repoburg 1.3.304 → 1.3.305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-pane/backend/dist/index.js +1646 -649
- package/agent-pane/backend/dist/server.js +1648 -651
- package/agent-pane/frontend/dist/assets/{TerminalView-BN_4GKd9.js → TerminalView-CWb7lwEQ.js} +1 -1
- package/agent-pane/frontend/dist/assets/index-B5j2jGP4.css +1 -0
- package/agent-pane/frontend/dist/assets/index-BhyGOapD.js +836 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/tabtape/extension/dist/build-info.json +3 -3
- package/tabtape/extension/dist/manifest.json +1 -1
- package/tabtape/ui/dist/build-info.json +3 -3
- package/agent-pane/frontend/dist/assets/index-CaUGqLNi.js +0 -836
- package/agent-pane/frontend/dist/assets/index-CuJZVIUh.css +0 -1
|
@@ -1,836 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-BN_4GKd9.js","assets/TerminalView-6GBZ9nXN.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var _0=Object.defineProperty;var R0=(t,n,r)=>n in t?_0(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r;var it=(t,n,r)=>R0(t,typeof n!="symbol"?n+"":n,r);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(a){if(a.ep)return;a.ep=!0;const c=r(a);fetch(a.href,c)}})();function qg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lu={exports:{}},mi={},Ou={exports:{}},He={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Fh;function A0(){if(Fh)return He;Fh=1;var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=k&&D[k]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function N(D,P,le){this.props=D,this.context=P,this.refs=b,this.updater=le||S}N.prototype.isReactComponent={},N.prototype.setState=function(D,P){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,P,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=N.prototype;function R(D,P,le){this.props=D,this.context=P,this.refs=b,this.updater=le||S}var z=R.prototype=new E;z.constructor=R,C(z,N.prototype),z.isPureReactComponent=!0;var I=Array.isArray,L=Object.prototype.hasOwnProperty,q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function $(D,P,le){var W,X={},ae=null,be=null;if(P!=null)for(W in P.ref!==void 0&&(be=P.ref),P.key!==void 0&&(ae=""+P.key),P)L.call(P,W)&&!K.hasOwnProperty(W)&&(X[W]=P[W]);var _e=arguments.length-2;if(_e===1)X.children=le;else if(1<_e){for(var Ae=Array(_e),je=0;je<_e;je++)Ae[je]=arguments[je+2];X.children=Ae}if(D&&D.defaultProps)for(W in _e=D.defaultProps,_e)X[W]===void 0&&(X[W]=_e[W]);return{$$typeof:t,type:D,key:ae,ref:be,props:X,_owner:q.current}}function Z(D,P){return{$$typeof:t,type:D.type,key:P,ref:D.ref,props:D.props,_owner:D._owner}}function he(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function ce(D){var P={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(le){return P[le]})}var ye=/\/+/g;function Se(D,P){return typeof D=="object"&&D!==null&&D.key!=null?ce(""+D.key):P.toString(36)}function Oe(D,P,le,W,X){var ae=typeof D;(ae==="undefined"||ae==="boolean")&&(D=null);var be=!1;if(D===null)be=!0;else switch(ae){case"string":case"number":be=!0;break;case"object":switch(D.$$typeof){case t:case n:be=!0}}if(be)return be=D,X=X(be),D=W===""?"."+Se(be,0):W,I(X)?(le="",D!=null&&(le=D.replace(ye,"$&/")+"/"),Oe(X,P,le,"",function(je){return je})):X!=null&&(he(X)&&(X=Z(X,le+(!X.key||be&&be.key===X.key?"":(""+X.key).replace(ye,"$&/")+"/")+D)),P.push(X)),1;if(be=0,W=W===""?".":W+":",I(D))for(var _e=0;_e<D.length;_e++){ae=D[_e];var Ae=W+Se(ae,_e);be+=Oe(ae,P,le,Ae,X)}else if(Ae=y(D),typeof Ae=="function")for(D=Ae.call(D),_e=0;!(ae=D.next()).done;)ae=ae.value,Ae=W+Se(ae,_e++),be+=Oe(ae,P,le,Ae,X);else if(ae==="object")throw P=String(D),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return be}function J(D,P,le){if(D==null)return D;var W=[],X=0;return Oe(D,W,"","",function(ae){return P.call(le,ae,X++)}),W}function re(D){if(D._status===-1){var P=D._result;P=P(),P.then(function(le){(D._status===0||D._status===-1)&&(D._status=1,D._result=le)},function(le){(D._status===0||D._status===-1)&&(D._status=2,D._result=le)}),D._status===-1&&(D._status=0,D._result=P)}if(D._status===1)return D._result.default;throw D._result}var oe={current:null},F={transition:null},Q={ReactCurrentDispatcher:oe,ReactCurrentBatchConfig:F,ReactCurrentOwner:q};function G(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:J,forEach:function(D,P,le){J(D,function(){P.apply(this,arguments)},le)},count:function(D){var P=0;return J(D,function(){P++}),P},toArray:function(D){return J(D,function(P){return P})||[]},only:function(D){if(!he(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},He.Component=N,He.Fragment=r,He.Profiler=a,He.PureComponent=R,He.StrictMode=o,He.Suspense=g,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,He.act=G,He.cloneElement=function(D,P,le){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var W=C({},D.props),X=D.key,ae=D.ref,be=D._owner;if(P!=null){if(P.ref!==void 0&&(ae=P.ref,be=q.current),P.key!==void 0&&(X=""+P.key),D.type&&D.type.defaultProps)var _e=D.type.defaultProps;for(Ae in P)L.call(P,Ae)&&!K.hasOwnProperty(Ae)&&(W[Ae]=P[Ae]===void 0&&_e!==void 0?_e[Ae]:P[Ae])}var Ae=arguments.length-2;if(Ae===1)W.children=le;else if(1<Ae){_e=Array(Ae);for(var je=0;je<Ae;je++)_e[je]=arguments[je+2];W.children=_e}return{$$typeof:t,type:D.type,key:X,ref:ae,props:W,_owner:be}},He.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:c,_context:D},D.Consumer=D},He.createElement=$,He.createFactory=function(D){var P=$.bind(null,D);return P.type=D,P},He.createRef=function(){return{current:null}},He.forwardRef=function(D){return{$$typeof:p,render:D}},He.isValidElement=he,He.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:re}},He.memo=function(D,P){return{$$typeof:m,type:D,compare:P===void 0?null:P}},He.startTransition=function(D){var P=F.transition;F.transition={};try{D()}finally{F.transition=P}},He.unstable_act=G,He.useCallback=function(D,P){return oe.current.useCallback(D,P)},He.useContext=function(D){return oe.current.useContext(D)},He.useDebugValue=function(){},He.useDeferredValue=function(D){return oe.current.useDeferredValue(D)},He.useEffect=function(D,P){return oe.current.useEffect(D,P)},He.useId=function(){return oe.current.useId()},He.useImperativeHandle=function(D,P,le){return oe.current.useImperativeHandle(D,P,le)},He.useInsertionEffect=function(D,P){return oe.current.useInsertionEffect(D,P)},He.useLayoutEffect=function(D,P){return oe.current.useLayoutEffect(D,P)},He.useMemo=function(D,P){return oe.current.useMemo(D,P)},He.useReducer=function(D,P,le){return oe.current.useReducer(D,P,le)},He.useRef=function(D){return oe.current.useRef(D)},He.useState=function(D){return oe.current.useState(D)},He.useSyncExternalStore=function(D,P,le){return oe.current.useSyncExternalStore(D,P,le)},He.useTransition=function(){return oe.current.useTransition()},He.version="18.3.1",He}var Uh;function zd(){return Uh||(Uh=1,Ou.exports=A0()),Ou.exports}/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Bh;function I0(){if(Bh)return mi;Bh=1;var t=zd(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(p,g,m){var v,k={},y=null,S=null;m!==void 0&&(y=""+m),g.key!==void 0&&(y=""+g.key),g.ref!==void 0&&(S=g.ref);for(v in g)o.call(g,v)&&!c.hasOwnProperty(v)&&(k[v]=g[v]);if(p&&p.defaultProps)for(v in g=p.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:n,type:p,key:y,ref:S,props:k,_owner:a.current}}return mi.Fragment=r,mi.jsx=d,mi.jsxs=d,mi}var Wh;function D0(){return Wh||(Wh=1,Lu.exports=I0()),Lu.exports}var l=D0(),x=zd();const ct=qg(x);var Ja={},Pu={exports:{}},In={},$u={exports:{}},zu={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Hh;function M0(){return Hh||(Hh=1,(function(t){function n(F,Q){var G=F.length;F.push(Q);e:for(;0<G;){var D=G-1>>>1,P=F[D];if(0<a(P,Q))F[D]=Q,F[G]=P,G=D;else break e}}function r(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var Q=F[0],G=F.pop();if(G!==Q){F[0]=G;e:for(var D=0,P=F.length,le=P>>>1;D<le;){var W=2*(D+1)-1,X=F[W],ae=W+1,be=F[ae];if(0>a(X,G))ae<P&&0>a(be,X)?(F[D]=be,F[ae]=G,D=ae):(F[D]=X,F[W]=G,D=W);else if(ae<P&&0>a(be,G))F[D]=be,F[ae]=G,D=ae;else break e}}return Q}function a(F,Q){var G=F.sortIndex-Q.sortIndex;return G!==0?G:F.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();t.unstable_now=function(){return d.now()-p}}var g=[],m=[],v=1,k=null,y=3,S=!1,C=!1,b=!1,N=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(F){for(var Q=r(m);Q!==null;){if(Q.callback===null)o(m);else if(Q.startTime<=F)o(m),Q.sortIndex=Q.expirationTime,n(g,Q);else break;Q=r(m)}}function I(F){if(b=!1,z(F),!C)if(r(g)!==null)C=!0,re(L);else{var Q=r(m);Q!==null&&oe(I,Q.startTime-F)}}function L(F,Q){C=!1,b&&(b=!1,E($),$=-1),S=!0;var G=y;try{for(z(Q),k=r(g);k!==null&&(!(k.expirationTime>Q)||F&&!ce());){var D=k.callback;if(typeof D=="function"){k.callback=null,y=k.priorityLevel;var P=D(k.expirationTime<=Q);Q=t.unstable_now(),typeof P=="function"?k.callback=P:k===r(g)&&o(g),z(Q)}else o(g);k=r(g)}if(k!==null)var le=!0;else{var W=r(m);W!==null&&oe(I,W.startTime-Q),le=!1}return le}finally{k=null,y=G,S=!1}}var q=!1,K=null,$=-1,Z=5,he=-1;function ce(){return!(t.unstable_now()-he<Z)}function ye(){if(K!==null){var F=t.unstable_now();he=F;var Q=!0;try{Q=K(!0,F)}finally{Q?Se():(q=!1,K=null)}}else q=!1}var Se;if(typeof R=="function")Se=function(){R(ye)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,J=Oe.port2;Oe.port1.onmessage=ye,Se=function(){J.postMessage(null)}}else Se=function(){N(ye,0)};function re(F){K=F,q||(q=!0,Se())}function oe(F,Q){$=N(function(){F(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){C||S||(C=!0,re(L))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_getFirstCallbackNode=function(){return r(g)},t.unstable_next=function(F){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var G=y;y=Q;try{return F()}finally{y=G}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,Q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=y;y=F;try{return Q()}finally{y=G}},t.unstable_scheduleCallback=function(F,Q,G){var D=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?D+G:D):G=D,F){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=G+P,F={id:v++,callback:Q,priorityLevel:F,startTime:G,expirationTime:P,sortIndex:-1},G>D?(F.sortIndex=G,n(m,F),r(g)===null&&F===r(m)&&(b?(E($),$=-1):b=!0,oe(I,G-D))):(F.sortIndex=P,n(g,F),C||S||(C=!0,re(L))),F},t.unstable_shouldYield=ce,t.unstable_wrapCallback=function(F){var Q=y;return function(){var G=y;y=Q;try{return F.apply(this,arguments)}finally{y=G}}}})(zu)),zu}var Vh;function L0(){return Vh||(Vh=1,$u.exports=M0()),$u.exports}/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.min.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Kh;function O0(){if(Kh)return In;Kh=1;var t=zd(),n=L0();function r(e){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function c(e,s){d(e,s),d(e+"Capture",s)}function d(e,s){for(a[e]=s,e=0;e<s.length;e++)o.add(s[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[: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]*$/,v={},k={};function y(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[e]=!0,!1)}function S(e,s,i,u){if(i!==null&&i.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return u?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,s,i,u){if(s===null||typeof s>"u"||S(e,s,i,u))return!0;if(u)return!1;if(i!==null)switch(i.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function b(e,s,i,u,f,h,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=s,this.sanitizeURL=h,this.removeEmptyString=w}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new b(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var s=e[0];N[s]=new b(s,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new b(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new b(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){N[e]=new b(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new b(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new b(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new b(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new b(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function R(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 s=e.replace(E,R);N[s]=new b(s,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var s=e.replace(E,R);N[s]=new b(s,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var s=e.replace(E,R);N[s]=new b(s,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new b(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new b(e,1,!1,e.toLowerCase(),null,!0,!0)});function z(e,s,i,u){var f=N.hasOwnProperty(s)?N[s]:null;(f!==null?f.type!==0:u||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(C(s,i,f,u)&&(i=null),u||f===null?y(s)&&(i===null?e.removeAttribute(s):e.setAttribute(s,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(s=f.attributeName,u=f.attributeNamespace,i===null?e.removeAttribute(s):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,u?e.setAttributeNS(u,s,i):e.setAttribute(s,i))))}var I=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),q=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),he=Symbol.for("react.provider"),ce=Symbol.for("react.context"),ye=Symbol.for("react.forward_ref"),Se=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),oe=Symbol.for("react.offscreen"),F=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,D;function P(e){if(D===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);D=s&&s[1]||""}return`
|
|
35
|
-
`+D+e}var le=!1;function W(e,s){if(!e||le)return"";le=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(V){var u=V}Reflect.construct(e,[],s)}else{try{s.call()}catch(V){u=V}e.call(s.prototype)}else{try{throw Error()}catch(V){u=V}e()}}catch(V){if(V&&u&&typeof V.stack=="string"){for(var f=V.stack.split(`
|
|
36
|
-
`),h=u.stack.split(`
|
|
37
|
-
`),w=f.length-1,j=h.length-1;1<=w&&0<=j&&f[w]!==h[j];)j--;for(;1<=w&&0<=j;w--,j--)if(f[w]!==h[j]){if(w!==1||j!==1)do if(w--,j--,0>j||f[w]!==h[j]){var M=`
|
|
38
|
-
`+f[w].replace(" at new "," at ");return e.displayName&&M.includes("<anonymous>")&&(M=M.replace("<anonymous>",e.displayName)),M}while(1<=w&&0<=j);break}}}finally{le=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?P(e):""}function X(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(e.type,!0),e;default:return""}}function ae(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 K:return"Fragment";case q:return"Portal";case Z:return"Profiler";case $:return"StrictMode";case Se:return"Suspense";case Oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case he:return(e._context.displayName||"Context")+".Provider";case ye:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return s=e.displayName||null,s!==null?s:ae(e.type)||"Memo";case re:s=e._payload,e=e._init;try{return ae(e(s))}catch{}}return null}function be(e){var s=e.type;switch(e.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=s.render,e=e.displayName||e.name||"",s.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(s);case 8:return s===$?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ae(e){var s=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function je(e){var s=Ae(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,s),u=""+e[s];if(!e.hasOwnProperty(s)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,h=i.set;return Object.defineProperty(e,s,{configurable:!0,get:function(){return f.call(this)},set:function(w){u=""+w,h.call(this,w)}}),Object.defineProperty(e,s,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(w){u=""+w},stopTracking:function(){e._valueTracker=null,delete e[s]}}}}function me(e){e._valueTracker||(e._valueTracker=je(e))}function pe(e){if(!e)return!1;var s=e._valueTracker;if(!s)return!0;var i=s.getValue(),u="";return e&&(u=Ae(e)?e.checked?"true":"false":e.value),e=u,e!==i?(s.setValue(e),!0):!1}function Ve(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 Ie(e,s){var i=s.checked;return G({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function mt(e,s){var i=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;i=_e(s.value!=null?s.value:i),e._wrapperState={initialChecked:u,initialValue:i,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Ue(e,s){s=s.checked,s!=null&&z(e,"checked",s,!1)}function Vt(e,s){Ue(e,s);var i=_e(s.value),u=s.type;if(i!=null)u==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}s.hasOwnProperty("value")?kt(e,s.type,i):s.hasOwnProperty("defaultValue")&&kt(e,s.type,_e(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(e.defaultChecked=!!s.defaultChecked)}function tn(e,s,i){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+e._wrapperState.initialValue,i||s===e.value||(e.value=s),e.defaultValue=s}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function kt(e,s,i){(s!=="number"||Ve(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var jt=Array.isArray;function Ft(e,s,i,u){if(e=e.options,s){s={};for(var f=0;f<i.length;f++)s["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=s.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&u&&(e[i].defaultSelected=!0)}else{for(i=""+_e(i),s=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,u&&(e[f].defaultSelected=!0);return}s!==null||e[f].disabled||(s=e[f])}s!==null&&(s.selected=!0)}}function Ot(e,s){if(s.dangerouslySetInnerHTML!=null)throw Error(r(91));return G({},s,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Y(e,s){var i=s.value;if(i==null){if(i=s.children,s=s.defaultValue,i!=null){if(s!=null)throw Error(r(92));if(jt(i)){if(1<i.length)throw Error(r(93));i=i[0]}s=i}s==null&&(s=""),i=s}e._wrapperState={initialValue:_e(i)}}function ge(e,s){var i=_e(s.value),u=_e(s.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),s.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),u!=null&&(e.defaultValue=""+u)}function Be(e){var s=e.textContent;s===e._wrapperState.initialValue&&s!==""&&s!==null&&(e.value=s)}function st(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gt(e,s){return e==null||e==="http://www.w3.org/1999/xhtml"?st(s):e==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vt,_t=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,i,u,f){MSApp.execUnsafeLocalFunction(function(){return e(s,i,u,f)})}:e})(function(e,s){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=s;else{for(vt=vt||document.createElement("div"),vt.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=vt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;s.firstChild;)e.appendChild(s.firstChild)}});function an(e,s){if(s){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=s;return}}e.textContent=s}var dt={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},Mn=["Webkit","ms","Moz","O"];Object.keys(dt).forEach(function(e){Mn.forEach(function(s){s=s+e.charAt(0).toUpperCase()+e.substring(1),dt[s]=dt[e]})});function Ln(e,s,i){return s==null||typeof s=="boolean"||s===""?"":i||typeof s!="number"||s===0||dt.hasOwnProperty(e)&&dt[e]?(""+s).trim():s+"px"}function hs(e,s){e=e.style;for(var i in s)if(s.hasOwnProperty(i)){var u=i.indexOf("--")===0,f=Ln(i,s[i],u);i==="float"&&(i="cssFloat"),u?e.setProperty(i,f):e[i]=f}}var ms=G({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 ns(e,s){if(s){if(ms[e]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function On(e,s){if(e.indexOf("-")===-1)return typeof s.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 gn=null;function ln(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kt=null,vn=null,Ze=null;function Rt(e){if(e=ei(e)){if(typeof Kt!="function")throw Error(r(280));var s=e.stateNode;s&&(s=ha(s),Kt(e.stateNode,e.type,s))}}function ft(e){vn?Ze?Ze.push(e):Ze=[e]:vn=e}function Gt(){if(vn){var e=vn,s=Ze;if(Ze=vn=null,Rt(e),s)for(e=0;e<s.length;e++)Rt(s[e])}}function yt(e,s){return e(s)}function xt(){}var lt=!1;function qt(e,s,i){if(lt)return e(s,i);lt=!0;try{return yt(e,s,i)}finally{lt=!1,(vn!==null||Ze!==null)&&(xt(),Gt())}}function ot(e,s){var i=e.stateNode;if(i===null)return null;var u=ha(i);if(u===null)return null;i=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,s,typeof i));return i}var Pt=!1;if(p)try{var _={};Object.defineProperty(_,"passive",{get:function(){Pt=!0}}),window.addEventListener("test",_,_),window.removeEventListener("test",_,_)}catch{Pt=!1}function fe(e,s,i,u,f,h,w,j,M){var V=Array.prototype.slice.call(arguments,3);try{s.apply(i,V)}catch(ne){this.onError(ne)}}var ie=!1,we=null,Pe=!1,qe=null,$e={onError:function(e){ie=!0,we=e}};function Ut(e,s,i,u,f,h,w,j,M){ie=!1,we=null,fe.apply($e,arguments)}function Pn(e,s,i,u,f,h,w,j,M){if(Ut.apply(this,arguments),ie){if(ie){var V=we;ie=!1,we=null}else throw Error(r(198));Pe||(Pe=!0,qe=V)}}function We(e){var s=e,i=e;if(e.alternate)for(;s.return;)s=s.return;else{e=s;do s=e,(s.flags&4098)!==0&&(i=s.return),e=s.return;while(e)}return s.tag===3?i:null}function yn(e){if(e.tag===13){var s=e.memoizedState;if(s===null&&(e=e.alternate,e!==null&&(s=e.memoizedState)),s!==null)return s.dehydrated}return null}function js(e){if(We(e)!==e)throw Error(r(188))}function Bs(e){var s=e.alternate;if(!s){if(s=We(e),s===null)throw Error(r(188));return s!==e?null:e}for(var i=e,u=s;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(u=f.return,u!==null){i=u;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return js(f),e;if(h===u)return js(f),s;h=h.sibling}throw Error(r(188))}if(i.return!==u.return)i=f,u=h;else{for(var w=!1,j=f.child;j;){if(j===i){w=!0,i=f,u=h;break}if(j===u){w=!0,u=f,i=h;break}j=j.sibling}if(!w){for(j=h.child;j;){if(j===i){w=!0,i=h,u=f;break}if(j===u){w=!0,u=h,i=f;break}j=j.sibling}if(!w)throw Error(r(189))}}if(i.alternate!==u)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:s}function $n(e){return e=Bs(e),e!==null?gs(e):null}function gs(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var s=gs(e);if(s!==null)return s;e=e.sibling}return null}var Je=n.unstable_scheduleCallback,At=n.unstable_cancelCallback,vs=n.unstable_shouldYield,ic=n.unstable_requestPaint,St=n.unstable_now,ys=n.unstable_getCurrentPriorityLevel,Ws=n.unstable_ImmediatePriority,xs=n.unstable_UserBlockingPriority,Wr=n.unstable_NormalPriority,vr=n.unstable_LowPriority,Yi=n.unstable_IdlePriority,yr=null,zn=null;function Hr(e){if(zn&&typeof zn.onCommitFiberRoot=="function")try{zn.onCommitFiberRoot(yr,e,void 0,(e.current.flags&128)===128)}catch{}}var xn=Math.clz32?Math.clz32:xr,Vr=Math.log,Hs=Math.LN2;function xr(e){return e>>>=0,e===0?32:31-(Vr(e)/Hs|0)|0}var wn=64,Kr=4194304;function wr(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 kr(e,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,h=e.pingedLanes,w=i&268435455;if(w!==0){var j=w&~f;j!==0?u=wr(j):(h&=w,h!==0&&(u=wr(h)))}else w=i&~f,w!==0?u=wr(w):h!==0&&(u=wr(h));if(u===0)return 0;if(s!==0&&s!==u&&(s&f)===0&&(f=u&-u,h=s&-s,f>=h||f===16&&(h&4194240)!==0))return s;if((u&4)!==0&&(u|=i&16),s=e.entangledLanes,s!==0)for(e=e.entanglements,s&=u;0<s;)i=31-xn(s),f=1<<i,u|=e[i],s&=~f;return u}function Qi(e,s){switch(e){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zi(e,s){for(var i=e.suspendedLanes,u=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes;0<h;){var w=31-xn(h),j=1<<w,M=f[w];M===-1?((j&i)===0||(j&u)!==0)&&(f[w]=Qi(j,s)):M<=s&&(e.expiredLanes|=j),h&=~j}}function Po(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $o(){var e=wn;return wn<<=1,(wn&4194240)===0&&(wn=64),e}function zo(e){for(var s=[],i=0;31>i;i++)s.push(e);return s}function Sr(e,s,i){e.pendingLanes|=s,s!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,s=31-xn(s),e[s]=i}function Ji(e,s){var i=e.pendingLanes&~s;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=s,e.mutableReadLanes&=s,e.entangledLanes&=s,s=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-xn(i),h=1<<f;s[f]=0,u[f]=-1,e[f]=-1,i&=~h}}function Vs(e,s){var i=e.entangledLanes|=s;for(e=e.entanglements;i;){var u=31-xn(i),f=1<<u;f&s|e[u]&s&&(e[u]|=s),i&=~f}}var Xe=0;function ue(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var T,U,ee,Te,Re,Fe=!1,Ye=[],et=null,bt=null,Nt=null,_s=new Map,Dt=new Map,Ks=[],Qy="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function bf(e,s){switch(e){case"focusin":case"focusout":et=null;break;case"dragenter":case"dragleave":bt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":_s.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.delete(s.pointerId)}}function Fo(e,s,i,u,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:s,domEventName:i,eventSystemFlags:u,nativeEvent:h,targetContainers:[f]},s!==null&&(s=ei(s),s!==null&&U(s)),e):(e.eventSystemFlags|=u,s=e.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),e)}function Zy(e,s,i,u,f){switch(s){case"focusin":return et=Fo(et,e,s,i,u,f),!0;case"dragenter":return bt=Fo(bt,e,s,i,u,f),!0;case"mouseover":return Nt=Fo(Nt,e,s,i,u,f),!0;case"pointerover":var h=f.pointerId;return _s.set(h,Fo(_s.get(h)||null,e,s,i,u,f)),!0;case"gotpointercapture":return h=f.pointerId,Dt.set(h,Fo(Dt.get(h)||null,e,s,i,u,f)),!0}return!1}function Nf(e){var s=br(e.target);if(s!==null){var i=We(s);if(i!==null){if(s=i.tag,s===13){if(s=yn(i),s!==null){e.blockedOn=s,Re(e.priority,function(){ee(i)});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ea(e){if(e.blockedOn!==null)return!1;for(var s=e.targetContainers;0<s.length;){var i=lc(e.domEventName,e.eventSystemFlags,s[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var u=new i.constructor(i.type,i);gn=u,i.target.dispatchEvent(u),gn=null}else return s=ei(i),s!==null&&U(s),e.blockedOn=i,!1;s.shift()}return!0}function Tf(e,s,i){ea(e)&&i.delete(s)}function Jy(){Fe=!1,et!==null&&ea(et)&&(et=null),bt!==null&&ea(bt)&&(bt=null),Nt!==null&&ea(Nt)&&(Nt=null),_s.forEach(Tf),Dt.forEach(Tf)}function Uo(e,s){e.blockedOn===s&&(e.blockedOn=null,Fe||(Fe=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Jy)))}function Bo(e){function s(f){return Uo(f,e)}if(0<Ye.length){Uo(Ye[0],e);for(var i=1;i<Ye.length;i++){var u=Ye[i];u.blockedOn===e&&(u.blockedOn=null)}}for(et!==null&&Uo(et,e),bt!==null&&Uo(bt,e),Nt!==null&&Uo(Nt,e),_s.forEach(s),Dt.forEach(s),i=0;i<Ks.length;i++)u=Ks[i],u.blockedOn===e&&(u.blockedOn=null);for(;0<Ks.length&&(i=Ks[0],i.blockedOn===null);)Nf(i),i.blockedOn===null&&Ks.shift()}var Gr=I.ReactCurrentBatchConfig,ta=!0;function ex(e,s,i,u){var f=Xe,h=Gr.transition;Gr.transition=null;try{Xe=1,ac(e,s,i,u)}finally{Xe=f,Gr.transition=h}}function tx(e,s,i,u){var f=Xe,h=Gr.transition;Gr.transition=null;try{Xe=4,ac(e,s,i,u)}finally{Xe=f,Gr.transition=h}}function ac(e,s,i,u){if(ta){var f=lc(e,s,i,u);if(f===null)Tc(e,s,u,na,i),bf(e,u);else if(Zy(f,e,s,i,u))u.stopPropagation();else if(bf(e,u),s&4&&-1<Qy.indexOf(e)){for(;f!==null;){var h=ei(f);if(h!==null&&T(h),h=lc(e,s,i,u),h===null&&Tc(e,s,u,na,i),h===f)break;f=h}f!==null&&u.stopPropagation()}else Tc(e,s,u,null,i)}}var na=null;function lc(e,s,i,u){if(na=null,e=ln(u),e=br(e),e!==null)if(s=We(e),s===null)e=null;else if(i=s.tag,i===13){if(e=yn(s),e!==null)return e;e=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;e=null}else s!==e&&(e=null);return na=e,null}function Cf(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ys()){case Ws:return 1;case xs:return 4;case Wr:case vr:return 16;case Yi:return 536870912;default:return 16}default:return 16}}var Gs=null,cc=null,sa=null;function Ef(){if(sa)return sa;var e,s=cc,i=s.length,u,f="value"in Gs?Gs.value:Gs.textContent,h=f.length;for(e=0;e<i&&s[e]===f[e];e++);var w=i-e;for(u=1;u<=w&&s[i-u]===f[h-u];u++);return sa=f.slice(e,1<u?1-u:void 0)}function ra(e){var s=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&s===13&&(e=13)):e=s,e===10&&(e=13),32<=e||e===13?e:0}function oa(){return!0}function jf(){return!1}function Fn(e){function s(i,u,f,h,w){this._reactName=i,this._targetInst=f,this.type=u,this.nativeEvent=h,this.target=w,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(h):h[j]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?oa:jf,this.isPropagationStopped=jf,this}return G(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=oa)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=oa)},persist:function(){},isPersistent:oa}),s}var qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uc=Fn(qr),Wo=G({},qr,{view:0,detail:0}),nx=Fn(Wo),dc,fc,Ho,ia=G({},Wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ho&&(Ho&&e.type==="mousemove"?(dc=e.screenX-Ho.screenX,fc=e.screenY-Ho.screenY):fc=dc=0,Ho=e),dc)},movementY:function(e){return"movementY"in e?e.movementY:fc}}),_f=Fn(ia),sx=G({},ia,{dataTransfer:0}),rx=Fn(sx),ox=G({},Wo,{relatedTarget:0}),pc=Fn(ox),ix=G({},qr,{animationName:0,elapsedTime:0,pseudoElement:0}),ax=Fn(ix),lx=G({},qr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cx=Fn(lx),ux=G({},qr,{data:0}),Rf=Fn(ux),dx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hx(e){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(e):(e=px[e])?!!s[e]:!1}function hc(){return hx}var mx=G({},Wo,{key:function(e){if(e.key){var s=dx[e.key]||e.key;if(s!=="Unidentified")return s}return e.type==="keypress"?(e=ra(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hc,charCode:function(e){return e.type==="keypress"?ra(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ra(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gx=Fn(mx),vx=G({},ia,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Af=Fn(vx),yx=G({},Wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hc}),xx=Fn(yx),wx=G({},qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),kx=Fn(wx),Sx=G({},ia,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),bx=Fn(Sx),Nx=[9,13,27,32],mc=p&&"CompositionEvent"in window,Vo=null;p&&"documentMode"in document&&(Vo=document.documentMode);var Tx=p&&"TextEvent"in window&&!Vo,If=p&&(!mc||Vo&&8<Vo&&11>=Vo),Df=" ",Mf=!1;function Lf(e,s){switch(e){case"keyup":return Nx.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Of(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function Cx(e,s){switch(e){case"compositionend":return Of(s);case"keypress":return s.which!==32?null:(Mf=!0,Df);case"textInput":return e=s.data,e===Df&&Mf?null:e;default:return null}}function Ex(e,s){if(Xr)return e==="compositionend"||!mc&&Lf(e,s)?(e=Ef(),sa=cc=Gs=null,Xr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return If&&s.locale!=="ko"?null:s.data;default:return null}}var jx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pf(e){var s=e&&e.nodeName&&e.nodeName.toLowerCase();return s==="input"?!!jx[e.type]:s==="textarea"}function $f(e,s,i,u){ft(u),s=da(s,"onChange"),0<s.length&&(i=new uc("onChange","change",null,i,u),e.push({event:i,listeners:s}))}var Ko=null,Go=null;function _x(e){np(e,0)}function aa(e){var s=eo(e);if(pe(s))return e}function Rx(e,s){if(e==="change")return s}var zf=!1;if(p){var gc;if(p){var vc="oninput"in document;if(!vc){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),vc=typeof Ff.oninput=="function"}gc=vc}else gc=!1;zf=gc&&(!document.documentMode||9<document.documentMode)}function Uf(){Ko&&(Ko.detachEvent("onpropertychange",Bf),Go=Ko=null)}function Bf(e){if(e.propertyName==="value"&&aa(Go)){var s=[];$f(s,Go,e,ln(e)),qt(_x,s)}}function Ax(e,s,i){e==="focusin"?(Uf(),Ko=s,Go=i,Ko.attachEvent("onpropertychange",Bf)):e==="focusout"&&Uf()}function Ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return aa(Go)}function Dx(e,s){if(e==="click")return aa(s)}function Mx(e,s){if(e==="input"||e==="change")return aa(s)}function Lx(e,s){return e===s&&(e!==0||1/e===1/s)||e!==e&&s!==s}var ss=typeof Object.is=="function"?Object.is:Lx;function qo(e,s){if(ss(e,s))return!0;if(typeof e!="object"||e===null||typeof s!="object"||s===null)return!1;var i=Object.keys(e),u=Object.keys(s);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var f=i[u];if(!g.call(s,f)||!ss(e[f],s[f]))return!1}return!0}function Wf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hf(e,s){var i=Wf(e);e=0;for(var u;i;){if(i.nodeType===3){if(u=e+i.textContent.length,e<=s&&u>=s)return{node:i,offset:s-e};e=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wf(i)}}function Vf(e,s){return e&&s?e===s?!0:e&&e.nodeType===3?!1:s&&s.nodeType===3?Vf(e,s.parentNode):"contains"in e?e.contains(s):e.compareDocumentPosition?!!(e.compareDocumentPosition(s)&16):!1:!1}function Kf(){for(var e=window,s=Ve();s instanceof e.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)e=s.contentWindow;else break;s=Ve(e.document)}return s}function yc(e){var s=e&&e.nodeName&&e.nodeName.toLowerCase();return s&&(s==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||s==="textarea"||e.contentEditable==="true")}function Ox(e){var s=Kf(),i=e.focusedElem,u=e.selectionRange;if(s!==i&&i&&i.ownerDocument&&Vf(i.ownerDocument.documentElement,i)){if(u!==null&&yc(i)){if(s=u.start,e=u.end,e===void 0&&(e=s),"selectionStart"in i)i.selectionStart=s,i.selectionEnd=Math.min(e,i.value.length);else if(e=(s=i.ownerDocument||document)&&s.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,h=Math.min(u.start,f);u=u.end===void 0?h:Math.min(u.end,f),!e.extend&&h>u&&(f=u,u=h,h=f),f=Hf(i,h);var w=Hf(i,u);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),e.removeAllRanges(),h>u?(e.addRange(s),e.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),e.addRange(s)))}}for(s=[],e=i;e=e.parentNode;)e.nodeType===1&&s.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<s.length;i++)e=s[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Px=p&&"documentMode"in document&&11>=document.documentMode,Yr=null,xc=null,Xo=null,wc=!1;function Gf(e,s,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;wc||Yr==null||Yr!==Ve(u)||(u=Yr,"selectionStart"in u&&yc(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Xo&&qo(Xo,u)||(Xo=u,u=da(xc,"onSelect"),0<u.length&&(s=new uc("onSelect","select",null,s,i),e.push({event:s,listeners:u}),s.target=Yr)))}function la(e,s){var i={};return i[e.toLowerCase()]=s.toLowerCase(),i["Webkit"+e]="webkit"+s,i["Moz"+e]="moz"+s,i}var Qr={animationend:la("Animation","AnimationEnd"),animationiteration:la("Animation","AnimationIteration"),animationstart:la("Animation","AnimationStart"),transitionend:la("Transition","TransitionEnd")},kc={},qf={};p&&(qf=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function ca(e){if(kc[e])return kc[e];if(!Qr[e])return e;var s=Qr[e],i;for(i in s)if(s.hasOwnProperty(i)&&i in qf)return kc[e]=s[i];return e}var Xf=ca("animationend"),Yf=ca("animationiteration"),Qf=ca("animationstart"),Zf=ca("transitionend"),Jf=new Map,ep="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function qs(e,s){Jf.set(e,s),c(s,[e])}for(var Sc=0;Sc<ep.length;Sc++){var bc=ep[Sc],$x=bc.toLowerCase(),zx=bc[0].toUpperCase()+bc.slice(1);qs($x,"on"+zx)}qs(Xf,"onAnimationEnd"),qs(Yf,"onAnimationIteration"),qs(Qf,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs(Zf,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yo));function tp(e,s,i){var u=e.type||"unknown-event";e.currentTarget=i,Pn(u,s,void 0,e),e.currentTarget=null}function np(e,s){s=(s&4)!==0;for(var i=0;i<e.length;i++){var u=e[i],f=u.event;u=u.listeners;e:{var h=void 0;if(s)for(var w=u.length-1;0<=w;w--){var j=u[w],M=j.instance,V=j.currentTarget;if(j=j.listener,M!==h&&f.isPropagationStopped())break e;tp(f,j,V),h=M}else for(w=0;w<u.length;w++){if(j=u[w],M=j.instance,V=j.currentTarget,j=j.listener,M!==h&&f.isPropagationStopped())break e;tp(f,j,V),h=M}}}if(Pe)throw e=qe,Pe=!1,qe=null,e}function pt(e,s){var i=s[Ac];i===void 0&&(i=s[Ac]=new Set);var u=e+"__bubble";i.has(u)||(sp(s,e,2,!1),i.add(u))}function Nc(e,s,i){var u=0;s&&(u|=4),sp(i,e,u,s)}var ua="_reactListening"+Math.random().toString(36).slice(2);function Qo(e){if(!e[ua]){e[ua]=!0,o.forEach(function(i){i!=="selectionchange"&&(Fx.has(i)||Nc(i,!1,e),Nc(i,!0,e))});var s=e.nodeType===9?e:e.ownerDocument;s===null||s[ua]||(s[ua]=!0,Nc("selectionchange",!1,s))}}function sp(e,s,i,u){switch(Cf(s)){case 1:var f=ex;break;case 4:f=tx;break;default:f=ac}i=f.bind(null,s,i,e),f=void 0,!Pt||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?f!==void 0?e.addEventListener(s,i,{capture:!0,passive:f}):e.addEventListener(s,i,!0):f!==void 0?e.addEventListener(s,i,{passive:f}):e.addEventListener(s,i,!1)}function Tc(e,s,i,u,f){var h=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var j=u.stateNode.containerInfo;if(j===f||j.nodeType===8&&j.parentNode===f)break;if(w===4)for(w=u.return;w!==null;){var M=w.tag;if((M===3||M===4)&&(M=w.stateNode.containerInfo,M===f||M.nodeType===8&&M.parentNode===f))return;w=w.return}for(;j!==null;){if(w=br(j),w===null)return;if(M=w.tag,M===5||M===6){u=h=w;continue e}j=j.parentNode}}u=u.return}qt(function(){var V=h,ne=ln(i),se=[];e:{var te=Jf.get(e);if(te!==void 0){var xe=uc,Ne=e;switch(e){case"keypress":if(ra(i)===0)break e;case"keydown":case"keyup":xe=gx;break;case"focusin":Ne="focus",xe=pc;break;case"focusout":Ne="blur",xe=pc;break;case"beforeblur":case"afterblur":xe=pc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=_f;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=xx;break;case Xf:case Yf:case Qf:xe=ax;break;case Zf:xe=kx;break;case"scroll":xe=nx;break;case"wheel":xe=bx;break;case"copy":case"cut":case"paste":xe=cx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Af}var Ce=(s&4)!==0,Mt=!Ce&&e==="scroll",B=Ce?te!==null?te+"Capture":null:te;Ce=[];for(var O=V,H;O!==null;){H=O;var de=H.stateNode;if(H.tag===5&&de!==null&&(H=de,B!==null&&(de=ot(O,B),de!=null&&Ce.push(Zo(O,de,H)))),Mt)break;O=O.return}0<Ce.length&&(te=new xe(te,Ne,null,i,ne),se.push({event:te,listeners:Ce}))}}if((s&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",xe=e==="mouseout"||e==="pointerout",te&&i!==gn&&(Ne=i.relatedTarget||i.fromElement)&&(br(Ne)||Ne[Rs]))break e;if((xe||te)&&(te=ne.window===ne?ne:(te=ne.ownerDocument)?te.defaultView||te.parentWindow:window,xe?(Ne=i.relatedTarget||i.toElement,xe=V,Ne=Ne?br(Ne):null,Ne!==null&&(Mt=We(Ne),Ne!==Mt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(xe=null,Ne=V),xe!==Ne)){if(Ce=_f,de="onMouseLeave",B="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Af,de="onPointerLeave",B="onPointerEnter",O="pointer"),Mt=xe==null?te:eo(xe),H=Ne==null?te:eo(Ne),te=new Ce(de,O+"leave",xe,i,ne),te.target=Mt,te.relatedTarget=H,de=null,br(ne)===V&&(Ce=new Ce(B,O+"enter",Ne,i,ne),Ce.target=H,Ce.relatedTarget=Mt,de=Ce),Mt=de,xe&&Ne)t:{for(Ce=xe,B=Ne,O=0,H=Ce;H;H=Zr(H))O++;for(H=0,de=B;de;de=Zr(de))H++;for(;0<O-H;)Ce=Zr(Ce),O--;for(;0<H-O;)B=Zr(B),H--;for(;O--;){if(Ce===B||B!==null&&Ce===B.alternate)break t;Ce=Zr(Ce),B=Zr(B)}Ce=null}else Ce=null;xe!==null&&rp(se,te,xe,Ce,!1),Ne!==null&&Mt!==null&&rp(se,Mt,Ne,Ce,!0)}}e:{if(te=V?eo(V):window,xe=te.nodeName&&te.nodeName.toLowerCase(),xe==="select"||xe==="input"&&te.type==="file")var Ee=Rx;else if(Pf(te))if(zf)Ee=Mx;else{Ee=Ix;var Me=Ax}else(xe=te.nodeName)&&xe.toLowerCase()==="input"&&(te.type==="checkbox"||te.type==="radio")&&(Ee=Dx);if(Ee&&(Ee=Ee(e,V))){$f(se,Ee,i,ne);break e}Me&&Me(e,te,V),e==="focusout"&&(Me=te._wrapperState)&&Me.controlled&&te.type==="number"&&kt(te,"number",te.value)}switch(Me=V?eo(V):window,e){case"focusin":(Pf(Me)||Me.contentEditable==="true")&&(Yr=Me,xc=V,Xo=null);break;case"focusout":Xo=xc=Yr=null;break;case"mousedown":wc=!0;break;case"contextmenu":case"mouseup":case"dragend":wc=!1,Gf(se,i,ne);break;case"selectionchange":if(Px)break;case"keydown":case"keyup":Gf(se,i,ne)}var Le;if(mc)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Xr?Lf(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(If&&i.locale!=="ko"&&(Xr||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Xr&&(Le=Ef()):(Gs=ne,cc="value"in Gs?Gs.value:Gs.textContent,Xr=!0)),Me=da(V,ze),0<Me.length&&(ze=new Rf(ze,e,null,i,ne),se.push({event:ze,listeners:Me}),Le?ze.data=Le:(Le=Of(i),Le!==null&&(ze.data=Le)))),(Le=Tx?Cx(e,i):Ex(e,i))&&(V=da(V,"onBeforeInput"),0<V.length&&(ne=new Rf("onBeforeInput","beforeinput",null,i,ne),se.push({event:ne,listeners:V}),ne.data=Le))}np(se,s)})}function Zo(e,s,i){return{instance:e,listener:s,currentTarget:i}}function da(e,s){for(var i=s+"Capture",u=[];e!==null;){var f=e,h=f.stateNode;f.tag===5&&h!==null&&(f=h,h=ot(e,i),h!=null&&u.unshift(Zo(e,h,f)),h=ot(e,s),h!=null&&u.push(Zo(e,h,f))),e=e.return}return u}function Zr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rp(e,s,i,u,f){for(var h=s._reactName,w=[];i!==null&&i!==u;){var j=i,M=j.alternate,V=j.stateNode;if(M!==null&&M===u)break;j.tag===5&&V!==null&&(j=V,f?(M=ot(i,h),M!=null&&w.unshift(Zo(i,M,j))):f||(M=ot(i,h),M!=null&&w.push(Zo(i,M,j)))),i=i.return}w.length!==0&&e.push({event:s,listeners:w})}var Ux=/\r\n?/g,Bx=/\u0000|\uFFFD/g;function op(e){return(typeof e=="string"?e:""+e).replace(Ux,`
|
|
39
|
-
`).replace(Bx,"")}function fa(e,s,i){if(s=op(s),op(e)!==s&&i)throw Error(r(425))}function pa(){}var Cc=null,Ec=null;function jc(e,s){return e==="textarea"||e==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var _c=typeof setTimeout=="function"?setTimeout:void 0,Wx=typeof clearTimeout=="function"?clearTimeout:void 0,ip=typeof Promise=="function"?Promise:void 0,Hx=typeof queueMicrotask=="function"?queueMicrotask:typeof ip<"u"?function(e){return ip.resolve(null).then(e).catch(Vx)}:_c;function Vx(e){setTimeout(function(){throw e})}function Rc(e,s){var i=s,u=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(u===0){e.removeChild(f),Bo(s);return}u--}else i!=="$"&&i!=="$?"&&i!=="$!"||u++;i=f}while(i);Bo(s)}function Xs(e){for(;e!=null;e=e.nextSibling){var s=e.nodeType;if(s===1||s===3)break;if(s===8){if(s=e.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return e}function ap(e){e=e.previousSibling;for(var s=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(s===0)return e;s--}else i==="/$"&&s++}e=e.previousSibling}return null}var Jr=Math.random().toString(36).slice(2),ws="__reactFiber$"+Jr,Jo="__reactProps$"+Jr,Rs="__reactContainer$"+Jr,Ac="__reactEvents$"+Jr,Kx="__reactListeners$"+Jr,Gx="__reactHandles$"+Jr;function br(e){var s=e[ws];if(s)return s;for(var i=e.parentNode;i;){if(s=i[Rs]||i[ws]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(e=ap(e);e!==null;){if(i=e[ws])return i;e=ap(e)}return s}e=i,i=e.parentNode}return null}function ei(e){return e=e[ws]||e[Rs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function eo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ha(e){return e[Jo]||null}var Ic=[],to=-1;function Ys(e){return{current:e}}function ht(e){0>to||(e.current=Ic[to],Ic[to]=null,to--)}function ut(e,s){to++,Ic[to]=e.current,e.current=s}var Qs={},cn=Ys(Qs),En=Ys(!1),Nr=Qs;function no(e,s){var i=e.type.contextTypes;if(!i)return Qs;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var f={},h;for(h in i)f[h]=s[h];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=f),f}function jn(e){return e=e.childContextTypes,e!=null}function ma(){ht(En),ht(cn)}function lp(e,s,i){if(cn.current!==Qs)throw Error(r(168));ut(cn,s),ut(En,i)}function cp(e,s,i){var u=e.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return i;u=u.getChildContext();for(var f in u)if(!(f in s))throw Error(r(108,be(e)||"Unknown",f));return G({},i,u)}function ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qs,Nr=cn.current,ut(cn,e),ut(En,En.current),!0}function up(e,s,i){var u=e.stateNode;if(!u)throw Error(r(169));i?(e=cp(e,s,Nr),u.__reactInternalMemoizedMergedChildContext=e,ht(En),ht(cn),ut(cn,e)):ht(En),ut(En,i)}var As=null,va=!1,Dc=!1;function dp(e){As===null?As=[e]:As.push(e)}function qx(e){va=!0,dp(e)}function Zs(){if(!Dc&&As!==null){Dc=!0;var e=0,s=Xe;try{var i=As;for(Xe=1;e<i.length;e++){var u=i[e];do u=u(!0);while(u!==null)}As=null,va=!1}catch(f){throw As!==null&&(As=As.slice(e+1)),Je(Ws,Zs),f}finally{Xe=s,Dc=!1}}return null}var so=[],ro=0,ya=null,xa=0,Gn=[],qn=0,Tr=null,Is=1,Ds="";function Cr(e,s){so[ro++]=xa,so[ro++]=ya,ya=e,xa=s}function fp(e,s,i){Gn[qn++]=Is,Gn[qn++]=Ds,Gn[qn++]=Tr,Tr=e;var u=Is;e=Ds;var f=32-xn(u)-1;u&=~(1<<f),i+=1;var h=32-xn(s)+f;if(30<h){var w=f-f%5;h=(u&(1<<w)-1).toString(32),u>>=w,f-=w,Is=1<<32-xn(s)+f|i<<f|u,Ds=h+e}else Is=1<<h|i<<f|u,Ds=e}function Mc(e){e.return!==null&&(Cr(e,1),fp(e,1,0))}function Lc(e){for(;e===ya;)ya=so[--ro],so[ro]=null,xa=so[--ro],so[ro]=null;for(;e===Tr;)Tr=Gn[--qn],Gn[qn]=null,Ds=Gn[--qn],Gn[qn]=null,Is=Gn[--qn],Gn[qn]=null}var Un=null,Bn=null,wt=!1,rs=null;function pp(e,s){var i=Zn(5,null,null,0);i.elementType="DELETED",i.stateNode=s,i.return=e,s=e.deletions,s===null?(e.deletions=[i],e.flags|=16):s.push(i)}function hp(e,s){switch(e.tag){case 5:var i=e.type;return s=s.nodeType!==1||i.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(e.stateNode=s,Un=e,Bn=Xs(s.firstChild),!0):!1;case 6:return s=e.pendingProps===""||s.nodeType!==3?null:s,s!==null?(e.stateNode=s,Un=e,Bn=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(i=Tr!==null?{id:Is,overflow:Ds}:null,e.memoizedState={dehydrated:s,treeContext:i,retryLane:1073741824},i=Zn(18,null,null,0),i.stateNode=s,i.return=e,e.child=i,Un=e,Bn=null,!0):!1;default:return!1}}function Oc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pc(e){if(wt){var s=Bn;if(s){var i=s;if(!hp(e,s)){if(Oc(e))throw Error(r(418));s=Xs(i.nextSibling);var u=Un;s&&hp(e,s)?pp(u,i):(e.flags=e.flags&-4097|2,wt=!1,Un=e)}}else{if(Oc(e))throw Error(r(418));e.flags=e.flags&-4097|2,wt=!1,Un=e}}}function mp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Un=e}function wa(e){if(e!==Un)return!1;if(!wt)return mp(e),wt=!0,!1;var s;if((s=e.tag!==3)&&!(s=e.tag!==5)&&(s=e.type,s=s!=="head"&&s!=="body"&&!jc(e.type,e.memoizedProps)),s&&(s=Bn)){if(Oc(e))throw gp(),Error(r(418));for(;s;)pp(e,s),s=Xs(s.nextSibling)}if(mp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,s=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(s===0){Bn=Xs(e.nextSibling);break e}s--}else i!=="$"&&i!=="$!"&&i!=="$?"||s++}e=e.nextSibling}Bn=null}}else Bn=Un?Xs(e.stateNode.nextSibling):null;return!0}function gp(){for(var e=Bn;e;)e=Xs(e.nextSibling)}function oo(){Bn=Un=null,wt=!1}function $c(e){rs===null?rs=[e]:rs.push(e)}var Xx=I.ReactCurrentBatchConfig;function ti(e,s,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(r(309));var u=i.stateNode}if(!u)throw Error(r(147,e));var f=u,h=""+e;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===h?s.ref:(s=function(w){var j=f.refs;w===null?delete j[h]:j[h]=w},s._stringRef=h,s)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function ka(e,s){throw e=Object.prototype.toString.call(s),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":e))}function vp(e){var s=e._init;return s(e._payload)}function yp(e){function s(B,O){if(e){var H=B.deletions;H===null?(B.deletions=[O],B.flags|=16):H.push(O)}}function i(B,O){if(!e)return null;for(;O!==null;)s(B,O),O=O.sibling;return null}function u(B,O){for(B=new Map;O!==null;)O.key!==null?B.set(O.key,O):B.set(O.index,O),O=O.sibling;return B}function f(B,O){return B=ir(B,O),B.index=0,B.sibling=null,B}function h(B,O,H){return B.index=H,e?(H=B.alternate,H!==null?(H=H.index,H<O?(B.flags|=2,O):H):(B.flags|=2,O)):(B.flags|=1048576,O)}function w(B){return e&&B.alternate===null&&(B.flags|=2),B}function j(B,O,H,de){return O===null||O.tag!==6?(O=_u(H,B.mode,de),O.return=B,O):(O=f(O,H),O.return=B,O)}function M(B,O,H,de){var Ee=H.type;return Ee===K?ne(B,O,H.props.children,de,H.key):O!==null&&(O.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===re&&vp(Ee)===O.type)?(de=f(O,H.props),de.ref=ti(B,O,H),de.return=B,de):(de=Va(H.type,H.key,H.props,null,B.mode,de),de.ref=ti(B,O,H),de.return=B,de)}function V(B,O,H,de){return O===null||O.tag!==4||O.stateNode.containerInfo!==H.containerInfo||O.stateNode.implementation!==H.implementation?(O=Ru(H,B.mode,de),O.return=B,O):(O=f(O,H.children||[]),O.return=B,O)}function ne(B,O,H,de,Ee){return O===null||O.tag!==7?(O=Mr(H,B.mode,de,Ee),O.return=B,O):(O=f(O,H),O.return=B,O)}function se(B,O,H){if(typeof O=="string"&&O!==""||typeof O=="number")return O=_u(""+O,B.mode,H),O.return=B,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case L:return H=Va(O.type,O.key,O.props,null,B.mode,H),H.ref=ti(B,null,O),H.return=B,H;case q:return O=Ru(O,B.mode,H),O.return=B,O;case re:var de=O._init;return se(B,de(O._payload),H)}if(jt(O)||Q(O))return O=Mr(O,B.mode,H,null),O.return=B,O;ka(B,O)}return null}function te(B,O,H,de){var Ee=O!==null?O.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ee!==null?null:j(B,O,""+H,de);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case L:return H.key===Ee?M(B,O,H,de):null;case q:return H.key===Ee?V(B,O,H,de):null;case re:return Ee=H._init,te(B,O,Ee(H._payload),de)}if(jt(H)||Q(H))return Ee!==null?null:ne(B,O,H,de,null);ka(B,H)}return null}function xe(B,O,H,de,Ee){if(typeof de=="string"&&de!==""||typeof de=="number")return B=B.get(H)||null,j(O,B,""+de,Ee);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case L:return B=B.get(de.key===null?H:de.key)||null,M(O,B,de,Ee);case q:return B=B.get(de.key===null?H:de.key)||null,V(O,B,de,Ee);case re:var Me=de._init;return xe(B,O,H,Me(de._payload),Ee)}if(jt(de)||Q(de))return B=B.get(H)||null,ne(O,B,de,Ee,null);ka(O,de)}return null}function Ne(B,O,H,de){for(var Ee=null,Me=null,Le=O,ze=O=0,Qt=null;Le!==null&&ze<H.length;ze++){Le.index>ze?(Qt=Le,Le=null):Qt=Le.sibling;var tt=te(B,Le,H[ze],de);if(tt===null){Le===null&&(Le=Qt);break}e&&Le&&tt.alternate===null&&s(B,Le),O=h(tt,O,ze),Me===null?Ee=tt:Me.sibling=tt,Me=tt,Le=Qt}if(ze===H.length)return i(B,Le),wt&&Cr(B,ze),Ee;if(Le===null){for(;ze<H.length;ze++)Le=se(B,H[ze],de),Le!==null&&(O=h(Le,O,ze),Me===null?Ee=Le:Me.sibling=Le,Me=Le);return wt&&Cr(B,ze),Ee}for(Le=u(B,Le);ze<H.length;ze++)Qt=xe(Le,B,ze,H[ze],de),Qt!==null&&(e&&Qt.alternate!==null&&Le.delete(Qt.key===null?ze:Qt.key),O=h(Qt,O,ze),Me===null?Ee=Qt:Me.sibling=Qt,Me=Qt);return e&&Le.forEach(function(ar){return s(B,ar)}),wt&&Cr(B,ze),Ee}function Ce(B,O,H,de){var Ee=Q(H);if(typeof Ee!="function")throw Error(r(150));if(H=Ee.call(H),H==null)throw Error(r(151));for(var Me=Ee=null,Le=O,ze=O=0,Qt=null,tt=H.next();Le!==null&&!tt.done;ze++,tt=H.next()){Le.index>ze?(Qt=Le,Le=null):Qt=Le.sibling;var ar=te(B,Le,tt.value,de);if(ar===null){Le===null&&(Le=Qt);break}e&&Le&&ar.alternate===null&&s(B,Le),O=h(ar,O,ze),Me===null?Ee=ar:Me.sibling=ar,Me=ar,Le=Qt}if(tt.done)return i(B,Le),wt&&Cr(B,ze),Ee;if(Le===null){for(;!tt.done;ze++,tt=H.next())tt=se(B,tt.value,de),tt!==null&&(O=h(tt,O,ze),Me===null?Ee=tt:Me.sibling=tt,Me=tt);return wt&&Cr(B,ze),Ee}for(Le=u(B,Le);!tt.done;ze++,tt=H.next())tt=xe(Le,B,ze,tt.value,de),tt!==null&&(e&&tt.alternate!==null&&Le.delete(tt.key===null?ze:tt.key),O=h(tt,O,ze),Me===null?Ee=tt:Me.sibling=tt,Me=tt);return e&&Le.forEach(function(j0){return s(B,j0)}),wt&&Cr(B,ze),Ee}function Mt(B,O,H,de){if(typeof H=="object"&&H!==null&&H.type===K&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case L:e:{for(var Ee=H.key,Me=O;Me!==null;){if(Me.key===Ee){if(Ee=H.type,Ee===K){if(Me.tag===7){i(B,Me.sibling),O=f(Me,H.props.children),O.return=B,B=O;break e}}else if(Me.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===re&&vp(Ee)===Me.type){i(B,Me.sibling),O=f(Me,H.props),O.ref=ti(B,Me,H),O.return=B,B=O;break e}i(B,Me);break}else s(B,Me);Me=Me.sibling}H.type===K?(O=Mr(H.props.children,B.mode,de,H.key),O.return=B,B=O):(de=Va(H.type,H.key,H.props,null,B.mode,de),de.ref=ti(B,O,H),de.return=B,B=de)}return w(B);case q:e:{for(Me=H.key;O!==null;){if(O.key===Me)if(O.tag===4&&O.stateNode.containerInfo===H.containerInfo&&O.stateNode.implementation===H.implementation){i(B,O.sibling),O=f(O,H.children||[]),O.return=B,B=O;break e}else{i(B,O);break}else s(B,O);O=O.sibling}O=Ru(H,B.mode,de),O.return=B,B=O}return w(B);case re:return Me=H._init,Mt(B,O,Me(H._payload),de)}if(jt(H))return Ne(B,O,H,de);if(Q(H))return Ce(B,O,H,de);ka(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,O!==null&&O.tag===6?(i(B,O.sibling),O=f(O,H),O.return=B,B=O):(i(B,O),O=_u(H,B.mode,de),O.return=B,B=O),w(B)):i(B,O)}return Mt}var io=yp(!0),xp=yp(!1),Sa=Ys(null),ba=null,ao=null,zc=null;function Fc(){zc=ao=ba=null}function Uc(e){var s=Sa.current;ht(Sa),e._currentValue=s}function Bc(e,s,i){for(;e!==null;){var u=e.alternate;if((e.childLanes&s)!==s?(e.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),e===i)break;e=e.return}}function lo(e,s){ba=e,zc=ao=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&s)!==0&&(_n=!0),e.firstContext=null)}function Xn(e){var s=e._currentValue;if(zc!==e)if(e={context:e,memoizedValue:s,next:null},ao===null){if(ba===null)throw Error(r(308));ao=e,ba.dependencies={lanes:0,firstContext:e}}else ao=ao.next=e;return s}var Er=null;function Wc(e){Er===null?Er=[e]:Er.push(e)}function wp(e,s,i,u){var f=s.interleaved;return f===null?(i.next=i,Wc(s)):(i.next=f.next,f.next=i),s.interleaved=i,Ms(e,u)}function Ms(e,s){e.lanes|=s;var i=e.alternate;for(i!==null&&(i.lanes|=s),i=e,e=e.return;e!==null;)e.childLanes|=s,i=e.alternate,i!==null&&(i.childLanes|=s),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Js=!1;function Hc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kp(e,s){e=e.updateQueue,s.updateQueue===e&&(s.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ls(e,s){return{eventTime:e,lane:s,tag:0,payload:null,callback:null,next:null}}function er(e,s,i){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(Qe&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,Ms(e,i)}return f=u.interleaved,f===null?(s.next=s,Wc(u)):(s.next=f.next,f.next=s),u.interleaved=s,Ms(e,i)}function Na(e,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194240)!==0)){var u=s.lanes;u&=e.pendingLanes,i|=u,s.lanes=i,Vs(e,i)}}function Sp(e,s){var i=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var f=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var w={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};h===null?f=h=w:h=h.next=w,i=i.next}while(i!==null);h===null?f=h=s:h=h.next=s}else f=h=s;i={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:u.shared,effects:u.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=s:e.next=s,i.lastBaseUpdate=s}function Ta(e,s,i,u){var f=e.updateQueue;Js=!1;var h=f.firstBaseUpdate,w=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var M=j,V=M.next;M.next=null,w===null?h=V:w.next=V,w=M;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,j=ne.lastBaseUpdate,j!==w&&(j===null?ne.firstBaseUpdate=V:j.next=V,ne.lastBaseUpdate=M))}if(h!==null){var se=f.baseState;w=0,ne=V=M=null,j=h;do{var te=j.lane,xe=j.eventTime;if((u&te)===te){ne!==null&&(ne=ne.next={eventTime:xe,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var Ne=e,Ce=j;switch(te=s,xe=i,Ce.tag){case 1:if(Ne=Ce.payload,typeof Ne=="function"){se=Ne.call(xe,se,te);break e}se=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Ce.payload,te=typeof Ne=="function"?Ne.call(xe,se,te):Ne,te==null)break e;se=G({},se,te);break e;case 2:Js=!0}}j.callback!==null&&j.lane!==0&&(e.flags|=64,te=f.effects,te===null?f.effects=[j]:te.push(j))}else xe={eventTime:xe,lane:te,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ne===null?(V=ne=xe,M=se):ne=ne.next=xe,w|=te;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;te=j,j=te.next,te.next=null,f.lastBaseUpdate=te,f.shared.pending=null}}while(!0);if(ne===null&&(M=se),f.baseState=M,f.firstBaseUpdate=V,f.lastBaseUpdate=ne,s=f.shared.interleaved,s!==null){f=s;do w|=f.lane,f=f.next;while(f!==s)}else h===null&&(f.shared.lanes=0);Rr|=w,e.lanes=w,e.memoizedState=se}}function bp(e,s,i){if(e=s.effects,s.effects=null,e!==null)for(s=0;s<e.length;s++){var u=e[s],f=u.callback;if(f!==null){if(u.callback=null,u=i,typeof f!="function")throw Error(r(191,f));f.call(u)}}}var ni={},ks=Ys(ni),si=Ys(ni),ri=Ys(ni);function jr(e){if(e===ni)throw Error(r(174));return e}function Vc(e,s){switch(ut(ri,s),ut(si,e),ut(ks,ni),e=s.nodeType,e){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:gt(null,"");break;default:e=e===8?s.parentNode:s,s=e.namespaceURI||null,e=e.tagName,s=gt(s,e)}ht(ks),ut(ks,s)}function co(){ht(ks),ht(si),ht(ri)}function Np(e){jr(ri.current);var s=jr(ks.current),i=gt(s,e.type);s!==i&&(ut(si,e),ut(ks,i))}function Kc(e){si.current===e&&(ht(ks),ht(si))}var Tt=Ys(0);function Ca(e){for(var s=e;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Gc=[];function qc(){for(var e=0;e<Gc.length;e++)Gc[e]._workInProgressVersionPrimary=null;Gc.length=0}var Ea=I.ReactCurrentDispatcher,Xc=I.ReactCurrentBatchConfig,_r=0,Ct=null,Bt=null,Xt=null,ja=!1,oi=!1,ii=0,Yx=0;function un(){throw Error(r(321))}function Yc(e,s){if(s===null)return!1;for(var i=0;i<s.length&&i<e.length;i++)if(!ss(e[i],s[i]))return!1;return!0}function Qc(e,s,i,u,f,h){if(_r=h,Ct=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Ea.current=e===null||e.memoizedState===null?e0:t0,e=i(u,f),oi){h=0;do{if(oi=!1,ii=0,25<=h)throw Error(r(301));h+=1,Xt=Bt=null,s.updateQueue=null,Ea.current=n0,e=i(u,f)}while(oi)}if(Ea.current=Aa,s=Bt!==null&&Bt.next!==null,_r=0,Xt=Bt=Ct=null,ja=!1,s)throw Error(r(300));return e}function Zc(){var e=ii!==0;return ii=0,e}function Ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Ct.memoizedState=Xt=e:Xt=Xt.next=e,Xt}function Yn(){if(Bt===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Bt.next;var s=Xt===null?Ct.memoizedState:Xt.next;if(s!==null)Xt=s,Bt=e;else{if(e===null)throw Error(r(310));Bt=e,e={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},Xt===null?Ct.memoizedState=Xt=e:Xt=Xt.next=e}return Xt}function ai(e,s){return typeof s=="function"?s(e):s}function Jc(e){var s=Yn(),i=s.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var u=Bt,f=u.baseQueue,h=i.pending;if(h!==null){if(f!==null){var w=f.next;f.next=h.next,h.next=w}u.baseQueue=f=h,i.pending=null}if(f!==null){h=f.next,u=u.baseState;var j=w=null,M=null,V=h;do{var ne=V.lane;if((_r&ne)===ne)M!==null&&(M=M.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),u=V.hasEagerState?V.eagerState:e(u,V.action);else{var se={lane:ne,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};M===null?(j=M=se,w=u):M=M.next=se,Ct.lanes|=ne,Rr|=ne}V=V.next}while(V!==null&&V!==h);M===null?w=u:M.next=j,ss(u,s.memoizedState)||(_n=!0),s.memoizedState=u,s.baseState=w,s.baseQueue=M,i.lastRenderedState=u}if(e=i.interleaved,e!==null){f=e;do h=f.lane,Ct.lanes|=h,Rr|=h,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[s.memoizedState,i.dispatch]}function eu(e){var s=Yn(),i=s.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var u=i.dispatch,f=i.pending,h=s.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do h=e(h,w.action),w=w.next;while(w!==f);ss(h,s.memoizedState)||(_n=!0),s.memoizedState=h,s.baseQueue===null&&(s.baseState=h),i.lastRenderedState=h}return[h,u]}function Tp(){}function Cp(e,s){var i=Ct,u=Yn(),f=s(),h=!ss(u.memoizedState,f);if(h&&(u.memoizedState=f,_n=!0),u=u.queue,tu(_p.bind(null,i,u,e),[e]),u.getSnapshot!==s||h||Xt!==null&&Xt.memoizedState.tag&1){if(i.flags|=2048,li(9,jp.bind(null,i,u,f,s),void 0,null),Yt===null)throw Error(r(349));(_r&30)!==0||Ep(i,s,f)}return f}function Ep(e,s,i){e.flags|=16384,e={getSnapshot:s,value:i},s=Ct.updateQueue,s===null?(s={lastEffect:null,stores:null},Ct.updateQueue=s,s.stores=[e]):(i=s.stores,i===null?s.stores=[e]:i.push(e))}function jp(e,s,i,u){s.value=i,s.getSnapshot=u,Rp(s)&&Ap(e)}function _p(e,s,i){return i(function(){Rp(s)&&Ap(e)})}function Rp(e){var s=e.getSnapshot;e=e.value;try{var i=s();return!ss(e,i)}catch{return!0}}function Ap(e){var s=Ms(e,1);s!==null&&ls(s,e,1,-1)}function Ip(e){var s=Ss();return typeof e=="function"&&(e=e()),s.memoizedState=s.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ai,lastRenderedState:e},s.queue=e,e=e.dispatch=Jx.bind(null,Ct,e),[s.memoizedState,e]}function li(e,s,i,u){return e={tag:e,create:s,destroy:i,deps:u,next:null},s=Ct.updateQueue,s===null?(s={lastEffect:null,stores:null},Ct.updateQueue=s,s.lastEffect=e.next=e):(i=s.lastEffect,i===null?s.lastEffect=e.next=e:(u=i.next,i.next=e,e.next=u,s.lastEffect=e)),e}function Dp(){return Yn().memoizedState}function _a(e,s,i,u){var f=Ss();Ct.flags|=e,f.memoizedState=li(1|s,i,void 0,u===void 0?null:u)}function Ra(e,s,i,u){var f=Yn();u=u===void 0?null:u;var h=void 0;if(Bt!==null){var w=Bt.memoizedState;if(h=w.destroy,u!==null&&Yc(u,w.deps)){f.memoizedState=li(s,i,h,u);return}}Ct.flags|=e,f.memoizedState=li(1|s,i,h,u)}function Mp(e,s){return _a(8390656,8,e,s)}function tu(e,s){return Ra(2048,8,e,s)}function Lp(e,s){return Ra(4,2,e,s)}function Op(e,s){return Ra(4,4,e,s)}function Pp(e,s){if(typeof s=="function")return e=e(),s(e),function(){s(null)};if(s!=null)return e=e(),s.current=e,function(){s.current=null}}function $p(e,s,i){return i=i!=null?i.concat([e]):null,Ra(4,4,Pp.bind(null,s,e),i)}function nu(){}function zp(e,s){var i=Yn();s=s===void 0?null:s;var u=i.memoizedState;return u!==null&&s!==null&&Yc(s,u[1])?u[0]:(i.memoizedState=[e,s],e)}function Fp(e,s){var i=Yn();s=s===void 0?null:s;var u=i.memoizedState;return u!==null&&s!==null&&Yc(s,u[1])?u[0]:(e=e(),i.memoizedState=[e,s],e)}function Up(e,s,i){return(_r&21)===0?(e.baseState&&(e.baseState=!1,_n=!0),e.memoizedState=i):(ss(i,s)||(i=$o(),Ct.lanes|=i,Rr|=i,e.baseState=!0),s)}function Qx(e,s){var i=Xe;Xe=i!==0&&4>i?i:4,e(!0);var u=Xc.transition;Xc.transition={};try{e(!1),s()}finally{Xe=i,Xc.transition=u}}function Bp(){return Yn().memoizedState}function Zx(e,s,i){var u=rr(e);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},Wp(e))Hp(s,i);else if(i=wp(e,s,i,u),i!==null){var f=Sn();ls(i,e,u,f),Vp(i,s,u)}}function Jx(e,s,i){var u=rr(e),f={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(Wp(e))Hp(s,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=s.lastRenderedReducer,h!==null))try{var w=s.lastRenderedState,j=h(w,i);if(f.hasEagerState=!0,f.eagerState=j,ss(j,w)){var M=s.interleaved;M===null?(f.next=f,Wc(s)):(f.next=M.next,M.next=f),s.interleaved=f;return}}catch{}finally{}i=wp(e,s,f,u),i!==null&&(f=Sn(),ls(i,e,u,f),Vp(i,s,u))}}function Wp(e){var s=e.alternate;return e===Ct||s!==null&&s===Ct}function Hp(e,s){oi=ja=!0;var i=e.pending;i===null?s.next=s:(s.next=i.next,i.next=s),e.pending=s}function Vp(e,s,i){if((i&4194240)!==0){var u=s.lanes;u&=e.pendingLanes,i|=u,s.lanes=i,Vs(e,i)}}var Aa={readContext:Xn,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},e0={readContext:Xn,useCallback:function(e,s){return Ss().memoizedState=[e,s===void 0?null:s],e},useContext:Xn,useEffect:Mp,useImperativeHandle:function(e,s,i){return i=i!=null?i.concat([e]):null,_a(4194308,4,Pp.bind(null,s,e),i)},useLayoutEffect:function(e,s){return _a(4194308,4,e,s)},useInsertionEffect:function(e,s){return _a(4,2,e,s)},useMemo:function(e,s){var i=Ss();return s=s===void 0?null:s,e=e(),i.memoizedState=[e,s],e},useReducer:function(e,s,i){var u=Ss();return s=i!==void 0?i(s):s,u.memoizedState=u.baseState=s,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},u.queue=e,e=e.dispatch=Zx.bind(null,Ct,e),[u.memoizedState,e]},useRef:function(e){var s=Ss();return e={current:e},s.memoizedState=e},useState:Ip,useDebugValue:nu,useDeferredValue:function(e){return Ss().memoizedState=e},useTransition:function(){var e=Ip(!1),s=e[0];return e=Qx.bind(null,e[1]),Ss().memoizedState=e,[s,e]},useMutableSource:function(){},useSyncExternalStore:function(e,s,i){var u=Ct,f=Ss();if(wt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=s(),Yt===null)throw Error(r(349));(_r&30)!==0||Ep(u,s,i)}f.memoizedState=i;var h={value:i,getSnapshot:s};return f.queue=h,Mp(_p.bind(null,u,h,e),[e]),u.flags|=2048,li(9,jp.bind(null,u,h,i,s),void 0,null),i},useId:function(){var e=Ss(),s=Yt.identifierPrefix;if(wt){var i=Ds,u=Is;i=(u&~(1<<32-xn(u)-1)).toString(32)+i,s=":"+s+"R"+i,i=ii++,0<i&&(s+="H"+i.toString(32)),s+=":"}else i=Yx++,s=":"+s+"r"+i.toString(32)+":";return e.memoizedState=s},unstable_isNewReconciler:!1},t0={readContext:Xn,useCallback:zp,useContext:Xn,useEffect:tu,useImperativeHandle:$p,useInsertionEffect:Lp,useLayoutEffect:Op,useMemo:Fp,useReducer:Jc,useRef:Dp,useState:function(){return Jc(ai)},useDebugValue:nu,useDeferredValue:function(e){var s=Yn();return Up(s,Bt.memoizedState,e)},useTransition:function(){var e=Jc(ai)[0],s=Yn().memoizedState;return[e,s]},useMutableSource:Tp,useSyncExternalStore:Cp,useId:Bp,unstable_isNewReconciler:!1},n0={readContext:Xn,useCallback:zp,useContext:Xn,useEffect:tu,useImperativeHandle:$p,useInsertionEffect:Lp,useLayoutEffect:Op,useMemo:Fp,useReducer:eu,useRef:Dp,useState:function(){return eu(ai)},useDebugValue:nu,useDeferredValue:function(e){var s=Yn();return Bt===null?s.memoizedState=e:Up(s,Bt.memoizedState,e)},useTransition:function(){var e=eu(ai)[0],s=Yn().memoizedState;return[e,s]},useMutableSource:Tp,useSyncExternalStore:Cp,useId:Bp,unstable_isNewReconciler:!1};function os(e,s){if(e&&e.defaultProps){s=G({},s),e=e.defaultProps;for(var i in e)s[i]===void 0&&(s[i]=e[i]);return s}return s}function su(e,s,i,u){s=e.memoizedState,i=i(u,s),i=i==null?s:G({},s,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ia={isMounted:function(e){return(e=e._reactInternals)?We(e)===e:!1},enqueueSetState:function(e,s,i){e=e._reactInternals;var u=Sn(),f=rr(e),h=Ls(u,f);h.payload=s,i!=null&&(h.callback=i),s=er(e,h,f),s!==null&&(ls(s,e,f,u),Na(s,e,f))},enqueueReplaceState:function(e,s,i){e=e._reactInternals;var u=Sn(),f=rr(e),h=Ls(u,f);h.tag=1,h.payload=s,i!=null&&(h.callback=i),s=er(e,h,f),s!==null&&(ls(s,e,f,u),Na(s,e,f))},enqueueForceUpdate:function(e,s){e=e._reactInternals;var i=Sn(),u=rr(e),f=Ls(i,u);f.tag=2,s!=null&&(f.callback=s),s=er(e,f,u),s!==null&&(ls(s,e,u,i),Na(s,e,u))}};function Kp(e,s,i,u,f,h,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,h,w):s.prototype&&s.prototype.isPureReactComponent?!qo(i,u)||!qo(f,h):!0}function Gp(e,s,i){var u=!1,f=Qs,h=s.contextType;return typeof h=="object"&&h!==null?h=Xn(h):(f=jn(s)?Nr:cn.current,u=s.contextTypes,h=(u=u!=null)?no(e,f):Qs),s=new s(i,h),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Ia,e.stateNode=s,s._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=h),s}function qp(e,s,i,u){e=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,u),s.state!==e&&Ia.enqueueReplaceState(s,s.state,null)}function ru(e,s,i,u){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Hc(e);var h=s.contextType;typeof h=="object"&&h!==null?f.context=Xn(h):(h=jn(s)?Nr:cn.current,f.context=no(e,h)),f.state=e.memoizedState,h=s.getDerivedStateFromProps,typeof h=="function"&&(su(e,s,h,i),f.state=e.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(s=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),s!==f.state&&Ia.enqueueReplaceState(f,f.state,null),Ta(e,i,f,u),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function uo(e,s){try{var i="",u=s;do i+=X(u),u=u.return;while(u);var f=i}catch(h){f=`
|
|
40
|
-
Error generating stack: `+h.message+`
|
|
41
|
-
`+h.stack}return{value:e,source:s,stack:f,digest:null}}function ou(e,s,i){return{value:e,source:null,stack:i??null,digest:s??null}}function iu(e,s){try{console.error(s.value)}catch(i){setTimeout(function(){throw i})}}var s0=typeof WeakMap=="function"?WeakMap:Map;function Xp(e,s,i){i=Ls(-1,i),i.tag=3,i.payload={element:null};var u=s.value;return i.callback=function(){za||(za=!0,ku=u),iu(e,s)},i}function Yp(e,s,i){i=Ls(-1,i),i.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;i.payload=function(){return u(f)},i.callback=function(){iu(e,s)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(i.callback=function(){iu(e,s),typeof u!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var w=s.stack;this.componentDidCatch(s.value,{componentStack:w!==null?w:""})}),i}function Qp(e,s,i){var u=e.pingCache;if(u===null){u=e.pingCache=new s0;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(i)||(f.add(i),e=v0.bind(null,e,s,i),s.then(e,e))}function Zp(e){do{var s;if((s=e.tag===13)&&(s=e.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return e;e=e.return}while(e!==null);return null}function Jp(e,s,i,u,f){return(e.mode&1)===0?(e===s?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(s=Ls(-1,1),s.tag=2,er(i,s,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var r0=I.ReactCurrentOwner,_n=!1;function kn(e,s,i,u){s.child=e===null?xp(s,null,i,u):io(s,e.child,i,u)}function eh(e,s,i,u,f){i=i.render;var h=s.ref;return lo(s,f),u=Qc(e,s,i,u,h,f),i=Zc(),e!==null&&!_n?(s.updateQueue=e.updateQueue,s.flags&=-2053,e.lanes&=~f,Os(e,s,f)):(wt&&i&&Mc(s),s.flags|=1,kn(e,s,u,f),s.child)}function th(e,s,i,u,f){if(e===null){var h=i.type;return typeof h=="function"&&!ju(h)&&h.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(s.tag=15,s.type=h,nh(e,s,h,u,f)):(e=Va(i.type,null,u,s,s.mode,f),e.ref=s.ref,e.return=s,s.child=e)}if(h=e.child,(e.lanes&f)===0){var w=h.memoizedProps;if(i=i.compare,i=i!==null?i:qo,i(w,u)&&e.ref===s.ref)return Os(e,s,f)}return s.flags|=1,e=ir(h,u),e.ref=s.ref,e.return=s,s.child=e}function nh(e,s,i,u,f){if(e!==null){var h=e.memoizedProps;if(qo(h,u)&&e.ref===s.ref)if(_n=!1,s.pendingProps=u=h,(e.lanes&f)!==0)(e.flags&131072)!==0&&(_n=!0);else return s.lanes=e.lanes,Os(e,s,f)}return au(e,s,i,u,f)}function sh(e,s,i){var u=s.pendingProps,f=u.children,h=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(po,Wn),Wn|=i;else{if((i&1073741824)===0)return e=h!==null?h.baseLanes|i:i,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:e,cachePool:null,transitions:null},s.updateQueue=null,ut(po,Wn),Wn|=e,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=h!==null?h.baseLanes:i,ut(po,Wn),Wn|=u}else h!==null?(u=h.baseLanes|i,s.memoizedState=null):u=i,ut(po,Wn),Wn|=u;return kn(e,s,f,i),s.child}function rh(e,s){var i=s.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(s.flags|=512,s.flags|=2097152)}function au(e,s,i,u,f){var h=jn(i)?Nr:cn.current;return h=no(s,h),lo(s,f),i=Qc(e,s,i,u,h,f),u=Zc(),e!==null&&!_n?(s.updateQueue=e.updateQueue,s.flags&=-2053,e.lanes&=~f,Os(e,s,f)):(wt&&u&&Mc(s),s.flags|=1,kn(e,s,i,f),s.child)}function oh(e,s,i,u,f){if(jn(i)){var h=!0;ga(s)}else h=!1;if(lo(s,f),s.stateNode===null)Ma(e,s),Gp(s,i,u),ru(s,i,u,f),u=!0;else if(e===null){var w=s.stateNode,j=s.memoizedProps;w.props=j;var M=w.context,V=i.contextType;typeof V=="object"&&V!==null?V=Xn(V):(V=jn(i)?Nr:cn.current,V=no(s,V));var ne=i.getDerivedStateFromProps,se=typeof ne=="function"||typeof w.getSnapshotBeforeUpdate=="function";se||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==u||M!==V)&&qp(s,w,u,V),Js=!1;var te=s.memoizedState;w.state=te,Ta(s,u,w,f),M=s.memoizedState,j!==u||te!==M||En.current||Js?(typeof ne=="function"&&(su(s,i,ne,u),M=s.memoizedState),(j=Js||Kp(s,i,j,u,te,M,V))?(se||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=M),w.props=u,w.state=M,w.context=V,u=j):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{w=s.stateNode,kp(e,s),j=s.memoizedProps,V=s.type===s.elementType?j:os(s.type,j),w.props=V,se=s.pendingProps,te=w.context,M=i.contextType,typeof M=="object"&&M!==null?M=Xn(M):(M=jn(i)?Nr:cn.current,M=no(s,M));var xe=i.getDerivedStateFromProps;(ne=typeof xe=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==se||te!==M)&&qp(s,w,u,M),Js=!1,te=s.memoizedState,w.state=te,Ta(s,u,w,f);var Ne=s.memoizedState;j!==se||te!==Ne||En.current||Js?(typeof xe=="function"&&(su(s,i,xe,u),Ne=s.memoizedState),(V=Js||Kp(s,i,V,u,te,Ne,M)||!1)?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(u,Ne,M),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(u,Ne,M)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=Ne),w.props=u,w.state=Ne,w.context=M,u=V):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&te===e.memoizedState||(s.flags|=1024),u=!1)}return lu(e,s,i,u,h,f)}function lu(e,s,i,u,f,h){rh(e,s);var w=(s.flags&128)!==0;if(!u&&!w)return f&&up(s,i,!1),Os(e,s,h);u=s.stateNode,r0.current=s;var j=w&&typeof i.getDerivedStateFromError!="function"?null:u.render();return s.flags|=1,e!==null&&w?(s.child=io(s,e.child,null,h),s.child=io(s,null,j,h)):kn(e,s,j,h),s.memoizedState=u.state,f&&up(s,i,!0),s.child}function ih(e){var s=e.stateNode;s.pendingContext?lp(e,s.pendingContext,s.pendingContext!==s.context):s.context&&lp(e,s.context,!1),Vc(e,s.containerInfo)}function ah(e,s,i,u,f){return oo(),$c(f),s.flags|=256,kn(e,s,i,u),s.child}var cu={dehydrated:null,treeContext:null,retryLane:0};function uu(e){return{baseLanes:e,cachePool:null,transitions:null}}function lh(e,s,i){var u=s.pendingProps,f=Tt.current,h=!1,w=(s.flags&128)!==0,j;if((j=w)||(j=e!==null&&e.memoizedState===null?!1:(f&2)!==0),j?(h=!0,s.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ut(Tt,f&1),e===null)return Pc(s),e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((s.mode&1)===0?s.lanes=1:e.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(w=u.children,e=u.fallback,h?(u=s.mode,h=s.child,w={mode:"hidden",children:w},(u&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=w):h=Ka(w,u,0,null),e=Mr(e,u,i,null),h.return=s,e.return=s,h.sibling=e,s.child=h,s.child.memoizedState=uu(i),s.memoizedState=cu,e):du(s,w));if(f=e.memoizedState,f!==null&&(j=f.dehydrated,j!==null))return o0(e,s,w,u,j,f,i);if(h){h=u.fallback,w=s.mode,f=e.child,j=f.sibling;var M={mode:"hidden",children:u.children};return(w&1)===0&&s.child!==f?(u=s.child,u.childLanes=0,u.pendingProps=M,s.deletions=null):(u=ir(f,M),u.subtreeFlags=f.subtreeFlags&14680064),j!==null?h=ir(j,h):(h=Mr(h,w,i,null),h.flags|=2),h.return=s,u.return=s,u.sibling=h,s.child=u,u=h,h=s.child,w=e.child.memoizedState,w=w===null?uu(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},h.memoizedState=w,h.childLanes=e.childLanes&~i,s.memoizedState=cu,u}return h=e.child,e=h.sibling,u=ir(h,{mode:"visible",children:u.children}),(s.mode&1)===0&&(u.lanes=i),u.return=s,u.sibling=null,e!==null&&(i=s.deletions,i===null?(s.deletions=[e],s.flags|=16):i.push(e)),s.child=u,s.memoizedState=null,u}function du(e,s){return s=Ka({mode:"visible",children:s},e.mode,0,null),s.return=e,e.child=s}function Da(e,s,i,u){return u!==null&&$c(u),io(s,e.child,null,i),e=du(s,s.pendingProps.children),e.flags|=2,s.memoizedState=null,e}function o0(e,s,i,u,f,h,w){if(i)return s.flags&256?(s.flags&=-257,u=ou(Error(r(422))),Da(e,s,w,u)):s.memoizedState!==null?(s.child=e.child,s.flags|=128,null):(h=u.fallback,f=s.mode,u=Ka({mode:"visible",children:u.children},f,0,null),h=Mr(h,f,w,null),h.flags|=2,u.return=s,h.return=s,u.sibling=h,s.child=u,(s.mode&1)!==0&&io(s,e.child,null,w),s.child.memoizedState=uu(w),s.memoizedState=cu,h);if((s.mode&1)===0)return Da(e,s,w,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var j=u.dgst;return u=j,h=Error(r(419)),u=ou(h,u,void 0),Da(e,s,w,u)}if(j=(w&e.childLanes)!==0,_n||j){if(u=Yt,u!==null){switch(w&-w){case 4:f=2;break;case 16:f=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:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|w))!==0?0:f,f!==0&&f!==h.retryLane&&(h.retryLane=f,Ms(e,f),ls(u,e,f,-1))}return Eu(),u=ou(Error(r(421))),Da(e,s,w,u)}return f.data==="$?"?(s.flags|=128,s.child=e.child,s=y0.bind(null,e),f._reactRetry=s,null):(e=h.treeContext,Bn=Xs(f.nextSibling),Un=s,wt=!0,rs=null,e!==null&&(Gn[qn++]=Is,Gn[qn++]=Ds,Gn[qn++]=Tr,Is=e.id,Ds=e.overflow,Tr=s),s=du(s,u.children),s.flags|=4096,s)}function ch(e,s,i){e.lanes|=s;var u=e.alternate;u!==null&&(u.lanes|=s),Bc(e.return,s,i)}function fu(e,s,i,u,f){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:f}:(h.isBackwards=s,h.rendering=null,h.renderingStartTime=0,h.last=u,h.tail=i,h.tailMode=f)}function uh(e,s,i){var u=s.pendingProps,f=u.revealOrder,h=u.tail;if(kn(e,s,u.children,i),u=Tt.current,(u&2)!==0)u=u&1|2,s.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=s.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ch(e,i,s);else if(e.tag===19)ch(e,i,s);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===s)break e;for(;e.sibling===null;){if(e.return===null||e.return===s)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(ut(Tt,u),(s.mode&1)===0)s.memoizedState=null;else switch(f){case"forwards":for(i=s.child,f=null;i!==null;)e=i.alternate,e!==null&&Ca(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=s.child,s.child=null):(f=i.sibling,i.sibling=null),fu(s,!1,f,i,h);break;case"backwards":for(i=null,f=s.child,s.child=null;f!==null;){if(e=f.alternate,e!==null&&Ca(e)===null){s.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}fu(s,!0,i,null,h);break;case"together":fu(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Ma(e,s){(s.mode&1)===0&&e!==null&&(e.alternate=null,s.alternate=null,s.flags|=2)}function Os(e,s,i){if(e!==null&&(s.dependencies=e.dependencies),Rr|=s.lanes,(i&s.childLanes)===0)return null;if(e!==null&&s.child!==e.child)throw Error(r(153));if(s.child!==null){for(e=s.child,i=ir(e,e.pendingProps),s.child=i,i.return=s;e.sibling!==null;)e=e.sibling,i=i.sibling=ir(e,e.pendingProps),i.return=s;i.sibling=null}return s.child}function i0(e,s,i){switch(s.tag){case 3:ih(s),oo();break;case 5:Np(s);break;case 1:jn(s.type)&&ga(s);break;case 4:Vc(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,f=s.memoizedProps.value;ut(Sa,u._currentValue),u._currentValue=f;break;case 13:if(u=s.memoizedState,u!==null)return u.dehydrated!==null?(ut(Tt,Tt.current&1),s.flags|=128,null):(i&s.child.childLanes)!==0?lh(e,s,i):(ut(Tt,Tt.current&1),e=Os(e,s,i),e!==null?e.sibling:null);ut(Tt,Tt.current&1);break;case 19:if(u=(i&s.childLanes)!==0,(e.flags&128)!==0){if(u)return uh(e,s,i);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ut(Tt,Tt.current),u)break;return null;case 22:case 23:return s.lanes=0,sh(e,s,i)}return Os(e,s,i)}var dh,pu,fh,ph;dh=function(e,s){for(var i=s.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},pu=function(){},fh=function(e,s,i,u){var f=e.memoizedProps;if(f!==u){e=s.stateNode,jr(ks.current);var h=null;switch(i){case"input":f=Ie(e,f),u=Ie(e,u),h=[];break;case"select":f=G({},f,{value:void 0}),u=G({},u,{value:void 0}),h=[];break;case"textarea":f=Ot(e,f),u=Ot(e,u),h=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=pa)}ns(i,u);var w;i=null;for(V in f)if(!u.hasOwnProperty(V)&&f.hasOwnProperty(V)&&f[V]!=null)if(V==="style"){var j=f[V];for(w in j)j.hasOwnProperty(w)&&(i||(i={}),i[w]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(a.hasOwnProperty(V)?h||(h=[]):(h=h||[]).push(V,null));for(V in u){var M=u[V];if(j=f!=null?f[V]:void 0,u.hasOwnProperty(V)&&M!==j&&(M!=null||j!=null))if(V==="style")if(j){for(w in j)!j.hasOwnProperty(w)||M&&M.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in M)M.hasOwnProperty(w)&&j[w]!==M[w]&&(i||(i={}),i[w]=M[w])}else i||(h||(h=[]),h.push(V,i)),i=M;else V==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,j=j?j.__html:void 0,M!=null&&j!==M&&(h=h||[]).push(V,M)):V==="children"?typeof M!="string"&&typeof M!="number"||(h=h||[]).push(V,""+M):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(a.hasOwnProperty(V)?(M!=null&&V==="onScroll"&&pt("scroll",e),h||j===M||(h=[])):(h=h||[]).push(V,M))}i&&(h=h||[]).push("style",i);var V=h;(s.updateQueue=V)&&(s.flags|=4)}},ph=function(e,s,i,u){i!==u&&(s.flags|=4)};function ci(e,s){if(!wt)switch(e.tailMode){case"hidden":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function dn(e){var s=e.alternate!==null&&e.alternate.child===e.child,i=0,u=0;if(s)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=u,e.childLanes=i,s}function a0(e,s,i){var u=s.pendingProps;switch(Lc(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(s),null;case 1:return jn(s.type)&&ma(),dn(s),null;case 3:return u=s.stateNode,co(),ht(En),ht(cn),qc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(wa(s)?s.flags|=4:e===null||e.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,rs!==null&&(Nu(rs),rs=null))),pu(e,s),dn(s),null;case 5:Kc(s);var f=jr(ri.current);if(i=s.type,e!==null&&s.stateNode!=null)fh(e,s,i,u,f),e.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(s.stateNode===null)throw Error(r(166));return dn(s),null}if(e=jr(ks.current),wa(s)){u=s.stateNode,i=s.type;var h=s.memoizedProps;switch(u[ws]=s,u[Jo]=h,e=(s.mode&1)!==0,i){case"dialog":pt("cancel",u),pt("close",u);break;case"iframe":case"object":case"embed":pt("load",u);break;case"video":case"audio":for(f=0;f<Yo.length;f++)pt(Yo[f],u);break;case"source":pt("error",u);break;case"img":case"image":case"link":pt("error",u),pt("load",u);break;case"details":pt("toggle",u);break;case"input":mt(u,h),pt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!h.multiple},pt("invalid",u);break;case"textarea":Y(u,h),pt("invalid",u)}ns(i,h),f=null;for(var w in h)if(h.hasOwnProperty(w)){var j=h[w];w==="children"?typeof j=="string"?u.textContent!==j&&(h.suppressHydrationWarning!==!0&&fa(u.textContent,j,e),f=["children",j]):typeof j=="number"&&u.textContent!==""+j&&(h.suppressHydrationWarning!==!0&&fa(u.textContent,j,e),f=["children",""+j]):a.hasOwnProperty(w)&&j!=null&&w==="onScroll"&&pt("scroll",u)}switch(i){case"input":me(u),tn(u,h,!0);break;case"textarea":me(u),Be(u);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(u.onclick=pa)}u=f,s.updateQueue=u,u!==null&&(s.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=st(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=w.createElement(i,{is:u.is}):(e=w.createElement(i),i==="select"&&(w=e,u.multiple?w.multiple=!0:u.size&&(w.size=u.size))):e=w.createElementNS(e,i),e[ws]=s,e[Jo]=u,dh(e,s,!1,!1),s.stateNode=e;e:{switch(w=On(i,u),i){case"dialog":pt("cancel",e),pt("close",e),f=u;break;case"iframe":case"object":case"embed":pt("load",e),f=u;break;case"video":case"audio":for(f=0;f<Yo.length;f++)pt(Yo[f],e);f=u;break;case"source":pt("error",e),f=u;break;case"img":case"image":case"link":pt("error",e),pt("load",e),f=u;break;case"details":pt("toggle",e),f=u;break;case"input":mt(e,u),f=Ie(e,u),pt("invalid",e);break;case"option":f=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},f=G({},u,{value:void 0}),pt("invalid",e);break;case"textarea":Y(e,u),f=Ot(e,u),pt("invalid",e);break;default:f=u}ns(i,f),j=f;for(h in j)if(j.hasOwnProperty(h)){var M=j[h];h==="style"?hs(e,M):h==="dangerouslySetInnerHTML"?(M=M?M.__html:void 0,M!=null&&_t(e,M)):h==="children"?typeof M=="string"?(i!=="textarea"||M!=="")&&an(e,M):typeof M=="number"&&an(e,""+M):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(a.hasOwnProperty(h)?M!=null&&h==="onScroll"&&pt("scroll",e):M!=null&&z(e,h,M,w))}switch(i){case"input":me(e),tn(e,u,!1);break;case"textarea":me(e),Be(e);break;case"option":u.value!=null&&e.setAttribute("value",""+_e(u.value));break;case"select":e.multiple=!!u.multiple,h=u.value,h!=null?Ft(e,!!u.multiple,h,!1):u.defaultValue!=null&&Ft(e,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=pa)}switch(i){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return dn(s),null;case 6:if(e&&s.stateNode!=null)ph(e,s,e.memoizedProps,u);else{if(typeof u!="string"&&s.stateNode===null)throw Error(r(166));if(i=jr(ri.current),jr(ks.current),wa(s)){if(u=s.stateNode,i=s.memoizedProps,u[ws]=s,(h=u.nodeValue!==i)&&(e=Un,e!==null))switch(e.tag){case 3:fa(u.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fa(u.nodeValue,i,(e.mode&1)!==0)}h&&(s.flags|=4)}else u=(i.nodeType===9?i:i.ownerDocument).createTextNode(u),u[ws]=s,s.stateNode=u}return dn(s),null;case 13:if(ht(Tt),u=s.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wt&&Bn!==null&&(s.mode&1)!==0&&(s.flags&128)===0)gp(),oo(),s.flags|=98560,h=!1;else if(h=wa(s),u!==null&&u.dehydrated!==null){if(e===null){if(!h)throw Error(r(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[ws]=s}else oo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;dn(s),h=!1}else rs!==null&&(Nu(rs),rs=null),h=!0;if(!h)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=i,s):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(s.child.flags|=8192,(s.mode&1)!==0&&(e===null||(Tt.current&1)!==0?Wt===0&&(Wt=3):Eu())),s.updateQueue!==null&&(s.flags|=4),dn(s),null);case 4:return co(),pu(e,s),e===null&&Qo(s.stateNode.containerInfo),dn(s),null;case 10:return Uc(s.type._context),dn(s),null;case 17:return jn(s.type)&&ma(),dn(s),null;case 19:if(ht(Tt),h=s.memoizedState,h===null)return dn(s),null;if(u=(s.flags&128)!==0,w=h.rendering,w===null)if(u)ci(h,!1);else{if(Wt!==0||e!==null&&(e.flags&128)!==0)for(e=s.child;e!==null;){if(w=Ca(e),w!==null){for(s.flags|=128,ci(h,!1),u=w.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=i,i=s.child;i!==null;)h=i,e=u,h.flags&=14680066,w=h.alternate,w===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=w.childLanes,h.lanes=w.lanes,h.child=w.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=w.memoizedProps,h.memoizedState=w.memoizedState,h.updateQueue=w.updateQueue,h.type=w.type,e=w.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ut(Tt,Tt.current&1|2),s.child}e=e.sibling}h.tail!==null&&St()>ho&&(s.flags|=128,u=!0,ci(h,!1),s.lanes=4194304)}else{if(!u)if(e=Ca(w),e!==null){if(s.flags|=128,u=!0,i=e.updateQueue,i!==null&&(s.updateQueue=i,s.flags|=4),ci(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!wt)return dn(s),null}else 2*St()-h.renderingStartTime>ho&&i!==1073741824&&(s.flags|=128,u=!0,ci(h,!1),s.lanes=4194304);h.isBackwards?(w.sibling=s.child,s.child=w):(i=h.last,i!==null?i.sibling=w:s.child=w,h.last=w)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=St(),s.sibling=null,i=Tt.current,ut(Tt,u?i&1|2:i&1),s):(dn(s),null);case 22:case 23:return Cu(),u=s.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(Wn&1073741824)!==0&&(dn(s),s.subtreeFlags&6&&(s.flags|=8192)):dn(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function l0(e,s){switch(Lc(s),s.tag){case 1:return jn(s.type)&&ma(),e=s.flags,e&65536?(s.flags=e&-65537|128,s):null;case 3:return co(),ht(En),ht(cn),qc(),e=s.flags,(e&65536)!==0&&(e&128)===0?(s.flags=e&-65537|128,s):null;case 5:return Kc(s),null;case 13:if(ht(Tt),e=s.memoizedState,e!==null&&e.dehydrated!==null){if(s.alternate===null)throw Error(r(340));oo()}return e=s.flags,e&65536?(s.flags=e&-65537|128,s):null;case 19:return ht(Tt),null;case 4:return co(),null;case 10:return Uc(s.type._context),null;case 22:case 23:return Cu(),null;case 24:return null;default:return null}}var La=!1,fn=!1,c0=typeof WeakSet=="function"?WeakSet:Set,ke=null;function fo(e,s){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(u){It(e,s,u)}else i.current=null}function hu(e,s,i){try{i()}catch(u){It(e,s,u)}}var hh=!1;function u0(e,s){if(Cc=ta,e=Kf(),yc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var f=u.anchorOffset,h=u.focusNode;u=u.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var w=0,j=-1,M=-1,V=0,ne=0,se=e,te=null;t:for(;;){for(var xe;se!==i||f!==0&&se.nodeType!==3||(j=w+f),se!==h||u!==0&&se.nodeType!==3||(M=w+u),se.nodeType===3&&(w+=se.nodeValue.length),(xe=se.firstChild)!==null;)te=se,se=xe;for(;;){if(se===e)break t;if(te===i&&++V===f&&(j=w),te===h&&++ne===u&&(M=w),(xe=se.nextSibling)!==null)break;se=te,te=se.parentNode}se=xe}i=j===-1||M===-1?null:{start:j,end:M}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ec={focusedElem:e,selectionRange:i},ta=!1,ke=s;ke!==null;)if(s=ke,e=s.child,(s.subtreeFlags&1028)!==0&&e!==null)e.return=s,ke=e;else for(;ke!==null;){s=ke;try{var Ne=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Ce=Ne.memoizedProps,Mt=Ne.memoizedState,B=s.stateNode,O=B.getSnapshotBeforeUpdate(s.elementType===s.type?Ce:os(s.type,Ce),Mt);B.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var H=s.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(de){It(s,s.return,de)}if(e=s.sibling,e!==null){e.return=s.return,ke=e;break}ke=s.return}return Ne=hh,hh=!1,Ne}function ui(e,s,i){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&e)===e){var h=f.destroy;f.destroy=void 0,h!==void 0&&hu(s,i,h)}f=f.next}while(f!==u)}}function Oa(e,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var i=s=s.next;do{if((i.tag&e)===e){var u=i.create;i.destroy=u()}i=i.next}while(i!==s)}}function mu(e){var s=e.ref;if(s!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof s=="function"?s(e):s.current=e}}function mh(e){var s=e.alternate;s!==null&&(e.alternate=null,mh(s)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(s=e.stateNode,s!==null&&(delete s[ws],delete s[Jo],delete s[Ac],delete s[Kx],delete s[Gx])),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 gh(e){return e.tag===5||e.tag===3||e.tag===4}function vh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gh(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 gu(e,s,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,s?i.nodeType===8?i.parentNode.insertBefore(e,s):i.insertBefore(e,s):(i.nodeType===8?(s=i.parentNode,s.insertBefore(e,i)):(s=i,s.appendChild(e)),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=pa));else if(u!==4&&(e=e.child,e!==null))for(gu(e,s,i),e=e.sibling;e!==null;)gu(e,s,i),e=e.sibling}function vu(e,s,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,s?i.insertBefore(e,s):i.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(vu(e,s,i),e=e.sibling;e!==null;)vu(e,s,i),e=e.sibling}var nn=null,is=!1;function tr(e,s,i){for(i=i.child;i!==null;)yh(e,s,i),i=i.sibling}function yh(e,s,i){if(zn&&typeof zn.onCommitFiberUnmount=="function")try{zn.onCommitFiberUnmount(yr,i)}catch{}switch(i.tag){case 5:fn||fo(i,s);case 6:var u=nn,f=is;nn=null,tr(e,s,i),nn=u,is=f,nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):nn.removeChild(i.stateNode));break;case 18:nn!==null&&(is?(e=nn,i=i.stateNode,e.nodeType===8?Rc(e.parentNode,i):e.nodeType===1&&Rc(e,i),Bo(e)):Rc(nn,i.stateNode));break;case 4:u=nn,f=is,nn=i.stateNode.containerInfo,is=!0,tr(e,s,i),nn=u,is=f;break;case 0:case 11:case 14:case 15:if(!fn&&(u=i.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var h=f,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&hu(i,s,w),f=f.next}while(f!==u)}tr(e,s,i);break;case 1:if(!fn&&(fo(i,s),u=i.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(j){It(i,s,j)}tr(e,s,i);break;case 21:tr(e,s,i);break;case 22:i.mode&1?(fn=(u=fn)||i.memoizedState!==null,tr(e,s,i),fn=u):tr(e,s,i);break;default:tr(e,s,i)}}function xh(e){var s=e.updateQueue;if(s!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new c0),s.forEach(function(u){var f=x0.bind(null,e,u);i.has(u)||(i.add(u),u.then(f,f))})}}function as(e,s){var i=s.deletions;if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];try{var h=e,w=s,j=w;e:for(;j!==null;){switch(j.tag){case 5:nn=j.stateNode,is=!1;break e;case 3:nn=j.stateNode.containerInfo,is=!0;break e;case 4:nn=j.stateNode.containerInfo,is=!0;break e}j=j.return}if(nn===null)throw Error(r(160));yh(h,w,f),nn=null,is=!1;var M=f.alternate;M!==null&&(M.return=null),f.return=null}catch(V){It(f,s,V)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)wh(s,e),s=s.sibling}function wh(e,s){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(as(s,e),bs(e),u&4){try{ui(3,e,e.return),Oa(3,e)}catch(Ce){It(e,e.return,Ce)}try{ui(5,e,e.return)}catch(Ce){It(e,e.return,Ce)}}break;case 1:as(s,e),bs(e),u&512&&i!==null&&fo(i,i.return);break;case 5:if(as(s,e),bs(e),u&512&&i!==null&&fo(i,i.return),e.flags&32){var f=e.stateNode;try{an(f,"")}catch(Ce){It(e,e.return,Ce)}}if(u&4&&(f=e.stateNode,f!=null)){var h=e.memoizedProps,w=i!==null?i.memoizedProps:h,j=e.type,M=e.updateQueue;if(e.updateQueue=null,M!==null)try{j==="input"&&h.type==="radio"&&h.name!=null&&Ue(f,h),On(j,w);var V=On(j,h);for(w=0;w<M.length;w+=2){var ne=M[w],se=M[w+1];ne==="style"?hs(f,se):ne==="dangerouslySetInnerHTML"?_t(f,se):ne==="children"?an(f,se):z(f,ne,se,V)}switch(j){case"input":Vt(f,h);break;case"textarea":ge(f,h);break;case"select":var te=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!h.multiple;var xe=h.value;xe!=null?Ft(f,!!h.multiple,xe,!1):te!==!!h.multiple&&(h.defaultValue!=null?Ft(f,!!h.multiple,h.defaultValue,!0):Ft(f,!!h.multiple,h.multiple?[]:"",!1))}f[Jo]=h}catch(Ce){It(e,e.return,Ce)}}break;case 6:if(as(s,e),bs(e),u&4){if(e.stateNode===null)throw Error(r(162));f=e.stateNode,h=e.memoizedProps;try{f.nodeValue=h}catch(Ce){It(e,e.return,Ce)}}break;case 3:if(as(s,e),bs(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Bo(s.containerInfo)}catch(Ce){It(e,e.return,Ce)}break;case 4:as(s,e),bs(e);break;case 13:as(s,e),bs(e),f=e.child,f.flags&8192&&(h=f.memoizedState!==null,f.stateNode.isHidden=h,!h||f.alternate!==null&&f.alternate.memoizedState!==null||(wu=St())),u&4&&xh(e);break;case 22:if(ne=i!==null&&i.memoizedState!==null,e.mode&1?(fn=(V=fn)||ne,as(s,e),fn=V):as(s,e),bs(e),u&8192){if(V=e.memoizedState!==null,(e.stateNode.isHidden=V)&&!ne&&(e.mode&1)!==0)for(ke=e,ne=e.child;ne!==null;){for(se=ke=ne;ke!==null;){switch(te=ke,xe=te.child,te.tag){case 0:case 11:case 14:case 15:ui(4,te,te.return);break;case 1:fo(te,te.return);var Ne=te.stateNode;if(typeof Ne.componentWillUnmount=="function"){u=te,i=te.return;try{s=u,Ne.props=s.memoizedProps,Ne.state=s.memoizedState,Ne.componentWillUnmount()}catch(Ce){It(u,i,Ce)}}break;case 5:fo(te,te.return);break;case 22:if(te.memoizedState!==null){bh(se);continue}}xe!==null?(xe.return=te,ke=xe):bh(se)}ne=ne.sibling}e:for(ne=null,se=e;;){if(se.tag===5){if(ne===null){ne=se;try{f=se.stateNode,V?(h=f.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(j=se.stateNode,M=se.memoizedProps.style,w=M!=null&&M.hasOwnProperty("display")?M.display:null,j.style.display=Ln("display",w))}catch(Ce){It(e,e.return,Ce)}}}else if(se.tag===6){if(ne===null)try{se.stateNode.nodeValue=V?"":se.memoizedProps}catch(Ce){It(e,e.return,Ce)}}else if((se.tag!==22&&se.tag!==23||se.memoizedState===null||se===e)&&se.child!==null){se.child.return=se,se=se.child;continue}if(se===e)break e;for(;se.sibling===null;){if(se.return===null||se.return===e)break e;ne===se&&(ne=null),se=se.return}ne===se&&(ne=null),se.sibling.return=se.return,se=se.sibling}}break;case 19:as(s,e),bs(e),u&4&&xh(e);break;case 21:break;default:as(s,e),bs(e)}}function bs(e){var s=e.flags;if(s&2){try{e:{for(var i=e.return;i!==null;){if(gh(i)){var u=i;break e}i=i.return}throw Error(r(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(an(f,""),u.flags&=-33);var h=vh(e);vu(e,h,f);break;case 3:case 4:var w=u.stateNode.containerInfo,j=vh(e);gu(e,j,w);break;default:throw Error(r(161))}}catch(M){It(e,e.return,M)}e.flags&=-3}s&4096&&(e.flags&=-4097)}function d0(e,s,i){ke=e,kh(e)}function kh(e,s,i){for(var u=(e.mode&1)!==0;ke!==null;){var f=ke,h=f.child;if(f.tag===22&&u){var w=f.memoizedState!==null||La;if(!w){var j=f.alternate,M=j!==null&&j.memoizedState!==null||fn;j=La;var V=fn;if(La=w,(fn=M)&&!V)for(ke=f;ke!==null;)w=ke,M=w.child,w.tag===22&&w.memoizedState!==null?Nh(f):M!==null?(M.return=w,ke=M):Nh(f);for(;h!==null;)ke=h,kh(h),h=h.sibling;ke=f,La=j,fn=V}Sh(e)}else(f.subtreeFlags&8772)!==0&&h!==null?(h.return=f,ke=h):Sh(e)}}function Sh(e){for(;ke!==null;){var s=ke;if((s.flags&8772)!==0){var i=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:fn||Oa(5,s);break;case 1:var u=s.stateNode;if(s.flags&4&&!fn)if(i===null)u.componentDidMount();else{var f=s.elementType===s.type?i.memoizedProps:os(s.type,i.memoizedProps);u.componentDidUpdate(f,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var h=s.updateQueue;h!==null&&bp(s,h,u);break;case 3:var w=s.updateQueue;if(w!==null){if(i=null,s.child!==null)switch(s.child.tag){case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}bp(s,w,i)}break;case 5:var j=s.stateNode;if(i===null&&s.flags&4){i=j;var M=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":M.autoFocus&&i.focus();break;case"img":M.src&&(i.src=M.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var V=s.alternate;if(V!==null){var ne=V.memoizedState;if(ne!==null){var se=ne.dehydrated;se!==null&&Bo(se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}fn||s.flags&512&&mu(s)}catch(te){It(s,s.return,te)}}if(s===e){ke=null;break}if(i=s.sibling,i!==null){i.return=s.return,ke=i;break}ke=s.return}}function bh(e){for(;ke!==null;){var s=ke;if(s===e){ke=null;break}var i=s.sibling;if(i!==null){i.return=s.return,ke=i;break}ke=s.return}}function Nh(e){for(;ke!==null;){var s=ke;try{switch(s.tag){case 0:case 11:case 15:var i=s.return;try{Oa(4,s)}catch(M){It(s,i,M)}break;case 1:var u=s.stateNode;if(typeof u.componentDidMount=="function"){var f=s.return;try{u.componentDidMount()}catch(M){It(s,f,M)}}var h=s.return;try{mu(s)}catch(M){It(s,h,M)}break;case 5:var w=s.return;try{mu(s)}catch(M){It(s,w,M)}}}catch(M){It(s,s.return,M)}if(s===e){ke=null;break}var j=s.sibling;if(j!==null){j.return=s.return,ke=j;break}ke=s.return}}var f0=Math.ceil,Pa=I.ReactCurrentDispatcher,yu=I.ReactCurrentOwner,Qn=I.ReactCurrentBatchConfig,Qe=0,Yt=null,$t=null,sn=0,Wn=0,po=Ys(0),Wt=0,di=null,Rr=0,$a=0,xu=0,fi=null,Rn=null,wu=0,ho=1/0,Ps=null,za=!1,ku=null,nr=null,Fa=!1,sr=null,Ua=0,pi=0,Su=null,Ba=-1,Wa=0;function Sn(){return(Qe&6)!==0?St():Ba!==-1?Ba:Ba=St()}function rr(e){return(e.mode&1)===0?1:(Qe&2)!==0&&sn!==0?sn&-sn:Xx.transition!==null?(Wa===0&&(Wa=$o()),Wa):(e=Xe,e!==0||(e=window.event,e=e===void 0?16:Cf(e.type)),e)}function ls(e,s,i,u){if(50<pi)throw pi=0,Su=null,Error(r(185));Sr(e,i,u),((Qe&2)===0||e!==Yt)&&(e===Yt&&((Qe&2)===0&&($a|=i),Wt===4&&or(e,sn)),An(e,u),i===1&&Qe===0&&(s.mode&1)===0&&(ho=St()+500,va&&Zs()))}function An(e,s){var i=e.callbackNode;Zi(e,s);var u=kr(e,e===Yt?sn:0);if(u===0)i!==null&&At(i),e.callbackNode=null,e.callbackPriority=0;else if(s=u&-u,e.callbackPriority!==s){if(i!=null&&At(i),s===1)e.tag===0?qx(Ch.bind(null,e)):dp(Ch.bind(null,e)),Hx(function(){(Qe&6)===0&&Zs()}),i=null;else{switch(ue(u)){case 1:i=Ws;break;case 4:i=xs;break;case 16:i=Wr;break;case 536870912:i=Yi;break;default:i=Wr}i=Mh(i,Th.bind(null,e))}e.callbackPriority=s,e.callbackNode=i}}function Th(e,s){if(Ba=-1,Wa=0,(Qe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(mo()&&e.callbackNode!==i)return null;var u=kr(e,e===Yt?sn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||s)s=Ha(e,u);else{s=u;var f=Qe;Qe|=2;var h=jh();(Yt!==e||sn!==s)&&(Ps=null,ho=St()+500,Ir(e,s));do try{m0();break}catch(j){Eh(e,j)}while(!0);Fc(),Pa.current=h,Qe=f,$t!==null?s=0:(Yt=null,sn=0,s=Wt)}if(s!==0){if(s===2&&(f=Po(e),f!==0&&(u=f,s=bu(e,f))),s===1)throw i=di,Ir(e,0),or(e,u),An(e,St()),i;if(s===6)or(e,u);else{if(f=e.current.alternate,(u&30)===0&&!p0(f)&&(s=Ha(e,u),s===2&&(h=Po(e),h!==0&&(u=h,s=bu(e,h))),s===1))throw i=di,Ir(e,0),or(e,u),An(e,St()),i;switch(e.finishedWork=f,e.finishedLanes=u,s){case 0:case 1:throw Error(r(345));case 2:Dr(e,Rn,Ps);break;case 3:if(or(e,u),(u&130023424)===u&&(s=wu+500-St(),10<s)){if(kr(e,0)!==0)break;if(f=e.suspendedLanes,(f&u)!==u){Sn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=_c(Dr.bind(null,e,Rn,Ps),s);break}Dr(e,Rn,Ps);break;case 4:if(or(e,u),(u&4194240)===u)break;for(s=e.eventTimes,f=-1;0<u;){var w=31-xn(u);h=1<<w,w=s[w],w>f&&(f=w),u&=~h}if(u=f,u=St()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*f0(u/1960))-u,10<u){e.timeoutHandle=_c(Dr.bind(null,e,Rn,Ps),u);break}Dr(e,Rn,Ps);break;case 5:Dr(e,Rn,Ps);break;default:throw Error(r(329))}}}return An(e,St()),e.callbackNode===i?Th.bind(null,e):null}function bu(e,s){var i=fi;return e.current.memoizedState.isDehydrated&&(Ir(e,s).flags|=256),e=Ha(e,s),e!==2&&(s=Rn,Rn=i,s!==null&&Nu(s)),e}function Nu(e){Rn===null?Rn=e:Rn.push.apply(Rn,e)}function p0(e){for(var s=e;;){if(s.flags&16384){var i=s.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var u=0;u<i.length;u++){var f=i[u],h=f.getSnapshot;f=f.value;try{if(!ss(h(),f))return!1}catch{return!1}}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function or(e,s){for(s&=~xu,s&=~$a,e.suspendedLanes|=s,e.pingedLanes&=~s,e=e.expirationTimes;0<s;){var i=31-xn(s),u=1<<i;e[i]=-1,s&=~u}}function Ch(e){if((Qe&6)!==0)throw Error(r(327));mo();var s=kr(e,0);if((s&1)===0)return An(e,St()),null;var i=Ha(e,s);if(e.tag!==0&&i===2){var u=Po(e);u!==0&&(s=u,i=bu(e,u))}if(i===1)throw i=di,Ir(e,0),or(e,s),An(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=s,Dr(e,Rn,Ps),An(e,St()),null}function Tu(e,s){var i=Qe;Qe|=1;try{return e(s)}finally{Qe=i,Qe===0&&(ho=St()+500,va&&Zs())}}function Ar(e){sr!==null&&sr.tag===0&&(Qe&6)===0&&mo();var s=Qe;Qe|=1;var i=Qn.transition,u=Xe;try{if(Qn.transition=null,Xe=1,e)return e()}finally{Xe=u,Qn.transition=i,Qe=s,(Qe&6)===0&&Zs()}}function Cu(){Wn=po.current,ht(po)}function Ir(e,s){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Wx(i)),$t!==null)for(i=$t.return;i!==null;){var u=i;switch(Lc(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&ma();break;case 3:co(),ht(En),ht(cn),qc();break;case 5:Kc(u);break;case 4:co();break;case 13:ht(Tt);break;case 19:ht(Tt);break;case 10:Uc(u.type._context);break;case 22:case 23:Cu()}i=i.return}if(Yt=e,$t=e=ir(e.current,null),sn=Wn=s,Wt=0,di=null,xu=$a=Rr=0,Rn=fi=null,Er!==null){for(s=0;s<Er.length;s++)if(i=Er[s],u=i.interleaved,u!==null){i.interleaved=null;var f=u.next,h=i.pending;if(h!==null){var w=h.next;h.next=f,u.next=w}i.pending=u}Er=null}return e}function Eh(e,s){do{var i=$t;try{if(Fc(),Ea.current=Aa,ja){for(var u=Ct.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}ja=!1}if(_r=0,Xt=Bt=Ct=null,oi=!1,ii=0,yu.current=null,i===null||i.return===null){Wt=1,di=s,$t=null;break}e:{var h=e,w=i.return,j=i,M=s;if(s=sn,j.flags|=32768,M!==null&&typeof M=="object"&&typeof M.then=="function"){var V=M,ne=j,se=ne.tag;if((ne.mode&1)===0&&(se===0||se===11||se===15)){var te=ne.alternate;te?(ne.updateQueue=te.updateQueue,ne.memoizedState=te.memoizedState,ne.lanes=te.lanes):(ne.updateQueue=null,ne.memoizedState=null)}var xe=Zp(w);if(xe!==null){xe.flags&=-257,Jp(xe,w,j,h,s),xe.mode&1&&Qp(h,V,s),s=xe,M=V;var Ne=s.updateQueue;if(Ne===null){var Ce=new Set;Ce.add(M),s.updateQueue=Ce}else Ne.add(M);break e}else{if((s&1)===0){Qp(h,V,s),Eu();break e}M=Error(r(426))}}else if(wt&&j.mode&1){var Mt=Zp(w);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),Jp(Mt,w,j,h,s),$c(uo(M,j));break e}}h=M=uo(M,j),Wt!==4&&(Wt=2),fi===null?fi=[h]:fi.push(h),h=w;do{switch(h.tag){case 3:h.flags|=65536,s&=-s,h.lanes|=s;var B=Xp(h,M,s);Sp(h,B);break e;case 1:j=M;var O=h.type,H=h.stateNode;if((h.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(nr===null||!nr.has(H)))){h.flags|=65536,s&=-s,h.lanes|=s;var de=Yp(h,j,s);Sp(h,de);break e}}h=h.return}while(h!==null)}Rh(i)}catch(Ee){s=Ee,$t===i&&i!==null&&($t=i=i.return);continue}break}while(!0)}function jh(){var e=Pa.current;return Pa.current=Aa,e===null?Aa:e}function Eu(){(Wt===0||Wt===3||Wt===2)&&(Wt=4),Yt===null||(Rr&268435455)===0&&($a&268435455)===0||or(Yt,sn)}function Ha(e,s){var i=Qe;Qe|=2;var u=jh();(Yt!==e||sn!==s)&&(Ps=null,Ir(e,s));do try{h0();break}catch(f){Eh(e,f)}while(!0);if(Fc(),Qe=i,Pa.current=u,$t!==null)throw Error(r(261));return Yt=null,sn=0,Wt}function h0(){for(;$t!==null;)_h($t)}function m0(){for(;$t!==null&&!vs();)_h($t)}function _h(e){var s=Dh(e.alternate,e,Wn);e.memoizedProps=e.pendingProps,s===null?Rh(e):$t=s,yu.current=null}function Rh(e){var s=e;do{var i=s.alternate;if(e=s.return,(s.flags&32768)===0){if(i=a0(i,s,Wn),i!==null){$t=i;return}}else{if(i=l0(i,s),i!==null){i.flags&=32767,$t=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Wt=6,$t=null;return}}if(s=s.sibling,s!==null){$t=s;return}$t=s=e}while(s!==null);Wt===0&&(Wt=5)}function Dr(e,s,i){var u=Xe,f=Qn.transition;try{Qn.transition=null,Xe=1,g0(e,s,i,u)}finally{Qn.transition=f,Xe=u}return null}function g0(e,s,i,u){do mo();while(sr!==null);if((Qe&6)!==0)throw Error(r(327));i=e.finishedWork;var f=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var h=i.lanes|i.childLanes;if(Ji(e,h),e===Yt&&($t=Yt=null,sn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Fa||(Fa=!0,Mh(Wr,function(){return mo(),null})),h=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||h){h=Qn.transition,Qn.transition=null;var w=Xe;Xe=1;var j=Qe;Qe|=4,yu.current=null,u0(e,i),wh(i,e),Ox(Ec),ta=!!Cc,Ec=Cc=null,e.current=i,d0(i),ic(),Qe=j,Xe=w,Qn.transition=h}else e.current=i;if(Fa&&(Fa=!1,sr=e,Ua=f),h=e.pendingLanes,h===0&&(nr=null),Hr(i.stateNode),An(e,St()),s!==null)for(u=e.onRecoverableError,i=0;i<s.length;i++)f=s[i],u(f.value,{componentStack:f.stack,digest:f.digest});if(za)throw za=!1,e=ku,ku=null,e;return(Ua&1)!==0&&e.tag!==0&&mo(),h=e.pendingLanes,(h&1)!==0?e===Su?pi++:(pi=0,Su=e):pi=0,Zs(),null}function mo(){if(sr!==null){var e=ue(Ua),s=Qn.transition,i=Xe;try{if(Qn.transition=null,Xe=16>e?16:e,sr===null)var u=!1;else{if(e=sr,sr=null,Ua=0,(Qe&6)!==0)throw Error(r(331));var f=Qe;for(Qe|=4,ke=e.current;ke!==null;){var h=ke,w=h.child;if((ke.flags&16)!==0){var j=h.deletions;if(j!==null){for(var M=0;M<j.length;M++){var V=j[M];for(ke=V;ke!==null;){var ne=ke;switch(ne.tag){case 0:case 11:case 15:ui(8,ne,h)}var se=ne.child;if(se!==null)se.return=ne,ke=se;else for(;ke!==null;){ne=ke;var te=ne.sibling,xe=ne.return;if(mh(ne),ne===V){ke=null;break}if(te!==null){te.return=xe,ke=te;break}ke=xe}}}var Ne=h.alternate;if(Ne!==null){var Ce=Ne.child;if(Ce!==null){Ne.child=null;do{var Mt=Ce.sibling;Ce.sibling=null,Ce=Mt}while(Ce!==null)}}ke=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,ke=w;else e:for(;ke!==null;){if(h=ke,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:ui(9,h,h.return)}var B=h.sibling;if(B!==null){B.return=h.return,ke=B;break e}ke=h.return}}var O=e.current;for(ke=O;ke!==null;){w=ke;var H=w.child;if((w.subtreeFlags&2064)!==0&&H!==null)H.return=w,ke=H;else e:for(w=O;ke!==null;){if(j=ke,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Oa(9,j)}}catch(Ee){It(j,j.return,Ee)}if(j===w){ke=null;break e}var de=j.sibling;if(de!==null){de.return=j.return,ke=de;break e}ke=j.return}}if(Qe=f,Zs(),zn&&typeof zn.onPostCommitFiberRoot=="function")try{zn.onPostCommitFiberRoot(yr,e)}catch{}u=!0}return u}finally{Xe=i,Qn.transition=s}}return!1}function Ah(e,s,i){s=uo(i,s),s=Xp(e,s,1),e=er(e,s,1),s=Sn(),e!==null&&(Sr(e,1,s),An(e,s))}function It(e,s,i){if(e.tag===3)Ah(e,e,i);else for(;s!==null;){if(s.tag===3){Ah(s,e,i);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(nr===null||!nr.has(u))){e=uo(i,e),e=Yp(s,e,1),s=er(s,e,1),e=Sn(),s!==null&&(Sr(s,1,e),An(s,e));break}}s=s.return}}function v0(e,s,i){var u=e.pingCache;u!==null&&u.delete(s),s=Sn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(sn&i)===i&&(Wt===4||Wt===3&&(sn&130023424)===sn&&500>St()-wu?Ir(e,0):xu|=i),An(e,s)}function Ih(e,s){s===0&&((e.mode&1)===0?s=1:(s=Kr,Kr<<=1,(Kr&130023424)===0&&(Kr=4194304)));var i=Sn();e=Ms(e,s),e!==null&&(Sr(e,s,i),An(e,i))}function y0(e){var s=e.memoizedState,i=0;s!==null&&(i=s.retryLane),Ih(e,i)}function x0(e,s){var i=0;switch(e.tag){case 13:var u=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(r(314))}u!==null&&u.delete(s),Ih(e,i)}var Dh;Dh=function(e,s,i){if(e!==null)if(e.memoizedProps!==s.pendingProps||En.current)_n=!0;else{if((e.lanes&i)===0&&(s.flags&128)===0)return _n=!1,i0(e,s,i);_n=(e.flags&131072)!==0}else _n=!1,wt&&(s.flags&1048576)!==0&&fp(s,xa,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;Ma(e,s),e=s.pendingProps;var f=no(s,cn.current);lo(s,i),f=Qc(null,s,u,e,f,i);var h=Zc();return s.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,jn(u)?(h=!0,ga(s)):h=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Hc(s),f.updater=Ia,s.stateNode=f,f._reactInternals=s,ru(s,u,e,i),s=lu(null,s,u,!0,h,i)):(s.tag=0,wt&&h&&Mc(s),kn(null,s,f,i),s=s.child),s;case 16:u=s.elementType;e:{switch(Ma(e,s),e=s.pendingProps,f=u._init,u=f(u._payload),s.type=u,f=s.tag=k0(u),e=os(u,e),f){case 0:s=au(null,s,u,e,i);break e;case 1:s=oh(null,s,u,e,i);break e;case 11:s=eh(null,s,u,e,i);break e;case 14:s=th(null,s,u,os(u.type,e),i);break e}throw Error(r(306,u,""))}return s;case 0:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:os(u,f),au(e,s,u,f,i);case 1:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:os(u,f),oh(e,s,u,f,i);case 3:e:{if(ih(s),e===null)throw Error(r(387));u=s.pendingProps,h=s.memoizedState,f=h.element,kp(e,s),Ta(s,u,null,i);var w=s.memoizedState;if(u=w.element,h.isDehydrated)if(h={element:u,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=h,s.memoizedState=h,s.flags&256){f=uo(Error(r(423)),s),s=ah(e,s,u,i,f);break e}else if(u!==f){f=uo(Error(r(424)),s),s=ah(e,s,u,i,f);break e}else for(Bn=Xs(s.stateNode.containerInfo.firstChild),Un=s,wt=!0,rs=null,i=xp(s,null,u,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(oo(),u===f){s=Os(e,s,i);break e}kn(e,s,u,i)}s=s.child}return s;case 5:return Np(s),e===null&&Pc(s),u=s.type,f=s.pendingProps,h=e!==null?e.memoizedProps:null,w=f.children,jc(u,f)?w=null:h!==null&&jc(u,h)&&(s.flags|=32),rh(e,s),kn(e,s,w,i),s.child;case 6:return e===null&&Pc(s),null;case 13:return lh(e,s,i);case 4:return Vc(s,s.stateNode.containerInfo),u=s.pendingProps,e===null?s.child=io(s,null,u,i):kn(e,s,u,i),s.child;case 11:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:os(u,f),eh(e,s,u,f,i);case 7:return kn(e,s,s.pendingProps,i),s.child;case 8:return kn(e,s,s.pendingProps.children,i),s.child;case 12:return kn(e,s,s.pendingProps.children,i),s.child;case 10:e:{if(u=s.type._context,f=s.pendingProps,h=s.memoizedProps,w=f.value,ut(Sa,u._currentValue),u._currentValue=w,h!==null)if(ss(h.value,w)){if(h.children===f.children&&!En.current){s=Os(e,s,i);break e}}else for(h=s.child,h!==null&&(h.return=s);h!==null;){var j=h.dependencies;if(j!==null){w=h.child;for(var M=j.firstContext;M!==null;){if(M.context===u){if(h.tag===1){M=Ls(-1,i&-i),M.tag=2;var V=h.updateQueue;if(V!==null){V=V.shared;var ne=V.pending;ne===null?M.next=M:(M.next=ne.next,ne.next=M),V.pending=M}}h.lanes|=i,M=h.alternate,M!==null&&(M.lanes|=i),Bc(h.return,i,s),j.lanes|=i;break}M=M.next}}else if(h.tag===10)w=h.type===s.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=i,j=w.alternate,j!==null&&(j.lanes|=i),Bc(w,i,s),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===s){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}kn(e,s,f.children,i),s=s.child}return s;case 9:return f=s.type,u=s.pendingProps.children,lo(s,i),f=Xn(f),u=u(f),s.flags|=1,kn(e,s,u,i),s.child;case 14:return u=s.type,f=os(u,s.pendingProps),f=os(u.type,f),th(e,s,u,f,i);case 15:return nh(e,s,s.type,s.pendingProps,i);case 17:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:os(u,f),Ma(e,s),s.tag=1,jn(u)?(e=!0,ga(s)):e=!1,lo(s,i),Gp(s,u,f),ru(s,u,f,i),lu(null,s,u,!0,e,i);case 19:return uh(e,s,i);case 22:return sh(e,s,i)}throw Error(r(156,s.tag))};function Mh(e,s){return Je(e,s)}function w0(e,s,i,u){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(e,s,i,u){return new w0(e,s,i,u)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function k0(e){if(typeof e=="function")return ju(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ye)return 11;if(e===J)return 14}return 2}function ir(e,s){var i=e.alternate;return i===null?(i=Zn(e.tag,s,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=s,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,s=e.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Va(e,s,i,u,f,h){var w=2;if(u=e,typeof e=="function")ju(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case K:return Mr(i.children,f,h,s);case $:w=8,f|=8;break;case Z:return e=Zn(12,i,s,f|2),e.elementType=Z,e.lanes=h,e;case Se:return e=Zn(13,i,s,f),e.elementType=Se,e.lanes=h,e;case Oe:return e=Zn(19,i,s,f),e.elementType=Oe,e.lanes=h,e;case oe:return Ka(i,f,h,s);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case he:w=10;break e;case ce:w=9;break e;case ye:w=11;break e;case J:w=14;break e;case re:w=16,u=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return s=Zn(w,i,s,f),s.elementType=e,s.type=u,s.lanes=h,s}function Mr(e,s,i,u){return e=Zn(7,e,u,s),e.lanes=i,e}function Ka(e,s,i,u){return e=Zn(22,e,u,s),e.elementType=oe,e.lanes=i,e.stateNode={isHidden:!1},e}function _u(e,s,i){return e=Zn(6,e,null,s),e.lanes=i,e}function Ru(e,s,i){return s=Zn(4,e.children!==null?e.children:[],e.key,s),s.lanes=i,s.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},s}function S0(e,s,i,u,f){this.tag=s,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=zo(0),this.expirationTimes=zo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zo(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Au(e,s,i,u,f,h,w,j,M){return e=new S0(e,s,i,j,M),s===1?(s=1,h===!0&&(s|=8)):s=0,h=Zn(3,null,null,s),e.current=h,h.stateNode=e,h.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hc(h),e}function b0(e,s,i){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:u==null?null:""+u,children:e,containerInfo:s,implementation:i}}function Lh(e){if(!e)return Qs;e=e._reactInternals;e:{if(We(e)!==e||e.tag!==1)throw Error(r(170));var s=e;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(jn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(jn(i))return cp(e,i,s)}return s}function Oh(e,s,i,u,f,h,w,j,M){return e=Au(i,u,!0,e,f,h,w,j,M),e.context=Lh(null),i=e.current,u=Sn(),f=rr(i),h=Ls(u,f),h.callback=s??null,er(i,h,f),e.current.lanes=f,Sr(e,f,u),An(e,u),e}function Ga(e,s,i,u){var f=s.current,h=Sn(),w=rr(f);return i=Lh(i),s.context===null?s.context=i:s.pendingContext=i,s=Ls(h,w),s.payload={element:e},u=u===void 0?null:u,u!==null&&(s.callback=u),e=er(f,s,w),e!==null&&(ls(e,f,w,h),Na(e,f,w)),w}function qa(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ph(e,s){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<s?i:s}}function Iu(e,s){Ph(e,s),(e=e.alternate)&&Ph(e,s)}function N0(){return null}var $h=typeof reportError=="function"?reportError:function(e){console.error(e)};function Du(e){this._internalRoot=e}Xa.prototype.render=Du.prototype.render=function(e){var s=this._internalRoot;if(s===null)throw Error(r(409));Ga(e,s,null,null)},Xa.prototype.unmount=Du.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var s=e.containerInfo;Ar(function(){Ga(null,e,null,null)}),s[Rs]=null}};function Xa(e){this._internalRoot=e}Xa.prototype.unstable_scheduleHydration=function(e){if(e){var s=Te();e={blockedOn:null,target:e,priority:s};for(var i=0;i<Ks.length&&s!==0&&s<Ks[i].priority;i++);Ks.splice(i,0,e),i===0&&Nf(e)}};function Mu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ya(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zh(){}function T0(e,s,i,u,f){if(f){if(typeof u=="function"){var h=u;u=function(){var V=qa(w);h.call(V)}}var w=Oh(s,u,e,0,null,!1,!1,"",zh);return e._reactRootContainer=w,e[Rs]=w.current,Qo(e.nodeType===8?e.parentNode:e),Ar(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof u=="function"){var j=u;u=function(){var V=qa(M);j.call(V)}}var M=Au(e,0,!1,null,null,!1,!1,"",zh);return e._reactRootContainer=M,e[Rs]=M.current,Qo(e.nodeType===8?e.parentNode:e),Ar(function(){Ga(s,M,i,u)}),M}function Qa(e,s,i,u,f){var h=i._reactRootContainer;if(h){var w=h;if(typeof f=="function"){var j=f;f=function(){var M=qa(w);j.call(M)}}Ga(s,w,e,f)}else w=T0(i,s,e,f,u);return qa(w)}T=function(e){switch(e.tag){case 3:var s=e.stateNode;if(s.current.memoizedState.isDehydrated){var i=wr(s.pendingLanes);i!==0&&(Vs(s,i|1),An(s,St()),(Qe&6)===0&&(ho=St()+500,Zs()))}break;case 13:Ar(function(){var u=Ms(e,1);if(u!==null){var f=Sn();ls(u,e,1,f)}}),Iu(e,1)}},U=function(e){if(e.tag===13){var s=Ms(e,134217728);if(s!==null){var i=Sn();ls(s,e,134217728,i)}Iu(e,134217728)}},ee=function(e){if(e.tag===13){var s=rr(e),i=Ms(e,s);if(i!==null){var u=Sn();ls(i,e,s,u)}Iu(e,s)}},Te=function(){return Xe},Re=function(e,s){var i=Xe;try{return Xe=e,s()}finally{Xe=i}},Kt=function(e,s,i){switch(s){case"input":if(Vt(e,i),s=i.name,i.type==="radio"&&s!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<i.length;s++){var u=i[s];if(u!==e&&u.form===e.form){var f=ha(u);if(!f)throw Error(r(90));pe(u),Vt(u,f)}}}break;case"textarea":ge(e,i);break;case"select":s=i.value,s!=null&&Ft(e,!!i.multiple,s,!1)}},yt=Tu,xt=Ar;var C0={usingClientEntryPoint:!1,Events:[ei,eo,ha,ft,Gt,Tu]},hi={findFiberByHostInstance:br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},E0={bundleType:hi.bundleType,version:hi.version,rendererPackageName:hi.rendererPackageName,rendererConfig:hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=$n(e),e===null?null:e.stateNode},findFiberByHostInstance:hi.findFiberByHostInstance||N0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Za=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Za.isDisabled&&Za.supportsFiber)try{yr=Za.inject(E0),zn=Za}catch{}}return In.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C0,In.createPortal=function(e,s){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mu(s))throw Error(r(200));return b0(e,s,null,i)},In.createRoot=function(e,s){if(!Mu(e))throw Error(r(299));var i=!1,u="",f=$h;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=Au(e,1,!1,null,null,i,!1,u,f),e[Rs]=s.current,Qo(e.nodeType===8?e.parentNode:e),new Du(s)},In.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var s=e._reactInternals;if(s===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=$n(s),e=e===null?null:e.stateNode,e},In.flushSync=function(e){return Ar(e)},In.hydrate=function(e,s,i){if(!Ya(s))throw Error(r(200));return Qa(null,e,s,!0,i)},In.hydrateRoot=function(e,s,i){if(!Mu(e))throw Error(r(405));var u=i!=null&&i.hydratedSources||null,f=!1,h="",w=$h;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),s=Oh(s,null,e,1,i??null,f,!1,h,w),e[Rs]=s.current,Qo(e),u)for(e=0;e<u.length;e++)i=u[e],f=i._getVersion,f=f(i._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[i,f]:s.mutableSourceEagerHydrationData.push(i,f);return new Xa(s)},In.render=function(e,s,i){if(!Ya(s))throw Error(r(200));return Qa(null,e,s,!1,i)},In.unmountComponentAtNode=function(e){if(!Ya(e))throw Error(r(40));return e._reactRootContainer?(Ar(function(){Qa(null,null,e,!1,function(){e._reactRootContainer=null,e[Rs]=null})}),!0):!1},In.unstable_batchedUpdates=Tu,In.unstable_renderSubtreeIntoContainer=function(e,s,i,u){if(!Ya(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Qa(e,s,i,!1,u)},In.version="18.3.1-next-f1338f8080-20240426",In}var Gh;function Xg(){if(Gh)return Pu.exports;Gh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),Pu.exports=O0(),Pu.exports}var qh;function P0(){if(qh)return Ja;qh=1;var t=Xg();return Ja.createRoot=t.createRoot,Ja.hydrateRoot=t.hydrateRoot,Ja}var $0=P0();const z0=qg($0),Xh=t=>{let n;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(n):m;if(!Object.is(k,n)){const y=n;n=v??(typeof k!="object"||k===null)?k:Object.assign({},n,k),r.forEach(S=>S(n,y))}},a=()=>n,p={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=n=t(o,a,p);return p},F0=(t=>t?Xh(t):Xh),U0=t=>t;function B0(t,n=U0){const r=ct.useSyncExternalStore(t.subscribe,ct.useCallback(()=>n(t.getState()),[t,n]),ct.useCallback(()=>n(t.getInitialState()),[t,n]));return ct.useDebugValue(r),r}const W0=t=>{const n=F0(t),r=o=>B0(n,o);return Object.assign(r,n),r},H0=(t=>W0),Yg="agentpane:machines",Qg="agentpane:active-machine";function V0(t){return/^[a-z][a-z0-9-]{1,30}$/.test(t)}function Zg(t){return`${t}.repoburg.com`}function Jg(t){const n=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(t);return n?n[1]:null}function ev(t,n){try{const r=localStorage.getItem(t);return r==null?n:JSON.parse(r)}catch{return n}}function tv(t,n){try{localStorage.setItem(t,JSON.stringify(n))}catch{}}function K0(t){const{mahlas:n,hostname:r}=t??{};return typeof n=="string"&&V0(n)&&r===Zg(n)}function nv(){const t=ev(Yg,[]);return Array.isArray(t)?t.filter(K0):[]}function G0(t){const n={mahlas:t,hostname:Zg(t),lastConnectedAt:new Date().toISOString()},r=nv(),o=[n,...r.filter(a=>a.mahlas!==t)];return tv(Yg,o),n}function q0(){const t=ev(Qg,null);return t?nv().find(n=>n.mahlas===t)??null:null}function X0(t){tv(Qg,t)}function Y0(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("host");if(!t)return;const n=Jg(t);n&&(G0(n),X0(n))}const Yh="http://localhost:9998",Q0=["agent.repoburg.com"];function mn(){if(typeof window>"u")return"";const t=new URLSearchParams(window.location.search),n=t.get("bport");if(n)return`http://localhost:${n}`;const r=t.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Q0.includes(o))return Yh;if(Jg(o))return"";const a=q0();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Yh}function Z0(t){const n=mn();return n?`${n.replace(/^http/,"ws")}${t}`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${t}`}const J0="/api";class Ui extends Error{constructor(r,o,a){super(r);it(this,"status");it(this,"body");this.name="ApiError",this.status=o,this.body=a}}function $r(t){var n;if(t instanceof Ui){const r=(n=t.body)==null?void 0:n.error;if(typeof r=="string"&&r)return r}return t instanceof Error?t.message:String(t)}async function Bi(t,n,r){const o=await fetch(`${mn()}${J0}${n}`,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`,c=null;try{c=await o.json();const d=c==null?void 0:c.error;typeof d=="string"&&d&&(a=`${a} — ${d}`)}catch{}throw new Ui(`${t} ${n} failed: ${a}`,o.status,c)}return o.json()}function Et(t){return Bi("GET",t)}function at(t,n){return Bi("POST",t,n)}function Hl(t){return Bi("DELETE",t)}function ds(t,n){return Bi("PATCH",t,n)}function ew(t,n){return Bi("PUT",t,n)}const Ts=new Map;function Fd(t,n,r){return`${t}
|
|
42
|
-
${n}
|
|
43
|
-
${r}`}function tw(t,n,r,o){const a=Fd(t,n,r),c=Ts.get(a);return c?(c.text+=o,c.text):(Ts.set(a,{sessionId:t,turnId:n,itemId:r,text:o}),o)}function nw(t,n){for(const[o,a]of Ts)(t===null||a.sessionId===t)&&Ts.delete(o);const r=n.filter(o=>o&&typeof o.sessionId=="string"&&typeof o.turnId=="string"&&typeof o.itemId=="string"&&typeof o.text=="string");for(const o of r)Ts.set(Fd(o.sessionId,o.turnId,o.itemId),{...o});return r}function Fu(t,n,r){var c;const o=r==null?void 0:r.external_item_id;if(!r||!o)return;const a=Fd(t,n,o);if(r.status==="in_progress"){const d=(c=r.data)==null?void 0:c.text;typeof d=="string"&&Ts.set(a,{sessionId:t,turnId:n,itemId:o,text:d});return}Ts.delete(a)}function gi(t,n){for(const[r,o]of Ts)o.sessionId===t&&o.turnId===n&&Ts.delete(r)}function sv(t,n,r){var p;const o=t.items??[];let a=-1;for(let g=o.length-1;g>=0;g--)if(o[g].external_item_id===n){a=g;break}if(a>=0){const g=o[a];if(g.status!=="in_progress"||((p=g.data)==null?void 0:p.text)===r)return t;const m=[...o];return m[a]={...g,data:{...g.data,text:r}},{...t,items:m,...g.type==="agent_message"?{agent_response:r}:{}}}const c=new Date().toISOString(),d={id:`delta-${n}`,turn_id:t.id,external_item_id:n,type:"agent_message",data:{text:r},status:"in_progress",created_at:c,updated_at:c};return{...t,items:[...o,d],agent_response:r}}function sw(t){var d;const n=[...Ts.values()].filter(p=>p.sessionId===t.id);if(n.length===0)return t;const r=p=>{if(p.status!=="running")return p;let g=p;for(const m of n)m.turnId===p.id&&(g=sv(g,m.itemId,m.text));return g},o=(t.turns??[]).map(r),a=(d=t.threads)==null?void 0:d.map(p=>{const g=(p.turns??[]).map(r);return g.some((m,v)=>{var k;return m!==((k=p.turns)==null?void 0:k[v])})?{...p,turns:g}:p});return o.some((p,g)=>p!==t.turns[g])||(a==null?void 0:a.some((p,g)=>{var m;return p!==((m=t.threads)==null?void 0:m[g])}))?{...t,turns:o,...a?{threads:a}:{}}:t}function rw(){return Et("/sessions")}function vi(t){return Et(`/sessions/${t}?items=summary`).then(sw)}function ow(t,n){return Et(`/sessions/${t}/turns/${n}`)}function Ud(t){return at("/sessions",t)}function Qh(t){return Hl(`/sessions/${t}`)}function rv(t,n,r,o){return at(`/sessions/${t}/turns`,{user_prompt:n,...r!=null&&r.length?{attachments:r}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function iw(t){return at(`/sessions/${t}/cancel`)}function aw(t,n){return at(`/sessions/${t}/turns/${n}/resume`)}function lw(){return at("/turns/resume-signed-out")}function cw(t,n){return ds(`/sessions/${t}`,{title:n})}function Zh(t){return ds(`/sessions/${t}`,{lifecycle:"finished"})}function Jh(t){return ds(`/sessions/${t}`,{lifecycle:"working"})}function uw(t,n){return ds(`/sessions/${t}`,{starred:n})}function em(t){return ds(`/sessions/${t}`,{has_unreviewed:0})}function dw(t,n,r,o){const a={model:n,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),ds(`/sessions/${t}`,a)}function fw(t,n){return ds(`/sessions/${t}`,{runtime_config:n})}function pw(t,n){return at(`/sessions/${t}/rewind`,{turn_id:n})}function hw(t){return at(`/sessions/${t}/restore`,{})}function mw(t,n,r){return at(`/sessions/${t}/branch`,{turn_id:n,title:r})}function ov(){return Et("/workspaces")}function gw(t,n){return at("/workspaces",{path:t,label:n})}function vw(t){return at("/workspaces/hide",{path:t})}function yw(){return Et("/workspaces/picker")}function tm(t){return Et(t?`/workspaces/browse?path=${encodeURIComponent(t)}`:"/workspaces/browse")}async function iv(){const t=await fetch(`${mn()}/api/pick-directory`);if(t.status===204)return{cancelled:!0};if(!t.ok)throw new Error(`GET /api/pick-directory failed: ${t.status} ${t.statusText}`);return t.json()}function av(){return Et("/folders")}function xw(t,n){return at("/folders",{workspace_path:t,name:n})}function nm(t,n){return ds(`/folders/${t}`,n)}function ww(t){return Hl(`/folders/${t}`)}function kw(t){return at("/sessions/reorder",{moves:t})}function Fs(t){return t.status==="pending"||t.status==="running"}function lv(t){return!!(t!=null&&t.turns.some(Fs))}function Vl(t){return t?t.turns.some(Fs)||(t.threads??[]).some(n=>(n.turns??[]).some(Fs)):!1}const Sw="s:",fd="a:",zr=t=>`${Sw}${t}`,Ii=t=>`${fd}${t}`;function hr(t){return{kind:t.startsWith(fd)?"app":"session",id:t.slice(fd.length)}}function Bd(t){return t.activeAppTabId!==null?Ii(t.activeAppTabId):t.activeSessionId===null?null:zr(t.activeSessionId)}function cv(t,n,r){const o=[...n.map(zr),...r.map(Ii)],a=new Set(o),c=t.filter(g=>a.has(g)),d=new Set(c),p=o.filter(g=>!d.has(g));return p.length===0&&c.length===t.length?t:[...c,...p]}function bw(t){return t.subscribe((n,r)=>{if(n.openTabs===r.openTabs&&n.openAppTabs===r.openAppTabs)return;const o=cv(n.tabOrder,n.openTabs,n.openAppTabs);o!==n.tabOrder&&t.setState({tabOrder:o})})}function sm(t,n,r){const o=t.indexOf(n);return t.slice(o+1).find(r)??t.slice(0,Math.max(o,0)).reverse().find(r)??null}function Wd(t,n){const r=d=>!n.has(d),o=Bd(t);let{activeSessionId:a,activeAppTabId:c}=t;if(o!==null&&n.has(o)){const d=sm(t.tabOrder,o,r),p=d===null?null:hr(d);c=(p==null?void 0:p.kind)==="app"?p.id:null,(p==null?void 0:p.kind)==="session"&&(a=p.id)}if(a!==null&&n.has(zr(a))){const d=g=>r(g)&&hr(g).kind==="session",p=sm(t.tabOrder,zr(a),d);a=p===null?null:hr(p).id}return{activeSessionId:a,activeAppTabId:c}}function uv(t,n){if(t.tabOrder.includes(n))return!1;const{kind:r,id:o}=hr(n);return(r==="app"?t.apps:t.sessions).some(c=>c.id===o)}const dv=1;function fv(){let t="";try{t=mn()}catch{}return`agentpane:tabs:${t||window.location.origin}`}function Uu(t){return Array.isArray(t)&&t.every(n=>typeof n=="string")}function rm(t){return t===null||typeof t=="string"}function Nw(t){if(t==null)return null;let n;try{n=JSON.parse(t)}catch{return null}if(typeof n!="object"||n===null)return null;const r=n;return r.v!==dv||!Uu(r.openTabs)||!rm(r.activeSessionId)||!Uu(r.openAppTabs)||!rm(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId,tabOrder:Uu(r.tabOrder)?r.tabOrder:[]}}const pv=[()=>window.sessionStorage,()=>window.localStorage];function Tw(){const t=fv();for(const n of pv)try{const r=Nw(n().getItem(t));if(r)return r}catch{}return null}function Cw(t){const n=fv(),r=JSON.stringify({v:dv,openTabs:t.openTabs,activeSessionId:t.activeSessionId,openAppTabs:t.openAppTabs,activeAppTabId:t.activeAppTabId,tabOrder:t.tabOrder});for(const o of pv)try{o().setItem(n,r)}catch{}}function Ew(t){return t.subscribe((n,r)=>{(n.openTabs!==r.openTabs||n.activeSessionId!==r.activeSessionId||n.openAppTabs!==r.openAppTabs||n.activeAppTabId!==r.activeAppTabId||n.tabOrder!==r.tabOrder)&&Cw(n)})}function Ci(t){return[...new Set(t)]}function jw(t,n,r,o){const a=v=>r===null||r.has(v),c=Ci(((t==null?void 0:t.openTabs)??[]).filter(v=>n.has(v))),d=Ci(((t==null?void 0:t.openAppTabs)??[]).filter(a));let p=(t==null?void 0:t.activeSessionId)??null;p!==null&&!n.has(p)&&(p=null),p!==null&&!c.includes(p)&&c.push(p),p??(p=c.at(-1)??null);let g=(t==null?void 0:t.activeAppTabId)??null;g!==null&&!a(g)&&(g=null),g!==null&&!d.includes(g)&&d.push(g),o!==null&&n.has(o)&&(c.includes(o)||c.push(o),p=o,g=null);const m=cv(Ci((t==null?void 0:t.tabOrder)??[]),c,d);return{openTabs:c,activeSessionId:p,openAppTabs:d,activeAppTabId:g,tabOrder:m}}const Us=new Map,Hd=new Map,Kl=new Map,kl=new Set,Vd=new Map,Gl=new Map;function _w(t,n,r=""){Us.set(t,n),Hd.set(t,r)}function Rw(t){Us.delete(t),Hd.delete(t)}function dl(t,n){Kl.set(t,n)}function Aw(t,n){n?kl.add(t):kl.delete(t)}function om(t,n,r){const o=Kl.get(t);if(!o||kl.has(o))return;const a=Us.get(o);a&&a({source:"agentpane-host",event:n,payload:r})}function im(t,n){const r=Kl.get(t);if(!r||kl.has(r))return;const o=Us.get(r);o&&o({source:"agentpane-host",event:"background_tasks",payload:{sessionId:t,tasks:n}})}function Iw(t,n,r,o,a,c=null){if(typeof a=="string"&&a!==Hd.get(t))return;const d=Us.get(t);d&&d({source:"agentpane-host",event:"tool_call",payload:{callId:n,tool:r,name:r,args:o,caller:c}})}function Dw(t,n,r,o){const a=Kl.get(t);if(!a)return;const c=Us.get(a);c&&c({source:"agentpane-host",event:"turn:delta",payload:{sessionId:t,turnId:n,itemId:r,delta:o}})}function Mw(t,n){Vd.set(t,n)}function Lw(t){Vd.delete(t)}function Ow(t,n){Gl.set(t,n)}function Pw(t){Gl.delete(t)}function hv(t,n={}){const r=Gl.get(t);if(r){r(n);return}const o=Us.get(t);o&&o({source:"agentpane-host",event:"state_changed",payload:{}})}function $w(){for(const t of new Set([...Us.keys(),...Gl.keys()]))hv(t)}function zw(t){var r;const n=Us.get(t);n&&n({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Vd.get(t))==null||r()}const Fw=(t,n)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},signedOutTurns:{},setWsConnected:r=>t({wsConnected:r}),onTurnCreated:(r,o)=>{t(a=>{const c=a.sessionDetails[r];return!c||o.thread_id?{}:c.turns.some(d=>d.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[r]:{...c,turns:[...c.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{n().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),t(a=>{const c=cr(a.sessions,r,()=>({is_running:1,status:"running"})),d=a.sessionDetails[r];if(!d)return{sessions:c};const p=d.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...bn(d,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:c,activeTurnIndex:a.activeSessionId===r&&p>=0?p:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{n().addLogEntry("DEBUG",`item:started — ${a.type}`),t(c=>{const d=am(a)?lr(c.retryStates,o):c.retryStates,p=c.sessionDetails[r];return p?{sessionDetails:{...c.sessionDetails,[r]:bn(p,o,g=>Wu(g,a))},retryStates:d}:{retryStates:d}})},onItemUpdated:(r,o,a)=>{t(c=>{const d=c.sessionDetails[r];return d?{sessionDetails:{...c.sessionDetails,[r]:bn(d,o,p=>Wu(p,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(n().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const c=a.data||{},d=c.task_type||"unknown",p=c.description||"background task",m=d==="local_agent"?"Subagent":d==="local_bash"?"Monitor":"Task";a.status==="completed"?n().addToast("success",`${m} completed: ${p}`):c.status!=="stopped"&&n().addToast("error",`${m} failed: ${p}`)}t(c=>{const d=am(a)?lr(c.retryStates,o):c.retryStates,p=c.sessionDetails[r];return p?{retryStates:d,sessionDetails:{...c.sessionDetails,[r]:bn(p,o,g=>{var v,k;let m=Wu(g,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const y=m.thoughts?m.thoughts+`
|
|
44
|
-
`+a.data.text:a.data.text;m={...m,thoughts:y}}return m})}}:{retryStates:d}})},onItemDelta:(r,o,a,c,d)=>{Dw(r,o,a,c),t(p=>{const g=lr(p.retryStates,o),m=p.sessionDetails[r];return m?{sessionDetails:{...p.sessionDetails,[r]:bn(m,o,v=>Hw(v,a,c,d))},retryStates:g}:{retryStates:g}})},onItemText:(r,o,a,c)=>{t(d=>{const p=d.sessionDetails[r];if(!p)return{};const g=bn(p,o,m=>m.status==="running"?sv(m,a,c):m);return{sessionDetails:{...d.sessionDetails,[r]:g}}})},onWidgetDelta:(r,o,a,c,d)=>{t(p=>{const g=lr(p.retryStates,o),m=p.sessionDetails[r];return m?{sessionDetails:{...p.sessionDetails,[r]:bn(m,o,v=>Ww(v,a,c,d))},retryStates:g}:{retryStates:g}})},onTurnCompleted:(r,o,a,c,d)=>{n().dropSignedOutTurn(o);const p=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;n().addLogEntry("INFO",`turn:completed — ${p} in / ${g} out`),om(r,"turn:completed",{sessionId:r,turnId:o,response:d??null}),n().refreshApps(),t(m=>{const v=m.sessionDetails[r],k=v?bn(v,o,N=>({...N,status:"completed",token_usage:a??N.token_usage??null,...d&&!N.agent_response?{agent_response:d}:{}})):null,y=Bu(k),S=y&&k?el(k):"active",C=cr(m.sessions,r,N=>({is_running:y,status:S,has_unreviewed:c?1:N.has_unreviewed})),b=lr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:y,status:S,has_unreviewed:c?1:k.has_unreviewed}},sessions:C,retryStates:b}:{sessions:C,retryStates:b}})},onTokenUsageUpdated:(r,o,a)=>{t(c=>{const d=c.sessionDetails[r];return d?{sessionDetails:{...c.sessionDetails,[r]:bn(d,o,p=>({...p,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{t(a=>{const c=a.sessionDetails[r];return c?{sessionDetails:{...a.sessionDetails,[r]:{...c,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a,c)=>{n().dropSignedOutTurn(o),n().addLogEntry("ERROR",`turn:failed — ${a}`),n().addToast("error",`Turn failed — ${a}`),om(r,"turn:failed",{sessionId:r,turnId:o,error:a}),t(d=>{const p=d.sessionDetails[r],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=p?bn(p,o,b=>({...b,status:m,error:a,...c?{resume_state:c}:{},items:b.items.map(N=>N.status==="in_progress"?{...N,status:"failed"}:N)})):null,k=Bu(v),y=k&&v?el(v):g?"active":"failed",S=cr(d.sessions,r,()=>({is_running:k,status:y})),C=lr(d.retryStates,o);return v?{sessionDetails:{...d.sessionDetails,[r]:{...v,is_running:k,status:y}},sessions:S,retryStates:C}:{sessions:S,retryStates:C}})},onTurnCancelled:(r,o)=>{n().dropSignedOutTurn(o),t(a=>{const c=a.sessionDetails[r],d=c?bn(c,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(y=>y.status==="in_progress"?{...y,status:"completed"}:y)})):null,p=Bu(d),g=p&&d?el(d):"active",m=cr(a.sessions,r,()=>({is_running:p,status:g})),v=lr(a.retryStates,o);return d?{sessionDetails:{...a.sessionDetails,[r]:{...d,is_running:p,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,a)=>{n().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),n().addToast("warn",Uw(a.reason)),a.reason==="auth"?t(c=>({signedOutTurns:{...c.signedOutTurns,[o]:r}})):n().dropSignedOutTurn(o),t(c=>{const d=c.sessionDetails[r],p=d?bn(d,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts,resume_at:a.resumeAt??null})):null,g=p?el(p):"interrupted",m=cr(c.sessions,r,()=>({is_running:1,status:g})),v=lr(c.retryStates,o);return p?{sessionDetails:{...c.sessionDetails,[r]:{...p,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,a)=>{n().dropSignedOutTurn(o),n().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),t(c=>{const d=cr(c.sessions,r,()=>({is_running:1,status:"running"})),p=c.sessionDetails[r];return p?{sessionDetails:{...c.sessionDetails,[r]:{...bn(p,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:d}:{sessions:d}})},onTurnResumed:(r,o)=>{n().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),n().addToast("success","Interrupted turn resumed"),t(a=>{const c=a.sessionDetails[r];return c?{sessionDetails:{...a.sessionDetails,[r]:bn(c,o,d=>({...d,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,a)=>{n().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),t(c=>({retryStates:{...c.retryStates,[o]:a}}))},onSessionTitle:(r,o)=>{t(a=>({sessions:a.sessions.map(c=>c.id===r?{...c,title:o}:c),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onSessionTouched:r=>{t(o=>{const a=o.sessionDetails[r];return{sessions:cr(o.sessions,r,()=>({user_touched:1})),sessionDetails:a?{...o.sessionDetails,[r]:{...a,user_touched:1}}:o.sessionDetails}})},onSessionUpdated:r=>{const o={...r};delete o.is_running,delete o.status,t(a=>{const c=a.sessionDetails[r.id];return{sessions:cr(a.sessions,r.id,()=>o),sessionDetails:c?{...a.sessionDetails,[r.id]:{...c,...o}}:a.sessionDetails}})},onBackgroundTasksChanged:(r,o)=>{im(r,o),t(a=>{if(o.length===0&&!a.backgroundTasks[r])return{};const c={...a.backgroundTasks};return o.length>0?c[r]=o:delete c[r],{backgroundTasks:c}})},onSignedOutTurnsSnapshot:r=>t({signedOutTurns:Object.fromEntries(r.map(o=>[o.turnId,o.sessionId]))}),dropSignedOutTurn:r=>{if(!(r in n().signedOutTurns))return;const o={...n().signedOutTurns};delete o[r],t({signedOutTurns:o})},onBackgroundTasksSnapshot:r=>{for(const[a,c]of Object.entries(r))im(a,c);const o={};for(const[a,c]of Object.entries(r))c.length>0&&(o[a]=c);t({backgroundTasks:o})}});function Uw(t){switch(t){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";case"auth":return"Claude is signed out — the turn waits until you sign in again";case"usage_limit":return"Usage limit reached — the turn waits until it is over";default:return"The agent host restarted — resuming the turn"}}function el(t){const n=[...t.turns,...(t.threads??[]).flatMap(r=>r.turns??[])].filter(Fs);return n.length>0&&n.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function am(t){return t.type!=="background_task"&&t.type!=="error"&&t.type!=="interruption"}function lr(t,n){if(!(n in t))return t;const r={...t};return delete r[n],r}function Bu(t){return t&&(t.turns.some(Fs)||(t.threads??[]).some(r=>(r.turns??[]).some(Fs)))?1:0}function cr(t,n,r){return t.some(o=>o.id===n)?t.map(o=>o.id===n?{...o,...r(o)}:o):t}function bn(t,n,r){const o=(t.threads??[]).map(a=>(a.turns??[]).some(c=>c.id===n)?{...a,turns:(a.turns??[]).map(c=>c.id===n?r(c):c)}:a);return{...t,turns:t.turns.map(a=>a.id===n?r(a):a),threads:o}}function Kd(t,n){for(let r=t.length-1;r>=0;r--)if(t[r].external_item_id===n)return r;return-1}function Wu(t,n){const r=Kd(t.items,n.external_item_id);if(r>=0){const c=[...t.items];return c[r]=n,{...t,items:c}}if(n.type==="agent_message"){const c=t.items.filter(d=>!(d.type==="agent_message"&&d.id.startsWith("delta-")));return{...t,items:[...c,n]}}const o=t.items;let a=o.length;if(t.deferred_item_count)for(;a>0&&o[a-1].created_at>n.created_at;)a--;return{...t,items:[...o.slice(0,a),n,...o.slice(a)]}}function Bw(t,n){const r=c=>c.external_item_id??c.id,o=new Map(t.items.map(c=>[r(c),c])),a=n.map(c=>{var p;const d=o.get(r(c));return o.delete(r(c)),d&&((p=d.data)==null?void 0:p.partial)!==!0&&d.updated_at>c.updated_at?d:c});return{...t,items:[...a,...o.values()],deferred_item_count:0,deferred_tool_calls:0}}function Ww(t,n,r,o){var p;const a=new Date().toISOString(),c=Kd(t.items,n);if(c>=0){const g=t.items[c];if(((p=g.data)==null?void 0:p.partial)!==!0||g.data.title===r&&g.data.html===o)return t;const m=[...t.items];return m[c]={...g,data:{...g.data,title:r,html:o},updated_at:a},{...t,items:m}}const d={id:`delta-${n}`,turn_id:t.id,external_item_id:n,type:"widget",data:{title:r,html:o,error:null,partial:!0},status:"in_progress",created_at:a,updated_at:a};return{...t,items:[...t.items,d]}}function Hw(t,n,r,o){var d;const a=Kd(t.items,n);if(a>=0){const p=t.items[a],g=((d=p.data)==null?void 0:d.text)??"",m=o??g+r,v=[...t.items];return v[a]={...p,data:{...p.data,text:m}},{...t,items:v,agent_response:m}}const c={id:`delta-${n}`,turn_id:t.id,external_item_id:n,type:"agent_message",data:{text:o??r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...t,items:[...t.items,c],agent_response:o??r}}function Vw(){const t=new URLSearchParams(window.location.search);return{session:t.get("session"),thread:t.get("thread")}}function Kw(){const t=new URL(window.location.href);!t.searchParams.has("session")&&!t.searchParams.has("thread")||(t.searchParams.delete("session"),t.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",t))}let Hu=0;function lm(t){return t==="sidecar"?"sidecar":"turns"}async function Gw(t,n){const r=await Promise.allSettled(t.map(c=>n(c))),o=new Map;let a=null;return r.forEach((c,d)=>{var p;c.status==="fulfilled"?o.set(t[d],c.value):a===null&&(a=((p=c.reason)==null?void 0:p.message)??"Request failed")}),{updated:o,firstError:a}}function qw(t,n){const r={...t.sessionDetails};n.forEach(g=>delete r[g]);const o={...t.backgroundTasks};n.forEach(g=>delete o[g]);const a=Object.fromEntries(Object.entries(t.signedOutTurns).filter(([,g])=>!n.has(g))),c=t.openTabs.filter(g=>!n.has(g)),d=Wd(t,new Set([...n].map(zr)));let p=t.activeTurnIndex;if(d.activeSessionId!==t.activeSessionId){const g=d.activeSessionId?r[d.activeSessionId]:null;p=g&&g.turns.length>0?g.turns.length-1:0}return{sessions:t.sessions.filter(g=>!n.has(g.id)),sessionDetails:r,backgroundTasks:o,signedOutTurns:a,openTabs:c,...d,activeTurnIndex:p}}function Xw(t){const n={...t};return delete n.turns,delete n.threads,delete n.contextUsage,n}function cm(t,n,r){const o=n().activeSessionId;t(c=>qw(c,r));const a=n().activeSessionId;a&&a!==o&&n().selectSession(a,{keepAppView:!0})}async function um(t,n,r,o,a){if(r.length===0)return;t({error:null});const{updated:c,firstError:d}=await Gw(r,o);c.size>0&&t(g=>({sessions:g.sessions.map(m=>c.get(m.id)??m)}));const p=r.length-c.size;if(p===0)n().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{t({error:d});const g=a[0].toUpperCase()+a.slice(1);n().addToast(p===r.length?"error":"warn",`${g} ${c.size} of ${r.length} — ${p} failed`)}}const Vu=new Map,Yw=(t,n)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=Vw(),o=Tw();try{const a=localStorage.getItem("agentpane:last-model-config");a&&t({lastModelConfig:JSON.parse(a)})}catch{}t({loading:!0,error:null});try{const a=n().loadApps(),[c,d,p]=await Promise.all([rw(),ov(),av()]);t({sessions:c,workspaces:d,folders:p,loading:!1}),Kw();const g=await a,m=jw(o,new Set(c.map(v=>v.id)),g?new Set(n().apps.map(v=>v.id)):null,r.session);t(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ci([...m.openTabs,...v.openTabs]),openAppTabs:Ci([...m.openAppTabs,...v.openAppTabs]),tabOrder:m.tabOrder,activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!n().activeSessionId&&await n().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(t({deepLinkThreadId:r.thread}),n().switchRightTab("threads"))}catch(a){t({loading:!1,error:a.message})}},selectSession:async(r,o)=>{const a=++Hu,c=o!=null&&o.keepAppView?{}:{activeAppTabId:null},d=p=>p.includes(r)?p:[...p,r];if(n().sessionDetails[r]){const p=n().sessionDetails[r];t({activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:lm(n().activeRightTab),...c,openTabs:d(n().openTabs)}),p.has_unreviewed===1&&(em(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})));return}t({loading:!0,error:null});try{const p=await vi(r);if(a!==Hu){t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},openTabs:d(g.openTabs),loading:!1}));return}t(g=>({sessionDetails:{...g.sessionDetails,[r]:p},activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:lm(g.activeRightTab),...c,openTabs:d(g.openTabs),loading:!1})),p.has_unreviewed===1&&(em(r).catch(()=>{}),t(g=>({sessions:g.sessions.map(m=>m.id===r?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[r]:{...p,has_unreviewed:0}}})))}catch(p){t(a===Hu?{loading:!1,error:p.message}:{loading:!1})}},closeTab:r=>n().closeTabs([zr(r)]),updateModelConfig:async(r,o,a)=>{const c=n().activeSessionId;if(c){t({error:null});try{const d=await dw(c,r,o,a),p={provider:d.runtime_type,model:d.model??"",reasoning:d.model_reasoning_effort??""};t({lastModelConfig:p}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(p)),t(g=>({sessions:g.sessions.map(m=>m.id===c?d:m),sessionDetails:g.sessionDetails[c]?{...g.sessionDetails,[c]:{...g.sessionDetails[c],model:d.model,model_reasoning_effort:d.model_reasoning_effort,external_thread_id:d.external_thread_id}}:g.sessionDetails})),await n().refreshActiveSession()}catch(d){t({error:d.message}),n().addToast("error",`Failed to update model — ${d.message}`)}}},createSession:async r=>{t({error:null});try{const o=await Ud(r);t(c=>({sessions:[o,...c.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};t({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await n().selectSession(o.id),n().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),n().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){t({error:o.message}),n().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{t(o=>({sessions:o.sessions.some(a=>a.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=n().sessionDetails[r];if(!o){const a=await vi(r);t(c=>({sessionDetails:{...c.sessionDetails,[r]:a}})),o=a}n().sessions.some(a=>a.id===r)||n().addSession(Xw(o)),await n().selectSession(r)},deleteSession:async r=>{var a;t({error:null});const o=(a=n().sessions.find(c=>c.id===r))==null?void 0:a.title;try{await Qh(r),cm(t,n,new Set([r])),n().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),n().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(c){t({error:c.message}),n().addToast("error",`Failed to delete session — ${c.message}`)}},renameSession:async(r,o)=>{t({error:null});try{const a=await cw(r,o.trim());t(c=>({sessions:c.sessions.map(d=>d.id===r?a:d),sessionDetails:c.sessionDetails[r]?{...c.sessionDetails,[r]:{...c.sessionDetails[r],title:a.title}}:c.sessionDetails}))}catch(a){t({error:a.message}),n().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{t({error:null});try{const o=await Zh(r);t(a=>({sessions:a.sessions.map(c=>c.id===r?o:c)})),n().addToast("info","Session marked as finished")}catch(o){t({error:o.message}),n().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await um(t,n,r,Zh,"marked as finished")},toggleStar:async r=>{const o=n().sessions.find(a=>a.id===r);if(o){t({error:null});try{const a=await uw(r,o.starred?0:1);t(c=>({sessions:c.sessions.map(d=>d.id===r?a:d),sessionDetails:c.sessionDetails[r]?{...c.sessionDetails,[r]:{...c.sessionDetails[r],starred:a.starred}}:c.sessionDetails}))}catch(a){t({error:a.message}),n().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{t({error:null});try{const o=await Jh(r);t(a=>({sessions:a.sessions.map(c=>c.id===r?o:c)})),n().addToast("info","Session reopened")}catch(o){t({error:o.message}),n().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await um(t,n,r,Jh,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;t({error:null});const o=await Promise.allSettled(r.map(d=>Qh(d))),a=new Set;if(o.forEach((d,p)=>{d.status==="fulfilled"&&a.add(r[p])}),a.size===0){t({error:"Failed to delete sessions"}),n().addToast("error","Failed to delete sessions");return}cm(t,n,a),n().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const c=r.length-a.size;c===0?n().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(t({error:"One or more sessions failed to delete"}),n().addToast("warn",`Deleted ${a.size} of ${r.length} — ${c} failed`))},submitPrompt:async(r,o)=>{const a=n().activeSessionId;if(a){t({error:null,submittingPrompt:r}),t(c=>{const d=c.sessionDetails[a];return d?{sessionDetails:{...c.sessionDetails,[a]:{...d,is_running:1,status:"running"}},sessions:c.sessions.map(p=>p.id===a?{...p,is_running:1,status:"running"}:p)}:{}});try{const c=await rv(a,r,o);n().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),t(d=>{const p=d.sessionDetails[a];if(!p)return{submittingPrompt:null};const g=p.turns.findIndex(v=>v.id===c.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...c,items:[]};return{submittingPrompt:null,sessionDetails:{...d.sessionDetails,[a]:{...p,turns:[...p.turns,m]}},activeTurnIndex:p.turns.length}})}catch(c){t({submittingPrompt:null,error:c.message}),n().addLogEntry("ERROR",`Turn failed — ${c.message}`),n().addToast("error",`Failed to send prompt — ${c.message}`),t(d=>{const p=d.sessionDetails[a];if(!p)return{};const g=Vl(p)?1:0;return{sessionDetails:{...d.sessionDetails,[a]:{...p,is_running:g,status:g?"running":"active"}},sessions:d.sessions.map(m=>m.id===a?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const r=n().activeSessionId;if(r)try{await iw(r)}catch(o){t({error:o.message})}},rewindToTurn:async(r,o)=>{t({error:null});try{const a=await pw(r,o),c=await vi(r);t(d=>({sessionDetails:{...d.sessionDetails,[r]:c},sessions:d.sessions.map(p=>p.id===r?{...p,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:c.turns.length>0?c.turns.length-1:0})),n().addToast("info","Rewound to selected turn")}catch(a){t({error:a.message}),n().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{t({error:null});try{const o=await hw(r),a=await vi(r);t(c=>({sessionDetails:{...c.sessionDetails,[r]:a},sessions:c.sessions.map(d=>d.id===r?{...d,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:d),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),n().addToast("info","Restored rewound session")}catch(o){t({error:o.message}),n().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{t({error:null});try{const c=await mw(r,o,a);t(d=>({sessions:[c,...d.sessions]})),await n().selectSession(c.id),n().addToast("success","Branched from selected turn")}catch(c){t({error:c.message}),n().addToast("error",`Failed to branch — ${c.message}`)}},updateRuntimeConfig:async r=>{const o=n().activeSessionId;if(o){t({error:null});try{const a=await fw(o,JSON.stringify(r));t(c=>({sessions:c.sessions.map(d=>d.id===o?a:d),sessionDetails:c.sessionDetails[o]?{...c.sessionDetails,[o]:{...c.sessionDetails[o],runtime_config:a.runtime_config}}:c.sessionDetails}))}catch(a){t({error:a.message}),n().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=n().activeSessionId;if(r)try{const o=await vi(r);t(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(c=>c.id===r?{...c,is_running:o.is_running,status:o.status}:c)}))}catch(o){t({error:o.message})}},loadDeferredItems:(r,o)=>{const a=Vu.get(o);if(a)return a;const c=ow(r,o).then(({items:d})=>(t(p=>{const g=p.sessionDetails[r];return g?{sessionDetails:{...p.sessionDetails,[r]:bn(g,o,m=>Bw(m,d))}}:{}}),!0)).catch(d=>(n().addToast("error",`Failed to load tool calls — ${d.message}`),!1)).finally(()=>Vu.delete(o));return Vu.set(o,c),c}});async function mv(t){const{sessions:n}=await Et(`/claude-sessions?workspace=${encodeURIComponent(t)}`);return n}function Qw(t,n){return at(`/claude-sessions/${encodeURIComponent(t)}/import`,{workspace:n})}const dm={available:!0,reason:null};let Ku=null;const Zw=(t,n)=>({workspaces:[],pickerSupport:null,loadPickerSupport:()=>{const r=n().pickerSupport;return r?Promise.resolve(r):(Ku??(Ku=yw().then(o=>typeof(o==null?void 0:o.available)!="boolean"?dm:(t({pickerSupport:o}),o)).catch(()=>dm).finally(()=>{Ku=null})),Ku)},createWorkspaceAt:async r=>{const o=await gw(r.trim());return t(a=>({workspaces:[...a.workspaces.filter(c=>c.id!==o.id),o]})),o},addWorkspace:async r=>{t({error:null});try{const o=await n().createWorkspaceAt(r);return n().addToast("success",`Workspace added — ${o.path}`),o}catch(o){return n().addToast("error",`Failed to add workspace — ${$r(o)}`),null}},removeWorkspace:async r=>{t({error:null});try{await vw(r);const o=await ov();t({workspaces:o}),n().addToast("info","Workspace hidden")}catch(o){n().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{t({error:null});try{const o=n().lastModelConfig,a=await Ud({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});t(c=>({sessions:[a,...c.sessions]})),await n().selectSession(a.id),n().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),n().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){t({error:o.message}),n().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{if(!(await n().loadPickerSupport()).available){n().setShowAddWorkspaceDialog(!0);return}try{const o=await iv();if(o.cancelled||!o.path)return;await n().addWorkspace(o.path)}catch(o){n().addToast("error",`Failed to pick directory — ${o.message}`)}},importClaudeSessions:async(r,o)=>{const a=[],c=[];for(const d of[...o].reverse())try{a.unshift(await Qw(d,r))}catch(p){c.unshift({id:d,error:$r(p)})}return a.length>0&&(t(d=>({sessions:[...a,...d.sessions]})),await n().selectSession(a[0].id),n().addLogEntry("INFO",`Imported ${a.length} Claude Code session(s) into ${r}`),n().addToast("success",a.length===1?`Imported — ${a[0].title||"Claude Code session"}`:`Imported ${a.length} Claude Code sessions`)),{imported:a,failed:c}}});function gv(t,n){const r=n?`?cwd=${encodeURIComponent(n)}`:"";return Et(`/providers/${encodeURIComponent(t)}/models${r}`)}const fm="curl -fsSL https://repoburg.com/install.sh | bash",Jw=2e3,vv="agentpane:daemon-seen";function ek(t=mn()){if(!t)return!1;try{const n=new URL(t);return n.protocol==="http:"&&(n.hostname==="localhost"||n.hostname==="127.0.0.1")}catch{return!1}}async function tk(t=mn()){try{return await fetch(`${t}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function nk(){try{return localStorage.getItem(vv)==="true"}catch{return!1}}function sk(){try{localStorage.setItem(vv,"true")}catch{}}function rk(t){let n=!1,r=!1,o=!1,a=null;function c(){a!==null&&(clearTimeout(a),a=null)}async function d(){if(n||r)return;c(),r=!0;const m=await tk();if(r=!1,!n){if(m){sk(),g(),t.onReady();return}o||(o=!0,t.onMissing()),a=setTimeout(()=>void d(),Jw)}}function p(){document.visibilityState==="visible"&&d()}function g(){n=!0,c(),window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",p)}return window.addEventListener("focus",p),document.addEventListener("visibilitychange",p),d(),g}const pd=160,hd=480,ok=240,Sl=220,ik=300,ak=600,lk=36;function bl(){return typeof window>"u"?ak:Math.max(Sl,Math.round(window.innerWidth*.7))}const pm="agentpane:sidebar-width",hm="agentpane:right-panel-width",Gu="agentpane:right-panel-collapsed";function mm(t,n,r,o){try{const a=localStorage.getItem(t);if(a==null)return o;const c=Number(a);return Number.isFinite(c)?Math.min(r,Math.max(n,c)):o}catch{return o}}function ck(t){try{return localStorage.getItem(t)==="true"}catch{return!1}}function gm(t,n){try{localStorage.setItem(t,String(n))}catch{}}const vm=200,uk=(t,n)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showAddWorkspaceDialog:!1,importSessionsWorkspace:null,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:mm(pm,pd,hd,ok),rightPanelWidth:mm(hm,Sl,bl(),ik),rightPanelCollapsed:ck(Gu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,usageViewOpen:!1,terminalViewOpen:!1,canGoBack:!1,canGoForward:!1,daemonStatus:ek()?"checking":"ready",setActiveTurnIndex:r=>t({activeTurnIndex:r}),switchRightTab:r=>{n().rightPanelCollapsed&&gm(Gu,!1),t({activeRightTab:r,rightPanelCollapsed:!1})},setShowNewSessionDialog:r=>t({showNewSessionDialog:r}),setShowAddWorkspaceDialog:r=>t({showAddWorkspaceDialog:r}),setImportSessionsWorkspace:r=>t({importSessionsWorkspace:r}),setShowRemoteModal:r=>t({showRemoteModal:r}),setShowCommandPalette:r=>t({showCommandPalette:r}),setShowModelSelector:r=>t({showModelSelector:r}),setDeepLinkThreadId:r=>t({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(hd,Math.max(pd,Math.round(r)));t({sidebarWidth:o});try{localStorage.setItem(pm,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(bl(),Math.max(Sl,Math.round(r)));t({rightPanelWidth:o});try{localStorage.setItem(hm,String(o))}catch{}},setRightPanelCollapsed:r=>{t({rightPanelCollapsed:r}),gm(Gu,r)},toggleRightPanel:()=>n().setRightPanelCollapsed(!n().rightPanelCollapsed),toggleVscodeView:()=>{if(n().vscodeViewOpen){t({vscodeViewOpen:!1});return}t({vscodeViewOpen:!0,terminalViewOpen:!1,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>t({vscodeState:r,vscodeId:o,vscodeToken:a}),toggleUsageView:()=>t({usageViewOpen:!n().usageViewOpen,terminalViewOpen:!1}),toggleTerminalView:()=>t(n().terminalViewOpen?{terminalViewOpen:!1}:{terminalViewOpen:!0,vscodeViewOpen:!1,usageViewOpen:!1}),setDaemonStatus:r=>t({daemonStatus:r}),addToast:(r,o,a,c)=>{const d=Math.random().toString(36).slice(2,9);t(p=>({toasts:[...p.toasts,{id:d,type:r,message:o,undoAction:a,undoLabel:c}]}))},removeToast:r=>{t(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});t(c=>{const d=[...c.eventLog,{time:a,level:r,message:o}];return d.length>vm&&d.splice(0,d.length-vm),{eventLog:d}})},loadModels:async(r,o)=>{if(!n().modelsLoading){t({modelsLoading:!0,models:[]});try{const a=await gv(r,o);t({models:a,modelsLoading:!1})}catch{t({modelsLoading:!1})}}}}),dk=(t,n)=>({createThread:async(r,o)=>{try{await at(`/sessions/${r}/threads`,o),n().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){n().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(r,o,a)=>{try{await at(`/sessions/${r}/threads/${o}/followup`,{message:a}),n().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(c){n().addToast("error",`Failed to send follow-up — ${c.message}`)}},cancelThreadTurn:async(r,o)=>{try{await at(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),n().addLogEntry("INFO","Thread turn cancelled")}catch(a){n().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await ds(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){n().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await ds(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){n().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const c=await at(`/sessions/${r}/threads/${o}/summarize`,{directives:a}),d=`
|
|
45
|
-
[Shared from a resolved discussion thread — summary of its findings]
|
|
46
|
-
|
|
47
|
-
\`\`\`QUOTE
|
|
48
|
-
${c.summary}
|
|
49
|
-
\`\`\`
|
|
50
|
-
|
|
51
|
-
`;return t({quotedText:d}),n().addLogEntry("INFO",`Thread shared to main session — "${c.summary.slice(0,40)}"`),n().addToast("success","Thread summary added to your input"),!0}catch(c){return n().addToast("error",`Failed to share thread — ${c.message}`),!1}},deleteThread:async(r,o)=>{try{await Hl(`/sessions/${r}/threads/${o}`)}catch(a){n().addToast("error",`Failed to delete thread — ${a.message}`)}},askSidecar:async(r,o)=>{try{return await at(`/sessions/${r}/sidecar`,{message:o}),n().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(a){return n().addToast("error",`Failed to ask the sidecar — ${a.message}`),!1}},onThreadCreated:(r,o,a)=>{t(c=>{const d=c.sessionDetails[r];return d?{sessionDetails:{...c.sessionDetails,[r]:{...d,threads:[...d.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{t(c=>{const d=c.sessionDetails[r];return d?{sessionDetails:{...c.sessionDetails,[r]:{...d,threads:(d.threads??[]).map(p=>p.id===o?{...p,turns:[...p.turns??[],{...a,items:[]}]}:p)}}}:{}})},onThreadResolved:(r,o,a)=>{t(c=>{const d=c.sessionDetails[r];if(!d)return{};const p=(d.threads??[]).map(g=>g.id===o?{...g,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...c.sessionDetails,[r]:{...d,threads:p}}}})},onThreadDeleted:(r,o)=>{t(a=>{const c=a.sessionDetails[r];return c?{sessionDetails:{...a.sessionDetails,[r]:{...c,threads:(c.threads??[]).filter(d=>d.id!==o)}}}:{}})}}),fk=(t,n)=>({folders:[],loadFolders:async()=>{const r=await av();t({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await xw(r,o);return t(c=>({folders:[...c.folders,a]})),a}catch(a){return n().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await nm(r,{name:o});t(c=>({folders:c.folders.map(d=>d.id===r?a:d)}))}catch(a){n().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=n().folders,a=n().sessions;t(c=>({folders:c.folders.filter(d=>d.id!==r),sessions:c.sessions.map(d=>d.folder_id===r?{...d,folder_id:null}:d)}));try{await ww(r)}catch(c){t({folders:o,sessions:a}),n().addToast("error",`Failed to delete folder — ${c.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=n().sessions,a=new Map(r.map(c=>[c.id,c]));t(c=>({sessions:c.sessions.map(d=>{const p=a.get(d.id);return p?{...d,folder_id:p.folder_id,sort_order:p.sort_order}:d})}));try{await kw(r)}catch(c){t({sessions:o}),n().addToast("error",`Failed to save session order — ${c.message}`)}},reorderFolders:async r=>{const o=n().folders,a=new Map(r.map((c,d)=>[c,d]));t(c=>({folders:c.folders.map(d=>a.has(d.id)?{...d,sort_order:a.get(d.id)}:d)}));try{await Promise.all(r.map((c,d)=>nm(c,{sort_order:d})))}catch(c){t({folders:o}),n().addToast("error",`Failed to save folder order — ${c.message}`)}}});function ym(){return Et("/apps")}function pk(){return Et("/apps/root")}function xm(t){return Et(`/apps/${t}/source`)}function wm(t,n=""){return Et(`/apps/${t}/state?workspace=${encodeURIComponent(n)}`)}function yv(t,n,r=""){return ew(`/apps/${t}/state?workspace=${encodeURIComponent(r)}`,n)}function hk(t){return Hl(`/apps/${t}`)}function mk(t){return Et(`/apps/${t}/sessions`)}async function km(t,n){try{return await Et(`/apps/${t}/sessions/${encodeURIComponent(n)}`)}catch(r){if(r instanceof Ui&&r.status===404)return null;throw r}}function gk(t,n,r={}){const o=new URLSearchParams({workspace:n});return r.lifecycle&&o.set("lifecycle",r.lifecycle),typeof r.running=="boolean"&&o.set("running",String(r.running)),Et(`/apps/${t}/workspace-sessions?${o}`)}async function vk(t,n,r){try{return await Et(`/apps/${t}/workspace-sessions/${encodeURIComponent(r)}?workspace=${encodeURIComponent(n)}`)}catch(o){if(o instanceof Ui&&o.status===404)return null;throw o}}function yk(t,n){return at(`/apps/${t}/sessions/${encodeURIComponent(n)}/cancel`)}function xk(t,n,r){return ds(`/apps/${t}/sessions/${encodeURIComponent(n)}`,{lifecycle:r})}async function wk(t,n,r,o){const a=await at("/apps/mcp/call",{tool:`${t}__${r}`,args:o,workspace:n});if(!a.ok)throw new Error(a.error||`callTool: ${r} failed`);return a.result}function kk(){return Et("/apps/examples")}function Sk(t){return at(`/apps/examples/${t}/install`,{})}function bk(t){return at("/apps",t)}function Nk(t,n){return at("/apps/import",{id:t,files:n})}function Tk(t,n,r){return at(`/apps/mcp/calls/${t}/result`,{result:n,error:null})}function Ck(t,n){return at(`/apps/${t}/edit-session`,n)}function Ek(t,n){return at(`/apps/${t}/files`,n)}async function jk(t,n){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(n)}/meta`);if(r.status===404)return null;if(!r.ok)throw new Error(`GET /apps/${t}/files/${n}/meta failed: ${r.status} ${r.statusText}`);return await r.json()}async function _k(t,n){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(n)}`);if(!r.ok)throw new Error(`GET /apps/${t}/files/${n} failed: ${r.status} ${r.statusText}`);return r.blob()}const fl=new Set;async function qu(t,n){fl.add(n),await t().loadApps();const r=t().apps.find(o=>o.id===n);t().openAppTab(n),t().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??n}`)}const md="agentpane:app-workspaces";function Rk(){try{const t=JSON.parse(localStorage.getItem(md)??"{}");return t&&typeof t=="object"?t:{}}catch{return{}}}const Ak=(t,n)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Rk(),loadApps:async()=>{try{const[r,o]=await Promise.all([ym(),pk().catch(()=>null)]);return r.forEach(a=>fl.add(a.id)),t(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await ym();for(const o of r)fl.has(o.id)||(fl.add(o.id),n().addToast("success",`New mini app discovered: ${o.title}`));t({apps:r})}catch{}},openAppTab:r=>{t(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>n().closeTabs([Ii(r)]),setActiveAppTab:r=>t({activeAppTabId:r}),openAppCatalog:()=>t({appCatalogOpen:!0}),closeAppCatalog:()=>t({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{t(a=>{const c={...a.appWorkspaces,[r]:o};try{localStorage.setItem(md,JSON.stringify(c))}catch{}return{appWorkspaces:c}})},installExampleApp:async r=>{try{return await Sk(r),await qu(n,r),!0}catch(o){return n().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await bk(r),await qu(n,r.id),!0}catch(o){return n().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Nk(r,o),await qu(n,r),!0}catch(a){return n().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=n().lastModelConfig,a=await Ck(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});n().sessions.some(c=>c.id===a.id)||t(c=>({sessions:[a,...c.sessions]})),await n().selectSession(a.id),n().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){n().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=n().apps.find(a=>a.id===r);if(o)try{await yv(r,{pinned:!o.pinned}),await n().loadApps()}catch(a){n().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await hk(r);const o=n().activeSessionId;t(c=>{const d={...c.appWorkspaces};delete d[r];try{localStorage.setItem(md,JSON.stringify(d))}catch{}return{apps:c.apps.filter(p=>p.id!==r),openAppTabs:c.openAppTabs.filter(p=>p!==r),...Wd(c,new Set([Ii(r)])),appWorkspaces:d}});const a=n().activeSessionId;a&&a!==o&&n().selectSession(a,{keepAppView:!0}),n().addToast("success",`Mini app deleted: ${r}`)}catch(o){n().addToast("error",`Failed to delete app — ${o.message}`)}}}),Ik=(t,n)=>({tabOrder:[],closedTabs:[],moveTab:(r,o)=>{const a=[...n().tabOrder],c=a.indexOf(r),d=a.indexOf(o);c===-1||d===-1||c===d||(a.splice(d,0,...a.splice(c,1)),t({tabOrder:a}))},closeTabs:r=>{const o=n(),a=new Set(r.filter(g=>o.tabOrder.includes(g)));if(a.size===0)return;const c=Wd(o,a),d=o.tabOrder.map((g,m)=>({key:g,index:m})).filter(g=>a.has(g.key)).reverse();t({...c,openTabs:o.openTabs.filter(g=>!a.has(zr(g))),openAppTabs:o.openAppTabs.filter(g=>!a.has(Ii(g))),tabOrder:o.tabOrder.filter(g=>!a.has(g)),closedTabs:[...o.closedTabs,...d].slice(-20)});const p=c.activeSessionId;p!==null&&p!==o.activeSessionId&&n().selectSession(p,{keepAppView:!0})},reopenClosedTab:()=>{const r=n(),o=[...r.closedTabs];let a=o.pop();for(;a&&!uv(r,a.key);)a=o.pop();if(!a){t({closedTabs:[]});return}const c=[...r.tabOrder];c.splice(a.index,0,a.key);const{kind:d,id:p}=hr(a.key);d==="app"?(t({closedTabs:o,tabOrder:c,openAppTabs:[...r.openAppTabs,p]}),n().openAppTab(p)):(t({closedTabs:o,tabOrder:c,openTabs:[...r.openTabs,p]}),n().selectSession(p))}}),Sm=3e3,Vn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Kn=[];let Nl=0,Gd=0,Tl=0,qd=0,Cl=0,Xd=0,Yd=0;const Di=new Map,Mi=new Map;let Eo=new Map,To=0,jo=new Map,Xu=!1;function El(t,n,r){if(Kn.push({t:Date.now(),cat:t,msg:n,ms:r}),Kn.length>Sm){const o=Kn.length-Sm;Kn.splice(0,o),Dn=Math.max(0,Dn-o)}}function Co(t,n,r){El(t,n,r),console.log(`[perf:${t}] ${n}`)}function xv(t){Co("note",t)}function wv(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function Dk(t,n){let r=Eo.get(t);r||Eo.set(t,r={n:0,bytes:0}),r.n++,r.bytes+=n;let o=Di.get(t);o||Di.set(t,o={n:0,bytes:0}),o.n++,o.bytes+=n}function Mk(){To++,Yd++}function Lk(t){jo.set(t,(jo.get(t)??0)+1),Mi.set(t,(Mi.get(t)??0)+1)}let pl=0;function Ok(){pl=performance.now()}function Pk(){const t=performance.now(),n=pl?t-pl:null;pl=0,requestAnimationFrame(()=>{if(n===null)return;const r=performance.now()-t+n;r>Vn.keypressMs&&Co("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(n)}ms, change→paint ${Math.round(performance.now()-t)}ms)`)})}const $k=5e3,kv=500,bm=2e3;let Dn=0,Yu=!1;function zk(t){return at("/perf-log",{entries:t}).then(()=>{Dn+=t.length})}function Fk(){if(Yu||Dn>=Kn.length)return;const t=Kn.slice(Dn,Dn+kv);t.length!==0&&(Yu=!0,zk(t).catch(()=>{Kn.length-Dn>bm&&(Dn=Math.max(Dn,Kn.length-bm))}).finally(()=>{Yu=!1}))}function Nm(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Dn>=Kn.length)return;const t=Kn.slice(Dn,Dn+kv);if(t.length!==0)try{const n=new Blob([JSON.stringify({entries:t})],{type:"application/json"});navigator.sendBeacon(`${mn()}/api/perf-log`,n),Dn+=t.length}catch{}}function Uk(){let t=0;for(const o of Eo.values())t+=o.n;const n=[];if(t>0){const o=[...Eo.entries()].sort((a,c)=>c[1].n-a[1].n).map(([a,c])=>`${a}×${c.n}(${wv(c.bytes)})`).join(", ");n.push(`ws ${t}/s [${o}]`)}To>0&&n.push(`store ${To}/s`);const r=[...jo.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&n.push(`renders ${r.join(" ")}`),n.length>0){const o=n.join(" · ");El("stat",o);const a=[...jo.values()].some(c=>c>Vn.renderPerSecLog);(t>Vn.wsPerSecLog||To>Vn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}Eo=new Map,To=0,jo=new Map}function Bk(t){if(t instanceof Element){const n=t.id?`#${t.id}`:"",r=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/)[0]}`:"";return`${t.tagName.toLowerCase()}${n}${r}`}return t?"window":"unknown"}function Wk(){if(Xu||typeof window>"u")return()=>{};Xu=!0,Nl=Date.now();const t=[];let n=performance.now()+250;const r=window.setInterval(()=>{const c=performance.now(),d=c-n;n=c+250,d>Vn.lagMs&&(Gd++,Tl=Math.max(Tl,d),Co("lag",`event loop blocked ${Math.round(d)}ms`))},250);if(t.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let c=performance.now(),d=0;const p=g=>{const m=g-c;c=g,m>Vn.frameGapMs&&Co("lag",`frame gap ${Math.round(m)}ms`),d=window.requestAnimationFrame(p)};d=window.requestAnimationFrame(p),t.push(()=>window.cancelAnimationFrame(d))}if(typeof PerformanceObserver<"u"){try{const c=new PerformanceObserver(d=>{var p;for(const g of d.getEntries()){const m=g.duration;if(m<Vn.longtaskBufferMs)continue;qd++,Cl=Math.max(Cl,m);const v=(p=g.attribution)==null?void 0:p[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",y=`long task ${Math.round(m)}ms (${k})`;m>=Vn.longtaskLogMs?Co("longtask",y,m):El("longtask",y,m)}});c.observe({type:"longtask",buffered:!1}),t.push(()=>c.disconnect())}catch{}try{const c=new PerformanceObserver(d=>{for(const p of d.getEntries()){const g=p.duration,m=p.processingStart-p.startTime;Xd++;const v=`${p.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${Bk(p.target)}`;g>=Vn.eventLogMs?Co("input",v,g):El("input",v,g)}});c.observe({type:"event",durationThreshold:Vn.eventBufferMs}),t.push(()=>c.disconnect())}catch{}}const o=window.setInterval(Uk,1e3);t.push(()=>window.clearInterval(o)),xv("perf logger session started");const a=window.setInterval(Fk,$k);return t.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",Nm),t.push(()=>window.removeEventListener("beforeunload",Nm)),window.__agentPanePerf={dump:Sv,reset:bv},()=>{t.forEach(c=>c()),Xu=!1}}function Sv(){const t=[],n=Nl?Math.round((Date.now()-Nl)/1e3):0;if(t.push("=== agent-pane perf report ==="),t.push(`uptime ${n}s · ${Kn.length} buffered entries`),t.push(`event-loop lag: ${Gd} blocks >${Vn.lagMs}ms (max ${Math.round(Tl)}ms)`),t.push(`long tasks: ${qd} ≥${Vn.longtaskBufferMs}ms (max ${Math.round(Cl)}ms)`),t.push(`slow input events (≥${Vn.eventBufferMs}ms): ${Xd}`),t.push(`store updates: ${Yd} total`),Di.size>0){t.push("ws messages by type (top 15):");for(const[r,o]of[...Di.entries()].sort((a,c)=>c[1].n-a[1].n).slice(0,15))t.push(` ${r}: ${o.n} msgs, ${wv(o.bytes)}`)}if(Mi.size>0){t.push("render counts by component:");for(const[r,o]of[...Mi.entries()].sort((a,c)=>c[1]-a[1]))t.push(` ${r}: ${o}`)}t.push("--- last 200 entries ---");for(const r of Kn.slice(-200))t.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return t.join(`
|
|
52
|
-
`)}function bv(){Kn.length=0,Dn=0,Nl=Date.now(),Gd=0,Tl=0,qd=0,Cl=0,Xd=0,Yd=0,Di.clear(),Mi.clear(),Eo=new Map,To=0,jo=new Map}const Lt={start:Wk,note:xv,trackWsEvent:Dk,trackStoreUpdate:Mk,trackRender:Lk,markKeystroke:Ok,markInputChange:Pk,dump:Sv,reset:bv},A=H0()((...t)=>({...Yw(...t),...Zw(...t),...Fw(...t),...uk(...t),...dk(...t),...fk(...t),...Ak(...t),...Ik(...t)}));typeof window<"u"&&(A.subscribe(()=>Lt.trackStoreUpdate()),bw(A),Ew(A));const Hk="modulepreload",Vk=function(t){return"/"+t},Tm={},Kk=function(n,r,o){let a=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));a=d(r.map(m=>{if(m=Vk(m),m in Tm)return;Tm[m]=!0;const v=m.endsWith(".css"),k=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${k}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":Hk,v||(y.as="script"),y.crossOrigin="",y.href=m,g&&y.setAttribute("nonce",g),document.head.appendChild(y),v)return new Promise((S,C)=>{y.addEventListener("load",S),y.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return a.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return n().catch(c)})};function gd(t){switch(t){case"claude":return{iconClass:"ic-claude",iconText:"CL"};case"codex":return{iconClass:"ic-codex",iconText:"CX"};case"repoburg":return{iconClass:"ic-repoburg",iconText:"RB"};case"cursor":return{iconClass:"ic-cursor",iconText:"CR"};default:return{iconClass:"ic-codex",iconText:"CX"}}}function Gk(t,n,r=!1,o="working",a=0){if(o==="finished")return"";if(t==="interrupted")return"interrupted";if(n)return"running";if(a>0)return"background";if(r&&t!=="failed")return"queued";switch(t){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function qk(t,n,r=!1,o="working",a=0){if(o==="finished")return"Finished";if(t==="interrupted")return"Interrupted";if(n)return"Running";if(a>0)return"Background";if(r&&t!=="failed")return"Review Pending";switch(t){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return t}}function ql(t,n=0){const r=t.is_running===1,o=t.lifecycle==="finished",a=gd(t.runtime_type),c=Gk(t.status,r,t.has_unreviewed===1,t.lifecycle,n),d=qk(t.status,r,t.has_unreviewed===1,t.lifecycle,n);return{dot:c,label:d,dotTitle:c==="background"?`${n} background task${n===1?"":"s"} running`:d,iconClass:a.iconClass,iconText:a.iconText,isRunning:r,isFinished:o,backgroundTaskCount:n}}function Wi(t,n,r=!0){x.useEffect(()=>{if(!r)return;function o(a){t.current&&!t.current.contains(a.target)&&n()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[t,n,r])}function Io(t,n=!0){x.useEffect(()=>{if(!n)return;function r(o){o.key==="Escape"&&t()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,n])}function Qd({status:t,size:n=6,title:r}){return l.jsx("span",{className:`status-dot ${t}`,style:n!==6?{width:n,height:n}:void 0,title:r})}function Zd({iconClass:t,iconText:n,size:r=20}){return l.jsx("span",{className:`runtime-icon ${t}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:n})}/**
|
|
53
|
-
* @license lucide-react v0.469.0 - ISC
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the ISC license.
|
|
56
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/const Xk=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nv=(...t)=>t.filter((n,r,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===r).join(" ").trim();/**
|
|
58
|
-
* @license lucide-react v0.469.0 - ISC
|
|
59
|
-
*
|
|
60
|
-
* This source code is licensed under the ISC license.
|
|
61
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/var Yk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
63
|
-
* @license lucide-react v0.469.0 - ISC
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the ISC license.
|
|
66
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const Tv=x.forwardRef(({color:t="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:c,iconNode:d,...p},g)=>x.createElement("svg",{ref:g,...Yk,width:n,height:n,stroke:t,strokeWidth:o?Number(r)*24/Number(n):r,className:Nv("lucide",a),...p},[...d.map(([m,v])=>x.createElement(m,v)),...Array.isArray(c)?c:[c]]));/**
|
|
68
|
-
* @license lucide-react v0.469.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const ve=(t,n)=>{const r=x.forwardRef(({className:o,...a},c)=>x.createElement(Tv,{ref:c,iconNode:n,className:Nv(`lucide-${Xk(t)}`,o),...a}));return r.displayName=`${t}`,r};/**
|
|
73
|
-
* @license lucide-react v0.469.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const Qk=ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
78
|
-
* @license lucide-react v0.469.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const Zk=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
83
|
-
* @license lucide-react v0.469.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const Cv=ve("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
88
|
-
* @license lucide-react v0.469.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const Jk=ve("BotOff",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
|
|
93
|
-
* @license lucide-react v0.469.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const gr=ve("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
98
|
-
* @license lucide-react v0.469.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const e1=ve("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
103
|
-
* @license lucide-react v0.469.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/const Cs=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
108
|
-
* @license lucide-react v0.469.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const _o=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
113
|
-
* @license lucide-react v0.469.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const Li=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
118
|
-
* @license lucide-react v0.469.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const Xl=ve("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
123
|
-
* @license lucide-react v0.469.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const t1=ve("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
128
|
-
* @license lucide-react v0.469.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const jl=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
133
|
-
* @license lucide-react v0.469.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const n1=ve("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
138
|
-
* @license lucide-react v0.469.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const s1=ve("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
143
|
-
* @license lucide-react v0.469.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const r1=ve("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
148
|
-
* @license lucide-react v0.469.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const Ev=ve("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
|
|
153
|
-
* @license lucide-react v0.469.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const Cm=ve("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
|
|
158
|
-
* @license lucide-react v0.469.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const Oi=ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
163
|
-
* @license lucide-react v0.469.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const o1=ve("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
168
|
-
* @license lucide-react v0.469.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const jv=ve("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
173
|
-
* @license lucide-react v0.469.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const i1=ve("FilePlus",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
|
|
178
|
-
* @license lucide-react v0.469.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const _v=ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
183
|
-
* @license lucide-react v0.469.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const a1=ve("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
|
|
188
|
-
* @license lucide-react v0.469.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const l1=ve("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
193
|
-
* @license lucide-react v0.469.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const Qu=ve("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
198
|
-
* @license lucide-react v0.469.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const _l=ve("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
203
|
-
* @license lucide-react v0.469.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const Rv=ve("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
208
|
-
* @license lucide-react v0.469.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const Av=ve("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
213
|
-
* @license lucide-react v0.469.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const Iv=ve("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/**
|
|
218
|
-
* @license lucide-react v0.469.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const c1=ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
223
|
-
* @license lucide-react v0.469.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const u1=ve("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
228
|
-
* @license lucide-react v0.469.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const d1=ve("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
|
|
233
|
-
* @license lucide-react v0.469.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const Dv=ve("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
238
|
-
* @license lucide-react v0.469.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const f1=ve("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
243
|
-
* @license lucide-react v0.469.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const p1=ve("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
248
|
-
* @license lucide-react v0.469.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const h1=ve("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
253
|
-
* @license lucide-react v0.469.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const m1=ve("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
258
|
-
* @license lucide-react v0.469.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const hn=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
263
|
-
* @license lucide-react v0.469.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const g1=ve("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
268
|
-
* @license lucide-react v0.469.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const v1=ve("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
273
|
-
* @license lucide-react v0.469.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const Mv=ve("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
278
|
-
* @license lucide-react v0.469.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const y1=ve("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
283
|
-
* @license lucide-react v0.469.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const Em=ve("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
|
|
288
|
-
* @license lucide-react v0.469.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const x1=ve("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
293
|
-
* @license lucide-react v0.469.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const w1=ve("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
|
|
298
|
-
* @license lucide-react v0.469.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const k1=ve("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
|
|
303
|
-
* @license lucide-react v0.469.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const S1=ve("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
308
|
-
* @license lucide-react v0.469.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const b1=ve("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
313
|
-
* @license lucide-react v0.469.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const hl=ve("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
318
|
-
* @license lucide-react v0.469.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const N1=ve("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
323
|
-
* @license lucide-react v0.469.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const T1=ve("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
328
|
-
* @license lucide-react v0.469.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const pr=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
333
|
-
* @license lucide-react v0.469.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const Lv=ve("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
338
|
-
* @license lucide-react v0.469.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const jm=ve("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
343
|
-
* @license lucide-react v0.469.0 - ISC
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the ISC license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const C1=ve("Rewind",[["polygon",{points:"11 19 2 12 11 5 11 19",key:"14yba5"}],["polygon",{points:"22 19 13 12 22 5 22 19",key:"1pi1cj"}]]);/**
|
|
348
|
-
* @license lucide-react v0.469.0 - ISC
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the ISC license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const Pi=ve("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
353
|
-
* @license lucide-react v0.469.0 - ISC
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the ISC license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const Ov=ve("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
358
|
-
* @license lucide-react v0.469.0 - ISC
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the ISC license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const Pv=ve("SatelliteDish",[["path",{d:"M4 10a7.31 7.31 0 0 0 10 10Z",key:"1fzpp3"}],["path",{d:"m9 15 3-3",key:"88sc13"}],["path",{d:"M17 13a6 6 0 0 0-6-6",key:"15cc6u"}],["path",{d:"M21 13A10 10 0 0 0 11 3",key:"11nf8s"}]]);/**
|
|
363
|
-
* @license lucide-react v0.469.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the ISC license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const E1=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
368
|
-
* @license lucide-react v0.469.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const Hi=ve("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
373
|
-
* @license lucide-react v0.469.0 - ISC
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the ISC license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/const j1=ve("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
|
|
378
|
-
* @license lucide-react v0.469.0 - ISC
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the ISC license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/const _1=ve("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
383
|
-
* @license lucide-react v0.469.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the ISC license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/const $v=ve("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
|
|
388
|
-
* @license lucide-react v0.469.0 - ISC
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the ISC license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/const Ur=ve("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
393
|
-
* @license lucide-react v0.469.0 - ISC
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the ISC license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/const Rl=ve("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
398
|
-
* @license lucide-react v0.469.0 - ISC
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the ISC license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/const zv=ve("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
403
|
-
* @license lucide-react v0.469.0 - ISC
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the ISC license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/const us=ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
408
|
-
* @license lucide-react v0.469.0 - ISC
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the ISC license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const Yl=ve("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
413
|
-
* @license lucide-react v0.469.0 - ISC
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the ISC license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/const R1=ve("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
|
|
418
|
-
* @license lucide-react v0.469.0 - ISC
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the ISC license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/const A1=ve("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
423
|
-
* @license lucide-react v0.469.0 - ISC
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the ISC license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/const I1=ve("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
428
|
-
* @license lucide-react v0.469.0 - ISC
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the ISC license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/const Fv=ve("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
433
|
-
* @license lucide-react v0.469.0 - ISC
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the ISC license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/const D1=ve("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
438
|
-
* @license lucide-react v0.469.0 - ISC
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the ISC license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/const Tn=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
443
|
-
* @license lucide-react v0.469.0 - ISC
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the ISC license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/const M1=ve("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),L1=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),O1=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function P1(t){return t.filter(([n])=>L1.has(n)).map(([n,r],o)=>[n,{...Object.fromEntries(Object.entries(r).filter(([a])=>O1.has(a))),key:String(o)}])}function Do({iconNode:t,size:n=14,className:r}){const o=x.useMemo(()=>t?P1(t):[],[t]);return o.length===0?l.jsx(Dv,{size:n,className:r,"aria-hidden":"true","data-testid":"app-icon-default"}):l.jsx(Tv,{iconNode:o,size:n,className:r,"aria-hidden":"true","data-testid":"app-icon"})}var Ni=Xg();function $1(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x.useMemo(()=>o=>{n.forEach(a=>a(o))},n)}const Ql=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mo(t){const n=Object.prototype.toString.call(t);return n==="[object Window]"||n==="[object global]"}function Jd(t){return"nodeType"in t}function Cn(t){var n,r;return t?Mo(t)?t:Jd(t)&&(n=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?n:window:window}function ef(t){const{Document:n}=Cn(t);return t instanceof n}function Vi(t){return Mo(t)?!1:t instanceof Cn(t).HTMLElement}function Uv(t){return t instanceof Cn(t).SVGElement}function Lo(t){return t?Mo(t)?t.document:Jd(t)?ef(t)?t:Vi(t)||Uv(t)?t.ownerDocument:document:document:document}const fs=Ql?x.useLayoutEffect:x.useEffect;function Zl(t){const n=x.useRef(t);return fs(()=>{n.current=t}),x.useCallback(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n.current==null?void 0:n.current(...o)},[])}function z1(){const t=x.useRef(null),n=x.useCallback((o,a)=>{t.current=setInterval(o,a)},[]),r=x.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[n,r]}function $i(t,n){n===void 0&&(n=[t]);const r=x.useRef(t);return fs(()=>{r.current!==t&&(r.current=t)},n),r}function Ki(t,n){const r=x.useRef();return x.useMemo(()=>{const o=t(r.current);return r.current=o,o},[...n])}function Al(t){const n=Zl(t),r=x.useRef(null),o=x.useCallback(a=>{a!==r.current&&(n==null||n(a,r.current)),r.current=a},[]);return[r,o]}function Il(t){const n=x.useRef();return x.useEffect(()=>{n.current=t},[t]),n.current}let Zu={};function Gi(t,n){return x.useMemo(()=>{if(n)return n;const r=Zu[t]==null?0:Zu[t]+1;return Zu[t]=r,t+"-"+r},[t,n])}function Bv(t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((c,d)=>{const p=Object.entries(d);for(const[g,m]of p){const v=c[g];v!=null&&(c[g]=v+t*m)}return c},{...n})}}const Ro=Bv(1),Dl=Bv(-1);function F1(t){return"clientX"in t&&"clientY"in t}function Jl(t){if(!t)return!1;const{KeyboardEvent:n}=Cn(t.target);return n&&t instanceof n}function U1(t){if(!t)return!1;const{TouchEvent:n}=Cn(t.target);return n&&t instanceof n}function Ml(t){if(U1(t)){if(t.touches&&t.touches.length){const{clientX:n,clientY:r}=t.touches[0];return{x:n,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:n,clientY:r}=t.changedTouches[0];return{x:n,y:r}}}return F1(t)?{x:t.clientX,y:t.clientY}:null}const Es=Object.freeze({Translate:{toString(t){if(!t)return;const{x:n,y:r}=t;return"translate3d("+(n?Math.round(n):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:n,scaleY:r}=t;return"scaleX("+n+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[Es.Translate.toString(t),Es.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:n,duration:r,easing:o}=t;return n+" "+r+"ms "+o}}}),_m="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function B1(t){return t.matches(_m)?t:t.querySelector(_m)}const W1={display:"none"};function H1(t){let{id:n,value:r}=t;return ct.createElement("div",{id:n,style:W1},r)}function V1(t){let{id:n,announcement:r,ariaLiveType:o="assertive"}=t;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ct.createElement("div",{id:n,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function K1(){const[t,n]=x.useState("");return{announce:x.useCallback(o=>{o!=null&&n(o)},[]),announcement:t}}const Wv=x.createContext(null);function G1(t){const n=x.useContext(Wv);x.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(t)},[t,n])}function q1(){const[t]=x.useState(()=>new Set),n=x.useCallback(o=>(t.add(o),()=>t.delete(o)),[t]);return[x.useCallback(o=>{let{type:a,event:c}=o;t.forEach(d=>{var p;return(p=d[a])==null?void 0:p.call(d,c)})},[t]),n]}const X1={draggable:`
|
|
448
|
-
To pick up a draggable item, press the space bar.
|
|
449
|
-
While dragging, use the arrow keys to move the item.
|
|
450
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
451
|
-
`},Y1={onDragStart(t){let{active:n}=t;return"Picked up draggable item "+n.id+"."},onDragOver(t){let{active:n,over:r}=t;return r?"Draggable item "+n.id+" was moved over droppable area "+r.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(t){let{active:n,over:r}=t;return r?"Draggable item "+n.id+" was dropped over droppable area "+r.id:"Draggable item "+n.id+" was dropped."},onDragCancel(t){let{active:n}=t;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Q1(t){let{announcements:n=Y1,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=X1}=t;const{announce:c,announcement:d}=K1(),p=Gi("DndLiveRegion"),[g,m]=x.useState(!1);if(x.useEffect(()=>{m(!0)},[]),G1(x.useMemo(()=>({onDragStart(k){let{active:y}=k;c(n.onDragStart({active:y}))},onDragMove(k){let{active:y,over:S}=k;n.onDragMove&&c(n.onDragMove({active:y,over:S}))},onDragOver(k){let{active:y,over:S}=k;c(n.onDragOver({active:y,over:S}))},onDragEnd(k){let{active:y,over:S}=k;c(n.onDragEnd({active:y,over:S}))},onDragCancel(k){let{active:y,over:S}=k;c(n.onDragCancel({active:y,over:S}))}}),[c,n])),!g)return null;const v=ct.createElement(ct.Fragment,null,ct.createElement(H1,{id:o,value:a.draggable}),ct.createElement(V1,{id:p,announcement:d}));return r?Ni.createPortal(v,r):v}var Ht;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Ht||(Ht={}));function Ll(){}function Hv(t,n){return x.useMemo(()=>({sensor:t,options:n??{}}),[t,n])}function Vv(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return x.useMemo(()=>[...n].filter(o=>o!=null),[...n])}const ps=Object.freeze({x:0,y:0});function Z1(t,n){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function J1(t,n){const r=Ml(t);if(!r)return"0 0";const o={x:(r.x-n.left)/n.width*100,y:(r.y-n.top)/n.height*100};return o.x+"% "+o.y+"%"}function eS(t,n){let{data:{value:r}}=t,{data:{value:o}}=n;return r-o}function tS(t,n){let{data:{value:r}}=t,{data:{value:o}}=n;return o-r}function nS(t,n){if(!t||t.length===0)return null;const[r]=t;return r[n]}function Rm(t,n,r){return n===void 0&&(n=t.left),r===void 0&&(r=t.top),{x:n+t.width*.5,y:r+t.height*.5}}const Kv=t=>{let{collisionRect:n,droppableRects:r,droppableContainers:o}=t;const a=Rm(n,n.left,n.top),c=[];for(const d of o){const{id:p}=d,g=r.get(p);if(g){const m=Z1(Rm(g),a);c.push({id:p,data:{droppableContainer:d,value:m}})}}return c.sort(eS)};function sS(t,n){const r=Math.max(n.top,t.top),o=Math.max(n.left,t.left),a=Math.min(n.left+n.width,t.left+t.width),c=Math.min(n.top+n.height,t.top+t.height),d=a-o,p=c-r;if(o<a&&r<c){const g=n.width*n.height,m=t.width*t.height,v=d*p,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const rS=t=>{let{collisionRect:n,droppableRects:r,droppableContainers:o}=t;const a=[];for(const c of o){const{id:d}=c,p=r.get(d);if(p){const g=sS(p,n);g>0&&a.push({id:d,data:{droppableContainer:c,value:g}})}}return a.sort(tS)};function oS(t,n,r){return{...t,scaleX:n&&r?n.width/r.width:1,scaleY:n&&r?n.height/r.height:1}}function Gv(t,n){return t&&n?{x:t.left-n.left,y:t.top-n.top}:ps}function iS(t){return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];return a.reduce((d,p)=>({...d,top:d.top+t*p.y,bottom:d.bottom+t*p.y,left:d.left+t*p.x,right:d.right+t*p.x}),{...r})}}const aS=iS(1);function qv(t){if(t.startsWith("matrix3d(")){const n=t.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(t.startsWith("matrix(")){const n=t.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function lS(t,n,r){const o=qv(n);if(!o)return t;const{scaleX:a,scaleY:c,x:d,y:p}=o,g=t.left-d-(1-a)*parseFloat(r),m=t.top-p-(1-c)*parseFloat(r.slice(r.indexOf(" ")+1)),v=a?t.width/a:t.width,k=c?t.height/c:t.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const cS={ignoreTransform:!1};function Oo(t,n){n===void 0&&(n=cS);let r=t.getBoundingClientRect();if(n.ignoreTransform){const{transform:m,transformOrigin:v}=Cn(t).getComputedStyle(t);m&&(r=lS(r,m,v))}const{top:o,left:a,width:c,height:d,bottom:p,right:g}=r;return{top:o,left:a,width:c,height:d,bottom:p,right:g}}function Am(t){return Oo(t,{ignoreTransform:!0})}function uS(t){const n=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}function dS(t,n){return n===void 0&&(n=Cn(t).getComputedStyle(t)),n.position==="fixed"}function fS(t,n){n===void 0&&(n=Cn(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const c=n[a];return typeof c=="string"?r.test(c):!1})}function tf(t,n){const r=[];function o(a){if(n!=null&&r.length>=n||!a)return r;if(ef(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!Vi(a)||Uv(a)||r.includes(a))return r;const c=Cn(t).getComputedStyle(a);return a!==t&&fS(a,c)&&r.push(a),dS(a,c)?r:o(a.parentNode)}return t?o(t):r}function Xv(t){const[n]=tf(t,1);return n??null}function Ju(t){return!Ql||!t?null:Mo(t)?t:Jd(t)?ef(t)||t===Lo(t).scrollingElement?window:Vi(t)?t:null:null}function Yv(t){return Mo(t)?t.scrollX:t.scrollLeft}function Qv(t){return Mo(t)?t.scrollY:t.scrollTop}function vd(t){return{x:Yv(t),y:Qv(t)}}var en;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(en||(en={}));function Zv(t){return!Ql||!t?!1:t===document.scrollingElement}function Jv(t){const n={x:0,y:0},r=Zv(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},a=t.scrollTop<=n.y,c=t.scrollLeft<=n.x,d=t.scrollTop>=o.y,p=t.scrollLeft>=o.x;return{isTop:a,isLeft:c,isBottom:d,isRight:p,maxScroll:o,minScroll:n}}const pS={x:.2,y:.2};function hS(t,n,r,o,a){let{top:c,left:d,right:p,bottom:g}=r;o===void 0&&(o=10),a===void 0&&(a=pS);const{isTop:m,isBottom:v,isLeft:k,isRight:y}=Jv(t),S={x:0,y:0},C={x:0,y:0},b={height:n.height*a.y,width:n.width*a.x};return!m&&c<=n.top+b.height?(S.y=en.Backward,C.y=o*Math.abs((n.top+b.height-c)/b.height)):!v&&g>=n.bottom-b.height&&(S.y=en.Forward,C.y=o*Math.abs((n.bottom-b.height-g)/b.height)),!y&&p>=n.right-b.width?(S.x=en.Forward,C.x=o*Math.abs((n.right-b.width-p)/b.width)):!k&&d<=n.left+b.width&&(S.x=en.Backward,C.x=o*Math.abs((n.left+b.width-d)/b.width)),{direction:S,speed:C}}function mS(t){if(t===document.scrollingElement){const{innerWidth:c,innerHeight:d}=window;return{top:0,left:0,right:c,bottom:d,width:c,height:d}}const{top:n,left:r,right:o,bottom:a}=t.getBoundingClientRect();return{top:n,left:r,right:o,bottom:a,width:t.clientWidth,height:t.clientHeight}}function ey(t){return t.reduce((n,r)=>Ro(n,vd(r)),ps)}function gS(t){return t.reduce((n,r)=>n+Yv(r),0)}function vS(t){return t.reduce((n,r)=>n+Qv(r),0)}function ty(t,n){if(n===void 0&&(n=Oo),!t)return;const{top:r,left:o,bottom:a,right:c}=n(t);Xv(t)&&(a<=0||c<=0||r>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const yS=[["x",["left","right"],gS],["y",["top","bottom"],vS]];class nf{constructor(n,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=tf(r),a=ey(o);this.rect={...n},this.width=n.width,this.height=n.height;for(const[c,d,p]of yS)for(const g of d)Object.defineProperty(this,g,{get:()=>{const m=p(o),v=a[c]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ei{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=n}add(n,r,o){var a;(a=this.target)==null||a.addEventListener(n,r,o),this.listeners.push([n,r,o])}}function xS(t){const{EventTarget:n}=Cn(t);return t instanceof n?t:Lo(t)}function ed(t,n){const r=Math.abs(t.x),o=Math.abs(t.y);return typeof n=="number"?Math.sqrt(r**2+o**2)>n:"x"in n&&"y"in n?r>n.x&&o>n.y:"x"in n?r>n.x:"y"in n?o>n.y:!1}var es;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(es||(es={}));function Im(t){t.preventDefault()}function wS(t){t.stopPropagation()}var nt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(nt||(nt={}));const ny={start:[nt.Space,nt.Enter],cancel:[nt.Esc],end:[nt.Space,nt.Enter,nt.Tab]},kS=(t,n)=>{let{currentCoordinates:r}=n;switch(t.code){case nt.Right:return{...r,x:r.x+25};case nt.Left:return{...r,x:r.x-25};case nt.Down:return{...r,y:r.y+25};case nt.Up:return{...r,y:r.y-25}}};class sy{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:r}}=n;this.props=n,this.listeners=new Ei(Lo(r)),this.windowListeners=new Ei(Cn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(es.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:r}=this.props,o=n.node.current;o&&ty(o),r(ps)}handleKeyDown(n){if(Jl(n)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:c=ny,coordinateGetter:d=kS,scrollBehavior:p="smooth"}=a,{code:g}=n;if(c.end.includes(g)){this.handleEnd(n);return}if(c.cancel.includes(g)){this.handleCancel(n);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:ps;this.referenceCoordinates||(this.referenceCoordinates=v);const k=d(n,{active:r,context:o.current,currentCoordinates:v});if(k){const y=Dl(k,v),S={x:0,y:0},{scrollableAncestors:C}=o.current;for(const b of C){const N=n.code,{isTop:E,isRight:R,isLeft:z,isBottom:I,maxScroll:L,minScroll:q}=Jv(b),K=mS(b),$={x:Math.min(N===nt.Right?K.right-K.width/2:K.right,Math.max(N===nt.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(N===nt.Down?K.bottom-K.height/2:K.bottom,Math.max(N===nt.Down?K.top:K.top+K.height/2,k.y))},Z=N===nt.Right&&!R||N===nt.Left&&!z,he=N===nt.Down&&!I||N===nt.Up&&!E;if(Z&&$.x!==k.x){const ce=b.scrollLeft+y.x,ye=N===nt.Right&&ce<=L.x||N===nt.Left&&ce>=q.x;if(ye&&!y.y){b.scrollTo({left:ce,behavior:p});return}ye?S.x=b.scrollLeft-ce:S.x=N===nt.Right?b.scrollLeft-L.x:b.scrollLeft-q.x,S.x&&b.scrollBy({left:-S.x,behavior:p});break}else if(he&&$.y!==k.y){const ce=b.scrollTop+y.y,ye=N===nt.Down&&ce<=L.y||N===nt.Up&&ce>=q.y;if(ye&&!y.x){b.scrollTo({top:ce,behavior:p});return}ye?S.y=b.scrollTop-ce:S.y=N===nt.Down?b.scrollTop-L.y:b.scrollTop-q.y,S.y&&b.scrollBy({top:-S.y,behavior:p});break}}this.handleMove(n,Ro(Dl(k,this.referenceCoordinates),S))}}}handleMove(n,r){const{onMove:o}=this.props;n.preventDefault(),o(r)}handleEnd(n){const{onEnd:r}=this.props;n.preventDefault(),this.detach(),r()}handleCancel(n){const{onCancel:r}=this.props;n.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}sy.activators=[{eventName:"onKeyDown",handler:(t,n,r)=>{let{keyboardCodes:o=ny,onActivation:a}=n,{active:c}=r;const{code:d}=t.nativeEvent;if(o.start.includes(d)){const p=c.activatorNode.current;return p&&t.target!==p?!1:(t.preventDefault(),a==null||a({event:t.nativeEvent}),!0)}return!1}}];function Dm(t){return!!(t&&"distance"in t)}function Mm(t){return!!(t&&"delay"in t)}class sf{constructor(n,r,o){var a;o===void 0&&(o=xS(n.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=n,this.events=r;const{event:c}=n,{target:d}=c;this.props=n,this.events=r,this.document=Lo(d),this.documentListeners=new Ei(this.document),this.listeners=new Ei(o),this.windowListeners=new Ei(Cn(d)),this.initialCoordinates=(a=Ml(c))!=null?a:ps,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:n,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.DragStart,Im),this.windowListeners.add(es.VisibilityChange,this.handleCancel),this.windowListeners.add(es.ContextMenu,Im),this.documentListeners.add(es.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Mm(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Dm(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(n,r){const{active:o,onPending:a}=this.props;a(o,n,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:n}=this,{onStart:r}=this.props;n&&(this.activated=!0,this.documentListeners.add(es.Click,wS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(es.SelectionChange,this.removeTextSelection),r(n))}handleMove(n){var r;const{activated:o,initialCoordinates:a,props:c}=this,{onMove:d,options:{activationConstraint:p}}=c;if(!a)return;const g=(r=Ml(n))!=null?r:ps,m=Dl(a,g);if(!o&&p){if(Dm(p)){if(p.tolerance!=null&&ed(m,p.tolerance))return this.handleCancel();if(ed(m,p.distance))return this.handleStart()}if(Mm(p)&&ed(m,p.tolerance))return this.handleCancel();this.handlePending(p,m);return}n.cancelable&&n.preventDefault(),d(g)}handleEnd(){const{onAbort:n,onEnd:r}=this.props;this.detach(),this.activated||n(this.props.active),r()}handleCancel(){const{onAbort:n,onCancel:r}=this.props;this.detach(),this.activated||n(this.props.active),r()}handleKeydown(n){n.code===nt.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const SS={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ec extends sf{constructor(n){const{event:r}=n,o=Lo(r.target);super(n,SS,o)}}ec.activators=[{eventName:"onPointerDown",handler:(t,n)=>{let{nativeEvent:r}=t,{onActivation:o}=n;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const bS={move:{name:"mousemove"},end:{name:"mouseup"}};var yd;(function(t){t[t.RightClick=2]="RightClick"})(yd||(yd={}));class NS extends sf{constructor(n){super(n,bS,Lo(n.event.target))}}NS.activators=[{eventName:"onMouseDown",handler:(t,n)=>{let{nativeEvent:r}=t,{onActivation:o}=n;return r.button===yd.RightClick?!1:(o==null||o({event:r}),!0)}}];const td={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class TS extends sf{constructor(n){super(n,td)}static setup(){return window.addEventListener(td.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(td.move.name,n)};function n(){}}}TS.activators=[{eventName:"onTouchStart",handler:(t,n)=>{let{nativeEvent:r}=t,{onActivation:o}=n;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var ji;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ji||(ji={}));var Ol;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ol||(Ol={}));function CS(t){let{acceleration:n,activator:r=ji.Pointer,canScroll:o,draggingRect:a,enabled:c,interval:d=5,order:p=Ol.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:y}=t;const S=jS({delta:k,disabled:!c}),[C,b]=z1(),N=x.useRef({x:0,y:0}),E=x.useRef({x:0,y:0}),R=x.useMemo(()=>{switch(r){case ji.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ji.DraggableRect:return a}},[r,a,g]),z=x.useRef(null),I=x.useCallback(()=>{const q=z.current;if(!q)return;const K=N.current.x*E.current.x,$=N.current.y*E.current.y;q.scrollBy(K,$)},[]),L=x.useMemo(()=>p===Ol.TreeOrder?[...m].reverse():m,[p,m]);x.useEffect(()=>{if(!c||!m.length||!R){b();return}for(const q of L){if((o==null?void 0:o(q))===!1)continue;const K=m.indexOf(q),$=v[K];if(!$)continue;const{direction:Z,speed:he}=hS(q,$,R,n,y);for(const ce of["x","y"])S[ce][Z[ce]]||(he[ce]=0,Z[ce]=0);if(he.x>0||he.y>0){b(),z.current=q,C(I,d),N.current=he,E.current=Z;return}}N.current={x:0,y:0},E.current={x:0,y:0},b()},[n,I,o,b,c,d,JSON.stringify(R),JSON.stringify(S),C,m,L,v,JSON.stringify(y)])}const ES={x:{[en.Backward]:!1,[en.Forward]:!1},y:{[en.Backward]:!1,[en.Forward]:!1}};function jS(t){let{delta:n,disabled:r}=t;const o=Il(n);return Ki(a=>{if(r||!o||!a)return ES;const c={x:Math.sign(n.x-o.x),y:Math.sign(n.y-o.y)};return{x:{[en.Backward]:a.x[en.Backward]||c.x===-1,[en.Forward]:a.x[en.Forward]||c.x===1},y:{[en.Backward]:a.y[en.Backward]||c.y===-1,[en.Forward]:a.y[en.Forward]||c.y===1}}},[r,n,o])}function _S(t,n){const r=n!=null?t.get(n):void 0,o=r?r.node.current:null;return Ki(a=>{var c;return n==null?null:(c=o??a)!=null?c:null},[o,n])}function RS(t,n){return x.useMemo(()=>t.reduce((r,o)=>{const{sensor:a}=o,c=a.activators.map(d=>({eventName:d.eventName,handler:n(d.handler,o)}));return[...r,...c]},[]),[t,n])}var zi;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(zi||(zi={}));var xd;(function(t){t.Optimized="optimized"})(xd||(xd={}));const Lm=new Map;function AS(t,n){let{dragging:r,dependencies:o,config:a}=n;const[c,d]=x.useState(null),{frequency:p,measure:g,strategy:m}=a,v=x.useRef(t),k=N(),y=$i(k),S=x.useCallback(function(E){E===void 0&&(E=[]),!y.current&&d(R=>R===null?E:R.concat(E.filter(z=>!R.includes(z))))},[y]),C=x.useRef(null),b=Ki(E=>{if(k&&!r)return Lm;if(!E||E===Lm||v.current!==t||c!=null){const R=new Map;for(let z of t){if(!z)continue;if(c&&c.length>0&&!c.includes(z.id)&&z.rect.current){R.set(z.id,z.rect.current);continue}const I=z.node.current,L=I?new nf(g(I),I):null;z.rect.current=L,L&&R.set(z.id,L)}return R}return E},[t,c,r,k,g]);return x.useEffect(()=>{v.current=t},[t]),x.useEffect(()=>{k||S()},[r,k]),x.useEffect(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),x.useEffect(()=>{k||typeof p!="number"||C.current!==null||(C.current=setTimeout(()=>{S(),C.current=null},p))},[p,k,S,...o]),{droppableRects:b,measureDroppableContainers:S,measuringScheduled:c!=null};function N(){switch(m){case zi.Always:return!1;case zi.BeforeDragging:return r;default:return!r}}}function rf(t,n){return Ki(r=>t?r||(typeof n=="function"?n(t):t):null,[n,t])}function IS(t,n){return rf(t,n)}function DS(t){let{callback:n,disabled:r}=t;const o=Zl(n),a=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:c}=window;return new c(o)},[o,r]);return x.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function tc(t){let{callback:n,disabled:r}=t;const o=Zl(n),a=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:c}=window;return new c(o)},[r]);return x.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function MS(t){return new nf(Oo(t),t)}function Om(t,n,r){n===void 0&&(n=MS);const[o,a]=x.useState(null);function c(){a(g=>{if(!t)return null;if(t.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=n(t);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const d=DS({callback(g){if(t)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(t)){c();break}}}}),p=tc({callback:c});return fs(()=>{c(),t?(p==null||p.observe(t),d==null||d.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),d==null||d.disconnect())},[t]),o}function LS(t){const n=rf(t);return Gv(t,n)}const Pm=[];function OS(t){const n=x.useRef(t),r=Ki(o=>t?o&&o!==Pm&&t&&n.current&&t.parentNode===n.current.parentNode?o:tf(t):Pm,[t]);return x.useEffect(()=>{n.current=t},[t]),r}function PS(t){const[n,r]=x.useState(null),o=x.useRef(t),a=x.useCallback(c=>{const d=Ju(c.target);d&&r(p=>p?(p.set(d,vd(d)),new Map(p)):null)},[]);return x.useEffect(()=>{const c=o.current;if(t!==c){d(c);const p=t.map(g=>{const m=Ju(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,vd(m)]):null}).filter(g=>g!=null);r(p.length?new Map(p):null),o.current=t}return()=>{d(t),d(c)};function d(p){p.forEach(g=>{const m=Ju(g);m==null||m.removeEventListener("scroll",a)})}},[a,t]),x.useMemo(()=>t.length?n?Array.from(n.values()).reduce((c,d)=>Ro(c,d),ps):ey(t):ps,[t,n])}function $m(t,n){n===void 0&&(n=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},n),x.useEffect(()=>{const o=t!==ps;o&&!r.current&&(r.current=t),!o&&r.current&&(r.current=null)},[t]),r.current?Dl(t,r.current):ps}function $S(t){x.useEffect(()=>{if(!Ql)return;const n=t.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of n)r==null||r()}},t.map(n=>{let{sensor:r}=n;return r}))}function zS(t,n){return x.useMemo(()=>t.reduce((r,o)=>{let{eventName:a,handler:c}=o;return r[a]=d=>{c(d,n)},r},{}),[t,n])}function ry(t){return x.useMemo(()=>t?uS(t):null,[t])}const zm=[];function FS(t,n){n===void 0&&(n=Oo);const[r]=t,o=ry(r?Cn(r):null),[a,c]=x.useState(zm);function d(){c(()=>t.length?t.map(g=>Zv(g)?o:new nf(n(g),g)):zm)}const p=tc({callback:d});return fs(()=>{p==null||p.disconnect(),d(),t.forEach(g=>p==null?void 0:p.observe(g))},[t]),a}function oy(t){if(!t)return null;if(t.children.length>1)return t;const n=t.children[0];return Vi(n)?n:t}function US(t){let{measure:n}=t;const[r,o]=x.useState(null),a=x.useCallback(m=>{for(const{target:v}of m)if(Vi(v)){o(k=>{const y=n(v);return k?{...k,width:y.width,height:y.height}:y});break}},[n]),c=tc({callback:a}),d=x.useCallback(m=>{const v=oy(m);c==null||c.disconnect(),v&&(c==null||c.observe(v)),o(v?n(v):null)},[n,c]),[p,g]=Al(d);return x.useMemo(()=>({nodeRef:p,rect:r,setRef:g}),[r,p,g])}const BS=[{sensor:ec,options:{}},{sensor:sy,options:{}}],WS={current:{}},ml={draggable:{measure:Am},droppable:{measure:Am,strategy:zi.WhileDragging,frequency:xd.Optimized},dragOverlay:{measure:Oo}};class _i extends Map{get(n){var r;return n!=null&&(r=super.get(n))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:r}=n;return!r})}getNodeFor(n){var r,o;return(r=(o=this.get(n))==null?void 0:o.node.current)!=null?r:void 0}}const HS={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _i,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ll},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ml,measureDroppableContainers:Ll,windowRect:null,measuringScheduled:!1},iy={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ll,draggableNodes:new Map,over:null,measureDroppableContainers:Ll},qi=x.createContext(iy),ay=x.createContext(HS);function VS(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _i}}}function KS(t,n){switch(n.type){case Ht.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case Ht.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:n.coordinates.x-t.draggable.initialCoordinates.x,y:n.coordinates.y-t.draggable.initialCoordinates.y}}};case Ht.DragEnd:case Ht.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ht.RegisterDroppable:{const{element:r}=n,{id:o}=r,a=new _i(t.droppable.containers);return a.set(o,r),{...t,droppable:{...t.droppable,containers:a}}}case Ht.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=n,c=t.droppable.containers.get(r);if(!c||o!==c.key)return t;const d=new _i(t.droppable.containers);return d.set(r,{...c,disabled:a}),{...t,droppable:{...t.droppable,containers:d}}}case Ht.UnregisterDroppable:{const{id:r,key:o}=n,a=t.droppable.containers.get(r);if(!a||o!==a.key)return t;const c=new _i(t.droppable.containers);return c.delete(r),{...t,droppable:{...t.droppable,containers:c}}}default:return t}}function GS(t){let{disabled:n}=t;const{active:r,activatorEvent:o,draggableNodes:a}=x.useContext(qi),c=Il(o),d=Il(r==null?void 0:r.id);return x.useEffect(()=>{if(!n&&!o&&c&&d!=null){if(!Jl(c)||document.activeElement===c.target)return;const p=a.get(d);if(!p)return;const{activatorNode:g,node:m}=p;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=B1(v);if(k){k.focus();break}}})}},[o,n,a,d,c]),null}function ly(t,n){let{transform:r,...o}=n;return t!=null&&t.length?t.reduce((a,c)=>c({transform:a,...o}),r):r}function qS(t){return x.useMemo(()=>({draggable:{...ml.draggable,...t==null?void 0:t.draggable},droppable:{...ml.droppable,...t==null?void 0:t.droppable},dragOverlay:{...ml.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function XS(t){let{activeNode:n,measure:r,initialRect:o,config:a=!0}=t;const c=x.useRef(!1),{x:d,y:p}=typeof a=="boolean"?{x:a,y:a}:a;fs(()=>{if(!d&&!p||!n){c.current=!1;return}if(c.current||!o)return;const m=n==null?void 0:n.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=Gv(v,o);if(d||(k.x=0),p||(k.y=0),c.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=Xv(m);y&&y.scrollBy({top:k.y,left:k.x})}},[n,d,p,o,r])}const nc=x.createContext({...ps,scaleX:1,scaleY:1});var dr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(dr||(dr={}));const cy=x.memo(function(n){var r,o,a,c;let{id:d,accessibility:p,autoScroll:g=!0,children:m,sensors:v=BS,collisionDetection:k=rS,measuring:y,modifiers:S,...C}=n;const b=x.useReducer(KS,void 0,VS),[N,E]=b,[R,z]=q1(),[I,L]=x.useState(dr.Uninitialized),q=I===dr.Initialized,{draggable:{active:K,nodes:$,translate:Z},droppable:{containers:he}}=N,ce=K!=null?$.get(K):null,ye=x.useRef({initial:null,translated:null}),Se=x.useMemo(()=>{var Ze;return K!=null?{id:K,data:(Ze=ce==null?void 0:ce.data)!=null?Ze:WS,rect:ye}:null},[K,ce]),Oe=x.useRef(null),[J,re]=x.useState(null),[oe,F]=x.useState(null),Q=$i(C,Object.values(C)),G=Gi("DndDescribedBy",d),D=x.useMemo(()=>he.getEnabled(),[he]),P=qS(y),{droppableRects:le,measureDroppableContainers:W,measuringScheduled:X}=AS(D,{dragging:q,dependencies:[Z.x,Z.y],config:P.droppable}),ae=_S($,K),be=x.useMemo(()=>oe?Ml(oe):null,[oe]),_e=vn(),Ae=IS(ae,P.draggable.measure);XS({activeNode:K!=null?$.get(K):null,config:_e.layoutShiftCompensation,initialRect:Ae,measure:P.draggable.measure});const je=Om(ae,P.draggable.measure,Ae),me=Om(ae?ae.parentElement:null),pe=x.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:le,draggableNodes:$,draggingNode:null,draggingNodeRect:null,droppableContainers:he,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=he.getNodeFor((r=pe.current.over)==null?void 0:r.id),Ie=US({measure:P.dragOverlay.measure}),mt=(o=Ie.nodeRef.current)!=null?o:ae,Ue=q?(a=Ie.rect)!=null?a:je:null,Vt=!!(Ie.nodeRef.current&&Ie.rect),tn=LS(Vt?null:je),kt=ry(mt?Cn(mt):null),jt=OS(q?Ve??ae:null),Ft=FS(jt),Ot=ly(S,{transform:{x:Z.x-tn.x,y:Z.y-tn.y,scaleX:1,scaleY:1},activatorEvent:oe,active:Se,activeNodeRect:je,containerNodeRect:me,draggingNodeRect:Ue,over:pe.current.over,overlayNodeRect:Ie.rect,scrollableAncestors:jt,scrollableAncestorRects:Ft,windowRect:kt}),Y=be?Ro(be,Z):null,ge=PS(jt),Be=$m(ge),st=$m(ge,[je]),gt=Ro(Ot,Be),vt=Ue?aS(Ue,Ot):null,_t=Se&&vt?k({active:Se,collisionRect:vt,droppableRects:le,droppableContainers:D,pointerCoordinates:Y}):null,an=nS(_t,"id"),[dt,Mn]=x.useState(null),Ln=Vt?Ot:Ro(Ot,st),hs=oS(Ln,(c=dt==null?void 0:dt.rect)!=null?c:null,je),ms=x.useRef(null),ns=x.useCallback((Ze,Rt)=>{let{sensor:ft,options:Gt}=Rt;if(Oe.current==null)return;const yt=$.get(Oe.current);if(!yt)return;const xt=Ze.nativeEvent,lt=new ft({active:Oe.current,activeNode:yt,event:xt,options:Gt,context:pe,onAbort(ot){if(!$.get(ot))return;const{onDragAbort:_}=Q.current,fe={id:ot};_==null||_(fe),R({type:"onDragAbort",event:fe})},onPending(ot,Pt,_,fe){if(!$.get(ot))return;const{onDragPending:we}=Q.current,Pe={id:ot,constraint:Pt,initialCoordinates:_,offset:fe};we==null||we(Pe),R({type:"onDragPending",event:Pe})},onStart(ot){const Pt=Oe.current;if(Pt==null)return;const _=$.get(Pt);if(!_)return;const{onDragStart:fe}=Q.current,ie={activatorEvent:xt,active:{id:Pt,data:_.data,rect:ye}};Ni.unstable_batchedUpdates(()=>{fe==null||fe(ie),L(dr.Initializing),E({type:Ht.DragStart,initialCoordinates:ot,active:Pt}),R({type:"onDragStart",event:ie}),re(ms.current),F(xt)})},onMove(ot){E({type:Ht.DragMove,coordinates:ot})},onEnd:qt(Ht.DragEnd),onCancel:qt(Ht.DragCancel)});ms.current=lt;function qt(ot){return async function(){const{active:_,collisions:fe,over:ie,scrollAdjustedTranslate:we}=pe.current;let Pe=null;if(_&&we){const{cancelDrop:qe}=Q.current;Pe={activatorEvent:xt,active:_,collisions:fe,delta:we,over:ie},ot===Ht.DragEnd&&typeof qe=="function"&&await Promise.resolve(qe(Pe))&&(ot=Ht.DragCancel)}Oe.current=null,Ni.unstable_batchedUpdates(()=>{E({type:ot}),L(dr.Uninitialized),Mn(null),re(null),F(null),ms.current=null;const qe=ot===Ht.DragEnd?"onDragEnd":"onDragCancel";if(Pe){const $e=Q.current[qe];$e==null||$e(Pe),R({type:qe,event:Pe})}})}}},[$]),On=x.useCallback((Ze,Rt)=>(ft,Gt)=>{const yt=ft.nativeEvent,xt=$.get(Gt);if(Oe.current!==null||!xt||yt.dndKit||yt.defaultPrevented)return;const lt={active:xt};Ze(ft,Rt.options,lt)===!0&&(yt.dndKit={capturedBy:Rt.sensor},Oe.current=Gt,ns(ft,Rt))},[$,ns]),gn=RS(v,On);$S(v),fs(()=>{je&&I===dr.Initializing&&L(dr.Initialized)},[je,I]),x.useEffect(()=>{const{onDragMove:Ze}=Q.current,{active:Rt,activatorEvent:ft,collisions:Gt,over:yt}=pe.current;if(!Rt||!ft)return;const xt={active:Rt,activatorEvent:ft,collisions:Gt,delta:{x:gt.x,y:gt.y},over:yt};Ni.unstable_batchedUpdates(()=>{Ze==null||Ze(xt),R({type:"onDragMove",event:xt})})},[gt.x,gt.y]),x.useEffect(()=>{const{active:Ze,activatorEvent:Rt,collisions:ft,droppableContainers:Gt,scrollAdjustedTranslate:yt}=pe.current;if(!Ze||Oe.current==null||!Rt||!yt)return;const{onDragOver:xt}=Q.current,lt=Gt.get(an),qt=lt&<.rect.current?{id:lt.id,rect:lt.rect.current,data:lt.data,disabled:lt.disabled}:null,ot={active:Ze,activatorEvent:Rt,collisions:ft,delta:{x:yt.x,y:yt.y},over:qt};Ni.unstable_batchedUpdates(()=>{Mn(qt),xt==null||xt(ot),R({type:"onDragOver",event:ot})})},[an]),fs(()=>{pe.current={activatorEvent:oe,active:Se,activeNode:ae,collisionRect:vt,collisions:_t,droppableRects:le,draggableNodes:$,draggingNode:mt,draggingNodeRect:Ue,droppableContainers:he,over:dt,scrollableAncestors:jt,scrollAdjustedTranslate:gt},ye.current={initial:Ue,translated:vt}},[Se,ae,_t,vt,$,mt,Ue,le,he,dt,jt,gt]),CS({..._e,delta:Z,draggingRect:vt,pointerCoordinates:Y,scrollableAncestors:jt,scrollableAncestorRects:Ft});const ln=x.useMemo(()=>({active:Se,activeNode:ae,activeNodeRect:je,activatorEvent:oe,collisions:_t,containerNodeRect:me,dragOverlay:Ie,draggableNodes:$,droppableContainers:he,droppableRects:le,over:dt,measureDroppableContainers:W,scrollableAncestors:jt,scrollableAncestorRects:Ft,measuringConfiguration:P,measuringScheduled:X,windowRect:kt}),[Se,ae,je,oe,_t,me,Ie,$,he,le,dt,W,jt,Ft,P,X,kt]),Kt=x.useMemo(()=>({activatorEvent:oe,activators:gn,active:Se,activeNodeRect:je,ariaDescribedById:{draggable:G},dispatch:E,draggableNodes:$,over:dt,measureDroppableContainers:W}),[oe,gn,Se,je,E,G,$,dt,W]);return ct.createElement(Wv.Provider,{value:z},ct.createElement(qi.Provider,{value:Kt},ct.createElement(ay.Provider,{value:ln},ct.createElement(nc.Provider,{value:hs},m)),ct.createElement(GS,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ct.createElement(Q1,{...p,hiddenTextDescribedById:G}));function vn(){const Ze=(J==null?void 0:J.autoScrollEnabled)===!1,Rt=typeof g=="object"?g.enabled===!1:g===!1,ft=q&&!Ze&&!Rt;return typeof g=="object"?{...g,enabled:ft}:{enabled:ft}}}),YS=x.createContext(null),Fm="button",QS="Draggable";function ZS(t){let{id:n,data:r,disabled:o=!1,attributes:a}=t;const c=Gi(QS),{activators:d,activatorEvent:p,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:y}=x.useContext(qi),{role:S=Fm,roleDescription:C="draggable",tabIndex:b=0}=a??{},N=(g==null?void 0:g.id)===n,E=x.useContext(N?nc:YS),[R,z]=Al(),[I,L]=Al(),q=zS(d,n),K=$i(r);fs(()=>(k.set(n,{id:n,key:c,node:R,activatorNode:I,data:K}),()=>{const Z=k.get(n);Z&&Z.key===c&&k.delete(n)}),[k,n]);const $=x.useMemo(()=>({role:S,tabIndex:b,"aria-disabled":o,"aria-pressed":N&&S===Fm?!0:void 0,"aria-roledescription":C,"aria-describedby":v.draggable}),[o,S,b,N,C,v.draggable]);return{active:g,activatorEvent:p,activeNodeRect:m,attributes:$,isDragging:N,listeners:o?void 0:q,node:R,over:y,setNodeRef:z,setActivatorNodeRef:L,transform:E}}function uy(){return x.useContext(ay)}const JS="Droppable",eb={timeout:25};function dy(t){let{data:n,disabled:r=!1,id:o,resizeObserverConfig:a}=t;const c=Gi(JS),{active:d,dispatch:p,over:g,measureDroppableContainers:m}=x.useContext(qi),v=x.useRef({disabled:r}),k=x.useRef(!1),y=x.useRef(null),S=x.useRef(null),{disabled:C,updateMeasurementsFor:b,timeout:N}={...eb,...a},E=$i(b??o),R=x.useCallback(()=>{if(!k.current){k.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{m(Array.isArray(E.current)?E.current:[E.current]),S.current=null},N)},[N]),z=tc({callback:R,disabled:C||!d}),I=x.useCallback(($,Z)=>{z&&(Z&&(z.unobserve(Z),k.current=!1),$&&z.observe($))},[z]),[L,q]=Al(I),K=$i(n);return x.useEffect(()=>{!z||!L.current||(z.disconnect(),k.current=!1,z.observe(L.current))},[L,z]),x.useEffect(()=>(p({type:Ht.RegisterDroppable,element:{id:o,key:c,disabled:r,node:L,rect:y,data:K}}),()=>p({type:Ht.UnregisterDroppable,key:c,id:o})),[o]),x.useEffect(()=>{r!==v.current.disabled&&(p({type:Ht.SetDroppableDisabled,id:o,key:c,disabled:r}),v.current.disabled=r)},[o,c,r,p]),{active:d,rect:y,isOver:(g==null?void 0:g.id)===o,node:L,over:g,setNodeRef:q}}function tb(t){let{animation:n,children:r}=t;const[o,a]=x.useState(null),[c,d]=x.useState(null),p=Il(r);return!r&&!o&&p&&a(p),fs(()=>{if(!c)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){a(null);return}Promise.resolve(n(m,c)).then(()=>{a(null)})},[n,o,c]),ct.createElement(ct.Fragment,null,r,o?x.cloneElement(o,{ref:d}):null)}const nb={x:0,y:0,scaleX:1,scaleY:1};function sb(t){let{children:n}=t;return ct.createElement(qi.Provider,{value:iy},ct.createElement(nc.Provider,{value:nb},n))}const rb={position:"fixed",touchAction:"none"},ob=t=>Jl(t)?"transform 250ms ease":void 0,ib=x.forwardRef((t,n)=>{let{as:r,activatorEvent:o,adjustScale:a,children:c,className:d,rect:p,style:g,transform:m,transition:v=ob}=t;if(!p)return null;const k=a?m:{...m,scaleX:1,scaleY:1},y={...rb,width:p.width,height:p.height,top:p.top,left:p.left,transform:Es.Transform.toString(k),transformOrigin:a&&o?J1(o,p):void 0,transition:typeof v=="function"?v(o):v,...g};return ct.createElement(r,{className:d,style:y,ref:n},c)}),ab=t=>n=>{let{active:r,dragOverlay:o}=n;const a={},{styles:c,className:d}=t;if(c!=null&&c.active)for(const[p,g]of Object.entries(c.active))g!==void 0&&(a[p]=r.node.style.getPropertyValue(p),r.node.style.setProperty(p,g));if(c!=null&&c.dragOverlay)for(const[p,g]of Object.entries(c.dragOverlay))g!==void 0&&o.node.style.setProperty(p,g);return d!=null&&d.active&&r.node.classList.add(d.active),d!=null&&d.dragOverlay&&o.node.classList.add(d.dragOverlay),function(){for(const[g,m]of Object.entries(a))r.node.style.setProperty(g,m);d!=null&&d.active&&r.node.classList.remove(d.active)}},lb=t=>{let{transform:{initial:n,final:r}}=t;return[{transform:Es.Transform.toString(n)},{transform:Es.Transform.toString(r)}]},cb={duration:250,easing:"ease",keyframes:lb,sideEffects:ab({styles:{active:{opacity:"0"}}})};function ub(t){let{config:n,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=t;return Zl((c,d)=>{if(n===null)return;const p=r.get(c);if(!p)return;const g=p.node.current;if(!g)return;const m=oy(d);if(!m)return;const{transform:v}=Cn(d).getComputedStyle(d),k=qv(v);if(!k)return;const y=typeof n=="function"?n:db(n);return ty(g,a.draggable.measure),y({active:{id:c,data:p.data,node:g,rect:a.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:d,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function db(t){const{duration:n,easing:r,sideEffects:o,keyframes:a}={...cb,...t};return c=>{let{active:d,dragOverlay:p,transform:g,...m}=c;if(!n)return;const v={x:p.rect.left-d.rect.left,y:p.rect.top-d.rect.top},k={scaleX:g.scaleX!==1?d.rect.width*g.scaleX/p.rect.width:1,scaleY:g.scaleY!==1?d.rect.height*g.scaleY/p.rect.height:1},y={x:g.x-v.x,y:g.y-v.y,...k},S=a({...m,active:d,dragOverlay:p,transform:{initial:g,final:y}}),[C]=S,b=S[S.length-1];if(JSON.stringify(C)===JSON.stringify(b))return;const N=o==null?void 0:o({active:d,dragOverlay:p,...m}),E=p.node.animate(S,{duration:n,easing:r,fill:"forwards"});return new Promise(R=>{E.onfinish=()=>{N==null||N(),R()}})}}let Um=0;function fb(t){return x.useMemo(()=>{if(t!=null)return Um++,Um},[t])}const pb=ct.memo(t=>{let{adjustScale:n=!1,children:r,dropAnimation:o,style:a,transition:c,modifiers:d,wrapperElement:p="div",className:g,zIndex:m=999}=t;const{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggableNodes:C,droppableContainers:b,dragOverlay:N,over:E,measuringConfiguration:R,scrollableAncestors:z,scrollableAncestorRects:I,windowRect:L}=uy(),q=x.useContext(nc),K=fb(k==null?void 0:k.id),$=ly(d,{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggingNodeRect:N.rect,over:E,overlayNodeRect:N.rect,scrollableAncestors:z,scrollableAncestorRects:I,transform:q,windowRect:L}),Z=rf(y),he=ub({config:o,draggableNodes:C,droppableContainers:b,measuringConfiguration:R}),ce=Z?N.setRef:void 0;return ct.createElement(sb,null,ct.createElement(tb,{animation:he},k&&K?ct.createElement(ib,{key:K,id:k.id,ref:ce,as:p,activatorEvent:v,adjustScale:n,className:g,transition:c,rect:Z,style:{zIndex:m,...a},transform:$},r):null))});function fy(t,n,r){const o=t.slice();return o.splice(r<0?o.length+r:r,0,o.splice(n,1)[0]),o}function hb(t,n){return t.reduce((r,o,a)=>{const c=n.get(o);return c&&(r[a]=c),r},Array(t.length))}function tl(t){return t!==null&&t>=0}function mb(t,n){if(t===n)return!0;if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}function gb(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const nl={scaleX:1,scaleY:1},vb=t=>{var n;let{rects:r,activeNodeRect:o,activeIndex:a,overIndex:c,index:d}=t;const p=(n=r[a])!=null?n:o;if(!p)return null;const g=yb(r,d,a);if(d===a){const m=r[c];return m?{x:a<c?m.left+m.width-(p.left+p.width):m.left-p.left,y:0,...nl}:null}return d>a&&d<=c?{x:-p.width-g,y:0,...nl}:d<a&&d>=c?{x:p.width+g,y:0,...nl}:{x:0,y:0,...nl}};function yb(t,n,r){const o=t[n],a=t[n-1],c=t[n+1];return!o||!a&&!c?0:r<n?a?o.left-(a.left+a.width):c.left-(o.left+o.width):c?c.left-(o.left+o.width):o.left-(a.left+a.width)}const py=t=>{let{rects:n,activeIndex:r,overIndex:o,index:a}=t;const c=fy(n,o,r),d=n[a],p=c[a];return!p||!d?null:{x:p.left-d.left,y:p.top-d.top,scaleX:p.width/d.width,scaleY:p.height/d.height}},sl={scaleX:1,scaleY:1},Bm=t=>{var n;let{activeIndex:r,activeNodeRect:o,index:a,rects:c,overIndex:d}=t;const p=(n=c[r])!=null?n:o;if(!p)return null;if(a===r){const m=c[d];return m?{x:0,y:r<d?m.top+m.height-(p.top+p.height):m.top-p.top,...sl}:null}const g=xb(c,a,r);return a>r&&a<=d?{x:0,y:-p.height-g,...sl}:a<r&&a>=d?{x:0,y:p.height+g,...sl}:{x:0,y:0,...sl}};function xb(t,n,r){const o=t[n],a=t[n-1],c=t[n+1];return o?r<n?a?o.top-(a.top+a.height):c?c.top-(o.top+o.height):0:c?c.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const hy="Sortable",my=ct.createContext({activeIndex:-1,containerId:hy,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:py,disabled:{draggable:!1,droppable:!1}});function wd(t){let{children:n,id:r,items:o,strategy:a=py,disabled:c=!1}=t;const{active:d,dragOverlay:p,droppableRects:g,over:m,measureDroppableContainers:v}=uy(),k=Gi(hy,r),y=p.rect!==null,S=x.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),C=d!=null,b=d?S.indexOf(d.id):-1,N=m?S.indexOf(m.id):-1,E=x.useRef(S),R=!mb(S,E.current),z=N!==-1&&b===-1||R,I=gb(c);fs(()=>{R&&C&&v(S)},[R,S,C,v]),x.useEffect(()=>{E.current=S},[S]);const L=x.useMemo(()=>({activeIndex:b,containerId:k,disabled:I,disableTransforms:z,items:S,overIndex:N,useDragOverlay:y,sortedRects:hb(S,g),strategy:a}),[b,k,I.draggable,I.droppable,z,S,N,g,y,a]);return ct.createElement(my.Provider,{value:L},n)}const wb=t=>{let{id:n,items:r,activeIndex:o,overIndex:a}=t;return fy(r,o,a).indexOf(n)},kb=t=>{let{containerId:n,isSorting:r,wasDragging:o,index:a,items:c,newIndex:d,previousItems:p,previousContainerId:g,transition:m}=t;return!m||!o||p!==c&&a===d?!1:r?!0:d!==a&&n===g},Sb={duration:200,easing:"ease"},gy="transform",bb=Es.Transition.toString({property:gy,duration:0,easing:"linear"}),Nb={roleDescription:"sortable"};function Tb(t){let{disabled:n,index:r,node:o,rect:a}=t;const[c,d]=x.useState(null),p=x.useRef(r);return fs(()=>{if(!n&&r!==p.current&&o.current){const g=a.current;if(g){const m=Oo(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&d(v)}}r!==p.current&&(p.current=r)},[n,r,o,a]),x.useEffect(()=>{c&&d(null)},[c]),c}function of(t){let{animateLayoutChanges:n=kb,attributes:r,disabled:o,data:a,getNewIndex:c=wb,id:d,strategy:p,resizeObserverConfig:g,transition:m=Sb}=t;const{items:v,containerId:k,activeIndex:y,disabled:S,disableTransforms:C,sortedRects:b,overIndex:N,useDragOverlay:E,strategy:R}=x.useContext(my),z=Cb(o,S),I=v.indexOf(d),L=x.useMemo(()=>({sortable:{containerId:k,index:I,items:v},...a}),[k,a,I,v]),q=x.useMemo(()=>v.slice(v.indexOf(d)),[v,d]),{rect:K,node:$,isOver:Z,setNodeRef:he}=dy({id:d,data:L,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...g}}),{active:ce,activatorEvent:ye,activeNodeRect:Se,attributes:Oe,setNodeRef:J,listeners:re,isDragging:oe,over:F,setActivatorNodeRef:Q,transform:G}=ZS({id:d,data:L,attributes:{...Nb,...r},disabled:z.draggable}),D=$1(he,J),P=!!ce,le=P&&!C&&tl(y)&&tl(N),W=!E&&oe,X=W&&le?G:null,be=le?X??(p??R)({rects:b,activeNodeRect:Se,activeIndex:y,overIndex:N,index:I}):null,_e=tl(y)&&tl(N)?c({id:d,items:v,activeIndex:y,overIndex:N}):I,Ae=ce==null?void 0:ce.id,je=x.useRef({activeId:Ae,items:v,newIndex:_e,containerId:k}),me=v!==je.current.items,pe=n({active:ce,containerId:k,isDragging:oe,isSorting:P,id:d,index:I,items:v,newIndex:je.current.newIndex,previousItems:je.current.items,previousContainerId:je.current.containerId,transition:m,wasDragging:je.current.activeId!=null}),Ve=Tb({disabled:!pe,index:I,node:$,rect:K});return x.useEffect(()=>{P&&je.current.newIndex!==_e&&(je.current.newIndex=_e),k!==je.current.containerId&&(je.current.containerId=k),v!==je.current.items&&(je.current.items=v)},[P,_e,k,v]),x.useEffect(()=>{if(Ae===je.current.activeId)return;if(Ae!=null&&je.current.activeId==null){je.current.activeId=Ae;return}const mt=setTimeout(()=>{je.current.activeId=Ae},50);return()=>clearTimeout(mt)},[Ae]),{active:ce,activeIndex:y,attributes:Oe,data:L,rect:K,index:I,newIndex:_e,items:v,isOver:Z,isSorting:P,isDragging:oe,listeners:re,node:$,overIndex:N,over:F,setNodeRef:D,setActivatorNodeRef:Q,setDroppableNodeRef:he,setDraggableNodeRef:J,transform:Ve??be,transition:Ie()};function Ie(){if(Ve||me&&je.current.newIndex===I)return bb;if(!(W&&!Jl(ye)||!m)&&(P||pe))return Es.Transition.toString({...m,property:gy})}}function Cb(t,n){var r,o;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:n.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:n.droppable}}nt.Down,nt.Right,nt.Up,nt.Left;function rl(t){const[n,r]=x.useState(()=>{try{const a=localStorage.getItem(t);if(a==null)return new Set;const c=JSON.parse(a);return Array.isArray(c)?new Set(c.filter(d=>typeof d=="string")):new Set}catch{return new Set}}),o=x.useCallback(a=>{r(c=>{const d=a(new Set(c));try{localStorage.setItem(t,JSON.stringify([...d]))}catch{}return d})},[t]);return[n,o]}function Eb(t,n=!1){const[r,o]=x.useState(()=>{try{const c=localStorage.getItem(t);return c==="1"?!0:c==="0"?!1:n}catch{return n}}),a=x.useCallback(c=>{o(c);try{localStorage.setItem(t,c?"1":"0")}catch{}},[t]);return[r,a]}async function Fi(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select();const r=document.execCommand("copy");return document.body.removeChild(n),r}catch{return!1}}}function jb(t){return t.origin_app_id!=null&&!t.user_touched&&!t.starred}const kd="(no directory)";function mr(t){return t.replaceAll("\\","/").replace(/\/+$/,"")}function Sd(t,n){if(!n||!t.cwd)return!1;const r=mr(t.cwd),o=mr(n);return r.startsWith(`${o}/`)}function _b(t,n){const r=new Map;for(const d of n){const p=d.cwd||kd,g=r.get(p)??[];g.push(d),r.set(p,g)}const o=new Set,a=new Set(t.filter(d=>d.deleted===1).map(d=>d.path)),c=[];for(const d of t){if(d.deleted===1){o.add(d.path);continue}o.add(d.path),c.push({path:d.path,label:d.label||d.path.split("/").pop()||d.path,sessions:r.get(d.path)??[],workspace:d})}for(const[d,p]of r)o.has(d)||a.has(d)||c.push({path:d,label:d===kd?"Other":d.split("/").pop()||d,sessions:p,workspace:null});return c}function Rb(t,n,r){if(n.length===0)return!1;const o=new Set(t.filter(a=>a.deleted===1).map(a=>a.path));return n.some(a=>!Sd(a,r)&&!o.has(a.cwd||kd))}function Pl(t){return[...t].sort((n,r)=>r.sort_order-n.sort_order||(n.created_at<r.created_at?1:-1))}function Wm(t,n,r,o){const a=n.map(c=>({folder:c,sessions:t.sessions.filter(d=>d.folder_id===c.id),finishedKey:`folder:${c.id}:finished`,hidden:o.has(c.id)}));return a.push({folder:null,sessions:t.sessions.filter(c=>!(c.folder_id&&r.has(c.folder_id))),finishedKey:`${t.path}:finished`,hidden:!1}),a}function Hm(t,n){return{working:Pl(t.sessions.filter(r=>r.lifecycle!=="finished")),finished:Pl(t.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:n.has(t.finishedKey)}}function ol(t,n){return t.folder_id&&n.has(t.folder_id)?t.folder_id:null}function Ab(t){const n=new Set(t.map(o=>o.name));if(!n.has("New Folder"))return"New Folder";let r=2;for(;n.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function Vm({id:t,children:n,className:r}){const{setNodeRef:o,isOver:a}=dy({id:t});return l.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:n})}function af({inputRef:t,value:n,onChange:r,onConfirm:o,onCancel:a}){return l.jsx("input",{ref:t,className:"tree-rename-input",value:n,onChange:c=>r(c.target.value),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation(),onKeyDown:c=>{c.key==="Enter"&&o(),c.key==="Escape"&&a()},onBlur:o})}function Ib({s:t,backgroundTaskCount:n,isActive:r,isSelected:o,originApp:a,renaming:c,renameValue:d,renameRef:p,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:y,onToggleStar:S}){const{attributes:C,listeners:b,setNodeRef:N,transform:E,transition:R,isDragging:z}=of({id:`s:${t.id}`}),I=ql(t,n);return l.jsxs("div",{ref:N,style:{transform:Es.Transform.toString(E),transition:R},className:`tree-item ${r?"active":""}${o?" selected":""} ${I.isFinished?"tree-item-finished":""}${z?" dragging":""}${t.starred?" tree-item-starred":""}`,...C,...b,onClick:k,onContextMenu:y,children:[l.jsx(Zd,{iconClass:I.iconClass,iconText:I.iconText,size:16}),a&&l.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:l.jsx(Do,{iconNode:a.iconNode,size:10})}),c?l.jsx(af,{inputRef:p,value:d,onChange:g,onConfirm:m,onCancel:v}):l.jsx("span",{className:"tree-label",children:t.title||t.id.slice(0,8)}),!c&&l.jsx("button",{className:`star-btn${t.starred?" starred":""}`,title:t.starred?"Unstar session":"Star session",onClick:L=>{L.stopPropagation(),S()},onPointerDown:L=>L.stopPropagation(),children:l.jsx(Rl,{size:10,fill:t.starred?"currentColor":"none"})}),I.dot&&l.jsx(Qd,{status:I.dot,title:I.dotTitle})]})}function Db({folder:t,count:n,collapsed:r,renaming:o,renameValue:a,renameRef:c,onRenameValue:d,onRenameConfirm:p,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:y,listeners:S,setNodeRef:C,transform:b,transition:N,isDragging:E,over:R}=of({id:`f:${t.id}`}),z=R!=null&&String(R.id).startsWith("s:");return l.jsxs("div",{ref:C,style:{transform:Es.Transform.toString(b),transition:N},className:`tree-folder ${r?"collapsed":""}${E?" dragging":""}`,children:[l.jsx("div",{className:`tree-folder-header${z?" drop-over":""}`,...y,...S,onClick:()=>{o||m()},onContextMenu:v,children:o?l.jsx(af,{inputRef:c,value:a,onChange:d,onConfirm:p,onCancel:g}):l.jsxs(l.Fragment,{children:[l.jsx(_o,{size:8,className:"tree-chevron"}),l.jsx(_l,{size:12}),l.jsx("span",{className:"tree-folder-label",children:t.name}),l.jsx("span",{className:"tree-count",children:n})]})}),!r&&l.jsx("div",{className:"tree-folder-children",children:k})]})}function Mb(){const t=A(_=>_.sessions),n=A(_=>_.backgroundTasks),r=A(_=>_.workspaces),o=A(_=>_.folders),a=A(_=>_.activeSessionId),c=A(_=>_.selectSession),d=A(_=>_.deleteSession),p=A(_=>_.removeWorkspace),g=A(_=>_.createSessionInWorkspace),m=A(_=>_.pickAndAddWorkspace),v=A(_=>_.setImportSessionsWorkspace),k=A(_=>_.renameSession),y=A(_=>_.markFinished),S=A(_=>_.markFinishedMany),C=A(_=>_.toggleStar),b=A(_=>_.reopenSession),N=A(_=>_.reopenSessionMany),E=A(_=>_.deleteSessionMany),R=A(_=>_.createSidebarFolder),z=A(_=>_.renameFolder),I=A(_=>_.deleteFolder),L=A(_=>_.applyMoves),q=A(_=>_.reorderFolders),K=A(_=>_.apps),$=A(_=>_.appsRootPath),Z=A(_=>_.activeAppTabId),he=A(_=>_.openAppTab),ce=A(_=>_.startAppEdit),ye=A(_=>_.toggleAppPin),Se=A(_=>_.deleteApp),Oe=A(_=>_.openAppCatalog),[J,re]=rl("agentpane:sidebar-ws-collapsed"),[oe,F]=rl("agentpane:sidebar-sub-collapsed"),[Q,G]=rl("agentpane:sidebar-folders-collapsed"),[D,P]=rl("agentpane:sidebar-app-edits-collapsed"),[le,W]=Eb("agentpane:sidebar-hide-auto-sessions"),[X,ae]=x.useState(null),[be,_e]=x.useState(null),[Ae,je]=x.useState(""),[me,pe]=x.useState(null),[Ve,Ie]=x.useState(new Set),[mt,Ue]=x.useState(null),Vt=x.useRef(null),tn=x.useRef(null),kt=x.useRef(null),jt=x.useRef(!1),Ft=Vv(Hv(ec,{activationConstraint:{distance:5}}));function Ot(){Ie(new Set),Ue(null)}Wi(Vt,()=>ae(null),!!X),Io(()=>{ae(null),Ot()},!!X||Ve.size>0),x.useLayoutEffect(()=>{const _=Vt.current;if(!X||!_)return;const fe=8,{offsetWidth:ie,offsetHeight:we}=_,Pe=X.x+ie>window.innerWidth-fe?Math.max(fe,X.x-ie):X.x,qe=X.y+we>window.innerHeight-fe?Math.max(fe,X.y-we):X.y;_.style.left=`${Pe}px`,_.style.top=`${qe}px`},[X]);const Y=x.useMemo(()=>new Map(t.map(_=>[_.id,_])),[t]),ge=x.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),Be=x.useMemo(()=>{const _=new Map;for(const fe of[...o].sort((ie,we)=>ie.sort_order-we.sort_order)){const ie=_.get(fe.workspace_path)??[];ie.push(fe),_.set(fe.workspace_path,ie)}return _},[o]);function st(_){re(fe=>{const ie=new Set(fe);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function gt(_){F(fe=>{const ie=new Set(fe);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function vt(_){G(fe=>{const ie=new Set(fe);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function _t(){W(!le),Ot()}function an(_){P(fe=>{const ie=new Set(fe);return ie.has(_)?ie.delete(_):ie.add(_),ie})}x.useEffect(()=>{be&&tn.current&&(tn.current.focus(),tn.current.select())},[be]),x.useEffect(()=>{var _,fe,ie;jt.current||!a||(jt.current=!0,(ie=(fe=(_=kt.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:fe.scrollIntoView)==null||ie.call(fe,{block:"nearest"}))},[a]);function dt(_,fe,ie,we=""){_e({kind:_,id:fe}),je(ie||we)}function Mn(){if(be){const _=Ae.trim();_&&(be.kind==="session"?k(be.id,_):z(be.id,_))}_e(null)}function Ln(){_e(null),je("")}async function hs(_){const fe=Ab(Be.get(_)??[]),ie=await R(_,fe);ie&&dt("folder",ie.id,ie.name)}function ms(_){const fe=String(_.active.id);if(fe.startsWith("s:")){const ie=Y.get(fe.slice(2));ie&&pe({kind:"session",label:ie.title||ie.id.slice(0,8)})}else if(fe.startsWith("f:")){const ie=ge.get(fe.slice(2));ie&&pe({kind:"folder",label:ie.name})}}function ns(_){pe(null);const{active:fe,over:ie}=_;if(!ie)return;const we=String(fe.id),Pe=String(ie.id);if(we.startsWith("s:")){const qe=Y.get(we.slice(2));if(!qe)return;const $e=qe.cwd||"(no directory)",Ut=ol(qe,ge);let Pn,We;if(Pe.startsWith("f:")){const Je=ge.get(Pe.slice(2));if(!Je)return;Pn=Je.workspace_path,We=Je.id}else if(Pe.startsWith("s:")){const Je=Y.get(Pe.slice(2));if(!Je)return;Pn=Je.cwd||"(no directory)",We=ol(Je,ge)}else if(Pe.startsWith("c:")){const Je=Pe.slice(2),At=Je.lastIndexOf("|");Pn=Je.slice(0,At);const vs=Je.slice(At+1);We=vs==="root"?null:vs}else return;if(Pn!==$e)return;const yn=Pl(t.filter(Je=>(Je.cwd||"(no directory)")===Pn&&ol(Je,ge)===We)),js=yn.filter(Je=>Je.id!==qe.id);let Bs=js.length;if(Pe.startsWith("s:")){const Je=js.findIndex(At=>At.id===Pe.slice(2));Je>=0&&(Bs=Je)}const $n=[...js.slice(0,Bs),qe,...js.slice(Bs)],gs=[];if(We===Ut){if($n.length===yn.length&&$n.every((Je,At)=>Je.id===yn[At].id))return;$n.forEach((Je,At)=>gs.push({id:Je.id,folder_id:We,sort_order:$n.length-1-At}))}else{const Je=Pl(t.filter(At=>(At.cwd||"(no directory)")===$e&&ol(At,ge)===Ut)).filter(At=>At.id!==qe.id);Je.forEach((At,vs)=>gs.push({id:At.id,folder_id:Ut,sort_order:Je.length-1-vs})),$n.forEach((At,vs)=>gs.push({id:At.id,folder_id:We,sort_order:$n.length-1-vs}))}L(gs);return}if(we.startsWith("f:")){if(!Pe.startsWith("f:"))return;const qe=ge.get(we.slice(2)),$e=ge.get(Pe.slice(2));if(!qe||!$e||qe.id===$e.id||qe.workspace_path!==$e.workspace_path)return;const Ut=(Be.get(qe.workspace_path)??[]).map(yn=>yn.id),Pn=Ut.indexOf(qe.id),We=Ut.indexOf($e.id);Ut.splice(We,0,...Ut.splice(Pn,1)),q(Ut)}}const On=$?t.filter(_=>!Sd(_,$)):t,gn=new Set(le?On.filter(_=>jb(_)&&_.id!==a).map(_=>_.id):[]),ln=_b(r,gn.size>0?On.filter(_=>!gn.has(_.id)):On),Kt=x.useMemo(()=>{const _=new Map;if(!$)return _;const fe=mr($);for(const ie of t){if(!Sd(ie,$))continue;const we=mr(ie.cwd).slice(fe.length+1).split("/")[0],Pe=_.get(we)??[];Pe.push(ie),_.set(we,Pe)}return _},[t,$]);function vn(_){return{folder:null,sessions:Kt.get(_)??[],finishedKey:`app:${_}:finished`,hidden:D.has(_)}}const Ze=[],Rt=_=>{if(_.hidden)return;const{working:fe,finished:ie,finishedCollapsed:we}=Hm(_,oe);Ze.push(...fe.map(Pe=>Pe.id)),we||Ze.push(...ie.map(Pe=>Pe.id))};for(const _ of ln){if(J.has(_.path))continue;const fe=Be.get(_.path)??[],ie=new Set(fe.map(we=>we.id));Wm(_,fe,ie,Q).forEach(Rt)}K.forEach(_=>Rt(vn(_.id)));const ft=t.filter(_=>Ve.has(_.id)),Gt=ft.filter(_=>_.lifecycle!=="finished").map(_=>_.id),yt=ft.filter(_=>_.lifecycle==="finished").map(_=>_.id);function xt(_,fe){if(fe.metaKey||fe.ctrlKey){fe.preventDefault(),Ue(_.id),Ie(ie=>{const we=new Set(ie);return we.has(_.id)?we.delete(_.id):we.add(_.id),we});return}if(fe.shiftKey){fe.preventDefault();const ie=mt??_.id;Ue(ie);const we=Ze.indexOf(ie),Pe=Ze.indexOf(_.id);if(we>=0&&Pe>=0){const[qe,$e]=we<Pe?[we,Pe]:[Pe,we];Ie(new Set(Ze.slice(qe,$e+1)))}return}Ot(),Ue(_.id),c(_.id)}function lt(_,fe){fe.preventDefault();const ie=Ve.has(_.id)&&Ve.size>1;Ve.has(_.id)||(Ie(new Set),Ue(_.id)),ae({x:fe.clientX,y:fe.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:ie})}function qt(_){var ie;const fe=_.origin_app_id?K.find(we=>we.id===_.origin_app_id):null;return l.jsx(Ib,{s:_,backgroundTaskCount:((ie=n[_.id])==null?void 0:ie.length)??0,isActive:a===_.id,isSelected:Ve.has(_.id),originApp:fe??null,renaming:(be==null?void 0:be.kind)==="session"&&be.id===_.id,renameValue:Ae,renameRef:tn,onRenameValue:je,onRenameConfirm:Mn,onRenameCancel:Ln,onSelect:we=>xt(_,we),onToggleStar:()=>C(_.id),onCtxMenu:we=>lt(_,we)},_.id)}function ot(_){var ie;const fe=ql(_,((ie=n[_.id])==null?void 0:ie.length)??0);return l.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ve.has(_.id)?" selected":""}${fe.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:we=>xt(_,we),onContextMenu:we=>lt(_,we),children:[l.jsx(Zd,{iconClass:fe.iconClass,iconText:fe.iconText,size:14}),(be==null?void 0:be.kind)==="session"&&be.id===_.id?l.jsx(af,{inputRef:tn,value:Ae,onChange:je,onConfirm:Mn,onCancel:Ln}):l.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),fe.dot&&l.jsx(Qd,{status:fe.dot,title:fe.dotTitle})]},_.id)}function Pt(_,fe="workspace"){const{working:ie,finished:we,finishedCollapsed:Pe}=Hm(_,oe),qe=fe==="workspace"?qt:ot,$e=l.jsxs(l.Fragment,{children:[ie.length===0&&we.length===0?l.jsx("div",{className:"tree-empty",children:"No sessions"}):ie.map(qe),we.length>0&&l.jsxs("div",{className:`tree-subgroup ${Pe?"collapsed":""}`,children:[l.jsxs("div",{className:"tree-subgroup-header",onClick:()=>gt(_.finishedKey),children:[l.jsx(_o,{size:8,className:"tree-chevron"}),l.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),l.jsx("span",{className:"tree-subgroup-count",children:we.length})]}),!Pe&&l.jsx("div",{className:"tree-subgroup-items",children:we.map(qe)})]})]});if(fe==="app")return $e;const Ut=[...ie,...we].map(Pn=>`s:${Pn.id}`);return l.jsx(wd,{items:Ut,strategy:Bm,children:$e})}return l.jsxs("div",{className:"ide-sidebar",ref:kt,children:[l.jsxs("div",{className:"sidebar-header",children:[l.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),l.jsxs("div",{className:"sidebar-header-actions",children:[l.jsx("button",{className:`sidebar-add sidebar-filter${le?" active":""}`,title:le?`Show automatic sessions (${gn.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":le?"Show automatic sessions":"Hide automatic sessions","aria-pressed":le,onClick:_t,children:le?l.jsx(Jk,{size:14}):l.jsx(gr,{size:14})}),l.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:l.jsx(pr,{size:14})})]})]}),l.jsxs(cy,{sensors:Ft,collisionDetection:Kv,onDragStart:ms,onDragEnd:ns,children:[ln.length===0?l.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):ln.map(_=>{const fe=J.has(_.path),ie=Be.get(_.path)??[],we=new Set(ie.map($e=>$e.id)),Pe=Wm(_,ie,we,Q),qe=Pe[Pe.length-1];return l.jsxs("div",{className:`tree-section ${fe?"collapsed":""}`,children:[l.jsxs("div",{className:"tree-section-header",onClick:()=>st(_.path),onContextMenu:$e=>{$e.preventDefault(),ae({x:$e.clientX,y:$e.clientY,type:"workspace",path:_.path})},children:[l.jsx(_o,{size:9,className:"tree-chevron"}),l.jsx(_l,{size:14}),l.jsx("span",{className:"tree-section-label",children:_.label}),l.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:$e=>{$e.stopPropagation(),g(_.path)},children:l.jsx(pr,{size:11})}),l.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:$e=>{$e.stopPropagation(),hs(_.path)},children:l.jsx(Qu,{size:11})}),l.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!fe&&l.jsxs("div",{className:"tree-children",children:[l.jsx(wd,{items:ie.map($e=>`f:${$e.id}`),strategy:Bm,children:Pe.filter($e=>$e.folder).map($e=>l.jsx(Db,{folder:$e.folder,count:$e.sessions.length,collapsed:$e.hidden,renaming:(be==null?void 0:be.kind)==="folder"&&be.id===$e.folder.id,renameValue:Ae,renameRef:tn,onRenameValue:je,onRenameConfirm:Mn,onRenameCancel:Ln,onToggle:()=>vt($e.folder.id),onCtxMenu:Ut=>{Ut.preventDefault(),ae({x:Ut.clientX,y:Ut.clientY,type:"folder",folderId:$e.folder.id,folderName:$e.folder.name})},children:l.jsx(Vm,{id:`c:${_.path}|${$e.folder.id}`,children:Pt($e)})},$e.folder.id))}),l.jsx(Vm,{id:`c:${_.path}|root`,children:Pt(qe)})]})]},_.path)}),l.jsx(pb,{children:me&&l.jsxs("div",{className:"drag-overlay",children:[me.kind==="folder"&&l.jsx(_l,{size:12}),l.jsx("span",{children:me.label})]})})]}),l.jsxs("div",{className:"sidebar-apps",children:[l.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[l.jsx("span",{className:"sidebar-header-title",children:"Apps"}),l.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>Oe(),children:l.jsx(pr,{size:14})})]}),K.length===0&&l.jsx("div",{className:"tree-empty",children:"No apps yet"}),K.map(_=>{const fe=vn(_.id),ie=fe.sessions.length>0&&!fe.hidden;return l.jsxs("div",{className:"sidebar-app-block",children:[l.jsxs("div",{className:`sidebar-app-row${Z===_.id?" active":""}`,title:_.description??void 0,onClick:()=>he(_.id),onContextMenu:we=>{we.preventDefault(),ae({x:we.clientX,y:we.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[fe.sessions.length>0&&l.jsx("button",{className:`sidebar-app-chevron${ie?"":" closed"}`,title:"Edit sessions of this app",onClick:we=>{we.stopPropagation(),an(_.id)},children:l.jsx(_o,{size:10,className:"tree-chevron"})}),l.jsx(Do,{iconNode:_.iconNode,size:14,className:"sidebar-app-icon"}),l.jsx("span",{className:"tree-label",children:_.title}),fe.sessions.length>0&&l.jsx("span",{className:"sidebar-app-count",children:fe.sessions.length}),_.pinned&&l.jsx(Rl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ie&&l.jsx("div",{className:"sidebar-app-edits",children:Pt(fe,"app")})]},_.id)})]}),l.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[l.jsx(Qu,{size:14}),l.jsx("span",{children:"Add workspace"})]}),X&&l.jsxs("div",{ref:Vt,className:"ctx-menu",style:{position:"fixed",left:X.x,top:X.y,zIndex:500},children:[X.type==="workspace"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(X.path),ae(null)},children:[l.jsx(pr,{size:12})," New Session"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{hs(X.path),ae(null)},children:[l.jsx(Qu,{size:12})," New Folder"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{v(X.path),ae(null)},children:[l.jsx(Iv,{size:12})," Import Claude Code Sessions…"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{p(X.path),ae(null)},children:[l.jsx(us,{size:12})," Hide Workspace"]})]}),X.type==="folder"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("folder",X.folderId,X.folderName??""),ae(null)},children:[l.jsx(hl,{size:12})," Rename Folder"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{I(X.folderId),ae(null)},children:[l.jsx(us,{size:12})," Delete Folder"]})]}),X.type==="session"&&!X.multi&&l.jsx(l.Fragment,{children:X.sessionLifecycle!=="finished"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("session",X.sessionId,X.sessionTitle??""),ae(null)},children:[l.jsx(hl,{size:12})," Rename"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(X.sessionId),ae(null)},children:[l.jsx(jl,{size:12})," Mark as Finished"]}),l.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Fi(X.sessionExternalId),ae(null))},children:[l.jsx(Oi,{size:12})," Copy Session ID"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),ae(null)},children:[l.jsx(us,{size:12})," Delete Session"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{b(X.sessionId),ae(null)},children:[l.jsx(Pi,{size:12})," Reopen"]}),l.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(Fi(X.sessionExternalId),ae(null))},children:[l.jsx(Oi,{size:12})," Copy Session ID"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),ae(null)},children:[l.jsx(us,{size:12})," Delete Session"]})]})}),X.type==="session"&&X.multi&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-header",children:[ft.length," sessions selected"]}),Gt.length>0&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{S(Gt),ae(null),Ot()},children:[l.jsx(jl,{size:12})," Mark ",Gt.length," as Finished"]}),yt.length>0&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(yt),ae(null),Ot()},children:[l.jsx(Pi,{size:12})," Reopen ",yt.length]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E([...Ve]),ae(null),Ot()},children:[l.jsx(us,{size:12})," Delete ",ft.length," Sessions"]})]}),X.type==="app"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ce(X.appId),ae(null)},children:[l.jsx(hl,{size:12})," Edit App"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ye(X.appId),ae(null)},children:[l.jsx(Rl,{size:12})," ",X.appPinned?"Unpin":"Pin"]}),l.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{Se(X.appId),ae(null)},children:[l.jsx(us,{size:12})," Delete App"]})]})]})]})}const il=4,Lb=({transform:t})=>({...t,y:0});function Km({tabKey:t,title:n,active:r,icon:o,badge:a,onSelect:c,onClose:d,onMenu:p}){const{attributes:g,listeners:m,setNodeRef:v,transform:k,transition:y,isDragging:S}=of({id:t});return l.jsxs("div",{ref:v,style:{transform:Es.Translate.toString(k),transition:y},className:`ide-tab ${r?"active":""} ${S?"dragging":""}`,title:n,...g,...m,onClick:c,onMouseDown:C=>{C.button===1&&C.preventDefault()},onAuxClick:C=>{C.button===1&&d()},onContextMenu:C=>{C.preventDefault(),C.stopPropagation(),p(C.clientX,C.clientY)},children:[o,n,a,l.jsx("span",{className:"ide-tab-close",onClick:C=>{C.stopPropagation(),d()},children:l.jsx(Tn,{size:12})})]})}function Ob({menu:t,tabs:n,onDone:r}){const o=A(k=>k.closeTabs),a=A(k=>k.reopenClosedTab),c=A(k=>k.closedTabs.some(y=>uv(k,y.key))),d=x.useRef(null),[p,g]=x.useState({left:t.x,top:t.y});Wi(d,r,!0),Io(r,!0),x.useLayoutEffect(()=>{if(!d.current)return;const{width:k,height:y}=d.current.getBoundingClientRect();g({left:Math.max(il,Math.min(t.x,window.innerWidth-k-il)),top:Math.max(il,Math.min(t.y,window.innerHeight-y-il))})},[t.x,t.y]);const m=t.key!==null&&n.includes(t.key)?t.key:null,v=(k,y,S=!1)=>l.jsx("div",{role:"menuitem","aria-disabled":S,className:`ctx-menu-item ${S?"ctx-disabled":""}`,onClick:()=>{S||(y(),r())},children:k});return l.jsxs("div",{ref:d,role:"menu",className:"ctx-menu",style:{position:"fixed",...p,zIndex:500},children:[m!==null&&l.jsxs(l.Fragment,{children:[v("Close",()=>o([m])),v("Close Others",()=>o(n.filter(k=>k!==m)),n.length<2),v("Close to the Right",()=>o(n.slice(n.indexOf(m)+1)),n.at(-1)===m),v("Close All",()=>o(n))]}),v("Reopen Closed Tab",a,!c)]})}function Pb(){const t=A(L=>L.tabOrder),n=A(L=>L.activeSessionId),r=A(L=>L.sessions),o=A(L=>L.backgroundTasks),a=A(L=>L.selectSession),c=A(L=>L.closeTab),d=A(L=>L.setShowNewSessionDialog),p=A(L=>L.apps),g=A(L=>L.activeAppTabId),m=A(L=>L.openAppTab),v=A(L=>L.closeAppTab),k=A(L=>L.moveTab),[y,S]=x.useState(null),C=x.useRef(null),b=Vv(Hv(ec,{activationConstraint:{distance:5}})),N=Bd({activeSessionId:n,activeAppTabId:g});x.useEffect(()=>{var L,q,K;(K=(q=(L=C.current)==null?void 0:L.querySelector(".ide-tab.active"))==null?void 0:q.scrollIntoView)==null||K.call(q,{block:"nearest",inline:"nearest"})},[N]);const E=t.filter(L=>{const{kind:q,id:K}=hr(L);return q==="app"||r.some($=>$.id===K)}),R=({active:L,over:q})=>{q&&k(String(L.id),String(q.id))},z=L=>{L.preventDefault(),S({x:L.clientX,y:L.clientY,key:null})},I=L=>{var ce;const{kind:q,id:K}=hr(L),$=(ye,Se)=>S({x:ye,y:Se,key:L});if(q==="app"){const ye=p.find(Se=>Se.id===K);return l.jsx(Km,{tabKey:L,title:(ye==null?void 0:ye.title)??K,active:g===K,icon:l.jsx(Do,{iconNode:ye==null?void 0:ye.iconNode,size:12,className:"miniapp-tab-icon"}),onSelect:()=>m(K),onClose:()=>v(K),onMenu:$},L)}const Z=r.find(ye=>ye.id===K);if(!Z)return null;const he=ql(Z,((ce=o[K])==null?void 0:ce.length)??0);return l.jsx(Km,{tabKey:L,title:Z.title||K.slice(0,8),active:n===K&&g==null,icon:l.jsx(Zd,{iconClass:he.iconClass,iconText:he.iconText,size:14}),badge:he.dot&&l.jsx(Qd,{status:he.dot,title:he.dotTitle}),onSelect:()=>void a(K),onClose:()=>c(K),onMenu:$},L)};return l.jsxs(cy,{sensors:b,collisionDetection:Kv,modifiers:[Lb],onDragEnd:R,children:[l.jsx(wd,{items:E,strategy:vb,children:l.jsxs("div",{ref:C,className:"ide-tabs",onContextMenu:z,onWheel:L=>{L.deltaX===0&&(L.currentTarget.scrollLeft+=L.deltaY)},children:[E.map(I),l.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>d(!0),children:l.jsx(pr,{size:14})})]})}),y&&l.jsx(Ob,{menu:y,tabs:E,onDone:()=>S(null)})]})}function lf(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Br=lf();function vy(t){Br=t}var Ri={exec:()=>null};function rt(t,n=""){let r=typeof t=="string"?t:t.source;const o={replace:(a,c)=>{let d=typeof c=="string"?c:c.source;return d=d.replace(Nn.caret,"$1"),r=r.replace(a,d),o},getRegex:()=>new RegExp(r,n)};return o}var Nn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},$b=/^(?:[ \t]*(?:\n|$))+/,zb=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fb=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Xi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ub=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cf=/(?:[*+-]|\d{1,9}[.)])/,yy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xy=rt(yy).replace(/bull/g,cf).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(),Bb=rt(yy).replace(/bull/g,cf).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(),uf=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wb=/^[^\n]+/,df=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Hb=rt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",df).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vb=rt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cf).getRegex(),sc="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",ff=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kb=rt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ff).replace("tag",sc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),wy=rt(uf).replace("hr",Xi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sc).getRegex(),Gb=rt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",wy).getRegex(),pf={blockquote:Gb,code:zb,def:Hb,fences:Fb,heading:Ub,hr:Xi,html:Kb,lheading:xy,list:Vb,newline:$b,paragraph:wy,table:Ri,text:Wb},Gm=rt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Xi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sc).getRegex(),qb={...pf,lheading:Bb,table:Gm,paragraph:rt(uf).replace("hr",Xi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gm).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",sc).getRegex()},Xb={...pf,html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ff).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ri,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:rt(uf).replace("hr",Xi).replace("heading",` *#{1,6} *[^
|
|
452
|
-
]`).replace("lheading",xy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Yb=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Qb=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ky=/^( {2,}|\\)\n(?!\s*$)/,Zb=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,rc=/[\p{P}\p{S}]/u,hf=/[\s\p{P}\p{S}]/u,Sy=/[^\s\p{P}\p{S}]/u,Jb=rt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,hf).getRegex(),by=/(?!~)[\p{P}\p{S}]/u,eN=/(?!~)[\s\p{P}\p{S}]/u,tN=/(?:[^\s\p{P}\p{S}]|~)/u,nN=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Ny=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sN=rt(Ny,"u").replace(/punct/g,rc).getRegex(),rN=rt(Ny,"u").replace(/punct/g,by).getRegex(),Ty="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",oN=rt(Ty,"gu").replace(/notPunctSpace/g,Sy).replace(/punctSpace/g,hf).replace(/punct/g,rc).getRegex(),iN=rt(Ty,"gu").replace(/notPunctSpace/g,tN).replace(/punctSpace/g,eN).replace(/punct/g,by).getRegex(),aN=rt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Sy).replace(/punctSpace/g,hf).replace(/punct/g,rc).getRegex(),lN=rt(/\\(punct)/,"gu").replace(/punct/g,rc).getRegex(),cN=rt(/^<(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(),uN=rt(ff).replace("(?:-->|$)","-->").getRegex(),dN=rt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",uN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),$l=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fN=rt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",$l).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Cy=rt(/^!?\[(label)\]\[(ref)\]/).replace("label",$l).replace("ref",df).getRegex(),Ey=rt(/^!?\[(ref)\](?:\[\])?/).replace("ref",df).getRegex(),pN=rt("reflink|nolink(?!\\()","g").replace("reflink",Cy).replace("nolink",Ey).getRegex(),mf={_backpedal:Ri,anyPunctuation:lN,autolink:cN,blockSkip:nN,br:ky,code:Qb,del:Ri,emStrongLDelim:sN,emStrongRDelimAst:oN,emStrongRDelimUnd:aN,escape:Yb,link:fN,nolink:Ey,punctuation:Jb,reflink:Cy,reflinkSearch:pN,tag:dN,text:Zb,url:Ri},hN={...mf,link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",$l).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$l).getRegex()},bd={...mf,emStrongRDelimAst:iN,emStrongLDelim:rN,url:rt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},mN={...bd,br:rt(ky).replace("{2,}","*").getRegex(),text:rt(bd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},al={normal:pf,gfm:qb,pedantic:Xb},yi={normal:mf,gfm:bd,breaks:mN,pedantic:hN},gN={"&":"&","<":"<",">":">",'"':""","'":"'"},qm=t=>gN[t];function Ns(t,n){if(n){if(Nn.escapeTest.test(t))return t.replace(Nn.escapeReplace,qm)}else if(Nn.escapeTestNoEncode.test(t))return t.replace(Nn.escapeReplaceNoEncode,qm);return t}function Xm(t){try{t=encodeURI(t).replace(Nn.percentDecode,"%")}catch{return null}return t}function Ym(t,n){var c;const r=t.replace(Nn.findPipe,(d,p,g)=>{let m=!1,v=p;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(Nn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((c=o.at(-1))!=null&&c.trim())&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(Nn.slashPipe,"|");return o}function xi(t,n,r){const o=t.length;if(o===0)return"";let a=0;for(;a<o&&t.charAt(o-a-1)===n;)a++;return t.slice(0,o-a)}function vN(t,n){if(t.indexOf(n[1])===-1)return-1;let r=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===n[0])r++;else if(t[o]===n[1]&&(r--,r<0))return o;return r>0?-2:-1}function Qm(t,n,r,o,a){const c=n.href,d=n.title||null,p=t[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:c,title:d,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,g}function yN(t,n,r){const o=t.match(r.other.indentCodeCompensation);if(o===null)return n;const a=o[1];return n.split(`
|
|
453
|
-
`).map(c=>{const d=c.match(r.other.beginningSpace);if(d===null)return c;const[p]=d;return p.length>=a.length?c.slice(a.length):c}).join(`
|
|
454
|
-
`)}var zl=class{constructor(t){it(this,"options");it(this,"rules");it(this,"lexer");this.options=t||Br}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:xi(r,`
|
|
455
|
-
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=yN(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){const o=xi(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:xi(n[0],`
|
|
456
|
-
`)}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=xi(n[0],`
|
|
457
|
-
`).split(`
|
|
458
|
-
`),o="",a="";const c=[];for(;r.length>0;){let d=!1;const p=[];let g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))p.push(r[g]),d=!0;else if(!d)p.push(r[g]);else break;r=r.slice(g);const m=p.join(`
|
|
459
|
-
`),v=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
460
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
461
|
-
${m}`:m,a=a?`${a}
|
|
462
|
-
${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,c,!0),this.lexer.state.top=k,r.length===0)break;const y=c.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const S=y,C=S.raw+`
|
|
463
|
-
`+r.join(`
|
|
464
|
-
`),b=this.blockquote(C);c[c.length-1]=b,o=o.substring(0,o.length-S.raw.length)+b.raw,a=a.substring(0,a.length-S.text.length)+b.text;break}else if((y==null?void 0:y.type)==="list"){const S=y,C=S.raw+`
|
|
465
|
-
`+r.join(`
|
|
466
|
-
`),b=this.list(C);c[c.length-1]=b,o=o.substring(0,o.length-y.raw.length)+b.raw,a=a.substring(0,a.length-S.raw.length)+b.raw,r=C.substring(c.at(-1).raw.length).split(`
|
|
467
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:c,text:a}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const c=this.rules.other.listItemRegex(r);let d=!1;for(;t;){let g=!1,m="",v="";if(!(n=c.exec(t))||this.rules.block.hr.test(t))break;m=n[0],t=t.substring(m.length);let k=n[2].split(`
|
|
468
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),y=t.split(`
|
|
469
|
-
`,1)[0],S=!k.trim(),C=0;if(this.options.pedantic?(C=2,v=k.trimStart()):S?C=n[1].length+1:(C=n[2].search(this.rules.other.nonSpaceChar),C=C>4?1:C,v=k.slice(C),C+=n[1].length),S&&this.rules.other.blankLine.test(y)&&(m+=y+`
|
|
470
|
-
`,t=t.substring(y.length+1),g=!0),!g){const E=this.rules.other.nextBulletRegex(C),R=this.rules.other.hrRegex(C),z=this.rules.other.fencesBeginRegex(C),I=this.rules.other.headingBeginRegex(C),L=this.rules.other.htmlBeginRegex(C);for(;t;){const q=t.split(`
|
|
471
|
-
`,1)[0];let K;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),z.test(y)||I.test(y)||L.test(y)||E.test(y)||R.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=C||!y.trim())v+=`
|
|
472
|
-
`+K.slice(C);else{if(S||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||z.test(k)||I.test(k)||R.test(k))break;v+=`
|
|
473
|
-
`+y}!S&&!y.trim()&&(S=!0),m+=q+`
|
|
474
|
-
`,t=t.substring(q.length+1),k=K.slice(C)}}a.loose||(d?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(d=!0));let b=null,N;this.options.gfm&&(b=this.rules.other.listIsTask.exec(v),b&&(N=b[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:m,task:!!b,checked:N,loose:!1,text:v,tokens:[]}),a.raw+=m}const p=a.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let g=0;g<a.items.length;g++)if(this.lexer.state.top=!1,a.items[g].tokens=this.lexer.blockTokens(a.items[g].text,[]),!a.loose){const m=a.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=v}if(a.loose)for(let g=0;g<a.items.length;g++)a.items[g].loose=!0;return a}}html(t){const n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){const n=this.rules.block.def.exec(t);if(n){const r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:a}}}table(t){var d;const n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;const r=Ym(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(d=n[3])!=null&&d.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
475
|
-
`):[],c={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const p of o)this.rules.other.tableAlignRight.test(p)?c.align.push("right"):this.rules.other.tableAlignCenter.test(p)?c.align.push("center"):this.rules.other.tableAlignLeft.test(p)?c.align.push("left"):c.align.push(null);for(let p=0;p<r.length;p++)c.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:c.align[p]});for(const p of a)c.rows.push(Ym(p,c.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:c.align[m]})));return c}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===`
|
|
476
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const c=xi(r.slice(0,-1),"\\");if((r.length-c.length)%2===0)return}else{const c=vN(n[2],"()");if(c===-2)return;if(c>-1){const p=(n[0].indexOf("!")===0?5:4)+n[1].length+c;n[2]=n[2].substring(0,c),n[0]=n[0].substring(0,p).trim(),n[3]=""}}let o=n[2],a="";if(this.options.pedantic){const c=this.rules.other.pedanticHrefTitle.exec(o);c&&(o=c[1],a=c[3])}else a=n[3]?n[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Qm(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=n[o.toLowerCase()];if(!a){const c=r[0].charAt(0);return{type:"text",raw:c,text:c}}return Qm(r,a,r[0],this.lexer,this.rules)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrongLDelim.exec(t);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const c=[...o[0]].length-1;let d,p,g=c,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,n=n.slice(-1*t.length+c);(o=v.exec(n))!=null;){if(d=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!d)continue;if(p=[...d].length,o[3]||o[4]){g+=p;continue}else if((o[5]||o[6])&&c%3&&!((c+p)%3)){m+=p;continue}if(g-=p,g>0)continue;p=Math.min(p,p+g+m);const k=[...o[0]][0].length,y=t.slice(0,c+o.index+k+p);if(Math.min(c,p)%2){const C=y.slice(1,-1);return{type:"em",raw:y,text:C,tokens:this.lexer.inlineTokens(C)}}const S=y.slice(2,-2);return{type:"strong",raw:y,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,o;return n[2]==="@"?(r=n[1],o="mailto:"+r):(r=n[1],o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let n;if(n=this.rules.inline.url.exec(t)){let o,a;if(n[2]==="@")o=n[0],a="mailto:"+o;else{let c;do c=n[0],n[0]=((r=this.rules.inline._backpedal.exec(n[0]))==null?void 0:r[0])??"";while(c!==n[0]);o=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){const r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},$s=class Nd{constructor(n){it(this,"tokens");it(this,"options");it(this,"state");it(this,"tokenizer");it(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Br,this.options.tokenizer=this.options.tokenizer||new zl,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 r={other:Nn,block:al.normal,inline:yi.normal};this.options.pedantic?(r.block=al.pedantic,r.inline=yi.pedantic):this.options.gfm&&(r.block=al.gfm,this.options.breaks?r.inline=yi.breaks:r.inline=yi.gfm),this.tokenizer.rules=r}static get rules(){return{block:al,inline:yi}}static lex(n,r){return new Nd(r).lex(n)}static lexInline(n,r){return new Nd(r).inlineTokens(n)}lex(n){n=n.replace(Nn.carriageReturn,`
|
|
477
|
-
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],o=!1){var a,c,d;for(this.options.pedantic&&(n=n.replace(Nn.tabCharGlobal," ").replace(Nn.spaceLine,""));n;){let p;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(m=>(p=m.call({lexer:this},n,r))?(n=n.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.space(n)){n=n.substring(p.raw.length);const m=r.at(-1);p.raw.length===1&&m!==void 0?m.raw+=`
|
|
478
|
-
`:r.push(p);continue}if(p=this.tokenizer.code(n)){n=n.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
479
|
-
`+p.raw,m.text+=`
|
|
480
|
-
`+p.text,this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(p=this.tokenizer.fences(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.heading(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.hr(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.blockquote(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.list(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.html(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.def(n)){n=n.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
481
|
-
`+p.raw,m.text+=`
|
|
482
|
-
`+p.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title});continue}if(p=this.tokenizer.table(n)){n=n.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.lheading(n)){n=n.substring(p.raw.length),r.push(p);continue}let g=n;if((d=this.options.extensions)!=null&&d.startBlock){let m=1/0;const v=n.slice(1);let k;this.options.extensions.startBlock.forEach(y=>{k=y.call({lexer:this},v),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(g=n.substring(0,m+1))}if(this.state.top&&(p=this.tokenizer.paragraph(g))){const m=r.at(-1);o&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=`
|
|
483
|
-
`+p.raw,m.text+=`
|
|
484
|
-
`+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p),o=g.length!==n.length,n=n.substring(p.raw.length);continue}if(p=this.tokenizer.text(n)){n=n.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
485
|
-
`+p.raw,m.text+=`
|
|
486
|
-
`+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(n){const m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){var p,g,m;let o=n,a=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let c=!1,d="";for(;n;){c||(d=""),c=!1;let v;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(y=>(v=y.call({lexer:this},n,r))?(n=n.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(v.raw.length);const y=r.at(-1);v.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(n,o,d)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(n)){n=n.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(n)){n=n.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(n))){n=n.substring(v.raw.length),r.push(v);continue}let k=n;if((m=this.options.extensions)!=null&&m.startInline){let y=1/0;const S=n.slice(1);let C;this.options.extensions.startInline.forEach(b=>{C=b.call({lexer:this},S),typeof C=="number"&&C>=0&&(y=Math.min(y,C))}),y<1/0&&y>=0&&(k=n.substring(0,y+1))}if(v=this.tokenizer.inlineText(k)){n=n.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),c=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=v.raw,y.text+=v.text):r.push(v);continue}if(n){const y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},Fl=class{constructor(t){it(this,"options");it(this,"parser");this.options=t||Br}space(t){return""}code({text:t,lang:n,escaped:r}){var c;const o=(c=(n||"").match(Nn.notSpaceStart))==null?void 0:c[0],a=t.replace(Nn.endingNewline,"")+`
|
|
487
|
-
`;return o?'<pre><code class="language-'+Ns(o)+'">'+(r?a:Ns(a,!0))+`</code></pre>
|
|
488
|
-
`:"<pre><code>"+(r?a:Ns(a,!0))+`</code></pre>
|
|
489
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
490
|
-
${this.parser.parse(t)}</blockquote>
|
|
491
|
-
`}html({text:t}){return t}heading({tokens:t,depth:n}){return`<h${n}>${this.parser.parseInline(t)}</h${n}>
|
|
492
|
-
`}hr(t){return`<hr>
|
|
493
|
-
`}list(t){const n=t.ordered,r=t.start;let o="";for(let d=0;d<t.items.length;d++){const p=t.items[d];o+=this.listitem(p)}const a=n?"ol":"ul",c=n&&r!==1?' start="'+r+'"':"";return"<"+a+c+`>
|
|
494
|
-
`+o+"</"+a+`>
|
|
495
|
-
`}listitem(t){var r;let n="";if(t.task){const o=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=o+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=o+" "+Ns(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):n+=o+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|
496
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
497
|
-
`}table(t){let n="",r="";for(let a=0;a<t.header.length;a++)r+=this.tablecell(t.header[a]);n+=this.tablerow({text:r});let o="";for(let a=0;a<t.rows.length;a++){const c=t.rows[a];r="";for(let d=0;d<c.length;d++)r+=this.tablecell(c[d]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
498
|
-
<thead>
|
|
499
|
-
`+n+`</thead>
|
|
500
|
-
`+o+`</table>
|
|
501
|
-
`}tablerow({text:t}){return`<tr>
|
|
502
|
-
${t}</tr>
|
|
503
|
-
`}tablecell(t){const n=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+n+`</${r}>
|
|
504
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ns(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:r}){const o=this.parser.parseInline(r),a=Xm(t);if(a===null)return o;t=a;let c='<a href="'+t+'"';return n&&(c+=' title="'+Ns(n)+'"'),c+=">"+o+"</a>",c}image({href:t,title:n,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Xm(t);if(a===null)return Ns(r);t=a;let c=`<img src="${t}" alt="${r}"`;return n&&(c+=` title="${Ns(n)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ns(t.text)}},gf=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},zs=class Td{constructor(n){it(this,"options");it(this,"renderer");it(this,"textRenderer");this.options=n||Br,this.options.renderer=this.options.renderer||new Fl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new gf}static parse(n,r){return new Td(r).parse(n)}static parseInline(n,r){return new Td(r).parseInline(n)}parse(n,r=!0){var a,c;let o="";for(let d=0;d<n.length;d++){const p=n[d];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[p.type]){const m=p,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=p;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;d+1<n.length&&n[d+1].type==="text";)m=n[++d],v+=`
|
|
505
|
-
`+this.renderer.text(m);r?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(n,r=this.renderer){var a,c;let o="";for(let d=0;d<n.length;d++){const p=n[d];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[p.type]){const m=this.options.extensions.renderers[p.type].call({parser:this},p);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){o+=m||"";continue}}const g=p;switch(g.type){case"escape":{o+=r.text(g);break}case"html":{o+=r.html(g);break}case"link":{o+=r.link(g);break}case"image":{o+=r.image(g);break}case"strong":{o+=r.strong(g);break}case"em":{o+=r.em(g);break}case"codespan":{o+=r.codespan(g);break}case"br":{o+=r.br(g);break}case"del":{o+=r.del(g);break}case"text":{o+=r.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},dd,gl=(dd=class{constructor(t){it(this,"options");it(this,"block");this.options=t||Br}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?$s.lex:$s.lexInline}provideParser(){return this.block?zs.parse:zs.parseInline}},it(dd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),dd),xN=class{constructor(...t){it(this,"defaults",lf());it(this,"options",this.setOptions);it(this,"parse",this.parseMarkdown(!0));it(this,"parseInline",this.parseMarkdown(!1));it(this,"Parser",zs);it(this,"Renderer",Fl);it(this,"TextRenderer",gf);it(this,"Lexer",$s);it(this,"Tokenizer",zl);it(this,"Hooks",gl);this.use(...t)}walkTokens(t,n){var o,a;let r=[];for(const c of t)switch(r=r.concat(n.call(this,c)),c.type){case"table":{const d=c;for(const p of d.header)r=r.concat(this.walkTokens(p.tokens,n));for(const p of d.rows)for(const g of p)r=r.concat(this.walkTokens(g.tokens,n));break}case"list":{const d=c;r=r.concat(this.walkTokens(d.items,n));break}default:{const d=c;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[d.type]?this.defaults.extensions.childTokens[d.type].forEach(p=>{const g=d[p].flat(1/0);r=r.concat(this.walkTokens(g,n))}):d.tokens&&(r=r.concat(this.walkTokens(d.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const c=n.renderers[a.name];c?n.renderers[a.name]=function(...d){let p=a.renderer.apply(this,d);return p===!1&&(p=c.apply(this,d)),p}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const c=n[a.level];c?c.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),o.extensions=n),r.renderer){const a=this.defaults.renderer||new Fl(this.defaults);for(const c in r.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;const d=c,p=r.renderer[d],g=a[d];a[d]=(...m)=>{let v=p.apply(a,m);return v===!1&&(v=g.apply(a,m)),v||""}}o.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new zl(this.defaults);for(const c in r.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;const d=c,p=r.tokenizer[d],g=a[d];a[d]=(...m)=>{let v=p.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new gl;for(const c in r.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;const d=c,p=r.hooks[d],g=a[d];gl.passThroughHooks.has(c)?a[d]=m=>{if(this.defaults.async)return Promise.resolve(p.call(a,m)).then(k=>g.call(a,k));const v=p.call(a,m);return g.call(a,v)}:a[d]=(...m)=>{let v=p.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.hooks=a}if(r.walkTokens){const a=this.defaults.walkTokens,c=r.walkTokens;o.walkTokens=function(d){let p=[];return p.push(c.call(this,d)),a&&(p=p.concat(a.call(this,d))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return $s.lex(t,n??this.defaults)}parser(t,n){return zs.parse(t,n??this.defaults)}parseMarkdown(t){return(r,o)=>{const a={...o},c={...this.defaults,...a},d=this.onError(!!c.silent,!!c.async);if(this.defaults.async===!0&&a.async===!1)return d(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 r>"u"||r===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));c.hooks&&(c.hooks.options=c,c.hooks.block=t);const p=c.hooks?c.hooks.provideLexer():t?$s.lex:$s.lexInline,g=c.hooks?c.hooks.provideParser():t?zs.parse:zs.parseInline;if(c.async)return Promise.resolve(c.hooks?c.hooks.preprocess(r):r).then(m=>p(m,c)).then(m=>c.hooks?c.hooks.processAllTokens(m):m).then(m=>c.walkTokens?Promise.all(this.walkTokens(m,c.walkTokens)).then(()=>m):m).then(m=>g(m,c)).then(m=>c.hooks?c.hooks.postprocess(m):m).catch(d);try{c.hooks&&(r=c.hooks.preprocess(r));let m=p(r,c);c.hooks&&(m=c.hooks.processAllTokens(m)),c.walkTokens&&this.walkTokens(m,c.walkTokens);let v=g(m,c);return c.hooks&&(v=c.hooks.postprocess(v)),v}catch(m){return d(m)}}}onError(t,n){return r=>{if(r.message+=`
|
|
506
|
-
Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+Ns(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}}},Fr=new xN;function Ge(t,n){return Fr.parse(t,n)}Ge.options=Ge.setOptions=function(t){return Fr.setOptions(t),Ge.defaults=Fr.defaults,vy(Ge.defaults),Ge};Ge.getDefaults=lf;Ge.defaults=Br;Ge.use=function(...t){return Fr.use(...t),Ge.defaults=Fr.defaults,vy(Ge.defaults),Ge};Ge.walkTokens=function(t,n){return Fr.walkTokens(t,n)};Ge.parseInline=Fr.parseInline;Ge.Parser=zs;Ge.parser=zs.parse;Ge.Renderer=Fl;Ge.TextRenderer=gf;Ge.Lexer=$s;Ge.lexer=$s.lex;Ge.Tokenizer=zl;Ge.Hooks=gl;Ge.parse=Ge;Ge.options;Ge.setOptions;Ge.use;Ge.walkTokens;Ge.parseInline;zs.parse;$s.lex;/*! @license DOMPurify 3.4.13 | (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.13/LICENSE */function Zm(t,n){(n==null||n>t.length)&&(n=t.length);for(var r=0,o=Array(n);r<n;r++)o[r]=t[r];return o}function wN(t){if(Array.isArray(t))return t}function kN(t,n){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,a,c,d,p=[],g=!0,m=!1;try{if(c=(r=r.call(t)).next,n!==0)for(;!(g=(o=c.call(r)).done)&&(p.push(o.value),p.length!==n);g=!0);}catch(v){m=!0,a=v}finally{try{if(!g&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(m)throw a}}return p}}function SN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
507
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bN(t,n){return wN(t)||kN(t,n)||NN(t,n)||SN()}function NN(t,n){if(t){if(typeof t=="string")return Zm(t,n);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zm(t,n):void 0}}const jy=Object.entries,Jm=Object.setPrototypeOf,TN=Object.isFrozen,CN=Object.getPrototypeOf,EN=Object.getOwnPropertyDescriptor;let rn=Object.freeze,on=Object.seal,ko=Object.create,_y=typeof Reflect<"u"&&Reflect,Cd=_y.apply,Ed=_y.construct;rn||(rn=function(n){return n});on||(on=function(n){return n});Cd||(Cd=function(n,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];return n.apply(r,a)});Ed||(Ed=function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new n(...o)});const go=zt(Array.prototype.forEach),jN=zt(Array.prototype.lastIndexOf),eg=zt(Array.prototype.pop),vo=zt(Array.prototype.push),_N=zt(Array.prototype.splice),fr=Array.isArray,Ti=zt(String.prototype.toLowerCase),nd=zt(String.prototype.toString),tg=zt(String.prototype.match),wi=zt(String.prototype.replace),ng=zt(String.prototype.indexOf),RN=zt(String.prototype.trim),AN=zt(Number.prototype.toString),IN=zt(Boolean.prototype.toString),sg=typeof BigInt>"u"?null:zt(BigInt.prototype.toString),rg=typeof Symbol>"u"?null:zt(Symbol.prototype.toString),Jt=zt(Object.prototype.hasOwnProperty),ki=zt(Object.prototype.toString),Zt=zt(RegExp.prototype.test),Lr=DN(TypeError);function zt(t){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Cd(t,n,o)}}function DN(t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return Ed(t,r)}}function Ke(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ti;if(Jm&&Jm(t,null),!fr(n))return t;let o=n.length;for(;o--;){let a=n[o];if(typeof a=="string"){const c=r(a);c!==a&&(TN(n)||(n[o]=c),a=c)}t[a]=!0}return t}function MN(t){for(let n=0;n<t.length;n++)Jt(t,n)||(t[n]=null);return t}function pn(t){const n=ko(null);for(const o of jy(t)){var r=bN(o,2);const a=r[0],c=r[1];Jt(t,a)&&(fr(c)?n[a]=MN(c):c&&typeof c=="object"&&c.constructor===Object?n[a]=pn(c):n[a]=c)}return n}function LN(t){switch(typeof t){case"string":return t;case"number":return AN(t);case"boolean":return IN(t);case"bigint":return sg?sg(t):"0";case"symbol":return rg?rg(t):"Symbol()";case"undefined":return ki(t);case"function":case"object":{if(t===null)return ki(t);const n=t,r=cs(n,"toString");if(typeof r=="function"){const o=r(n);return typeof o=="string"?o:ki(o)}return ki(t)}default:return ki(t)}}function cs(t,n){for(;t!==null;){const o=EN(t,n);if(o){if(o.get)return zt(o.get);if(typeof o.value=="function")return zt(o.value)}t=CN(t)}function r(){return null}return r}function ON(t){try{return Zt(t,""),!0}catch{return!1}}const og=rn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sd=rn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),rd=rn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),PN=rn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),od=rn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$N=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ig=rn(["#text"]),ag=rn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),id=rn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),lg=rn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ll=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zN=on(/{{[\w\W]*|^[\w\W]*}}/g),FN=on(/<%[\w\W]*|^[\w\W]*%>/g),UN=on(/\${[\w\W]*/g),BN=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),WN=on(/^aria-[\-\w]+$/),cg=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HN=on(/^(?:\w+script|data):/i),VN=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),KN=on(/^html$/i),GN=on(/^[a-z][.\w]*(-[.\w]+)+$/i),ug=on(/<[/\w!]/g),dg=on(/<[/\w]/g),qN=on(/<\/no(script|embed|frames)/i),XN=on(/\/>/i),Hn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},YN=function(){return typeof window>"u"?null:window},QN=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const c="dompurify"+(o?"#"+o:"");try{return n.createPolicy(c,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},fg=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(n,r,o,a){return Jt(n,r)&&fr(n[r])?Ke(a.base?pn(a.base):{},n[r],a.transform):o};function Ry(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YN();const n=ue=>Ry(ue);if(n.version="3.4.13",n.removed=[],!t||!t.document||t.document.nodeType!==Hn.document||!t.Element)return n.isSupported=!1,n;let r=t.document;const o=r,a=o.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,d=t.Node,p=t.Element,g=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const v=t.DOMParser,k=t.trustedTypes,y=p.prototype,S=cs(y,"cloneNode"),C=cs(y,"remove"),b=cs(y,"nextSibling"),N=cs(y,"childNodes"),E=cs(y,"parentNode"),R=cs(y,"shadowRoot"),z=cs(y,"attributes"),I=d&&d.prototype?cs(d.prototype,"nodeType"):null,L=d&&d.prototype?cs(d.prototype,"nodeName"):null,q=d&&d.prototype?cs(d.prototype,"ownerDocument"):null;if(typeof c=="function"){const ue=r.createElement("template");ue.content&&ue.content.ownerDocument&&(r=ue.content.ownerDocument)}let K,$="",Z,he=!1,ce=0;const ye=function(){if(ce>0)throw Lr('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.')},Se=function(T){ye(),ce++;try{return K.createHTML(T)}finally{ce--}},Oe=function(T){ye(),ce++;try{return K.createScriptURL(T)}finally{ce--}},J=function(){return he||(Z=QN(k,a),he=!0),Z},re=r,oe=re.implementation,F=re.createNodeIterator,Q=re.createDocumentFragment,G=re.getElementsByTagName,D=o.importNode;let P=fg();n.isSupported=typeof jy=="function"&&typeof E=="function"&&oe&&oe.createHTMLDocument!==void 0;const le=zN,W=FN,X=UN,ae=BN,be=WN,_e=HN,Ae=VN,je=GN;let me=cg,pe=null;const Ve=Ke({},[...og,...sd,...rd,...od,...ig]);let Ie=null;const mt=Ke({},[...ag,...id,...lg,...ll]);let Ue=Object.seal(ko(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}})),Vt=null,tn=null;const kt=Object.seal(ko(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jt=!0,Ft=!0,Ot=!1,Y=!0,ge=!1,Be=!0,st=!1,gt=!1,vt=null,_t=null,an=!1,dt=!1,Mn=!1,Ln=!1,hs=!0,ms=!1;const ns="user-content-";let On=!0,gn=!1,ln={},Kt=null;const vn=Ke({},["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 Ze=null;const Rt=Ke({},["audio","video","img","source","image","track"]);let ft=null;const Gt=Ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",lt="http://www.w3.org/1999/xhtml";let qt=lt,ot=!1,Pt=null;const _=Ke({},[yt,xt,lt],nd),fe=rn(["mi","mo","mn","ms","mtext"]);let ie=Ke({},fe);const we=rn(["annotation-xml"]);let Pe=Ke({},we);const qe=Ke({},["title","style","font","a","script"]);let $e=null;const Ut=["application/xhtml+xml","text/html"],Pn="text/html";let We=null,yn=null;const js=r.createElement("form"),Bs=function(T){return T instanceof RegExp||T instanceof Function},$n=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yn&&yn===T)return;(!T||typeof T!="object")&&(T={}),T=pn(T),$e=Ut.indexOf(T.PARSER_MEDIA_TYPE)===-1?Pn:T.PARSER_MEDIA_TYPE,We=$e==="application/xhtml+xml"?nd:Ti,pe=ur(T,"ALLOWED_TAGS",Ve,{transform:We}),Ie=ur(T,"ALLOWED_ATTR",mt,{transform:We}),Pt=ur(T,"ALLOWED_NAMESPACES",_,{transform:nd}),ft=ur(T,"ADD_URI_SAFE_ATTR",Gt,{transform:We,base:Gt}),Ze=ur(T,"ADD_DATA_URI_TAGS",Rt,{transform:We,base:Rt}),Kt=ur(T,"FORBID_CONTENTS",vn,{transform:We}),Vt=ur(T,"FORBID_TAGS",pn({}),{transform:We}),tn=ur(T,"FORBID_ATTR",pn({}),{transform:We}),ln=Jt(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?pn(T.USE_PROFILES):T.USE_PROFILES:!1,jt=T.ALLOW_ARIA_ATTR!==!1,Ft=T.ALLOW_DATA_ATTR!==!1,Ot=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=T.SAFE_FOR_TEMPLATES||!1,Be=T.SAFE_FOR_XML!==!1,st=T.WHOLE_DOCUMENT||!1,dt=T.RETURN_DOM||!1,Mn=T.RETURN_DOM_FRAGMENT||!1,Ln=T.RETURN_TRUSTED_TYPE||!1,an=T.FORCE_BODY||!1,hs=T.SANITIZE_DOM!==!1,ms=T.SANITIZE_NAMED_PROPS||!1,On=T.KEEP_CONTENT!==!1,gn=T.IN_PLACE||!1,me=ON(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:cg,qt=typeof T.NAMESPACE=="string"?T.NAMESPACE:lt,ie=Jt(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?pn(T.MATHML_TEXT_INTEGRATION_POINTS):Ke({},fe),Pe=Jt(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?pn(T.HTML_INTEGRATION_POINTS):Ke({},we);const U=Jt(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?pn(T.CUSTOM_ELEMENT_HANDLING):ko(null);if(Ue=ko(null),Jt(U,"tagNameCheck")&&Bs(U.tagNameCheck)&&(Ue.tagNameCheck=U.tagNameCheck),Jt(U,"attributeNameCheck")&&Bs(U.attributeNameCheck)&&(Ue.attributeNameCheck=U.attributeNameCheck),Jt(U,"allowCustomizedBuiltInElements")&&typeof U.allowCustomizedBuiltInElements=="boolean"&&(Ue.allowCustomizedBuiltInElements=U.allowCustomizedBuiltInElements),on(Ue),ge&&(Ft=!1),Mn&&(dt=!0),ln&&(pe=Ke({},ig),Ie=ko(null),ln.html===!0&&(Ke(pe,og),Ke(Ie,ag)),ln.svg===!0&&(Ke(pe,sd),Ke(Ie,id),Ke(Ie,ll)),ln.svgFilters===!0&&(Ke(pe,rd),Ke(Ie,id),Ke(Ie,ll)),ln.mathMl===!0&&(Ke(pe,od),Ke(Ie,lg),Ke(Ie,ll))),kt.tagCheck=null,kt.attributeCheck=null,Jt(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?kt.tagCheck=T.ADD_TAGS:fr(T.ADD_TAGS)&&(pe===Ve&&(pe=pn(pe)),Ke(pe,T.ADD_TAGS,We))),Jt(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?kt.attributeCheck=T.ADD_ATTR:fr(T.ADD_ATTR)&&(Ie===mt&&(Ie=pn(Ie)),Ke(Ie,T.ADD_ATTR,We))),Jt(T,"ADD_URI_SAFE_ATTR")&&fr(T.ADD_URI_SAFE_ATTR)&&Ke(ft,T.ADD_URI_SAFE_ATTR,We),Jt(T,"FORBID_CONTENTS")&&fr(T.FORBID_CONTENTS)&&(Kt===vn&&(Kt=pn(Kt)),Ke(Kt,T.FORBID_CONTENTS,We)),Jt(T,"ADD_FORBID_CONTENTS")&&fr(T.ADD_FORBID_CONTENTS)&&(Kt===vn&&(Kt=pn(Kt)),Ke(Kt,T.ADD_FORBID_CONTENTS,We)),On&&(pe["#text"]=!0),st&&Ke(pe,["html","head","body"]),pe.table&&(Ke(pe,["tbody"]),delete Vt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ee=K;K=T.TRUSTED_TYPES_POLICY;try{$=Se("")}catch(Te){throw K=ee,Te}}else T.TRUSTED_TYPES_POLICY===null?(K=void 0,$=""):(K===void 0&&(K=J()),K&&typeof $=="string"&&($=Se("")));rn&&rn(T),yn=T},gs=Ke({},[...sd,...rd,...PN]),Je=Ke({},[...od,...$N]),At=function(T,U,ee){return U.namespaceURI===lt?T==="svg":U.namespaceURI===yt?T==="svg"&&(ee==="annotation-xml"||ie[ee]):!!gs[T]},vs=function(T,U,ee){return U.namespaceURI===lt?T==="math":U.namespaceURI===xt?T==="math"&&Pe[ee]:!!Je[T]},ic=function(T,U,ee){return U.namespaceURI===xt&&!Pe[ee]||U.namespaceURI===yt&&!ie[ee]?!1:!Je[T]&&(qe[T]||!gs[T])},St=function(T){let U=E(T);(!U||!U.tagName)&&(U={namespaceURI:qt,tagName:"template"});const ee=Ti(T.tagName),Te=Ti(U.tagName);return Pt[T.namespaceURI]?T.namespaceURI===xt?At(ee,U,Te):T.namespaceURI===yt?vs(ee,U,Te):T.namespaceURI===lt?ic(ee,U,Te):!!($e==="application/xhtml+xml"&&Pt[T.namespaceURI]):!1},ys=function(T){vo(n.removed,{element:T});try{E(T).removeChild(T)}catch{if(C(T),!E(T))throw Lr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ws=function(T){vr(T);const U=N(T);if(U){const Te=[];go(U,Re=>{vo(Te,Re)}),go(Te,Re=>{try{C(Re)}catch{}})}const ee=z(T);if(ee)for(let Te=ee.length-1;Te>=0;--Te){const Re=ee[Te],Fe=Re&&Re.name;if(typeof Fe=="string")try{T.removeAttribute(Fe)}catch{}}},xs=function(T,U){try{vo(n.removed,{attribute:U.getAttributeNode(T),from:U})}catch{vo(n.removed,{attribute:null,from:U})}if(U.removeAttribute(T),T==="is")if(dt||Mn)try{ys(U)}catch{}else try{U.setAttribute(T,"")}catch{}},Wr=function(T){const U=z(T);if(U)for(let ee=U.length-1;ee>=0;--ee){const Te=U[ee],Re=Te&&Te.name;if(!(typeof Re!="string"||Ie[We(Re)]))try{T.removeAttribute(Re)}catch{}}},vr=function(T){const U=[T];for(;U.length>0;){const ee=U.pop();(I?I(ee):ee.nodeType)===Hn.element&&Wr(ee);const Re=N(ee);if(Re)for(let Fe=Re.length-1;Fe>=0;--Fe)U.push(Re[Fe])}},Yi=function(T){if(!Be)return;const U=[T];for(;U.length>0;){const ee=U.pop(),Te=I?I(ee):ee.nodeType;if(Te===Hn.processingInstruction||Te===Hn.comment&&Zt(dg,ee.data)){try{C(ee)}catch{}continue}if(Te===Hn.element){const Fe=ee,Ye=We(L?L(ee):ee.nodeName);try{Fe.hasAttribute&&Fe.hasAttribute("patchsrc")&&Fe.removeAttribute("patchsrc"),Fe.hasAttribute&&Fe.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&Fe.removeAttribute("for")}catch{}}const Re=N(ee);if(Re)for(let Fe=Re.length-1;Fe>=0;--Fe)U.push(Re[Fe])}},yr=function(T){let U=null,ee=null;if(an)T="<remove></remove>"+T;else{const Fe=tg(T,/^[\r\n\t ]+/);ee=Fe&&Fe[0]}$e==="application/xhtml+xml"&&qt===lt&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const Te=K?Se(T):T;if(qt===lt)try{U=new v().parseFromString(Te,$e)}catch{}if(!U||!U.documentElement){U=oe.createDocument(qt,"template",null);try{U.documentElement.innerHTML=ot?$:Te}catch{}}const Re=U.body||U.documentElement;return T&&ee&&Re.insertBefore(r.createTextNode(ee),Re.childNodes[0]||null),qt===lt?G.call(U,st?"html":"body")[0]:st?U.documentElement:Re},zn=function(T){const U=q?q(T):T.ownerDocument;return F.call(U||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Hr=function(T){return T=wi(T,le," "),T=wi(T,W," "),T=wi(T,X," "),T},xn=function(T){var U;T.normalize();const ee=q?q(T):T.ownerDocument,Te=F.call(ee||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Re=Te.nextNode();for(;Re;)Re.data=Hr(Re.data),Re=Te.nextNode();const Fe=(U=T.querySelectorAll)===null||U===void 0?void 0:U.call(T,"template");Fe&&go(Fe,Ye=>{Hs(Ye.content)&&xn(Ye.content)})},Vr=function(T){const U=L?L(T):null;return typeof U!="string"||We(U)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==z(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==I(T)||T.childNodes!==N(T)},Hs=function(T){if(!I||typeof T!="object"||T===null)return!1;try{return I(T)===Hn.documentFragment}catch{return!1}},xr=function(T){if(!I||typeof T!="object"||T===null)return!1;try{return typeof I(T)=="number"}catch{return!1}};function wn(ue,T,U){ue.length!==0&&go(ue,ee=>{ee.call(n,T,U,yn)})}const Kr=function(T,U){return!!(Be&&T.hasChildNodes()&&!xr(T.firstElementChild)&&Zt(ug,T.textContent)&&Zt(ug,T.innerHTML)||Be&&T.namespaceURI===lt&&U==="style"&&xr(T.firstElementChild)||T.nodeType===Hn.processingInstruction||Be&&T.nodeType===Hn.comment&&Zt(dg,T.data))},wr=function(T,U,ee){if(!Vt[U]&&$o(U)&&(Ue.tagNameCheck instanceof RegExp&&Zt(Ue.tagNameCheck,U)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(U)))return!1;if(On&&!Kt[U]){const Te=E(T),Re=N(T);if(Re&&Te){const Fe=Re.length;for(let Ye=Fe-1;Ye>=0;--Ye){const et=T===ee?S(Re[Ye],!0):Re[Ye];Te.insertBefore(et,b(T))}}}return ys(T),!0},kr=function(T,U,ee,Te){return T.length===0?U:U===ee||U===Te?pn(U):U},Qi=function(T,U){if(wn(P.beforeSanitizeElements,T,null),T!==U&&E(T)===null)return gn&&vr(T),!0;if(Vr(T))return ys(T),!0;const ee=We(L?L(T):T.nodeName);if(pe=kr(P.uponSanitizeElement,pe,Ve,vt),wn(P.uponSanitizeElement,T,{tagName:ee,allowedTags:pe}),T!==U&&E(T)===null)return gn&&vr(T),!0;if(Kr(T,ee))return ys(T),!0;if(Vt[ee]||!(kt.tagCheck instanceof Function&&kt.tagCheck(ee))&&!pe[ee]){const Re=wr(T,ee,U);return Re===!1&&wn(P.afterSanitizeElements,T,null),Re}if((I?I(T):T.nodeType)===Hn.element&&!St(T)||(ee==="noscript"||ee==="noembed"||ee==="noframes")&&Zt(qN,T.innerHTML))return ys(T),!0;if(ge&&T.nodeType===Hn.text){const Re=Hr(T.textContent);T.textContent!==Re&&(vo(n.removed,{element:T.cloneNode()}),T.textContent=Re)}return wn(P.afterSanitizeElements,T,null),!1},Zi=function(T,U,ee){if(tn[U]||Be&&U==="patchsrc"||Be&&U==="for"&&T!=="label"&&T!=="output"||hs&&(U==="id"||U==="name")&&(ee in r||ee in js))return!1;const Te=Ie[U]||kt.attributeCheck instanceof Function&&kt.attributeCheck(U,T);if(!(Ft&&Zt(ae,U))){if(!(jt&&Zt(be,U))){if(Te){if(!ft[U]){if(!Zt(me,wi(ee,Ae,""))){if(!((U==="src"||U==="xlink:href"||U==="href")&&T!=="script"&&ng(ee,"data:")===0&&Ze[T])){if(!(Ot&&!Zt(_e,wi(ee,Ae,"")))){if(ee)return!1}}}}}else if(!($o(T)&&(Ue.tagNameCheck instanceof RegExp&&Zt(Ue.tagNameCheck,T)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(T))&&(Ue.attributeNameCheck instanceof RegExp&&Zt(Ue.attributeNameCheck,U)||Ue.attributeNameCheck instanceof Function&&Ue.attributeNameCheck(U,T))||U==="is"&&Ue.allowCustomizedBuiltInElements&&(Ue.tagNameCheck instanceof RegExp&&Zt(Ue.tagNameCheck,ee)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(ee))))return!1}}return!0},Po=Ke({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),$o=function(T){return!Po[Ti(T)]&&Zt(je,T)},zo=function(T,U,ee,Te){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!ee)switch(k.getAttributeType(T,U)){case"TrustedHTML":return Se(Te);case"TrustedScriptURL":return Oe(Te)}return Te},Sr=function(T,U,ee,Te){try{ee?T.setAttributeNS(ee,U,Te):T.setAttribute(U,Te),Vr(T)?ys(T):eg(n.removed)}catch{xs(U,T)}},Ji=function(T){wn(P.beforeSanitizeAttributes,T,null);const U=T.attributes;if(!U||Vr(T))return;Ie=kr(P.uponSanitizeAttribute,Ie,mt,_t);const ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie,forceKeepAttr:void 0};let Te=U.length;const Re=We(T.nodeName);for(;Te--;){const Fe=U[Te],Ye=Fe.name,et=Fe.namespaceURI,bt=Fe.value,Nt=We(Ye),_s=bt;let Dt=Ye==="value"?_s:RN(_s);if(ee.attrName=Nt,ee.attrValue=Dt,ee.keepAttr=!0,ee.forceKeepAttr=void 0,wn(P.uponSanitizeAttribute,T,ee),Dt=ee.attrValue,ms&&(Nt==="id"||Nt==="name")&&ng(Dt,ns)!==0&&(xs(Ye,T),Dt=ns+Dt),Be&&Zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Dt)){xs(Ye,T);continue}if(Nt==="attributename"&&tg(Dt,"href")){xs(Ye,T);continue}if(!ee.forceKeepAttr){if(!ee.keepAttr){xs(Ye,T);continue}if(!Y&&Zt(XN,Dt)){xs(Ye,T);continue}if(ge&&(Dt=Hr(Dt)),!Zi(Re,Nt,Dt)){xs(Ye,T);continue}Dt=zo(Re,Nt,et,Dt),Dt!==_s&&Sr(T,Ye,et,Dt)}}wn(P.afterSanitizeAttributes,T,null)},Vs=function(T){let U=null;const ee=zn(T);for(wn(P.beforeSanitizeShadowDOM,T,null);U=ee.nextNode();)if(wn(P.uponSanitizeShadowNode,U,null),Qi(U,T),Ji(U),Hs(U.content)&&Vs(U.content),(I?I(U):U.nodeType)===Hn.element){const Re=R(U);Hs(Re)&&(Xe(Re),Vs(Re))}wn(P.afterSanitizeShadowDOM,T,null)},Xe=function(T){const U=[{node:T,shadow:null}];for(;U.length>0;){const ee=U.pop();if(ee.shadow){Vs(ee.shadow);continue}const Te=ee.node,Fe=(I?I(Te):Te.nodeType)===Hn.element,Ye=N(Te);if(Ye)for(let et=Ye.length-1;et>=0;--et)U.push({node:Ye[et],shadow:null});if(Fe){const et=L?L(Te):null;if(typeof et=="string"&&We(et)==="template"){const bt=Te.content;Hs(bt)&&U.push({node:bt,shadow:null})}}if(Fe){const et=R(Te);Hs(et)&&U.push({node:null,shadow:et},{node:et,shadow:null})}}};return n.sanitize=function(ue){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=null,ee=null,Te=null,Re=null;if(ot=!ue,ot&&(ue="<!-->"),typeof ue!="string"&&!xr(ue)&&(ue=LN(ue),typeof ue!="string"))throw Lr("dirty is not a string, aborting");if(!n.isSupported)return ue;gt?(pe=vt,Ie=_t):$n(T),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(pe=pn(pe)),P.uponSanitizeAttribute.length>0&&(Ie=pn(Ie)),n.removed=[];const Fe=gn&&typeof ue!="string"&&xr(ue);if(Fe){Yi(ue);const bt=L?L(ue):ue.nodeName;if(typeof bt=="string"){const Nt=We(bt);if(!pe[Nt]||Vt[Nt])throw Ws(ue),Lr("root node is forbidden and cannot be sanitized in-place")}if(Vr(ue))throw Ws(ue),Lr("root node is clobbered and cannot be sanitized in-place");try{Xe(ue)}catch(Nt){throw Ws(ue),Nt}}else if(xr(ue))U=yr("<!---->"),ee=U.ownerDocument.importNode(ue,!0),ee.nodeType===Hn.element&&ee.nodeName==="BODY"||ee.nodeName==="HTML"?U=ee:U.appendChild(ee),Xe(ee);else{if(!dt&&!ge&&!st&&ue.indexOf("<")===-1)return K&&Ln?Se(ue):ue;if(U=yr(ue),!U)return dt?null:Ln?$:""}U&&an&&ys(U.firstChild);const Ye=Fe?ue:U;try{const bt=zn(Ye);for(;Te=bt.nextNode();)Qi(Te,Ye),Ji(Te),Hs(Te.content)&&Vs(Te.content)}catch(bt){throw Fe&&(Ws(ue),go(n.removed,Nt=>{Nt.element&&vr(Nt.element)})),bt}if(Fe)return go(n.removed,bt=>{bt.element&&vr(bt.element)}),ge&&xn(ue),ue;if(dt){if(ge&&xn(U),Mn)for(Re=Q.call(U.ownerDocument);U.firstChild;)Re.appendChild(U.firstChild);else Re=U;return(Ie.shadowroot||Ie.shadowrootmode)&&(Re=D.call(o,Re,!0)),Re}let et=st?U.outerHTML:U.innerHTML;return st&&pe["!doctype"]&&U.ownerDocument&&U.ownerDocument.doctype&&U.ownerDocument.doctype.name&&Zt(KN,U.ownerDocument.doctype.name)&&(et="<!DOCTYPE "+U.ownerDocument.doctype.name+`>
|
|
508
|
-
`+et),ge&&(et=Hr(et)),K&&Ln?Se(et):et},n.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$n(ue),gt=!0,vt=pe,_t=Ie},n.clearConfig=function(){yn=null,gt=!1,vt=null,_t=null,K=Z,$=""},n.isValidAttribute=function(ue,T,U){yn||$n({});const ee=We(ue),Te=We(T);return Zi(ee,Te,U)},n.addHook=function(ue,T){typeof T=="function"&&Jt(P,ue)&&vo(P[ue],T)},n.removeHook=function(ue,T){if(Jt(P,ue)){if(T!==void 0){const U=jN(P[ue],T);return U===-1?void 0:_N(P[ue],U,1)[0]}return eg(P[ue])}},n.removeHooks=function(ue){Jt(P,ue)&&(P[ue]=[])},n.removeAllHooks=function(){P=fg()},n}var vf=Ry();const ZN=new Set(["command_execution","file_change","mcp_tool_call","web_search"]),JN=100;function pg(t){return ZN.has(t.type)}function eT({items:t,runtimeType:n,turn:r,threads:o=[]}){const[a,c]=x.useState(!1),[d,p]=x.useState(!1);if(t.length===0)return null;const g=t.length,m=d?0:Math.max(0,g-JN),v=m>0?t.slice(m):t;return l.jsxs("div",{className:"tool-calls",children:[l.jsxs("div",{className:"tool-calls-header",onClick:()=>c(k=>!k),children:[l.jsx("span",{className:"tool-calls-icon",children:l.jsx(D1,{size:12})}),l.jsxs("span",{className:"tool-calls-summary",children:[g," tool call",g>1?"s":""]}),l.jsx(Li,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&l.jsxs("div",{className:"tool-calls-body",children:[m>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>p(!0),children:["Show ",m," earlier tool call",m>1?"s":""]})}),v.map(k=>l.jsx(Or,{item:k,runtimeType:n,turn:r,threads:o},k.id))]})]})}Ge.setOptions({breaks:!0,gfm:!0});function tT(t){const n=Ge.parse(t);return vf.sanitize(n)}function hg(t,n){var a;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const c=r.currentNode,d=((a=c.textContent)==null?void 0:a.length)??0;if(o+d>n)return{node:c,offset:n-o};o+=d}return null}function nT(t,n,r){const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const c=o.currentNode;if(!c.textContent||c.textContent.trim()==="")continue;const d=document.createRange();d.selectNodeContents(c),!(d.compareBoundaryPoints(Range.START_TO_END,n)<=0)&&(d.compareBoundaryPoints(Range.END_TO_START,n)>=0||a.push(c))}for(const c of a){const d=c.length;let p=0,g=d;if(c===n.startContainer&&(p=Math.min(n.startOffset,d)),c===n.endContainer&&(g=Math.min(n.endOffset,d)),p>=g)continue;g<d&&c.splitText(g);const m=p>0?c.splitText(p):c,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function sT(t,n){t.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of n){if(r.start_offset===null||r.end_offset===null)continue;const o=hg(t,r.start_offset),a=hg(t,r.end_offset);if(!o||!a)continue;const c=document.createRange();c.setStart(o.node,o.offset),c.setEnd(a.node,a.offset),nT(t,c,()=>{const d=document.createElement("mark");return d.setAttribute("data-thread-id",r.id),r.status==="resolved"&&d.classList.add("thread-mark-resolved"),d})}}function rT(t){const n=window.getSelection();if(!n||n.rangeCount===0)return null;const r=n.getRangeAt(0);if(r.collapsed||!t.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(t,0),o.setEnd(r.startContainer,r.startOffset);const a=o.toString().length,c=r.toString();return{start:a,end:a+c.length,text:c}}function oT({itemId:t,turnId:n,sessionId:r,content:o,threads:a}){const c=x.useRef(null),d=x.useRef(null),p=x.useRef(null),g=x.useRef(""),m=x.useRef(0),[v,k]=x.useState(!1),[y,S]=x.useState({x:0,y:0}),[C,b]=x.useState(!1),[N,E]=x.useState({x:0,y:0}),[R,z]=x.useState(""),[I,L]=x.useState(null),[q,K]=x.useState(!1),$=A(G=>G.createThread),Z=A(G=>G.switchRightTab),he=A(G=>Vl(G.sessionDetails[r])),ce=x.useCallback(async()=>{await Fi(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),ye=x.useCallback(()=>{var D;if(!I)return;const G=`
|
|
509
|
-
\`\`\`QUOTE
|
|
510
|
-
${I.text}
|
|
511
|
-
\`\`\`
|
|
512
|
-
|
|
513
|
-
`;A.setState({quotedText:G}),k(!1),L(null),(D=window.getSelection())==null||D.removeAllRanges()},[I]),Se=x.useMemo(()=>tT(o||"…"),[o]),Oe=x.useMemo(()=>a.filter(G=>G.item_id===t),[a,t]);x.useEffect(()=>{c.current&&sT(c.current,Oe)},[Se,Oe]),x.useEffect(()=>{g.current=R},[R]),x.useEffect(()=>{function G(D){d.current&&!d.current.contains(D.target)&&(k(!1),g.current.trim()||b(!1))}return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[]);const J=x.useCallback(()=>{k(!1),g.current.trim()||b(!1)},[]),re=x.useCallback(()=>{const G=c.current;if(!G)return;const D=rT(G);if(D&&D.text.trim().length>0){const P=window.getSelection();if(P&&P.rangeCount>0&&P.anchorNode&&P.focusNode){const W=P.getRangeAt(0).getBoundingClientRect(),X=28,ae=6,be=170;let _e=!1;try{const me=document.createRange();me.setStart(P.focusNode,P.focusOffset),me.setEnd(P.focusNode,P.focusOffset);const pe=document.createRange();pe.setStart(P.anchorNode,P.anchorOffset),pe.setEnd(P.anchorNode,P.anchorOffset),_e=pe.compareBoundaryPoints(Range.START_TO_START,me)>0}catch{_e=!1}let Ae=W.top-X-ae;Ae<8&&(Ae=W.bottom+ae);let je=_e?W.left-be:W.right;je=Math.max(8,Math.min(je,window.innerWidth-be-8)),S({x:je,y:Ae}),k(!0),L(D)}}else k(!1)},[]);x.useEffect(()=>{function G(D){const P=D.target;P&&(P.closest(".selection-actions")||P.closest(".thread-create-popover"))||re()}return document.addEventListener("mouseup",G),()=>document.removeEventListener("mouseup",G)},[re]);const oe=x.useCallback(()=>{k(!1),b(!0),E({x:y.x,y:y.y})},[y]);x.useLayoutEffect(()=>{if(!C)return;const G=p.current;if(!G)return;const D=G.offsetWidth,P=G.offsetHeight,le=8;let W=y.x,X=y.y;W-D<le&&(W=D+le),W>window.innerWidth-le&&(W=window.innerWidth-le),X<le&&(X=le),X+P>window.innerHeight-le&&(X=window.innerHeight-P-le),E({x:W,y:X})},[C,y]);const F=x.useCallback(async()=>{var G;he||!I||!R.trim()||(await $(r,{itemId:t,turnId:n,startOffset:I.start,endOffset:I.end,selectedText:I.text,message:R.trim()}),z(""),b(!1),L(null),(G=window.getSelection())==null||G.removeAllRanges(),Z("threads"))},[I,R,$,r,t,n,Z,he]),Q=x.useCallback(G=>{const D=G.target;if(D.tagName==="MARK"&&D.hasAttribute("data-thread-id")){G.preventDefault(),Z("threads");const P=D.getAttribute("data-thread-id");setTimeout(()=>{const le=document.getElementById(`thread-${P}`);le&&(le.scrollIntoView({behavior:"smooth",block:"center"}),le.classList.add("thread-card-highlighted"),setTimeout(()=>le.classList.remove("thread-card-highlighted"),1500))},100)}},[Z]);return l.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:d,children:[l.jsx("div",{ref:c,dangerouslySetInnerHTML:{__html:Se},onMouseDown:J,onClick:Q}),l.jsx("button",{className:`copy-text-btn${q?" copied":""}`,onClick:ce,title:q?"Copied":"Copy message","aria-label":"Copy message text",children:q?l.jsx(Cs,{size:14}):l.jsx(Oi,{size:14})}),v&&!C&&l.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!he&&l.jsxs("button",{className:"discuss-button",onClick:oe,title:"Start a discussion about this text",children:[l.jsx(v1,{size:14}),l.jsx("span",{children:"Discuss"})]}),l.jsxs("button",{className:"discuss-button",onClick:ye,title:"Quote this text in your message",children:[l.jsx(Lv,{size:14}),l.jsx("span",{children:"Quote"})]})]}),C&&l.jsxs("div",{ref:p,className:"thread-create-popover",style:{left:N.x,top:N.y},children:[l.jsxs("div",{className:"thread-create-header",children:[l.jsxs("span",{className:"thread-create-quote",children:['"',I==null?void 0:I.text.slice(0,80),I&&I.text.length>80?"…":"",'"']}),l.jsx("button",{className:"thread-create-close",onClick:()=>{b(!1),L(null)},children:l.jsx(Tn,{size:14})})]}),l.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:R,onChange:G=>z(G.target.value),autoFocus:!0,rows:2,onKeyDown:G=>{if(G.key==="Enter"&&(G.metaKey||G.ctrlKey)&&(G.preventDefault(),F()),G.key==="Escape")if(g.current.trim()){const D=Date.now();m.current&&D-m.current<400?(m.current=0,b(!1),L(null)):m.current=D}else b(!1),L(null)}}),l.jsxs("div",{className:"thread-create-footer",children:[l.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),l.jsxs("button",{className:"thread-create-send",onClick:F,disabled:!R.trim()||he,title:he?"Wait for the running turn to finish first":void 0,children:[l.jsx(Hi,{size:13}),l.jsx("span",{children:"Send"})]})]})]})]})}const mg=x.memo(oT),Ul=new Map,Ay=new Set,jd=new Set,gg=new Map;function Iy(){jd.forEach(t=>t())}function Dy(t,n){return`${t}:${n}`}function iT(t,n,r,o,a){var g;const c=Dy(n,r),d=Ul.get(t)??new Map,p=new Map(d);((g=p.get(c))==null?void 0:g.answer)===a?p.delete(c):p.set(c,{itemIndex:n,groupIndex:r,question:o,answer:a}),Ul.set(t,p),Iy()}function aT(t){Ul.delete(t),Iy()}function lT(t){Ay.add(t),aT(t)}function cT(t){const n=x.useCallback(r=>(jd.add(r),()=>{jd.delete(r)}),[]);return x.useSyncExternalStore(n,()=>Ul.get(t)??gg,()=>gg)}function uT(t){return[...t].sort((n,r)=>n.itemIndex-r.itemIndex||n.groupIndex-r.groupIndex).map(n=>`> ${n.question}
|
|
514
|
-
${n.answer}`).join(`
|
|
515
|
-
|
|
516
|
-
`)}function vg({item:t,turn:n}){var S;const r=t.data??{},o=x.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(C=>!!C&&Array.isArray(C.selections)&&C.selections.length>0):[],[r.groups]),a=cT(n.id),c=A(C=>n.session_id?C.sessionDetails[n.session_id]:null),d=A(C=>C.activeSessionId),p=n.items.filter(C=>C.type==="ask_user"||C.type==="final_result").findIndex(C=>C.id===t.id),g=c?((S=c.turns[c.turns.length-1])==null?void 0:S.id)===n.id:!0,m=Ay.has(n.id),v=m||lv(c)||!g||n.session_id!==d,k=(C,b,N)=>{v||iT(n.id,p,C,b,N)},y=()=>{const C=[...a.values()];if(C.length===0)return;const b=uT(C);lT(n.id),A.getState().submitPrompt(b)};return l.jsxs("div",{className:"render-content ask-user-card",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(n1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Question"}),m&&l.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?l.jsxs("div",{className:"ask-user-groups",children:[o.map((C,b)=>l.jsxs("div",{className:"ask-user-group",children:[C.question&&l.jsx("div",{className:"ask-user-question",children:C.question}),l.jsx("div",{className:"ask-user-options",children:C.selections.map(N=>{var R;const E=((R=a.get(Dy(p,b)))==null?void 0:R.answer)===N;return l.jsx("button",{type:"button",className:`ask-user-option ${E?"selected":""}`,disabled:v,onClick:()=>k(b,C.question,N),children:N},N)})})]},b)),v?m&&l.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):l.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:y,children:[l.jsx(Hi,{size:12}),"Send"]})]}):r.question?l.jsx("p",{className:"user-message",children:r.question}):l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const dT={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error",auth:"signed out",usage_limit:"usage limit"};function vl(t){return t&&dT[t]||"interrupted"}function Bl(t){if(!t)return"";const n=new Date(t);return Number.isNaN(n.getTime())?"":n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function fT(t){switch(t.interrupt_reason){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"auth":return"Interrupted — Claude is signed out. Sign in again from a terminal, then resume.";case"usage_limit":{const n=Bl(t.resume_at);return n?`Usage limit reached — resumes at ${n}.`:"Usage limit reached — resume once it is over."}case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function pT(t){return t.items.filter(n=>n.type==="interruption").map(n=>n.data)}function hT({item:t}){const n=t.data,r=Bl(n.interrupted_at);let o="";switch(n.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=n.resumed_at?`resumed ${Bl(n.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return l.jsx("div",{className:"interruption-marker",title:n.detail??void 0,children:l.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",vl(n.reason),") · ",o]})})}function mT({turn:t,label:n}){const[r,o]=x.useState(!1),a=A(d=>d.addToast),c=()=>{o(!0),aw(t.session_id,t.id).catch(d=>a("error",`Could not resume the turn — ${d.message}`)).finally(()=>o(!1))};return l.jsxs("button",{type:"button",className:"banner-action",onClick:c,disabled:r,children:[l.jsx(Ov,{size:12}),n]})}function gT({turn:t}){const n=t.resume_state;if(!n||n==="cancelled"||n==="resumed")return null;const r=t.interrupt_reason,o=pT(t),a=o[o.length-1],c=Bl(t.interrupted_at??(a==null?void 0:a.interrupted_at));let d,p=null,g=null;switch(n){case"waiting":{const m=r==="usage_limit"&&!t.resume_at;d=fT(t),p=m?(a==null?void 0:a.detail)??null:null,g=r==="auth"||m?"Resume":"Resume now";break}case"resuming":d=`Interrupted (${vl(r)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);d=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,p=t.error&&!t.error.startsWith("Automatic resume stopped")?t.error:null,g="Resume";break}case"skipped":d=`Interrupted${c?` ${c}`:""} (${vl(r)}) — too long ago to resume automatically.`,g="Resume";break;default:d=`Interrupted (${vl(r)}) — this turn cannot be resumed.`,p=t.error}return l.jsxs("div",{className:"interruption-banner","data-state":n,children:[l.jsx("span",{className:"banner-icon",children:r==="network"?l.jsx(Fv,{size:12}):l.jsx(Xl,{size:12})}),l.jsxs("span",{className:"banner-text",children:[d,p&&l.jsx("span",{className:"banner-detail",children:p})]}),g&&l.jsx(mT,{turn:t,label:g})]})}function vT({turnId:t}){const n=A(o=>o.retryStates[t]);if(!n)return null;const r=n.errorStatus?`API error ${n.errorStatus}`:"Connection problem";return l.jsxs("div",{className:"retry-banner",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(Fv,{size:12})}),l.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",n.attempt," of ",n.maxRetries,")…"]})]})}const yT='(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=global||self,global.morphdom=factory())})(this,function(){"use strict";var DOCUMENT_FRAGMENT_NODE=11;function morphAttrs(fromNode,toNode){var toNodeAttrs=toNode.attributes;var attr;var attrName;var attrNamespaceURI;var attrValue;var fromValue;if(toNode.nodeType===DOCUMENT_FRAGMENT_NODE||fromNode.nodeType===DOCUMENT_FRAGMENT_NODE){return}for(var i=toNodeAttrs.length-1;i>=0;i--){attr=toNodeAttrs[i];attrName=attr.name;attrNamespaceURI=attr.namespaceURI;attrValue=attr.value;if(attrNamespaceURI){attrName=attr.localName||attrName;fromValue=fromNode.getAttributeNS(attrNamespaceURI,attrName);if(fromValue!==attrValue){if(attr.prefix==="xmlns"){attrName=attr.name}fromNode.setAttributeNS(attrNamespaceURI,attrName,attrValue)}}else{fromValue=fromNode.getAttribute(attrName);if(fromValue!==attrValue){fromNode.setAttribute(attrName,attrValue)}}}var fromNodeAttrs=fromNode.attributes;for(var d=fromNodeAttrs.length-1;d>=0;d--){attr=fromNodeAttrs[d];attrName=attr.name;attrNamespaceURI=attr.namespaceURI;if(attrNamespaceURI){attrName=attr.localName||attrName;if(!toNode.hasAttributeNS(attrNamespaceURI,attrName)){fromNode.removeAttributeNS(attrNamespaceURI,attrName)}}else{if(!toNode.hasAttribute(attrName)){fromNode.removeAttribute(attrName)}}}}var range;var NS_XHTML="http://www.w3.org/1999/xhtml";var doc=typeof document==="undefined"?undefined:document;var HAS_TEMPLATE_SUPPORT=!!doc&&"content"in doc.createElement("template");var HAS_RANGE_SUPPORT=!!doc&&doc.createRange&&"createContextualFragment"in doc.createRange();function createFragmentFromTemplate(str){var template=doc.createElement("template");template.innerHTML=str;return template.content.childNodes[0]}function createFragmentFromRange(str){if(!range){range=doc.createRange();range.selectNode(doc.body)}var fragment=range.createContextualFragment(str);return fragment.childNodes[0]}function createFragmentFromWrap(str){var fragment=doc.createElement("body");fragment.innerHTML=str;return fragment.childNodes[0]}function toElement(str){str=str.trim();if(HAS_TEMPLATE_SUPPORT){return createFragmentFromTemplate(str)}else if(HAS_RANGE_SUPPORT){return createFragmentFromRange(str)}return createFragmentFromWrap(str)}function compareNodeNames(fromEl,toEl){var fromNodeName=fromEl.nodeName;var toNodeName=toEl.nodeName;var fromCodeStart,toCodeStart;if(fromNodeName===toNodeName){return true}fromCodeStart=fromNodeName.charCodeAt(0);toCodeStart=toNodeName.charCodeAt(0);if(fromCodeStart<=90&&toCodeStart>=97){return fromNodeName===toNodeName.toUpperCase()}else if(toCodeStart<=90&&fromCodeStart>=97){return toNodeName===fromNodeName.toUpperCase()}else{return false}}function createElementNS(name,namespaceURI){return!namespaceURI||namespaceURI===NS_XHTML?doc.createElement(name):doc.createElementNS(namespaceURI,name)}function moveChildren(fromEl,toEl){var curChild=fromEl.firstChild;while(curChild){var nextChild=curChild.nextSibling;toEl.appendChild(curChild);curChild=nextChild}return toEl}function syncBooleanAttrProp(fromEl,toEl,name){if(fromEl[name]!==toEl[name]){fromEl[name]=toEl[name];if(fromEl[name]){fromEl.setAttribute(name,"")}else{fromEl.removeAttribute(name)}}}var specialElHandlers={OPTION:function(fromEl,toEl){var parentNode=fromEl.parentNode;if(parentNode){var parentName=parentNode.nodeName.toUpperCase();if(parentName==="OPTGROUP"){parentNode=parentNode.parentNode;parentName=parentNode&&parentNode.nodeName.toUpperCase()}if(parentName==="SELECT"&&!parentNode.hasAttribute("multiple")){if(fromEl.hasAttribute("selected")&&!toEl.selected){fromEl.setAttribute("selected","selected");fromEl.removeAttribute("selected")}parentNode.selectedIndex=-1}}syncBooleanAttrProp(fromEl,toEl,"selected")},INPUT:function(fromEl,toEl){syncBooleanAttrProp(fromEl,toEl,"checked");syncBooleanAttrProp(fromEl,toEl,"disabled");if(fromEl.value!==toEl.value){fromEl.value=toEl.value}if(!toEl.hasAttribute("value")){fromEl.removeAttribute("value")}},TEXTAREA:function(fromEl,toEl){var newValue=toEl.value;if(fromEl.value!==newValue){fromEl.value=newValue}var firstChild=fromEl.firstChild;if(firstChild){var oldValue=firstChild.nodeValue;if(oldValue==newValue||!newValue&&oldValue==fromEl.placeholder){return}firstChild.nodeValue=newValue}},SELECT:function(fromEl,toEl){if(!toEl.hasAttribute("multiple")){var selectedIndex=-1;var i=0;var curChild=fromEl.firstChild;var optgroup;var nodeName;while(curChild){nodeName=curChild.nodeName&&curChild.nodeName.toUpperCase();if(nodeName==="OPTGROUP"){optgroup=curChild;curChild=optgroup.firstChild;if(!curChild){curChild=optgroup.nextSibling;optgroup=null}}else{if(nodeName==="OPTION"){if(curChild.hasAttribute("selected")){selectedIndex=i;break}i++}curChild=curChild.nextSibling;if(!curChild&&optgroup){curChild=optgroup.nextSibling;optgroup=null}}}fromEl.selectedIndex=selectedIndex}}};var ELEMENT_NODE=1;var DOCUMENT_FRAGMENT_NODE$1=11;var TEXT_NODE=3;var COMMENT_NODE=8;function noop(){}function defaultGetNodeKey(node){if(node){return node.getAttribute&&node.getAttribute("id")||node.id}}function morphdomFactory(morphAttrs){return function morphdom(fromNode,toNode,options){if(!options){options={}}if(typeof toNode==="string"){if(fromNode.nodeName==="#document"||fromNode.nodeName==="HTML"){var toNodeHtml=toNode;toNode=doc.createElement("html");toNode.innerHTML=toNodeHtml}else if(fromNode.nodeName==="BODY"){var toNodeBody=toNode;toNode=doc.createElement("html");toNode.innerHTML=toNodeBody;var bodyElement=toNode.querySelector("body");if(bodyElement){toNode=bodyElement}}else{toNode=toElement(toNode)}}else if(toNode.nodeType===DOCUMENT_FRAGMENT_NODE$1){toNode=toNode.firstElementChild}var getNodeKey=options.getNodeKey||defaultGetNodeKey;var onBeforeNodeAdded=options.onBeforeNodeAdded||noop;var onNodeAdded=options.onNodeAdded||noop;var onBeforeElUpdated=options.onBeforeElUpdated||noop;var onElUpdated=options.onElUpdated||noop;var onBeforeNodeDiscarded=options.onBeforeNodeDiscarded||noop;var onNodeDiscarded=options.onNodeDiscarded||noop;var onBeforeElChildrenUpdated=options.onBeforeElChildrenUpdated||noop;var skipFromChildren=options.skipFromChildren||noop;var addChild=options.addChild||function(parent,child){return parent.appendChild(child)};var childrenOnly=options.childrenOnly===true;var fromNodesLookup=Object.create(null);var keyedRemovalList=[];function addKeyedRemoval(key){keyedRemovalList.push(key)}function walkDiscardedChildNodes(node,skipKeyedNodes){if(node.nodeType===ELEMENT_NODE){var curChild=node.firstChild;while(curChild){var key=undefined;if(skipKeyedNodes&&(key=getNodeKey(curChild))){addKeyedRemoval(key)}else{onNodeDiscarded(curChild);if(curChild.firstChild){walkDiscardedChildNodes(curChild,skipKeyedNodes)}}curChild=curChild.nextSibling}}}function removeNode(node,parentNode,skipKeyedNodes){if(onBeforeNodeDiscarded(node)===false){return}if(parentNode){parentNode.removeChild(node)}onNodeDiscarded(node);walkDiscardedChildNodes(node,skipKeyedNodes)}function indexTree(node){if(node.nodeType===ELEMENT_NODE||node.nodeType===DOCUMENT_FRAGMENT_NODE$1){var curChild=node.firstChild;while(curChild){var key=getNodeKey(curChild);if(key){fromNodesLookup[key]=curChild}indexTree(curChild);curChild=curChild.nextSibling}}}indexTree(fromNode);function handleNodeAdded(el){onNodeAdded(el);var curChild=el.firstChild;while(curChild){var nextSibling=curChild.nextSibling;var key=getNodeKey(curChild);if(key){var unmatchedFromEl=fromNodesLookup[key];if(unmatchedFromEl&&compareNodeNames(curChild,unmatchedFromEl)){curChild.parentNode.replaceChild(unmatchedFromEl,curChild);morphEl(unmatchedFromEl,curChild)}else{handleNodeAdded(curChild)}}else{handleNodeAdded(curChild)}curChild=nextSibling}}function cleanupFromEl(fromEl,curFromNodeChild,curFromNodeKey){while(curFromNodeChild){var fromNextSibling=curFromNodeChild.nextSibling;if(curFromNodeKey=getNodeKey(curFromNodeChild)){addKeyedRemoval(curFromNodeKey)}else{removeNode(curFromNodeChild,fromEl,true)}curFromNodeChild=fromNextSibling}}function morphEl(fromEl,toEl,childrenOnly){var toElKey=getNodeKey(toEl);if(toElKey){delete fromNodesLookup[toElKey]}if(!childrenOnly){var beforeUpdateResult=onBeforeElUpdated(fromEl,toEl);if(beforeUpdateResult===false){return}else if(beforeUpdateResult instanceof HTMLElement){fromEl=beforeUpdateResult;indexTree(fromEl)}morphAttrs(fromEl,toEl);onElUpdated(fromEl);if(onBeforeElChildrenUpdated(fromEl,toEl)===false){return}}if(fromEl.nodeName!=="TEXTAREA"){morphChildren(fromEl,toEl)}else{specialElHandlers.TEXTAREA(fromEl,toEl)}}function morphChildren(fromEl,toEl){var skipFrom=skipFromChildren(fromEl,toEl);var curToNodeChild=toEl.firstChild;var curFromNodeChild=fromEl.firstChild;var curToNodeKey;var curFromNodeKey;var fromNextSibling;var toNextSibling;var matchingFromEl;outer:while(curToNodeChild){toNextSibling=curToNodeChild.nextSibling;curToNodeKey=getNodeKey(curToNodeChild);while(!skipFrom&&curFromNodeChild){fromNextSibling=curFromNodeChild.nextSibling;if(curToNodeChild.isSameNode&&curToNodeChild.isSameNode(curFromNodeChild)){curToNodeChild=toNextSibling;curFromNodeChild=fromNextSibling;continue outer}curFromNodeKey=getNodeKey(curFromNodeChild);var curFromNodeType=curFromNodeChild.nodeType;var isCompatible=undefined;if(curFromNodeType===curToNodeChild.nodeType){if(curFromNodeType===ELEMENT_NODE){if(curToNodeKey){if(curToNodeKey!==curFromNodeKey){if(matchingFromEl=fromNodesLookup[curToNodeKey]){if(fromNextSibling===matchingFromEl){isCompatible=false}else{fromEl.insertBefore(matchingFromEl,curFromNodeChild);if(curFromNodeKey){addKeyedRemoval(curFromNodeKey)}else{removeNode(curFromNodeChild,fromEl,true)}curFromNodeChild=matchingFromEl;curFromNodeKey=getNodeKey(curFromNodeChild)}}else{isCompatible=false}}}else if(curFromNodeKey){isCompatible=false}isCompatible=isCompatible!==false&&compareNodeNames(curFromNodeChild,curToNodeChild);if(isCompatible){morphEl(curFromNodeChild,curToNodeChild)}}else if(curFromNodeType===TEXT_NODE||curFromNodeType==COMMENT_NODE){isCompatible=true;if(curFromNodeChild.nodeValue!==curToNodeChild.nodeValue){curFromNodeChild.nodeValue=curToNodeChild.nodeValue}}}if(isCompatible){curToNodeChild=toNextSibling;curFromNodeChild=fromNextSibling;continue outer}if(curFromNodeKey){addKeyedRemoval(curFromNodeKey)}else{removeNode(curFromNodeChild,fromEl,true)}curFromNodeChild=fromNextSibling}if(curToNodeKey&&(matchingFromEl=fromNodesLookup[curToNodeKey])&&compareNodeNames(matchingFromEl,curToNodeChild)){if(!skipFrom){addChild(fromEl,matchingFromEl)}morphEl(matchingFromEl,curToNodeChild)}else{var onBeforeNodeAddedResult=onBeforeNodeAdded(curToNodeChild);if(onBeforeNodeAddedResult!==false){if(onBeforeNodeAddedResult){curToNodeChild=onBeforeNodeAddedResult}if(curToNodeChild.actualize){curToNodeChild=curToNodeChild.actualize(fromEl.ownerDocument||doc)}addChild(fromEl,curToNodeChild);handleNodeAdded(curToNodeChild)}}curToNodeChild=toNextSibling;curFromNodeChild=fromNextSibling}cleanupFromEl(fromEl,curFromNodeChild,curFromNodeKey);var specialElHandler=specialElHandlers[fromEl.nodeName];if(specialElHandler){specialElHandler(fromEl,toEl)}}var morphedNode=fromNode;var morphedNodeType=morphedNode.nodeType;var toNodeType=toNode.nodeType;if(!childrenOnly){if(morphedNodeType===ELEMENT_NODE){if(toNodeType===ELEMENT_NODE){if(!compareNodeNames(fromNode,toNode)){onNodeDiscarded(fromNode);morphedNode=moveChildren(fromNode,createElementNS(toNode.nodeName,toNode.namespaceURI))}}else{morphedNode=toNode}}else if(morphedNodeType===TEXT_NODE||morphedNodeType===COMMENT_NODE){if(toNodeType===morphedNodeType){if(morphedNode.nodeValue!==toNode.nodeValue){morphedNode.nodeValue=toNode.nodeValue}return morphedNode}else{morphedNode=toNode}}}if(morphedNode===toNode){onNodeDiscarded(fromNode)}else{if(toNode.isSameNode&&toNode.isSameNode(morphedNode)){return}morphEl(morphedNode,toNode,childrenOnly);if(keyedRemovalList){for(var i=0,len=keyedRemovalList.length;i<len;i++){var elToRemove=fromNodesLookup[keyedRemovalList[i]];if(elToRemove){removeNode(elToRemove,elToRemove.parentNode,false)}}}}if(!childrenOnly&&morphedNode!==fromNode&&fromNode.parentNode){if(morphedNode.actualize){morphedNode=morphedNode.actualize(fromNode.ownerDocument||doc)}fromNode.parentNode.replaceChild(morphedNode,fromNode)}return morphedNode}}var morphdom=morphdomFactory(morphAttrs);return morphdom});',xT=["https://cdnjs.cloudflare.com","https://cdn.jsdelivr.net","https://unpkg.com","https://esm.sh"],My="agentpane-widget",Ly="agentpane-pane",Oy="allow-scripts allow-popups allow-popups-to-escape-sandbox",Si=xT.join(" "),Py=["default-src 'none'",`script-src 'unsafe-inline' 'unsafe-eval' ${Si}`,`style-src 'unsafe-inline' ${Si}`,`img-src data: blob: ${Si}`,`font-src data: ${Si}`,`connect-src ${Si}`,"media-src data: blob:","frame-src 'none'","form-action 'none'","base-uri 'none'"].join("; ");function $y(){const t=typeof document<"u"?getComputedStyle(document.documentElement):null,n=(r,o)=>(t==null?void 0:t.getPropertyValue(r).trim())||o;return{"--color-text-primary":n("--text","#1c1b18"),"--color-text-secondary":n("--text-2","#54504a"),"--color-text-muted":n("--text-3","#78736c"),"--color-background-primary":n("--canvas","#fdfdfc"),"--color-background-secondary":n("--surface-0","#f8f7f5"),"--color-border":n("--border","#e2e0db"),"--color-accent":n("--accent","#d97706"),"--font-sans":n("--font-sans","'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"),"--font-mono":n("--font-mono","'JetBrains Mono', 'SF Mono', 'Fira Code', monospace"),"--radius":n("--r-lg","8px"),"--color-series-1":"#2a78d6","--color-series-2":"#eb6834","--color-series-3":"#1baf7a","--color-series-4":"#eda100","--color-series-5":"#e87ba4","--color-series-6":"#008300","--color-series-7":"#6250d6","--color-series-8":"#e34948","--color-good":"#0ca30c","--color-warning":"#fab219","--color-serious":"#ec835a","--color-critical":"#d03b3b"}}const zy=`window.addEventListener('click', function (e) {
|
|
517
|
-
if (e.defaultPrevented || e.button !== 0) return;
|
|
518
|
-
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
519
|
-
if (!a) return;
|
|
520
|
-
var href = (a.getAttribute('href') || '').trim();
|
|
521
|
-
if (href.charAt(0) === '#' || /^javascript:/i.test(href)) return;
|
|
522
|
-
e.preventDefault();
|
|
523
|
-
if (!/^https?:\\/\\//i.test(href)) return;
|
|
524
|
-
try {
|
|
525
|
-
window.open(new URL(href).href, '_blank', 'noopener,noreferrer');
|
|
526
|
-
} catch (err) {}
|
|
527
|
-
});`,wT=`(function () {
|
|
528
|
-
var SELF = '${My}';
|
|
529
|
-
var PANE = '${Ly}';
|
|
530
|
-
var SCRIPT_TIMEOUT_MS = 15000;
|
|
531
|
-
var root = document.getElementById('root');
|
|
532
|
-
var finished = false;
|
|
533
|
-
var lastHtml = null;
|
|
534
|
-
|
|
535
|
-
function post(msg) {
|
|
536
|
-
msg.source = SELF;
|
|
537
|
-
parent.postMessage(msg, '*');
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
function parse(html, keepScripts) {
|
|
541
|
-
var tmp = document.createElement('div');
|
|
542
|
-
tmp.innerHTML = html;
|
|
543
|
-
if (!keepScripts) {
|
|
544
|
-
var scripts = tmp.querySelectorAll('script');
|
|
545
|
-
for (var i = 0; i < scripts.length; i++) scripts[i].remove();
|
|
546
|
-
}
|
|
547
|
-
return tmp;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
function morph(html, isFinal) {
|
|
551
|
-
var added = new Set();
|
|
552
|
-
morphdom(root, parse(html, isFinal), {
|
|
553
|
-
childrenOnly: true,
|
|
554
|
-
onBeforeElUpdated: function (from, to) { return !from.isEqualNode(to); },
|
|
555
|
-
onNodeAdded: function (node) {
|
|
556
|
-
added.add(node);
|
|
557
|
-
if (!isFinal && node.nodeType === 1 && node.animate && !added.has(node.parentNode)) {
|
|
558
|
-
node.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 220, easing: 'ease-out' });
|
|
559
|
-
}
|
|
560
|
-
return node;
|
|
561
|
-
},
|
|
562
|
-
});
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
// Scripts parsed by innerHTML never run; replace each with a fresh copy.
|
|
566
|
-
function runScripts(done) {
|
|
567
|
-
var scripts = Array.prototype.slice.call(root.querySelectorAll('script'));
|
|
568
|
-
var i = 0;
|
|
569
|
-
function next() {
|
|
570
|
-
if (i >= scripts.length) return done();
|
|
571
|
-
var old = scripts[i++];
|
|
572
|
-
var s = document.createElement('script');
|
|
573
|
-
for (var a = 0; a < old.attributes.length; a++) s.setAttribute(old.attributes[a].name, old.attributes[a].value);
|
|
574
|
-
s.text = old.textContent || '';
|
|
575
|
-
if (!old.src) {
|
|
576
|
-
old.replaceWith(s);
|
|
577
|
-
return next();
|
|
578
|
-
}
|
|
579
|
-
s.async = false;
|
|
580
|
-
var settled = false;
|
|
581
|
-
var timer = setTimeout(go, SCRIPT_TIMEOUT_MS);
|
|
582
|
-
function go() {
|
|
583
|
-
if (settled) return;
|
|
584
|
-
settled = true;
|
|
585
|
-
clearTimeout(timer);
|
|
586
|
-
next();
|
|
587
|
-
}
|
|
588
|
-
s.onload = go;
|
|
589
|
-
s.onerror = function () {
|
|
590
|
-
post({ type: 'error', message: 'Could not load ' + old.src });
|
|
591
|
-
go();
|
|
592
|
-
};
|
|
593
|
-
old.replaceWith(s);
|
|
594
|
-
}
|
|
595
|
-
next();
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
function finish() {
|
|
599
|
-
document.dispatchEvent(new Event('DOMContentLoaded', { bubbles: true }));
|
|
600
|
-
window.dispatchEvent(new Event('load'));
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
window.addEventListener('message', function (e) {
|
|
604
|
-
if (e.source !== parent) return;
|
|
605
|
-
var msg = e.data;
|
|
606
|
-
if (!msg || msg.source !== PANE || msg.type !== 'content' || finished) return;
|
|
607
|
-
var html = typeof msg.html === 'string' ? msg.html : '';
|
|
608
|
-
var isFinal = msg.final === true;
|
|
609
|
-
if (!isFinal && html === lastHtml) return;
|
|
610
|
-
lastHtml = html;
|
|
611
|
-
morph(html, isFinal);
|
|
612
|
-
if (isFinal) {
|
|
613
|
-
finished = true;
|
|
614
|
-
runScripts(finish);
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
|
|
618
|
-
window.addEventListener('error', function (e) {
|
|
619
|
-
var message = String(e.message || 'Script error');
|
|
620
|
-
// Benign: a layout change inside a ResizeObserver callback.
|
|
621
|
-
if (/ResizeObserver loop/.test(message)) return;
|
|
622
|
-
post({ type: 'error', message: message });
|
|
623
|
-
});
|
|
624
|
-
|
|
625
|
-
${zy}
|
|
626
|
-
|
|
627
|
-
// The frame is as tall as the document's content: the bottom of the
|
|
628
|
-
// lowest in-flow child of <body> (#root, or what a script appended), plus
|
|
629
|
-
// the body's own padding, border and margin below it. Not the viewport or
|
|
630
|
-
// a box styled height: 100% — those follow the frame itself.
|
|
631
|
-
function px(style, prop) {
|
|
632
|
-
return parseFloat(style.getPropertyValue(prop)) || 0;
|
|
633
|
-
}
|
|
634
|
-
function contentHeight() {
|
|
635
|
-
var bottom = 0;
|
|
636
|
-
var children = document.body.children;
|
|
637
|
-
for (var i = 0; i < children.length; i++) {
|
|
638
|
-
var child = children[i];
|
|
639
|
-
if (child.tagName === 'SCRIPT') continue;
|
|
640
|
-
var style = getComputedStyle(child);
|
|
641
|
-
if (style.position === 'absolute' || style.position === 'fixed' || style.display === 'none') continue;
|
|
642
|
-
bottom = Math.max(bottom, child.getBoundingClientRect().bottom + px(style, 'margin-bottom'));
|
|
643
|
-
}
|
|
644
|
-
var body = getComputedStyle(document.body);
|
|
645
|
-
return bottom + window.scrollY + px(body, 'padding-bottom') + px(body, 'border-bottom-width') + px(body, 'margin-bottom');
|
|
646
|
-
}
|
|
647
|
-
var lastHeight = -1;
|
|
648
|
-
function reportHeight() {
|
|
649
|
-
var h = Math.ceil(contentHeight());
|
|
650
|
-
if (h === lastHeight) return;
|
|
651
|
-
lastHeight = h;
|
|
652
|
-
post({ type: 'height', height: h });
|
|
653
|
-
}
|
|
654
|
-
var sizes = new ResizeObserver(reportHeight);
|
|
655
|
-
sizes.observe(root);
|
|
656
|
-
sizes.observe(document.body);
|
|
657
|
-
// Elements a script adds next to #root count too.
|
|
658
|
-
new MutationObserver(function (records) {
|
|
659
|
-
for (var r = 0; r < records.length; r++) {
|
|
660
|
-
for (var n = 0; n < records[r].addedNodes.length; n++) {
|
|
661
|
-
if (records[r].addedNodes[n].nodeType === 1) sizes.observe(records[r].addedNodes[n]);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
reportHeight();
|
|
665
|
-
}).observe(document.body, { childList: true });
|
|
666
|
-
reportHeight();
|
|
667
|
-
post({ type: 'ready' });
|
|
668
|
-
})();`;function _d(t){return`<script>${t.replace(/<\/script/gi,"<\\/script")}<\/script>`}function kT(){const t=Object.entries($y()).map(([n,r])=>`${n}: ${r};`).join(" ");return["<!DOCTYPE html>","<html><head>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="${Py}">`,"<style>",`:root { ${t} color-scheme: light; }`,"html, body { margin: 0; padding: 0; background: transparent; overflow: hidden; }","body { font: 14px/1.5 var(--font-sans); color: var(--color-text-primary); -webkit-font-smoothing: antialiased; }","#root { position: relative; display: flow-root; }","*, *::before, *::after { box-sizing: border-box; }","</style>",_d(yT),'</head><body><div id="root"></div>',_d(wT),"</body></html>"].join(`
|
|
669
|
-
`)}let yg=null;function ST(){return yg??(yg=kT()),yg}const bT=4e3,NT=3,So=new Map,TT=500;function CT(t,n){if(So.delete(t),So.set(t,n),So.size>TT){const r=So.keys().next().value;r!==void 0&&So.delete(r)}}function ET({widgetId:t,title:n,html:r,final:o,onError:a}){const c=x.useRef(null),[d,p]=x.useState(()=>So.get(t)??0),g=x.useRef({html:r,final:o});g.current={html:r,final:o};const m=x.useRef(a);m.current=a;const v=x.useRef(0),k=x.useRef(null),y=x.useCallback(()=>{var N;const S=(N=c.current)==null?void 0:N.contentWindow;if(!S||v.current===0||v.current>NT)return;const C=g.current,b=k.current;b&&(b.final||b.html===C.html&&b.final===C.final)||(k.current=C,S.postMessage({source:Ly,type:"content",html:C.html,final:C.final},"*"))},[]);return x.useEffect(()=>{function S(C){var E;const b=c.current;if(!b||C.source!==b.contentWindow)return;const N=C.data;if(!(!N||typeof N!="object"||N.source!==My))if(N.type==="ready")v.current+=1,k.current=null,y();else if(N.type==="height"&&typeof N.height=="number"&&Number.isFinite(N.height)){const R=Math.min(bT,Math.max(0,Math.ceil(N.height)));p(R),CT(t,R)}else N.type==="error"&&typeof N.message=="string"&&((E=m.current)==null||E.call(m,N.message.slice(0,500)))}return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[t,y]),x.useEffect(()=>{y()},[r,o,y]),l.jsx("iframe",{ref:c,className:"widget-frame",sandbox:Oy,srcDoc:ST(),title:n||"Widget",style:{height:`${d}px`}})}const jT=720,_T=20;function Rd(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function RT(t,n){const r=Object.entries($y()).map(([o,a])=>`${o}: ${a};`).join(" ");return["<!DOCTYPE html>","<html><head>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="${Py}">`,'<meta name="viewport" content="width=device-width, initial-scale=1">',`<title>${Rd(t||"Widget")}</title>`,"<style>",`:root { ${r} color-scheme: light; }`,"html { background: var(--color-background-primary); }","body { margin: 0; padding: 32px 24px; font: 14px/1.5 var(--font-sans); color: var(--color-text-primary); -webkit-font-smoothing: antialiased; }",`#root { position: relative; display: flow-root; max-width: ${jT}px; margin: 0 auto; }`,"*, *::before, *::after { box-sizing: border-box; }","</style>",_d(zy),'</head><body><div id="root">',n,"</div></body></html>"].join(`
|
|
670
|
-
`)}function AT(t,n){const r=Rd(t||"Widget");return["<!DOCTYPE html>","<html><head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1">',`<title>${r}</title>`,"<style>html, body { margin: 0; height: 100%; } iframe { display: block; width: 100%; height: 100%; border: 0; }</style>","</head><body>",`<iframe sandbox="${Oy}" title="${r}" srcdoc="${Rd(RT(t,n))}"></iframe>`,"</body></html>"].join(`
|
|
671
|
-
`)}const yo=new Map;function IT(t,n,r){const o=AT(n,r);let a=yo.get(t);a&&a.doc!==o&&(URL.revokeObjectURL(a.url),a=void 0),a??(a={doc:o,url:URL.createObjectURL(new Blob([o],{type:"text/html;charset=utf-8"}))}),yo.delete(t),yo.set(t,a);for(const[d,p]of yo){if(yo.size<=_T)break;URL.revokeObjectURL(p.url),yo.delete(d)}const c=window.open(a.url,"_blank");c&&(c.opener=null)}function DT({item:t}){const[n,r]=x.useState(null),o=t.data??{},a=typeof o.title=="string"?o.title.trim():"",c=typeof o.html=="string"?o.html:"",d=o.partial===!0,p=typeof o.error=="string"&&o.error?o.error:null,g=t.external_item_id??t.id;return l.jsxs("div",{className:"render-content widget-card",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(j1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:a||"Visual"}),d&&l.jsx("span",{className:"turn-header-meta",children:"drawing…"}),p&&l.jsx("span",{className:"turn-header-meta",style:{color:"var(--red)"},children:"failed"}),!d&&c.trim()!==""&&l.jsx("button",{type:"button",className:"widget-open-btn",title:"Open in a new tab","aria-label":"Open in a new tab",onClick:()=>IT(g,a,c),children:l.jsx(jv,{size:14})})]}),c.trim()?l.jsx(ET,{widgetId:g,title:a,html:c,final:!d,onError:r}):!p&&l.jsx("div",{className:"widget-placeholder",children:d?"Drawing…":"Nothing to show"}),p&&l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:p})}),n&&!p&&l.jsxs("div",{className:"widget-script-error",title:n,children:["Script error: ",n]})]})}Ge.setOptions({breaks:!0,gfm:!0});const MT=10,LT=100;function OT({attachments:t}){const[n,r]=x.useState(null);return x.useEffect(()=>{if(!n)return;function o(a){a.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),!Array.isArray(t)||t.length===0?null:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"attachment-pills",children:t.map((o,a)=>{const c=o.media_type.startsWith("image/"),d=`data:${o.media_type};base64,${o.data}`;return l.jsxs("span",{className:"attachment-pill",title:o.name,onClick:c?()=>r(d):void 0,style:c?{cursor:"pointer"}:void 0,children:[c?l.jsx("img",{src:d,alt:o.name,className:"attachment-pill-thumb"}):l.jsx(_v,{size:12,className:"attachment-pill-icon"}),l.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),n&&l.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:l.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[l.jsx("img",{src:n,alt:"preview"}),l.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:l.jsx(Tn,{size:20})})]})})]})}function PT(t){const n=Ge.parse(t);return vf.sanitize(n)}function xg(t){var n;return(n=t.data)!=null&&n.text?t.data.text:""}function $T(t){const n=t.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return n?n[1]:t}const wg='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function zT(t){return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${wg}</body>`):t+wg}function FT({html:t}){const[n,r]=x.useState(480),o=x.useRef(null);return x.useEffect(()=>{function a(c){var d;c.source===((d=o.current)==null?void 0:d.contentWindow)&&typeof c.data=="number"&&c.data>0&&r(c.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),l.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:zT(t),title:"HTML content",style:{width:"100%",height:`${n}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const kg=1e4;function UT({item:t,runtimeType:n,turn:r,threads:o}){var p,g,m,v,k,y,S,C;const a=t.status==="in_progress",[c,d]=x.useState(!1);switch(t.type){case"agent_message":{const{iconClass:b,iconText:N}=gd(n??"codex");return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:`turn-header-icon ${b}`,children:N}),l.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&l.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),l.jsx(mg,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:xg(t)||"…",threads:o,runtimeType:n})]})}case"reasoning":return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(e1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),l.jsx("div",{dangerouslySetInnerHTML:{__html:PT(xg(t))}})]});case"command_execution":{const b=t.data||{},N=$T(b.command||""),E=b.aggregated_output||"",R=b.exit_code,z=a?"running…":R!==null?`exit ${R}`:"",I=E.length>kg,L=I&&!c?E.slice(0,kg)+`
|
|
672
|
-
… (truncated, click to expand)`:E;return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(zv,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Command"}),z&&l.jsx("span",{className:"turn-header-meta",children:z})]}),l.jsx("pre",{className:"cmd-block",children:l.jsx("code",{children:N})}),E&&l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"cmd-output",children:l.jsx("code",{children:L})}),I&&l.jsx("button",{className:"cmd-output-toggle",onClick:()=>d(q=>!q),children:c?"Show less":`Show full output (${(E.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const b=(p=t.data)==null?void 0:p.changes,N=Array.isArray(b)?b:[],E=`${N.length} file${N.length!==1?"s":""}`;return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(i1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"File Changes"}),l.jsx("span",{className:"turn-header-meta",children:E})]}),l.jsx("div",{className:"file-change-list",children:N.map((R,z)=>{const I=R.kind==="add"?"A":R.kind==="delete"?"D":"M",L=R.kind==="add"?"fc-add":R.kind==="delete"?"fc-del":"fc-mod";return l.jsxs("div",{className:"file-change",children:[l.jsx("span",{className:`fc-status ${L}`,children:I}),l.jsx("span",{className:"fc-name",children:R.path})]},z)})})]})}case"mcp_tool_call":{const b=t.data||{},N=b.tool||"mcp";if(N==="Agent"){const $=b.arguments,Z=($==null?void 0:$.description)||($==null?void 0:$.prompt)||"Subagent",he=t.status==="failed",ce=a?"running…":he?"failed":"done";return l.jsxs("div",{className:"agent-call-card",children:[l.jsx("span",{className:"agent-call-icon",children:l.jsx(gr,{size:14})}),l.jsx("span",{className:"agent-call-desc",children:Z}),l.jsx("span",{className:`agent-call-status ${a?"running":he?"failed":"done"}`,children:ce})]})}const E=b.server||"",R=b.arguments,z=b.result,I=b.error,L=t.status==="failed"||!!I,q=a?"running…":L?"failed":"done",K=((g=z==null?void 0:z.content)==null?void 0:g.filter($=>$.type==="text").map($=>$.text))??[];return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(T1,{size:14})}),l.jsxs("span",{className:"turn-header-title",children:["MCP: ",N]}),E&&l.jsx("span",{className:"turn-header-meta",children:E}),l.jsx("span",{className:"turn-header-meta",style:L?{color:"var(--red)"}:void 0,children:q})]}),R&&Object.keys(R).length>0&&l.jsx("div",{className:"mcp-args",children:Object.entries(R).map(([$,Z])=>l.jsxs("div",{className:"mcp-arg",children:[l.jsx("span",{className:"mcp-arg-key",children:$}),$==="code"?l.jsx("pre",{className:"cmd-block",children:l.jsx("code",{children:String(Z)})}):l.jsx("span",{className:"mcp-arg-value",children:typeof Z=="string"?Z:JSON.stringify(Z,null,2)})]},$))}),K.length>0&&K.map(($,Z)=>l.jsx("pre",{className:"cmd-output",children:l.jsx("code",{children:$})},Z)),I&&l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:I})})]})}case"web_search":{const b=((m=t.data)==null?void 0:m.query)||"";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(E1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),l.jsx("p",{className:"user-message",children:b})]})}case"todo_list":{const b=((v=t.data)==null?void 0:v.items)||[];return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(h1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),l.jsx("ul",{className:"todo-list",children:b.map((N,E)=>l.jsxs("li",{className:N.completed?"todo-done":"todo-pending",children:[N.completed?l.jsx(Cs,{size:14}):l.jsx(Ur,{size:14})," ",N.text]},E))})]})}case"ask_user":return l.jsx(vg,{item:t,turn:r});case"final_result":{const b=t.data??{},N=b.text||"",E=b.html||null,R=Array.isArray(b.groups)?b.groups.filter(L=>!!L&&Array.isArray(L.selections)&&L.selections.length>0):[],{iconClass:z,iconText:I}=gd(n??"codex");return l.jsxs(l.Fragment,{children:[(N||E)&&l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:`turn-header-icon ${z}`,children:I}),l.jsx("span",{className:"turn-header-title",children:"Agent"})]}),N&&l.jsx(mg,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:N,threads:o,runtimeType:n}),E&&l.jsx(FT,{html:E})]}),R.length>0&&l.jsx(vg,{item:t,turn:r})]})}case"background_task":{const b=t.data||{},N=b.task_type||"unknown",E=b.subagent_type||null,R=b.description||"",z=b.status||"running",I=b.last_tool_name||null,L=b.token_count||null,q=N==="local_agent",K=N==="local_bash",$=q?gr:K?Pv:Ev,Z=q?`Subagent${E?`: ${E}`:""}`:K?"Monitor":"Background Task",he=z==="running"?"running…":z==="completed"?"done":z==="failed"?"failed":z==="stopped"?"stopped":z,ce=t.status==="failed"||z==="failed";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx($,{size:14})}),l.jsx("span",{className:"turn-header-title",children:Z}),l.jsx("span",{className:"turn-header-meta",style:ce?{color:"var(--red)"}:void 0,children:he})]}),R&&l.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:R}),I&&a&&l.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",I,L!=null&&` · ${L.toLocaleString()} tokens`]}),l.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const b=((k=t.data)==null?void 0:k.trigger)??"auto",N=((y=t.data)==null?void 0:y.pre_tokens)??0,E=((S=t.data)==null?void 0:S.post_tokens)??0,R=N>0?Math.round((1-E/N)*100):0,z=b==="manual"?"Context compacted (/compact)":"Context auto-compacted";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:l.jsx(y1,{size:14})}),l.jsx("span",{className:"turn-header-title",children:z})]}),l.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[N.toLocaleString()," → ",E.toLocaleString()," tokens (",R,"% reduction)"]})]})}case"interruption":return l.jsx(hT,{item:t});case"widget":return l.jsx(DT,{item:t});case"error":{const b=((C=t.data)==null?void 0:C.message)||"Unknown error";return l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:l.jsx(Xl,{size:14})}),l.jsx("span",{className:"turn-header-title",children:"Error"})]}),l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:b})})]})}default:return null}}const Or=x.memo(UT,(t,n)=>t.item===n.item&&t.runtimeType===n.runtimeType&&t.threads===n.threads&&t.turn.id===n.turn.id);function BT(t){return t.type==="widget"?`widget-${t.external_item_id??t.id}`:t.id}function WT({turn:t,runtimeType:n,threads:r=[]}){Lt.trackRender("TurnContent");const[o,a]=x.useState(!1),[c,d]=x.useState(!1),[p,g]=x.useState(!1),[m,v]=x.useState(!1),k=A(W=>W.loadDeferredItems),y=t.items.some(W=>W.type==="background_task"&&W.status==="in_progress");x.useEffect(()=>{t.status==="running"||t.status==="pending"?a(!0):t.status==="completed"&&!y&&a(!1)},[t.status,y]);const S=t.deferred_item_count??0,C=Fs(t),b=x.useRef(C);x.useEffect(()=>{const W=b.current&&!C&&t.status==="completed"&&!y;if(b.current=C,W||!o||S===0||m||C&&!c)return;let X=!1;return k(t.session_id,t.id).then(ae=>{!ae&&!X&&v(!0)}),()=>{X=!0}},[o,S,m,C,c,t.status,y,k,t.session_id,t.id]);let N=-1;for(let W=t.items.length-1;W>=0;W--)if(t.items[W].type==="agent_message"){N=W;break}const E=N>=0,R=E?t.items.slice(0,N):t.items,z=t.items.some(W=>W.type==="final_result"||W.type==="ask_user"),I=!E&&t.status==="completed"&&t.agent_response&&!z?{id:`response-${t.id}`,turn_id:t.id,external_item_id:`response-${t.id}`,type:"agent_message",data:{text:t.agent_response},status:"completed",created_at:t.created_at,updated_at:t.updated_at}:null,L=R.filter(W=>{var X;return!(W.type==="reasoning"&&(!((X=W.data)!=null&&X.text)||W.data.text===""))}),q=t.items.some(W=>{var X;return W.type==="interruption"&&((X=W.data)==null?void 0:X.reason)==="auth"}),K=t.items.some(W=>{var X;return W.type==="interruption"&&((X=W.data)==null?void 0:X.reason)==="usage_limit"}),$=L.filter(W=>{var X,ae;return!(W.type==="background_task"||W.type==="ask_user"||W.type==="final_result"||W.type==="widget"||q&&W.type==="error"&&((X=W.data)==null?void 0:X.error)==="authentication_failed"||K&&W.type==="error"&&((ae=W.data)==null?void 0:ae.error)==="rate_limit")}),Z=c?0:Math.max(0,$.length-LT),he=Z>0?$.slice(Z):$,ce=[];let ye=null;for(const W of he)W.type==="agent_message"?(ye&&ce.push(ye),ye={agentMessage:W,toolItems:[],otherItems:[]}):W.type==="interruption"||W.type==="error"?(ye&&ce.push(ye),ce.push({agentMessage:null,toolItems:[],otherItems:[W]}),ye=null):(ye||(ye={agentMessage:null,toolItems:[],otherItems:[]}),pg(W)?ye.toolItems.push(W):ye.otherItems.push(W));ye&&ce.push(ye);const Se=t.status==="running"||t.status==="pending",Oe=W=>{var X;return W.type==="widget"&&(Se||((X=W.data)==null?void 0:X.partial)!==!0)},J=E?t.items[N]:I,re=[...R.filter(Oe),...J?[J]:[],...E?t.items.slice(N+1).filter(W=>W.type!=="ask_user"&&W.type!=="background_task"&&W.type!=="final_result"&&(W.type!=="widget"||Oe(W))):[]],oe=t.items.filter(W=>W.type==="background_task"),F=p?0:Math.max(0,oe.length-MT),Q=F>0?oe.slice(F):oe,G=$.filter(W=>pg(W)).length+(t.deferred_tool_calls??0),D=G>0||C&&($.length>0||S>0),P=t.status==="pending"&&t.resume_state==="waiting",le=t.resume_state==="gave_up"||t.resume_state==="skipped"||t.resume_state==="unsupported";return l.jsxs("div",{className:"turn-group",children:[l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),l.jsx("span",{className:"turn-header-title",children:"You"})]}),l.jsx("p",{className:"user-message",children:t.user_prompt}),Array.isArray(t.attachments)&&t.attachments.length>0&&l.jsx(OT,{attachments:t.attachments})]}),D&&l.jsxs("div",{className:"tool-calls",children:[l.jsxs("div",{className:"tool-calls-header",onClick:()=>a(W=>!W),children:[l.jsx("span",{className:"tool-calls-icon",children:l.jsx(d1,{size:12})}),l.jsx("span",{className:"tool-calls-summary",children:G>0?`${G} tool call${G>1?"s":""}`:P?"interrupted":"thinking…"}),l.jsx(Li,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&l.jsxs("div",{className:"tool-calls-body",children:[S>0&&l.jsx("div",{className:"render-load-earlier",children:m?l.jsx("button",{className:"render-load-earlier-btn",onClick:()=>v(!1),children:"Couldn't load these steps. Try again"}):C&&!c?l.jsx("button",{className:"render-load-earlier-btn",onClick:()=>d(!0),children:"Show earlier steps"}):l.jsx("span",{className:"tool-calls-loading",children:"Loading steps…"})}),(S===0||C)&&l.jsxs(l.Fragment,{children:[S===0&&Z>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>d(!0),children:["Show ",Z," earlier step",Z>1?"s":""]})}),ce.map((W,X)=>l.jsxs("div",{className:"intermediate-segment",children:[W.agentMessage&&l.jsx(Or,{item:W.agentMessage,runtimeType:n,turn:t,threads:r}),W.otherItems.map(ae=>l.jsx(Or,{item:ae,runtimeType:n,turn:t,threads:r},ae.id)),W.toolItems.length>0&&l.jsx(eT,{items:W.toolItems,runtimeType:n,turn:t,threads:r})]},X))]})]})]}),F>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(!0),children:["Show ",F," earlier background task",F>1?"s":""]})}),Q.map(W=>l.jsx(Or,{item:W,runtimeType:n,turn:t,threads:r},`task-${W.id}`)),re.map(W=>l.jsx(Or,{item:W,runtimeType:n,turn:t,threads:r},BT(W))),t.items.filter(W=>W.type==="final_result").map(W=>l.jsx(Or,{item:W,runtimeType:n,turn:t,threads:r},`final-${W.id}`)),t.items.filter(W=>W.type==="ask_user").map(W=>l.jsx(Or,{item:W,runtimeType:n,turn:t,threads:r},`ask-${W.id}`)),t.items.length===0&&!t.error&&(t.status==="pending"||t.status==="running")&&l.jsx("div",{className:"render-content",children:l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.status==="running"?"Agent is thinking…":"Waiting to start…"})}),t.error&&!le&&l.jsx("div",{className:"render-content",children:l.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:l.jsx("code",{children:t.error})})}),t.status==="running"&&l.jsx(vT,{turnId:t.id}),l.jsx(gT,{turn:t}),t.status==="aborted"&&l.jsxs("div",{className:"aborted-banner",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(Ur,{size:12})}),l.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const HT=x.memo(WT),VT=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘K":"Ctrl+K";function KT(){const t=A(N=>N.workspaces),n=A(N=>N.loadPickerSupport),r=A(N=>N.pickAndAddWorkspace),o=A(N=>N.createSessionInWorkspace),a=A(N=>N.setImportSessionsWorkspace);x.useEffect(()=>{n()},[n]);const c=t.filter(N=>N.deleted===0),[d,p]=x.useState(null),g=c.find(N=>N.path===d)??c[c.length-1]??null,m=(g==null?void 0:g.path)??null,[v,k]=x.useState(null);x.useEffect(()=>{if(!m)return;let N=!1;return mv(m).then(E=>{N||k({path:m,count:E.length})}).catch(()=>{}),()=>{N=!0}},[m]);const y=v&&v.path===m?v.count:0,[S,C]=x.useState(!1);async function b(N){C(!0);try{await o(N)}finally{C(!1)}}return l.jsx("div",{className:"render-scroll welcome-scroll",children:l.jsxs("main",{className:"welcome","aria-labelledby":"welcome-title",children:[l.jsx("h1",{className:"welcome-title",id:"welcome-title",children:"Welcome to Repoburg"}),l.jsx("p",{className:"welcome-lead",children:"Run Claude Code and Codex agents on your projects, side by side. Each session works in a workspace: one of your project folders."}),l.jsxs("ol",{className:"welcome-steps",children:[l.jsxs("li",{className:`welcome-step${g?" done":" current"}`,children:[l.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:g?l.jsx(Cs,{size:13}):"1"}),l.jsxs("div",{className:"welcome-step-body",children:[l.jsx("h2",{className:"welcome-step-title",children:"Add a workspace"}),g?l.jsx("p",{className:"welcome-step-text",children:l.jsx("code",{title:g.path,children:g.path})}):l.jsxs("button",{className:"dialog-btn-create welcome-primary",onClick:()=>void r(),children:[l.jsx(l1,{size:14})," Open folder…"]})]})]}),l.jsxs("li",{className:`welcome-step${g?" current":" upcoming"}`,children:[l.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:"2"}),l.jsxs("div",{className:"welcome-step-body",children:[l.jsx("h2",{className:"welcome-step-title",children:"Start your first session"}),g&&m?l.jsxs(l.Fragment,{children:[c.length>1&&l.jsxs("label",{className:"welcome-step-text welcome-target",children:["In",l.jsx("select",{className:"dialog-input dialog-select",value:m,onChange:N=>p(N.target.value),children:c.map(N=>l.jsx("option",{value:N.path,children:N.label||N.path},N.id))})]}),l.jsxs("div",{className:"welcome-actions",children:[l.jsxs("button",{className:"dialog-btn-create welcome-primary",disabled:S,onClick:()=>void b(m),children:[l.jsx(pr,{size:14})," New session"]}),y>0&&l.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>a(m),children:[l.jsx(Iv,{size:14})," Import ",y," Claude Code"," ",y===1?"session":"sessions"]})]}),y>0&&l.jsxs("p",{className:"welcome-step-text",children:["Sessions you started with ",l.jsx("code",{children:"claude"})," in this folder continue right where they left off."]})]}):l.jsx("p",{className:"welcome-step-text",children:"Then start an agent session in it."})]})]})]}),l.jsxs("p",{className:"welcome-tip",children:["Later: right-click a workspace to import its Claude Code sessions, and press ",l.jsx("kbd",{children:VT})," for the command palette."]})]})})}const GT=[],cl=50;function qT(){Lt.trackRender("RenderArea");const t=A(S=>S.activeSessionId),n=A(S=>S.activeSessionId?S.sessionDetails[S.activeSessionId]:null),r=A(S=>S.submittingPrompt),o=A(S=>S.loading),a=A(S=>!S.activeSessionId&&!Rb(S.workspaces,S.sessions,S.appsRootPath)),c=(n==null?void 0:n.turns)??[],d=(n==null?void 0:n.threads)??GT,p=x.useRef(null),[g,m]=x.useState(cl);x.useEffect(()=>{m(cl)},[t]);const v=c.filter(S=>!S.thread_id),k=Math.max(0,v.length-g),y=v.slice(k);return x.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[t,c.length]),o&&!n?l.jsx("div",{className:"render-scroll",children:l.jsxs("div",{className:"skeleton-bars",children:[l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"}),l.jsx("div",{className:"skeleton-bar"})]})}):n?l.jsxs("div",{className:"render-scroll",ref:p,children:[r&&l.jsx("div",{className:"turn-block",children:l.jsxs("div",{className:"turn-group",children:[l.jsxs("div",{className:"render-content",children:[l.jsxs("div",{className:"turn-header",children:[l.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),l.jsx("span",{className:"turn-header-title",children:"You"})]}),l.jsx("p",{className:"user-message",children:r})]}),l.jsx("div",{className:"render-content",children:l.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),c.length===0&&!r&&l.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),k>0&&l.jsx("div",{className:"render-load-earlier",children:l.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>m(S=>S+cl),children:["Show ",Math.min(cl,k)," earlier turns (",k," hidden)"]})}),y.map((S,C)=>l.jsx("div",{id:`turn-${k+C}`,className:"turn-block",children:l.jsx(HT,{turn:S,runtimeType:n.runtime_type,threads:d})},S.id))]}):a?l.jsx(KT,{}):l.jsx("div",{className:"render-scroll",children:l.jsx("div",{className:"empty-state",children:"No session selected"})})}const XT=x.memo(qT),YT=[{id:"model",label:"/model",hint:"Change model",capability:"dynamicModels"},{id:"sandbox",label:"/sandbox",hint:"Sandbox mode",capability:"sandbox",subPopup:"sandbox"},{id:"websearch",label:"/websearch",hint:"Web search mode",capability:"webSearch",subPopup:"websearch"},{id:"network",label:"/network",hint:"Network access",capability:"networkAccess",subPopup:"network"},{id:"skills",label:"/skills",hint:"Browse skills",capability:"skills"},{id:"plugins",label:"/plugins",hint:"Browse plugins",capability:"plugins"},{id:"mcp",label:"/mcp",hint:"Browse MCP servers",capability:"mcpServers"}];function QT(t){return t.map(n=>({id:n.name,label:`/${n.name}`,hint:n.description,capability:null,insertAsText:!0}))}function ZT(t,n,r=[]){const o=[...YT,...QT(r)],a=new Set;return o.filter(c=>!(a.has(c.label)||(a.add(c.label),c.capability&&!n[c.capability])||t&&!c.label.toLowerCase().includes(t.toLowerCase())))}function JT({commands:t,selectedIndex:n,onSelect:r,onHover:o}){return l.jsxs("div",{className:"slash-popup",children:[l.jsx("div",{className:"slash-popup-header",children:"Commands"}),t.length===0&&l.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),t.map((a,c)=>l.jsxs("div",{className:`slash-popup-item ${c===n?"selected":""}`,onMouseEnter:()=>o(c),onClick:()=>r(a),children:[l.jsx("span",{className:"slash-popup-label",children:a.label}),l.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function ad({title:t,options:n,currentValue:r,onSelect:o,onClose:a}){return l.jsxs("div",{className:"slash-popup",children:[l.jsxs("div",{className:"slash-popup-header",children:[l.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),l.jsx("span",{children:t})]}),n.map(c=>l.jsxs("div",{className:`slash-popup-item ${c.value===r?"selected":""}`,onClick:()=>o(c.value),children:[l.jsxs("div",{className:"slash-popup-item-main",children:[l.jsx("span",{className:"slash-popup-label",children:c.label}),c.description&&l.jsx("span",{className:"slash-popup-hint",children:c.description})]}),c.value===r&&l.jsx("span",{className:"slash-popup-check",children:"✓"})]},c.value))]})}function eC(t){return Et("/skills")}function tC({filter:t,onSelect:n,onClose:r}){const[o,a]=x.useState([]),[c,d]=x.useState(!0),[p,g]=x.useState(0),m=x.useRef(null);x.useEffect(()=>{eC().then(a).catch(()=>a([])).finally(()=>d(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(t.toLowerCase())||k.description.toLowerCase().includes(t.toLowerCase()));return x.useEffect(()=>{g(0)},[t]),x.useEffect(()=>{function k(y){y.key==="ArrowDown"?(y.preventDefault(),g(S=>Math.min(S+1,v.length-1))):y.key==="ArrowUp"?(y.preventDefault(),g(S=>Math.max(S-1,0))):y.key==="Enter"?(y.preventDefault(),v[p]&&n(v[p])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,p,n,r]),l.jsxs("div",{className:"slash-popup",ref:m,children:[l.jsxs("div",{className:"slash-popup-header",children:[l.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),l.jsx("span",{children:"Skills"})]}),c&&l.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!c&&v.length===0&&l.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,y)=>l.jsxs("div",{className:`slash-popup-item ${y===p?"selected":""}`,onMouseEnter:()=>g(y),onClick:()=>n(k),children:[l.jsxs("div",{className:"slash-popup-item-main",children:[l.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&l.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&l.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function Fy(){return Et("/providers")}function nC(t,n){const r=n?`?cwd=${encodeURIComponent(n)}`:"";return Et(`/providers/${t}/commands${r}`)}const sC={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function rC(t){const[n,r]=x.useState([]),[o,a]=x.useState(!0);x.useEffect(()=>{Fy().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const c=n.find(d=>d.id===t)??null;return{provider:c,capabilities:(c==null?void 0:c.capabilities)??sC,loading:o}}const xo=32,ld=200;function Sg(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function bg(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}let Ng=0;function oC(){return Ng+=1,`att-${Date.now()}-${Ng}`}function iC(){Lt.trackRender("CommandInputBar");const[t,n]=x.useState(""),r=x.useRef(null),o=x.useRef(xo),a=x.useRef(null),{submitPrompt:c,cancelTurn:d,updateRuntimeConfig:p,setShowModelSelector:g}=A(),m=A(Y=>Y.activeSessionId),v=A(Y=>Y.activeSessionId?Y.sessionDetails[Y.activeSessionId]:null),k=A(Y=>Y.quotedText),y=lv(v),S=!!(v!=null&&v.turns.some(Y=>Y.status==="pending"&&Y.resume_state==="waiting")),C=!m,{capabilities:b}=rC(v==null?void 0:v.runtime_type),N=(v==null?void 0:v.runtime_type)??null,E=b.imageAttachments,[R,z]=x.useState([]),[I,L]=x.useState(!1),[q,K]=x.useState(null),[$,Z]=x.useState([]);x.useEffect(()=>{if(!N){Z([]);return}let Y=!1;return nC(N,(v==null?void 0:v.cwd)??void 0).then(ge=>{Y||Z(ge)}).catch(()=>{Y||Z([])}),()=>{Y=!0}},[N,v==null?void 0:v.cwd]);const[he,ce]=x.useState(!1),[ye,Se]=x.useState(""),[Oe,J]=x.useState(0),[re,oe]=x.useState(void 0),[F,Q]=x.useState(!1),[G,D]=x.useState(""),[P,le]=x.useState([]),W=he?ZT(ye,b,$):[];x.useEffect(()=>{k!==null&&(n(Y=>Y+k),setTimeout(()=>{if(r.current){pe(),r.current.focus();const Y=r.current.value.length;r.current.setSelectionRange(Y,Y)}},0),A.setState({quotedText:null}))},[k]),x.useEffect(()=>{if(!y)return;function Y(ge){ge.key==="Escape"&&(ge.preventDefault(),d())}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[y,d]),x.useEffect(()=>{ce(!1),oe(void 0),Q(!1),le([]),z(Y=>{for(const ge of Y)ge.previewUrl&&URL.revokeObjectURL(ge.previewUrl);return[]})},[m]),x.useEffect(()=>{if(!q)return;function Y(ge){ge.key==="Escape"&&(ge.preventDefault(),K(null))}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[q]);const X=x.useCallback(Y=>{if(!Y)return;const ge=Array.from(Y);for(const Be of ge){const st=new FileReader;st.onload=()=>{const vt=st.result.split(",")[1]??"",_t=Be.type.startsWith("image/")?URL.createObjectURL(Be):void 0;z(an=>[...an,{id:oC(),name:Be.name,media_type:Be.type||"application/octet-stream",data:vt,previewUrl:_t,size:Be.size}])},st.readAsDataURL(Be)}},[]),ae=x.useCallback(Y=>{z(ge=>{const Be=ge.find(st=>st.id===Y);return Be!=null&&Be.previewUrl&&URL.revokeObjectURL(Be.previewUrl),ge.filter(st=>st.id!==Y)})},[]),be=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),!(!E||y)&&L(!0)},[E,y]),_e=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),L(!1)},[]),Ae=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),L(!1),!(!E||y)&&X(Y.dataTransfer.files)},[E,y,X]),je=x.useCallback(Y=>{var st;if(!E)return;const ge=(st=Y.clipboardData)==null?void 0:st.items;if(!ge)return;const Be=[];for(let gt=0;gt<ge.length;gt++){const vt=ge[gt];if(vt.type.startsWith("image/")){const _t=vt.getAsFile();_t&&Be.push(_t)}}Be.length>0&&(Y.preventDefault(),X(Be))},[E,X]);function me(Y){const ge=r.current;ge&&(ge.style.height=`${Y}px`,o.current=Y)}function pe(){const Y=r.current;if(Y){if(Y.scrollHeight>Y.clientHeight){const ge=Math.min(Y.scrollHeight,ld);ge!==o.current&&me(ge);return}o.current>xo&&(Y.style.height="auto",me(Math.min(Y.scrollHeight,ld)))}}function Ve(){const Y=t.trim();if(!Y||y)return;let ge=Y;P.length>0&&(ge=`${P.map(gt=>`$${gt.name}`).join(" ")}
|
|
673
|
-
|
|
674
|
-
${Y}`);const Be=R.map(({id:st,previewUrl:gt,size:vt,..._t})=>_t);n(""),le([]),me(xo),ce(!1),oe(void 0),Q(!1);for(const st of R)st.previewUrl&&URL.revokeObjectURL(st.previewUrl);z([]),c(ge,Be.length>0?Be:void 0)}function Ie(Y){if(Y.insertAsText){const ge=`/${Y.id} `;n(ge),ce(!1),oe(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Be=ge.length;r.current.setSelectionRange(Be,Be),pe()}});return}Y.subPopup?oe(Y.subPopup):Y.id==="skills"?(Q(!0),D(""),ce(!1),n("")):Y.id==="model"?(g(!0),ce(!1),n("")):(ce(!1),n(""))}function mt(Y){le(ge=>[...ge,Y]),Q(!1),n(""),me(xo)}function Ue(Y){const ge=Sg(v==null?void 0:v.runtime_config);re==="sandbox"?ge.sandboxMode=Y:re==="websearch"?ge.webSearchMode=Y:re==="network"&&(ge.networkAccessEnabled=Y==="true"),p(ge),oe(void 0),ce(!1),n(""),me(xo)}function Vt(Y){if(Lt.markKeystroke(),he&&!re){if(Y.key==="ArrowDown"){Y.preventDefault(),J(ge=>Math.min(ge+1,W.length-1));return}if(Y.key==="ArrowUp"){Y.preventDefault(),J(ge=>Math.max(ge-1,0));return}if(Y.key==="Enter"){Y.preventDefault(),W[Oe]&&Ie(W[Oe]);return}if(Y.key==="Escape"){Y.preventDefault(),ce(!1),n("");return}}if(re&&Y.key==="Escape"){Y.preventDefault(),oe(void 0);return}if(Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&!y){Y.preventDefault(),Ve();return}Y.key==="Escape"&&y&&(Y.preventDefault(),d())}function tn(Y){Lt.markInputChange();const ge=Y.target.value;n(ge),pe(),ge.startsWith("/")&&!ge.includes(" ")&&!y?(ce(!0),Se(ge.slice(1)),J(0)):(ce(!1),oe(void 0)),ge.startsWith("$")&&!y?(Q(!0),D(ge.slice(1))):ge.startsWith("$")||Q(!1)}const kt=Sg(v==null?void 0:v.runtime_config),jt=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],Ft=[{value:"disabled",label:"Disabled",description:"No web search"},{value:"cached",label:"Cached",description:"Use cached search results"},{value:"live",label:"Live",description:"Perform live web searches"}],Ot=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return l.jsxs("div",{className:`cmd-bar${I?" drag-over":""}`,onDragOver:be,onDragLeave:_e,onDrop:Ae,children:[he&&!re&&l.jsx(JT,{commands:W,selectedIndex:Oe,onSelect:Ie,onHover:J}),he&&re==="sandbox"&&l.jsx(ad,{title:"Sandbox Mode",options:jt,currentValue:kt.sandboxMode,onSelect:Ue,onClose:()=>oe(void 0)}),he&&re==="websearch"&&l.jsx(ad,{title:"Web Search",options:Ft,currentValue:kt.webSearchMode,onSelect:Ue,onClose:()=>oe(void 0)}),he&&re==="network"&&l.jsx(ad,{title:"Network Access",options:Ot,currentValue:kt.networkAccessEnabled===!0?"true":"false",onSelect:Ue,onClose:()=>oe(void 0)}),F&&l.jsx(tC,{filter:G,onSelect:mt,onClose:()=>{Q(!1),n("")}}),P.length>0&&l.jsx("div",{className:"skill-badges",children:P.map(Y=>l.jsxs("span",{className:"skill-badge",children:["$",Y.name,l.jsx("button",{className:"skill-badge-remove",onClick:()=>le(ge=>ge.filter(Be=>Be.id!==Y.id)),children:"×"})]},Y.id))}),R.length>0&&l.jsx("div",{className:"attachment-preview-area",children:R.map(Y=>l.jsxs("div",{className:"attachment-chip",title:Y.name,children:[Y.previewUrl?l.jsx("img",{src:Y.previewUrl,alt:Y.name,className:"attachment-thumb",onClick:()=>K(Y),style:{cursor:"pointer"}}):l.jsx(_v,{size:20,className:"attachment-file-icon"}),l.jsxs("div",{className:"attachment-info",children:[l.jsx("span",{className:"attachment-name",children:Y.name}),l.jsx("span",{className:"attachment-size",children:bg(Y.size)})]}),l.jsx("button",{className:"attachment-remove",onClick:()=>ae(Y.id),title:"Remove attachment",children:l.jsx(Tn,{size:14})})]},Y.id))}),E&&!y&&!C&&l.jsx("input",{ref:a,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:Y=>{X(Y.target.files),Y.target.value=""}}),l.jsxs("div",{className:"cmd-input-row",children:[E&&!y&&!C&&l.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var Y;return(Y=a.current)==null?void 0:Y.click()},title:"Attach files",disabled:y,children:l.jsx(b1,{size:16})}),l.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:C?"Select or create a session…":S?"Interrupted — waiting to resume…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:t,disabled:y||C,rows:1,style:{minHeight:xo,maxHeight:ld},onChange:tn,onKeyDown:Vt,onPaste:je}),y?l.jsx("button",{className:"cmd-stop-btn",onClick:()=>d(),title:"Stop (Esc)",children:l.jsx(Ur,{size:15})}):l.jsx("button",{className:"cmd-send-btn",onClick:Ve,disabled:!t.trim()||C,title:"Send (⌘↵)",children:l.jsx(Cv,{size:16})})]}),q&&l.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:l.jsxs("div",{className:"image-preview-content",onClick:Y=>Y.stopPropagation(),children:[l.jsx("img",{src:q.previewUrl,alt:q.name}),l.jsxs("div",{className:"image-preview-info",children:[l.jsx("span",{children:q.name}),l.jsx("span",{children:bg(q.size)})]}),l.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:l.jsx(Tn,{size:20})})]})})]})}function aC(){const t=A(N=>N.activeSessionId),n=A(N=>N.activeSessionId?N.sessionDetails[N.activeSessionId]:null),r=A(N=>N.activeTurnIndex),o=A(N=>N.setActiveTurnIndex),a=A(N=>N.rewindToTurn),c=A(N=>N.restoreSession),d=A(N=>N.branchFromTurn),p=(n==null?void 0:n.turns)??[],g=Vl(n),m=!!(n!=null&&n.rewound_at_turn_id),v=(n==null?void 0:n.runtime_type)==="repoburg",k=v?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[y,S]=x.useState(null),C=x.useRef(null);if(Wi(C,()=>S(null),!!y),Io(()=>S(null),!!y),p.length===0)return l.jsx("div",{className:"empty-state",children:"No turns yet"});function b(N){o(N),requestAnimationFrame(()=>{var E;(E=document.getElementById(`turn-${N}`))==null||E.scrollIntoView({behavior:"smooth",block:"start"})})}return l.jsxs("div",{className:"right-section",children:[l.jsx("div",{className:"right-section-title",children:"Conversation"}),p.map((N,E)=>{const R=E===r,z=N.user_prompt.length>50?N.user_prompt.slice(0,50)+"…":N.user_prompt,I=N.status==="running"||N.status==="pending";return l.jsx("div",{children:l.jsxs("div",{className:`turn-item ${R?"active":""}`,onClick:()=>b(E),onContextMenu:L=>{L.preventDefault(),S({x:L.clientX,y:L.clientY,turnId:N.id,turnIndex:E,isLast:E===p.length-1,isSlashCommand:N.user_prompt.trimStart().startsWith("/")})},children:[l.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:l.jsx(I1,{size:12})}),l.jsx("span",{className:"turn-item-label",children:z}),I&&l.jsx("span",{className:"turn-item-status",children:N.status==="pending"&&N.resume_state==="waiting"?"interrupted":"running…"})]})},N.id)}),y&&l.jsxs("div",{ref:C,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[l.jsxs("div",{className:`ctx-menu-item ${y.isLast||g||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||g||y.isSlashCommand||(window.confirm(k)&&a(t,y.turnId),S(null))},children:[l.jsx(C1,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),m&&!v&&l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{c(t),S(null)},children:[l.jsx(Pi,{size:12})," Restore Rewind"]}),l.jsxs("div",{className:"ctx-menu-item",onClick:()=>{d(t,y.turnId),S(null)},children:[l.jsx(Av,{size:12})," Branch from Here"]})]})]})}function yf(t){return(t??[]).filter(n=>n.task_type!=="local_agent").length}const Tg=2e4;function lC(t){const n=[];return t.forEach((r,o)=>{var a;for(const c of r.items)if(c.type==="background_task"){if((((a=c.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;n.push({item:c,turnIndex:o,turnPrompt:r.user_prompt})}}),n}function cC({entry:t}){const{item:n,turnIndex:r,turnPrompt:o}=t,a=n.data||{},c=a.task_type||"unknown",d=a.subagent_type||null,p=a.description||"",g=a.summary||null,m=a.last_tool_name||null,v=a.token_count||null,k=a.output||"",y=n.status==="in_progress",S=a.status||"running",C=!y&&S==="running"?"stopped":S,b=c==="local_agent",N=c==="local_bash",E=b?gr:N?Pv:Ev,R=b?`Subagent${d?`: ${d}`:""}`:N?"Monitor":"Background Task",z=C==="running"?"running…":C==="completed"?"done":C==="failed"?"failed":C==="stopped"?"stopped":C,I=C==="failed"||n.status==="failed"&&C!=="stopped",[L,q]=x.useState(y),[K,$]=x.useState(!1),Z=x.useRef(null);x.useEffect(()=>{y&&q(!0)},[y]),x.useEffect(()=>{L&&y&&Z.current&&(Z.current.scrollTop=Z.current.scrollHeight)},[L,y,k]);const he=k.length>Tg,ce=he&&!K?k.slice(0,Tg)+`
|
|
675
|
-
… (truncated, click to expand)`:k,ye=y?null:C==="completed"?l.jsx(Cs,{size:12}):I?l.jsx(Xl,{size:12}):l.jsx(Ur,{size:12});return l.jsxs("div",{className:`task-card ${y?"task-running":""} ${I?"task-failed":""}`,children:[l.jsxs("div",{className:"task-card-header",onClick:()=>q(Se=>!Se),style:{cursor:"pointer"},children:[l.jsx("span",{className:"task-card-icon",children:l.jsx(E,{size:14})}),l.jsx("span",{className:"task-card-type",children:R}),l.jsxs("span",{className:`task-card-status ${I?"task-status-failed":y?"task-status-running":"task-status-done"}`,children:[ye," ",z]}),l.jsx(Li,{size:14,className:"task-card-chevron",style:{transform:L?"rotate(90deg)":"none",marginLeft:"auto"}})]}),p&&l.jsx("div",{className:"task-card-desc",children:p}),y&&m&&l.jsxs("div",{className:"task-card-meta",children:["last tool: ",m,v!=null&&` · ${v.toLocaleString()} tokens`]}),L&&l.jsxs("div",{className:"task-card-body",children:[k?l.jsxs(l.Fragment,{children:[l.jsx("pre",{className:"cmd-output task-output",ref:Z,children:l.jsx("code",{children:ce})}),he&&l.jsx("button",{className:"cmd-output-toggle",onClick:()=>$(Se=>!Se),children:K?"Show less":`Show full output (${(k.length/1024).toFixed(0)}KB)`})]}):g?l.jsx("pre",{className:"cmd-output task-output",children:l.jsx("code",{children:g})}):y?l.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):l.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),l.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const uC=x.memo(cC);function dC(){const t=A(d=>d.activeSessionId?d.sessionDetails[d.activeSessionId]:null),n=A(d=>d.activeSessionId?d.backgroundTasks[d.activeSessionId]:void 0),r=(t==null?void 0:t.turns)??[],o=lC(r),a=[...o].sort((d,p)=>{const g=d.item.status==="in_progress",m=p.item.status==="in_progress";return g&&!m?-1:!g&&m?1:p.turnIndex-d.turnIndex}),c=yf(n);return o.length===0?l.jsx("div",{className:"empty-state",children:"No background tasks yet"}):l.jsxs("div",{className:"right-section",children:[l.jsxs("div",{className:"right-section-title",children:["Background Tasks (",o.length,")",c>0&&l.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",c," running"]})]}),a.map(d=>l.jsx(uC,{entry:d},d.item.id))]})}const fC=x.memo(dC),pC="Your job is to answer questions about this session:",Cg="Understand the user's question below, read the session file given above, and answer.",hC=new Set(["claude"]);function mC(t){return hC.has(t)}function xf(t){return t.kind==="sidecar"}function gC(t){const n=(t??[]).filter(xf);return n.length?n[n.length-1]:null}function vC(t){if(!t.startsWith(pC))return t;const n=t.indexOf(Cg);return n<0?t:t.slice(n+Cg.length).replace(/^\n+/,"")}function yC({thread:t,onClose:n}){const{activeSessionId:r,resolveThread:o,shareThread:a}=A(),[c,d]=x.useState(""),[p,g]=x.useState(!1),[m,v]=x.useState(!1);async function k(){if(!r||p)return;g(!0),await a(r,t.id,c)?n():g(!1)}async function y(){!r||m||(v(!0),await o(r,t.id),n())}const S=p||m;return l.jsx("div",{className:"dialog-overlay",onClick:S?void 0:n,children:l.jsxs("div",{className:"dialog",onClick:C=>C.stopPropagation(),children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Resolve thread"}),l.jsx("button",{className:"dialog-close",onClick:n,disabled:S,children:l.jsx(Tn,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),l.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",l.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:c,onChange:C=>d(C.target.value),rows:3,disabled:S,autoFocus:!0})]})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:n,disabled:S,children:"Cancel"}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:S,title:"Resolve without sharing",children:[m?l.jsx(hn,{size:13,className:"spin"}):l.jsx(jl,{size:13}),"Resolve only"]}),l.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:S,children:[p?l.jsx(hn,{size:13,className:"spin"}):l.jsx(_1,{size:13}),p?"Summarizing…":"Share & Resolve"]})]})]})})}const Eg=[];Ge.setOptions({breaks:!0,gfm:!0});function xC(t){const n=Ge.parse(t);return vf.sanitize(n)}function wC(t){var n,r,o;if(t.type==="agent_message"||t.type==="final_result"){const a=(n=t.data)==null?void 0:n.text;return typeof a=="string"&&a?a:null}if(t.type==="ask_user"){const a=Array.isArray((r=t.data)==null?void 0:r.groups)?t.data.groups:[],c=[(o=t.data)==null?void 0:o.question,...a.map(d=>d.question)].filter(d=>typeof d=="string"&&!!d);return c.length?c.join(`
|
|
676
|
-
|
|
677
|
-
`):null}return null}function kC(t){const n=t.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return n?n[1]:t}function Uy({turn:t,formatPrompt:n=kC}){const r=n(t.user_prompt),o=t.items.map(wC).filter(a=>a!==null);return o.length===0&&t.status==="completed"&&t.agent_response&&o.push(t.agent_response),l.jsxs("div",{className:"thread-card-turn",children:[l.jsx("div",{className:"thread-card-user-message",children:r}),o.map((a,c)=>l.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:xC(a)}},c)),o.length===0&&(t.status==="pending"||t.status==="running")&&l.jsx("div",{className:"thread-card-pending",children:t.status==="running"?"AI is responding…":"Waiting…"}),t.status==="failed"&&l.jsx("div",{className:"thread-card-pending",children:t.error||"Turn failed"})]})}function SC({thread:t,threadTurns:n,onStop:r,onResolve:o,onReopen:a,onDelete:c,onFollowup:d,onLocate:p}){var Se,Oe,J;const[g,m]=x.useState(""),[v,k]=x.useState(!0),y=x.useRef(null),S=x.useRef(null),[C,b]=x.useState(!1),[N,E]=x.useState({x:0,y:0}),[R,z]=x.useState(""),I=n.some(Fs),L=28,q=120,K=x.useRef(L);x.useEffect(()=>{const re=S.current;re&&(re.scrollTop=re.scrollHeight)},[n.length,v]);function $(re){const oe=y.current;oe&&(oe.style.height=`${re}px`,K.current=re)}function Z(){const re=y.current;if(re){if(re.scrollHeight>re.clientHeight){const oe=Math.min(re.scrollHeight,q);oe!==K.current&&$(oe);return}K.current>L&&(re.style.height="auto",$(Math.min(re.scrollHeight,q)))}}const he=x.useCallback(()=>{b(!1)},[]),ce=x.useCallback(()=>{const re=S.current;if(!re)return;const oe=window.getSelection();if(!oe||oe.rangeCount===0||oe.isCollapsed){b(!1);return}const F=oe.getRangeAt(0);if(!re.contains(F.commonAncestorContainer)){b(!1);return}const Q=F.commonAncestorContainer.nodeType===Node.TEXT_NODE?F.commonAncestorContainer.parentElement:F.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){b(!1);return}const G=oe.toString();if(!G.trim()){b(!1);return}const D=F.getBoundingClientRect(),P=28,le=6,W=170;let X=!1;if(oe.anchorNode&&oe.focusNode)try{const _e=document.createRange();_e.setStart(oe.focusNode,oe.focusOffset),_e.setEnd(oe.focusNode,oe.focusOffset);const Ae=document.createRange();Ae.setStart(oe.anchorNode,oe.anchorOffset),Ae.setEnd(oe.anchorNode,oe.anchorOffset),X=Ae.compareBoundaryPoints(Range.START_TO_START,_e)>0}catch{X=!1}let ae=D.top-P-le;ae<8&&(ae=D.bottom+le);let be=X?D.left-W:D.right;be=Math.max(8,Math.min(be,window.innerWidth-W-8)),E({x:be,y:ae}),z(G),b(!0)},[]);x.useEffect(()=>{function re(oe){const F=oe.target;F&&F.closest(".selection-actions")||ce()}return document.addEventListener("mouseup",re),()=>document.removeEventListener("mouseup",re)},[ce]);const ye=x.useCallback(()=>{var oe;const re=`
|
|
678
|
-
\`\`\`QUOTE
|
|
679
|
-
${R}
|
|
680
|
-
\`\`\`
|
|
681
|
-
|
|
682
|
-
`;m(F=>F+re),b(!1),z(""),(oe=window.getSelection())==null||oe.removeAllRanges(),setTimeout(()=>{if(y.current){Z(),y.current.focus();const F=y.current.value.length;y.current.setSelectionRange(F,F)}},0)},[R]);return l.jsxs("div",{className:`thread-card ${t.status==="resolved"?"thread-resolved":""}`,id:`thread-${t.id}`,children:[l.jsxs("div",{className:"thread-card-header",onClick:()=>k(re=>!re),children:[l.jsx("div",{className:"thread-card-quote",children:t.selected_text===null?((J=(Oe=(Se=t.turns)==null?void 0:Se[0])==null?void 0:Oe.user_prompt)==null?void 0:J.slice(0,100))||"Quick question":`“${t.selected_text.slice(0,100)}${t.selected_text.length>100?"…":""}”`}),l.jsxs("div",{className:"thread-card-header-right",children:[t.selected_text!==null&&l.jsx("button",{className:"thread-locate-btn",onClick:re=>{re.stopPropagation(),p()},title:"Scroll to text",children:l.jsx(x1,{size:12})}),l.jsx("span",{className:`thread-status-badge ${t.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:t.status==="open"?"Open":"Resolved"})]})]}),v&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"thread-card-conversation",ref:S,onMouseDown:he,children:[n.map(re=>l.jsx(Uy,{turn:re},re.id)),n.length===0&&l.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),C&&l.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:l.jsxs("button",{className:"discuss-button",onClick:ye,title:"Quote this text in your follow-up",children:[l.jsx(Lv,{size:14}),l.jsx("span",{children:"Quote"})]})}),t.status==="open"&&l.jsxs("div",{className:"thread-card-followup",children:[l.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:I?"Agent is running…":"Type a follow-up…",value:g,onChange:re=>{Lt.markInputChange(),m(re.target.value),Z()},disabled:I,rows:1,style:{minHeight:L,maxHeight:q},onKeyDown:re=>{Lt.markKeystroke(),re.key==="Enter"&&(re.metaKey||re.ctrlKey)&&!I&&g.trim()&&(re.preventDefault(),d(g.trim()),m(""),$(L))}}),l.jsx("button",{className:"thread-card-followup-send",disabled:I||!g.trim(),onClick:()=>{d(g.trim()),m("")},children:l.jsx(Hi,{size:13})}),I&&l.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:l.jsx(Ur,{size:13})})]}),l.jsxs("div",{className:"thread-card-actions",children:[t.status==="open"?l.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[l.jsx(jl,{size:13})," Resolve"]}):l.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[l.jsx(Pi,{size:13})," Reopen"]}),l.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:c,title:"Delete thread",children:[l.jsx(us,{size:13})," Delete"]})]})]})]})}function bC(){Lt.trackRender("ThreadsPanel");const t=A(E=>E.activeSessionId),n=A(E=>{var R;return E.activeSessionId?((R=E.sessionDetails[E.activeSessionId])==null?void 0:R.threads)??Eg:Eg}),r=x.useMemo(()=>n.filter(E=>!xf(E)),[n]),o=A(E=>E.followupThread),a=A(E=>E.cancelThreadTurn),c=A(E=>E.reopenThread),d=A(E=>E.deleteThread),p=A(E=>E.deepLinkThreadId),g=A(E=>E.setDeepLinkThreadId),[m,v]=x.useState("open"),[k,y]=x.useState(null);x.useEffect(()=>{if(!p)return;const E=p;g(null),v(z=>r.some(I=>I.id===E&&I.status==="open")?z:"all");const R=setTimeout(()=>{const z=document.getElementById(`thread-${E}`);z&&(z.scrollIntoView({behavior:"smooth",block:"center"}),z.classList.add("thread-card-highlighted"),setTimeout(()=>z.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(R)},[p,g,r]);const S=r.filter(E=>m==="open"?E.status==="open":m==="resolved"?E.status==="resolved":!0),C=r.filter(E=>E.status==="open").length,b=r.filter(E=>E.status==="resolved").length;function N(E){setTimeout(()=>{const R=document.querySelector(`mark[data-thread-id="${E}"]`);R&&(R.scrollIntoView({behavior:"smooth",block:"center"}),R.classList.add("thread-mark-flash"),setTimeout(()=>R.classList.remove("thread-mark-flash"),1500))},50)}return t?r.length===0?l.jsxs("div",{className:"empty-state",children:[l.jsx(Mv,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsx("div",{children:"No threads yet."}),l.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):l.jsxs("div",{children:[l.jsxs("div",{className:"thread-filter-tabs",children:[l.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",C,")"]}),l.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",b,")"]}),l.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",r.length,")"]})]}),S.length===0?l.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):S.map(E=>l.jsx(SC,{thread:E,threadTurns:E.turns??[],onStop:()=>a(t,E.id),onResolve:()=>y(E),onReopen:()=>c(t,E.id),onDelete:()=>d(t,E.id),onFollowup:R=>o(t,E.id,R),onLocate:()=>N(E.id)},E.id)),k&&l.jsx(yC,{thread:k,onClose:()=>y(null)})]}):l.jsx("div",{className:"empty-state",children:"No session selected"})}function NC(){const t=A(d=>d.apps),n=A(d=>d.activeAppTabId),r=A(d=>d.openAppTab),o=A(d=>d.startAppEdit),a=A(d=>d.toggleAppPin),c=A(d=>d.deleteApp);return t.length===0?l.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):l.jsx("div",{className:"apps-panel",children:t.map(d=>l.jsxs("div",{className:`apps-panel-row${n===d.id?" active":""}`,onClick:()=>r(d.id),title:d.description??void 0,children:[l.jsx(Do,{iconNode:d.iconNode,size:14,className:"sidebar-app-icon"}),l.jsxs("div",{className:"apps-panel-info",children:[l.jsx("span",{className:"apps-panel-title",children:d.title}),d.description&&l.jsx("span",{className:"apps-panel-desc",children:d.description})]}),l.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:p=>{p.stopPropagation(),o(d.id)},children:l.jsx(hl,{size:12})}),l.jsx("button",{className:`apps-panel-action${d.pinned?" pinned":""}`,title:d.pinned?"Unpin app":"Pin app (sorts first)",onClick:p=>{p.stopPropagation(),a(d.id)},children:l.jsx(Rl,{size:12,fill:d.pinned?"currentColor":"none"})}),l.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:p=>{p.stopPropagation(),c(d.id)},children:l.jsx(us,{size:12})})]},d.id))})}const TC=24;function CC(){Lt.trackRender("SidecarPanel");const t=A(E=>E.activeSessionId),n=A(E=>{var R;return E.activeSessionId?(R=E.sessionDetails[E.activeSessionId])==null?void 0:R.runtime_type:void 0}),r=A(E=>{var R;return E.activeSessionId?gC((R=E.sessionDetails[E.activeSessionId])==null?void 0:R.threads):null}),o=A(E=>E.askSidecar),a=A(E=>E.cancelThreadTurn),c=A(E=>E.deleteThread),[d,p]=x.useState(""),[g,m]=x.useState(!1),v=x.useRef(null),k=x.useRef(!0),y=(r==null?void 0:r.turns)??[],S=y[y.length-1],C=y.some(Fs);if(x.useEffect(()=>{k.current=!0},[t,y.length]),x.useEffect(()=>{const E=v.current;E&&k.current&&(E.scrollTop=E.scrollHeight)},[t,y.length,S==null?void 0:S.items.length,S==null?void 0:S.status]),!t||!n)return l.jsx("div",{className:"empty-state",children:"No session selected"});if(!mC(n))return l.jsxs("div",{className:"empty-state",children:[l.jsx(gr,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsxs("div",{children:["The sidecar is not available for ",n," sessions yet."]})]});const b=!C&&!g&&d.trim().length>0;async function N(){if(!t||!b)return;m(!0);const E=await o(t,d.trim());m(!1),E&&p("")}return l.jsxs("div",{className:"sidecar-panel",children:[l.jsx("div",{ref:v,className:"sidecar-conversation",onScroll:E=>{const R=E.currentTarget;k.current=R.scrollHeight-R.scrollTop-R.clientHeight<=TC},children:y.length===0?l.jsxs("div",{className:"empty-state",children:[l.jsx(gr,{size:24,style:{opacity:.3,marginBottom:8}}),l.jsx("div",{children:"Ask about this session."}),l.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):y.map(E=>l.jsx(Uy,{turn:E,formatPrompt:vC},E.id))}),l.jsxs("div",{className:"sidecar-footer",children:[l.jsxs("div",{className:"thread-card-followup",children:[l.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:C?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:d,rows:2,disabled:C,onChange:E=>{Lt.markInputChange(),p(E.target.value)},onKeyDown:E=>{Lt.markKeystroke(),E.key==="Enter"&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),N())}}),C&&r?l.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>a(t,r.id),children:l.jsx(Ur,{size:13})}):l.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!b,onClick:()=>void N(),children:l.jsx(Hi,{size:13})})]}),r&&l.jsx("div",{className:"thread-card-actions",children:l.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:C,onClick:()=>c(t,r.id),children:[l.jsx(us,{size:13})," Clear"]})})]})]})}function EC(){var g;Lt.trackRender("RightPanel");const t=A(m=>m.activeRightTab),n=A(m=>m.switchRightTab),r=A(m=>m.rightPanelCollapsed),o=A(m=>m.toggleRightPanel),a=A(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),c=A(m=>m.activeSessionId?yf(m.backgroundTasks[m.activeSessionId]):0),d=((g=a==null?void 0:a.threads)==null?void 0:g.filter(m=>m.status==="open"&&!xf(m)).length)??0,p=[{id:"turns",label:"Turns",icon:p1},{id:"sidecar",label:"Sidecar",icon:gr},{id:"tasks",label:"Tasks",icon:f1,badge:c||void 0},{id:"threads",label:"Threads",icon:Mv,badge:d||void 0},{id:"apps",label:"Apps",icon:Dv}];return r?l.jsxs("div",{className:"ide-right collapsed",children:[l.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:l.jsx(k1,{size:15})}),l.jsx("div",{className:"right-rail-divider"}),p.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return l.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${t===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>n(m.id),children:[l.jsx(v,{size:15}),m.badge?l.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):l.jsxs("div",{className:"ide-right",children:[l.jsxs("div",{className:"right-header",children:[l.jsx("div",{className:"right-tabs",children:p.map(m=>l.jsxs("div",{className:`right-tab ${t===m.id?"active":""}`,onClick:()=>n(m.id),children:[m.label,m.badge?l.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),l.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:l.jsx(w1,{size:14})})]}),l.jsxs("div",{className:"right-content",children:[t==="turns"&&l.jsx(aC,{}),t==="sidecar"&&l.jsx(CC,{}),t==="tasks"&&l.jsx(fC,{}),t==="threads"&&l.jsx(bC,{}),t==="apps"&&l.jsx(NC,{})]})]})}const De={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Ad=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max,De.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max,De.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high,De.xhigh,De.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[De.low,De.medium,De.high]}]}];function jC(t){return Ad.find(n=>n.id===t)}function wf(t){const n=jC(t);return(n==null?void 0:n.models)??[]}function By(t,n){return wf(t).find(r=>r.slug===n)}function Id(t,n){var r;return((r=By(t,n))==null?void 0:r.reasoningLevels)??[]}function Dd(t,n){var r;return(r=By(t,n))==null?void 0:r.defaultReasoning}function _C(){const{activeSessionId:t,sessions:n,updateModelConfig:r}=A(),o=A(J=>J.showModelSelector),a=A(J=>J.setShowModelSelector),c=n.find(J=>J.id===t),d=A(J=>J.models),p=A(J=>J.modelsLoading),g=A(J=>J.loadModels),[m,v]=x.useState(!1),k=x.useRef(null);if(Wi(k,()=>v(!1),m),Io(()=>v(!1),m),x.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),x.useEffect(()=>{c!=null&&c.runtime_type&&g(c.runtime_type,c.cwd??void 0)},[c==null?void 0:c.runtime_type,c==null?void 0:c.cwd,g]),!c)return null;const y=c.runtime_type,S=c.model??"",C=c.model_reasoning_effort??"",b=d.length>0?d:[],N=wf(y),R=[...b.length>0?b:N];if(S&&!R.some(J=>J.slug===S)){const J=N[0];R.unshift({slug:S,displayName:S,description:"Custom model",defaultReasoning:(J==null?void 0:J.defaultReasoning)??"medium",reasoningLevels:(J==null?void 0:J.reasoningLevels)??[]})}function z(J){return R.find(re=>re.slug===J)}function I(J){var re;return b.length>0?((re=z(J))==null?void 0:re.reasoningLevels)??[]:Id(y,J)}function L(J){var re;return b.length>0?(re=z(J))==null?void 0:re.defaultReasoning:Dd(y,J)}const q=Ad.find(J=>J.id===y),K=z(S),$=S?I(S):[],Z=(q==null?void 0:q.label)??y,he=(K==null?void 0:K.displayName)??(S||"Default"),ce=$.find(J=>J.effort===C),ye=(ce==null?void 0:ce.label)??(C||"Default");function Se(J){var Q;const re=I(J),F=re.some(G=>G.effort===C)?C:L(J)??((Q=re[0])==null?void 0:Q.effort)??"";r(J,F),v(!1)}function Oe(J){r(S,J),v(!1)}return l.jsxs("div",{className:"model-selector",ref:k,children:[l.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[l.jsx("span",{className:"model-selector-provider",children:Z}),l.jsx("span",{className:"model-selector-sep",children:"›"}),l.jsx("span",{className:"model-selector-model",children:he}),ye!=="Default"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"model-selector-sep",children:"›"}),l.jsx("span",{className:"model-selector-reasoning",children:ye})]}),l.jsx(_o,{size:12,className:"model-selector-chevron"})]}),m&&l.jsxs("div",{className:"model-selector-popover",children:[l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Ad.map(J=>l.jsxs("div",{className:`model-selector-item ${J.id===y?"selected":""} ${J.available?"":"disabled"}`,onClick:()=>{if(J.available){if(J.id===y){v(!1);return}r("","",J.id)}},children:[l.jsx("span",{children:J.label}),!J.available&&l.jsxs("span",{className:"model-selector-coming-soon",children:[l.jsx(g1,{size:10})," Soon"]}),J.id===y&&l.jsx(Cs,{size:12})]},J.id))]}),l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Model"}),p&&l.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!p&&R.length===0&&l.jsx("div",{className:"model-selector-empty",children:"No models available"}),R.map(J=>l.jsxs("div",{className:`model-selector-item ${J.slug===S?"selected":""}`,onClick:()=>Se(J.slug),children:[l.jsxs("div",{className:"model-selector-item-main",children:[l.jsx("span",{className:"model-selector-item-name",children:J.displayName}),l.jsx("span",{className:"model-selector-item-desc",children:J.description})]}),J.slug===S&&l.jsx(Cs,{size:12})]},J.slug))]}),l.jsxs("div",{className:"model-selector-column",children:[l.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),$.length===0&&l.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),$.map(J=>l.jsxs("div",{className:`model-selector-item ${J.effort===C?"selected":""}`,onClick:()=>Oe(J.effort),children:[l.jsx("span",{children:J.label}),J.effort===C&&l.jsx(Cs,{size:12})]},J.effort))]})]})]})}function bi(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function jg(){const t=A(r=>r.canGoBack),n=A(r=>r.canGoForward);return l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"sb-item sb-btn",title:"Back","aria-label":"Back",disabled:!t,onClick:()=>window.history.back(),children:l.jsx(Qk,{size:14})}),l.jsx("button",{className:"sb-item sb-btn",title:"Forward","aria-label":"Forward",disabled:!n,onClick:()=>window.history.forward(),children:l.jsx(Zk,{size:14})})]})}function _g(){const t=A(n=>n.setShowRemoteModal);return l.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>t(!0),children:[l.jsx(M1,{size:14})," Repoburg"]})}function Rg(){const t=A(r=>r.usageViewOpen),n=A(r=>r.toggleUsageView);return l.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Usage Center",onClick:n,children:[l.jsx(Rv,{size:14})," Usage"]})}function Ag(){const t=A(r=>r.vscodeViewOpen),n=A(r=>r.toggleVscodeView);return l.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open VS Code",onClick:n,children:[l.jsx(r1,{size:14})," Code"]})}function Ig(){const t=A(r=>r.terminalViewOpen),n=A(r=>r.toggleTerminalView);return l.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open a terminal",onClick:n,children:[l.jsx($v,{size:14})," Terminal"]})}function RC(){Lt.trackRender("StatusBar");const t=A(v=>v.activeSessionId),n=A(v=>t?v.sessions.find(k=>k.id===t)??null:null),r=A(v=>t?v.sessionDetails[t]??null:null),o=A(v=>t?v.backgroundTasks[t]:void 0),a=A(v=>v.wsConnected),c=A(v=>v.switchRightTab),d=(r==null?void 0:r.contextUsage)??null;if(!n)return l.jsxs("div",{className:"ide-statusbar",children:[l.jsx(jg,{}),l.jsx(_g,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Ag,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Ig,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Rg,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),l.jsx("div",{className:"sb-spacer"}),l.jsxs("div",{className:"sb-item",children:[l.jsx(Cm,{size:14})," K"]})]});const p=o??[],g=ql(n,p.length),m=yf(p);return l.jsxs("div",{className:"ide-statusbar",children:[l.jsx(jg,{}),l.jsx(_g,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Ag,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Ig,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(Rg,{}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx(_C,{}),m>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sb-divider",children:"|"}),l.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${m} Monitor task${m>1?"s":""} running — click to view`,onClick:()=>c("tasks"),children:[l.jsx(zv,{size:14})," ",m]})]}),l.jsx("div",{className:"sb-spacer"}),l.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:n.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),d&&l.jsx(AC,{usage:d}),l.jsx("div",{className:"sb-divider",children:"|"}),l.jsxs("div",{className:"sb-item",children:[l.jsx(Cm,{size:14})," K"]})]})}function AC({usage:t}){const n=t.percentage>=85?"var(--red)":t.percentage>=60?"var(--amber)":"var(--green)",r=`${bi(t.totalTokens)} / ${bi(t.contextWindow)} tokens`+(t.autoCompactThreshold?` · auto-compacts at ${bi(t.autoCompactThreshold)}`:"");return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"sb-divider",children:"|"}),l.jsx("div",{className:"sb-context",title:r,children:l.jsxs("span",{className:"sb-context-text",style:{color:n},children:[Math.round(t.percentage),"% / ",bi(t.totalTokens)," / ",bi(t.contextWindow)]})})]})}function Dg(t){return Et(`/vscode-web/status?folder=${encodeURIComponent(t??"")}`)}function IC(t){return at("/vscode-web/start",{folder:t})}function DC(t){return at("/vscode-web/heartbeat",{id:t})}const MC=1e3,LC=5*6e4;function Mg({children:t}){const n=A(r=>r.toggleVscodeView);return l.jsxs("div",{className:"vscode-view vscode-view--loading",children:[t,l.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:n,children:l.jsx(Tn,{size:16})})]})}function OC(){const t=A(C=>C.vscodeState),n=A(C=>C.vscodeId),r=A(C=>C.vscodeToken),o=A(C=>C.setVscodeView),a=A(C=>{var N;const b=C.activeSessionId?C.sessions.find(E=>E.id===C.activeSessionId):null;return b!=null&&b.cwd?b.cwd:((N=C.workspaces.find(E=>E.deleted===0))==null?void 0:N.path)??null}),[c,d]=x.useState(!1),[p,g]=x.useState(0),m=x.useRef(null),v=mn(),k=v===""||v===window.location.origin,y=`${v}/vscode/${n??""}/?tkn=${r??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;x.useEffect(()=>{let C=!1;function b(){m.current&&(clearInterval(m.current),m.current=null)}async function N(){try{let R=await Dg(a);if((R.state==="stopped"||R.state==="error")&&(R=await IC(a)),C||(o(R.state,R.id,R.token),R.state==="running"||R.state==="error"))return;m.current=setInterval(async()=>{const z=await Dg(a);C||(o(z.state,z.id,z.token),(z.state==="running"||z.state==="error"||z.state==="stopped")&&b())},MC)}catch{C||o("error",null,null)}}N();const E=setInterval(()=>{const R=A.getState().vscodeId;R&&DC(R).catch(()=>{})},LC);return()=>{C=!0,b(),clearInterval(E)}},[p,a,o]);function S(){d(!1),o("starting",null,null),g(C=>C+1)}return t!=="running"||!r||!n?l.jsx(Mg,{children:t==="error"?l.jsxs(l.Fragment,{children:[l.jsx("span",{children:"VS Code could not start."}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:S,children:[l.jsx(Pi,{size:14})," Retry"]})]}):l.jsxs("span",{className:"vscode-view-hint",children:[l.jsx(hn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?l.jsxs("div",{className:"vscode-view",children:[!c&&l.jsxs("div",{className:"vscode-view-overlay",children:[l.jsx(hn,{size:16,className:"spin"})," Loading VS Code…"]}),l.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>d(!0)},n)]}):l.jsxs(Mg,{children:[l.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),l.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[l.jsx(jv,{size:14})," Open VS Code in a new tab"]})]})}function PC(t){const n=new URLSearchParams;return t.since&&n.set("since",t.since),t.until&&n.set("until",t.until),n.set("tz",t.timezone),t.fresh&&n.set("fresh","1"),Et(`/usage/report?${n.toString()}`)}const $C=[{id:"today",label:"Today"},{id:"7d",label:"7 days"},{id:"30d",label:"30 days"},{id:"month",label:"This month"},{id:"all",label:"All"}];function bo(t){return Math.round(t).toLocaleString("en-US")}function ts(t){return`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function No(t){return new Intl.NumberFormat("en-US",{notation:"compact",maximumSignificantDigits:3}).format(t)}function kf(t){const n=t.startsWith("anthropic/claude-")?t.slice(17):t.startsWith("claude-")?t.slice(7):t,r=n.split("-");return r.length>=3&&r[r.length-1].length===8?r.slice(0,-1).join("-"):n}const zC={claude:"Claude",codex:"Codex",repoburg:"Repoburg",opencode:"OpenCode",amp:"Amp",droid:"Droid",gemini:"Gemini",copilot:"Copilot",pi:"pi",kimi:"Kimi",qwen:"Qwen"};function yl(t){return zC[t]??t.charAt(0).toUpperCase()+t.slice(1)}const Wl=t=>String(t).padStart(2,"0");function oc(t){return`${t.getFullYear()}-${Wl(t.getMonth()+1)}-${Wl(t.getDate())}`}function FC(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:`${oc(n)} ${Wl(n.getHours())}:${Wl(n.getMinutes())}`}function Lg(t,n=new Date){if(t==="all")return{since:null,until:null};const r=new Date(n.getFullYear(),n.getMonth(),n.getDate());return t==="7d"?r.setDate(r.getDate()-6):t==="30d"?r.setDate(r.getDate()-29):t==="month"&&r.setDate(1),{since:oc(r),until:null}}function Og(t){const n=new Date(`${t}T00:00:00Z`);return n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+6)%7),n.toISOString().slice(0,10)}function Sf(t,n){const r=[],o=new Date(`${t}T00:00:00Z`),a=new Date(`${n}T00:00:00Z`);for(;o<=a&&r.length<3700;)r.push(o.toISOString().slice(0,10)),o.setUTCDate(o.getUTCDate()+1);return r}const UC=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Md(t){const n=/^(\d{4})-(\d{2})(?:-(\d{2}))?$/.exec(t);if(!n)return t;const r=UC[Number(n[2])-1]??n[2];return n[3]?`${r} ${Number(n[3])}`:`${r} ${n[1]}`}function BC(t,n=Date.now()){const r=Math.max(0,Math.round((n-Date.parse(t))/1e3));if(r<45)return"just now";const o=Math.round(r/60);if(o<60)return`${o} min ago`;const a=Math.round(o/60);return a<24?`${a} h ago`:oc(new Date(t))}const Pr=7,WC=92;function Wy(t,n){const r=n.indexOf(t);return r>=0&&r<Pr?r:Pr}function xl(t){return t<Pr?`var(--usage-series-${t+1})`:"var(--usage-series-other)"}function HC(t,n){return Sf(Og(t),Og(n)).filter((r,o)=>o%7===0)}function VC(t,n){const{daily:r}=t;if(r.length===0)return null;const o=t.window.since??r[0].period,a=r[r.length-1].period,c=t.window.until??(n>a?n:a),d=Sf(o,c);if(d.length<2)return null;const p=d.length>WC,g=new Map((p?t.weekly:r).map(y=>[y.period,y])),m=new Map,v=(p?HC(o,c):d).map(y=>{const S=g.get(y),C=new Map;let b=0;for(const R of(S==null?void 0:S.breakdown)??[]){if(R.cost_usd<=0)continue;const z=Wy(R.model,t.model_order),I=C.get(z)??{slot:z,label:z<Pr?kf(R.model):"Other",cost:0};I.cost+=R.cost_usd,b+=R.cost_usd,C.set(z,I)}const N=((S==null?void 0:S.cost_usd)??0)-b;if(N>.005){const R=C.get(Pr)??{slot:Pr,label:"Other",cost:0};R.cost+=N,C.set(Pr,R)}const E=[...C.values()].sort((R,z)=>R.slot-z.slot);for(const R of E)m.set(R.slot,R.label);return{period:y,label:p?`Week of ${Md(y)}`:Md(y),total:E.reduce((R,z)=>R+z.cost,0),segments:E}});if(!v.some(y=>y.total>0))return null;const k=[...m.entries()].sort((y,S)=>y[0]-S[0]).map(([y,S])=>({slot:y,label:S}));return{unit:p?"week":"day",columns:v,series:k}}function KC(t){if(!(t>0))return[0,1];if(t<.01)return[0,.01];const n=t/4,r=10**Math.floor(Math.log10(n)),o=n/r,a=(o<=1?1:o<=2?2:o<=2.5?2.5:o<=5?5:10)*r,c=[];for(let d=0;d*a<t+a*1e-9||c.length<2;d++)c.push(d*a);return c[c.length-1]<t&&c.push(c.length*a),c}function GC(t,n){if(t>=1e4)return`$${No(t)}`;let r=0;for(;r<3&&Math.abs(Math.round(n*10**r)-n*10**r)>1e-9;)r++;return`$${t.toLocaleString("en-US",{minimumFractionDigits:r,maximumFractionDigits:r})}`}const wo=t=>`${t}%`;function qC({data:t}){const{columns:n,series:r,unit:o}=t,[a,c]=x.useState(null),d=x.useMemo(()=>KC(Math.max(...n.map(b=>b.total))),[n]),p=d[d.length-1],g=d[1]-d[0],m=n.reduce((b,N,E)=>N.total>n[b].total?E:b,0),v=Math.max(1,Math.ceil(n.length/8)),k=n.length,y=b=>{const N={ArrowLeft:-1,ArrowRight:1,Home:-k,End:k};b.key in N&&(b.preventDefault(),c(E=>Math.min(k-1,Math.max(0,(E??k-1)+N[b.key]))))},S=a===null?null:n[a],C=a===null?0:(a+.5)/k*100;return l.jsxs("div",{className:"usage-chart",children:[l.jsxs("div",{className:"usage-chart-head",children:[l.jsx("div",{className:"usage-section-title",children:o==="week"?"Weekly cost (USD)":"Daily cost (USD)"}),r.length>=2&&l.jsx("ul",{className:"usage-legend","aria-label":"Models",children:r.map(b=>l.jsxs("li",{className:"usage-legend-item",children:[l.jsx("span",{className:"usage-swatch",style:{background:xl(b.slot)}}),b.label]},b.slot))})]}),l.jsxs("div",{className:"usage-plot-wrap",children:[l.jsx("div",{className:"usage-yaxis","aria-hidden":"true",children:d.map(b=>l.jsx("span",{className:"usage-ytick",style:{bottom:wo(b/p*100)},children:GC(b,g)},b))}),l.jsxs("div",{className:"usage-plot",role:"group",tabIndex:0,"aria-label":`${o==="week"?"Weekly":"Daily"} cost chart. Arrow keys move between ${o}s.`,onKeyDown:y,onFocus:()=>c(b=>b??k-1),onBlur:()=>c(null),onMouseLeave:()=>c(null),children:[d.map(b=>l.jsx("div",{className:`usage-gridline${b===0?" usage-gridline-base":""}`,style:{bottom:wo(b/p*100)}},b)),l.jsx("div",{className:"usage-cols",children:n.map((b,N)=>l.jsxs("div",{className:`usage-col${a===N?" usage-col-active":""}`,"data-period":b.period,onMouseEnter:()=>c(N),children:[N===m&&b.total>0&&a!==N&&l.jsx("span",{className:"usage-peak",style:{bottom:`calc(${wo(b.total/p*100)} + 3px)`},children:ts(b.total)}),b.total>0&&l.jsx("div",{className:"usage-bar",style:{height:wo(b.total/p*100)},children:b.segments.map(E=>l.jsx("div",{className:"usage-seg",style:{flexGrow:E.cost,background:xl(E.slot)}},E.slot))})]},b.period))}),S&&l.jsxs("div",{className:"usage-tooltip",role:"status",style:{left:wo(C),transform:C<20?"translateX(-12px)":C>80?"translateX(calc(-100% + 12px))":"translateX(-50%)"},children:[l.jsxs("div",{className:"usage-tooltip-head",children:[l.jsx("span",{children:S.label}),l.jsx("strong",{children:ts(S.total)})]}),S.segments.length===0&&l.jsx("div",{className:"usage-tooltip-empty",children:"No usage"}),[...S.segments].sort((b,N)=>N.cost-b.cost).map(b=>l.jsxs("div",{className:"usage-tooltip-line",children:[l.jsx("span",{className:"usage-swatch",style:{background:xl(b.slot)}}),l.jsx("span",{className:"usage-tooltip-model",children:b.label}),l.jsx("span",{children:ts(b.cost)})]},b.slot))]})]}),l.jsx("div",{}),l.jsx("div",{className:"usage-xaxis","aria-hidden":"true",children:n.map((b,N)=>(k-1-N)%v===0?l.jsx("span",{className:"usage-xtick",style:{left:wo((N+.5)/k*100),transform:N===0&&k>1?"translateX(-30%)":N===k-1?"translateX(-70%)":"translateX(-50%)"},children:Md(b.period)},b.period):null)})]})]})}const Pg=[{id:"daily",label:"Daily",column:"Date"},{id:"weekly",label:"Weekly",column:"Week"},{id:"monthly",label:"Monthly",column:"Month"},{id:"session",label:"Session",column:"Session"}],XC={weekly:"Weeks start on Monday.",session:"Sessions last active in this range, with their whole usage."},cd=50,YC={input_tokens:0,output_tokens:0,cache_creation_tokens:0,cache_read_tokens:0,total_tokens:0,cost_usd:0};function QC(t){return t.reduce((n,r)=>({input_tokens:n.input_tokens+r.input_tokens,output_tokens:n.output_tokens+r.output_tokens,cache_creation_tokens:n.cache_creation_tokens+r.cache_creation_tokens,cache_read_tokens:n.cache_read_tokens+r.cache_read_tokens,total_tokens:n.total_tokens+r.total_tokens,cost_usd:n.cost_usd+r.cost_usd}),YC)}function ud({t}){return l.jsxs(l.Fragment,{children:[l.jsx("td",{className:"usage-num",children:bo(t.input_tokens)}),l.jsx("td",{className:"usage-num",children:bo(t.output_tokens)}),l.jsx("td",{className:"usage-num",children:bo(t.cache_creation_tokens)}),l.jsx("td",{className:"usage-num",children:bo(t.cache_read_tokens)}),l.jsx("td",{className:"usage-num",children:bo(t.total_tokens)}),l.jsx("td",{className:"usage-num usage-cost",children:ts(t.cost_usd)})]})}function ZC({models:t,order:n}){return l.jsx("span",{className:"usage-models",children:t.map(r=>l.jsxs("span",{className:"usage-model",title:r,children:[l.jsx("span",{className:"usage-swatch",style:{background:xl(Wy(r,n))}}),kf(r)]},r))})}function JC({row:t,onOpen:n}){const r=t.pane_session;if(!r)return l.jsx("span",{className:"usage-session-id usage-session-id-main",title:t.period,children:t.period});const o=r.title||"Untitled session";return l.jsxs("span",{className:"usage-session",children:[l.jsxs("span",{className:"usage-session-title",children:[l.jsx("button",{className:"usage-session-link",title:`Open "${o}"`,onClick:()=>n(r.id),children:o}),r.kind==="discussion"&&l.jsx("span",{className:"usage-tag",children:"discussion"})]}),l.jsx("span",{className:"usage-session-id",title:t.period,children:t.period})]})}function eE({report:t,onOpenSession:n}){var C;const[r,o]=x.useState("daily"),[a,c]=x.useState(!1),[d,p]=x.useState(!1),g=r==="session",m=g?t.sessions:t[r],v=g&&!d?m.slice(0,cd):m,k=g?QC(t.sessions):t.totals,y=g?10:9,S=XC[r];return l.jsxs("div",{className:"usage-table-wrap",children:[l.jsxs("div",{className:"usage-table-head",children:[l.jsx("div",{className:"usage-tabs",role:"tablist","aria-label":"Report",children:Pg.map(b=>l.jsx("button",{role:"tab","aria-selected":r===b.id,className:`usage-tab${r===b.id?" usage-tab-active":""}`,onClick:()=>o(b.id),children:b.label},b.id))}),S&&l.jsx("span",{className:"usage-table-note",children:S}),l.jsxs("label",{className:"usage-check",title:"One line per agent and model, like ccusage --breakdown",children:[l.jsx("input",{type:"checkbox",checked:a,onChange:b=>c(b.target.checked)}),"Breakdown"]})]}),l.jsx("div",{className:"usage-table-scroll",role:"tabpanel",children:l.jsxs("table",{className:"usage-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:(C=Pg.find(b=>b.id===r))==null?void 0:C.column}),l.jsx("th",{children:"Agent"}),l.jsx("th",{children:"Models"}),l.jsx("th",{className:"usage-num",children:"Input"}),l.jsx("th",{className:"usage-num",children:"Output"}),l.jsx("th",{className:"usage-num",children:"Cache Create"}),l.jsx("th",{className:"usage-num",children:"Cache Read"}),l.jsx("th",{className:"usage-num",children:"Total Tokens"}),l.jsx("th",{className:"usage-num",children:"Cost (USD)"}),g&&l.jsx("th",{children:"Last Activity"})]})}),l.jsxs("tbody",{children:[m.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:y,className:"usage-empty",children:"No usage in this range."})}),v.map(b=>{const N=g?b:null;return l.jsxs(x.Fragment,{children:[l.jsxs("tr",{className:"usage-row",children:[l.jsx("td",{className:"usage-period",children:N?l.jsx(JC,{row:N,onOpen:n}):b.period}),l.jsx("td",{children:N?yl(N.agent):b.agents.map(yl).join(", ")}),l.jsx("td",{children:l.jsx(ZC,{models:b.models,order:t.model_order})}),l.jsx(ud,{t:b}),N&&l.jsx("td",{className:"usage-when",children:N.last_activity?FC(N.last_activity):"—"})]}),a&&b.breakdown.map(E=>l.jsxs("tr",{className:"usage-sub",children:[l.jsx("td",{}),l.jsx("td",{children:yl(E.agent)}),l.jsxs("td",{title:E.model,children:[l.jsx("span",{className:"usage-branch",children:"└─"})," ",kf(E.model)]}),l.jsx(ud,{t:E}),N&&l.jsx("td",{})]},`${E.agent}\0${E.model}`))]},b.period)})]}),m.length>0&&l.jsx("tfoot",{children:l.jsxs("tr",{className:"usage-total",children:[l.jsx("td",{children:"Total"}),l.jsx("td",{}),l.jsx("td",{}),l.jsx(ud,{t:k}),g&&l.jsx("td",{})]})})]})}),g&&m.length>cd&&l.jsx("button",{className:"usage-more",onClick:()=>p(b=>!b),children:d?`Show the top ${cd}`:`Show all ${m.length} sessions`})]})}const Hy="agentpane:usage-budget",tE=6e4;function nE(){try{const t=Number(localStorage.getItem(Hy));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function sE(t){try{localStorage.setItem(Hy,String(t))}catch{}}function rE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function wl({label:t,value:n,title:r,children:o}){return l.jsxs("div",{className:"usage-kpi",children:[l.jsx("div",{className:"usage-kpi-label",children:t}),l.jsx("div",{className:"usage-kpi-value",title:r,children:n}),o]})}function oE({spent:t}){const[n,r]=x.useState(nE),o=n>0?t/n:0,a=o>=1?"over":o>=.8?"near":"ok",c=d=>{const p=Number(d.replace(",",".")),g=Number.isFinite(p)&&p>0?p:0;r(g),sE(g)};return l.jsxs(wl,{label:"This month",value:ts(t),children:[n>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`usage-meter usage-meter-${a}`,role:"meter","aria-label":"Monthly budget used","aria-valuemin":0,"aria-valuemax":n,"aria-valuenow":Math.min(t,n),children:l.jsx("div",{className:"usage-meter-fill",style:{width:`${Math.min(100,o*100)}%`}})}),l.jsx("div",{className:`usage-kpi-sub${a==="over"?" usage-over":""}`,children:a==="over"?l.jsxs(l.Fragment,{children:[l.jsx(Yl,{size:11})," ",ts(t-n)," over the ",ts(n)," budget"]}):`${ts(n-t)} left of ${ts(n)}`})]}):l.jsx("div",{className:"usage-kpi-sub",children:"No monthly budget set"}),l.jsxs("div",{className:"usage-budget",children:[l.jsx("label",{htmlFor:"usage-budget-input",children:"Monthly budget (USD)"}),l.jsx("input",{id:"usage-budget-input",type:"number",min:"0",step:"1",defaultValue:n>0?n:"",placeholder:"none",onBlur:d=>c(d.target.value),onKeyDown:d=>{d.key==="Enter"&&c(d.currentTarget.value)}})]})]})}const iE=(t,n)=>t.since===n.since&&t.until===n.until;function aE(){const t=A(z=>z.toggleUsageView),n=A(z=>z.selectSession),[r,o]=x.useState("30d"),[a,c]=x.useState(null),[d,p]=x.useState(null),[g,m]=x.useState(!1),v=x.useMemo(rE,[]),k=x.useRef(0),y=x.useCallback(z=>{const I=++k.current,{since:L,until:q}=Lg(r),K=async $=>{const Z=await PC({since:L,until:q,timezone:v,fresh:$});I===k.current&&(c(Z),p(null),!$&&Z.generated_at&&Date.now()-Date.parse(Z.generated_at)>tE&&await K(!0))};m(!0),K(z).catch($=>{I===k.current&&p($.message)}).finally(()=>{I===k.current&&m(!1)})},[r,v]);x.useEffect(()=>{y(!1)},[y]),x.useEffect(()=>()=>{k.current++},[]);const S=z=>{t(),n(z)},C=oc(new Date),b=x.useMemo(()=>a?VC(a,C):null,[a,C]),N=g&&a!==null&&!iE(a.window,Lg(r)),E=a==null?void 0:a.totals,R=a&&a.daily.length>0?Sf(a.window.since??a.daily[0].period,a.window.until??C).length:0;return l.jsxs("div",{className:"usage-view",children:[l.jsxs("div",{className:"usage-header",children:[l.jsxs("div",{className:"usage-title",children:[l.jsx(Rv,{size:18})," Usage Center"]}),l.jsxs("div",{className:"usage-controls",children:[$C.map(z=>l.jsx("button",{className:`usage-range-btn${r===z.id?" usage-range-btn-active":""}`,"aria-pressed":r===z.id,onClick:()=>o(z.id),children:z.label},z.id)),l.jsx("button",{className:"usage-range-btn usage-refresh",onClick:()=>y(!0),title:"Read the logs again (runs ccusage)","aria-label":"Refresh",children:l.jsx(jm,{size:13,className:g?"spin":void 0})}),l.jsx("button",{className:"dialog-close",title:"Close usage view","aria-label":"Close usage view",onClick:t,children:l.jsx(Tn,{size:16})})]})]}),d&&l.jsxs("div",{className:"usage-error",children:["Could not load usage data: ",d]}),!a&&!d&&l.jsxs("div",{className:"usage-loading",children:[l.jsx(jm,{size:14,className:"spin"})," Reading the Claude Code and Codex logs with ccusage…"]}),a&&E&&l.jsxs("div",{className:`usage-body${N?" usage-body-stale":""}`,"aria-busy":g,children:[a.source.ccusage_error&&l.jsxs("div",{className:"usage-warning",role:"alert",children:[l.jsx(Yl,{size:13}),l.jsxs("span",{children:["ccusage could not read the Claude Code and Codex logs, so only Repoburg calls are counted:"," ",a.source.ccusage_error]})]}),l.jsxs("div",{className:"usage-kpis",children:[l.jsx(wl,{label:"Cost (USD)",value:ts(E.cost_usd),children:l.jsx("div",{className:"usage-kpi-sub",children:a.by_agent.length===0?"No usage in this range":a.by_agent.map(z=>`${yl(z.agent)} ${ts(z.cost_usd)}`).join(" · ")})}),l.jsx(oE,{spent:a.month_to_date_cost_usd}),l.jsxs(wl,{label:"Total tokens",value:No(E.total_tokens),title:`${bo(E.total_tokens)} tokens`,children:[l.jsxs("div",{className:"usage-kpi-sub",children:["Input ",No(E.input_tokens)," · Output ",No(E.output_tokens)]}),l.jsxs("div",{className:"usage-kpi-sub",children:["Cache Create ",No(E.cache_creation_tokens)," · Cache Read"," ",No(E.cache_read_tokens)]})]}),l.jsx(wl,{label:"Daily average",value:R>0?ts(E.cost_usd/R):"—",children:l.jsx("div",{className:"usage-kpi-sub",children:R>0?`over ${R} ${R===1?"day":"days"} · ${a.daily.length} with usage`:"No usage in this range"})})]}),b&&l.jsx(qC,{data:b}),l.jsx(eE,{report:a,onOpenSession:S}),a.unpriced_models.length>0&&l.jsxs("div",{className:"usage-note",children:["No price for these Repoburg models, counted as $0: ",a.unpriced_models.join(", ")]}),l.jsxs("div",{className:"usage-source",children:["Claude Code and Codex costs by"," ",l.jsx("a",{href:"https://github.com/ryoppippi/ccusage",target:"_blank",rel:"noreferrer",children:"ccusage"}),a.source.ccusage_version?` ${a.source.ccusage_version}`:""," with LiteLLM prices · Repoburg calls priced by AgentPane · days in ",a.timezone,a.generated_at&&` · logs read ${BC(a.generated_at)}`]})]})]})}const $g="claude auth login";function lE(){const t=A(p=>Object.keys(p.signedOutTurns).length),n=A(p=>p.terminalViewOpen),r=A(p=>p.toggleTerminalView),o=A(p=>p.addToast),[a,c]=x.useState(!1);if(t===0)return null;const d=()=>{c(!0),lw().catch(p=>o("error",`Could not resume the turns — ${$r(p)}`)).finally(()=>c(!1))};return l.jsxs("div",{className:"signed-out-band",role:"status",children:[l.jsx("span",{className:"banner-icon",children:l.jsx(u1,{size:12})}),l.jsxs("span",{className:"banner-text",children:["Claude is signed out — ",t===1?"1 turn is":`${t} turns are`," waiting. Run"," ",l.jsx("code",{children:$g})," in a terminal, then resume."]}),l.jsxs("button",{type:"button",className:"banner-action",onClick:()=>void Fi($g),children:[l.jsx(Oi,{size:12}),"Copy"]}),!n&&l.jsxs("button",{type:"button",className:"banner-action",onClick:r,children:[l.jsx($v,{size:12}),"Open terminal"]}),l.jsxs("button",{type:"button",className:"banner-action",onClick:d,disabled:a,children:[l.jsx(Ov,{size:12}),t===1?"Resume turn":"Resume turns"]})]})}const zg=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,cE=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,uE={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function Vy(){return mn()||window.location.origin}function Ky(t,n){let r=n;if(r&&typeof r=="object"){const d=r;r=typeof d.id=="string"?d.id:d.url}if(typeof r!="string")return null;const o=r.trim();if(zg.test(o))return o;const a=cE.exec(o);if(!a)return null;let c;try{c=decodeURIComponent(a[1])}catch{return null}return c===t&&zg.test(a[2])?a[2]:null}function Fg(t){return/^https?:\/\//i.test(t.url)?t:{...t,url:`${Vy()}${t.url}`}}function dE(t){return uE[t.slice(t.lastIndexOf(".")+1)]??"application/octet-stream"}function Gy(t){return new Promise((n,r)=>{const o=new FileReader;o.onload=()=>{const a=String(o.result??"");n(a.slice(a.indexOf(",")+1))},o.onerror=()=>r(o.error??new Error("Could not read the file")),o.readAsDataURL(t)})}function fE(t,n){const r=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(t);return r?{type:n||r[1]||void 0,data:t.slice(r[0].length)}:{type:n,data:t}}async function qy(t){if(t instanceof Blob){const n=t.name;return{name:typeof n=="string"&&n?n:void 0,type:t.type||void 0,data:await Gy(t)}}if(t&&typeof t=="object"&&typeof t.data=="string"){const n=t;return{name:typeof n.name=="string"&&n.name?n.name:void 0,type:typeof n.type=="string"&&n.type?n.type:void 0,data:n.data}}return null}async function pE(t){const n=await qy(t);if(!n)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return n}async function hE(t,n,r){if(n==null)return[];if(!Array.isArray(n))throw new Error("submitTurn: attachments must be an array");const o=[];for(let a=0;a<n.length;a++){const c=n[a],d=await qy(c);if(d){const{type:m,data:v}=fE(d.data,d.type);if(!m)throw new Error(`submitTurn: attachment ${a+1} has no type`);o.push({name:d.name??`attachment-${a+1}`,media_type:m,data:v});continue}const p=Ky(t,c);if(!p)throw new Error(`submitTurn: attachment ${a+1} is not a file of this app`);const g=await r(p);o.push({name:p,media_type:dE(p),data:await Gy(g)})}return o}const mE=`function (config) {
|
|
683
|
-
var nextId = 1;
|
|
684
|
-
var pending = new Map();
|
|
685
|
-
var listeners = [];
|
|
686
|
-
// Absolute http(s) URL, or null. Relative and #fragment hrefs are not
|
|
687
|
-
// external and keep their in-frame behavior.
|
|
688
|
-
function externalUrl(raw) {
|
|
689
|
-
if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
|
|
690
|
-
try { return new URL(raw.trim()).href; } catch (err) { return null; }
|
|
691
|
-
}
|
|
692
|
-
// New browser tab. The sandbox lets popups escape it, so the page loads
|
|
693
|
-
// like any other tab; noopener leaves it no handle back to this frame.
|
|
694
|
-
function openTab(url) {
|
|
695
|
-
window.open(url, '_blank', 'noopener,noreferrer');
|
|
696
|
-
}
|
|
697
|
-
// A plain external link would navigate THIS frame: the app disappears and
|
|
698
|
-
// most sites refuse to be framed anyway. Open it in a new tab instead.
|
|
699
|
-
// Bubble phase on window, so the app's own handlers run first and can
|
|
700
|
-
// still claim the click with preventDefault(). Modifier clicks and
|
|
701
|
-
// target="_blank" links already open a tab natively.
|
|
702
|
-
window.addEventListener('click', function (e) {
|
|
703
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
704
|
-
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
705
|
-
if (!a) return;
|
|
706
|
-
var target = (a.getAttribute('target') || '').toLowerCase();
|
|
707
|
-
if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
|
|
708
|
-
var url = externalUrl(a.getAttribute('href'));
|
|
709
|
-
if (!url) return;
|
|
710
|
-
e.preventDefault();
|
|
711
|
-
openTab(url);
|
|
712
|
-
});
|
|
713
|
-
// Stored files: <apiOrigin>/api/apps/<app-id>/files/<id>. Same reference
|
|
714
|
-
// rules as the pane (utils/appFiles.ts): an id, a file URL of this app on
|
|
715
|
-
// any origin, or an object carrying id/url.
|
|
716
|
-
var FILE_ID_RE = /^[a-f0-9]{64}\\.(?:png|jpg|gif|webp)$/;
|
|
717
|
-
var FILE_URL_RE = /^(?:https?:\\/\\/[^\\/?#]+)?\\/api\\/apps\\/([^\\/?#]+)\\/files\\/([^\\/?#]+)$/i;
|
|
718
|
-
function fileRefId(ref) {
|
|
719
|
-
if (ref && typeof ref === 'object') ref = typeof ref.id === 'string' ? ref.id : ref.url;
|
|
720
|
-
if (typeof ref !== 'string') return null;
|
|
721
|
-
var s = ref.trim();
|
|
722
|
-
if (FILE_ID_RE.test(s)) return s;
|
|
723
|
-
var m = FILE_URL_RE.exec(s);
|
|
724
|
-
if (!m) return null;
|
|
725
|
-
var owner;
|
|
726
|
-
try { owner = decodeURIComponent(m[1]); } catch (err) { return null; }
|
|
727
|
-
return owner === config.appId && FILE_ID_RE.test(m[2]) ? m[2] : null;
|
|
728
|
-
}
|
|
729
|
-
function fileUrl(ref) {
|
|
730
|
-
var id = fileRefId(ref);
|
|
731
|
-
if (!id) return typeof ref === 'string' ? ref : '';
|
|
732
|
-
return config.apiOrigin + '/api/apps/' + encodeURIComponent(config.appId) + '/files/' + id;
|
|
733
|
-
}
|
|
734
|
-
window.addEventListener('message', function (e) {
|
|
735
|
-
var msg = e.data;
|
|
736
|
-
if (!msg || msg.source !== 'agentpane-host') return;
|
|
737
|
-
if (msg.id != null && pending.has(msg.id)) {
|
|
738
|
-
var p = pending.get(msg.id);
|
|
739
|
-
pending.delete(msg.id);
|
|
740
|
-
if (msg.ok) {
|
|
741
|
-
p.resolve(msg.result);
|
|
742
|
-
} else {
|
|
743
|
-
var err = new Error(msg.error || 'bridge error');
|
|
744
|
-
// code 'conflict': setState's ifVersion is stale; state = the stored copy.
|
|
745
|
-
if (msg.code) err.code = msg.code;
|
|
746
|
-
if (msg.state) err.state = msg.state;
|
|
747
|
-
p.reject(err);
|
|
748
|
-
}
|
|
749
|
-
} else if (msg.event) {
|
|
750
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
751
|
-
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
});
|
|
755
|
-
function call(method, params) {
|
|
756
|
-
return new Promise(function (resolve, reject) {
|
|
757
|
-
var id = nextId++;
|
|
758
|
-
pending.set(id, { resolve: resolve, reject: reject });
|
|
759
|
-
try {
|
|
760
|
-
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
761
|
-
} catch (err) {
|
|
762
|
-
// Params that cannot be cloned (functions, DOM nodes, ...).
|
|
763
|
-
pending.delete(id);
|
|
764
|
-
reject(err);
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
}
|
|
768
|
-
window.AgentPane = {
|
|
769
|
-
getApp: function () { return call('getApp'); },
|
|
770
|
-
getState: function () { return call('getState'); },
|
|
771
|
-
setState: function (data, opts) {
|
|
772
|
-
var params = { data: data };
|
|
773
|
-
if (opts && typeof opts.ifVersion === 'number') params.ifVersion = opts.ifVersion;
|
|
774
|
-
return call('setState', params);
|
|
775
|
-
},
|
|
776
|
-
createSession: function (opts) { return call('createSession', opts); },
|
|
777
|
-
submitTurn: function (sessionId, prompt, opts) {
|
|
778
|
-
var params = { sessionId: sessionId, prompt: prompt };
|
|
779
|
-
if (opts && opts.attachments != null) params.attachments = opts.attachments;
|
|
780
|
-
return call('submitTurn', params);
|
|
781
|
-
},
|
|
782
|
-
getSession: function (sessionId) { return call('getSession', { sessionId: sessionId }); },
|
|
783
|
-
listSessions: function (opts) {
|
|
784
|
-
var params = {};
|
|
785
|
-
if (opts && (opts.lifecycle === 'working' || opts.lifecycle === 'finished')) params.lifecycle = opts.lifecycle;
|
|
786
|
-
if (opts && typeof opts.running === 'boolean') params.running = opts.running;
|
|
787
|
-
return call('listSessions', params);
|
|
788
|
-
},
|
|
789
|
-
getSessionInfo: function (sessionId) { return call('getSessionInfo', { sessionId: sessionId }); },
|
|
790
|
-
cancelTurn: function (sessionId) { return call('cancelTurn', { sessionId: sessionId }); },
|
|
791
|
-
setSessionLifecycle: function (sessionId, lifecycle) { return call('setSessionLifecycle', { sessionId: sessionId, lifecycle: lifecycle }); },
|
|
792
|
-
callTool: function (tool, args) { return call('callTool', { tool: tool, args: args }); },
|
|
793
|
-
listProviders: function () { return call('listProviders'); },
|
|
794
|
-
listModels: function (runtime, cwd) { return call('listModels', { runtime: runtime, cwd: cwd }); },
|
|
795
|
-
pickDirectory: function () { return call('pickDirectory'); },
|
|
796
|
-
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
797
|
-
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
798
|
-
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
799
|
-
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
800
|
-
onBackgroundTasks: function (cb) { listeners.push(function (event, payload) { if (event === 'background_tasks' && payload) cb(payload); }); },
|
|
801
|
-
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
|
|
802
|
-
openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
|
|
803
|
-
openUrl: function (url) {
|
|
804
|
-
var href = externalUrl(url);
|
|
805
|
-
if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
|
|
806
|
-
try { openTab(href); } catch (err) { return Promise.reject(err); }
|
|
807
|
-
return Promise.resolve({ ok: true });
|
|
808
|
-
},
|
|
809
|
-
uploadFile: function (file) { return call('uploadFile', { file: file }); },
|
|
810
|
-
getFile: function (ref) { return call('getFile', { ref: ref }); },
|
|
811
|
-
fileUrl: fileUrl
|
|
812
|
-
};
|
|
813
|
-
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
814
|
-
window.addEventListener('error', function (e) {
|
|
815
|
-
parent.postMessage({
|
|
816
|
-
source: 'agentpane-app', report: 'error',
|
|
817
|
-
message: e.message || 'Unknown error',
|
|
818
|
-
stack: (e.error && e.error.stack) || '',
|
|
819
|
-
line: e.lineno || 0, col: e.colno || 0
|
|
820
|
-
}, '*');
|
|
821
|
-
});
|
|
822
|
-
window.addEventListener('unhandledrejection', function (e) {
|
|
823
|
-
var r = e.reason;
|
|
824
|
-
var msg = r && (r.message || String(r)) || 'unknown';
|
|
825
|
-
parent.postMessage({
|
|
826
|
-
source: 'agentpane-app', report: 'error',
|
|
827
|
-
message: 'Unhandled promise rejection: ' + msg,
|
|
828
|
-
stack: (r && r.stack) || '', line: 0, col: 0
|
|
829
|
-
}, '*');
|
|
830
|
-
});
|
|
831
|
-
}`;function gE(t){return`(${mE})(${JSON.stringify(t)});`}function Ug(t){return t.replace(/<\/script/gi,"<\\/script")}function vE(t,n){const r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,c;for(;(c=o.exec(t))!==null;)a=c.index;return a}function Bg(t,n,r){const o=vE(t,n);return o===-1?t+r:t.slice(0,o)+r+t.slice(o)}function yE(t,n,r){let o=t;const a=`<script>${Ug(n)}<\/script>`;if(/<\/head>/i.test(o)?o=Bg(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const c=`<script>${Ug(r)}<\/script>`;o=Bg(o,"</body>",c)}return o}function xE(){const t=globalThis.crypto;return t&&typeof t.randomUUID=="function"?`tab-${t.randomUUID()}`:`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function wE(t){var r;if(!(t instanceof Ui)||t.status!==409)return null;const n=(r=t.body)==null?void 0:r.state;return n&&typeof n=="object"?n:null}function kE({appId:t,workspace:n=""}){const r=x.useRef(null),o=x.useRef({pinned:!1,data:null}),[a,c]=x.useState(null),[d,p]=x.useState(null),[g,m]=x.useState([]);x.useEffect(()=>{let S=!0;const C=xE(),b=E=>{const R=o.current.version;typeof E.version=="number"&&typeof R=="number"&&E.version<R||(o.current=E)};_w(t,E=>{var R,z;return(z=(R=r.current)==null?void 0:R.contentWindow)==null?void 0:z.postMessage(E,"*")},n);const N=async E=>{var K,$,Z,he,ce,ye,Se,Oe,J,re,oe,F,Q,G,D,P,le,W,X,ae,be,_e,Ae,je;if(E.source!==((K=r.current)==null?void 0:K.contentWindow))return;const R=E.data;if(!R||R.source!=="agentpane-app")return;if(R.report==="error"){const me={message:String(R.message??"Unknown error"),stack:String(R.stack??"")};m(pe=>{const Ve=pe[pe.length-1];return Ve&&Ve.message===me.message?pe:[...pe,me].slice(-20)});return}if(typeof R.method!="string")return;let z=!0,I,L,q=null;try{switch(R.method){case"getApp":I={id:t,workspace:n};break;case"getState":try{const me=await wm(t,n);b(me),I=me}catch{I=o.current}break;case"setState":{const me=(($=R.params)==null?void 0:$.data)??null,pe=(Z=R.params)==null?void 0:Z.ifVersion,Ve={data:me,writer:C};typeof pe=="number"&&(Ve.ifVersion=pe);try{const Ie=await yv(t,Ve,n);b(Ie),I=Ie}catch(Ie){if(q=wE(Ie),!q)throw Ie;b(q);const mt=Ie.body;throw new Error(typeof(mt==null?void 0:mt.error)=="string"?mt.error:"App state changed since that version")}break}case"createSession":{const me=R.params??{},pe=await Ud({title:typeof me.title=="string"?me.title:void 0,runtime_type:typeof me.runtime_type=="string"?me.runtime_type:void 0,model:typeof me.model=="string"?me.model:void 0,model_reasoning_effort:typeof me.model_reasoning_effort=="string"?me.model_reasoning_effort:void 0,cwd:typeof me.cwd=="string"?me.cwd:void 0,origin_app_id:t,origin_app_workspace:n});dl(pe.id,t),A.getState().addSession(pe),I=pe;break}case"submitTurn":{const me=String(((he=R.params)==null?void 0:he.sessionId)??"");if(!await km(t,me))throw new Error(`submitTurn: ${me} is not a session of this app`);const pe=String(((ce=R.params)==null?void 0:ce.prompt)??""),Ve=await hE(t,(ye=R.params)==null?void 0:ye.attachments,mt=>_k(t,mt)),Ie=await rv(me,pe,Ve.length?Ve:void 0,{originAppId:t});dl(me,t),I=Ie;break}case"getSession":{I=await km(t,String(((Se=R.params)==null?void 0:Se.sessionId)??""));break}case"listSessions":{const me=(Oe=R.params)==null?void 0:Oe.lifecycle,pe=(J=R.params)==null?void 0:J.running;I=await gk(t,n,{lifecycle:me==="working"||me==="finished"?me:void 0,running:typeof pe=="boolean"?pe:void 0});break}case"getSessionInfo":{I=await vk(t,n,String(((re=R.params)==null?void 0:re.sessionId)??""));break}case"cancelTurn":{I=await yk(t,String(((oe=R.params)==null?void 0:oe.sessionId)??""));break}case"setSessionLifecycle":{I=await xk(t,String(((F=R.params)==null?void 0:F.sessionId)??""),String(((Q=R.params)==null?void 0:Q.lifecycle)??""));break}case"callTool":{const me=(G=R.params)==null?void 0:G.args;I=await wk(t,n,String(((D=R.params)==null?void 0:D.tool)??""),me&&typeof me=="object"?me:{});break}case"listProviders":{I=await Fy();break}case"listModels":{const me=typeof((P=R.params)==null?void 0:P.runtime)=="string"?R.params.runtime.trim():"";if(!me)throw new Error("listModels: runtime is required");const pe=(le=R.params)==null?void 0:le.cwd;I=await gv(me,typeof pe=="string"&&pe?pe:void 0);break}case"pickDirectory":{if(A.getState().activeAppTabId!==t)throw new Error("pickDirectory: the app is not on screen — call it from a click in the app");I=await iv();break}case"resolveToolCall":{const me=String(((W=R.params)==null?void 0:W.callId)??""),pe=(X=R.params)==null?void 0:X.result;await Tk(me,pe),I={ok:!0};break}case"openSession":{if(A.getState().activeAppTabId!==t)throw new Error("openSession: the app is not on screen — call it from a click in the app");const me=typeof((ae=R.params)==null?void 0:ae.sessionId)=="string"?R.params.sessionId.trim():"";if(!me)throw new Error("openSession: sessionId is required");try{await A.getState().revealSession(me)}catch(pe){throw new Error(`openSession: ${pe instanceof Error?pe.message:String(pe)}`)}I={ok:!0};break}case"uploadFile":{const me=await pE((be=R.params)==null?void 0:be.file);try{I=Fg(await Ek(t,me))}catch(pe){throw new Error(`uploadFile: ${pe instanceof Error?pe.message:String(pe)}`)}break}case"getFile":{const me=Ky(t,(_e=R.params)==null?void 0:_e.ref),pe=me?await jk(t,me):null;I=pe?Fg(pe):null;break}default:throw new Error(`Unknown bridge method: ${R.method}`)}}catch(me){z=!1,L=me instanceof Error?me.message:String(me)}(je=(Ae=r.current)==null?void 0:Ae.contentWindow)==null||je.postMessage(q?{source:"agentpane-host",id:R.id,ok:z,error:L,code:"conflict",state:q}:{source:"agentpane-host",id:R.id,ok:z,result:I,error:L},"*")};return window.addEventListener("message",N),Ow(t,E=>{var R,z;typeof E.workspace=="string"&&E.workspace!==n||E.writer!==C&&((z=(R=r.current)==null?void 0:R.contentWindow)==null||z.postMessage({source:"agentpane-host",event:"state_changed",payload:typeof E.version=="number"?{version:E.version}:{}},"*"))}),Mw(t,()=>{xm(t).then(E=>{S&&(c(E),m([]))}).catch(()=>{})}),(async()=>{try{const[E,R,z]=await Promise.all([xm(t),wm(t,n),mk(t).catch(()=>[])]);if(!S)return;o.current=R,z.forEach(I=>dl(I.id,t)),c(E)}catch(E){S&&p(E instanceof Error?E.message:String(E))}})(),()=>{S=!1,Rw(t),Lw(t),Pw(t),window.removeEventListener("message",N)}},[t,n]),x.useEffect(()=>{a&&Aw(t,a.manifest.headlessSessions===!0)},[t,a]);const v=x.useMemo(()=>a?yE(a.html,gE({appId:t,apiOrigin:Vy()}),a.js):"",[a,t]);if(d)return l.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",d]});if(!v)return l.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[],y=k.some(S=>S.severity==="error");return l.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&l.jsxs("div",{className:`miniapp-diagnostics${y?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[l.jsx("div",{className:"miniapp-diagnostics-title",children:y?`Compile errors in ${(a==null?void 0:a.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((S,C)=>l.jsxs("div",{className:"miniapp-diag",children:[S.file,":",S.line,":",S.column," — ",S.message]},C))]}),l.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",allow:"loopback-network; local-network; local-network-access",title:`Mini app: ${t}`,srcDoc:v}),g.length>0&&l.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((S,C)=>l.jsxs("div",{className:"miniapp-rt-error",children:[l.jsx("div",{className:"miniapp-rt-error-message",children:S.message}),S.stack&&l.jsx("pre",{className:"miniapp-rt-error-stack",children:S.stack})]},C))})]})}function SE({appId:t,active:n}){const r=A(y=>y.apps),o=A(y=>y.workspaces),a=A(y=>y.appWorkspaces),c=A(y=>y.setAppWorkspace),d=A(y=>y.setActiveAppTab),p=A(y=>y.startAppEdit),g=r.find(y=>y.id===t),m=a[t]??"",v=o.filter(y=>y.deleted!==1),k=m!==""&&!v.some(y=>y.path===m)?m:null;return l.jsxs("div",{className:`miniapp-view ${n?"":"miniapp-view-hidden"}`,children:[l.jsxs("div",{className:"miniapp-header",children:[l.jsx(Do,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),l.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??t}),l.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:m,onChange:y=>c(t,y.target.value),children:[l.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(y=>l.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&l.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),l.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void p(t),children:[l.jsx(N1,{size:13}),"Edit"]}),l.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>d(null),children:l.jsx(Tn,{size:14})})]}),l.jsx("div",{className:"miniapp-body",children:l.jsx(kE,{appId:t,workspace:m},`${t}:${m}`)})]})}function bE({side:t,minWidth:n,maxWidth:r,getWidth:o,setWidth:a}){const[c,d]=x.useState(!1),p=x.useRef(0),g=x.useRef(0),m=x.useCallback(y=>{const S=y.clientX-p.current,C=t==="left"?g.current+S:g.current-S,b=Math.min(r,Math.max(n,C));a(b)},[t,n,r,a]),v=x.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),d(!1)},[m]);return{onPointerDown:x.useCallback(y=>{var S,C;y.preventDefault(),y.stopPropagation();try{(C=(S=y.currentTarget)==null?void 0:S.setPointerCapture)==null||C.call(S,y.pointerId)}catch{}p.current=y.clientX,g.current=o(),d(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:c}}function Wg({side:t,minWidth:n,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:c,dragging:d}=bE({side:t,minWidth:n,maxWidth:r,getWidth:o,setWidth:a});return l.jsx("div",{className:`resize-handle ${t}${d?" dragging":""}`,onPointerDown:c,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} panel`,"data-resizing":d?"":void 0})}const NE=x.lazy(()=>Kk(()=>import("./TerminalView-BN_4GKd9.js"),__vite__mapDeps([0,1])));function TE(){Lt.trackRender("IdeWorkspace");const t=A(S=>S.sidebarWidth),n=A(S=>S.rightPanelWidth),r=A(S=>S.setSidebarWidth),o=A(S=>S.setRightPanelWidth),a=A(S=>S.rightPanelCollapsed),c=A(S=>S.vscodeViewOpen),d=A(S=>S.usageViewOpen),p=A(S=>S.terminalViewOpen),[g,m]=x.useState(!1);p&&!g&&m(!0);const v=A(S=>S.activeAppTabId),k=A(S=>S.openAppTabs);x.useEffect(()=>{const S=()=>{const C=bl(),{rightPanelWidth:b,setRightPanelWidth:N}=A.getState();b>C&&N(C)};return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const y=a?`${t}px 6px 1fr ${lk}px`:`${t}px 6px 1fr 6px ${n}px`;return l.jsxs("div",{className:"ide-root",children:[l.jsx(lE,{}),l.jsxs("div",{className:`ide-layout ${c||d||p?"ide-hidden":""}`,style:{gridTemplateColumns:y},children:[l.jsx(Mb,{}),l.jsx(Wg,{side:"left",minWidth:pd,maxWidth:hd,getWidth:()=>A.getState().sidebarWidth,setWidth:r}),l.jsxs("div",{className:"ide-center",children:[l.jsx(Pb,{}),l.jsxs("div",{className:"ide-render",children:[k.map(S=>l.jsx(SE,{appId:S,active:v===S},S)),v==null&&l.jsx(XT,{})]}),l.jsx(iC,{})]}),!a&&l.jsx(Wg,{side:"right",minWidth:Sl,maxWidth:bl(),getWidth:()=>A.getState().rightPanelWidth,setWidth:o}),l.jsx(EC,{})]}),c&&l.jsx(OC,{}),d&&l.jsx(aE,{}),g&&l.jsx(x.Suspense,{fallback:null,children:l.jsx(NE,{visible:p})}),l.jsx(RC,{})]})}function CE(){const{showNewSessionDialog:t,setShowNewSessionDialog:n,createSession:r,lastModelConfig:o}=A(),a=(o==null?void 0:o.provider)??"codex",c=(o==null?void 0:o.model)??"",d=(o==null?void 0:o.reasoning)??"",[p,g]=x.useState(""),[m,v]=x.useState(c),[k,y]=x.useState(d),[S,C]=x.useState("");if(!t)return null;const b=wf(a),N=m?Id(a,m):[];function E(){r({title:p.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:S.trim()||void 0,runtime_type:a}),g(""),C("")}function R(I){I.key==="Escape"&&n(!1)}function z(I){var K;v(I);const L=Id(a,I);L.some($=>$.effort===k)||y(Dd(a,I)??((K=L[0])==null?void 0:K.effort)??"")}return l.jsx("div",{className:"dialog-overlay",onClick:()=>n(!1),children:l.jsxs("div",{className:"dialog",onClick:I=>I.stopPropagation(),onKeyDown:R,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"New Session"}),l.jsx("button",{className:"dialog-close",onClick:()=>n(!1),children:l.jsx(Tn,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.jsxs("label",{className:"dialog-label",children:["Title (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:p,onChange:I=>g(I.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),l.jsxs("label",{className:"dialog-label",children:["Model",l.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:I=>z(I.target.value),children:[l.jsx("option",{value:"",children:"Default (Codex picks)"}),b.map(I=>l.jsxs("option",{value:I.slug,children:[I.displayName," — ",I.description]},I.slug))]})]}),N.length>0&&l.jsxs("label",{className:"dialog-label",children:["Thinking Level",l.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:I=>y(I.target.value),children:[l.jsxs("option",{value:"",children:["Default (",Dd(a,m),")"]}),N.map(I=>l.jsx("option",{value:I.effort,children:I.label},I.effort))]})]}),l.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:S,onChange:I=>C(I.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>n(!1),children:"Cancel"}),l.jsx("button",{className:"dialog-btn-create",onClick:E,children:"Create"})]})]})})}function EE(t,n){const r=n!==""&&(t===n||t.startsWith(`${n}/`)),o=[r?{label:"~",path:n}:{label:"/",path:"/"}],a=t.slice(r?n.length:0);let c=o[0].path;for(const d of a.split("/").filter(Boolean))c=c==="/"?`/${d}`:`${c}/${d}`,o.push({label:d,path:c});return o}function jE(t){const n=t.filter(a=>a.deleted===0).at(-1);if(!n)return;const r=mr(n.path),o=r.lastIndexOf("/");return o>0?r.slice(0,o):void 0}function _E(){return A(n=>n.showAddWorkspaceDialog)?l.jsx(RE,{}):null}function RE(){var K;const t=A($=>$.setShowAddWorkspaceDialog),n=A($=>$.workspaces),r=A($=>$.createWorkspaceAt),o=A($=>$.addToast),[a,c]=x.useState(null),[d,p]=x.useState(!0),[g,m]=x.useState(null),[v,k]=x.useState(!1),y=x.useRef(0),[S]=x.useState(()=>jE(A.getState().workspaces)),C=x.useRef(null),b=x.useCallback(()=>{v||t(!1)},[v,t]);Io(b);const N=x.useCallback(async($,Z=!1)=>{const he=++y.current;p(!0);let ce=null,ye=null;try{ce=await tm($)}catch(Se){if(ye=$r(Se),Z&&$)try{ce=await tm(),ye=null}catch(Oe){ye=$r(Oe)}}he===y.current&&(ce&&c(ce),m(ye),p(!1))},[]);x.useEffect(()=>{N(S,!0)},[N,S]);const E=a==null?void 0:a.path;x.useEffect(()=>{C.current&&(C.current.scrollTop=0)},[E]);const R=new Set(n.filter($=>$.deleted===0).map($=>mr($.path)));async function z($){if(!v){k(!0),m(null);try{const Z=await r($);t(!1),o("success",`Workspace added — ${Z.path}`)}catch(Z){m($r(Z)),k(!1)}}}const I=a?EE(a.path,a.home):[],L=((K=I.at(-1))==null?void 0:K.label)??"",q=a!==null&&R.has(mr(a.path));return l.jsx("div",{className:"dialog-overlay",onClick:b,children:l.jsxs("div",{className:"dialog folder-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"folder-dialog-title",onClick:$=>$.stopPropagation(),children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",id:"folder-dialog-title",children:"Add workspace"}),l.jsx("button",{className:"dialog-close",onClick:b,"aria-label":"Close",disabled:v,children:l.jsx(Tn,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.jsxs("p",{className:"dialog-hint",children:["Choose a project folder",a&&l.jsxs(l.Fragment,{children:[" ","on ",l.jsx("strong",{children:a.hostname})]}),"."]}),l.jsxs("div",{className:"folder-nav",children:[l.jsx("button",{className:"folder-up",onClick:()=>(a==null?void 0:a.parent)&&void N(a.parent),disabled:!(a!=null&&a.parent),"aria-label":"Parent folder",title:"Parent folder",children:l.jsx(Cv,{size:14})}),l.jsx("nav",{className:"folder-crumbs","aria-label":"Folder path",children:I.map(($,Z)=>l.jsxs(x.Fragment,{children:[Z>0&&l.jsx(Li,{size:12,className:"folder-crumb-sep","aria-hidden":"true"}),Z===I.length-1?l.jsx("span",{className:"folder-crumb current","aria-current":"location",title:$.path,children:$.label}):l.jsx("button",{className:"folder-crumb",onClick:()=>void N($.path),title:$.path,children:$.label})]},$.path))}),d&&a&&l.jsx(hn,{size:14,className:"spin folder-spinner","aria-label":"Loading"})]}),l.jsx("ul",{ref:C,className:`folder-list${d&&a?" loading":""}`,"aria-label":"Folders",children:a?a.folders.length===0?l.jsx("li",{className:"folder-empty",children:"No folders here."}):a.folders.map($=>l.jsxs("li",{className:"folder-item",children:[l.jsxs("button",{className:"folder-row",onClick:()=>void N($.path),title:$.path,"aria-label":$.git?`${$.name} (git repository)`:$.name,children:[$.git?l.jsx(a1,{size:15,className:"folder-icon git","aria-hidden":"true"}):l.jsx(_l,{size:15,className:"folder-icon","aria-hidden":"true"}),l.jsx("span",{className:"folder-name",children:$.name}),l.jsx(Li,{size:13,className:"folder-chevron","aria-hidden":"true"})]}),R.has(mr($.path))?l.jsx("span",{className:"folder-tag",children:"Added"}):l.jsx("button",{className:"folder-add",onClick:()=>void z($.path),disabled:v,"aria-label":`Add ${$.name}`,children:"Add"})]},$.path)):d&&l.jsxs("li",{className:"folder-empty",role:"status",children:[l.jsx(hn,{size:14,className:"spin"})," Loading folders…"]})}),(a==null?void 0:a.truncated)&&l.jsxs("p",{className:"folder-note",children:["Showing the first ",a.folders.length," folders."]}),g&&l.jsx("p",{className:"folder-error",role:"alert",children:g})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:b,disabled:v,children:"Cancel"}),l.jsx("button",{className:"dialog-btn-create",onClick:()=>a&&void z(a.path),disabled:!a||d||v||q,children:v?"Adding…":q?"Already added":`Add “${L}”`})]})]})})}const Ld=6e4,Od=60*Ld,ul=24*Od;function AE(t,n=Date.now()){const r=Date.parse(t);if(Number.isNaN(r))return"";const o=Math.max(0,n-r);return o<Ld?"just now":o<Od?`${Math.floor(o/Ld)} min ago`:o<ul?`${Math.floor(o/Od)} h ago`:o<2*ul?"yesterday":o<7*ul?`${Math.floor(o/ul)} days ago`:new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function IE(){const t=A(n=>n.importSessionsWorkspace);return t?l.jsx(DE,{workspace:t},t):null}function DE({workspace:t}){const n=A(I=>I.setImportSessionsWorkspace),r=A(I=>I.importClaudeSessions),[o,a]=x.useState(null),[c,d]=x.useState(null),[p,g]=x.useState(new Set),[m,v]=x.useState(!1),[k,y]=x.useState(new Map),S=x.useCallback(()=>{m||n(null)},[m,n]);Io(S),x.useEffect(()=>{let I=!1;return mv(t).then(L=>{I||a(L)}).catch(L=>{I||d($r(L))}),()=>{I=!0}},[t]);function C(I){g(L=>{const q=new Set(L);return q.has(I)?q.delete(I):q.add(I),q})}const b=o??[],N=b.length>0&&b.every(I=>p.has(I.session_id));async function E(){const I=b.filter($=>p.has($.session_id)).map($=>$.session_id);if(I.length===0)return;v(!0);const{imported:L,failed:q}=await r(t,I);if(v(!1),q.length===0){n(null);return}const K=new Set(L.map($=>$.import_source_id));a($=>($??[]).filter(Z=>!K.has(Z.session_id))),g(new Set(q.map($=>$.id))),y(new Map(q.map($=>[$.id,$.error])))}const R=t.split("/").pop()||t,z=p.size;return l.jsx("div",{className:"dialog-overlay",onClick:S,children:l.jsxs("div",{className:"dialog import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"import-dialog-title",onClick:I=>I.stopPropagation(),children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",id:"import-dialog-title",children:"Import Claude Code sessions"}),l.jsx("button",{className:"dialog-close",onClick:S,"aria-label":"Close",disabled:m,children:l.jsx(Tn,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[l.jsxs("p",{className:"dialog-hint",children:["Sessions you started with ",l.jsx("code",{children:"claude"})," in ",l.jsx("strong",{title:t,children:R}),", in a terminal or an IDE. An imported session keeps its history and continues the same Claude conversation."]}),c?l.jsxs("p",{className:"import-error",role:"alert",children:["Could not list the sessions — ",c]}):o===null?l.jsxs("div",{className:"import-loading",role:"status",children:[l.jsx(hn,{size:14,className:"spin"})," Looking for sessions…"]}):o.length===0?l.jsxs("div",{className:"import-empty",children:["No Claude Code sessions to import here. Sessions you start with ",l.jsx("code",{children:"claude"})," in this folder will show up here."]}):l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"import-select-all",children:[l.jsx("input",{type:"checkbox",checked:N,disabled:m,onChange:()=>g(N?new Set:new Set(b.map(I=>I.session_id)))}),"Select all (",o.length,")"]}),l.jsx("ul",{className:"import-list",children:o.map(I=>{const L=k.get(I.session_id);return l.jsx("li",{children:l.jsxs("label",{className:`import-row${p.has(I.session_id)?" selected":""}`,children:[l.jsx("input",{type:"checkbox",checked:p.has(I.session_id),disabled:m,onChange:()=>C(I.session_id)}),l.jsxs("span",{className:"import-row-main",children:[l.jsx("span",{className:"import-row-title",title:I.title,children:I.title}),l.jsxs("span",{className:"import-row-meta",children:[l.jsx("span",{title:new Date(I.last_modified).toLocaleString(),children:AE(I.last_modified)}),I.git_branch&&l.jsxs("span",{className:"import-row-branch",title:"Git branch",children:[l.jsx(Av,{size:10})," ",I.git_branch]})]}),I.recently_active&&l.jsxs("span",{className:"import-row-warn",children:[l.jsx(Yl,{size:11})," Active in the last few minutes. If it is still open in a terminal, close it there first: both would write to the same session."]}),L&&l.jsx("span",{className:"import-row-error",role:"alert",children:L})]})]})},I.session_id)})})]})]}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:S,disabled:m,children:"Cancel"}),l.jsx("button",{className:"dialog-btn-create",onClick:()=>void E(),disabled:z===0||m,children:m?l.jsxs(l.Fragment,{children:[l.jsx(hn,{size:12,className:"spin"})," Importing…"]}):z>1?`Import ${z} sessions`:"Import"})]})]})})}const ME=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,LE=512*1024;function OE(t){const n=t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(n)?n:""}function PE(){const{appCatalogOpen:t,closeAppCatalog:n,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:c}=A(),[d,p]=x.useState("examples"),[g,m]=x.useState(null),[v,k]=x.useState(null),[y,S]=x.useState(!1),[C,b]=x.useState(""),[N,E]=x.useState(""),[R,z]=x.useState(""),[I,L]=x.useState(""),[q,K]=x.useState(null),[$,Z]=x.useState(""),he=x.useRef(null);if(x.useEffect(()=>{t&&(m(null),kk().then(m).catch(()=>m([])))},[t]),x.useEffect(()=>{he.current&&(he.current.webkitdirectory=!0)},[d]),!t)return null;const ce=new Set(r.map(F=>F.id));async function ye(F){k(F);try{await o(F)&&n()}finally{k(null)}}async function Se(){if(y)return;const F=C.trim(),Q=N.trim();if(!(!F||!Q)){S(!0);try{await a({id:F,title:Q,description:R.trim()||void 0,icon:I.trim()||void 0})&&(b(""),E(""),z(""),L(""),n())}finally{S(!1)}}}async function Oe(F){const Q=Array.from(F.target.files??[]),G={};let D="";for(const P of Q){const W=(P.webkitRelativePath??"").split("/");!D&&W.length>1&&(D=W[0]);const X=W[W.length-1];if(!(!X||!ME.test(X))&&!(P.size>LE))try{G[X]=await P.text()}catch{}}K(Object.keys(G).length>0?G:null),Z(OE(D))}async function J(){if(!(y||!q||!$.trim())){S(!0);try{await c($.trim(),q)&&(K(null),Z(""),n())}finally{S(!1)}}}function re(F){F.key==="Escape"&&n()}const oe=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return l.jsx("div",{className:"dialog-overlay",onClick:n,children:l.jsxs("div",{className:"dialog app-catalog",onClick:F=>F.stopPropagation(),onKeyDown:re,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Add Mini App"}),l.jsx("button",{className:"dialog-close",onClick:n,children:"✕"})]}),l.jsx("div",{className:"catalog-tabs",children:oe.map(F=>l.jsx("button",{className:`catalog-tab${d===F.key?" active":""}`,onClick:()=>p(F.key),children:F.label},F.key))}),l.jsxs("div",{className:"dialog-body catalog-body",children:[d==="examples"&&l.jsx("div",{className:"catalog-examples",children:g===null?l.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?l.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(F=>{const Q=ce.has(F.id);return l.jsxs("div",{className:"example-row",children:[l.jsx(Do,{iconNode:F.iconNode,size:14,className:"sidebar-app-icon"}),l.jsxs("div",{className:"example-info",children:[l.jsx("span",{className:"example-title",children:F.title}),F.description&&l.jsx("span",{className:"example-desc",children:F.description})]}),l.jsx("button",{className:"example-install",disabled:Q||v===F.id,onClick:()=>ye(F.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":v===F.id?"Installing…":"Install"})]},F.id)})}),d==="new"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["App id (folder name)",l.jsx("input",{className:"dialog-input",type:"text",value:C,onChange:F=>b(F.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),l.jsxs("label",{className:"dialog-label",children:["Title",l.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:F=>E(F.target.value),placeholder:"e.g. Todo List"})]}),l.jsxs("label",{className:"dialog-label",children:["Description (optional)",l.jsx("input",{className:"dialog-input",type:"text",value:R,onChange:F=>z(F.target.value),placeholder:"What does this app do?"})]}),l.jsxs("label",{className:"dialog-label",children:[l.jsxs("span",{children:["Icon (optional, a"," ",l.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),l.jsx("input",{className:"dialog-input",type:"text",value:I,onChange:F=>L(F.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),l.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!C.trim()||!N.trim(),onClick:Se,children:[l.jsx(pr,{size:13})," Create App"]})]}),d==="upload"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),l.jsx("input",{ref:he,type:"file",multiple:!0,onChange:Oe}),q&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["App id",l.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:F=>Z(F.target.value)})]}),l.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(q).length," file(s):"," ",Object.keys(q).slice(0,6).join(", "),Object.keys(q).length>6?", …":""]})]}),l.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!$.trim(),onClick:J,children:[l.jsx(A1,{size:13})," Import App"]})]})]}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-cancel",onClick:n,children:"Close"})})]})})}function $E(){const t=A(k=>k.showCommandPalette),n=A(k=>k.setShowCommandPalette),r=A(),[o,a]=x.useState(""),[c,d]=x.useState(0),p=x.useRef(null),g=x.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=Vl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:pr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:us,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Hi,action:()=>{const S=document.querySelector(".cmd-input");S==null||S.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Ur,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:m1,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:gr,action:()=>r.switchRightTab("sidecar"),available:!!r.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:r.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:S1,action:()=>r.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Tn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),m=x.useMemo(()=>{const k=o.toLowerCase().trim(),y=g.filter(S=>S.available);return k?y.filter(S=>S.label.toLowerCase().includes(k)||S.hint.toLowerCase().includes(k)):y},[g,o]);x.useEffect(()=>{t&&(a(""),d(0),setTimeout(()=>{var k;return(k=p.current)==null?void 0:k.focus()},50))},[t]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),d(y=>Math.min(y+1,m.length-1));else if(k.key==="ArrowUp")k.preventDefault(),d(y=>Math.max(y-1,0));else if(k.key==="Enter"){k.preventDefault();const y=m[c];y&&(y.action(),n(!1))}else k.key==="Escape"&&n(!1)}return t?l.jsx("div",{className:"palette-overlay",onClick:()=>n(!1),children:l.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[l.jsxs("div",{className:"palette-search",children:[l.jsx("input",{ref:p,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),d(0)},onKeyDown:v}),l.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?l.jsx("div",{className:"palette-empty",children:"No matching commands"}):l.jsx("div",{className:"palette-list",children:m.map((k,y)=>{const S=k.icon;return l.jsxs("div",{className:`palette-item ${y===c?"selected":""}`,onClick:()=>{k.action(),n(!1)},onMouseEnter:()=>d(y),children:[l.jsx("span",{className:"palette-item-icon",children:l.jsx(S,{size:16})}),l.jsx("span",{className:"palette-item-label",children:k.label}),l.jsx("span",{className:"palette-item-hint",children:k.hint}),y===c&&l.jsx(o1,{size:12,className:"palette-item-enter"})]},k.id)})}),l.jsxs("div",{className:"palette-footer",children:[l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"↑"}),l.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"↵"})," Select"]}),l.jsxs("span",{className:"palette-footer-hint",children:[l.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Hg=/^[a-z][a-z0-9-]{1,30}$/,zE=2e3;function FE(){const{showRemoteModal:t,setShowRemoteModal:n,selectSession:r}=A(),[o,a]=x.useState(null),[c,d]=x.useState(null),[p,g]=x.useState(!1),[m,v]=x.useState(!1),[k,y]=x.useState(!1),[S,C]=x.useState(!1),[b,N]=x.useState("main"),[E,R]=x.useState(""),[z,I]=x.useState(!1),[L,q]=x.useState(null),K=x.useRef(null);Wi(K,()=>C(!1),S);const $=m||k,Z=x.useCallback(async()=>{g(!0),d(null);try{const F=await fetch(`${mn()}/remote/status`,{headers:{Accept:"application/json"}});if(!F.ok)throw new Error(`status ${F.status}`);a(await F.json())}catch{a(null),d("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);x.useEffect(()=>{t&&(N("main"),q(null),Z())},[t,Z]);const he=L!==null&&L.state==="running";if(x.useEffect(()=>{if(!he)return;const F=setInterval(async()=>{try{const Q=await fetch(`${mn()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&q(await Q.json())}catch{}},zE);return()=>clearInterval(F)},[he]),!t)return null;const ce=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function ye(F){F.key==="Escape"&&n(!1)}async function Se(F){if(Hg.test(F)){I(!0);try{const Q=await fetch(`${mn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:F})});if(!Q.ok)throw new Error(`enable ${Q.status}`);q(await Q.json()),N("setup")}catch{d("Could not start the setup — check the daemon logs.")}finally{I(!1)}}}function Oe(){L!=null&&L.troubleshootingSessionId&&(r(L.troubleshootingSessionId),n(!1))}async function J(){v(!0);try{await fetch(`${mn()}/remote/disable`,{method:"POST"}),await Z()}catch{d("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function re(){if(C(!1),!!window.confirm(`Remove the tunnel completely?
|
|
832
|
-
|
|
833
|
-
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
834
|
-
|
|
835
|
-
This cannot be undone.`)){y(!0);try{const Q=await fetch(`${mn()}/remote/uninstall`,{method:"DELETE"});if(!Q.ok)throw new Error(`uninstall ${Q.status}`);await Z()}catch{d("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function oe(){if(!L)return l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",l.jsx("input",{className:"dialog-input",value:E,onChange:D=>R(D.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),l.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),l.jsxs("div",{className:"dialog-footer",children:[l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>N("main"),children:"Back"}),l.jsxs("button",{className:"dialog-btn-create",disabled:!Hg.test(E)||z,onClick:()=>void Se(E),children:[z?l.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const F=["detect","provision","install","verify","ready"],Q=F.indexOf(L.step),G=L.state==="ready";return l.jsxs(l.Fragment,{children:[L.state==="running"&&l.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx(hn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),L.state==="ready"&&l.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[l.jsx(Cs,{size:14})," Setup complete — you can close this window."]}),L.state==="ready"&&L.hostname&&l.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",l.jsx("a",{href:`https://${L.hostname}`,target:"_blank",rel:"noreferrer",children:L.hostname})]}),l.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:F.map((D,P)=>{const le=G||Q>-1&&P<Q,W=!G&&P===Q&&L.state==="running";return l.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:le||W?1:.4,color:le?"var(--green)":void 0},children:[le?l.jsx(Cs,{size:13}):W?l.jsx(hn,{size:13,className:"spin"}):l.jsx(s1,{size:9,style:{marginLeft:2,marginRight:2}}),D]},D)})}),L.logs.length>0&&l.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:L.logs.slice(-3).map(D=>D.message).join(`
|
|
836
|
-
`)}),L.state==="troubleshooting"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-create",onClick:Oe,children:"Open troubleshooting session"})})]}),L.state==="failed"&&l.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",L.error]}),l.jsx("div",{className:"dialog-footer",children:l.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void Z(),children:"Refresh status"})})]})}return l.jsx("div",{className:"dialog-overlay",onClick:()=>n(!1),children:l.jsxs("div",{className:"dialog",onClick:F=>F.stopPropagation(),onKeyDown:ye,children:[l.jsxs("div",{className:"dialog-header",children:[l.jsx("span",{className:"dialog-title",children:"Remote Access"}),l.jsx("button",{className:"dialog-close",onClick:()=>n(!1),children:l.jsx(Tn,{size:16})})]}),l.jsxs("div",{className:"dialog-body",children:[p&&l.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[l.jsx(hn,{size:14,className:"spin"})," Loading machine status…"]}),c&&l.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:c}),b==="setup"?oe():l.jsxs(l.Fragment,{children:[ce&&(o==null?void 0:o.tunnel.hostname)&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",l.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),l.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[l.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void J(),disabled:$,children:[m?l.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),l.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>C(F=>!F),disabled:$,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":S,children:k?l.jsx(hn,{size:14,className:"spin"}):l.jsx(_o,{size:14})}),S&&l.jsx("div",{ref:K,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:l.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void re(),children:[l.jsx(us,{size:12})," Remove tunnel"]})})]})]}),!ce&&l.jsx(l.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",l.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),l.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void Se(o.tunnel.mahlas),disabled:z,children:[z?l.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):l.jsx(Em,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>N("setup"),children:[l.jsx(Em,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),l.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const UE={success:t1,error:Xl,info:c1,warn:Yl},BE=4e3;function WE({toast:t}){const n=A(d=>d.removeToast),r=UE[t.type],o=x.useRef(null);x.useEffect(()=>{function d(){o.current=setTimeout(()=>n(t.id),BE)}return d(),()=>{o.current&&clearTimeout(o.current)}},[t.id,n]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function c(){o.current=setTimeout(()=>n(t.id),2e3)}return l.jsxs("div",{className:`toast toast-${t.type}`,onMouseEnter:a,onMouseLeave:c,children:[l.jsx(r,{size:16}),l.jsx("span",{className:"toast-message",children:t.message}),t.undoAction&&l.jsxs("button",{className:"toast-undo",onClick:()=>{var d;(d=t.undoAction)==null||d.call(t),n(t.id)},children:[l.jsx(R1,{size:12})," ",t.undoLabel||"Undo"]}),l.jsx("button",{className:"toast-close",onClick:()=>n(t.id),children:l.jsx(Tn,{size:14})})]})}function HE(){const t=A(n=>n.toasts);return t.length===0?null:l.jsx("div",{className:"toast-container",children:t.map(n=>l.jsx(WE,{toast:n},n.id))})}function VE(){const[t]=x.useState(nk),[n,r]=x.useState(!1),[o,a]=x.useState(!1),c=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(c.current),[]);async function d(){await Fi(fm)&&(r(!0),a(!0),clearTimeout(c.current),c.current=setTimeout(()=>r(!1),1500))}return l.jsxs("main",{className:"daemon-download",children:[l.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),t&&l.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg app to continue."}),l.jsxs("div",{className:"daemon-download-install",children:[t&&l.jsx("p",{className:"daemon-download-label",children:"Not installed? Run this in Terminal:"}),l.jsxs("div",{className:"daemon-download-cmd",onCopy:()=>a(!0),children:[l.jsx("span",{className:"daemon-download-prompt","aria-hidden":"true",children:"$"}),l.jsx("code",{children:fm}),l.jsx("button",{type:"button",className:`daemon-download-copy${n?" copied":""}`,onClick:()=>void d(),"aria-label":"Copy the install command",title:n?"Copied":"Copy",children:n?l.jsx(Cs,{size:15}):l.jsx(Oi,{size:15})})]}),!t&&l.jsx("p",{className:"daemon-download-meta",children:"Apple Silicon · macOS 13+"})]}),o&&l.jsx("p",{className:"daemon-download-hint",children:"Paste it into Terminal and press Return. Repoburg installs and opens in your menu bar."}),(t||o)&&l.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[l.jsx(hn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Jn=null,Ao=null,Ai=1e3;const KE=1e4;function Pd(){Jn&&(Jn.readyState===WebSocket.OPEN||Jn.readyState===WebSocket.CONNECTING)||(Jn=new WebSocket(Z0("/ws")),Jn.onopen=()=>{const t=Ai>1e3;if(Ai=1e3,A.getState().setWsConnected(!0),A.getState().addLogEntry("INFO","WebSocket connected"),t){$w();const n=A.getState();n.activeSessionId&&(n.refreshActiveSession(),n.addToast("info","WebSocket reconnected — session state reconciled"))}},Jn.onclose=()=>{A.getState().setWsConnected(!1),A.getState().addLogEntry("WARN","WebSocket disconnected"),A.getState().addToast("warn","WebSocket disconnected — reconnecting…"),qE()},Jn.onerror=()=>{},Jn.onmessage=t=>{try{const n=JSON.parse(t.data);Lt.trackWsEvent(typeof n.event=="string"?n.event:"unknown",typeof t.data=="string"?t.data.length:0);const r=XE[n.event];r&&r(n.data)}catch{}})}function GE(){Ao&&(clearTimeout(Ao),Ao=null),Jn&&(Jn.onclose=null,Jn.close(),Jn=null),A.getState().setWsConnected(!1)}function qE(){Ao||(Ao=window.setTimeout(()=>{Ao=null,Pd()},Ai),Ai=Math.min(Ai*2,KE))}const XE={"turn:created":t=>{const n=t;A.getState().onTurnCreated(n.sessionId,n.turn)},"turn:started":t=>{const n=t;Lt.note(`turn:started — ${n.turnId.slice(0,8)}`),A.getState().onTurnStarted(n.sessionId,n.turnId)},"item:started":t=>{const n=t;Fu(n.sessionId,n.turnId,n.item),A.getState().onItemStarted(n.sessionId,n.turnId,n.item)},"item:updated":t=>{const n=t;Fu(n.sessionId,n.turnId,n.item),A.getState().onItemUpdated(n.sessionId,n.turnId,n.item)},"item:completed":t=>{const n=t;Fu(n.sessionId,n.turnId,n.item),A.getState().onItemCompleted(n.sessionId,n.turnId,n.item)},"item:delta":t=>{const n=t,r=tw(n.sessionId,n.turnId,n.itemId,n.delta);A.getState().onItemDelta(n.sessionId,n.turnId,n.itemId,n.delta,r)},"streams:snapshot":t=>{const n=t,r=A.getState();for(const o of nw(n.sessionId??null,Array.isArray(n.streams)?n.streams:[]))r.onItemText(o.sessionId,o.turnId,o.itemId,o.text)},"widget:delta":t=>{const n=t;typeof n.itemId!="string"||typeof n.html!="string"||A.getState().onWidgetDelta(n.sessionId,n.turnId,n.itemId,typeof n.title=="string"?n.title:"",n.html)},"turn:completed":t=>{const n=t;Lt.note(`turn:completed — ${n.turnId.slice(0,8)}`),gi(n.sessionId,n.turnId),A.getState().onTurnCompleted(n.sessionId,n.turnId,n.usage,n.hasUnreviewed,n.response??void 0)},"turn:tokenUsage":t=>{const n=t;A.getState().onTokenUsageUpdated(n.sessionId,n.turnId,n.usage)},"turn:contextUsage":t=>{const n=t,r={totalTokens:n.totalTokens,contextWindow:n.contextWindow,percentage:n.percentage,...n.autoCompactThreshold?{autoCompactThreshold:n.autoCompactThreshold}:{}};A.getState().onContextUsageUpdated(n.sessionId,r)},"turn:failed":t=>{const n=t;gi(n.sessionId,n.turnId),A.getState().onTurnFailed(n.sessionId,n.turnId,n.error,n.resumeState)},"turn:interrupted":t=>{const n=t;Lt.note(`turn:interrupted — ${n.turnId.slice(0,8)} (${n.reason})`),gi(n.sessionId,n.turnId),A.getState().onTurnInterrupted(n.sessionId,n.turnId,{reason:n.reason,interruptedAt:n.interruptedAt,attempts:n.attempts,detail:n.detail??null,resumeAt:n.resumeAt??null})},"turn:resuming":t=>{const n=t;gi(n.sessionId,n.turnId),A.getState().onTurnResuming(n.sessionId,n.turnId,n.attempt)},"turn:resumed":t=>{const n=t;A.getState().onTurnResumed(n.sessionId,n.turnId)},"turn:retrying":t=>{const n=t;A.getState().onTurnRetrying(n.sessionId,n.turnId,{attempt:n.attempt,maxRetries:n.maxRetries,retryDelayMs:n.retryDelayMs,errorStatus:n.errorStatus??null,error:n.error??null})},"turn:cancelled":t=>{const n=t;gi(n.sessionId,n.turnId),A.getState().onTurnCancelled(n.sessionId,n.turnId)},"session:title":t=>{const n=t;A.getState().onSessionTitle(n.sessionId,n.title)},"session:touched":t=>{const n=t;A.getState().onSessionTouched(n.sessionId)},"session:created":t=>{const{session:n}=t;n.origin_app_id&&dl(n.id,n.origin_app_id),A.getState().addSession(n)},"session:resync":t=>{const n=t,r=A.getState();r.activeSessionId===n.sessionId&&r.refreshActiveSession()},"session:updated":t=>{const n=t;A.getState().onSessionUpdated(n.session)},background_tasks:t=>{const n=t;Lt.note(`background_tasks — ${n.tasks.length} live (${n.tasks.map(r=>r.task_type).join(", ")||"none"})`),A.getState().onBackgroundTasksChanged(n.sessionId,n.tasks)},"background_tasks:snapshot":t=>{const n=t;A.getState().onBackgroundTasksSnapshot(n.sessions??{})},"signed_out_turns:snapshot":t=>{const n=t;A.getState().onSignedOutTurnsSnapshot(n.turns??[])},"thread:created":t=>{const n=t;A.getState().onThreadCreated(n.sessionId,n.thread,n.turn)},"thread:followup":t=>{const n=t;A.getState().onThreadFollowup(n.sessionId,n.threadId,n.turn)},"thread:resolved":t=>{const n=t;A.getState().onThreadResolved(n.sessionId,n.threadId,n.status)},"thread:deleted":t=>{const n=t;A.getState().onThreadDeleted(n.sessionId,n.threadId)},"app:tool_call":t=>{const n=t;Iw(n.appId,n.callId,n.tool,n.args??{},n.workspace,n.caller)},"app:source:updated":t=>{zw(t.appId),A.getState().refreshApps()},"app:state_changed":t=>{const{appId:n,...r}=t;hv(n,r)}};function YE(){const t=A(n=>n.init);return x.useEffect(()=>{Y0();function n(){t(),Pd()}const{daemonStatus:r,setDaemonStatus:o}=A.getState();let a=null;r==="ready"?n():a=rk({onMissing:()=>o("missing"),onReady:()=>{o("ready"),n()}});function c(){if(document.visibilityState!=="visible")return;const d=A.getState(),p=d.activeSessionId;if(!p)return;const g=d.sessionDetails[p];d.wsConnected||Pd(),g&&g.is_running===1&&(d.refreshActiveSession(),d.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",c),()=>{a==null||a(),GE(),document.removeEventListener("visibilitychange",c)}},[t]),null}const Xy="agentpaneView";function $d(t){return{tab:Bd(t),vscode:t.vscodeViewOpen,usage:t.usageViewOpen,terminal:t.terminalViewOpen}}function Yy(t,n){return t.tab===n.tab&&t.vscode===n.vscode&&t.usage===n.usage&&t.terminal===n.terminal}function Vg(t){return t.tab===null&&!t.vscode&&!t.usage&&!t.terminal}function Kg(t,n){return n.tab!==null&&!t.tabOrder.includes(n.tab)?!1:!Yy(n,$d(t))}function Gg(t){const n=t==null?void 0:t[Xy];return typeof(n==null?void 0:n.index)!="number"?null:{...n,view:{...n.view,terminal:!!n.view.terminal}}}function QE(t,n){t.getState().vscodeViewOpen!==n.vscode&&t.getState().toggleVscodeView(),t.getState().usageViewOpen!==n.usage&&t.getState().toggleUsageView(),t.getState().terminalViewOpen!==n.terminal&&t.getState().toggleTerminalView();const r=t.getState();if(n.tab===null)return;const{kind:o,id:a}=hr(n.tab);o==="app"?r.openAppTab(a):r.activeSessionId===a?r.setActiveAppTab(null):r.selectSession(a)}function ZE(t){let n=Gg(window.history.state)??{index:0,newest:0,view:$d(t.getState())},r=n.newest,o=!1;const a=new Map([[n.index,n.view]]),c=y=>{const S=t.getState();for(let C=n.index+y;C>=0&&C<=r;C+=y){const b=a.get(C);if(!b||Kg(S,b))return!0}return!1},d=()=>{const y=c(-1),S=c(1),C=t.getState();(C.canGoBack!==y||C.canGoForward!==S)&&t.setState({canGoBack:y,canGoForward:S})},p=()=>({[Xy]:{...n,newest:r}}),g=()=>{window.history.replaceState({...window.history.state,...p()},"")},m=y=>{if(a.set(n.index,n.view),Vg(n.view))n={...n,view:y},g();else{n={index:n.index+1,newest:n.index+1,view:y},r=n.index;for(const S of a.keys())S>r&&a.delete(S);window.history.pushState(p(),"")}a.set(n.index,y)},v=y=>{const S=Gg(y.state);if(!S)return;a.set(S.index,S.view),r=Math.max(r,S.index);const C=t.getState(),b=Math.sign(S.index-n.index);if(b!==0&&!Kg(C,S.view)){const N=S.index+b;window.history.go(N<0||N>r?n.index-S.index:b);return}n=S,g(),o=!0;try{QE(t,S.view)}finally{o=!1}d()};g(),d(),window.addEventListener("popstate",v);const k=t.subscribe((y,S)=>{const C=y.activeSessionId!==S.activeSessionId||y.activeAppTabId!==S.activeAppTabId||y.vscodeViewOpen!==S.vscodeViewOpen||y.usageViewOpen!==S.usageViewOpen||y.terminalViewOpen!==S.terminalViewOpen;if(!(!C&&y.tabOrder===S.tabOrder)){if(C&&!o){const b=$d(y);!Vg(b)&&!Yy(b,n.view)&&m(b)}d()}});return()=>{k(),window.removeEventListener("popstate",v)}}function JE(){const t=A(c=>c.loading),n=A(c=>c.error),r=A(c=>c.sessions),o=A(c=>c.daemonStatus),a=A(c=>c.setShowCommandPalette);return x.useEffect(()=>Lt.start(),[]),x.useEffect(()=>ZE(A),[]),x.useEffect(()=>{function c(d){(d.metaKey||d.ctrlKey)&&d.key==="k"&&(d.preventDefault(),a(!0))}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),l.jsxs(l.Fragment,{children:[l.jsx(YE,{}),o==="missing"?l.jsx(VE,{}):o==="checking"||t&&r.length===0?l.jsx("div",{className:"empty-state",children:"Loading sessions…"}):n&&r.length===0?l.jsxs("div",{className:"empty-state",children:["Error: ",n]}):l.jsxs(l.Fragment,{children:[l.jsx(TE,{}),l.jsx(CE,{}),l.jsx(_E,{}),l.jsx(IE,{}),l.jsx(PE,{}),l.jsx(FE,{}),l.jsx($E,{}),l.jsx(HE,{})]})]})}z0.createRoot(document.getElementById("root")).render(l.jsx(ct.StrictMode,{children:l.jsx(JE,{})}));export{Pi as R,Tn as X,Z0 as b,ve as c,l as j,x as r,A as u};
|