repoburg 1.3.281 → 1.3.283

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.
@@ -0,0 +1,649 @@
1
+ var zx=Object.defineProperty;var Fx=(t,s,r)=>s in t?zx(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r;var rt=(t,s,r)=>Fx(t,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();function mg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xu={exports:{}},lo={},wu={exports:{}},We={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mh;function Ux(){if(mh)return We;mh=1;var t=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=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(C){return C===null||typeof C!="object"?null:(C=k&&C[k]||C["@@iterator"],typeof C=="function"?C:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,E={};function T(C,P,se){this.props=C,this.context=P,this.refs=E,this.updater=se||S}T.prototype.isReactComponent={},T.prototype.setState=function(C,P){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,P,"setState")},T.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function I(){}I.prototype=T.prototype;function R(C,P,se){this.props=C,this.context=P,this.refs=E,this.updater=se||S}var U=R.prototype=new I;U.constructor=R,N(U,T.prototype),U.isPureReactComponent=!0;var A=Array.isArray,L=Object.prototype.hasOwnProperty,q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function $(C,P,se){var de,X={},fe=null,Te=null;if(P!=null)for(de in P.ref!==void 0&&(Te=P.ref),P.key!==void 0&&(fe=""+P.key),P)L.call(P,de)&&!K.hasOwnProperty(de)&&(X[de]=P[de]);var Ee=arguments.length-2;if(Ee===1)X.children=se;else if(1<Ee){for(var Re=Array(Ee),Ce=0;Ce<Ee;Ce++)Re[Ce]=arguments[Ce+2];X.children=Re}if(C&&C.defaultProps)for(de in Ee=C.defaultProps,Ee)X[de]===void 0&&(X[de]=Ee[de]);return{$$typeof:t,type:C,key:fe,ref:Te,props:X,_owner:q.current}}function ne(C,P){return{$$typeof:t,type:C.type,key:P,ref:C.ref,props:C.props,_owner:C._owner}}function pe(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function G(C){var P={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(se){return P[se]})}var ve=/\/+/g;function we(C,P){return typeof C=="object"&&C!==null&&C.key!=null?G(""+C.key):P.toString(36)}function Oe(C,P,se,de,X){var fe=typeof C;(fe==="undefined"||fe==="boolean")&&(C=null);var Te=!1;if(C===null)Te=!0;else switch(fe){case"string":case"number":Te=!0;break;case"object":switch(C.$$typeof){case t:case s:Te=!0}}if(Te)return Te=C,X=X(Te),C=de===""?"."+we(Te,0):de,A(X)?(se="",C!=null&&(se=C.replace(ve,"$&/")+"/"),Oe(X,P,se,"",function(Ce){return Ce})):X!=null&&(pe(X)&&(X=ne(X,se+(!X.key||Te&&Te.key===X.key?"":(""+X.key).replace(ve,"$&/")+"/")+C)),P.push(X)),1;if(Te=0,de=de===""?".":de+":",A(C))for(var Ee=0;Ee<C.length;Ee++){fe=C[Ee];var Re=de+we(fe,Ee);Te+=Oe(fe,P,se,Re,X)}else if(Re=y(C),typeof Re=="function")for(C=Re.call(C),Ee=0;!(fe=C.next()).done;)fe=fe.value,Re=de+we(fe,Ee++),Te+=Oe(fe,P,se,Re,X);else if(fe==="object")throw P=String(C),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return Te}function te(C,P,se){if(C==null)return C;var de=[],X=0;return Oe(C,de,"","",function(fe){return P.call(se,fe,X++)}),de}function oe(C){if(C._status===-1){var P=C._result;P=P(),P.then(function(se){(C._status===0||C._status===-1)&&(C._status=1,C._result=se)},function(se){(C._status===0||C._status===-1)&&(C._status=2,C._result=se)}),C._status===-1&&(C._status=0,C._result=P)}if(C._status===1)return C._result.default;throw C._result}var ae={current:null},z={transition:null},Q={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:z,ReactCurrentOwner:q};function W(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:te,forEach:function(C,P,se){te(C,function(){P.apply(this,arguments)},se)},count:function(C){var P=0;return te(C,function(){P++}),P},toArray:function(C){return te(C,function(P){return P})||[]},only:function(C){if(!pe(C))throw Error("React.Children.only expected to receive a single React element child.");return C}},We.Component=T,We.Fragment=r,We.Profiler=l,We.PureComponent=R,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q,We.act=W,We.cloneElement=function(C,P,se){if(C==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+C+".");var de=N({},C.props),X=C.key,fe=C.ref,Te=C._owner;if(P!=null){if(P.ref!==void 0&&(fe=P.ref,Te=q.current),P.key!==void 0&&(X=""+P.key),C.type&&C.type.defaultProps)var Ee=C.type.defaultProps;for(Re in P)L.call(P,Re)&&!K.hasOwnProperty(Re)&&(de[Re]=P[Re]===void 0&&Ee!==void 0?Ee[Re]:P[Re])}var Re=arguments.length-2;if(Re===1)de.children=se;else if(1<Re){Ee=Array(Re);for(var Ce=0;Ce<Re;Ce++)Ee[Ce]=arguments[Ce+2];de.children=Ee}return{$$typeof:t,type:C.type,key:X,ref:fe,props:de,_owner:Te}},We.createContext=function(C){return C={$$typeof:d,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},C.Provider={$$typeof:u,_context:C},C.Consumer=C},We.createElement=$,We.createFactory=function(C){var P=$.bind(null,C);return P.type=C,P},We.createRef=function(){return{current:null}},We.forwardRef=function(C){return{$$typeof:p,render:C}},We.isValidElement=pe,We.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:oe}},We.memo=function(C,P){return{$$typeof:m,type:C,compare:P===void 0?null:P}},We.startTransition=function(C){var P=z.transition;z.transition={};try{C()}finally{z.transition=P}},We.unstable_act=W,We.useCallback=function(C,P){return ae.current.useCallback(C,P)},We.useContext=function(C){return ae.current.useContext(C)},We.useDebugValue=function(){},We.useDeferredValue=function(C){return ae.current.useDeferredValue(C)},We.useEffect=function(C,P){return ae.current.useEffect(C,P)},We.useId=function(){return ae.current.useId()},We.useImperativeHandle=function(C,P,se){return ae.current.useImperativeHandle(C,P,se)},We.useInsertionEffect=function(C,P){return ae.current.useInsertionEffect(C,P)},We.useLayoutEffect=function(C,P){return ae.current.useLayoutEffect(C,P)},We.useMemo=function(C,P){return ae.current.useMemo(C,P)},We.useReducer=function(C,P,se){return ae.current.useReducer(C,P,se)},We.useRef=function(C){return ae.current.useRef(C)},We.useState=function(C){return ae.current.useState(C)},We.useSyncExternalStore=function(C,P,se){return ae.current.useSyncExternalStore(C,P,se)},We.useTransition=function(){return ae.current.useTransition()},We.version="18.3.1",We}var gh;function vd(){return gh||(gh=1,wu.exports=Ux()),wu.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var vh;function Bx(){if(vh)return lo;vh=1;var t=vd(),s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={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)&&!u.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:s,type:p,key:y,ref:S,props:k,_owner:l.current}}return lo.Fragment=r,lo.jsx=d,lo.jsxs=d,lo}var yh;function Wx(){return yh||(yh=1,xu.exports=Bx()),xu.exports}var a=Wx(),x=vd();const ot=mg(x);var Wa={},ku={exports:{}},An={},Su={exports:{}},bu={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var xh;function Hx(){return xh||(xh=1,(function(t){function s(z,Q){var W=z.length;z.push(Q);e:for(;0<W;){var C=W-1>>>1,P=z[C];if(0<l(P,Q))z[C]=Q,z[W]=P,W=C;else break e}}function r(z){return z.length===0?null:z[0]}function o(z){if(z.length===0)return null;var Q=z[0],W=z.pop();if(W!==Q){z[0]=W;e:for(var C=0,P=z.length,se=P>>>1;C<se;){var de=2*(C+1)-1,X=z[de],fe=de+1,Te=z[fe];if(0>l(X,W))fe<P&&0>l(Te,X)?(z[C]=Te,z[fe]=W,C=fe):(z[C]=X,z[de]=W,C=de);else if(fe<P&&0>l(Te,W))z[C]=Te,z[fe]=W,C=fe;else break e}}return Q}function l(z,Q){var W=z.sortIndex-Q.sortIndex;return W!==0?W:z.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.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,N=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,I=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 U(z){for(var Q=r(m);Q!==null;){if(Q.callback===null)o(m);else if(Q.startTime<=z)o(m),Q.sortIndex=Q.expirationTime,s(g,Q);else break;Q=r(m)}}function A(z){if(E=!1,U(z),!N)if(r(g)!==null)N=!0,oe(L);else{var Q=r(m);Q!==null&&ae(A,Q.startTime-z)}}function L(z,Q){N=!1,E&&(E=!1,I($),$=-1),S=!0;var W=y;try{for(U(Q),k=r(g);k!==null&&(!(k.expirationTime>Q)||z&&!G());){var C=k.callback;if(typeof C=="function"){k.callback=null,y=k.priorityLevel;var P=C(k.expirationTime<=Q);Q=t.unstable_now(),typeof P=="function"?k.callback=P:k===r(g)&&o(g),U(Q)}else o(g);k=r(g)}if(k!==null)var se=!0;else{var de=r(m);de!==null&&ae(A,de.startTime-Q),se=!1}return se}finally{k=null,y=W,S=!1}}var q=!1,K=null,$=-1,ne=5,pe=-1;function G(){return!(t.unstable_now()-pe<ne)}function ve(){if(K!==null){var z=t.unstable_now();pe=z;var Q=!0;try{Q=K(!0,z)}finally{Q?we():(q=!1,K=null)}}else q=!1}var we;if(typeof R=="function")we=function(){R(ve)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,te=Oe.port2;Oe.port1.onmessage=ve,we=function(){te.postMessage(null)}}else we=function(){T(ve,0)};function oe(z){K=z,q||(q=!0,we())}function ae(z,Q){$=T(function(){z(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(z){z.callback=null},t.unstable_continueExecution=function(){N||S||(N=!0,oe(L))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_getFirstCallbackNode=function(){return r(g)},t.unstable_next=function(z){switch(y){case 1:case 2:case 3:var Q=3;break;default:Q=y}var W=y;y=Q;try{return z()}finally{y=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,Q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var W=y;y=z;try{return Q()}finally{y=W}},t.unstable_scheduleCallback=function(z,Q,W){var C=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?C+W:C):W=C,z){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=W+P,z={id:v++,callback:Q,priorityLevel:z,startTime:W,expirationTime:P,sortIndex:-1},W>C?(z.sortIndex=W,s(m,z),r(g)===null&&z===r(m)&&(E?(I($),$=-1):E=!0,ae(A,W-C))):(z.sortIndex=P,s(g,z),N||S||(N=!0,oe(L))),z},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(z){var Q=y;return function(){var W=y;y=Q;try{return z.apply(this,arguments)}finally{y=W}}}})(bu)),bu}var wh;function Vx(){return wh||(wh=1,Su.exports=Hx()),Su.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var kh;function Gx(){if(kh)return An;kh=1;var t=vd(),s=Vx();function r(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,l={};function u(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(l[e]=n,e=0;e<n.length;e++)o.add(n[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,n,i,c){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return c?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function N(e,n,i,c){if(n===null||typeof n>"u"||S(e,n,i,c))return!0;if(c)return!1;if(i!==null)switch(i.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function E(e,n,i,c,f,h,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=c,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=h,this.removeEmptyString=w}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];T[n]=new E(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new E(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){T[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([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 n=e.replace(I,R);T[n]=new E(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(I,R);T[n]=new E(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(I,R);T[n]=new E(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,n,i,c){var f=T.hasOwnProperty(n)?T[n]:null;(f!==null?f.type!==0:c||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(N(n,i,f,c)&&(i=null),c||f===null?y(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(n=f.attributeName,c=f.attributeNamespace,i===null?e.removeAttribute(n):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,c?e.setAttributeNS(c,n,i):e.setAttribute(n,i))))}var A=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"),ne=Symbol.for("react.profiler"),pe=Symbol.for("react.provider"),G=Symbol.for("react.context"),ve=Symbol.for("react.forward_ref"),we=Symbol.for("react.suspense"),Oe=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),z=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var W=Object.assign,C;function P(e){if(C===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);C=n&&n[1]||""}return`
34
+ `+C+e}var se=!1;function de(e,n){if(!e||se)return"";se=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(V){var c=V}Reflect.construct(e,[],n)}else{try{n.call()}catch(V){c=V}e.call(n.prototype)}else{try{throw Error()}catch(V){c=V}e()}}catch(V){if(V&&c&&typeof V.stack=="string"){for(var f=V.stack.split(`
35
+ `),h=c.stack.split(`
36
+ `),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 D=`
37
+ `+f[w].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=w&&0<=j);break}}}finally{se=!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=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function fe(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 ne:return"Profiler";case $:return"StrictMode";case we:return"Suspense";case Oe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case G:return(e.displayName||"Context")+".Consumer";case pe:return(e._context.displayName||"Context")+".Provider";case ve:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case oe:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}function Te(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(n);case 8:return n===$?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function Ee(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Re(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ce(e){var n=Re(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),c=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,h=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){c=""+w,h.call(this,w)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function at(e){e._valueTracker||(e._valueTracker=Ce(e))}function Me(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),c="";return e&&(c=Re(e)?e.checked?"true":"false":e.value),e=c,e!==i?(n.setValue(e),!0):!1}function lt(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 $e(e,n){var i=n.checked;return W({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function en(e,n){var i=n.defaultValue==null?"":n.defaultValue,c=n.checked!=null?n.checked:n.defaultChecked;i=Ee(n.value!=null?n.value:i),e._wrapperState={initialChecked:c,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Fe(e,n){n=n.checked,n!=null&&U(e,"checked",n,!1)}function Ht(e,n){Fe(e,n);var i=Ee(n.value),c=n.type;if(i!=null)c==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(c==="submit"||c==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?wt(e,n.type,i):n.hasOwnProperty("defaultValue")&&wt(e,n.type,Ee(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function tn(e,n,i){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var c=n.type;if(!(c!=="submit"&&c!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function wt(e,n,i){(n!=="number"||lt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var jt=Array.isArray;function $t(e,n,i,c){if(e=e.options,n){n={};for(var f=0;f<i.length;f++)n["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=n.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&c&&(e[i].defaultSelected=!0)}else{for(i=""+Ee(i),n=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,c&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Dt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(r(91));return W({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Y(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(r(92));if(jt(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:Ee(i)}}function he(e,n){var i=Ee(n.value),c=Ee(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),c!=null&&(e.defaultValue=""+c)}function Ue(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function tt(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 mt(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gt,Ct=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,c,f){MSApp.execUnsafeLocalFunction(function(){return e(n,i,c,f)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=gt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function an(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}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(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),dt[n]=dt[e]})});function Dn(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||dt.hasOwnProperty(e)&&dt[e]?(""+n).trim():n+"px"}function ps(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var c=i.indexOf("--")===0,f=Dn(i,n[i],c);i==="float"&&(i="cssFloat"),c?e.setProperty(i,f):e[i]=f}}var hs=W({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 ts(e,n){if(n){if(hs[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(r(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(r(61))}if(n.style!=null&&typeof n.style!="object")throw Error(r(62))}}function Ln(e,n){if(e.indexOf("-")===-1)return typeof n.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 Vt=null,vn=null,Xe=null;function Et(e){if(e=Ki(e)){if(typeof Vt!="function")throw Error(r(280));var n=e.stateNode;n&&(n=ra(n),Vt(e.stateNode,e.type,n))}}function ft(e){vn?Xe?Xe.push(e):Xe=[e]:vn=e}function Gt(){if(vn){var e=vn,n=Xe;if(Xe=vn=null,Et(e),n)for(e=0;e<n.length;e++)Et(n[e])}}function vt(e,n){return e(n)}function yt(){}var it=!1;function Kt(e,n,i){if(it)return e(n,i);it=!0;try{return vt(e,n,i)}finally{it=!1,(vn!==null||Xe!==null)&&(yt(),Gt())}}function st(e,n){var i=e.stateNode;if(i===null)return null;var c=ra(i);if(c===null)return null;i=c[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(r(231,n,typeof i));return i}var Lt=!1;if(p)try{var _={};Object.defineProperty(_,"passive",{get:function(){Lt=!0}}),window.addEventListener("test",_,_),window.removeEventListener("test",_,_)}catch{Lt=!1}function ue(e,n,i,c,f,h,w,j,D){var V=Array.prototype.slice.call(arguments,3);try{n.apply(i,V)}catch(ee){this.onError(ee)}}var ie=!1,ye=null,De=!1,Ge=null,Le={onError:function(e){ie=!0,ye=e}};function zt(e,n,i,c,f,h,w,j,D){ie=!1,ye=null,ue.apply(Le,arguments)}function On(e,n,i,c,f,h,w,j,D){if(zt.apply(this,arguments),ie){if(ie){var V=ye;ie=!1,ye=null}else throw Error(r(198));De||(De=!0,Ge=V)}}function Be(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function yn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Cs(e){if(Be(e)!==e)throw Error(r(188))}function Us(e){var n=e.alternate;if(!n){if(n=Be(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,c=n;;){var f=i.return;if(f===null)break;var h=f.alternate;if(h===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===i)return Cs(f),e;if(h===c)return Cs(f),n;h=h.sibling}throw Error(r(188))}if(i.return!==c.return)i=f,c=h;else{for(var w=!1,j=f.child;j;){if(j===i){w=!0,i=f,c=h;break}if(j===c){w=!0,c=f,i=h;break}j=j.sibling}if(!w){for(j=h.child;j;){if(j===i){w=!0,i=h,c=f;break}if(j===c){w=!0,c=h,i=f;break}j=j.sibling}if(!w)throw Error(r(189))}}if(i.alternate!==c)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function Pn(e){return e=Us(e),e!==null?ms(e):null}function ms(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ms(e);if(n!==null)return n;e=e.sibling}return null}var Qe=s.unstable_scheduleCallback,_t=s.unstable_cancelCallback,gs=s.unstable_shouldYield,Hl=s.unstable_requestPaint,kt=s.unstable_now,vs=s.unstable_getCurrentPriorityLevel,Bs=s.unstable_ImmediatePriority,ys=s.unstable_UserBlockingPriority,Ur=s.unstable_NormalPriority,gr=s.unstable_LowPriority,Fo=s.unstable_IdlePriority,vr=null,$n=null;function Br(e){if($n&&typeof $n.onCommitFiberRoot=="function")try{$n.onCommitFiberRoot(vr,e,void 0,(e.current.flags&128)===128)}catch{}}var xn=Math.clz32?Math.clz32:yr,Wr=Math.log,Ws=Math.LN2;function yr(e){return e>>>=0,e===0?32:31-(Wr(e)/Ws|0)|0}var wn=64,Hr=4194304;function xr(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 wr(e,n){var i=e.pendingLanes;if(i===0)return 0;var c=0,f=e.suspendedLanes,h=e.pingedLanes,w=i&268435455;if(w!==0){var j=w&~f;j!==0?c=xr(j):(h&=w,h!==0&&(c=xr(h)))}else w=i&~f,w!==0?c=xr(w):h!==0&&(c=xr(h));if(c===0)return 0;if(n!==0&&n!==c&&(n&f)===0&&(f=c&-c,h=n&-n,f>=h||f===16&&(h&4194240)!==0))return n;if((c&4)!==0&&(c|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=c;0<n;)i=31-xn(n),f=1<<i,c|=e[i],n&=~f;return c}function Uo(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 Bo(e,n){for(var i=e.suspendedLanes,c=e.pingedLanes,f=e.expirationTimes,h=e.pendingLanes;0<h;){var w=31-xn(h),j=1<<w,D=f[w];D===-1?((j&i)===0||(j&c)!==0)&&(f[w]=Uo(j,n)):D<=n&&(e.expiredLanes|=j),h&=~j}}function Ri(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Ai(){var e=wn;return wn<<=1,(wn&4194240)===0&&(wn=64),e}function Ii(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function kr(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-xn(n),e[n]=i}function Wo(e,n){var i=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var c=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-xn(i),h=1<<f;n[f]=0,c[f]=-1,e[f]=-1,i&=~h}}function Hs(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var c=31-xn(i),f=1<<c;f&n|e[c]&n&&(e[c]|=n),i&=~f}}var Ke=0;function le(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var b,F,Z,Se,je,ze=!1,qe=[],Ze=null,St=null,bt=null,Es=new Map,At=new Map,Vs=[],ay="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 Qd(e,n){switch(e){case"focusin":case"focusout":Ze=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":Es.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(n.pointerId)}}function Mi(e,n,i,c,f,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:i,eventSystemFlags:c,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ki(n),n!==null&&F(n)),e):(e.eventSystemFlags|=c,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function ly(e,n,i,c,f){switch(n){case"focusin":return Ze=Mi(Ze,e,n,i,c,f),!0;case"dragenter":return St=Mi(St,e,n,i,c,f),!0;case"mouseover":return bt=Mi(bt,e,n,i,c,f),!0;case"pointerover":var h=f.pointerId;return Es.set(h,Mi(Es.get(h)||null,e,n,i,c,f)),!0;case"gotpointercapture":return h=f.pointerId,At.set(h,Mi(At.get(h)||null,e,n,i,c,f)),!0}return!1}function Zd(e){var n=Sr(e.target);if(n!==null){var i=Be(n);if(i!==null){if(n=i.tag,n===13){if(n=yn(i),n!==null){e.blockedOn=n,je(e.priority,function(){Z(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ho(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Gl(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var c=new i.constructor(i.type,i);gn=c,i.target.dispatchEvent(c),gn=null}else return n=Ki(i),n!==null&&F(n),e.blockedOn=i,!1;n.shift()}return!0}function Jd(e,n,i){Ho(e)&&i.delete(n)}function cy(){ze=!1,Ze!==null&&Ho(Ze)&&(Ze=null),St!==null&&Ho(St)&&(St=null),bt!==null&&Ho(bt)&&(bt=null),Es.forEach(Jd),At.forEach(Jd)}function Di(e,n){e.blockedOn===n&&(e.blockedOn=null,ze||(ze=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,cy)))}function Li(e){function n(f){return Di(f,e)}if(0<qe.length){Di(qe[0],e);for(var i=1;i<qe.length;i++){var c=qe[i];c.blockedOn===e&&(c.blockedOn=null)}}for(Ze!==null&&Di(Ze,e),St!==null&&Di(St,e),bt!==null&&Di(bt,e),Es.forEach(n),At.forEach(n),i=0;i<Vs.length;i++)c=Vs[i],c.blockedOn===e&&(c.blockedOn=null);for(;0<Vs.length&&(i=Vs[0],i.blockedOn===null);)Zd(i),i.blockedOn===null&&Vs.shift()}var Vr=A.ReactCurrentBatchConfig,Vo=!0;function uy(e,n,i,c){var f=Ke,h=Vr.transition;Vr.transition=null;try{Ke=1,Vl(e,n,i,c)}finally{Ke=f,Vr.transition=h}}function dy(e,n,i,c){var f=Ke,h=Vr.transition;Vr.transition=null;try{Ke=4,Vl(e,n,i,c)}finally{Ke=f,Vr.transition=h}}function Vl(e,n,i,c){if(Vo){var f=Gl(e,n,i,c);if(f===null)cc(e,n,c,Go,i),Qd(e,c);else if(ly(f,e,n,i,c))c.stopPropagation();else if(Qd(e,c),n&4&&-1<ay.indexOf(e)){for(;f!==null;){var h=Ki(f);if(h!==null&&b(h),h=Gl(e,n,i,c),h===null&&cc(e,n,c,Go,i),h===f)break;f=h}f!==null&&c.stopPropagation()}else cc(e,n,c,null,i)}}var Go=null;function Gl(e,n,i,c){if(Go=null,e=ln(c),e=Sr(e),e!==null)if(n=Be(e),n===null)e=null;else if(i=n.tag,i===13){if(e=yn(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Go=e,null}function ef(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(vs()){case Bs:return 1;case ys:return 4;case Ur:case gr:return 16;case Fo:return 536870912;default:return 16}default:return 16}}var Gs=null,Kl=null,Ko=null;function tf(){if(Ko)return Ko;var e,n=Kl,i=n.length,c,f="value"in Gs?Gs.value:Gs.textContent,h=f.length;for(e=0;e<i&&n[e]===f[e];e++);var w=i-e;for(c=1;c<=w&&n[i-c]===f[h-c];c++);return Ko=f.slice(e,1<c?1-c:void 0)}function qo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Yo(){return!0}function nf(){return!1}function zn(e){function n(i,c,f,h,w){this._reactName=i,this._targetInst=f,this.type=c,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)?Yo:nf,this.isPropagationStopped=nf,this}return W(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Yo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Yo)},persist:function(){},isPersistent:Yo}),n}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=zn(Gr),Oi=W({},Gr,{view:0,detail:0}),fy=zn(Oi),Yl,Xl,Pi,Xo=W({},Oi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zl,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!==Pi&&(Pi&&e.type==="mousemove"?(Yl=e.screenX-Pi.screenX,Xl=e.screenY-Pi.screenY):Xl=Yl=0,Pi=e),Yl)},movementY:function(e){return"movementY"in e?e.movementY:Xl}}),sf=zn(Xo),py=W({},Xo,{dataTransfer:0}),hy=zn(py),my=W({},Oi,{relatedTarget:0}),Ql=zn(my),gy=W({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),vy=zn(gy),yy=W({},Gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xy=zn(yy),wy=W({},Gr,{data:0}),rf=zn(wy),ky={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sy={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"},by={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ty(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=by[e])?!!n[e]:!1}function Zl(){return Ty}var Ny=W({},Oi,{key:function(e){if(e.key){var n=ky[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=qo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zl,charCode:function(e){return e.type==="keypress"?qo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jy=zn(Ny),Cy=W({},Xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),of=zn(Cy),Ey=W({},Oi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zl}),_y=zn(Ey),Ry=W({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ay=zn(Ry),Iy=W({},Xo,{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}),My=zn(Iy),Dy=[9,13,27,32],Jl=p&&"CompositionEvent"in window,$i=null;p&&"documentMode"in document&&($i=document.documentMode);var Ly=p&&"TextEvent"in window&&!$i,af=p&&(!Jl||$i&&8<$i&&11>=$i),lf=" ",cf=!1;function uf(e,n){switch(e){case"keyup":return Dy.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kr=!1;function Oy(e,n){switch(e){case"compositionend":return df(n);case"keypress":return n.which!==32?null:(cf=!0,lf);case"textInput":return e=n.data,e===lf&&cf?null:e;default:return null}}function Py(e,n){if(Kr)return e==="compositionend"||!Jl&&uf(e,n)?(e=tf(),Ko=Kl=Gs=null,Kr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return af&&n.locale!=="ko"?null:n.data;default:return null}}var $y={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 ff(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!$y[e.type]:n==="textarea"}function pf(e,n,i,c){ft(c),n=ta(n,"onChange"),0<n.length&&(i=new ql("onChange","change",null,i,c),e.push({event:i,listeners:n}))}var zi=null,Fi=null;function zy(e){Af(e,0)}function Qo(e){var n=Zr(e);if(Me(n))return e}function Fy(e,n){if(e==="change")return n}var hf=!1;if(p){var ec;if(p){var tc="oninput"in document;if(!tc){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),tc=typeof mf.oninput=="function"}ec=tc}else ec=!1;hf=ec&&(!document.documentMode||9<document.documentMode)}function gf(){zi&&(zi.detachEvent("onpropertychange",vf),Fi=zi=null)}function vf(e){if(e.propertyName==="value"&&Qo(Fi)){var n=[];pf(n,Fi,e,ln(e)),Kt(zy,n)}}function Uy(e,n,i){e==="focusin"?(gf(),zi=n,Fi=i,zi.attachEvent("onpropertychange",vf)):e==="focusout"&&gf()}function By(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Qo(Fi)}function Wy(e,n){if(e==="click")return Qo(n)}function Hy(e,n){if(e==="input"||e==="change")return Qo(n)}function Vy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ns=typeof Object.is=="function"?Object.is:Vy;function Ui(e,n){if(ns(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),c=Object.keys(n);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var f=i[c];if(!g.call(n,f)||!ns(e[f],n[f]))return!1}return!0}function yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xf(e,n){var i=yf(e);e=0;for(var c;i;){if(i.nodeType===3){if(c=e+i.textContent.length,e<=n&&c>=n)return{node:i,offset:n-e};e=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=yf(i)}}function wf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?wf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function kf(){for(var e=window,n=lt();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=lt(e.document)}return n}function nc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function Gy(e){var n=kf(),i=e.focusedElem,c=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&wf(i.ownerDocument.documentElement,i)){if(c!==null&&nc(i)){if(n=c.start,e=c.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,h=Math.min(c.start,f);c=c.end===void 0?h:Math.min(c.end,f),!e.extend&&h>c&&(f=c,c=h,h=f),f=xf(i,h);var w=xf(i,c);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),h>c?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Ky=p&&"documentMode"in document&&11>=document.documentMode,qr=null,sc=null,Bi=null,rc=!1;function Sf(e,n,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;rc||qr==null||qr!==lt(c)||(c=qr,"selectionStart"in c&&nc(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Bi&&Ui(Bi,c)||(Bi=c,c=ta(sc,"onSelect"),0<c.length&&(n=new ql("onSelect","select",null,n,i),e.push({event:n,listeners:c}),n.target=qr)))}function Zo(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var Yr={animationend:Zo("Animation","AnimationEnd"),animationiteration:Zo("Animation","AnimationIteration"),animationstart:Zo("Animation","AnimationStart"),transitionend:Zo("Transition","TransitionEnd")},ic={},bf={};p&&(bf=document.createElement("div").style,"AnimationEvent"in window||(delete Yr.animationend.animation,delete Yr.animationiteration.animation,delete Yr.animationstart.animation),"TransitionEvent"in window||delete Yr.transitionend.transition);function Jo(e){if(ic[e])return ic[e];if(!Yr[e])return e;var n=Yr[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in bf)return ic[e]=n[i];return e}var Tf=Jo("animationend"),Nf=Jo("animationiteration"),jf=Jo("animationstart"),Cf=Jo("transitionend"),Ef=new Map,_f="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 Ks(e,n){Ef.set(e,n),u(n,[e])}for(var oc=0;oc<_f.length;oc++){var ac=_f[oc],qy=ac.toLowerCase(),Yy=ac[0].toUpperCase()+ac.slice(1);Ks(qy,"on"+Yy)}Ks(Tf,"onAnimationEnd"),Ks(Nf,"onAnimationIteration"),Ks(jf,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(Cf,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="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(" "),Xy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function Rf(e,n,i){var c=e.type||"unknown-event";e.currentTarget=i,On(c,n,void 0,e),e.currentTarget=null}function Af(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var c=e[i],f=c.event;c=c.listeners;e:{var h=void 0;if(n)for(var w=c.length-1;0<=w;w--){var j=c[w],D=j.instance,V=j.currentTarget;if(j=j.listener,D!==h&&f.isPropagationStopped())break e;Rf(f,j,V),h=D}else for(w=0;w<c.length;w++){if(j=c[w],D=j.instance,V=j.currentTarget,j=j.listener,D!==h&&f.isPropagationStopped())break e;Rf(f,j,V),h=D}}}if(De)throw e=Ge,De=!1,Ge=null,e}function pt(e,n){var i=n[mc];i===void 0&&(i=n[mc]=new Set);var c=e+"__bubble";i.has(c)||(If(n,e,2,!1),i.add(c))}function lc(e,n,i){var c=0;n&&(c|=4),If(i,e,c,n)}var ea="_reactListening"+Math.random().toString(36).slice(2);function Hi(e){if(!e[ea]){e[ea]=!0,o.forEach(function(i){i!=="selectionchange"&&(Xy.has(i)||lc(i,!1,e),lc(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ea]||(n[ea]=!0,lc("selectionchange",!1,n))}}function If(e,n,i,c){switch(ef(n)){case 1:var f=uy;break;case 4:f=dy;break;default:f=Vl}i=f.bind(null,n,i,e),f=void 0,!Lt||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),c?f!==void 0?e.addEventListener(n,i,{capture:!0,passive:f}):e.addEventListener(n,i,!0):f!==void 0?e.addEventListener(n,i,{passive:f}):e.addEventListener(n,i,!1)}function cc(e,n,i,c,f){var h=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var j=c.stateNode.containerInfo;if(j===f||j.nodeType===8&&j.parentNode===f)break;if(w===4)for(w=c.return;w!==null;){var D=w.tag;if((D===3||D===4)&&(D=w.stateNode.containerInfo,D===f||D.nodeType===8&&D.parentNode===f))return;w=w.return}for(;j!==null;){if(w=Sr(j),w===null)return;if(D=w.tag,D===5||D===6){c=h=w;continue e}j=j.parentNode}}c=c.return}Kt(function(){var V=h,ee=ln(i),re=[];e:{var J=Ef.get(e);if(J!==void 0){var ge=ql,ke=e;switch(e){case"keypress":if(qo(i)===0)break e;case"keydown":case"keyup":ge=jy;break;case"focusin":ke="focus",ge=Ql;break;case"focusout":ke="blur",ge=Ql;break;case"beforeblur":case"afterblur":ge=Ql;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":ge=sf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=hy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=_y;break;case Tf:case Nf:case jf:ge=vy;break;case Cf:ge=Ay;break;case"scroll":ge=fy;break;case"wheel":ge=My;break;case"copy":case"cut":case"paste":ge=xy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=of}var be=(n&4)!==0,It=!be&&e==="scroll",B=be?J!==null?J+"Capture":null:J;be=[];for(var O=V,H;O!==null;){H=O;var ce=H.stateNode;if(H.tag===5&&ce!==null&&(H=ce,B!==null&&(ce=st(O,B),ce!=null&&be.push(Vi(O,ce,H)))),It)break;O=O.return}0<be.length&&(J=new ge(J,ke,null,i,ee),re.push({event:J,listeners:be}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",ge=e==="mouseout"||e==="pointerout",J&&i!==gn&&(ke=i.relatedTarget||i.fromElement)&&(Sr(ke)||ke[_s]))break e;if((ge||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,ge?(ke=i.relatedTarget||i.toElement,ge=V,ke=ke?Sr(ke):null,ke!==null&&(It=Be(ke),ke!==It||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(ge=null,ke=V),ge!==ke)){if(be=sf,ce="onMouseLeave",B="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(be=of,ce="onPointerLeave",B="onPointerEnter",O="pointer"),It=ge==null?J:Zr(ge),H=ke==null?J:Zr(ke),J=new be(ce,O+"leave",ge,i,ee),J.target=It,J.relatedTarget=H,ce=null,Sr(ee)===V&&(be=new be(B,O+"enter",ke,i,ee),be.target=H,be.relatedTarget=It,ce=be),It=ce,ge&&ke)t:{for(be=ge,B=ke,O=0,H=be;H;H=Xr(H))O++;for(H=0,ce=B;ce;ce=Xr(ce))H++;for(;0<O-H;)be=Xr(be),O--;for(;0<H-O;)B=Xr(B),H--;for(;O--;){if(be===B||B!==null&&be===B.alternate)break t;be=Xr(be),B=Xr(B)}be=null}else be=null;ge!==null&&Mf(re,J,ge,be,!1),ke!==null&&It!==null&&Mf(re,It,ke,be,!0)}}e:{if(J=V?Zr(V):window,ge=J.nodeName&&J.nodeName.toLowerCase(),ge==="select"||ge==="input"&&J.type==="file")var Ne=Fy;else if(ff(J))if(hf)Ne=Hy;else{Ne=By;var Ae=Uy}else(ge=J.nodeName)&&ge.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Ne=Wy);if(Ne&&(Ne=Ne(e,V))){pf(re,Ne,i,ee);break e}Ae&&Ae(e,J,V),e==="focusout"&&(Ae=J._wrapperState)&&Ae.controlled&&J.type==="number"&&wt(J,"number",J.value)}switch(Ae=V?Zr(V):window,e){case"focusin":(ff(Ae)||Ae.contentEditable==="true")&&(qr=Ae,sc=V,Bi=null);break;case"focusout":Bi=sc=qr=null;break;case"mousedown":rc=!0;break;case"contextmenu":case"mouseup":case"dragend":rc=!1,Sf(re,i,ee);break;case"selectionchange":if(Ky)break;case"keydown":case"keyup":Sf(re,i,ee)}var Ie;if(Jl)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else Kr?uf(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(af&&i.locale!=="ko"&&(Kr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&Kr&&(Ie=tf()):(Gs=ee,Kl="value"in Gs?Gs.value:Gs.textContent,Kr=!0)),Ae=ta(V,Pe),0<Ae.length&&(Pe=new rf(Pe,e,null,i,ee),re.push({event:Pe,listeners:Ae}),Ie?Pe.data=Ie:(Ie=df(i),Ie!==null&&(Pe.data=Ie)))),(Ie=Ly?Oy(e,i):Py(e,i))&&(V=ta(V,"onBeforeInput"),0<V.length&&(ee=new rf("onBeforeInput","beforeinput",null,i,ee),re.push({event:ee,listeners:V}),ee.data=Ie))}Af(re,n)})}function Vi(e,n,i){return{instance:e,listener:n,currentTarget:i}}function ta(e,n){for(var i=n+"Capture",c=[];e!==null;){var f=e,h=f.stateNode;f.tag===5&&h!==null&&(f=h,h=st(e,i),h!=null&&c.unshift(Vi(e,h,f)),h=st(e,n),h!=null&&c.push(Vi(e,h,f))),e=e.return}return c}function Xr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Mf(e,n,i,c,f){for(var h=n._reactName,w=[];i!==null&&i!==c;){var j=i,D=j.alternate,V=j.stateNode;if(D!==null&&D===c)break;j.tag===5&&V!==null&&(j=V,f?(D=st(i,h),D!=null&&w.unshift(Vi(i,D,j))):f||(D=st(i,h),D!=null&&w.push(Vi(i,D,j)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var Qy=/\r\n?/g,Zy=/\u0000|\uFFFD/g;function Df(e){return(typeof e=="string"?e:""+e).replace(Qy,`
38
+ `).replace(Zy,"")}function na(e,n,i){if(n=Df(n),Df(e)!==n&&i)throw Error(r(425))}function sa(){}var uc=null,dc=null;function fc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var pc=typeof setTimeout=="function"?setTimeout:void 0,Jy=typeof clearTimeout=="function"?clearTimeout:void 0,Lf=typeof Promise=="function"?Promise:void 0,ex=typeof queueMicrotask=="function"?queueMicrotask:typeof Lf<"u"?function(e){return Lf.resolve(null).then(e).catch(tx)}:pc;function tx(e){setTimeout(function(){throw e})}function hc(e,n){var i=n,c=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(c===0){e.removeChild(f),Li(n);return}c--}else i!=="$"&&i!=="$?"&&i!=="$!"||c++;i=f}while(i);Li(n)}function qs(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Of(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Qr=Math.random().toString(36).slice(2),xs="__reactFiber$"+Qr,Gi="__reactProps$"+Qr,_s="__reactContainer$"+Qr,mc="__reactEvents$"+Qr,nx="__reactListeners$"+Qr,sx="__reactHandles$"+Qr;function Sr(e){var n=e[xs];if(n)return n;for(var i=e.parentNode;i;){if(n=i[_s]||i[xs]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=Of(e);e!==null;){if(i=e[xs])return i;e=Of(e)}return n}e=i,i=e.parentNode}return null}function Ki(e){return e=e[xs]||e[_s],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function ra(e){return e[Gi]||null}var gc=[],Jr=-1;function Ys(e){return{current:e}}function ht(e){0>Jr||(e.current=gc[Jr],gc[Jr]=null,Jr--)}function ct(e,n){Jr++,gc[Jr]=e.current,e.current=n}var Xs={},cn=Ys(Xs),jn=Ys(!1),br=Xs;function ei(e,n){var i=e.type.contextTypes;if(!i)return Xs;var c=e.stateNode;if(c&&c.__reactInternalMemoizedUnmaskedChildContext===n)return c.__reactInternalMemoizedMaskedChildContext;var f={},h;for(h in i)f[h]=n[h];return c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function Cn(e){return e=e.childContextTypes,e!=null}function ia(){ht(jn),ht(cn)}function Pf(e,n,i){if(cn.current!==Xs)throw Error(r(168));ct(cn,n),ct(jn,i)}function $f(e,n,i){var c=e.stateNode;if(n=n.childContextTypes,typeof c.getChildContext!="function")return i;c=c.getChildContext();for(var f in c)if(!(f in n))throw Error(r(108,Te(e)||"Unknown",f));return W({},i,c)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xs,br=cn.current,ct(cn,e),ct(jn,jn.current),!0}function zf(e,n,i){var c=e.stateNode;if(!c)throw Error(r(169));i?(e=$f(e,n,br),c.__reactInternalMemoizedMergedChildContext=e,ht(jn),ht(cn),ct(cn,e)):ht(jn),ct(jn,i)}var Rs=null,aa=!1,vc=!1;function Ff(e){Rs===null?Rs=[e]:Rs.push(e)}function rx(e){aa=!0,Ff(e)}function Qs(){if(!vc&&Rs!==null){vc=!0;var e=0,n=Ke;try{var i=Rs;for(Ke=1;e<i.length;e++){var c=i[e];do c=c(!0);while(c!==null)}Rs=null,aa=!1}catch(f){throw Rs!==null&&(Rs=Rs.slice(e+1)),Qe(Bs,Qs),f}finally{Ke=n,vc=!1}}return null}var ti=[],ni=0,la=null,ca=0,Gn=[],Kn=0,Tr=null,As=1,Is="";function Nr(e,n){ti[ni++]=ca,ti[ni++]=la,la=e,ca=n}function Uf(e,n,i){Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,Tr=e;var c=As;e=Is;var f=32-xn(c)-1;c&=~(1<<f),i+=1;var h=32-xn(n)+f;if(30<h){var w=f-f%5;h=(c&(1<<w)-1).toString(32),c>>=w,f-=w,As=1<<32-xn(n)+f|i<<f|c,Is=h+e}else As=1<<h|i<<f|c,Is=e}function yc(e){e.return!==null&&(Nr(e,1),Uf(e,1,0))}function xc(e){for(;e===la;)la=ti[--ni],ti[ni]=null,ca=ti[--ni],ti[ni]=null;for(;e===Tr;)Tr=Gn[--Kn],Gn[Kn]=null,Is=Gn[--Kn],Gn[Kn]=null,As=Gn[--Kn],Gn[Kn]=null}var Fn=null,Un=null,xt=!1,ss=null;function Bf(e,n){var i=Qn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function Wf(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Fn=e,Un=qs(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Fn=e,Un=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=Tr!==null?{id:As,overflow:Is}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=Qn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Fn=e,Un=null,!0):!1;default:return!1}}function wc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function kc(e){if(xt){var n=Un;if(n){var i=n;if(!Wf(e,n)){if(wc(e))throw Error(r(418));n=qs(i.nextSibling);var c=Fn;n&&Wf(e,n)?Bf(c,i):(e.flags=e.flags&-4097|2,xt=!1,Fn=e)}}else{if(wc(e))throw Error(r(418));e.flags=e.flags&-4097|2,xt=!1,Fn=e}}}function Hf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fn=e}function ua(e){if(e!==Fn)return!1;if(!xt)return Hf(e),xt=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!fc(e.type,e.memoizedProps)),n&&(n=Un)){if(wc(e))throw Vf(),Error(r(418));for(;n;)Bf(e,n),n=qs(n.nextSibling)}if(Hf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){Un=qs(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Un=null}}else Un=Fn?qs(e.stateNode.nextSibling):null;return!0}function Vf(){for(var e=Un;e;)e=qs(e.nextSibling)}function si(){Un=Fn=null,xt=!1}function Sc(e){ss===null?ss=[e]:ss.push(e)}var ix=A.ReactCurrentBatchConfig;function qi(e,n,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 c=i.stateNode}if(!c)throw Error(r(147,e));var f=c,h=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===h?n.ref:(n=function(w){var j=f.refs;w===null?delete j[h]:j[h]=w},n._stringRef=h,n)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function da(e,n){throw e=Object.prototype.toString.call(n),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Gf(e){var n=e._init;return n(e._payload)}function Kf(e){function n(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;)n(B,O),O=O.sibling;return null}function c(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,ce){return O===null||O.tag!==6?(O=pu(H,B.mode,ce),O.return=B,O):(O=f(O,H),O.return=B,O)}function D(B,O,H,ce){var Ne=H.type;return Ne===K?ee(B,O,H.props.children,ce,H.key):O!==null&&(O.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===oe&&Gf(Ne)===O.type)?(ce=f(O,H.props),ce.ref=qi(B,O,H),ce.return=B,ce):(ce=La(H.type,H.key,H.props,null,B.mode,ce),ce.ref=qi(B,O,H),ce.return=B,ce)}function V(B,O,H,ce){return O===null||O.tag!==4||O.stateNode.containerInfo!==H.containerInfo||O.stateNode.implementation!==H.implementation?(O=hu(H,B.mode,ce),O.return=B,O):(O=f(O,H.children||[]),O.return=B,O)}function ee(B,O,H,ce,Ne){return O===null||O.tag!==7?(O=Mr(H,B.mode,ce,Ne),O.return=B,O):(O=f(O,H),O.return=B,O)}function re(B,O,H){if(typeof O=="string"&&O!==""||typeof O=="number")return O=pu(""+O,B.mode,H),O.return=B,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case L:return H=La(O.type,O.key,O.props,null,B.mode,H),H.ref=qi(B,null,O),H.return=B,H;case q:return O=hu(O,B.mode,H),O.return=B,O;case oe:var ce=O._init;return re(B,ce(O._payload),H)}if(jt(O)||Q(O))return O=Mr(O,B.mode,H,null),O.return=B,O;da(B,O)}return null}function J(B,O,H,ce){var Ne=O!==null?O.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Ne!==null?null:j(B,O,""+H,ce);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case L:return H.key===Ne?D(B,O,H,ce):null;case q:return H.key===Ne?V(B,O,H,ce):null;case oe:return Ne=H._init,J(B,O,Ne(H._payload),ce)}if(jt(H)||Q(H))return Ne!==null?null:ee(B,O,H,ce,null);da(B,H)}return null}function ge(B,O,H,ce,Ne){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return B=B.get(H)||null,j(O,B,""+ce,Ne);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case L:return B=B.get(ce.key===null?H:ce.key)||null,D(O,B,ce,Ne);case q:return B=B.get(ce.key===null?H:ce.key)||null,V(O,B,ce,Ne);case oe:var Ae=ce._init;return ge(B,O,H,Ae(ce._payload),Ne)}if(jt(ce)||Q(ce))return B=B.get(H)||null,ee(O,B,ce,Ne,null);da(O,ce)}return null}function ke(B,O,H,ce){for(var Ne=null,Ae=null,Ie=O,Pe=O=0,Xt=null;Ie!==null&&Pe<H.length;Pe++){Ie.index>Pe?(Xt=Ie,Ie=null):Xt=Ie.sibling;var Je=J(B,Ie,H[Pe],ce);if(Je===null){Ie===null&&(Ie=Xt);break}e&&Ie&&Je.alternate===null&&n(B,Ie),O=h(Je,O,Pe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je,Ie=Xt}if(Pe===H.length)return i(B,Ie),xt&&Nr(B,Pe),Ne;if(Ie===null){for(;Pe<H.length;Pe++)Ie=re(B,H[Pe],ce),Ie!==null&&(O=h(Ie,O,Pe),Ae===null?Ne=Ie:Ae.sibling=Ie,Ae=Ie);return xt&&Nr(B,Pe),Ne}for(Ie=c(B,Ie);Pe<H.length;Pe++)Xt=ge(Ie,B,Pe,H[Pe],ce),Xt!==null&&(e&&Xt.alternate!==null&&Ie.delete(Xt.key===null?Pe:Xt.key),O=h(Xt,O,Pe),Ae===null?Ne=Xt:Ae.sibling=Xt,Ae=Xt);return e&&Ie.forEach(function(or){return n(B,or)}),xt&&Nr(B,Pe),Ne}function be(B,O,H,ce){var Ne=Q(H);if(typeof Ne!="function")throw Error(r(150));if(H=Ne.call(H),H==null)throw Error(r(151));for(var Ae=Ne=null,Ie=O,Pe=O=0,Xt=null,Je=H.next();Ie!==null&&!Je.done;Pe++,Je=H.next()){Ie.index>Pe?(Xt=Ie,Ie=null):Xt=Ie.sibling;var or=J(B,Ie,Je.value,ce);if(or===null){Ie===null&&(Ie=Xt);break}e&&Ie&&or.alternate===null&&n(B,Ie),O=h(or,O,Pe),Ae===null?Ne=or:Ae.sibling=or,Ae=or,Ie=Xt}if(Je.done)return i(B,Ie),xt&&Nr(B,Pe),Ne;if(Ie===null){for(;!Je.done;Pe++,Je=H.next())Je=re(B,Je.value,ce),Je!==null&&(O=h(Je,O,Pe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je);return xt&&Nr(B,Pe),Ne}for(Ie=c(B,Ie);!Je.done;Pe++,Je=H.next())Je=ge(Ie,B,Pe,Je.value,ce),Je!==null&&(e&&Je.alternate!==null&&Ie.delete(Je.key===null?Pe:Je.key),O=h(Je,O,Pe),Ae===null?Ne=Je:Ae.sibling=Je,Ae=Je);return e&&Ie.forEach(function($x){return n(B,$x)}),xt&&Nr(B,Pe),Ne}function It(B,O,H,ce){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 Ne=H.key,Ae=O;Ae!==null;){if(Ae.key===Ne){if(Ne=H.type,Ne===K){if(Ae.tag===7){i(B,Ae.sibling),O=f(Ae,H.props.children),O.return=B,B=O;break e}}else if(Ae.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===oe&&Gf(Ne)===Ae.type){i(B,Ae.sibling),O=f(Ae,H.props),O.ref=qi(B,Ae,H),O.return=B,B=O;break e}i(B,Ae);break}else n(B,Ae);Ae=Ae.sibling}H.type===K?(O=Mr(H.props.children,B.mode,ce,H.key),O.return=B,B=O):(ce=La(H.type,H.key,H.props,null,B.mode,ce),ce.ref=qi(B,O,H),ce.return=B,B=ce)}return w(B);case q:e:{for(Ae=H.key;O!==null;){if(O.key===Ae)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 n(B,O);O=O.sibling}O=hu(H,B.mode,ce),O.return=B,B=O}return w(B);case oe:return Ae=H._init,It(B,O,Ae(H._payload),ce)}if(jt(H))return ke(B,O,H,ce);if(Q(H))return be(B,O,H,ce);da(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=pu(H,B.mode,ce),O.return=B,B=O),w(B)):i(B,O)}return It}var ri=Kf(!0),qf=Kf(!1),fa=Ys(null),pa=null,ii=null,bc=null;function Tc(){bc=ii=pa=null}function Nc(e){var n=fa.current;ht(fa),e._currentValue=n}function jc(e,n,i){for(;e!==null;){var c=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),e===i)break;e=e.return}}function oi(e,n){pa=e,bc=ii=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(En=!0),e.firstContext=null)}function qn(e){var n=e._currentValue;if(bc!==e)if(e={context:e,memoizedValue:n,next:null},ii===null){if(pa===null)throw Error(r(308));ii=e,pa.dependencies={lanes:0,firstContext:e}}else ii=ii.next=e;return n}var jr=null;function Cc(e){jr===null?jr=[e]:jr.push(e)}function Yf(e,n,i,c){var f=n.interleaved;return f===null?(i.next=i,Cc(n)):(i.next=f.next,f.next=i),n.interleaved=i,Ms(e,c)}function Ms(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Zs=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ds(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Js(e,n,i){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Ye&2)!==0){var f=c.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),c.pending=n,Ms(e,i)}return f=c.interleaved,f===null?(n.next=n,Cc(c)):(n.next=f.next,f.next=n),c.interleaved=n,Ms(e,i)}function ha(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}function Qf(e,n){var i=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,i===c)){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=n:h=h.next=n}else f=h=n;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:c.shared,effects:c.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function ma(e,n,i,c){var f=e.updateQueue;Zs=!1;var h=f.firstBaseUpdate,w=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var D=j,V=D.next;D.next=null,w===null?h=V:w.next=V,w=D;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,j=ee.lastBaseUpdate,j!==w&&(j===null?ee.firstBaseUpdate=V:j.next=V,ee.lastBaseUpdate=D))}if(h!==null){var re=f.baseState;w=0,ee=V=D=null,j=h;do{var J=j.lane,ge=j.eventTime;if((c&J)===J){ee!==null&&(ee=ee.next={eventTime:ge,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var ke=e,be=j;switch(J=n,ge=i,be.tag){case 1:if(ke=be.payload,typeof ke=="function"){re=ke.call(ge,re,J);break e}re=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=be.payload,J=typeof ke=="function"?ke.call(ge,re,J):ke,J==null)break e;re=W({},re,J);break e;case 2:Zs=!0}}j.callback!==null&&j.lane!==0&&(e.flags|=64,J=f.effects,J===null?f.effects=[j]:J.push(j))}else ge={eventTime:ge,lane:J,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ee===null?(V=ee=ge,D=re):ee=ee.next=ge,w|=J;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;J=j,j=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);if(ee===null&&(D=re),f.baseState=D,f.firstBaseUpdate=V,f.lastBaseUpdate=ee,n=f.shared.interleaved,n!==null){f=n;do w|=f.lane,f=f.next;while(f!==n)}else h===null&&(f.shared.lanes=0);_r|=w,e.lanes=w,e.memoizedState=re}}function Zf(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var c=e[n],f=c.callback;if(f!==null){if(c.callback=null,c=i,typeof f!="function")throw Error(r(191,f));f.call(c)}}}var Yi={},ws=Ys(Yi),Xi=Ys(Yi),Qi=Ys(Yi);function Cr(e){if(e===Yi)throw Error(r(174));return e}function _c(e,n){switch(ct(Qi,n),ct(Xi,e),ct(ws,Yi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mt(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=mt(n,e)}ht(ws),ct(ws,n)}function ai(){ht(ws),ht(Xi),ht(Qi)}function Jf(e){Cr(Qi.current);var n=Cr(ws.current),i=mt(n,e.type);n!==i&&(ct(Xi,e),ct(ws,i))}function Rc(e){Xi.current===e&&(ht(ws),ht(Xi))}var Tt=Ys(0);function ga(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ac=[];function Ic(){for(var e=0;e<Ac.length;e++)Ac[e]._workInProgressVersionPrimary=null;Ac.length=0}var va=A.ReactCurrentDispatcher,Mc=A.ReactCurrentBatchConfig,Er=0,Nt=null,Ft=null,qt=null,ya=!1,Zi=!1,Ji=0,ox=0;function un(){throw Error(r(321))}function Dc(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!ns(e[i],n[i]))return!1;return!0}function Lc(e,n,i,c,f,h){if(Er=h,Nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,va.current=e===null||e.memoizedState===null?ux:dx,e=i(c,f),Zi){h=0;do{if(Zi=!1,Ji=0,25<=h)throw Error(r(301));h+=1,qt=Ft=null,n.updateQueue=null,va.current=fx,e=i(c,f)}while(Zi)}if(va.current=ka,n=Ft!==null&&Ft.next!==null,Er=0,qt=Ft=Nt=null,ya=!1,n)throw Error(r(300));return e}function Oc(){var e=Ji!==0;return Ji=0,e}function ks(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?Nt.memoizedState=qt=e:qt=qt.next=e,qt}function Yn(){if(Ft===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var n=qt===null?Nt.memoizedState:qt.next;if(n!==null)qt=n,Ft=e;else{if(e===null)throw Error(r(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},qt===null?Nt.memoizedState=qt=e:qt=qt.next=e}return qt}function eo(e,n){return typeof n=="function"?n(e):n}function Pc(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=Ft,f=c.baseQueue,h=i.pending;if(h!==null){if(f!==null){var w=f.next;f.next=h.next,h.next=w}c.baseQueue=f=h,i.pending=null}if(f!==null){h=f.next,c=c.baseState;var j=w=null,D=null,V=h;do{var ee=V.lane;if((Er&ee)===ee)D!==null&&(D=D.next={lane:0,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),c=V.hasEagerState?V.eagerState:e(c,V.action);else{var re={lane:ee,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null};D===null?(j=D=re,w=c):D=D.next=re,Nt.lanes|=ee,_r|=ee}V=V.next}while(V!==null&&V!==h);D===null?w=c:D.next=j,ns(c,n.memoizedState)||(En=!0),n.memoizedState=c,n.baseState=w,n.baseQueue=D,i.lastRenderedState=c}if(e=i.interleaved,e!==null){f=e;do h=f.lane,Nt.lanes|=h,_r|=h,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function $c(e){var n=Yn(),i=n.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var c=i.dispatch,f=i.pending,h=n.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do h=e(h,w.action),w=w.next;while(w!==f);ns(h,n.memoizedState)||(En=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),i.lastRenderedState=h}return[h,c]}function ep(){}function tp(e,n){var i=Nt,c=Yn(),f=n(),h=!ns(c.memoizedState,f);if(h&&(c.memoizedState=f,En=!0),c=c.queue,zc(rp.bind(null,i,c,e),[e]),c.getSnapshot!==n||h||qt!==null&&qt.memoizedState.tag&1){if(i.flags|=2048,to(9,sp.bind(null,i,c,f,n),void 0,null),Yt===null)throw Error(r(349));(Er&30)!==0||np(i,n,f)}return f}function np(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function sp(e,n,i,c){n.value=i,n.getSnapshot=c,ip(n)&&op(e)}function rp(e,n,i){return i(function(){ip(n)&&op(e)})}function ip(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!ns(e,i)}catch{return!0}}function op(e){var n=Ms(e,1);n!==null&&as(n,e,1,-1)}function ap(e){var n=ks();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:eo,lastRenderedState:e},n.queue=e,e=e.dispatch=cx.bind(null,Nt,e),[n.memoizedState,e]}function to(e,n,i,c){return e={tag:e,create:n,destroy:i,deps:c,next:null},n=Nt.updateQueue,n===null?(n={lastEffect:null,stores:null},Nt.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(c=i.next,i.next=e,e.next=c,n.lastEffect=e)),e}function lp(){return Yn().memoizedState}function xa(e,n,i,c){var f=ks();Nt.flags|=e,f.memoizedState=to(1|n,i,void 0,c===void 0?null:c)}function wa(e,n,i,c){var f=Yn();c=c===void 0?null:c;var h=void 0;if(Ft!==null){var w=Ft.memoizedState;if(h=w.destroy,c!==null&&Dc(c,w.deps)){f.memoizedState=to(n,i,h,c);return}}Nt.flags|=e,f.memoizedState=to(1|n,i,h,c)}function cp(e,n){return xa(8390656,8,e,n)}function zc(e,n){return wa(2048,8,e,n)}function up(e,n){return wa(4,2,e,n)}function dp(e,n){return wa(4,4,e,n)}function fp(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function pp(e,n,i){return i=i!=null?i.concat([e]):null,wa(4,4,fp.bind(null,n,e),i)}function Fc(){}function hp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Dc(n,c[1])?c[0]:(i.memoizedState=[e,n],e)}function mp(e,n){var i=Yn();n=n===void 0?null:n;var c=i.memoizedState;return c!==null&&n!==null&&Dc(n,c[1])?c[0]:(e=e(),i.memoizedState=[e,n],e)}function gp(e,n,i){return(Er&21)===0?(e.baseState&&(e.baseState=!1,En=!0),e.memoizedState=i):(ns(i,n)||(i=Ai(),Nt.lanes|=i,_r|=i,e.baseState=!0),n)}function ax(e,n){var i=Ke;Ke=i!==0&&4>i?i:4,e(!0);var c=Mc.transition;Mc.transition={};try{e(!1),n()}finally{Ke=i,Mc.transition=c}}function vp(){return Yn().memoizedState}function lx(e,n,i){var c=sr(e);if(i={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null},yp(e))xp(n,i);else if(i=Yf(e,n,i,c),i!==null){var f=Sn();as(i,e,c,f),wp(i,n,c)}}function cx(e,n,i){var c=sr(e),f={lane:c,action:i,hasEagerState:!1,eagerState:null,next:null};if(yp(e))xp(n,f);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var w=n.lastRenderedState,j=h(w,i);if(f.hasEagerState=!0,f.eagerState=j,ns(j,w)){var D=n.interleaved;D===null?(f.next=f,Cc(n)):(f.next=D.next,D.next=f),n.interleaved=f;return}}catch{}finally{}i=Yf(e,n,f,c),i!==null&&(f=Sn(),as(i,e,c,f),wp(i,n,c))}}function yp(e){var n=e.alternate;return e===Nt||n!==null&&n===Nt}function xp(e,n){Zi=ya=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function wp(e,n,i){if((i&4194240)!==0){var c=n.lanes;c&=e.pendingLanes,i|=c,n.lanes=i,Hs(e,i)}}var ka={readContext:qn,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},ux={readContext:qn,useCallback:function(e,n){return ks().memoizedState=[e,n===void 0?null:n],e},useContext:qn,useEffect:cp,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,xa(4194308,4,fp.bind(null,n,e),i)},useLayoutEffect:function(e,n){return xa(4194308,4,e,n)},useInsertionEffect:function(e,n){return xa(4,2,e,n)},useMemo:function(e,n){var i=ks();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var c=ks();return n=i!==void 0?i(n):n,c.memoizedState=c.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},c.queue=e,e=e.dispatch=lx.bind(null,Nt,e),[c.memoizedState,e]},useRef:function(e){var n=ks();return e={current:e},n.memoizedState=e},useState:ap,useDebugValue:Fc,useDeferredValue:function(e){return ks().memoizedState=e},useTransition:function(){var e=ap(!1),n=e[0];return e=ax.bind(null,e[1]),ks().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var c=Nt,f=ks();if(xt){if(i===void 0)throw Error(r(407));i=i()}else{if(i=n(),Yt===null)throw Error(r(349));(Er&30)!==0||np(c,n,i)}f.memoizedState=i;var h={value:i,getSnapshot:n};return f.queue=h,cp(rp.bind(null,c,h,e),[e]),c.flags|=2048,to(9,sp.bind(null,c,h,i,n),void 0,null),i},useId:function(){var e=ks(),n=Yt.identifierPrefix;if(xt){var i=Is,c=As;i=(c&~(1<<32-xn(c)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ji++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=ox++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},dx={readContext:qn,useCallback:hp,useContext:qn,useEffect:zc,useImperativeHandle:pp,useInsertionEffect:up,useLayoutEffect:dp,useMemo:mp,useReducer:Pc,useRef:lp,useState:function(){return Pc(eo)},useDebugValue:Fc,useDeferredValue:function(e){var n=Yn();return gp(n,Ft.memoizedState,e)},useTransition:function(){var e=Pc(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:ep,useSyncExternalStore:tp,useId:vp,unstable_isNewReconciler:!1},fx={readContext:qn,useCallback:hp,useContext:qn,useEffect:zc,useImperativeHandle:pp,useInsertionEffect:up,useLayoutEffect:dp,useMemo:mp,useReducer:$c,useRef:lp,useState:function(){return $c(eo)},useDebugValue:Fc,useDeferredValue:function(e){var n=Yn();return Ft===null?n.memoizedState=e:gp(n,Ft.memoizedState,e)},useTransition:function(){var e=$c(eo)[0],n=Yn().memoizedState;return[e,n]},useMutableSource:ep,useSyncExternalStore:tp,useId:vp,unstable_isNewReconciler:!1};function rs(e,n){if(e&&e.defaultProps){n=W({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function Uc(e,n,i,c){n=e.memoizedState,i=i(c,n),i=i==null?n:W({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Sa={isMounted:function(e){return(e=e._reactInternals)?Be(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ha(n,e,f))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var c=Sn(),f=sr(e),h=Ds(c,f);h.tag=1,h.payload=n,i!=null&&(h.callback=i),n=Js(e,h,f),n!==null&&(as(n,e,f,c),ha(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Sn(),c=sr(e),f=Ds(i,c);f.tag=2,n!=null&&(f.callback=n),n=Js(e,f,c),n!==null&&(as(n,e,c,i),ha(n,e,c))}};function kp(e,n,i,c,f,h,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,h,w):n.prototype&&n.prototype.isPureReactComponent?!Ui(i,c)||!Ui(f,h):!0}function Sp(e,n,i){var c=!1,f=Xs,h=n.contextType;return typeof h=="object"&&h!==null?h=qn(h):(f=Cn(n)?br:cn.current,c=n.contextTypes,h=(c=c!=null)?ei(e,f):Xs),n=new n(i,h),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sa,e.stateNode=n,n._reactInternals=e,c&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=h),n}function bp(e,n,i,c){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,c),n.state!==e&&Sa.enqueueReplaceState(n,n.state,null)}function Bc(e,n,i,c){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Ec(e);var h=n.contextType;typeof h=="object"&&h!==null?f.context=qn(h):(h=Cn(n)?br:cn.current,f.context=ei(e,h)),f.state=e.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Uc(e,n,h,i),f.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(n=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),n!==f.state&&Sa.enqueueReplaceState(f,f.state,null),ma(e,i,f,c),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function li(e,n){try{var i="",c=n;do i+=X(c),c=c.return;while(c);var f=i}catch(h){f=`
39
+ Error generating stack: `+h.message+`
40
+ `+h.stack}return{value:e,source:n,stack:f,digest:null}}function Wc(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function Hc(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var px=typeof WeakMap=="function"?WeakMap:Map;function Tp(e,n,i){i=Ds(-1,i),i.tag=3,i.payload={element:null};var c=n.value;return i.callback=function(){_a||(_a=!0,iu=c),Hc(e,n)},i}function Np(e,n,i){i=Ds(-1,i),i.tag=3;var c=e.type.getDerivedStateFromError;if(typeof c=="function"){var f=n.value;i.payload=function(){return c(f)},i.callback=function(){Hc(e,n)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(i.callback=function(){Hc(e,n),typeof c!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),i}function jp(e,n,i){var c=e.pingCache;if(c===null){c=e.pingCache=new px;var f=new Set;c.set(n,f)}else f=c.get(n),f===void 0&&(f=new Set,c.set(n,f));f.has(i)||(f.add(i),e=Cx.bind(null,e,n,i),n.then(e,e))}function Cp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function Ep(e,n,i,c,f){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=Ds(-1,1),n.tag=2,Js(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var hx=A.ReactCurrentOwner,En=!1;function kn(e,n,i,c){n.child=e===null?qf(n,null,i,c):ri(n,e.child,i,c)}function _p(e,n,i,c,f){i=i.render;var h=n.ref;return oi(n,f),c=Lc(e,n,i,c,h,f),i=Oc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&i&&yc(n),n.flags|=1,kn(e,n,c,f),n.child)}function Rp(e,n,i,c,f){if(e===null){var h=i.type;return typeof h=="function"&&!fu(h)&&h.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=h,Ap(e,n,h,c,f)):(e=La(i.type,null,c,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,(e.lanes&f)===0){var w=h.memoizedProps;if(i=i.compare,i=i!==null?i:Ui,i(w,c)&&e.ref===n.ref)return Ls(e,n,f)}return n.flags|=1,e=ir(h,c),e.ref=n.ref,e.return=n,n.child=e}function Ap(e,n,i,c,f){if(e!==null){var h=e.memoizedProps;if(Ui(h,c)&&e.ref===n.ref)if(En=!1,n.pendingProps=c=h,(e.lanes&f)!==0)(e.flags&131072)!==0&&(En=!0);else return n.lanes=e.lanes,Ls(e,n,f)}return Vc(e,n,i,c,f)}function Ip(e,n,i){var c=n.pendingProps,f=c.children,h=e!==null?e.memoizedState:null;if(c.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(ui,Bn),Bn|=i;else{if((i&1073741824)===0)return e=h!==null?h.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,ct(ui,Bn),Bn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=h!==null?h.baseLanes:i,ct(ui,Bn),Bn|=c}else h!==null?(c=h.baseLanes|i,n.memoizedState=null):c=i,ct(ui,Bn),Bn|=c;return kn(e,n,f,i),n.child}function Mp(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function Vc(e,n,i,c,f){var h=Cn(i)?br:cn.current;return h=ei(n,h),oi(n,f),i=Lc(e,n,i,c,h,f),c=Oc(),e!==null&&!En?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,Ls(e,n,f)):(xt&&c&&yc(n),n.flags|=1,kn(e,n,i,f),n.child)}function Dp(e,n,i,c,f){if(Cn(i)){var h=!0;oa(n)}else h=!1;if(oi(n,f),n.stateNode===null)Ta(e,n),Sp(n,i,c),Bc(n,i,c,f),c=!0;else if(e===null){var w=n.stateNode,j=n.memoizedProps;w.props=j;var D=w.context,V=i.contextType;typeof V=="object"&&V!==null?V=qn(V):(V=Cn(i)?br:cn.current,V=ei(n,V));var ee=i.getDerivedStateFromProps,re=typeof ee=="function"||typeof w.getSnapshotBeforeUpdate=="function";re||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==c||D!==V)&&bp(n,w,c,V),Zs=!1;var J=n.memoizedState;w.state=J,ma(n,c,w,f),D=n.memoizedState,j!==c||J!==D||jn.current||Zs?(typeof ee=="function"&&(Uc(n,i,ee,c),D=n.memoizedState),(j=Zs||kp(n,i,j,c,J,D,V))?(re||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"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=D),w.props=c,w.state=D,w.context=V,c=j):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{w=n.stateNode,Xf(e,n),j=n.memoizedProps,V=n.type===n.elementType?j:rs(n.type,j),w.props=V,re=n.pendingProps,J=w.context,D=i.contextType,typeof D=="object"&&D!==null?D=qn(D):(D=Cn(i)?br:cn.current,D=ei(n,D));var ge=i.getDerivedStateFromProps;(ee=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j!==re||J!==D)&&bp(n,w,c,D),Zs=!1,J=n.memoizedState,w.state=J,ma(n,c,w,f);var ke=n.memoizedState;j!==re||J!==ke||jn.current||Zs?(typeof ge=="function"&&(Uc(n,i,ge,c),ke=n.memoizedState),(V=Zs||kp(n,i,V,c,J,ke,D)||!1)?(ee||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(c,ke,D),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(c,ke,D)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=ke),w.props=c,w.state=ke,w.context=D,c=V):(typeof w.componentDidUpdate!="function"||j===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||j===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),c=!1)}return Gc(e,n,i,c,h,f)}function Gc(e,n,i,c,f,h){Mp(e,n);var w=(n.flags&128)!==0;if(!c&&!w)return f&&zf(n,i,!1),Ls(e,n,h);c=n.stateNode,hx.current=n;var j=w&&typeof i.getDerivedStateFromError!="function"?null:c.render();return n.flags|=1,e!==null&&w?(n.child=ri(n,e.child,null,h),n.child=ri(n,null,j,h)):kn(e,n,j,h),n.memoizedState=c.state,f&&zf(n,i,!0),n.child}function Lp(e){var n=e.stateNode;n.pendingContext?Pf(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Pf(e,n.context,!1),_c(e,n.containerInfo)}function Op(e,n,i,c,f){return si(),Sc(f),n.flags|=256,kn(e,n,i,c),n.child}var Kc={dehydrated:null,treeContext:null,retryLane:0};function qc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Pp(e,n,i){var c=n.pendingProps,f=Tt.current,h=!1,w=(n.flags&128)!==0,j;if((j=w)||(j=e!==null&&e.memoizedState===null?!1:(f&2)!==0),j?(h=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ct(Tt,f&1),e===null)return kc(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=c.children,e=c.fallback,h?(c=n.mode,h=n.child,w={mode:"hidden",children:w},(c&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=w):h=Oa(w,c,0,null),e=Mr(e,c,i,null),h.return=n,e.return=n,h.sibling=e,n.child=h,n.child.memoizedState=qc(i),n.memoizedState=Kc,e):Yc(n,w));if(f=e.memoizedState,f!==null&&(j=f.dehydrated,j!==null))return mx(e,n,w,c,j,f,i);if(h){h=c.fallback,w=n.mode,f=e.child,j=f.sibling;var D={mode:"hidden",children:c.children};return(w&1)===0&&n.child!==f?(c=n.child,c.childLanes=0,c.pendingProps=D,n.deletions=null):(c=ir(f,D),c.subtreeFlags=f.subtreeFlags&14680064),j!==null?h=ir(j,h):(h=Mr(h,w,i,null),h.flags|=2),h.return=n,c.return=n,c.sibling=h,n.child=c,c=h,h=n.child,w=e.child.memoizedState,w=w===null?qc(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},h.memoizedState=w,h.childLanes=e.childLanes&~i,n.memoizedState=Kc,c}return h=e.child,e=h.sibling,c=ir(h,{mode:"visible",children:c.children}),(n.mode&1)===0&&(c.lanes=i),c.return=n,c.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=c,n.memoizedState=null,c}function Yc(e,n){return n=Oa({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function ba(e,n,i,c){return c!==null&&Sc(c),ri(n,e.child,null,i),e=Yc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function mx(e,n,i,c,f,h,w){if(i)return n.flags&256?(n.flags&=-257,c=Wc(Error(r(422))),ba(e,n,w,c)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(h=c.fallback,f=n.mode,c=Oa({mode:"visible",children:c.children},f,0,null),h=Mr(h,f,w,null),h.flags|=2,c.return=n,h.return=n,c.sibling=h,n.child=c,(n.mode&1)!==0&&ri(n,e.child,null,w),n.child.memoizedState=qc(w),n.memoizedState=Kc,h);if((n.mode&1)===0)return ba(e,n,w,null);if(f.data==="$!"){if(c=f.nextSibling&&f.nextSibling.dataset,c)var j=c.dgst;return c=j,h=Error(r(419)),c=Wc(h,c,void 0),ba(e,n,w,c)}if(j=(w&e.childLanes)!==0,En||j){if(c=Yt,c!==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&(c.suspendedLanes|w))!==0?0:f,f!==0&&f!==h.retryLane&&(h.retryLane=f,Ms(e,f),as(c,e,f,-1))}return du(),c=Wc(Error(r(421))),ba(e,n,w,c)}return f.data==="$?"?(n.flags|=128,n.child=e.child,n=Ex.bind(null,e),f._reactRetry=n,null):(e=h.treeContext,Un=qs(f.nextSibling),Fn=n,xt=!0,ss=null,e!==null&&(Gn[Kn++]=As,Gn[Kn++]=Is,Gn[Kn++]=Tr,As=e.id,Is=e.overflow,Tr=n),n=Yc(n,c.children),n.flags|=4096,n)}function $p(e,n,i){e.lanes|=n;var c=e.alternate;c!==null&&(c.lanes|=n),jc(e.return,n,i)}function Xc(e,n,i,c,f){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:f}:(h.isBackwards=n,h.rendering=null,h.renderingStartTime=0,h.last=c,h.tail=i,h.tailMode=f)}function zp(e,n,i){var c=n.pendingProps,f=c.revealOrder,h=c.tail;if(kn(e,n,c.children,i),c=Tt.current,(c&2)!==0)c=c&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$p(e,i,n);else if(e.tag===19)$p(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}c&=1}if(ct(Tt,c),(n.mode&1)===0)n.memoizedState=null;else switch(f){case"forwards":for(i=n.child,f=null;i!==null;)e=i.alternate,e!==null&&ga(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=n.child,n.child=null):(f=i.sibling,i.sibling=null),Xc(n,!1,f,i,h);break;case"backwards":for(i=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&ga(e)===null){n.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}Xc(n,!0,i,null,h);break;case"together":Xc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Ta(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Ls(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),_r|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(r(153));if(n.child!==null){for(e=n.child,i=ir(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=ir(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function gx(e,n,i){switch(n.tag){case 3:Lp(n),si();break;case 5:Jf(n);break;case 1:Cn(n.type)&&oa(n);break;case 4:_c(n,n.stateNode.containerInfo);break;case 10:var c=n.type._context,f=n.memoizedProps.value;ct(fa,c._currentValue),c._currentValue=f;break;case 13:if(c=n.memoizedState,c!==null)return c.dehydrated!==null?(ct(Tt,Tt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Pp(e,n,i):(ct(Tt,Tt.current&1),e=Ls(e,n,i),e!==null?e.sibling:null);ct(Tt,Tt.current&1);break;case 19:if(c=(i&n.childLanes)!==0,(e.flags&128)!==0){if(c)return zp(e,n,i);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ct(Tt,Tt.current),c)break;return null;case 22:case 23:return n.lanes=0,Ip(e,n,i)}return Ls(e,n,i)}var Fp,Qc,Up,Bp;Fp=function(e,n){for(var i=n.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===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Qc=function(){},Up=function(e,n,i,c){var f=e.memoizedProps;if(f!==c){e=n.stateNode,Cr(ws.current);var h=null;switch(i){case"input":f=$e(e,f),c=$e(e,c),h=[];break;case"select":f=W({},f,{value:void 0}),c=W({},c,{value:void 0}),h=[];break;case"textarea":f=Dt(e,f),c=Dt(e,c),h=[];break;default:typeof f.onClick!="function"&&typeof c.onClick=="function"&&(e.onclick=sa)}ts(i,c);var w;i=null;for(V in f)if(!c.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"&&(l.hasOwnProperty(V)?h||(h=[]):(h=h||[]).push(V,null));for(V in c){var D=c[V];if(j=f!=null?f[V]:void 0,c.hasOwnProperty(V)&&D!==j&&(D!=null||j!=null))if(V==="style")if(j){for(w in j)!j.hasOwnProperty(w)||D&&D.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in D)D.hasOwnProperty(w)&&j[w]!==D[w]&&(i||(i={}),i[w]=D[w])}else i||(h||(h=[]),h.push(V,i)),i=D;else V==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,j=j?j.__html:void 0,D!=null&&j!==D&&(h=h||[]).push(V,D)):V==="children"?typeof D!="string"&&typeof D!="number"||(h=h||[]).push(V,""+D):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(l.hasOwnProperty(V)?(D!=null&&V==="onScroll"&&pt("scroll",e),h||j===D||(h=[])):(h=h||[]).push(V,D))}i&&(h=h||[]).push("style",i);var V=h;(n.updateQueue=V)&&(n.flags|=4)}},Bp=function(e,n,i,c){i!==c&&(n.flags|=4)};function no(e,n){if(!xt)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function dn(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,c=0;if(n)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags&14680064,c|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=c,e.childLanes=i,n}function vx(e,n,i){var c=n.pendingProps;switch(xc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(n),null;case 1:return Cn(n.type)&&ia(),dn(n),null;case 3:return c=n.stateNode,ai(),ht(jn),ht(cn),Ic(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(e===null||e.child===null)&&(ua(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ss!==null&&(lu(ss),ss=null))),Qc(e,n),dn(n),null;case 5:Rc(n);var f=Cr(Qi.current);if(i=n.type,e!==null&&n.stateNode!=null)Up(e,n,i,c,f),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!c){if(n.stateNode===null)throw Error(r(166));return dn(n),null}if(e=Cr(ws.current),ua(n)){c=n.stateNode,i=n.type;var h=n.memoizedProps;switch(c[xs]=n,c[Gi]=h,e=(n.mode&1)!==0,i){case"dialog":pt("cancel",c),pt("close",c);break;case"iframe":case"object":case"embed":pt("load",c);break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],c);break;case"source":pt("error",c);break;case"img":case"image":case"link":pt("error",c),pt("load",c);break;case"details":pt("toggle",c);break;case"input":en(c,h),pt("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!h.multiple},pt("invalid",c);break;case"textarea":Y(c,h),pt("invalid",c)}ts(i,h),f=null;for(var w in h)if(h.hasOwnProperty(w)){var j=h[w];w==="children"?typeof j=="string"?c.textContent!==j&&(h.suppressHydrationWarning!==!0&&na(c.textContent,j,e),f=["children",j]):typeof j=="number"&&c.textContent!==""+j&&(h.suppressHydrationWarning!==!0&&na(c.textContent,j,e),f=["children",""+j]):l.hasOwnProperty(w)&&j!=null&&w==="onScroll"&&pt("scroll",c)}switch(i){case"input":at(c),tn(c,h,!0);break;case"textarea":at(c),Ue(c);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(c.onclick=sa)}c=f,n.updateQueue=c,c!==null&&(n.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof c.is=="string"?e=w.createElement(i,{is:c.is}):(e=w.createElement(i),i==="select"&&(w=e,c.multiple?w.multiple=!0:c.size&&(w.size=c.size))):e=w.createElementNS(e,i),e[xs]=n,e[Gi]=c,Fp(e,n,!1,!1),n.stateNode=e;e:{switch(w=Ln(i,c),i){case"dialog":pt("cancel",e),pt("close",e),f=c;break;case"iframe":case"object":case"embed":pt("load",e),f=c;break;case"video":case"audio":for(f=0;f<Wi.length;f++)pt(Wi[f],e);f=c;break;case"source":pt("error",e),f=c;break;case"img":case"image":case"link":pt("error",e),pt("load",e),f=c;break;case"details":pt("toggle",e),f=c;break;case"input":en(e,c),f=$e(e,c),pt("invalid",e);break;case"option":f=c;break;case"select":e._wrapperState={wasMultiple:!!c.multiple},f=W({},c,{value:void 0}),pt("invalid",e);break;case"textarea":Y(e,c),f=Dt(e,c),pt("invalid",e);break;default:f=c}ts(i,f),j=f;for(h in j)if(j.hasOwnProperty(h)){var D=j[h];h==="style"?ps(e,D):h==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&Ct(e,D)):h==="children"?typeof D=="string"?(i!=="textarea"||D!=="")&&an(e,D):typeof D=="number"&&an(e,""+D):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(l.hasOwnProperty(h)?D!=null&&h==="onScroll"&&pt("scroll",e):D!=null&&U(e,h,D,w))}switch(i){case"input":at(e),tn(e,c,!1);break;case"textarea":at(e),Ue(e);break;case"option":c.value!=null&&e.setAttribute("value",""+Ee(c.value));break;case"select":e.multiple=!!c.multiple,h=c.value,h!=null?$t(e,!!c.multiple,h,!1):c.defaultValue!=null&&$t(e,!!c.multiple,c.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=sa)}switch(i){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}}c&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return dn(n),null;case 6:if(e&&n.stateNode!=null)Bp(e,n,e.memoizedProps,c);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=Cr(Qi.current),Cr(ws.current),ua(n)){if(c=n.stateNode,i=n.memoizedProps,c[xs]=n,(h=c.nodeValue!==i)&&(e=Fn,e!==null))switch(e.tag){case 3:na(c.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&na(c.nodeValue,i,(e.mode&1)!==0)}h&&(n.flags|=4)}else c=(i.nodeType===9?i:i.ownerDocument).createTextNode(c),c[xs]=n,n.stateNode=c}return dn(n),null;case 13:if(ht(Tt),c=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(xt&&Un!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Vf(),si(),n.flags|=98560,h=!1;else if(h=ua(n),c!==null&&c.dehydrated!==null){if(e===null){if(!h)throw Error(r(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[xs]=n}else si(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dn(n),h=!1}else ss!==null&&(lu(ss),ss=null),h=!0;if(!h)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(c=c!==null,c!==(e!==null&&e.memoizedState!==null)&&c&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Tt.current&1)!==0?Ut===0&&(Ut=3):du())),n.updateQueue!==null&&(n.flags|=4),dn(n),null);case 4:return ai(),Qc(e,n),e===null&&Hi(n.stateNode.containerInfo),dn(n),null;case 10:return Nc(n.type._context),dn(n),null;case 17:return Cn(n.type)&&ia(),dn(n),null;case 19:if(ht(Tt),h=n.memoizedState,h===null)return dn(n),null;if(c=(n.flags&128)!==0,w=h.rendering,w===null)if(c)no(h,!1);else{if(Ut!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=ga(e),w!==null){for(n.flags|=128,no(h,!1),c=w.updateQueue,c!==null&&(n.updateQueue=c,n.flags|=4),n.subtreeFlags=0,c=i,i=n.child;i!==null;)h=i,e=c,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 ct(Tt,Tt.current&1|2),n.child}e=e.sibling}h.tail!==null&&kt()>di&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304)}else{if(!c)if(e=ga(w),e!==null){if(n.flags|=128,c=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),no(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!xt)return dn(n),null}else 2*kt()-h.renderingStartTime>di&&i!==1073741824&&(n.flags|=128,c=!0,no(h,!1),n.lanes=4194304);h.isBackwards?(w.sibling=n.child,n.child=w):(i=h.last,i!==null?i.sibling=w:n.child=w,h.last=w)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=kt(),n.sibling=null,i=Tt.current,ct(Tt,c?i&1|2:i&1),n):(dn(n),null);case 22:case 23:return uu(),c=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==c&&(n.flags|=8192),c&&(n.mode&1)!==0?(Bn&1073741824)!==0&&(dn(n),n.subtreeFlags&6&&(n.flags|=8192)):dn(n),null;case 24:return null;case 25:return null}throw Error(r(156,n.tag))}function yx(e,n){switch(xc(n),n.tag){case 1:return Cn(n.type)&&ia(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ai(),ht(jn),ht(cn),Ic(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Rc(n),null;case 13:if(ht(Tt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(r(340));si()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return ht(Tt),null;case 4:return ai(),null;case 10:return Nc(n.type._context),null;case 22:case 23:return uu(),null;case 24:return null;default:return null}}var Na=!1,fn=!1,xx=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ci(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(c){Rt(e,n,c)}else i.current=null}function Zc(e,n,i){try{i()}catch(c){Rt(e,n,c)}}var Wp=!1;function wx(e,n){if(uc=Vo,e=kf(),nc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,h=c.focusNode;c=c.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var w=0,j=-1,D=-1,V=0,ee=0,re=e,J=null;t:for(;;){for(var ge;re!==i||f!==0&&re.nodeType!==3||(j=w+f),re!==h||c!==0&&re.nodeType!==3||(D=w+c),re.nodeType===3&&(w+=re.nodeValue.length),(ge=re.firstChild)!==null;)J=re,re=ge;for(;;){if(re===e)break t;if(J===i&&++V===f&&(j=w),J===h&&++ee===c&&(D=w),(ge=re.nextSibling)!==null)break;re=J,J=re.parentNode}re=ge}i=j===-1||D===-1?null:{start:j,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(dc={focusedElem:e,selectionRange:i},Vo=!1,xe=n;xe!==null;)if(n=xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,xe=e;else for(;xe!==null;){n=xe;try{var ke=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var be=ke.memoizedProps,It=ke.memoizedState,B=n.stateNode,O=B.getSnapshotBeforeUpdate(n.elementType===n.type?be:rs(n.type,be),It);B.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var H=n.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(ce){Rt(n,n.return,ce)}if(e=n.sibling,e!==null){e.return=n.return,xe=e;break}xe=n.return}return ke=Wp,Wp=!1,ke}function so(e,n,i){var c=n.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&e)===e){var h=f.destroy;f.destroy=void 0,h!==void 0&&Zc(n,i,h)}f=f.next}while(f!==c)}}function ja(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var c=i.create;i.destroy=c()}i=i.next}while(i!==n)}}function Jc(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function Hp(e){var n=e.alternate;n!==null&&(e.alternate=null,Hp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[xs],delete n[Gi],delete n[mc],delete n[nx],delete n[sx])),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 Vp(e){return e.tag===5||e.tag===3||e.tag===4}function Gp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vp(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 eu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=sa));else if(c!==4&&(e=e.child,e!==null))for(eu(e,n,i),e=e.sibling;e!==null;)eu(e,n,i),e=e.sibling}function tu(e,n,i){var c=e.tag;if(c===5||c===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(c!==4&&(e=e.child,e!==null))for(tu(e,n,i),e=e.sibling;e!==null;)tu(e,n,i),e=e.sibling}var nn=null,is=!1;function er(e,n,i){for(i=i.child;i!==null;)Kp(e,n,i),i=i.sibling}function Kp(e,n,i){if($n&&typeof $n.onCommitFiberUnmount=="function")try{$n.onCommitFiberUnmount(vr,i)}catch{}switch(i.tag){case 5:fn||ci(i,n);case 6:var c=nn,f=is;nn=null,er(e,n,i),nn=c,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?hc(e.parentNode,i):e.nodeType===1&&hc(e,i),Li(e)):hc(nn,i.stateNode));break;case 4:c=nn,f=is,nn=i.stateNode.containerInfo,is=!0,er(e,n,i),nn=c,is=f;break;case 0:case 11:case 14:case 15:if(!fn&&(c=i.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){f=c=c.next;do{var h=f,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&Zc(i,n,w),f=f.next}while(f!==c)}er(e,n,i);break;case 1:if(!fn&&(ci(i,n),c=i.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=i.memoizedProps,c.state=i.memoizedState,c.componentWillUnmount()}catch(j){Rt(i,n,j)}er(e,n,i);break;case 21:er(e,n,i);break;case 22:i.mode&1?(fn=(c=fn)||i.memoizedState!==null,er(e,n,i),fn=c):er(e,n,i);break;default:er(e,n,i)}}function qp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new xx),n.forEach(function(c){var f=_x.bind(null,e,c);i.has(c)||(i.add(c),c.then(f,f))})}}function os(e,n){var i=n.deletions;if(i!==null)for(var c=0;c<i.length;c++){var f=i[c];try{var h=e,w=n,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));Kp(h,w,f),nn=null,is=!1;var D=f.alternate;D!==null&&(D.return=null),f.return=null}catch(V){Rt(f,n,V)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Yp(n,e),n=n.sibling}function Yp(e,n){var i=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(os(n,e),Ss(e),c&4){try{so(3,e,e.return),ja(3,e)}catch(be){Rt(e,e.return,be)}try{so(5,e,e.return)}catch(be){Rt(e,e.return,be)}}break;case 1:os(n,e),Ss(e),c&512&&i!==null&&ci(i,i.return);break;case 5:if(os(n,e),Ss(e),c&512&&i!==null&&ci(i,i.return),e.flags&32){var f=e.stateNode;try{an(f,"")}catch(be){Rt(e,e.return,be)}}if(c&4&&(f=e.stateNode,f!=null)){var h=e.memoizedProps,w=i!==null?i.memoizedProps:h,j=e.type,D=e.updateQueue;if(e.updateQueue=null,D!==null)try{j==="input"&&h.type==="radio"&&h.name!=null&&Fe(f,h),Ln(j,w);var V=Ln(j,h);for(w=0;w<D.length;w+=2){var ee=D[w],re=D[w+1];ee==="style"?ps(f,re):ee==="dangerouslySetInnerHTML"?Ct(f,re):ee==="children"?an(f,re):U(f,ee,re,V)}switch(j){case"input":Ht(f,h);break;case"textarea":he(f,h);break;case"select":var J=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!h.multiple;var ge=h.value;ge!=null?$t(f,!!h.multiple,ge,!1):J!==!!h.multiple&&(h.defaultValue!=null?$t(f,!!h.multiple,h.defaultValue,!0):$t(f,!!h.multiple,h.multiple?[]:"",!1))}f[Gi]=h}catch(be){Rt(e,e.return,be)}}break;case 6:if(os(n,e),Ss(e),c&4){if(e.stateNode===null)throw Error(r(162));f=e.stateNode,h=e.memoizedProps;try{f.nodeValue=h}catch(be){Rt(e,e.return,be)}}break;case 3:if(os(n,e),Ss(e),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Li(n.containerInfo)}catch(be){Rt(e,e.return,be)}break;case 4:os(n,e),Ss(e);break;case 13:os(n,e),Ss(e),f=e.child,f.flags&8192&&(h=f.memoizedState!==null,f.stateNode.isHidden=h,!h||f.alternate!==null&&f.alternate.memoizedState!==null||(ru=kt())),c&4&&qp(e);break;case 22:if(ee=i!==null&&i.memoizedState!==null,e.mode&1?(fn=(V=fn)||ee,os(n,e),fn=V):os(n,e),Ss(e),c&8192){if(V=e.memoizedState!==null,(e.stateNode.isHidden=V)&&!ee&&(e.mode&1)!==0)for(xe=e,ee=e.child;ee!==null;){for(re=xe=ee;xe!==null;){switch(J=xe,ge=J.child,J.tag){case 0:case 11:case 14:case 15:so(4,J,J.return);break;case 1:ci(J,J.return);var ke=J.stateNode;if(typeof ke.componentWillUnmount=="function"){c=J,i=J.return;try{n=c,ke.props=n.memoizedProps,ke.state=n.memoizedState,ke.componentWillUnmount()}catch(be){Rt(c,i,be)}}break;case 5:ci(J,J.return);break;case 22:if(J.memoizedState!==null){Zp(re);continue}}ge!==null?(ge.return=J,xe=ge):Zp(re)}ee=ee.sibling}e:for(ee=null,re=e;;){if(re.tag===5){if(ee===null){ee=re;try{f=re.stateNode,V?(h=f.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(j=re.stateNode,D=re.memoizedProps.style,w=D!=null&&D.hasOwnProperty("display")?D.display:null,j.style.display=Dn("display",w))}catch(be){Rt(e,e.return,be)}}}else if(re.tag===6){if(ee===null)try{re.stateNode.nodeValue=V?"":re.memoizedProps}catch(be){Rt(e,e.return,be)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===e)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===e)break e;for(;re.sibling===null;){if(re.return===null||re.return===e)break e;ee===re&&(ee=null),re=re.return}ee===re&&(ee=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:os(n,e),Ss(e),c&4&&qp(e);break;case 21:break;default:os(n,e),Ss(e)}}function Ss(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Vp(i)){var c=i;break e}i=i.return}throw Error(r(160))}switch(c.tag){case 5:var f=c.stateNode;c.flags&32&&(an(f,""),c.flags&=-33);var h=Gp(e);tu(e,h,f);break;case 3:case 4:var w=c.stateNode.containerInfo,j=Gp(e);eu(e,j,w);break;default:throw Error(r(161))}}catch(D){Rt(e,e.return,D)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function kx(e,n,i){xe=e,Xp(e)}function Xp(e,n,i){for(var c=(e.mode&1)!==0;xe!==null;){var f=xe,h=f.child;if(f.tag===22&&c){var w=f.memoizedState!==null||Na;if(!w){var j=f.alternate,D=j!==null&&j.memoizedState!==null||fn;j=Na;var V=fn;if(Na=w,(fn=D)&&!V)for(xe=f;xe!==null;)w=xe,D=w.child,w.tag===22&&w.memoizedState!==null?Jp(f):D!==null?(D.return=w,xe=D):Jp(f);for(;h!==null;)xe=h,Xp(h),h=h.sibling;xe=f,Na=j,fn=V}Qp(e)}else(f.subtreeFlags&8772)!==0&&h!==null?(h.return=f,xe=h):Qp(e)}}function Qp(e){for(;xe!==null;){var n=xe;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:fn||ja(5,n);break;case 1:var c=n.stateNode;if(n.flags&4&&!fn)if(i===null)c.componentDidMount();else{var f=n.elementType===n.type?i.memoizedProps:rs(n.type,i.memoizedProps);c.componentDidUpdate(f,i.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var h=n.updateQueue;h!==null&&Zf(n,h,c);break;case 3:var w=n.updateQueue;if(w!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Zf(n,w,i)}break;case 5:var j=n.stateNode;if(i===null&&n.flags&4){i=j;var D=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":D.autoFocus&&i.focus();break;case"img":D.src&&(i.src=D.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var V=n.alternate;if(V!==null){var ee=V.memoizedState;if(ee!==null){var re=ee.dehydrated;re!==null&&Li(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}fn||n.flags&512&&Jc(n)}catch(J){Rt(n,n.return,J)}}if(n===e){xe=null;break}if(i=n.sibling,i!==null){i.return=n.return,xe=i;break}xe=n.return}}function Zp(e){for(;xe!==null;){var n=xe;if(n===e){xe=null;break}var i=n.sibling;if(i!==null){i.return=n.return,xe=i;break}xe=n.return}}function Jp(e){for(;xe!==null;){var n=xe;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{ja(4,n)}catch(D){Rt(n,i,D)}break;case 1:var c=n.stateNode;if(typeof c.componentDidMount=="function"){var f=n.return;try{c.componentDidMount()}catch(D){Rt(n,f,D)}}var h=n.return;try{Jc(n)}catch(D){Rt(n,h,D)}break;case 5:var w=n.return;try{Jc(n)}catch(D){Rt(n,w,D)}}}catch(D){Rt(n,n.return,D)}if(n===e){xe=null;break}var j=n.sibling;if(j!==null){j.return=n.return,xe=j;break}xe=n.return}}var Sx=Math.ceil,Ca=A.ReactCurrentDispatcher,nu=A.ReactCurrentOwner,Xn=A.ReactCurrentBatchConfig,Ye=0,Yt=null,Ot=null,sn=0,Bn=0,ui=Ys(0),Ut=0,ro=null,_r=0,Ea=0,su=0,io=null,_n=null,ru=0,di=1/0,Os=null,_a=!1,iu=null,tr=null,Ra=!1,nr=null,Aa=0,oo=0,ou=null,Ia=-1,Ma=0;function Sn(){return(Ye&6)!==0?kt():Ia!==-1?Ia:Ia=kt()}function sr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&sn!==0?sn&-sn:ix.transition!==null?(Ma===0&&(Ma=Ai()),Ma):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:ef(e.type)),e)}function as(e,n,i,c){if(50<oo)throw oo=0,ou=null,Error(r(185));kr(e,i,c),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(Ea|=i),Ut===4&&rr(e,sn)),Rn(e,c),i===1&&Ye===0&&(n.mode&1)===0&&(di=kt()+500,aa&&Qs()))}function Rn(e,n){var i=e.callbackNode;Bo(e,n);var c=wr(e,e===Yt?sn:0);if(c===0)i!==null&&_t(i),e.callbackNode=null,e.callbackPriority=0;else if(n=c&-c,e.callbackPriority!==n){if(i!=null&&_t(i),n===1)e.tag===0?rx(th.bind(null,e)):Ff(th.bind(null,e)),ex(function(){(Ye&6)===0&&Qs()}),i=null;else{switch(le(c)){case 1:i=Bs;break;case 4:i=ys;break;case 16:i=Ur;break;case 536870912:i=Fo;break;default:i=Ur}i=ch(i,eh.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function eh(e,n){if(Ia=-1,Ma=0,(Ye&6)!==0)throw Error(r(327));var i=e.callbackNode;if(fi()&&e.callbackNode!==i)return null;var c=wr(e,e===Yt?sn:0);if(c===0)return null;if((c&30)!==0||(c&e.expiredLanes)!==0||n)n=Da(e,c);else{n=c;var f=Ye;Ye|=2;var h=sh();(Yt!==e||sn!==n)&&(Os=null,di=kt()+500,Ar(e,n));do try{Nx();break}catch(j){nh(e,j)}while(!0);Tc(),Ca.current=h,Ye=f,Ot!==null?n=0:(Yt=null,sn=0,n=Ut)}if(n!==0){if(n===2&&(f=Ri(e),f!==0&&(c=f,n=au(e,f))),n===1)throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;if(n===6)rr(e,c);else{if(f=e.current.alternate,(c&30)===0&&!bx(f)&&(n=Da(e,c),n===2&&(h=Ri(e),h!==0&&(c=h,n=au(e,h))),n===1))throw i=ro,Ar(e,0),rr(e,c),Rn(e,kt()),i;switch(e.finishedWork=f,e.finishedLanes=c,n){case 0:case 1:throw Error(r(345));case 2:Ir(e,_n,Os);break;case 3:if(rr(e,c),(c&130023424)===c&&(n=ru+500-kt(),10<n)){if(wr(e,0)!==0)break;if(f=e.suspendedLanes,(f&c)!==c){Sn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=pc(Ir.bind(null,e,_n,Os),n);break}Ir(e,_n,Os);break;case 4:if(rr(e,c),(c&4194240)===c)break;for(n=e.eventTimes,f=-1;0<c;){var w=31-xn(c);h=1<<w,w=n[w],w>f&&(f=w),c&=~h}if(c=f,c=kt()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*Sx(c/1960))-c,10<c){e.timeoutHandle=pc(Ir.bind(null,e,_n,Os),c);break}Ir(e,_n,Os);break;case 5:Ir(e,_n,Os);break;default:throw Error(r(329))}}}return Rn(e,kt()),e.callbackNode===i?eh.bind(null,e):null}function au(e,n){var i=io;return e.current.memoizedState.isDehydrated&&(Ar(e,n).flags|=256),e=Da(e,n),e!==2&&(n=_n,_n=i,n!==null&&lu(n)),e}function lu(e){_n===null?_n=e:_n.push.apply(_n,e)}function bx(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var c=0;c<i.length;c++){var f=i[c],h=f.getSnapshot;f=f.value;try{if(!ns(h(),f))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function rr(e,n){for(n&=~su,n&=~Ea,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-xn(n),c=1<<i;e[i]=-1,n&=~c}}function th(e){if((Ye&6)!==0)throw Error(r(327));fi();var n=wr(e,0);if((n&1)===0)return Rn(e,kt()),null;var i=Da(e,n);if(e.tag!==0&&i===2){var c=Ri(e);c!==0&&(n=c,i=au(e,c))}if(i===1)throw i=ro,Ar(e,0),rr(e,n),Rn(e,kt()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Ir(e,_n,Os),Rn(e,kt()),null}function cu(e,n){var i=Ye;Ye|=1;try{return e(n)}finally{Ye=i,Ye===0&&(di=kt()+500,aa&&Qs())}}function Rr(e){nr!==null&&nr.tag===0&&(Ye&6)===0&&fi();var n=Ye;Ye|=1;var i=Xn.transition,c=Ke;try{if(Xn.transition=null,Ke=1,e)return e()}finally{Ke=c,Xn.transition=i,Ye=n,(Ye&6)===0&&Qs()}}function uu(){Bn=ui.current,ht(ui)}function Ar(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Jy(i)),Ot!==null)for(i=Ot.return;i!==null;){var c=i;switch(xc(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&ia();break;case 3:ai(),ht(jn),ht(cn),Ic();break;case 5:Rc(c);break;case 4:ai();break;case 13:ht(Tt);break;case 19:ht(Tt);break;case 10:Nc(c.type._context);break;case 22:case 23:uu()}i=i.return}if(Yt=e,Ot=e=ir(e.current,null),sn=Bn=n,Ut=0,ro=null,su=Ea=_r=0,_n=io=null,jr!==null){for(n=0;n<jr.length;n++)if(i=jr[n],c=i.interleaved,c!==null){i.interleaved=null;var f=c.next,h=i.pending;if(h!==null){var w=h.next;h.next=f,c.next=w}i.pending=c}jr=null}return e}function nh(e,n){do{var i=Ot;try{if(Tc(),va.current=ka,ya){for(var c=Nt.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}ya=!1}if(Er=0,qt=Ft=Nt=null,Zi=!1,Ji=0,nu.current=null,i===null||i.return===null){Ut=1,ro=n,Ot=null;break}e:{var h=e,w=i.return,j=i,D=n;if(n=sn,j.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var V=D,ee=j,re=ee.tag;if((ee.mode&1)===0&&(re===0||re===11||re===15)){var J=ee.alternate;J?(ee.updateQueue=J.updateQueue,ee.memoizedState=J.memoizedState,ee.lanes=J.lanes):(ee.updateQueue=null,ee.memoizedState=null)}var ge=Cp(w);if(ge!==null){ge.flags&=-257,Ep(ge,w,j,h,n),ge.mode&1&&jp(h,V,n),n=ge,D=V;var ke=n.updateQueue;if(ke===null){var be=new Set;be.add(D),n.updateQueue=be}else ke.add(D);break e}else{if((n&1)===0){jp(h,V,n),du();break e}D=Error(r(426))}}else if(xt&&j.mode&1){var It=Cp(w);if(It!==null){(It.flags&65536)===0&&(It.flags|=256),Ep(It,w,j,h,n),Sc(li(D,j));break e}}h=D=li(D,j),Ut!==4&&(Ut=2),io===null?io=[h]:io.push(h),h=w;do{switch(h.tag){case 3:h.flags|=65536,n&=-n,h.lanes|=n;var B=Tp(h,D,n);Qf(h,B);break e;case 1:j=D;var O=h.type,H=h.stateNode;if((h.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(tr===null||!tr.has(H)))){h.flags|=65536,n&=-n,h.lanes|=n;var ce=Np(h,j,n);Qf(h,ce);break e}}h=h.return}while(h!==null)}ih(i)}catch(Ne){n=Ne,Ot===i&&i!==null&&(Ot=i=i.return);continue}break}while(!0)}function sh(){var e=Ca.current;return Ca.current=ka,e===null?ka:e}function du(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Yt===null||(_r&268435455)===0&&(Ea&268435455)===0||rr(Yt,sn)}function Da(e,n){var i=Ye;Ye|=2;var c=sh();(Yt!==e||sn!==n)&&(Os=null,Ar(e,n));do try{Tx();break}catch(f){nh(e,f)}while(!0);if(Tc(),Ye=i,Ca.current=c,Ot!==null)throw Error(r(261));return Yt=null,sn=0,Ut}function Tx(){for(;Ot!==null;)rh(Ot)}function Nx(){for(;Ot!==null&&!gs();)rh(Ot)}function rh(e){var n=lh(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,n===null?ih(e):Ot=n,nu.current=null}function ih(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=vx(i,n,Bn),i!==null){Ot=i;return}}else{if(i=yx(i,n),i!==null){i.flags&=32767,Ot=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,Ot=null;return}}if(n=n.sibling,n!==null){Ot=n;return}Ot=n=e}while(n!==null);Ut===0&&(Ut=5)}function Ir(e,n,i){var c=Ke,f=Xn.transition;try{Xn.transition=null,Ke=1,jx(e,n,i,c)}finally{Xn.transition=f,Ke=c}return null}function jx(e,n,i,c){do fi();while(nr!==null);if((Ye&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(Wo(e,h),e===Yt&&(Ot=Yt=null,sn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Ra||(Ra=!0,ch(Ur,function(){return fi(),null})),h=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||h){h=Xn.transition,Xn.transition=null;var w=Ke;Ke=1;var j=Ye;Ye|=4,nu.current=null,wx(e,i),Yp(i,e),Gy(dc),Vo=!!uc,dc=uc=null,e.current=i,kx(i),Hl(),Ye=j,Ke=w,Xn.transition=h}else e.current=i;if(Ra&&(Ra=!1,nr=e,Aa=f),h=e.pendingLanes,h===0&&(tr=null),Br(i.stateNode),Rn(e,kt()),n!==null)for(c=e.onRecoverableError,i=0;i<n.length;i++)f=n[i],c(f.value,{componentStack:f.stack,digest:f.digest});if(_a)throw _a=!1,e=iu,iu=null,e;return(Aa&1)!==0&&e.tag!==0&&fi(),h=e.pendingLanes,(h&1)!==0?e===ou?oo++:(oo=0,ou=e):oo=0,Qs(),null}function fi(){if(nr!==null){var e=le(Aa),n=Xn.transition,i=Ke;try{if(Xn.transition=null,Ke=16>e?16:e,nr===null)var c=!1;else{if(e=nr,nr=null,Aa=0,(Ye&6)!==0)throw Error(r(331));var f=Ye;for(Ye|=4,xe=e.current;xe!==null;){var h=xe,w=h.child;if((xe.flags&16)!==0){var j=h.deletions;if(j!==null){for(var D=0;D<j.length;D++){var V=j[D];for(xe=V;xe!==null;){var ee=xe;switch(ee.tag){case 0:case 11:case 15:so(8,ee,h)}var re=ee.child;if(re!==null)re.return=ee,xe=re;else for(;xe!==null;){ee=xe;var J=ee.sibling,ge=ee.return;if(Hp(ee),ee===V){xe=null;break}if(J!==null){J.return=ge,xe=J;break}xe=ge}}}var ke=h.alternate;if(ke!==null){var be=ke.child;if(be!==null){ke.child=null;do{var It=be.sibling;be.sibling=null,be=It}while(be!==null)}}xe=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,xe=w;else e:for(;xe!==null;){if(h=xe,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:so(9,h,h.return)}var B=h.sibling;if(B!==null){B.return=h.return,xe=B;break e}xe=h.return}}var O=e.current;for(xe=O;xe!==null;){w=xe;var H=w.child;if((w.subtreeFlags&2064)!==0&&H!==null)H.return=w,xe=H;else e:for(w=O;xe!==null;){if(j=xe,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:ja(9,j)}}catch(Ne){Rt(j,j.return,Ne)}if(j===w){xe=null;break e}var ce=j.sibling;if(ce!==null){ce.return=j.return,xe=ce;break e}xe=j.return}}if(Ye=f,Qs(),$n&&typeof $n.onPostCommitFiberRoot=="function")try{$n.onPostCommitFiberRoot(vr,e)}catch{}c=!0}return c}finally{Ke=i,Xn.transition=n}}return!1}function oh(e,n,i){n=li(i,n),n=Tp(e,n,1),e=Js(e,n,1),n=Sn(),e!==null&&(kr(e,1,n),Rn(e,n))}function Rt(e,n,i){if(e.tag===3)oh(e,e,i);else for(;n!==null;){if(n.tag===3){oh(n,e,i);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(tr===null||!tr.has(c))){e=li(i,e),e=Np(n,e,1),n=Js(n,e,1),e=Sn(),n!==null&&(kr(n,1,e),Rn(n,e));break}}n=n.return}}function Cx(e,n,i){var c=e.pingCache;c!==null&&c.delete(n),n=Sn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(sn&i)===i&&(Ut===4||Ut===3&&(sn&130023424)===sn&&500>kt()-ru?Ar(e,0):su|=i),Rn(e,n)}function ah(e,n){n===0&&((e.mode&1)===0?n=1:(n=Hr,Hr<<=1,(Hr&130023424)===0&&(Hr=4194304)));var i=Sn();e=Ms(e,n),e!==null&&(kr(e,n,i),Rn(e,i))}function Ex(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),ah(e,i)}function _x(e,n){var i=0;switch(e.tag){case 13:var c=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=e.stateNode;break;default:throw Error(r(314))}c!==null&&c.delete(n),ah(e,i)}var lh;lh=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||jn.current)En=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return En=!1,gx(e,n,i);En=(e.flags&131072)!==0}else En=!1,xt&&(n.flags&1048576)!==0&&Uf(n,ca,n.index);switch(n.lanes=0,n.tag){case 2:var c=n.type;Ta(e,n),e=n.pendingProps;var f=ei(n,cn.current);oi(n,i),f=Lc(null,n,c,e,f,i);var h=Oc();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Cn(c)?(h=!0,oa(n)):h=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ec(n),f.updater=Sa,n.stateNode=f,f._reactInternals=n,Bc(n,c,e,i),n=Gc(null,n,c,!0,h,i)):(n.tag=0,xt&&h&&yc(n),kn(null,n,f,i),n=n.child),n;case 16:c=n.elementType;e:{switch(Ta(e,n),e=n.pendingProps,f=c._init,c=f(c._payload),n.type=c,f=n.tag=Ax(c),e=rs(c,e),f){case 0:n=Vc(null,n,c,e,i);break e;case 1:n=Dp(null,n,c,e,i);break e;case 11:n=_p(null,n,c,e,i);break e;case 14:n=Rp(null,n,c,rs(c.type,e),i);break e}throw Error(r(306,c,""))}return n;case 0:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Vc(e,n,c,f,i);case 1:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Dp(e,n,c,f,i);case 3:e:{if(Lp(n),e===null)throw Error(r(387));c=n.pendingProps,h=n.memoizedState,f=h.element,Xf(e,n),ma(n,c,null,i);var w=n.memoizedState;if(c=w.element,h.isDehydrated)if(h={element:c,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){f=li(Error(r(423)),n),n=Op(e,n,c,i,f);break e}else if(c!==f){f=li(Error(r(424)),n),n=Op(e,n,c,i,f);break e}else for(Un=qs(n.stateNode.containerInfo.firstChild),Fn=n,xt=!0,ss=null,i=qf(n,null,c,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(si(),c===f){n=Ls(e,n,i);break e}kn(e,n,c,i)}n=n.child}return n;case 5:return Jf(n),e===null&&kc(n),c=n.type,f=n.pendingProps,h=e!==null?e.memoizedProps:null,w=f.children,fc(c,f)?w=null:h!==null&&fc(c,h)&&(n.flags|=32),Mp(e,n),kn(e,n,w,i),n.child;case 6:return e===null&&kc(n),null;case 13:return Pp(e,n,i);case 4:return _c(n,n.stateNode.containerInfo),c=n.pendingProps,e===null?n.child=ri(n,null,c,i):kn(e,n,c,i),n.child;case 11:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),_p(e,n,c,f,i);case 7:return kn(e,n,n.pendingProps,i),n.child;case 8:return kn(e,n,n.pendingProps.children,i),n.child;case 12:return kn(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(c=n.type._context,f=n.pendingProps,h=n.memoizedProps,w=f.value,ct(fa,c._currentValue),c._currentValue=w,h!==null)if(ns(h.value,w)){if(h.children===f.children&&!jn.current){n=Ls(e,n,i);break e}}else for(h=n.child,h!==null&&(h.return=n);h!==null;){var j=h.dependencies;if(j!==null){w=h.child;for(var D=j.firstContext;D!==null;){if(D.context===c){if(h.tag===1){D=Ds(-1,i&-i),D.tag=2;var V=h.updateQueue;if(V!==null){V=V.shared;var ee=V.pending;ee===null?D.next=D:(D.next=ee.next,ee.next=D),V.pending=D}}h.lanes|=i,D=h.alternate,D!==null&&(D.lanes|=i),jc(h.return,i,n),j.lanes|=i;break}D=D.next}}else if(h.tag===10)w=h.type===n.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),jc(w,i,n),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}kn(e,n,f.children,i),n=n.child}return n;case 9:return f=n.type,c=n.pendingProps.children,oi(n,i),f=qn(f),c=c(f),n.flags|=1,kn(e,n,c,i),n.child;case 14:return c=n.type,f=rs(c,n.pendingProps),f=rs(c.type,f),Rp(e,n,c,f,i);case 15:return Ap(e,n,n.type,n.pendingProps,i);case 17:return c=n.type,f=n.pendingProps,f=n.elementType===c?f:rs(c,f),Ta(e,n),n.tag=1,Cn(c)?(e=!0,oa(n)):e=!1,oi(n,i),Sp(n,c,f),Bc(n,c,f,i),Gc(null,n,c,!0,e,i);case 19:return zp(e,n,i);case 22:return Ip(e,n,i)}throw Error(r(156,n.tag))};function ch(e,n){return Qe(e,n)}function Rx(e,n,i,c){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,n,i,c){return new Rx(e,n,i,c)}function fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ax(e){if(typeof e=="function")return fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ve)return 11;if(e===te)return 14}return 2}function ir(e,n){var i=e.alternate;return i===null?(i=Qn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,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,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function La(e,n,i,c,f,h){var w=2;if(c=e,typeof e=="function")fu(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case K:return Mr(i.children,f,h,n);case $:w=8,f|=8;break;case ne:return e=Qn(12,i,n,f|2),e.elementType=ne,e.lanes=h,e;case we:return e=Qn(13,i,n,f),e.elementType=we,e.lanes=h,e;case Oe:return e=Qn(19,i,n,f),e.elementType=Oe,e.lanes=h,e;case ae:return Oa(i,f,h,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:w=10;break e;case G:w=9;break e;case ve:w=11;break e;case te:w=14;break e;case oe:w=16,c=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return n=Qn(w,i,n,f),n.elementType=e,n.type=c,n.lanes=h,n}function Mr(e,n,i,c){return e=Qn(7,e,c,n),e.lanes=i,e}function Oa(e,n,i,c){return e=Qn(22,e,c,n),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function pu(e,n,i){return e=Qn(6,e,null,n),e.lanes=i,e}function hu(e,n,i){return n=Qn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ix(e,n,i,c,f){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ii(0),this.expirationTimes=Ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.identifierPrefix=c,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function mu(e,n,i,c,f,h,w,j,D){return e=new Ix(e,n,i,j,D),n===1?(n=1,h===!0&&(n|=8)):n=0,h=Qn(3,null,null,n),e.current=h,h.stateNode=e,h.memoizedState={element:c,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ec(h),e}function Mx(e,n,i){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:c==null?null:""+c,children:e,containerInfo:n,implementation:i}}function uh(e){if(!e)return Xs;e=e._reactInternals;e:{if(Be(e)!==e||e.tag!==1)throw Error(r(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Cn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(Cn(i))return $f(e,i,n)}return n}function dh(e,n,i,c,f,h,w,j,D){return e=mu(i,c,!0,e,f,h,w,j,D),e.context=uh(null),i=e.current,c=Sn(),f=sr(i),h=Ds(c,f),h.callback=n??null,Js(i,h,f),e.current.lanes=f,kr(e,f,c),Rn(e,c),e}function Pa(e,n,i,c){var f=n.current,h=Sn(),w=sr(f);return i=uh(i),n.context===null?n.context=i:n.pendingContext=i,n=Ds(h,w),n.payload={element:e},c=c===void 0?null:c,c!==null&&(n.callback=c),e=Js(f,n,w),e!==null&&(as(e,f,w,h),ha(e,f,w)),w}function $a(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 fh(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function gu(e,n){fh(e,n),(e=e.alternate)&&fh(e,n)}function Dx(){return null}var ph=typeof reportError=="function"?reportError:function(e){console.error(e)};function vu(e){this._internalRoot=e}za.prototype.render=vu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(r(409));Pa(e,n,null,null)},za.prototype.unmount=vu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Rr(function(){Pa(null,e,null,null)}),n[_s]=null}};function za(e){this._internalRoot=e}za.prototype.unstable_scheduleHydration=function(e){if(e){var n=Se();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Vs.length&&n!==0&&n<Vs[i].priority;i++);Vs.splice(i,0,e),i===0&&Zd(e)}};function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hh(){}function Lx(e,n,i,c,f){if(f){if(typeof c=="function"){var h=c;c=function(){var V=$a(w);h.call(V)}}var w=dh(n,c,e,0,null,!1,!1,"",hh);return e._reactRootContainer=w,e[_s]=w.current,Hi(e.nodeType===8?e.parentNode:e),Rr(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof c=="function"){var j=c;c=function(){var V=$a(D);j.call(V)}}var D=mu(e,0,!1,null,null,!1,!1,"",hh);return e._reactRootContainer=D,e[_s]=D.current,Hi(e.nodeType===8?e.parentNode:e),Rr(function(){Pa(n,D,i,c)}),D}function Ua(e,n,i,c,f){var h=i._reactRootContainer;if(h){var w=h;if(typeof f=="function"){var j=f;f=function(){var D=$a(w);j.call(D)}}Pa(n,w,e,f)}else w=Lx(i,n,e,f,c);return $a(w)}b=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=xr(n.pendingLanes);i!==0&&(Hs(n,i|1),Rn(n,kt()),(Ye&6)===0&&(di=kt()+500,Qs()))}break;case 13:Rr(function(){var c=Ms(e,1);if(c!==null){var f=Sn();as(c,e,1,f)}}),gu(e,1)}},F=function(e){if(e.tag===13){var n=Ms(e,134217728);if(n!==null){var i=Sn();as(n,e,134217728,i)}gu(e,134217728)}},Z=function(e){if(e.tag===13){var n=sr(e),i=Ms(e,n);if(i!==null){var c=Sn();as(i,e,n,c)}gu(e,n)}},Se=function(){return Ke},je=function(e,n){var i=Ke;try{return Ke=e,n()}finally{Ke=i}},Vt=function(e,n,i){switch(n){case"input":if(Ht(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var c=i[n];if(c!==e&&c.form===e.form){var f=ra(c);if(!f)throw Error(r(90));Me(c),Ht(c,f)}}}break;case"textarea":he(e,i);break;case"select":n=i.value,n!=null&&$t(e,!!i.multiple,n,!1)}},vt=cu,yt=Rr;var Ox={usingClientEntryPoint:!1,Events:[Ki,Zr,ra,ft,Gt,cu]},ao={findFiberByHostInstance:Sr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Px={bundleType:ao.bundleType,version:ao.version,rendererPackageName:ao.rendererPackageName,rendererConfig:ao.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pn(e),e===null?null:e.stateNode},findFiberByHostInstance:ao.findFiberByHostInstance||Dx,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 Ba=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ba.isDisabled&&Ba.supportsFiber)try{vr=Ba.inject(Px),$n=Ba}catch{}}return An.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ox,An.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!yu(n))throw Error(r(200));return Mx(e,n,null,i)},An.createRoot=function(e,n){if(!yu(e))throw Error(r(299));var i=!1,c="",f=ph;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),n=mu(e,1,!1,null,null,i,!1,c,f),e[_s]=n.current,Hi(e.nodeType===8?e.parentNode:e),new vu(n)},An.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Pn(n),e=e===null?null:e.stateNode,e},An.flushSync=function(e){return Rr(e)},An.hydrate=function(e,n,i){if(!Fa(n))throw Error(r(200));return Ua(null,e,n,!0,i)},An.hydrateRoot=function(e,n,i){if(!yu(e))throw Error(r(405));var c=i!=null&&i.hydratedSources||null,f=!1,h="",w=ph;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),n=dh(n,null,e,1,i??null,f,!1,h,w),e[_s]=n.current,Hi(e),c)for(e=0;e<c.length;e++)i=c[e],f=i._getVersion,f=f(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,f]:n.mutableSourceEagerHydrationData.push(i,f);return new za(n)},An.render=function(e,n,i){if(!Fa(n))throw Error(r(200));return Ua(null,e,n,!1,i)},An.unmountComponentAtNode=function(e){if(!Fa(e))throw Error(r(40));return e._reactRootContainer?(Rr(function(){Ua(null,null,e,!1,function(){e._reactRootContainer=null,e[_s]=null})}),!0):!1},An.unstable_batchedUpdates=cu,An.unstable_renderSubtreeIntoContainer=function(e,n,i,c){if(!Fa(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return Ua(e,n,i,!1,c)},An.version="18.3.1-next-f1338f8080-20240426",An}var Sh;function gg(){if(Sh)return ku.exports;Sh=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(s){console.error(s)}}return t(),ku.exports=Gx(),ku.exports}var bh;function Kx(){if(bh)return Wa;bh=1;var t=gg();return Wa.createRoot=t.createRoot,Wa.hydrateRoot=t.hydrateRoot,Wa}var qx=Kx();const Yx=mg(qx),Th=t=>{let s;const r=new Set,o=(m,v)=>{const k=typeof m=="function"?m(s):m;if(!Object.is(k,s)){const y=s;s=v??(typeof k!="object"||k===null)?k:Object.assign({},s,k),r.forEach(S=>S(s,y))}},l=()=>s,p={setState:o,getState:l,getInitialState:()=>g,subscribe:m=>(r.add(m),()=>r.delete(m))},g=s=t(o,l,p);return p},Xx=(t=>t?Th(t):Th),Qx=t=>t;function Zx(t,s=Qx){const r=ot.useSyncExternalStore(t.subscribe,ot.useCallback(()=>s(t.getState()),[t,s]),ot.useCallback(()=>s(t.getInitialState()),[t,s]));return ot.useDebugValue(r),r}const Jx=t=>{const s=Xx(t),r=o=>Zx(s,o);return Object.assign(r,s),r},e0=(t=>Jx),vg="agentpane:machines",yg="agentpane:active-machine";function t0(t){return/^[a-z][a-z0-9-]{1,30}$/.test(t)}function xg(t){return`${t}.repoburg.com`}function wg(t){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(t);return s?s[1]:null}function kg(t,s){try{const r=localStorage.getItem(t);return r==null?s:JSON.parse(r)}catch{return s}}function Sg(t,s){try{localStorage.setItem(t,JSON.stringify(s))}catch{}}function n0(t){const{mahlas:s,hostname:r}=t??{};return typeof s=="string"&&t0(s)&&r===xg(s)}function bg(){const t=kg(vg,[]);return Array.isArray(t)?t.filter(n0):[]}function s0(t){const s={mahlas:t,hostname:xg(t),lastConnectedAt:new Date().toISOString()},r=bg(),o=[s,...r.filter(l=>l.mahlas!==t)];return Sg(vg,o),s}function r0(){const t=kg(yg,null);return t?bg().find(s=>s.mahlas===t)??null:null}function i0(t){Sg(yg,t)}function o0(){if(typeof window>"u")return;const t=new URLSearchParams(window.location.search).get("host");if(!t)return;const s=wg(t);s&&(s0(s),i0(s))}const Nh="http://localhost:9998",a0=["agent.repoburg.com"];function mn(){if(typeof window>"u")return"";const t=new URLSearchParams(window.location.search),s=t.get("bport");if(s)return`http://localhost:${s}`;const r=t.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(a0.includes(o))return Nh;if(wg(o))return"";const l=r0();return l?`https://${l.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Nh}const l0="/api";class yd extends Error{constructor(r,o,l){super(r);rt(this,"status");rt(this,"body");this.name="ApiError",this.status=o,this.body=l}}function xi(t){var s;if(t instanceof yd){const r=(s=t.body)==null?void 0:s.error;if(typeof r=="string"&&r)return r}return t instanceof Error?t.message:String(t)}async function Io(t,s,r){const o=await fetch(`${mn()}${l0}${s}`,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!o.ok){let l=`${o.status} ${o.statusText}`,u=null;try{u=await o.json();const d=u==null?void 0:u.error;typeof d=="string"&&d&&(l=`${l} — ${d}`)}catch{}throw new yd(`${t} ${s} failed: ${l}`,o.status,u)}return o.json()}function Wt(t){return Io("GET",t)}function ut(t,s){return Io("POST",t,s)}function Rl(t){return Io("DELETE",t)}function Ns(t,s){return Io("PATCH",t,s)}function c0(t,s){return Io("PUT",t,s)}function u0(){return Wt("/sessions")}function co(t){return Wt(`/sessions/${t}`)}function xd(t){return ut("/sessions",t)}function jh(t){return Rl(`/sessions/${t}`)}function Tg(t,s,r,o){return ut(`/sessions/${t}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function d0(t){return ut(`/sessions/${t}/cancel`)}function f0(t,s){return ut(`/sessions/${t}/turns/${s}/resume`)}function p0(t,s){return Ns(`/sessions/${t}`,{title:s})}function Ch(t){return Ns(`/sessions/${t}`,{lifecycle:"finished"})}function Eh(t){return Ns(`/sessions/${t}`,{lifecycle:"working"})}function h0(t,s){return Ns(`/sessions/${t}`,{starred:s})}function _h(t){return Ns(`/sessions/${t}`,{has_unreviewed:0})}function m0(t,s,r,o){const l={model:s,model_reasoning_effort:r};return o!==void 0&&(l.runtime_type=o),Ns(`/sessions/${t}`,l)}function g0(t,s){return Ns(`/sessions/${t}`,{runtime_config:s})}function v0(t,s){return ut(`/sessions/${t}/rewind`,{turn_id:s})}function y0(t){return ut(`/sessions/${t}/restore`,{})}function x0(t,s,r){return ut(`/sessions/${t}/branch`,{turn_id:s,title:r})}function Ng(){return Wt("/workspaces")}function w0(t,s){return ut("/workspaces",{path:t,label:s})}function k0(t){return ut("/workspaces/hide",{path:t})}function S0(){return Wt("/workspaces/picker")}function Rh(t){return Wt(t?`/workspaces/browse?path=${encodeURIComponent(t)}`:"/workspaces/browse")}async function b0(){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 jg(){return Wt("/folders")}function T0(t,s){return ut("/folders",{workspace_path:t,name:s})}function Ah(t,s){return Ns(`/folders/${t}`,s)}function N0(t){return Rl(`/folders/${t}`)}function j0(t){return ut("/sessions/reorder",{moves:t})}function hr(t){return t.status==="pending"||t.status==="running"}function Cg(t){return!!(t!=null&&t.turns.some(hr))}function Al(t){return t?t.turns.some(hr)||(t.threads??[]).some(s=>(s.turns??[]).some(hr)):!1}const C0="s:",Ku="a:",Pr=t=>`${C0}${t}`,No=t=>`${Ku}${t}`;function fr(t){return{kind:t.startsWith(Ku)?"app":"session",id:t.slice(Ku.length)}}function wd(t){return t.activeAppTabId!==null?No(t.activeAppTabId):t.activeSessionId===null?null:Pr(t.activeSessionId)}function Eg(t,s,r){const o=[...s.map(Pr),...r.map(No)],l=new Set(o),u=t.filter(g=>l.has(g)),d=new Set(u),p=o.filter(g=>!d.has(g));return p.length===0&&u.length===t.length?t:[...u,...p]}function E0(t){return t.subscribe((s,r)=>{if(s.openTabs===r.openTabs&&s.openAppTabs===r.openAppTabs)return;const o=Eg(s.tabOrder,s.openTabs,s.openAppTabs);o!==s.tabOrder&&t.setState({tabOrder:o})})}function Ih(t,s,r){const o=t.indexOf(s);return t.slice(o+1).find(r)??t.slice(0,Math.max(o,0)).reverse().find(r)??null}function kd(t,s){const r=d=>!s.has(d),o=wd(t);let{activeSessionId:l,activeAppTabId:u}=t;if(o!==null&&s.has(o)){const d=Ih(t.tabOrder,o,r),p=d===null?null:fr(d);u=(p==null?void 0:p.kind)==="app"?p.id:null,(p==null?void 0:p.kind)==="session"&&(l=p.id)}if(l!==null&&s.has(Pr(l))){const d=g=>r(g)&&fr(g).kind==="session",p=Ih(t.tabOrder,Pr(l),d);l=p===null?null:fr(p).id}return{activeSessionId:l,activeAppTabId:u}}function _g(t,s){if(t.tabOrder.includes(s))return!1;const{kind:r,id:o}=fr(s);return(r==="app"?t.apps:t.sessions).some(u=>u.id===o)}const Rg=1;function Ag(){let t="";try{t=mn()}catch{}return`agentpane:tabs:${t||window.location.origin}`}function Tu(t){return Array.isArray(t)&&t.every(s=>typeof s=="string")}function Mh(t){return t===null||typeof t=="string"}function _0(t){if(t==null)return null;let s;try{s=JSON.parse(t)}catch{return null}if(typeof s!="object"||s===null)return null;const r=s;return r.v!==Rg||!Tu(r.openTabs)||!Mh(r.activeSessionId)||!Tu(r.openAppTabs)||!Mh(r.activeAppTabId)?null:{openTabs:r.openTabs,activeSessionId:r.activeSessionId,openAppTabs:r.openAppTabs,activeAppTabId:r.activeAppTabId,tabOrder:Tu(r.tabOrder)?r.tabOrder:[]}}const Ig=[()=>window.sessionStorage,()=>window.localStorage];function R0(){const t=Ag();for(const s of Ig)try{const r=_0(s().getItem(t));if(r)return r}catch{}return null}function A0(t){const s=Ag(),r=JSON.stringify({v:Rg,openTabs:t.openTabs,activeSessionId:t.activeSessionId,openAppTabs:t.openAppTabs,activeAppTabId:t.activeAppTabId,tabOrder:t.tabOrder});for(const o of Ig)try{o().setItem(s,r)}catch{}}function I0(t){return t.subscribe((s,r)=>{(s.openTabs!==r.openTabs||s.activeSessionId!==r.activeSessionId||s.openAppTabs!==r.openAppTabs||s.activeAppTabId!==r.activeAppTabId||s.tabOrder!==r.tabOrder)&&A0(s)})}function xo(t){return[...new Set(t)]}function M0(t,s,r,o){const l=v=>r===null||r.has(v),u=xo(((t==null?void 0:t.openTabs)??[]).filter(v=>s.has(v))),d=xo(((t==null?void 0:t.openAppTabs)??[]).filter(l));let p=(t==null?void 0:t.activeSessionId)??null;p!==null&&!s.has(p)&&(p=null),p!==null&&!u.includes(p)&&u.push(p),p??(p=u.at(-1)??null);let g=(t==null?void 0:t.activeAppTabId)??null;g!==null&&!l(g)&&(g=null),g!==null&&!d.includes(g)&&d.push(g),o!==null&&s.has(o)&&(u.includes(o)||u.push(o),p=o,g=null);const m=Eg(xo((t==null?void 0:t.tabOrder)??[]),u,d);return{openTabs:u,activeSessionId:p,openAppTabs:d,activeAppTabId:g,tabOrder:m}}function D0(){const t=new URLSearchParams(window.location.search);return{session:t.get("session"),thread:t.get("thread")}}function L0(){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 Nu=0;function Dh(t){return t==="sidecar"?"sidecar":"turns"}async function O0(t,s){const r=await Promise.allSettled(t.map(u=>s(u))),o=new Map;let l=null;return r.forEach((u,d)=>{var p;u.status==="fulfilled"?o.set(t[d],u.value):l===null&&(l=((p=u.reason)==null?void 0:p.message)??"Request failed")}),{updated:o,firstError:l}}function P0(t,s){const r={...t.sessionDetails};s.forEach(p=>delete r[p]);const o={...t.backgroundTasks};s.forEach(p=>delete o[p]);const l=t.openTabs.filter(p=>!s.has(p)),u=kd(t,new Set([...s].map(Pr)));let d=t.activeTurnIndex;if(u.activeSessionId!==t.activeSessionId){const p=u.activeSessionId?r[u.activeSessionId]:null;d=p&&p.turns.length>0?p.turns.length-1:0}return{sessions:t.sessions.filter(p=>!s.has(p.id)),sessionDetails:r,backgroundTasks:o,openTabs:l,...u,activeTurnIndex:d}}function $0(t){const s={...t};return delete s.turns,delete s.threads,delete s.contextUsage,s}function Lh(t,s,r){const o=s().activeSessionId;t(u=>P0(u,r));const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0})}async function Oh(t,s,r,o,l){if(r.length===0)return;t({error:null});const{updated:u,firstError:d}=await O0(r,o);u.size>0&&t(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const p=r.length-u.size;if(p===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${l}`);else{t({error:d});const g=l[0].toUpperCase()+l.slice(1);s().addToast(p===r.length?"error":"warn",`${g} ${u.size} of ${r.length} — ${p} failed`)}}const z0=(t,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const r=D0(),o=R0();try{const l=localStorage.getItem("agentpane:last-model-config");l&&t({lastModelConfig:JSON.parse(l)})}catch{}t({loading:!0,error:null});try{const l=s().loadApps(),[u,d,p]=await Promise.all([u0(),Ng(),jg()]);t({sessions:u,workspaces:d,folders:p,loading:!1}),L0();const g=await l,m=M0(o,new Set(u.map(v=>v.id)),g?new Set(s().apps.map(v=>v.id)):null,r.session);t(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:xo([...m.openTabs,...v.openTabs]),openAppTabs:xo([...m.openAppTabs,...v.openAppTabs]),tabOrder:m.tabOrder,activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!s().activeSessionId&&await s().selectSession(m.activeSessionId,{keepAppView:!0}),r.thread&&(t({deepLinkThreadId:r.thread}),s().switchRightTab("threads"))}catch(l){t({loading:!1,error:l.message})}},selectSession:async(r,o)=>{const l=++Nu,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},d=p=>p.includes(r)?p:[...p,r];if(s().sessionDetails[r]){const p=s().sessionDetails[r];t({activeSessionId:r,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:Dh(s().activeRightTab),...u,openTabs:d(s().openTabs)}),p.has_unreviewed===1&&(_h(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 co(r);if(l!==Nu){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:Dh(g.activeRightTab),...u,openTabs:d(g.openTabs),loading:!1})),p.has_unreviewed===1&&(_h(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(l===Nu?{loading:!1,error:p.message}:{loading:!1})}},closeTab:r=>s().closeTabs([Pr(r)]),updateModelConfig:async(r,o,l)=>{const u=s().activeSessionId;if(u){t({error:null});try{const d=await m0(u,r,o,l),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===u?d:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:d.model,model_reasoning_effort:d.model_reasoning_effort,external_thread_id:d.external_thread_id}}:g.sessionDetails})),await s().refreshActiveSession()}catch(d){t({error:d.message}),s().addToast("error",`Failed to update model — ${d.message}`)}}},createSession:async r=>{t({error:null});try{const o=await xd(r);t(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const l={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};t({lastModelConfig:l}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(l)),await s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},addSession:r=>{t(o=>({sessions:o.sessions.some(l=>l.id===r.id)?o.sessions:[r,...o.sessions]}))},revealSession:async r=>{let o=s().sessionDetails[r];if(!o){const l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l}})),o=l}s().sessions.some(l=>l.id===r)||s().addSession($0(o)),await s().selectSession(r)},deleteSession:async r=>{var l;t({error:null});const o=(l=s().sessions.find(u=>u.id===r))==null?void 0:l.title;try{await jh(r),Lh(t,s,new Set([r])),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){t({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{t({error:null});try{const l=await p0(r,o.trim());t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:l.title}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to rename session — ${l.message}`)}},markFinished:async r=>{t({error:null});try{const o=await Ch(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){t({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Oh(t,s,r,Ch,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(l=>l.id===r);if(o){t({error:null});try{const l=await h0(r,o.starred?0:1);t(u=>({sessions:u.sessions.map(d=>d.id===r?l:d),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:l.starred}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to star session — ${l.message}`)}}},reopenSession:async r=>{t({error:null});try{const o=await Eh(r);t(l=>({sessions:l.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){t({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Oh(t,s,r,Eh,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;t({error:null});const o=await Promise.allSettled(r.map(d=>jh(d))),l=new Set;if(o.forEach((d,p)=>{d.status==="fulfilled"&&l.add(r[p])}),l.size===0){t({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}Lh(t,s,l),s().addLogEntry("INFO",`${l.size} session${l.size===1?"":"s"} deleted`);const u=r.length-l.size;u===0?s().addToast("info",`${l.size} session${l.size===1?"":"s"} deleted`):(t({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${l.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const l=s().activeSessionId;if(l){t({error:null,submittingPrompt:r}),t(u=>{const d=u.sessionDetails[l];return d?{sessionDetails:{...u.sessionDetails,[l]:{...d,is_running:1,status:"running"}},sessions:u.sessions.map(p=>p.id===l?{...p,is_running:1,status:"running"}:p)}:{}});try{const u=await Tg(l,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.slice(0,40)}"`),t(d=>{const p=d.sessionDetails[l];if(!p)return{submittingPrompt:null};const g=p.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...d.sessionDetails,[l]:{...p,turns:[...p.turns,m]}},activeTurnIndex:p.turns.length}})}catch(u){t({submittingPrompt:null,error:u.message}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),t(d=>{const p=d.sessionDetails[l];if(!p)return{};const g=Al(p)?1:0;return{sessionDetails:{...d.sessionDetails,[l]:{...p,is_running:g,status:g?"running":"active"}},sessions:d.sessions.map(m=>m.id===l?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const r=s().activeSessionId;if(r)try{await d0(r)}catch(o){t({error:o.message})}},rewindToTurn:async(r,o)=>{t({error:null});try{const l=await v0(r,o),u=await co(r);t(d=>({sessionDetails:{...d.sessionDetails,[r]:u},sessions:d.sessions.map(p=>p.id===r?{...p,external_thread_id:l.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(l){t({error:l.message}),s().addToast("error",`Failed to rewind — ${l.message}`)}},restoreSession:async r=>{t({error:null});try{const o=await y0(r),l=await co(r);t(u=>({sessionDetails:{...u.sessionDetails,[r]:l},sessions:u.sessions.map(d=>d.id===r?{...d,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:d),activeTurnIndex:l.turns.length>0?l.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){t({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,l)=>{t({error:null});try{const u=await x0(r,o,l);t(d=>({sessions:[u,...d.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){t({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){t({error:null});try{const l=await g0(o,JSON.stringify(r));t(u=>({sessions:u.sessions.map(d=>d.id===o?l:d),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:l.runtime_config}}:u.sessionDetails}))}catch(l){t({error:l.message}),s().addToast("error",`Failed to update config — ${l.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await co(r);t(l=>({sessionDetails:{...l.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(l.activeTurnIndex,o.turns.length-1):0,sessions:l.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){t({error:o.message})}}});async function Mg(t){const{sessions:s}=await Wt(`/claude-sessions?workspace=${encodeURIComponent(t)}`);return s}function F0(t,s){return ut(`/claude-sessions/${encodeURIComponent(t)}/import`,{workspace:s})}const Ph={available:!0,reason:null};let ju=null;const U0=(t,s)=>({workspaces:[],pickerSupport:null,loadPickerSupport:()=>{const r=s().pickerSupport;return r?Promise.resolve(r):(ju??(ju=S0().then(o=>typeof(o==null?void 0:o.available)!="boolean"?Ph:(t({pickerSupport:o}),o)).catch(()=>Ph).finally(()=>{ju=null})),ju)},createWorkspaceAt:async r=>{const o=await w0(r.trim());return t(l=>({workspaces:[...l.workspaces.filter(u=>u.id!==o.id),o]})),o},addWorkspace:async r=>{t({error:null});try{const o=await s().createWorkspaceAt(r);return s().addToast("success",`Workspace added — ${o.path}`),o}catch(o){return s().addToast("error",`Failed to add workspace — ${xi(o)}`),null}},removeWorkspace:async r=>{t({error:null});try{await k0(r);const o=await Ng();t({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{t({error:null});try{const o=s().lastModelConfig,l=await xd({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(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`Session created in ${r} — ${l.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){t({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{if(!(await s().loadPickerSupport()).available){s().setShowAddWorkspaceDialog(!0);return}try{const o=await b0();if(o.cancelled||!o.path)return;await s().addWorkspace(o.path)}catch(o){s().addToast("error",`Failed to pick directory — ${o.message}`)}},importClaudeSessions:async(r,o)=>{const l=[],u=[];for(const d of[...o].reverse())try{l.unshift(await F0(d,r))}catch(p){u.unshift({id:d,error:xi(p)})}return l.length>0&&(t(d=>({sessions:[...l,...d.sessions]})),await s().selectSession(l[0].id),s().addLogEntry("INFO",`Imported ${l.length} Claude Code session(s) into ${r}`),s().addToast("success",l.length===1?`Imported — ${l[0].title||"Claude Code session"}`:`Imported ${l.length} Claude Code sessions`)),{imported:l,failed:u}}}),Fs=new Map,Sd=new Map,Il=new Map,bd=new Map,Ml=new Map;function B0(t,s,r=""){Fs.set(t,s),Sd.set(t,r)}function W0(t){Fs.delete(t),Sd.delete(t)}function Cu(t,s){Il.set(t,s)}function $h(t,s,r){const o=Il.get(t);if(!o)return;const l=Fs.get(o);l&&l({source:"agentpane-host",event:s,payload:r})}function zh(t,s){const r=Il.get(t);if(!r)return;const o=Fs.get(r);o&&o({source:"agentpane-host",event:"background_tasks",payload:{sessionId:t,tasks:s}})}function H0(t,s,r,o,l){if(typeof l=="string"&&l!==Sd.get(t))return;const u=Fs.get(t);u&&u({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function V0(t,s,r,o){const l=Il.get(t);if(!l)return;const u=Fs.get(l);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:t,turnId:s,itemId:r,delta:o}})}function G0(t,s){bd.set(t,s)}function K0(t){bd.delete(t)}function q0(t,s){Ml.set(t,s)}function Y0(t){Ml.delete(t)}function Dg(t,s={}){const r=Ml.get(t);if(r){r(s);return}const o=Fs.get(t);o&&o({source:"agentpane-host",event:"state_changed",payload:{}})}function X0(){for(const t of new Set([...Fs.keys(),...Ml.keys()]))Dg(t)}function Q0(t){var r;const s=Fs.get(t);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=bd.get(t))==null||r()}const Z0=(t,s)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:r=>t({wsConnected:r}),onTurnCreated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return!u||o.thread_id?{}:u.turns.some(d=>d.id===o.id)?{}:{sessionDetails:{...l.sessionDetails,[r]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),t(l=>{const u=ar(l.sessions,r,()=>({is_running:1,status:"running"})),d=l.sessionDetails[r];if(!d)return{sessions:u};const p=d.turns.findIndex(g=>g.id===o);return{sessionDetails:{...l.sessionDetails,[r]:{...Zn(d,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:l.activeSessionId===r&&p>=0?p:l.activeTurnIndex}})},onItemStarted:(r,o,l)=>{s().addLogEntry("DEBUG",`item:started — ${l.type}`),t(u=>{const d=Fh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>_u(g,l))},retryStates:d}:{retryStates:d}})},onItemUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>_u(p,l))}}:{}})},onItemCompleted:(r,o,l)=>{if(s().addLogEntry("DEBUG",`item:completed — ${l.type}`),l.type==="background_task"&&(l.status==="completed"||l.status==="failed")){const u=l.data||{},d=u.task_type||"unknown",p=u.description||"background task",m=d==="local_agent"?"Subagent":d==="local_bash"?"Monitor":"Task";l.status==="completed"?s().addToast("success",`${m} completed: ${p}`):u.status!=="stopped"&&s().addToast("error",`${m} failed: ${p}`)}t(u=>{const d=Fh(l)?Dr(u.retryStates,o):u.retryStates,p=u.sessionDetails[r];return p?{retryStates:d,sessionDetails:{...u.sessionDetails,[r]:Zn(p,o,g=>{var v,k;let m=_u(g,l);if(l.type==="agent_message"&&((v=l.data)!=null&&v.text)&&(m={...m,agent_response:l.data.text}),l.type==="reasoning"&&((k=l.data)!=null&&k.text)){const y=m.thoughts?m.thoughts+`
41
+ `+l.data.text:l.data.text;m={...m,thoughts:y}}return m})}}:{retryStates:d}})},onItemDelta:(r,o,l,u)=>{V0(r,o,l,u),t(d=>{const p=Dr(d.retryStates,o),g=d.sessionDetails[r];return g?{sessionDetails:{...d.sessionDetails,[r]:Zn(g,o,m=>ew(m,l,u))},retryStates:p}:{retryStates:p}})},onTurnCompleted:(r,o,l,u,d)=>{const p=(l==null?void 0:l.input_tokens)??0,g=(l==null?void 0:l.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${p} in / ${g} out`),$h(r,"turn:completed",{turnId:o,response:d??null}),s().refreshApps(),t(m=>{const v=m.sessionDetails[r],k=v?Zn(v,o,T=>({...T,status:"completed",token_usage:l??T.token_usage??null,...d&&!T.agent_response?{agent_response:d}:{}})):null,y=Eu(k),S=y&&k?Ha(k):"active",N=ar(m.sessions,r,T=>({is_running:y,status:S,has_unreviewed:u?1:T.has_unreviewed})),E=Dr(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[r]:{...k,is_running:y,status:S,has_unreviewed:u?1:k.has_unreviewed}},sessions:N,retryStates:E}:{sessions:N,retryStates:E}})},onTokenUsageUpdated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:Zn(d,o,p=>({...p,token_usage:l}))}}:{}})},onContextUsageUpdated:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,l,u)=>{s().addLogEntry("ERROR",`turn:failed — ${l}`),s().addToast("error",`Turn failed — ${l}`),$h(r,"turn:failed",{turnId:o,error:l}),t(d=>{const p=d.sessionDetails[r],g=l.includes("cancelled")||l.includes("aborted"),m=g?"aborted":"failed",v=p?Zn(p,o,E=>({...E,status:m,error:l,...u?{resume_state:u}:{},items:E.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})):null,k=Eu(v),y=k&&v?Ha(v):g?"active":"failed",S=ar(d.sessions,r,()=>({is_running:k,status:y})),N=Dr(d.retryStates,o);return v?{sessionDetails:{...d.sessionDetails,[r]:{...v,is_running:k,status:y}},sessions:S,retryStates:N}:{sessions:S,retryStates:N}})},onTurnCancelled:(r,o)=>{t(l=>{const u=l.sessionDetails[r],d=u?Zn(u,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=Eu(d),g=p&&d?Ha(d):"active",m=ar(l.sessions,r,()=>({is_running:p,status:g})),v=Dr(l.retryStates,o);return d?{sessionDetails:{...l.sessionDetails,[r]:{...d,is_running:p,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(r,o,l)=>{s().addLogEntry("WARN",`turn:interrupted — ${l.reason}${l.detail?` (${l.detail})`:""}`),s().addToast("warn",J0(l.reason)),t(u=>{const d=u.sessionDetails[r],p=d?Zn(d,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:l.reason,interrupted_at:l.interruptedAt,resume_attempts:l.attempts})):null,g=p?Ha(p):"interrupted",m=ar(u.sessions,r,()=>({is_running:1,status:g})),v=Dr(u.retryStates,o);return p?{sessionDetails:{...u.sessionDetails,[r]:{...p,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(r,o,l)=>{s().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${l})`),t(u=>{const d=ar(u.sessions,r,()=>({is_running:1,status:"running"})),p=u.sessionDetails[r];return p?{sessionDetails:{...u.sessionDetails,[r]:{...Zn(p,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:l})),is_running:1,status:"running"}},sessions:d}:{sessions:d}})},onTurnResumed:(r,o)=>{s().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),s().addToast("success","Interrupted turn resumed"),t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:Zn(u,o,d=>({...d,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(r,o,l)=>{s().addLogEntry("WARN",`turn:retrying — ${r.slice(0,8)}/${o.slice(0,8)} attempt ${l.attempt}/${l.maxRetries} (${l.errorStatus??"no response"}${l.error?`, ${l.error}`:""})`),t(u=>({retryStates:{...u.retryStates,[o]:l}}))},onSessionTitle:(r,o)=>{t(l=>({sessions:l.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:l.sessionDetails[r]?{...l.sessionDetails,[r]:{...l.sessionDetails[r],title:o}}:l.sessionDetails}))},onSessionTouched:r=>{t(o=>{const l=o.sessionDetails[r];return{sessions:ar(o.sessions,r,()=>({user_touched:1})),sessionDetails:l?{...o.sessionDetails,[r]:{...l,user_touched:1}}:o.sessionDetails}})},onSessionUpdated:r=>{const o={...r};delete o.is_running,delete o.status,t(l=>{const u=l.sessionDetails[r.id];return{sessions:ar(l.sessions,r.id,()=>o),sessionDetails:u?{...l.sessionDetails,[r.id]:{...u,...o}}:l.sessionDetails}})},onBackgroundTasksChanged:(r,o)=>{zh(r,o),t(l=>{if(o.length===0&&!l.backgroundTasks[r])return{};const u={...l.backgroundTasks};return o.length>0?u[r]=o:delete u[r],{backgroundTasks:u}})},onBackgroundTasksSnapshot:r=>{for(const[l,u]of Object.entries(r))zh(l,u);const o={};for(const[l,u]of Object.entries(r))u.length>0&&(o[l]=u);t({backgroundTasks:o})}});function J0(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";default:return"The agent host restarted — resuming the turn"}}function Ha(t){const s=[...t.turns,...(t.threads??[]).flatMap(r=>r.turns??[])].filter(hr);return s.length>0&&s.every(r=>r.status==="pending"&&r.resume_state==="waiting")?"interrupted":"running"}function Fh(t){return t.type!=="background_task"&&t.type!=="error"&&t.type!=="interruption"}function Dr(t,s){if(!(s in t))return t;const r={...t};return delete r[s],r}function Eu(t){return t&&(t.turns.some(hr)||(t.threads??[]).some(r=>(r.turns??[]).some(hr)))?1:0}function ar(t,s,r){return t.some(o=>o.id===s)?t.map(o=>o.id===s?{...o,...r(o)}:o):t}function Zn(t,s,r){const o=(t.threads??[]).map(l=>(l.turns??[]).some(u=>u.id===s)?{...l,turns:(l.turns??[]).map(u=>u.id===s?r(u):u)}:l);return{...t,turns:t.turns.map(l=>l.id===s?r(l):l),threads:o}}function Lg(t,s){for(let r=t.length-1;r>=0;r--)if(t[r].external_item_id===s)return r;return-1}function _u(t,s){const r=Lg(t.items,s.external_item_id);if(r>=0){const o=[...t.items];return o[r]=s,{...t,items:o}}if(s.type==="agent_message"){const o=t.items.filter(l=>!(l.type==="agent_message"&&l.id.startsWith("delta-")));return{...t,items:[...o,s]}}return{...t,items:[...t.items,s]}}function ew(t,s,r){var u;const o=Lg(t.items,s);if(o>=0){const d=t.items[o],g=(((u=d.data)==null?void 0:u.text)??"")+r,m=[...t.items];return m[o]={...d,data:{...d.data,text:g}},{...t,items:m,agent_response:g}}const l={id:`delta-${s}`,turn_id:t.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...t,items:[...t.items,l],agent_response:r}}function tw(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return Wt(`/providers/${t}/models${r}`)}const Uh="curl -fsSL https://repoburg.com/install.sh | bash",nw=2e3,Og="agentpane:daemon-seen";function sw(t=mn()){if(!t)return!1;try{const s=new URL(t);return s.protocol==="http:"&&(s.hostname==="localhost"||s.hostname==="127.0.0.1")}catch{return!1}}async function rw(t=mn()){try{return await fetch(`${t}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function iw(){try{return localStorage.getItem(Og)==="true"}catch{return!1}}function ow(){try{localStorage.setItem(Og,"true")}catch{}}function aw(t){let s=!1,r=!1,o=!1,l=null;function u(){l!==null&&(clearTimeout(l),l=null)}async function d(){if(s||r)return;u(),r=!0;const m=await rw();if(r=!1,!s){if(m){ow(),g(),t.onReady();return}o||(o=!0,t.onMissing()),l=setTimeout(()=>void d(),nw)}}function p(){document.visibilityState==="visible"&&d()}function g(){s=!0,u(),window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",p)}return window.addEventListener("focus",p),document.addEventListener("visibilitychange",p),d(),g}const qu=160,Yu=480,lw=240,al=220,cw=300,uw=600,dw=36;function ll(){return typeof window>"u"?uw:Math.max(al,Math.round(window.innerWidth*.7))}const Bh="agentpane:sidebar-width",Wh="agentpane:right-panel-width",Ru="agentpane:right-panel-collapsed";function Hh(t,s,r,o){try{const l=localStorage.getItem(t);if(l==null)return o;const u=Number(l);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}function fw(t){try{return localStorage.getItem(t)==="true"}catch{return!1}}function Vh(t,s){try{localStorage.setItem(t,String(s))}catch{}}const Gh=200,pw=(t,s)=>({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:Hh(Bh,qu,Yu,lw),rightPanelWidth:Hh(Wh,al,ll(),cw),rightPanelCollapsed:fw(Ru),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,usageViewOpen:!1,canGoBack:!1,canGoForward:!1,daemonStatus:sw()?"checking":"ready",setActiveTurnIndex:r=>t({activeTurnIndex:r}),switchRightTab:r=>{s().rightPanelCollapsed&&Vh(Ru,!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(Yu,Math.max(qu,Math.round(r)));t({sidebarWidth:o});try{localStorage.setItem(Bh,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(ll(),Math.max(al,Math.round(r)));t({rightPanelWidth:o});try{localStorage.setItem(Wh,String(o))}catch{}},setRightPanelCollapsed:r=>{t({rightPanelCollapsed:r}),Vh(Ru,r)},toggleRightPanel:()=>s().setRightPanelCollapsed(!s().rightPanelCollapsed),toggleVscodeView:()=>{if(s().vscodeViewOpen){t({vscodeViewOpen:!1});return}t({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,l)=>t({vscodeState:r,vscodeId:o,vscodeToken:l}),toggleUsageView:()=>t({usageViewOpen:!s().usageViewOpen}),setDaemonStatus:r=>t({daemonStatus:r}),addToast:(r,o,l,u)=>{const d=Math.random().toString(36).slice(2,9);t(p=>({toasts:[...p.toasts,{id:d,type:r,message:o,undoAction:l,undoLabel:u}]}))},removeToast:r=>{t(o=>({toasts:o.toasts.filter(l=>l.id!==r)}))},addLogEntry:(r,o)=>{const l=new Date().toLocaleTimeString("en-GB",{hour12:!1});t(u=>{const d=[...u.eventLog,{time:l,level:r,message:o}];return d.length>Gh&&d.splice(0,d.length-Gh),{eventLog:d}})},loadModels:async(r,o)=>{if(!s().modelsLoading){t({modelsLoading:!0,models:[]});try{const l=await tw(r,o);t({models:l,modelsLoading:!1})}catch{t({modelsLoading:!1})}}}}),hw=(t,s)=>({createThread:async(r,o)=>{try{await ut(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(l){s().addToast("error",`Failed to create thread — ${l.message}`)}},followupThread:async(r,o,l)=>{try{await ut(`/sessions/${r}/threads/${o}/followup`,{message:l}),s().addLogEntry("INFO",`Thread follow-up — "${l.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await ut(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(l){s().addToast("error",`Failed to cancel thread turn — ${l.message}`)}},resolveThread:async(r,o)=>{try{await Ns(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(l){s().addToast("error",`Failed to resolve thread — ${l.message}`)}},reopenThread:async(r,o)=>{try{await Ns(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(l){s().addToast("error",`Failed to reopen thread — ${l.message}`)}},shareThread:async(r,o,l)=>{try{const u=await ut(`/sessions/${r}/threads/${o}/summarize`,{directives:l}),d=`
42
+ [Shared from a resolved discussion thread — summary of its findings]
43
+
44
+ \`\`\`QUOTE
45
+ ${u.summary}
46
+ \`\`\`
47
+
48
+ `;return t({quotedText:d}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await Rl(`/sessions/${r}/threads/${o}`)}catch(l){s().addToast("error",`Failed to delete thread — ${l.message}`)}},askSidecar:async(r,o)=>{try{return await ut(`/sessions/${r}/sidecar`,{message:o}),s().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(l){return s().addToast("error",`Failed to ask the sidecar — ${l.message}`),!1}},onThreadCreated:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:[...d.threads??[],{...o,turns:[{...l,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];return d?{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:(d.threads??[]).map(p=>p.id===o?{...p,turns:[...p.turns??[],{...l,items:[]}]}:p)}}}:{}})},onThreadResolved:(r,o,l)=>{t(u=>{const d=u.sessionDetails[r];if(!d)return{};const p=(d.threads??[]).map(g=>g.id===o?{...g,status:l,resolved_at:l==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[r]:{...d,threads:p}}}})},onThreadDeleted:(r,o)=>{t(l=>{const u=l.sessionDetails[r];return u?{sessionDetails:{...l.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(d=>d.id!==o)}}}:{}})}}),mw=(t,s)=>({folders:[],loadFolders:async()=>{const r=await jg();t({folders:r})},createSidebarFolder:async(r,o)=>{try{const l=await T0(r,o);return t(u=>({folders:[...u.folders,l]})),l}catch(l){return s().addToast("error",`Failed to create folder — ${l.message}`),null}},renameFolder:async(r,o)=>{try{const l=await Ah(r,{name:o});t(u=>({folders:u.folders.map(d=>d.id===r?l:d)}))}catch(l){s().addToast("error",`Failed to rename folder — ${l.message}`)}},deleteFolder:async r=>{const o=s().folders,l=s().sessions;t(u=>({folders:u.folders.filter(d=>d.id!==r),sessions:u.sessions.map(d=>d.folder_id===r?{...d,folder_id:null}:d)}));try{await N0(r)}catch(u){t({folders:o,sessions:l}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,l=new Map(r.map(u=>[u.id,u]));t(u=>({sessions:u.sessions.map(d=>{const p=l.get(d.id);return p?{...d,folder_id:p.folder_id,sort_order:p.sort_order}:d})}));try{await j0(r)}catch(u){t({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,l=new Map(r.map((u,d)=>[u,d]));t(u=>({folders:u.folders.map(d=>l.has(d.id)?{...d,sort_order:l.get(d.id)}:d)}));try{await Promise.all(r.map((u,d)=>Ah(u,{sort_order:d})))}catch(u){t({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function Kh(){return Wt("/apps")}function gw(){return Wt("/apps/root")}function qh(t){return Wt(`/apps/${t}/source`)}function Yh(t,s=""){return Wt(`/apps/${t}/state?workspace=${encodeURIComponent(s)}`)}function Pg(t,s,r=""){return c0(`/apps/${t}/state?workspace=${encodeURIComponent(r)}`,s)}function vw(t){return Rl(`/apps/${t}`)}function yw(t){return Wt(`/apps/${t}/sessions`)}function xw(){return Wt("/apps/examples")}function ww(t){return ut(`/apps/examples/${t}/install`,{})}function kw(t){return ut("/apps",t)}function Sw(t,s){return ut("/apps/import",{id:t,files:s})}function bw(t,s,r){return ut(`/apps/mcp/calls/${t}/result`,{result:s,error:null})}function Tw(t,s){return ut(`/apps/${t}/edit-session`,s)}function Nw(t,s){return ut(`/apps/${t}/files`,s)}async function jw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}/meta`);if(r.status===404)return null;if(!r.ok)throw new Error(`GET /apps/${t}/files/${s}/meta failed: ${r.status} ${r.statusText}`);return await r.json()}async function Cw(t,s){const r=await fetch(`${mn()}/api/apps/${t}/files/${encodeURIComponent(s)}`);if(!r.ok)throw new Error(`GET /apps/${t}/files/${s} failed: ${r.status} ${r.statusText}`);return r.blob()}const nl=new Set;async function Au(t,s){nl.add(s),await t().loadApps();const r=t().apps.find(o=>o.id===s);t().openAppTab(s),t().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const Xu="agentpane:app-workspaces";function Ew(){try{const t=JSON.parse(localStorage.getItem(Xu)??"{}");return t&&typeof t=="object"?t:{}}catch{return{}}}const _w=(t,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Ew(),loadApps:async()=>{try{const[r,o]=await Promise.all([Kh(),gw().catch(()=>null)]);return r.forEach(l=>nl.add(l.id)),t(o?{apps:r,appsRootPath:o.root}:{apps:r}),!0}catch{return!1}},refreshApps:async()=>{try{const r=await Kh();for(const o of r)nl.has(o.id)||(nl.add(o.id),s().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=>s().closeTabs([No(r)]),setActiveAppTab:r=>t({activeAppTabId:r}),openAppCatalog:()=>t({appCatalogOpen:!0}),closeAppCatalog:()=>t({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{t(l=>{const u={...l.appWorkspaces,[r]:o};try{localStorage.setItem(Xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await ww(r),await Au(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await kw(r),await Au(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await Sw(r,o),await Au(s,r),!0}catch(l){return s().addToast("error",`Failed to import app — ${l.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,l=await Tw(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});s().sessions.some(u=>u.id===l.id)||t(u=>({sessions:[l,...u.sessions]})),await s().selectSession(l.id),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(l=>l.id===r);if(o)try{await Pg(r,{pinned:!o.pinned}),await s().loadApps()}catch(l){s().addToast("error",`Failed to pin app — ${l.message}`)}},deleteApp:async r=>{try{await vw(r);const o=s().activeSessionId;t(u=>{const d={...u.appWorkspaces};delete d[r];try{localStorage.setItem(Xu,JSON.stringify(d))}catch{}return{apps:u.apps.filter(p=>p.id!==r),openAppTabs:u.openAppTabs.filter(p=>p!==r),...kd(u,new Set([No(r)])),appWorkspaces:d}});const l=s().activeSessionId;l&&l!==o&&s().selectSession(l,{keepAppView:!0}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),Rw=(t,s)=>({tabOrder:[],closedTabs:[],moveTab:(r,o)=>{const l=[...s().tabOrder],u=l.indexOf(r),d=l.indexOf(o);u===-1||d===-1||u===d||(l.splice(d,0,...l.splice(u,1)),t({tabOrder:l}))},closeTabs:r=>{const o=s(),l=new Set(r.filter(g=>o.tabOrder.includes(g)));if(l.size===0)return;const u=kd(o,l),d=o.tabOrder.map((g,m)=>({key:g,index:m})).filter(g=>l.has(g.key)).reverse();t({...u,openTabs:o.openTabs.filter(g=>!l.has(Pr(g))),openAppTabs:o.openAppTabs.filter(g=>!l.has(No(g))),tabOrder:o.tabOrder.filter(g=>!l.has(g)),closedTabs:[...o.closedTabs,...d].slice(-20)});const p=u.activeSessionId;p!==null&&p!==o.activeSessionId&&s().selectSession(p,{keepAppView:!0})},reopenClosedTab:()=>{const r=s(),o=[...r.closedTabs];let l=o.pop();for(;l&&!_g(r,l.key);)l=o.pop();if(!l){t({closedTabs:[]});return}const u=[...r.tabOrder];u.splice(l.index,0,l.key);const{kind:d,id:p}=fr(l.key);d==="app"?(t({closedTabs:o,tabOrder:u,openAppTabs:[...r.openAppTabs,p]}),s().openAppTab(p)):(t({closedTabs:o,tabOrder:u,openTabs:[...r.openTabs,p]}),s().selectSession(p))}}),Xh=3e3,Hn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Vn=[];let cl=0,Td=0,ul=0,Nd=0,dl=0,jd=0,Cd=0;const jo=new Map,Co=new Map;let wi=new Map,vi=0,ki=new Map,Iu=!1;function fl(t,s,r){if(Vn.push({t:Date.now(),cat:t,msg:s,ms:r}),Vn.length>Xh){const o=Vn.length-Xh;Vn.splice(0,o),In=Math.max(0,In-o)}}function yi(t,s,r){fl(t,s,r),console.log(`[perf:${t}] ${s}`)}function $g(t){yi("note",t)}function zg(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function Aw(t,s){let r=wi.get(t);r||wi.set(t,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=jo.get(t);o||jo.set(t,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Iw(){vi++,Cd++}function Mw(t){ki.set(t,(ki.get(t)??0)+1),Co.set(t,(Co.get(t)??0)+1)}let sl=0;function Dw(){sl=performance.now()}function Lw(){const t=performance.now(),s=sl?t-sl:null;sl=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-t+s;r>Hn.keypressMs&&yi("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-t)}ms)`)})}const Ow=5e3,Fg=500,Qh=2e3;let In=0,Mu=!1;function Pw(t){return ut("/perf-log",{entries:t}).then(()=>{In+=t.length})}function $w(){if(Mu||In>=Vn.length)return;const t=Vn.slice(In,In+Fg);t.length!==0&&(Mu=!0,Pw(t).catch(()=>{Vn.length-In>Qh&&(In=Math.max(In,Vn.length-Qh))}).finally(()=>{Mu=!1}))}function Zh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||In>=Vn.length)return;const t=Vn.slice(In,In+Fg);if(t.length!==0)try{const s=new Blob([JSON.stringify({entries:t})],{type:"application/json"});navigator.sendBeacon(`${mn()}/api/perf-log`,s),In+=t.length}catch{}}function zw(){let t=0;for(const o of wi.values())t+=o.n;const s=[];if(t>0){const o=[...wi.entries()].sort((l,u)=>u[1].n-l[1].n).map(([l,u])=>`${l}×${u.n}(${zg(u.bytes)})`).join(", ");s.push(`ws ${t}/s [${o}]`)}vi>0&&s.push(`store ${vi}/s`);const r=[...ki.entries()].sort((o,l)=>l[1]-o[1]).map(([o,l])=>`${o}×${l}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");fl("stat",o);const l=[...ki.values()].some(u=>u>Hn.renderPerSecLog);(t>Hn.wsPerSecLog||vi>Hn.storePerSecLog||l)&&console.log(`[perf:stat] ${o}`)}wi=new Map,vi=0,ki=new Map}function Fw(t){if(t instanceof Element){const s=t.id?`#${t.id}`:"",r=typeof t.className=="string"&&t.className?`.${t.className.trim().split(/\s+/)[0]}`:"";return`${t.tagName.toLowerCase()}${s}${r}`}return t?"window":"unknown"}function Uw(){if(Iu||typeof window>"u")return()=>{};Iu=!0,cl=Date.now();const t=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),d=u-s;s=u+250,d>Hn.lagMs&&(Td++,ul=Math.max(ul,d),yi("lag",`event loop blocked ${Math.round(d)}ms`))},250);if(t.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),d=0;const p=g=>{const m=g-u;u=g,m>Hn.frameGapMs&&yi("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 u=new PerformanceObserver(d=>{var p;for(const g of d.getEntries()){const m=g.duration;if(m<Hn.longtaskBufferMs)continue;Nd++,dl=Math.max(dl,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>=Hn.longtaskLogMs?yi("longtask",y,m):fl("longtask",y,m)}});u.observe({type:"longtask",buffered:!1}),t.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(d=>{for(const p of d.getEntries()){const g=p.duration,m=p.processingStart-p.startTime;jd++;const v=`${p.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${Fw(p.target)}`;g>=Hn.eventLogMs?yi("input",v,g):fl("input",v,g)}});u.observe({type:"event",durationThreshold:Hn.eventBufferMs}),t.push(()=>u.disconnect())}catch{}}const o=window.setInterval(zw,1e3);t.push(()=>window.clearInterval(o)),$g("perf logger session started");const l=window.setInterval($w,Ow);return t.push(()=>window.clearInterval(l)),window.addEventListener("beforeunload",Zh),t.push(()=>window.removeEventListener("beforeunload",Zh)),window.__agentPanePerf={dump:Ug,reset:Bg},()=>{t.forEach(u=>u()),Iu=!1}}function Ug(){const t=[],s=cl?Math.round((Date.now()-cl)/1e3):0;if(t.push("=== agent-pane perf report ==="),t.push(`uptime ${s}s · ${Vn.length} buffered entries`),t.push(`event-loop lag: ${Td} blocks >${Hn.lagMs}ms (max ${Math.round(ul)}ms)`),t.push(`long tasks: ${Nd} ≥${Hn.longtaskBufferMs}ms (max ${Math.round(dl)}ms)`),t.push(`slow input events (≥${Hn.eventBufferMs}ms): ${jd}`),t.push(`store updates: ${Cd} total`),jo.size>0){t.push("ws messages by type (top 15):");for(const[r,o]of[...jo.entries()].sort((l,u)=>u[1].n-l[1].n).slice(0,15))t.push(` ${r}: ${o.n} msgs, ${zg(o.bytes)}`)}if(Co.size>0){t.push("render counts by component:");for(const[r,o]of[...Co.entries()].sort((l,u)=>u[1]-l[1]))t.push(` ${r}: ${o}`)}t.push("--- last 200 entries ---");for(const r of Vn.slice(-200))t.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return t.join(`
49
+ `)}function Bg(){Vn.length=0,In=0,cl=Date.now(),Td=0,ul=0,Nd=0,dl=0,jd=0,Cd=0,jo.clear(),Co.clear(),wi=new Map,vi=0,ki=new Map}const Mt={start:Uw,note:$g,trackWsEvent:Aw,trackStoreUpdate:Iw,trackRender:Mw,markKeystroke:Dw,markInputChange:Lw,dump:Ug,reset:Bg},M=e0()((...t)=>({...z0(...t),...U0(...t),...Z0(...t),...pw(...t),...hw(...t),...mw(...t),..._w(...t),...Rw(...t)}));typeof window<"u"&&(M.subscribe(()=>Mt.trackStoreUpdate()),E0(M),I0(M));function Qu(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 Bw(t,s,r=!1,o="working",l=0){if(o==="finished")return"";if(t==="interrupted")return"interrupted";if(s)return"running";if(l>0)return"background";if(r&&t!=="failed")return"queued";switch(t){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Ww(t,s,r=!1,o="working",l=0){if(o==="finished")return"Finished";if(t==="interrupted")return"Interrupted";if(s)return"Running";if(l>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 Dl(t,s=0){const r=t.is_running===1,o=t.lifecycle==="finished",l=Qu(t.runtime_type),u=Bw(t.status,r,t.has_unreviewed===1,t.lifecycle,s),d=Ww(t.status,r,t.has_unreviewed===1,t.lifecycle,s);return{dot:u,label:d,dotTitle:u==="background"?`${s} background task${s===1?"":"s"} running`:d,iconClass:l.iconClass,iconText:l.iconText,isRunning:r,isFinished:o,backgroundTaskCount:s}}function Mo(t,s,r=!0){x.useEffect(()=>{if(!r)return;function o(l){t.current&&!t.current.contains(l.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[t,s,r])}function Ni(t,s=!0){x.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&t()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[t,s])}function Ed({status:t,size:s=6,title:r}){return a.jsx("span",{className:`status-dot ${t}`,style:s!==6?{width:s,height:s}:void 0,title:r})}function _d({iconClass:t,iconText:s,size:r=20}){return a.jsx("span",{className:`runtime-icon ${t}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
50
+ * @license lucide-react v0.469.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const Hw=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wg=(...t)=>t.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
55
+ * @license lucide-react v0.469.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */var Vw={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"};/**
60
+ * @license lucide-react v0.469.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const Hg=x.forwardRef(({color:t="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:d,...p},g)=>x.createElement("svg",{ref:g,...Vw,width:s,height:s,stroke:t,strokeWidth:o?Number(r)*24/Number(s):r,className:Wg("lucide",l),...p},[...d.map(([m,v])=>x.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
65
+ * @license lucide-react v0.469.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const me=(t,s)=>{const r=x.forwardRef(({className:o,...l},u)=>x.createElement(Hg,{ref:u,iconNode:s,className:Wg(`lucide-${Hw(t)}`,o),...l}));return r.displayName=`${t}`,r};/**
70
+ * @license lucide-react v0.469.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const Gw=me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
75
+ * @license lucide-react v0.469.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const Kw=me("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
80
+ * @license lucide-react v0.469.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const Vg=me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
85
+ * @license lucide-react v0.469.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const qw=me("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"}]]);/**
90
+ * @license lucide-react v0.469.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const mr=me("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"}]]);/**
95
+ * @license lucide-react v0.469.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const Yw=me("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"}]]);/**
100
+ * @license lucide-react v0.469.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const Ts=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
105
+ * @license lucide-react v0.469.0 - ISC
106
+ *
107
+ * This source code is licensed under the ISC license.
108
+ * See the LICENSE file in the root directory of this source tree.
109
+ */const Si=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
110
+ * @license lucide-react v0.469.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const Eo=me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
115
+ * @license lucide-react v0.469.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */const Ll=me("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"}]]);/**
120
+ * @license lucide-react v0.469.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const Xw=me("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
125
+ * @license lucide-react v0.469.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const pl=me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
130
+ * @license lucide-react v0.469.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const Qw=me("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"}]]);/**
135
+ * @license lucide-react v0.469.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const Zw=me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
140
+ * @license lucide-react v0.469.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const Jw=me("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"}]]);/**
145
+ * @license lucide-react v0.469.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const Gg=me("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"}]]);/**
150
+ * @license lucide-react v0.469.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const Jh=me("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"}]]);/**
155
+ * @license lucide-react v0.469.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const hl=me("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"}]]);/**
160
+ * @license lucide-react v0.469.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const ek=me("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
165
+ * @license lucide-react v0.469.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const tk=me("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"}]]);/**
170
+ * @license lucide-react v0.469.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const nk=me("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"}]]);/**
175
+ * @license lucide-react v0.469.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const Kg=me("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"}]]);/**
180
+ * @license lucide-react v0.469.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const sk=me("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"}]]);/**
185
+ * @license lucide-react v0.469.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const rk=me("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"}]]);/**
190
+ * @license lucide-react v0.469.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const Du=me("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"}]]);/**
195
+ * @license lucide-react v0.469.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const ml=me("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"}]]);/**
200
+ * @license lucide-react v0.469.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const qg=me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
205
+ * @license lucide-react v0.469.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const Yg=me("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"}]]);/**
210
+ * @license lucide-react v0.469.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const Xg=me("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"}]]);/**
215
+ * @license lucide-react v0.469.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const ik=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
220
+ * @license lucide-react v0.469.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const ok=me("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"}]]);/**
225
+ * @license lucide-react v0.469.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const Qg=me("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"}]]);/**
230
+ * @license lucide-react v0.469.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const ak=me("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"}]]);/**
235
+ * @license lucide-react v0.469.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const lk=me("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"}]]);/**
240
+ * @license lucide-react v0.469.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const ck=me("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"}]]);/**
245
+ * @license lucide-react v0.469.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const uk=me("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"}]]);/**
250
+ * @license lucide-react v0.469.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const hn=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
255
+ * @license lucide-react v0.469.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const dk=me("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"}]]);/**
260
+ * @license lucide-react v0.469.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const fk=me("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"}]]);/**
265
+ * @license lucide-react v0.469.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const Zg=me("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"}]]);/**
270
+ * @license lucide-react v0.469.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const pk=me("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"}]]);/**
275
+ * @license lucide-react v0.469.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const em=me("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"}]]);/**
280
+ * @license lucide-react v0.469.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const hk=me("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
285
+ * @license lucide-react v0.469.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const mk=me("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"}]]);/**
290
+ * @license lucide-react v0.469.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const gk=me("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"}]]);/**
295
+ * @license lucide-react v0.469.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const vk=me("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
300
+ * @license lucide-react v0.469.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const yk=me("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"}]]);/**
305
+ * @license lucide-react v0.469.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const rl=me("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"}]]);/**
310
+ * @license lucide-react v0.469.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const xk=me("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"}]]);/**
315
+ * @license lucide-react v0.469.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const wk=me("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"}]]);/**
320
+ * @license lucide-react v0.469.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const dr=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
325
+ * @license lucide-react v0.469.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const Jg=me("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"}]]);/**
330
+ * @license lucide-react v0.469.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const kk=me("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"}]]);/**
335
+ * @license lucide-react v0.469.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const Sk=me("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"}]]);/**
340
+ * @license lucide-react v0.469.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const _o=me("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"}]]);/**
345
+ * @license lucide-react v0.469.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const ev=me("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"}]]);/**
350
+ * @license lucide-react v0.469.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const tv=me("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"}]]);/**
355
+ * @license lucide-react v0.469.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const bk=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
360
+ * @license lucide-react v0.469.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const Do=me("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"}]]);/**
365
+ * @license lucide-react v0.469.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const Tk=me("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"}]]);/**
370
+ * @license lucide-react v0.469.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const zr=me("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
375
+ * @license lucide-react v0.469.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const gl=me("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"}]]);/**
380
+ * @license lucide-react v0.469.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const nv=me("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
385
+ * @license lucide-react v0.469.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const us=me("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"}]]);/**
390
+ * @license lucide-react v0.469.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const sv=me("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"}]]);/**
395
+ * @license lucide-react v0.469.0 - ISC
396
+ *
397
+ * This source code is licensed under the ISC license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */const Nk=me("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"}]]);/**
400
+ * @license lucide-react v0.469.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */const jk=me("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"}]]);/**
405
+ * @license lucide-react v0.469.0 - ISC
406
+ *
407
+ * This source code is licensed under the ISC license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */const Ck=me("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"}]]);/**
410
+ * @license lucide-react v0.469.0 - ISC
411
+ *
412
+ * This source code is licensed under the ISC license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */const rv=me("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"}]]);/**
415
+ * @license lucide-react v0.469.0 - ISC
416
+ *
417
+ * This source code is licensed under the ISC license.
418
+ * See the LICENSE file in the root directory of this source tree.
419
+ */const Ek=me("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"}]]);/**
420
+ * @license lucide-react v0.469.0 - ISC
421
+ *
422
+ * This source code is licensed under the ISC license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */const Tn=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
425
+ * @license lucide-react v0.469.0 - ISC
426
+ *
427
+ * This source code is licensed under the ISC license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */const _k=me("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"}]]),Rk=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),Ak=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function Ik(t){return t.filter(([s])=>Rk.has(s)).map(([s,r],o)=>[s,{...Object.fromEntries(Object.entries(r).filter(([l])=>Ak.has(l))),key:String(o)}])}function ji({iconNode:t,size:s=14,className:r}){const o=x.useMemo(()=>t?Ik(t):[],[t]);return o.length===0?a.jsx(Qg,{size:s,className:r,"aria-hidden":"true","data-testid":"app-icon-default"}):a.jsx(Hg,{iconNode:o,size:s,className:r,"aria-hidden":"true","data-testid":"app-icon"})}var go=gg();function Mk(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>o=>{s.forEach(l=>l(o))},s)}const Ol=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ci(t){const s=Object.prototype.toString.call(t);return s==="[object Window]"||s==="[object global]"}function Rd(t){return"nodeType"in t}function Nn(t){var s,r;return t?Ci(t)?t:Rd(t)&&(s=(r=t.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ad(t){const{Document:s}=Nn(t);return t instanceof s}function Lo(t){return Ci(t)?!1:t instanceof Nn(t).HTMLElement}function iv(t){return t instanceof Nn(t).SVGElement}function Ei(t){return t?Ci(t)?t.document:Rd(t)?Ad(t)?t:Lo(t)||iv(t)?t.ownerDocument:document:document:document}const ds=Ol?x.useLayoutEffect:x.useEffect;function Pl(t){const s=x.useRef(t);return ds(()=>{s.current=t}),x.useCallback(function(){for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return s.current==null?void 0:s.current(...o)},[])}function Dk(){const t=x.useRef(null),s=x.useCallback((o,l)=>{t.current=setInterval(o,l)},[]),r=x.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[s,r]}function Ro(t,s){s===void 0&&(s=[t]);const r=x.useRef(t);return ds(()=>{r.current!==t&&(r.current=t)},s),r}function Oo(t,s){const r=x.useRef();return x.useMemo(()=>{const o=t(r.current);return r.current=o,o},[...s])}function vl(t){const s=Pl(t),r=x.useRef(null),o=x.useCallback(l=>{l!==r.current&&(s==null||s(l,r.current)),r.current=l},[]);return[r,o]}function yl(t){const s=x.useRef();return x.useEffect(()=>{s.current=t},[t]),s.current}let Lu={};function Po(t,s){return x.useMemo(()=>{if(s)return s;const r=Lu[t]==null?0:Lu[t]+1;return Lu[t]=r,t+"-"+r},[t,s])}function ov(t){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return o.reduce((u,d)=>{const p=Object.entries(d);for(const[g,m]of p){const v=u[g];v!=null&&(u[g]=v+t*m)}return u},{...s})}}const bi=ov(1),xl=ov(-1);function Lk(t){return"clientX"in t&&"clientY"in t}function $l(t){if(!t)return!1;const{KeyboardEvent:s}=Nn(t.target);return s&&t instanceof s}function Ok(t){if(!t)return!1;const{TouchEvent:s}=Nn(t.target);return s&&t instanceof s}function wl(t){if(Ok(t)){if(t.touches&&t.touches.length){const{clientX:s,clientY:r}=t.touches[0];return{x:s,y:r}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:s,clientY:r}=t.changedTouches[0];return{x:s,y:r}}}return Lk(t)?{x:t.clientX,y:t.clientY}:null}const js=Object.freeze({Translate:{toString(t){if(!t)return;const{x:s,y:r}=t;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:s,scaleY:r}=t;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(t){if(t)return[js.Translate.toString(t),js.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:s,duration:r,easing:o}=t;return s+" "+r+"ms "+o}}}),tm="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Pk(t){return t.matches(tm)?t:t.querySelector(tm)}const $k={display:"none"};function zk(t){let{id:s,value:r}=t;return ot.createElement("div",{id:s,style:$k},r)}function Fk(t){let{id:s,announcement:r,ariaLiveType:o="assertive"}=t;const l={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 ot.createElement("div",{id:s,style:l,role:"status","aria-live":o,"aria-atomic":!0},r)}function Uk(){const[t,s]=x.useState("");return{announce:x.useCallback(o=>{o!=null&&s(o)},[]),announcement:t}}const av=x.createContext(null);function Bk(t){const s=x.useContext(av);x.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(t)},[t,s])}function Wk(){const[t]=x.useState(()=>new Set),s=x.useCallback(o=>(t.add(o),()=>t.delete(o)),[t]);return[x.useCallback(o=>{let{type:l,event:u}=o;t.forEach(d=>{var p;return(p=d[l])==null?void 0:p.call(d,u)})},[t]),s]}const Hk={draggable:`
430
+ To pick up a draggable item, press the space bar.
431
+ While dragging, use the arrow keys to move the item.
432
+ Press space again to drop the item in its new position, or press escape to cancel.
433
+ `},Vk={onDragStart(t){let{active:s}=t;return"Picked up draggable item "+s.id+"."},onDragOver(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(t){let{active:s,over:r}=t;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(t){let{active:s}=t;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function Gk(t){let{announcements:s=Vk,container:r,hiddenTextDescribedById:o,screenReaderInstructions:l=Hk}=t;const{announce:u,announcement:d}=Uk(),p=Po("DndLiveRegion"),[g,m]=x.useState(!1);if(x.useEffect(()=>{m(!0)},[]),Bk(x.useMemo(()=>({onDragStart(k){let{active:y}=k;u(s.onDragStart({active:y}))},onDragMove(k){let{active:y,over:S}=k;s.onDragMove&&u(s.onDragMove({active:y,over:S}))},onDragOver(k){let{active:y,over:S}=k;u(s.onDragOver({active:y,over:S}))},onDragEnd(k){let{active:y,over:S}=k;u(s.onDragEnd({active:y,over:S}))},onDragCancel(k){let{active:y,over:S}=k;u(s.onDragCancel({active:y,over:S}))}}),[u,s])),!g)return null;const v=ot.createElement(ot.Fragment,null,ot.createElement(zk,{id:o,value:l.draggable}),ot.createElement(Fk,{id:p,announcement:d}));return r?go.createPortal(v,r):v}var Bt;(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"})(Bt||(Bt={}));function kl(){}function lv(t,s){return x.useMemo(()=>({sensor:t,options:s??{}}),[t,s])}function cv(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return x.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const fs=Object.freeze({x:0,y:0});function Kk(t,s){return Math.sqrt(Math.pow(t.x-s.x,2)+Math.pow(t.y-s.y,2))}function qk(t,s){const r=wl(t);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function Yk(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return r-o}function Xk(t,s){let{data:{value:r}}=t,{data:{value:o}}=s;return o-r}function Qk(t,s){if(!t||t.length===0)return null;const[r]=t;return r[s]}function nm(t,s,r){return s===void 0&&(s=t.left),r===void 0&&(r=t.top),{x:s+t.width*.5,y:r+t.height*.5}}const uv=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=nm(s,s.left,s.top),u=[];for(const d of o){const{id:p}=d,g=r.get(p);if(g){const m=Kk(nm(g),l);u.push({id:p,data:{droppableContainer:d,value:m}})}}return u.sort(Yk)};function Zk(t,s){const r=Math.max(s.top,t.top),o=Math.max(s.left,t.left),l=Math.min(s.left+s.width,t.left+t.width),u=Math.min(s.top+s.height,t.top+t.height),d=l-o,p=u-r;if(o<l&&r<u){const g=s.width*s.height,m=t.width*t.height,v=d*p,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const Jk=t=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=t;const l=[];for(const u of o){const{id:d}=u,p=r.get(d);if(p){const g=Zk(p,s);g>0&&l.push({id:d,data:{droppableContainer:u,value:g}})}}return l.sort(Xk)};function e1(t,s,r){return{...t,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function dv(t,s){return t&&s?{x:t.left-s.left,y:t.top-s.top}:fs}function t1(t){return function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];return l.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 n1=t1(1);function fv(t){if(t.startsWith("matrix3d(")){const s=t.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(t.startsWith("matrix(")){const s=t.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function s1(t,s,r){const o=fv(s);if(!o)return t;const{scaleX:l,scaleY:u,x:d,y:p}=o,g=t.left-d-(1-l)*parseFloat(r),m=t.top-p-(1-u)*parseFloat(r.slice(r.indexOf(" ")+1)),v=l?t.width/l:t.width,k=u?t.height/u:t.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const r1={ignoreTransform:!1};function _i(t,s){s===void 0&&(s=r1);let r=t.getBoundingClientRect();if(s.ignoreTransform){const{transform:m,transformOrigin:v}=Nn(t).getComputedStyle(t);m&&(r=s1(r,m,v))}const{top:o,left:l,width:u,height:d,bottom:p,right:g}=r;return{top:o,left:l,width:u,height:d,bottom:p,right:g}}function sm(t){return _i(t,{ignoreTransform:!0})}function i1(t){const s=t.innerWidth,r=t.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function o1(t,s){return s===void 0&&(s=Nn(t).getComputedStyle(t)),s.position==="fixed"}function a1(t,s){s===void 0&&(s=Nn(t).getComputedStyle(t));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(l=>{const u=s[l];return typeof u=="string"?r.test(u):!1})}function Id(t,s){const r=[];function o(l){if(s!=null&&r.length>=s||!l)return r;if(Ad(l)&&l.scrollingElement!=null&&!r.includes(l.scrollingElement))return r.push(l.scrollingElement),r;if(!Lo(l)||iv(l)||r.includes(l))return r;const u=Nn(t).getComputedStyle(l);return l!==t&&a1(l,u)&&r.push(l),o1(l,u)?r:o(l.parentNode)}return t?o(t):r}function pv(t){const[s]=Id(t,1);return s??null}function Ou(t){return!Ol||!t?null:Ci(t)?t:Rd(t)?Ad(t)||t===Ei(t).scrollingElement?window:Lo(t)?t:null:null}function hv(t){return Ci(t)?t.scrollX:t.scrollLeft}function mv(t){return Ci(t)?t.scrollY:t.scrollTop}function Zu(t){return{x:hv(t),y:mv(t)}}var Jt;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Jt||(Jt={}));function gv(t){return!Ol||!t?!1:t===document.scrollingElement}function vv(t){const s={x:0,y:0},r=gv(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},o={x:t.scrollWidth-r.width,y:t.scrollHeight-r.height},l=t.scrollTop<=s.y,u=t.scrollLeft<=s.x,d=t.scrollTop>=o.y,p=t.scrollLeft>=o.x;return{isTop:l,isLeft:u,isBottom:d,isRight:p,maxScroll:o,minScroll:s}}const l1={x:.2,y:.2};function c1(t,s,r,o,l){let{top:u,left:d,right:p,bottom:g}=r;o===void 0&&(o=10),l===void 0&&(l=l1);const{isTop:m,isBottom:v,isLeft:k,isRight:y}=vv(t),S={x:0,y:0},N={x:0,y:0},E={height:s.height*l.y,width:s.width*l.x};return!m&&u<=s.top+E.height?(S.y=Jt.Backward,N.y=o*Math.abs((s.top+E.height-u)/E.height)):!v&&g>=s.bottom-E.height&&(S.y=Jt.Forward,N.y=o*Math.abs((s.bottom-E.height-g)/E.height)),!y&&p>=s.right-E.width?(S.x=Jt.Forward,N.x=o*Math.abs((s.right-E.width-p)/E.width)):!k&&d<=s.left+E.width&&(S.x=Jt.Backward,N.x=o*Math.abs((s.left+E.width-d)/E.width)),{direction:S,speed:N}}function u1(t){if(t===document.scrollingElement){const{innerWidth:u,innerHeight:d}=window;return{top:0,left:0,right:u,bottom:d,width:u,height:d}}const{top:s,left:r,right:o,bottom:l}=t.getBoundingClientRect();return{top:s,left:r,right:o,bottom:l,width:t.clientWidth,height:t.clientHeight}}function yv(t){return t.reduce((s,r)=>bi(s,Zu(r)),fs)}function d1(t){return t.reduce((s,r)=>s+hv(r),0)}function f1(t){return t.reduce((s,r)=>s+mv(r),0)}function xv(t,s){if(s===void 0&&(s=_i),!t)return;const{top:r,left:o,bottom:l,right:u}=s(t);pv(t)&&(l<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const p1=[["x",["left","right"],d1],["y",["top","bottom"],f1]];class Md{constructor(s,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=Id(r),l=yv(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,d,p]of p1)for(const g of d)Object.defineProperty(this,g,{get:()=>{const m=p(o),v=l[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class wo{constructor(s){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=s}add(s,r,o){var l;(l=this.target)==null||l.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function h1(t){const{EventTarget:s}=Nn(t);return t instanceof s?t:Ei(t)}function Pu(t,s){const r=Math.abs(t.x),o=Math.abs(t.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.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 rm(t){t.preventDefault()}function m1(t){t.stopPropagation()}var et;(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"})(et||(et={}));const wv={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},g1=(t,s)=>{let{currentCoordinates:r}=s;switch(t.code){case et.Right:return{...r,x:r.x+25};case et.Left:return{...r,x:r.x-25};case et.Down:return{...r,y:r.y+25};case et.Up:return{...r,y:r.y-25}}};class kv{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new wo(Ei(r)),this.windowListeners=new wo(Nn(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:s,onStart:r}=this.props,o=s.node.current;o&&xv(o),r(fs)}handleKeyDown(s){if($l(s)){const{active:r,context:o,options:l}=this.props,{keyboardCodes:u=wv,coordinateGetter:d=g1,scrollBehavior:p="smooth"}=l,{code:g}=s;if(u.end.includes(g)){this.handleEnd(s);return}if(u.cancel.includes(g)){this.handleCancel(s);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:fs;this.referenceCoordinates||(this.referenceCoordinates=v);const k=d(s,{active:r,context:o.current,currentCoordinates:v});if(k){const y=xl(k,v),S={x:0,y:0},{scrollableAncestors:N}=o.current;for(const E of N){const T=s.code,{isTop:I,isRight:R,isLeft:U,isBottom:A,maxScroll:L,minScroll:q}=vv(E),K=u1(E),$={x:Math.min(T===et.Right?K.right-K.width/2:K.right,Math.max(T===et.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===et.Down?K.bottom-K.height/2:K.bottom,Math.max(T===et.Down?K.top:K.top+K.height/2,k.y))},ne=T===et.Right&&!R||T===et.Left&&!U,pe=T===et.Down&&!A||T===et.Up&&!I;if(ne&&$.x!==k.x){const G=E.scrollLeft+y.x,ve=T===et.Right&&G<=L.x||T===et.Left&&G>=q.x;if(ve&&!y.y){E.scrollTo({left:G,behavior:p});return}ve?S.x=E.scrollLeft-G:S.x=T===et.Right?E.scrollLeft-L.x:E.scrollLeft-q.x,S.x&&E.scrollBy({left:-S.x,behavior:p});break}else if(pe&&$.y!==k.y){const G=E.scrollTop+y.y,ve=T===et.Down&&G<=L.y||T===et.Up&&G>=q.y;if(ve&&!y.x){E.scrollTo({top:G,behavior:p});return}ve?S.y=E.scrollTop-G:S.y=T===et.Down?E.scrollTop-L.y:E.scrollTop-q.y,S.y&&E.scrollBy({top:-S.y,behavior:p});break}}this.handleMove(s,bi(xl(k,this.referenceCoordinates),S))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}kv.activators=[{eventName:"onKeyDown",handler:(t,s,r)=>{let{keyboardCodes:o=wv,onActivation:l}=s,{active:u}=r;const{code:d}=t.nativeEvent;if(o.start.includes(d)){const p=u.activatorNode.current;return p&&t.target!==p?!1:(t.preventDefault(),l==null||l({event:t.nativeEvent}),!0)}return!1}}];function im(t){return!!(t&&"distance"in t)}function om(t){return!!(t&&"delay"in t)}class Dd{constructor(s,r,o){var l;o===void 0&&(o=h1(s.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=s,this.events=r;const{event:u}=s,{target:d}=u;this.props=s,this.events=r,this.document=Ei(d),this.documentListeners=new wo(this.document),this.listeners=new wo(o),this.windowListeners=new wo(Nn(d)),this.initialCoordinates=(l=wl(u))!=null?l:fs,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:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(es.Resize,this.handleCancel),this.windowListeners.add(es.DragStart,rm),this.windowListeners.add(es.VisibilityChange,this.handleCancel),this.windowListeners.add(es.ContextMenu,rm),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(om(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(im(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(s,r){const{active:o,onPending:l}=this.props;l(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(es.Click,m1,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(es.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:l,props:u}=this,{onMove:d,options:{activationConstraint:p}}=u;if(!l)return;const g=(r=wl(s))!=null?r:fs,m=xl(l,g);if(!o&&p){if(im(p)){if(p.tolerance!=null&&Pu(m,p.tolerance))return this.handleCancel();if(Pu(m,p.distance))return this.handleStart()}if(om(p)&&Pu(m,p.tolerance))return this.handleCancel();this.handlePending(p,m);return}s.cancelable&&s.preventDefault(),d(g)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===et.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const v1={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zl extends Dd{constructor(s){const{event:r}=s,o=Ei(r.target);super(s,v1,o)}}zl.activators=[{eventName:"onPointerDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const y1={move:{name:"mousemove"},end:{name:"mouseup"}};var Ju;(function(t){t[t.RightClick=2]="RightClick"})(Ju||(Ju={}));class x1 extends Dd{constructor(s){super(s,y1,Ei(s.event.target))}}x1.activators=[{eventName:"onMouseDown",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;return r.button===Ju.RightClick?!1:(o==null||o({event:r}),!0)}}];const $u={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class w1 extends Dd{constructor(s){super(s,$u)}static setup(){return window.addEventListener($u.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener($u.move.name,s)};function s(){}}}w1.activators=[{eventName:"onTouchStart",handler:(t,s)=>{let{nativeEvent:r}=t,{onActivation:o}=s;const{touches:l}=r;return l.length>1?!1:(o==null||o({event:r}),!0)}}];var ko;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ko||(ko={}));var Sl;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Sl||(Sl={}));function k1(t){let{acceleration:s,activator:r=ko.Pointer,canScroll:o,draggingRect:l,enabled:u,interval:d=5,order:p=Sl.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:y}=t;const S=b1({delta:k,disabled:!u}),[N,E]=Dk(),T=x.useRef({x:0,y:0}),I=x.useRef({x:0,y:0}),R=x.useMemo(()=>{switch(r){case ko.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ko.DraggableRect:return l}},[r,l,g]),U=x.useRef(null),A=x.useCallback(()=>{const q=U.current;if(!q)return;const K=T.current.x*I.current.x,$=T.current.y*I.current.y;q.scrollBy(K,$)},[]),L=x.useMemo(()=>p===Sl.TreeOrder?[...m].reverse():m,[p,m]);x.useEffect(()=>{if(!u||!m.length||!R){E();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:ne,speed:pe}=c1(q,$,R,s,y);for(const G of["x","y"])S[G][ne[G]]||(pe[G]=0,ne[G]=0);if(pe.x>0||pe.y>0){E(),U.current=q,N(A,d),T.current=pe,I.current=ne;return}}T.current={x:0,y:0},I.current={x:0,y:0},E()},[s,A,o,E,u,d,JSON.stringify(R),JSON.stringify(S),N,m,L,v,JSON.stringify(y)])}const S1={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function b1(t){let{delta:s,disabled:r}=t;const o=yl(s);return Oo(l=>{if(r||!o||!l)return S1;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.y-o.y)};return{x:{[Jt.Backward]:l.x[Jt.Backward]||u.x===-1,[Jt.Forward]:l.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:l.y[Jt.Backward]||u.y===-1,[Jt.Forward]:l.y[Jt.Forward]||u.y===1}}},[r,s,o])}function T1(t,s){const r=s!=null?t.get(s):void 0,o=r?r.node.current:null;return Oo(l=>{var u;return s==null?null:(u=o??l)!=null?u:null},[o,s])}function N1(t,s){return x.useMemo(()=>t.reduce((r,o)=>{const{sensor:l}=o,u=l.activators.map(d=>({eventName:d.eventName,handler:s(d.handler,o)}));return[...r,...u]},[]),[t,s])}var Ao;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Ao||(Ao={}));var ed;(function(t){t.Optimized="optimized"})(ed||(ed={}));const am=new Map;function j1(t,s){let{dragging:r,dependencies:o,config:l}=s;const[u,d]=x.useState(null),{frequency:p,measure:g,strategy:m}=l,v=x.useRef(t),k=T(),y=Ro(k),S=x.useCallback(function(I){I===void 0&&(I=[]),!y.current&&d(R=>R===null?I:R.concat(I.filter(U=>!R.includes(U))))},[y]),N=x.useRef(null),E=Oo(I=>{if(k&&!r)return am;if(!I||I===am||v.current!==t||u!=null){const R=new Map;for(let U of t){if(!U)continue;if(u&&u.length>0&&!u.includes(U.id)&&U.rect.current){R.set(U.id,U.rect.current);continue}const A=U.node.current,L=A?new Md(g(A),A):null;U.rect.current=L,L&&R.set(U.id,L)}return R}return I},[t,u,r,k,g]);return x.useEffect(()=>{v.current=t},[t]),x.useEffect(()=>{k||S()},[r,k]),x.useEffect(()=>{u&&u.length>0&&d(null)},[JSON.stringify(u)]),x.useEffect(()=>{k||typeof p!="number"||N.current!==null||(N.current=setTimeout(()=>{S(),N.current=null},p))},[p,k,S,...o]),{droppableRects:E,measureDroppableContainers:S,measuringScheduled:u!=null};function T(){switch(m){case Ao.Always:return!1;case Ao.BeforeDragging:return r;default:return!r}}}function Ld(t,s){return Oo(r=>t?r||(typeof s=="function"?s(t):t):null,[s,t])}function C1(t,s){return Ld(t,s)}function E1(t){let{callback:s,disabled:r}=t;const o=Pl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function Fl(t){let{callback:s,disabled:r}=t;const o=Pl(s),l=x.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return x.useEffect(()=>()=>l==null?void 0:l.disconnect(),[l]),l}function _1(t){return new Md(_i(t),t)}function lm(t,s,r){s===void 0&&(s=_1);const[o,l]=x.useState(null);function u(){l(g=>{if(!t)return null;if(t.isConnected===!1){var m;return(m=g??r)!=null?m:null}const v=s(t);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const d=E1({callback(g){if(t)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(t)){u();break}}}}),p=Fl({callback:u});return ds(()=>{u(),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 R1(t){const s=Ld(t);return dv(t,s)}const cm=[];function A1(t){const s=x.useRef(t),r=Oo(o=>t?o&&o!==cm&&t&&s.current&&t.parentNode===s.current.parentNode?o:Id(t):cm,[t]);return x.useEffect(()=>{s.current=t},[t]),r}function I1(t){const[s,r]=x.useState(null),o=x.useRef(t),l=x.useCallback(u=>{const d=Ou(u.target);d&&r(p=>p?(p.set(d,Zu(d)),new Map(p)):null)},[]);return x.useEffect(()=>{const u=o.current;if(t!==u){d(u);const p=t.map(g=>{const m=Ou(g);return m?(m.addEventListener("scroll",l,{passive:!0}),[m,Zu(m)]):null}).filter(g=>g!=null);r(p.length?new Map(p):null),o.current=t}return()=>{d(t),d(u)};function d(p){p.forEach(g=>{const m=Ou(g);m==null||m.removeEventListener("scroll",l)})}},[l,t]),x.useMemo(()=>t.length?s?Array.from(s.values()).reduce((u,d)=>bi(u,d),fs):yv(t):fs,[t,s])}function um(t,s){s===void 0&&(s=[]);const r=x.useRef(null);return x.useEffect(()=>{r.current=null},s),x.useEffect(()=>{const o=t!==fs;o&&!r.current&&(r.current=t),!o&&r.current&&(r.current=null)},[t]),r.current?xl(t,r.current):fs}function M1(t){x.useEffect(()=>{if(!Ol)return;const s=t.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},t.map(s=>{let{sensor:r}=s;return r}))}function D1(t,s){return x.useMemo(()=>t.reduce((r,o)=>{let{eventName:l,handler:u}=o;return r[l]=d=>{u(d,s)},r},{}),[t,s])}function Sv(t){return x.useMemo(()=>t?i1(t):null,[t])}const dm=[];function L1(t,s){s===void 0&&(s=_i);const[r]=t,o=Sv(r?Nn(r):null),[l,u]=x.useState(dm);function d(){u(()=>t.length?t.map(g=>gv(g)?o:new Md(s(g),g)):dm)}const p=Fl({callback:d});return ds(()=>{p==null||p.disconnect(),d(),t.forEach(g=>p==null?void 0:p.observe(g))},[t]),l}function bv(t){if(!t)return null;if(t.children.length>1)return t;const s=t.children[0];return Lo(s)?s:t}function O1(t){let{measure:s}=t;const[r,o]=x.useState(null),l=x.useCallback(m=>{for(const{target:v}of m)if(Lo(v)){o(k=>{const y=s(v);return k?{...k,width:y.width,height:y.height}:y});break}},[s]),u=Fl({callback:l}),d=x.useCallback(m=>{const v=bv(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?s(v):null)},[s,u]),[p,g]=vl(d);return x.useMemo(()=>({nodeRef:p,rect:r,setRef:g}),[r,p,g])}const P1=[{sensor:zl,options:{}},{sensor:kv,options:{}}],$1={current:{}},il={draggable:{measure:sm},droppable:{measure:sm,strategy:Ao.WhileDragging,frequency:ed.Optimized},dragOverlay:{measure:_i}};class So extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const z1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new So,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:kl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:il,measureDroppableContainers:kl,windowRect:null,measuringScheduled:!1},Tv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:kl,draggableNodes:new Map,over:null,measureDroppableContainers:kl},$o=x.createContext(Tv),Nv=x.createContext(z1);function F1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new So}}}function U1(t,s){switch(s.type){case Bt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Bt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:s.coordinates.x-t.draggable.initialCoordinates.x,y:s.coordinates.y-t.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=s,{id:o}=r,l=new So(t.droppable.containers);return l.set(o,r),{...t,droppable:{...t.droppable,containers:l}}}case Bt.SetDroppableDisabled:{const{id:r,key:o,disabled:l}=s,u=t.droppable.containers.get(r);if(!u||o!==u.key)return t;const d=new So(t.droppable.containers);return d.set(r,{...u,disabled:l}),{...t,droppable:{...t.droppable,containers:d}}}case Bt.UnregisterDroppable:{const{id:r,key:o}=s,l=t.droppable.containers.get(r);if(!l||o!==l.key)return t;const u=new So(t.droppable.containers);return u.delete(r),{...t,droppable:{...t.droppable,containers:u}}}default:return t}}function B1(t){let{disabled:s}=t;const{active:r,activatorEvent:o,draggableNodes:l}=x.useContext($o),u=yl(o),d=yl(r==null?void 0:r.id);return x.useEffect(()=>{if(!s&&!o&&u&&d!=null){if(!$l(u)||document.activeElement===u.target)return;const p=l.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=Pk(v);if(k){k.focus();break}}})}},[o,s,l,d,u]),null}function jv(t,s){let{transform:r,...o}=s;return t!=null&&t.length?t.reduce((l,u)=>u({transform:l,...o}),r):r}function W1(t){return x.useMemo(()=>({draggable:{...il.draggable,...t==null?void 0:t.draggable},droppable:{...il.droppable,...t==null?void 0:t.droppable},dragOverlay:{...il.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 H1(t){let{activeNode:s,measure:r,initialRect:o,config:l=!0}=t;const u=x.useRef(!1),{x:d,y:p}=typeof l=="boolean"?{x:l,y:l}:l;ds(()=>{if(!d&&!p||!s){u.current=!1;return}if(u.current||!o)return;const m=s==null?void 0:s.node.current;if(!m||m.isConnected===!1)return;const v=r(m),k=dv(v,o);if(d||(k.x=0),p||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const y=pv(m);y&&y.scrollBy({top:k.y,left:k.x})}},[s,d,p,o,r])}const Ul=x.createContext({...fs,scaleX:1,scaleY:1});var cr;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(cr||(cr={}));const Cv=x.memo(function(s){var r,o,l,u;let{id:d,accessibility:p,autoScroll:g=!0,children:m,sensors:v=P1,collisionDetection:k=Jk,measuring:y,modifiers:S,...N}=s;const E=x.useReducer(U1,void 0,F1),[T,I]=E,[R,U]=Wk(),[A,L]=x.useState(cr.Uninitialized),q=A===cr.Initialized,{draggable:{active:K,nodes:$,translate:ne},droppable:{containers:pe}}=T,G=K!=null?$.get(K):null,ve=x.useRef({initial:null,translated:null}),we=x.useMemo(()=>{var Xe;return K!=null?{id:K,data:(Xe=G==null?void 0:G.data)!=null?Xe:$1,rect:ve}:null},[K,G]),Oe=x.useRef(null),[te,oe]=x.useState(null),[ae,z]=x.useState(null),Q=Ro(N,Object.values(N)),W=Po("DndDescribedBy",d),C=x.useMemo(()=>pe.getEnabled(),[pe]),P=W1(y),{droppableRects:se,measureDroppableContainers:de,measuringScheduled:X}=j1(C,{dragging:q,dependencies:[ne.x,ne.y],config:P.droppable}),fe=T1($,K),Te=x.useMemo(()=>ae?wl(ae):null,[ae]),Ee=vn(),Re=C1(fe,P.draggable.measure);H1({activeNode:K!=null?$.get(K):null,config:Ee.layoutShiftCompensation,initialRect:Re,measure:P.draggable.measure});const Ce=lm(fe,P.draggable.measure,Re),at=lm(fe?fe.parentElement:null),Me=x.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:$,draggingNode:null,draggingNodeRect:null,droppableContainers:pe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),lt=pe.getNodeFor((r=Me.current.over)==null?void 0:r.id),$e=O1({measure:P.dragOverlay.measure}),en=(o=$e.nodeRef.current)!=null?o:fe,Fe=q?(l=$e.rect)!=null?l:Ce:null,Ht=!!($e.nodeRef.current&&$e.rect),tn=R1(Ht?null:Ce),wt=Sv(en?Nn(en):null),jt=A1(q?lt??fe:null),$t=L1(jt),Dt=jv(S,{transform:{x:ne.x-tn.x,y:ne.y-tn.y,scaleX:1,scaleY:1},activatorEvent:ae,active:we,activeNodeRect:Ce,containerNodeRect:at,draggingNodeRect:Fe,over:Me.current.over,overlayNodeRect:$e.rect,scrollableAncestors:jt,scrollableAncestorRects:$t,windowRect:wt}),Y=Te?bi(Te,ne):null,he=I1(jt),Ue=um(he),tt=um(he,[Ce]),mt=bi(Dt,Ue),gt=Fe?n1(Fe,Dt):null,Ct=we&&gt?k({active:we,collisionRect:gt,droppableRects:se,droppableContainers:C,pointerCoordinates:Y}):null,an=Qk(Ct,"id"),[dt,Mn]=x.useState(null),Dn=Ht?Dt:bi(Dt,tt),ps=e1(Dn,(u=dt==null?void 0:dt.rect)!=null?u:null,Ce),hs=x.useRef(null),ts=x.useCallback((Xe,Et)=>{let{sensor:ft,options:Gt}=Et;if(Oe.current==null)return;const vt=$.get(Oe.current);if(!vt)return;const yt=Xe.nativeEvent,it=new ft({active:Oe.current,activeNode:vt,event:yt,options:Gt,context:Me,onAbort(st){if(!$.get(st))return;const{onDragAbort:_}=Q.current,ue={id:st};_==null||_(ue),R({type:"onDragAbort",event:ue})},onPending(st,Lt,_,ue){if(!$.get(st))return;const{onDragPending:ye}=Q.current,De={id:st,constraint:Lt,initialCoordinates:_,offset:ue};ye==null||ye(De),R({type:"onDragPending",event:De})},onStart(st){const Lt=Oe.current;if(Lt==null)return;const _=$.get(Lt);if(!_)return;const{onDragStart:ue}=Q.current,ie={activatorEvent:yt,active:{id:Lt,data:_.data,rect:ve}};go.unstable_batchedUpdates(()=>{ue==null||ue(ie),L(cr.Initializing),I({type:Bt.DragStart,initialCoordinates:st,active:Lt}),R({type:"onDragStart",event:ie}),oe(hs.current),z(yt)})},onMove(st){I({type:Bt.DragMove,coordinates:st})},onEnd:Kt(Bt.DragEnd),onCancel:Kt(Bt.DragCancel)});hs.current=it;function Kt(st){return async function(){const{active:_,collisions:ue,over:ie,scrollAdjustedTranslate:ye}=Me.current;let De=null;if(_&&ye){const{cancelDrop:Ge}=Q.current;De={activatorEvent:yt,active:_,collisions:ue,delta:ye,over:ie},st===Bt.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(De))&&(st=Bt.DragCancel)}Oe.current=null,go.unstable_batchedUpdates(()=>{I({type:st}),L(cr.Uninitialized),Mn(null),oe(null),z(null),hs.current=null;const Ge=st===Bt.DragEnd?"onDragEnd":"onDragCancel";if(De){const Le=Q.current[Ge];Le==null||Le(De),R({type:Ge,event:De})}})}}},[$]),Ln=x.useCallback((Xe,Et)=>(ft,Gt)=>{const vt=ft.nativeEvent,yt=$.get(Gt);if(Oe.current!==null||!yt||vt.dndKit||vt.defaultPrevented)return;const it={active:yt};Xe(ft,Et.options,it)===!0&&(vt.dndKit={capturedBy:Et.sensor},Oe.current=Gt,ts(ft,Et))},[$,ts]),gn=N1(v,Ln);M1(v),ds(()=>{Ce&&A===cr.Initializing&&L(cr.Initialized)},[Ce,A]),x.useEffect(()=>{const{onDragMove:Xe}=Q.current,{active:Et,activatorEvent:ft,collisions:Gt,over:vt}=Me.current;if(!Et||!ft)return;const yt={active:Et,activatorEvent:ft,collisions:Gt,delta:{x:mt.x,y:mt.y},over:vt};go.unstable_batchedUpdates(()=>{Xe==null||Xe(yt),R({type:"onDragMove",event:yt})})},[mt.x,mt.y]),x.useEffect(()=>{const{active:Xe,activatorEvent:Et,collisions:ft,droppableContainers:Gt,scrollAdjustedTranslate:vt}=Me.current;if(!Xe||Oe.current==null||!Et||!vt)return;const{onDragOver:yt}=Q.current,it=Gt.get(an),Kt=it&&it.rect.current?{id:it.id,rect:it.rect.current,data:it.data,disabled:it.disabled}:null,st={active:Xe,activatorEvent:Et,collisions:ft,delta:{x:vt.x,y:vt.y},over:Kt};go.unstable_batchedUpdates(()=>{Mn(Kt),yt==null||yt(st),R({type:"onDragOver",event:st})})},[an]),ds(()=>{Me.current={activatorEvent:ae,active:we,activeNode:fe,collisionRect:gt,collisions:Ct,droppableRects:se,draggableNodes:$,draggingNode:en,draggingNodeRect:Fe,droppableContainers:pe,over:dt,scrollableAncestors:jt,scrollAdjustedTranslate:mt},ve.current={initial:Fe,translated:gt}},[we,fe,Ct,gt,$,en,Fe,se,pe,dt,jt,mt]),k1({...Ee,delta:ne,draggingRect:gt,pointerCoordinates:Y,scrollableAncestors:jt,scrollableAncestorRects:$t});const ln=x.useMemo(()=>({active:we,activeNode:fe,activeNodeRect:Ce,activatorEvent:ae,collisions:Ct,containerNodeRect:at,dragOverlay:$e,draggableNodes:$,droppableContainers:pe,droppableRects:se,over:dt,measureDroppableContainers:de,scrollableAncestors:jt,scrollableAncestorRects:$t,measuringConfiguration:P,measuringScheduled:X,windowRect:wt}),[we,fe,Ce,ae,Ct,at,$e,$,pe,se,dt,de,jt,$t,P,X,wt]),Vt=x.useMemo(()=>({activatorEvent:ae,activators:gn,active:we,activeNodeRect:Ce,ariaDescribedById:{draggable:W},dispatch:I,draggableNodes:$,over:dt,measureDroppableContainers:de}),[ae,gn,we,Ce,I,W,$,dt,de]);return ot.createElement(av.Provider,{value:U},ot.createElement($o.Provider,{value:Vt},ot.createElement(Nv.Provider,{value:ln},ot.createElement(Ul.Provider,{value:ps},m)),ot.createElement(B1,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ot.createElement(Gk,{...p,hiddenTextDescribedById:W}));function vn(){const Xe=(te==null?void 0:te.autoScrollEnabled)===!1,Et=typeof g=="object"?g.enabled===!1:g===!1,ft=q&&!Xe&&!Et;return typeof g=="object"?{...g,enabled:ft}:{enabled:ft}}}),V1=x.createContext(null),fm="button",G1="Draggable";function K1(t){let{id:s,data:r,disabled:o=!1,attributes:l}=t;const u=Po(G1),{activators:d,activatorEvent:p,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:y}=x.useContext($o),{role:S=fm,roleDescription:N="draggable",tabIndex:E=0}=l??{},T=(g==null?void 0:g.id)===s,I=x.useContext(T?Ul:V1),[R,U]=vl(),[A,L]=vl(),q=D1(d,s),K=Ro(r);ds(()=>(k.set(s,{id:s,key:u,node:R,activatorNode:A,data:K}),()=>{const ne=k.get(s);ne&&ne.key===u&&k.delete(s)}),[k,s]);const $=x.useMemo(()=>({role:S,tabIndex:E,"aria-disabled":o,"aria-pressed":T&&S===fm?!0:void 0,"aria-roledescription":N,"aria-describedby":v.draggable}),[o,S,E,T,N,v.draggable]);return{active:g,activatorEvent:p,activeNodeRect:m,attributes:$,isDragging:T,listeners:o?void 0:q,node:R,over:y,setNodeRef:U,setActivatorNodeRef:L,transform:I}}function Ev(){return x.useContext(Nv)}const q1="Droppable",Y1={timeout:25};function _v(t){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:l}=t;const u=Po(q1),{active:d,dispatch:p,over:g,measureDroppableContainers:m}=x.useContext($o),v=x.useRef({disabled:r}),k=x.useRef(!1),y=x.useRef(null),S=x.useRef(null),{disabled:N,updateMeasurementsFor:E,timeout:T}={...Y1,...l},I=Ro(E??o),R=x.useCallback(()=>{if(!k.current){k.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{m(Array.isArray(I.current)?I.current:[I.current]),S.current=null},T)},[T]),U=Fl({callback:R,disabled:N||!d}),A=x.useCallback(($,ne)=>{U&&(ne&&(U.unobserve(ne),k.current=!1),$&&U.observe($))},[U]),[L,q]=vl(A),K=Ro(s);return x.useEffect(()=>{!U||!L.current||(U.disconnect(),k.current=!1,U.observe(L.current))},[L,U]),x.useEffect(()=>(p({type:Bt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:L,rect:y,data:K}}),()=>p({type:Bt.UnregisterDroppable,key:u,id:o})),[o]),x.useEffect(()=>{r!==v.current.disabled&&(p({type:Bt.SetDroppableDisabled,id:o,key:u,disabled:r}),v.current.disabled=r)},[o,u,r,p]),{active:d,rect:y,isOver:(g==null?void 0:g.id)===o,node:L,over:g,setNodeRef:q}}function X1(t){let{animation:s,children:r}=t;const[o,l]=x.useState(null),[u,d]=x.useState(null),p=yl(r);return!r&&!o&&p&&l(p),ds(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){l(null);return}Promise.resolve(s(m,u)).then(()=>{l(null)})},[s,o,u]),ot.createElement(ot.Fragment,null,r,o?x.cloneElement(o,{ref:d}):null)}const Q1={x:0,y:0,scaleX:1,scaleY:1};function Z1(t){let{children:s}=t;return ot.createElement($o.Provider,{value:Tv},ot.createElement(Ul.Provider,{value:Q1},s))}const J1={position:"fixed",touchAction:"none"},eS=t=>$l(t)?"transform 250ms ease":void 0,tS=x.forwardRef((t,s)=>{let{as:r,activatorEvent:o,adjustScale:l,children:u,className:d,rect:p,style:g,transform:m,transition:v=eS}=t;if(!p)return null;const k=l?m:{...m,scaleX:1,scaleY:1},y={...J1,width:p.width,height:p.height,top:p.top,left:p.left,transform:js.Transform.toString(k),transformOrigin:l&&o?qk(o,p):void 0,transition:typeof v=="function"?v(o):v,...g};return ot.createElement(r,{className:d,style:y,ref:s},u)}),nS=t=>s=>{let{active:r,dragOverlay:o}=s;const l={},{styles:u,className:d}=t;if(u!=null&&u.active)for(const[p,g]of Object.entries(u.active))g!==void 0&&(l[p]=r.node.style.getPropertyValue(p),r.node.style.setProperty(p,g));if(u!=null&&u.dragOverlay)for(const[p,g]of Object.entries(u.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(l))r.node.style.setProperty(g,m);d!=null&&d.active&&r.node.classList.remove(d.active)}},sS=t=>{let{transform:{initial:s,final:r}}=t;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},rS={duration:250,easing:"ease",keyframes:sS,sideEffects:nS({styles:{active:{opacity:"0"}}})};function iS(t){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:l}=t;return Pl((u,d)=>{if(s===null)return;const p=r.get(u);if(!p)return;const g=p.node.current;if(!g)return;const m=bv(d);if(!m)return;const{transform:v}=Nn(d).getComputedStyle(d),k=fv(v);if(!k)return;const y=typeof s=="function"?s:oS(s);return xv(g,l.draggable.measure),y({active:{id:u,data:p.data,node:g,rect:l.draggable.measure(g)},draggableNodes:r,dragOverlay:{node:d,rect:l.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:l,transform:k})})}function oS(t){const{duration:s,easing:r,sideEffects:o,keyframes:l}={...rS,...t};return u=>{let{active:d,dragOverlay:p,transform:g,...m}=u;if(!s)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=l({...m,active:d,dragOverlay:p,transform:{initial:g,final:y}}),[N]=S,E=S[S.length-1];if(JSON.stringify(N)===JSON.stringify(E))return;const T=o==null?void 0:o({active:d,dragOverlay:p,...m}),I=p.node.animate(S,{duration:s,easing:r,fill:"forwards"});return new Promise(R=>{I.onfinish=()=>{T==null||T(),R()}})}}let pm=0;function aS(t){return x.useMemo(()=>{if(t!=null)return pm++,pm},[t])}const lS=ot.memo(t=>{let{adjustScale:s=!1,children:r,dropAnimation:o,style:l,transition:u,modifiers:d,wrapperElement:p="div",className:g,zIndex:m=999}=t;const{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggableNodes:N,droppableContainers:E,dragOverlay:T,over:I,measuringConfiguration:R,scrollableAncestors:U,scrollableAncestorRects:A,windowRect:L}=Ev(),q=x.useContext(Ul),K=aS(k==null?void 0:k.id),$=jv(d,{activatorEvent:v,active:k,activeNodeRect:y,containerNodeRect:S,draggingNodeRect:T.rect,over:I,overlayNodeRect:T.rect,scrollableAncestors:U,scrollableAncestorRects:A,transform:q,windowRect:L}),ne=Ld(y),pe=iS({config:o,draggableNodes:N,droppableContainers:E,measuringConfiguration:R}),G=ne?T.setRef:void 0;return ot.createElement(Z1,null,ot.createElement(X1,{animation:pe},k&&K?ot.createElement(tS,{key:K,id:k.id,ref:G,as:p,activatorEvent:v,adjustScale:s,className:g,transition:u,rect:ne,style:{zIndex:m,...l},transform:$},r):null))});function Rv(t,s,r){const o=t.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function cS(t,s){return t.reduce((r,o,l)=>{const u=s.get(o);return u&&(r[l]=u),r},Array(t.length))}function Va(t){return t!==null&&t>=0}function uS(t,s){if(t===s)return!0;if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==s[r])return!1;return!0}function dS(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const Ga={scaleX:1,scaleY:1},fS=t=>{var s;let{rects:r,activeNodeRect:o,activeIndex:l,overIndex:u,index:d}=t;const p=(s=r[l])!=null?s:o;if(!p)return null;const g=pS(r,d,l);if(d===l){const m=r[u];return m?{x:l<u?m.left+m.width-(p.left+p.width):m.left-p.left,y:0,...Ga}:null}return d>l&&d<=u?{x:-p.width-g,y:0,...Ga}:d<l&&d>=u?{x:p.width+g,y:0,...Ga}:{x:0,y:0,...Ga}};function pS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return!o||!l&&!u?0:r<s?l?o.left-(l.left+l.width):u.left-(o.left+o.width):u?u.left-(o.left+o.width):o.left-(l.left+l.width)}const Av=t=>{let{rects:s,activeIndex:r,overIndex:o,index:l}=t;const u=Rv(s,o,r),d=s[l],p=u[l];return!p||!d?null:{x:p.left-d.left,y:p.top-d.top,scaleX:p.width/d.width,scaleY:p.height/d.height}},Ka={scaleX:1,scaleY:1},hm=t=>{var s;let{activeIndex:r,activeNodeRect:o,index:l,rects:u,overIndex:d}=t;const p=(s=u[r])!=null?s:o;if(!p)return null;if(l===r){const m=u[d];return m?{x:0,y:r<d?m.top+m.height-(p.top+p.height):m.top-p.top,...Ka}:null}const g=hS(u,l,r);return l>r&&l<=d?{x:0,y:-p.height-g,...Ka}:l<r&&l>=d?{x:0,y:p.height+g,...Ka}:{x:0,y:0,...Ka}};function hS(t,s,r){const o=t[s],l=t[s-1],u=t[s+1];return o?r<s?l?o.top-(l.top+l.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):l?o.top-(l.top+l.height):0:0}const Iv="Sortable",Mv=ot.createContext({activeIndex:-1,containerId:Iv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Av,disabled:{draggable:!1,droppable:!1}});function td(t){let{children:s,id:r,items:o,strategy:l=Av,disabled:u=!1}=t;const{active:d,dragOverlay:p,droppableRects:g,over:m,measureDroppableContainers:v}=Ev(),k=Po(Iv,r),y=p.rect!==null,S=x.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),N=d!=null,E=d?S.indexOf(d.id):-1,T=m?S.indexOf(m.id):-1,I=x.useRef(S),R=!uS(S,I.current),U=T!==-1&&E===-1||R,A=dS(u);ds(()=>{R&&N&&v(S)},[R,S,N,v]),x.useEffect(()=>{I.current=S},[S]);const L=x.useMemo(()=>({activeIndex:E,containerId:k,disabled:A,disableTransforms:U,items:S,overIndex:T,useDragOverlay:y,sortedRects:cS(S,g),strategy:l}),[E,k,A.draggable,A.droppable,U,S,T,g,y,l]);return ot.createElement(Mv.Provider,{value:L},s)}const mS=t=>{let{id:s,items:r,activeIndex:o,overIndex:l}=t;return Rv(r,o,l).indexOf(s)},gS=t=>{let{containerId:s,isSorting:r,wasDragging:o,index:l,items:u,newIndex:d,previousItems:p,previousContainerId:g,transition:m}=t;return!m||!o||p!==u&&l===d?!1:r?!0:d!==l&&s===g},vS={duration:200,easing:"ease"},Dv="transform",yS=js.Transition.toString({property:Dv,duration:0,easing:"linear"}),xS={roleDescription:"sortable"};function wS(t){let{disabled:s,index:r,node:o,rect:l}=t;const[u,d]=x.useState(null),p=x.useRef(r);return ds(()=>{if(!s&&r!==p.current&&o.current){const g=l.current;if(g){const m=_i(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)},[s,r,o,l]),x.useEffect(()=>{u&&d(null)},[u]),u}function Od(t){let{animateLayoutChanges:s=gS,attributes:r,disabled:o,data:l,getNewIndex:u=mS,id:d,strategy:p,resizeObserverConfig:g,transition:m=vS}=t;const{items:v,containerId:k,activeIndex:y,disabled:S,disableTransforms:N,sortedRects:E,overIndex:T,useDragOverlay:I,strategy:R}=x.useContext(Mv),U=kS(o,S),A=v.indexOf(d),L=x.useMemo(()=>({sortable:{containerId:k,index:A,items:v},...l}),[k,l,A,v]),q=x.useMemo(()=>v.slice(v.indexOf(d)),[v,d]),{rect:K,node:$,isOver:ne,setNodeRef:pe}=_v({id:d,data:L,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...g}}),{active:G,activatorEvent:ve,activeNodeRect:we,attributes:Oe,setNodeRef:te,listeners:oe,isDragging:ae,over:z,setActivatorNodeRef:Q,transform:W}=K1({id:d,data:L,attributes:{...xS,...r},disabled:U.draggable}),C=Mk(pe,te),P=!!G,se=P&&!N&&Va(y)&&Va(T),de=!I&&ae,X=de&&se?W:null,Te=se?X??(p??R)({rects:E,activeNodeRect:we,activeIndex:y,overIndex:T,index:A}):null,Ee=Va(y)&&Va(T)?u({id:d,items:v,activeIndex:y,overIndex:T}):A,Re=G==null?void 0:G.id,Ce=x.useRef({activeId:Re,items:v,newIndex:Ee,containerId:k}),at=v!==Ce.current.items,Me=s({active:G,containerId:k,isDragging:ae,isSorting:P,id:d,index:A,items:v,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:m,wasDragging:Ce.current.activeId!=null}),lt=wS({disabled:!Me,index:A,node:$,rect:K});return x.useEffect(()=>{P&&Ce.current.newIndex!==Ee&&(Ce.current.newIndex=Ee),k!==Ce.current.containerId&&(Ce.current.containerId=k),v!==Ce.current.items&&(Ce.current.items=v)},[P,Ee,k,v]),x.useEffect(()=>{if(Re===Ce.current.activeId)return;if(Re!=null&&Ce.current.activeId==null){Ce.current.activeId=Re;return}const en=setTimeout(()=>{Ce.current.activeId=Re},50);return()=>clearTimeout(en)},[Re]),{active:G,activeIndex:y,attributes:Oe,data:L,rect:K,index:A,newIndex:Ee,items:v,isOver:ne,isSorting:P,isDragging:ae,listeners:oe,node:$,overIndex:T,over:z,setNodeRef:C,setActivatorNodeRef:Q,setDroppableNodeRef:pe,setDraggableNodeRef:te,transform:lt??Te,transition:$e()};function $e(){if(lt||at&&Ce.current.newIndex===A)return yS;if(!(de&&!$l(ve)||!m)&&(P||Me))return js.Transition.toString({...m,property:Dv})}}function kS(t,s){var r,o;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(r=t==null?void 0:t.draggable)!=null?r:s.draggable,droppable:(o=t==null?void 0:t.droppable)!=null?o:s.droppable}}et.Down,et.Right,et.Up,et.Left;function qa(t){const[s,r]=x.useState(()=>{try{const l=localStorage.getItem(t);if(l==null)return new Set;const u=JSON.parse(l);return Array.isArray(u)?new Set(u.filter(d=>typeof d=="string")):new Set}catch{return new Set}}),o=x.useCallback(l=>{r(u=>{const d=l(new Set(u));try{localStorage.setItem(t,JSON.stringify([...d]))}catch{}return d})},[t]);return[s,o]}function SS(t,s=!1){const[r,o]=x.useState(()=>{try{const u=localStorage.getItem(t);return u==="1"?!0:u==="0"?!1:s}catch{return s}}),l=x.useCallback(u=>{o(u);try{localStorage.setItem(t,u?"1":"0")}catch{}},[t]);return[r,l]}async function bl(t){try{return await navigator.clipboard.writeText(t),!0}catch{try{const s=document.createElement("textarea");s.value=t,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function bS(t){return t.origin_app_id!=null&&!t.user_touched&&!t.starred}const nd="(no directory)";function pr(t){return t.replaceAll("\\","/").replace(/\/+$/,"")}function sd(t,s){if(!s||!t.cwd)return!1;const r=pr(t.cwd),o=pr(s);return r.startsWith(`${o}/`)}function TS(t,s){const r=new Map;for(const d of s){const p=d.cwd||nd,g=r.get(p)??[];g.push(d),r.set(p,g)}const o=new Set,l=new Set(t.filter(d=>d.deleted===1).map(d=>d.path)),u=[];for(const d of t){if(d.deleted===1){o.add(d.path);continue}o.add(d.path),u.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)||l.has(d)||u.push({path:d,label:d===nd?"Other":d.split("/").pop()||d,sessions:p,workspace:null});return u}function NS(t,s,r){if(s.length===0)return!1;const o=new Set(t.filter(l=>l.deleted===1).map(l=>l.path));return s.some(l=>!sd(l,r)&&!o.has(l.cwd||nd))}function Tl(t){return[...t].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function mm(t,s,r,o){const l=s.map(u=>({folder:u,sessions:t.sessions.filter(d=>d.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return l.push({folder:null,sessions:t.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${t.path}:finished`,hidden:!1}),l}function gm(t,s){return{working:Tl(t.sessions.filter(r=>r.lifecycle!=="finished")),finished:Tl(t.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(t.finishedKey)}}function Ya(t,s){return t.folder_id&&s.has(t.folder_id)?t.folder_id:null}function jS(t){const s=new Set(t.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function vm({id:t,children:s,className:r}){const{setNodeRef:o,isOver:l}=_v({id:t});return a.jsx("div",{ref:o,className:`${r??""}${l?" drop-over":""}`,children:s})}function Pd({inputRef:t,value:s,onChange:r,onConfirm:o,onCancel:l}){return a.jsx("input",{ref:t,className:"tree-rename-input",value:s,onChange:u=>r(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&l()},onBlur:o})}function CS({s:t,backgroundTaskCount:s,isActive:r,isSelected:o,originApp:l,renaming:u,renameValue:d,renameRef:p,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:y,onToggleStar:S}){const{attributes:N,listeners:E,setNodeRef:T,transform:I,transition:R,isDragging:U}=Od({id:`s:${t.id}`}),A=Dl(t,s);return a.jsxs("div",{ref:T,style:{transform:js.Transform.toString(I),transition:R},className:`tree-item ${r?"active":""}${o?" selected":""} ${A.isFinished?"tree-item-finished":""}${U?" dragging":""}${t.starred?" tree-item-starred":""}`,...N,...E,onClick:k,onContextMenu:y,children:[a.jsx(_d,{iconClass:A.iconClass,iconText:A.iconText,size:16}),l&&a.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a.jsx(ji,{iconNode:l.iconNode,size:10})}),u?a.jsx(Pd,{inputRef:p,value:d,onChange:g,onConfirm:m,onCancel:v}):a.jsx("span",{className:"tree-label",children:t.title||t.id.slice(0,8)}),!u&&a.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:a.jsx(gl,{size:10,fill:t.starred?"currentColor":"none"})}),A.dot&&a.jsx(Ed,{status:A.dot,title:A.dotTitle})]})}function ES({folder:t,count:s,collapsed:r,renaming:o,renameValue:l,renameRef:u,onRenameValue:d,onRenameConfirm:p,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:y,listeners:S,setNodeRef:N,transform:E,transition:T,isDragging:I,over:R}=Od({id:`f:${t.id}`}),U=R!=null&&String(R.id).startsWith("s:");return a.jsxs("div",{ref:N,style:{transform:js.Transform.toString(E),transition:T},className:`tree-folder ${r?"collapsed":""}${I?" dragging":""}`,children:[a.jsx("div",{className:`tree-folder-header${U?" drop-over":""}`,...y,...S,onClick:()=>{o||m()},onContextMenu:v,children:o?a.jsx(Pd,{inputRef:u,value:l,onChange:d,onConfirm:p,onCancel:g}):a.jsxs(a.Fragment,{children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx(ml,{size:12}),a.jsx("span",{className:"tree-folder-label",children:t.name}),a.jsx("span",{className:"tree-count",children:s})]})}),!r&&a.jsx("div",{className:"tree-folder-children",children:k})]})}function _S(){const t=M(_=>_.sessions),s=M(_=>_.backgroundTasks),r=M(_=>_.workspaces),o=M(_=>_.folders),l=M(_=>_.activeSessionId),u=M(_=>_.selectSession),d=M(_=>_.deleteSession),p=M(_=>_.removeWorkspace),g=M(_=>_.createSessionInWorkspace),m=M(_=>_.pickAndAddWorkspace),v=M(_=>_.setImportSessionsWorkspace),k=M(_=>_.renameSession),y=M(_=>_.markFinished),S=M(_=>_.markFinishedMany),N=M(_=>_.toggleStar),E=M(_=>_.reopenSession),T=M(_=>_.reopenSessionMany),I=M(_=>_.deleteSessionMany),R=M(_=>_.createSidebarFolder),U=M(_=>_.renameFolder),A=M(_=>_.deleteFolder),L=M(_=>_.applyMoves),q=M(_=>_.reorderFolders),K=M(_=>_.apps),$=M(_=>_.appsRootPath),ne=M(_=>_.activeAppTabId),pe=M(_=>_.openAppTab),G=M(_=>_.startAppEdit),ve=M(_=>_.toggleAppPin),we=M(_=>_.deleteApp),Oe=M(_=>_.openAppCatalog),[te,oe]=qa("agentpane:sidebar-ws-collapsed"),[ae,z]=qa("agentpane:sidebar-sub-collapsed"),[Q,W]=qa("agentpane:sidebar-folders-collapsed"),[C,P]=qa("agentpane:sidebar-app-edits-collapsed"),[se,de]=SS("agentpane:sidebar-hide-auto-sessions"),[X,fe]=x.useState(null),[Te,Ee]=x.useState(null),[Re,Ce]=x.useState(""),[at,Me]=x.useState(null),[lt,$e]=x.useState(new Set),[en,Fe]=x.useState(null),Ht=x.useRef(null),tn=x.useRef(null),wt=x.useRef(null),jt=x.useRef(!1),$t=cv(lv(zl,{activationConstraint:{distance:5}}));function Dt(){$e(new Set),Fe(null)}Mo(Ht,()=>fe(null),!!X),Ni(()=>{fe(null),Dt()},!!X||lt.size>0),x.useLayoutEffect(()=>{const _=Ht.current;if(!X||!_)return;const ue=8,{offsetWidth:ie,offsetHeight:ye}=_,De=X.x+ie>window.innerWidth-ue?Math.max(ue,X.x-ie):X.x,Ge=X.y+ye>window.innerHeight-ue?Math.max(ue,X.y-ye):X.y;_.style.left=`${De}px`,_.style.top=`${Ge}px`},[X]);const Y=x.useMemo(()=>new Map(t.map(_=>[_.id,_])),[t]),he=x.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),Ue=x.useMemo(()=>{const _=new Map;for(const ue of[...o].sort((ie,ye)=>ie.sort_order-ye.sort_order)){const ie=_.get(ue.workspace_path)??[];ie.push(ue),_.set(ue.workspace_path,ie)}return _},[o]);function tt(_){oe(ue=>{const ie=new Set(ue);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function mt(_){z(ue=>{const ie=new Set(ue);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function gt(_){W(ue=>{const ie=new Set(ue);return ie.has(_)?ie.delete(_):ie.add(_),ie})}function Ct(){de(!se),Dt()}function an(_){P(ue=>{const ie=new Set(ue);return ie.has(_)?ie.delete(_):ie.add(_),ie})}x.useEffect(()=>{Te&&tn.current&&(tn.current.focus(),tn.current.select())},[Te]),x.useEffect(()=>{var _,ue,ie;jt.current||!l||(jt.current=!0,(ie=(ue=(_=wt.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:ue.scrollIntoView)==null||ie.call(ue,{block:"nearest"}))},[l]);function dt(_,ue,ie,ye=""){Ee({kind:_,id:ue}),Ce(ie||ye)}function Mn(){if(Te){const _=Re.trim();_&&(Te.kind==="session"?k(Te.id,_):U(Te.id,_))}Ee(null)}function Dn(){Ee(null),Ce("")}async function ps(_){const ue=jS(Ue.get(_)??[]),ie=await R(_,ue);ie&&dt("folder",ie.id,ie.name)}function hs(_){const ue=String(_.active.id);if(ue.startsWith("s:")){const ie=Y.get(ue.slice(2));ie&&Me({kind:"session",label:ie.title||ie.id.slice(0,8)})}else if(ue.startsWith("f:")){const ie=he.get(ue.slice(2));ie&&Me({kind:"folder",label:ie.name})}}function ts(_){Me(null);const{active:ue,over:ie}=_;if(!ie)return;const ye=String(ue.id),De=String(ie.id);if(ye.startsWith("s:")){const Ge=Y.get(ye.slice(2));if(!Ge)return;const Le=Ge.cwd||"(no directory)",zt=Ya(Ge,he);let On,Be;if(De.startsWith("f:")){const Qe=he.get(De.slice(2));if(!Qe)return;On=Qe.workspace_path,Be=Qe.id}else if(De.startsWith("s:")){const Qe=Y.get(De.slice(2));if(!Qe)return;On=Qe.cwd||"(no directory)",Be=Ya(Qe,he)}else if(De.startsWith("c:")){const Qe=De.slice(2),_t=Qe.lastIndexOf("|");On=Qe.slice(0,_t);const gs=Qe.slice(_t+1);Be=gs==="root"?null:gs}else return;if(On!==Le)return;const yn=Tl(t.filter(Qe=>(Qe.cwd||"(no directory)")===On&&Ya(Qe,he)===Be)),Cs=yn.filter(Qe=>Qe.id!==Ge.id);let Us=Cs.length;if(De.startsWith("s:")){const Qe=Cs.findIndex(_t=>_t.id===De.slice(2));Qe>=0&&(Us=Qe)}const Pn=[...Cs.slice(0,Us),Ge,...Cs.slice(Us)],ms=[];if(Be===zt){if(Pn.length===yn.length&&Pn.every((Qe,_t)=>Qe.id===yn[_t].id))return;Pn.forEach((Qe,_t)=>ms.push({id:Qe.id,folder_id:Be,sort_order:Pn.length-1-_t}))}else{const Qe=Tl(t.filter(_t=>(_t.cwd||"(no directory)")===Le&&Ya(_t,he)===zt)).filter(_t=>_t.id!==Ge.id);Qe.forEach((_t,gs)=>ms.push({id:_t.id,folder_id:zt,sort_order:Qe.length-1-gs})),Pn.forEach((_t,gs)=>ms.push({id:_t.id,folder_id:Be,sort_order:Pn.length-1-gs}))}L(ms);return}if(ye.startsWith("f:")){if(!De.startsWith("f:"))return;const Ge=he.get(ye.slice(2)),Le=he.get(De.slice(2));if(!Ge||!Le||Ge.id===Le.id||Ge.workspace_path!==Le.workspace_path)return;const zt=(Ue.get(Ge.workspace_path)??[]).map(yn=>yn.id),On=zt.indexOf(Ge.id),Be=zt.indexOf(Le.id);zt.splice(Be,0,...zt.splice(On,1)),q(zt)}}const Ln=$?t.filter(_=>!sd(_,$)):t,gn=new Set(se?Ln.filter(_=>bS(_)&&_.id!==l).map(_=>_.id):[]),ln=TS(r,gn.size>0?Ln.filter(_=>!gn.has(_.id)):Ln),Vt=x.useMemo(()=>{const _=new Map;if(!$)return _;const ue=pr($);for(const ie of t){if(!sd(ie,$))continue;const ye=pr(ie.cwd).slice(ue.length+1).split("/")[0],De=_.get(ye)??[];De.push(ie),_.set(ye,De)}return _},[t,$]);function vn(_){return{folder:null,sessions:Vt.get(_)??[],finishedKey:`app:${_}:finished`,hidden:C.has(_)}}const Xe=[],Et=_=>{if(_.hidden)return;const{working:ue,finished:ie,finishedCollapsed:ye}=gm(_,ae);Xe.push(...ue.map(De=>De.id)),ye||Xe.push(...ie.map(De=>De.id))};for(const _ of ln){if(te.has(_.path))continue;const ue=Ue.get(_.path)??[],ie=new Set(ue.map(ye=>ye.id));mm(_,ue,ie,Q).forEach(Et)}K.forEach(_=>Et(vn(_.id)));const ft=t.filter(_=>lt.has(_.id)),Gt=ft.filter(_=>_.lifecycle!=="finished").map(_=>_.id),vt=ft.filter(_=>_.lifecycle==="finished").map(_=>_.id);function yt(_,ue){if(ue.metaKey||ue.ctrlKey){ue.preventDefault(),Fe(_.id),$e(ie=>{const ye=new Set(ie);return ye.has(_.id)?ye.delete(_.id):ye.add(_.id),ye});return}if(ue.shiftKey){ue.preventDefault();const ie=en??_.id;Fe(ie);const ye=Xe.indexOf(ie),De=Xe.indexOf(_.id);if(ye>=0&&De>=0){const[Ge,Le]=ye<De?[ye,De]:[De,ye];$e(new Set(Xe.slice(Ge,Le+1)))}return}Dt(),Fe(_.id),u(_.id)}function it(_,ue){ue.preventDefault();const ie=lt.has(_.id)&&lt.size>1;lt.has(_.id)||($e(new Set),Fe(_.id)),fe({x:ue.clientX,y:ue.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:ie})}function Kt(_){var ie;const ue=_.origin_app_id?K.find(ye=>ye.id===_.origin_app_id):null;return a.jsx(CS,{s:_,backgroundTaskCount:((ie=s[_.id])==null?void 0:ie.length)??0,isActive:l===_.id,isSelected:lt.has(_.id),originApp:ue??null,renaming:(Te==null?void 0:Te.kind)==="session"&&Te.id===_.id,renameValue:Re,renameRef:tn,onRenameValue:Ce,onRenameConfirm:Mn,onRenameCancel:Dn,onSelect:ye=>yt(_,ye),onToggleStar:()=>N(_.id),onCtxMenu:ye=>it(_,ye)},_.id)}function st(_){var ie;const ue=Dl(_,((ie=s[_.id])==null?void 0:ie.length)??0);return a.jsxs("div",{className:`sidebar-app-edit-row${l===_.id?" active":""}${lt.has(_.id)?" selected":""}${ue.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ye=>yt(_,ye),onContextMenu:ye=>it(_,ye),children:[a.jsx(_d,{iconClass:ue.iconClass,iconText:ue.iconText,size:14}),(Te==null?void 0:Te.kind)==="session"&&Te.id===_.id?a.jsx(Pd,{inputRef:tn,value:Re,onChange:Ce,onConfirm:Mn,onCancel:Dn}):a.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),ue.dot&&a.jsx(Ed,{status:ue.dot,title:ue.dotTitle})]},_.id)}function Lt(_,ue="workspace"){const{working:ie,finished:ye,finishedCollapsed:De}=gm(_,ae),Ge=ue==="workspace"?Kt:st,Le=a.jsxs(a.Fragment,{children:[ie.length===0&&ye.length===0?a.jsx("div",{className:"tree-empty",children:"No sessions"}):ie.map(Ge),ye.length>0&&a.jsxs("div",{className:`tree-subgroup ${De?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-subgroup-header",onClick:()=>mt(_.finishedKey),children:[a.jsx(Si,{size:8,className:"tree-chevron"}),a.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),a.jsx("span",{className:"tree-subgroup-count",children:ye.length})]}),!De&&a.jsx("div",{className:"tree-subgroup-items",children:ye.map(Ge)})]})]});if(ue==="app")return Le;const zt=[...ie,...ye].map(On=>`s:${On.id}`);return a.jsx(td,{items:zt,strategy:hm,children:Le})}return a.jsxs("div",{className:"ide-sidebar",ref:wt,children:[a.jsxs("div",{className:"sidebar-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),a.jsxs("div",{className:"sidebar-header-actions",children:[a.jsx("button",{className:`sidebar-add sidebar-filter${se?" active":""}`,title:se?`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":se?"Show automatic sessions":"Hide automatic sessions","aria-pressed":se,onClick:Ct,children:se?a.jsx(qw,{size:14}):a.jsx(mr,{size:14})}),a.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:a.jsx(dr,{size:14})})]})]}),a.jsxs(Cv,{sensors:$t,collisionDetection:uv,onDragStart:hs,onDragEnd:ts,children:[ln.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):ln.map(_=>{const ue=te.has(_.path),ie=Ue.get(_.path)??[],ye=new Set(ie.map(Le=>Le.id)),De=mm(_,ie,ye,Q),Ge=De[De.length-1];return a.jsxs("div",{className:`tree-section ${ue?"collapsed":""}`,children:[a.jsxs("div",{className:"tree-section-header",onClick:()=>tt(_.path),onContextMenu:Le=>{Le.preventDefault(),fe({x:Le.clientX,y:Le.clientY,type:"workspace",path:_.path})},children:[a.jsx(Si,{size:9,className:"tree-chevron"}),a.jsx(ml,{size:14}),a.jsx("span",{className:"tree-section-label",children:_.label}),a.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Le=>{Le.stopPropagation(),g(_.path)},children:a.jsx(dr,{size:11})}),a.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Le=>{Le.stopPropagation(),ps(_.path)},children:a.jsx(Du,{size:11})}),a.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!ue&&a.jsxs("div",{className:"tree-children",children:[a.jsx(td,{items:ie.map(Le=>`f:${Le.id}`),strategy:hm,children:De.filter(Le=>Le.folder).map(Le=>a.jsx(ES,{folder:Le.folder,count:Le.sessions.length,collapsed:Le.hidden,renaming:(Te==null?void 0:Te.kind)==="folder"&&Te.id===Le.folder.id,renameValue:Re,renameRef:tn,onRenameValue:Ce,onRenameConfirm:Mn,onRenameCancel:Dn,onToggle:()=>gt(Le.folder.id),onCtxMenu:zt=>{zt.preventDefault(),fe({x:zt.clientX,y:zt.clientY,type:"folder",folderId:Le.folder.id,folderName:Le.folder.name})},children:a.jsx(vm,{id:`c:${_.path}|${Le.folder.id}`,children:Lt(Le)})},Le.folder.id))}),a.jsx(vm,{id:`c:${_.path}|root`,children:Lt(Ge)})]})]},_.path)}),a.jsx(lS,{children:at&&a.jsxs("div",{className:"drag-overlay",children:[at.kind==="folder"&&a.jsx(ml,{size:12}),a.jsx("span",{children:at.label})]})})]}),a.jsxs("div",{className:"sidebar-apps",children:[a.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[a.jsx("span",{className:"sidebar-header-title",children:"Apps"}),a.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>Oe(),children:a.jsx(dr,{size:14})})]}),K.length===0&&a.jsx("div",{className:"tree-empty",children:"No apps yet"}),K.map(_=>{const ue=vn(_.id),ie=ue.sessions.length>0&&!ue.hidden;return a.jsxs("div",{className:"sidebar-app-block",children:[a.jsxs("div",{className:`sidebar-app-row${ne===_.id?" active":""}`,title:_.description??void 0,onClick:()=>pe(_.id),onContextMenu:ye=>{ye.preventDefault(),fe({x:ye.clientX,y:ye.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[ue.sessions.length>0&&a.jsx("button",{className:`sidebar-app-chevron${ie?"":" closed"}`,title:"Edit sessions of this app",onClick:ye=>{ye.stopPropagation(),an(_.id)},children:a.jsx(Si,{size:10,className:"tree-chevron"})}),a.jsx(ji,{iconNode:_.iconNode,size:14,className:"sidebar-app-icon"}),a.jsx("span",{className:"tree-label",children:_.title}),ue.sessions.length>0&&a.jsx("span",{className:"sidebar-app-count",children:ue.sessions.length}),_.pinned&&a.jsx(gl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),ie&&a.jsx("div",{className:"sidebar-app-edits",children:Lt(ue,"app")})]},_.id)})]}),a.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[a.jsx(Du,{size:14}),a.jsx("span",{children:"Add workspace"})]}),X&&a.jsxs("div",{ref:Ht,className:"ctx-menu",style:{position:"fixed",left:X.x,top:X.y,zIndex:500},children:[X.type==="workspace"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(X.path),fe(null)},children:[a.jsx(dr,{size:12})," New Session"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ps(X.path),fe(null)},children:[a.jsx(Du,{size:12})," New Folder"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{v(X.path),fe(null)},children:[a.jsx(Xg,{size:12})," Import Claude Code Sessions…"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{p(X.path),fe(null)},children:[a.jsx(us,{size:12})," Hide Workspace"]})]}),X.type==="folder"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("folder",X.folderId,X.folderName??""),fe(null)},children:[a.jsx(rl,{size:12})," Rename Folder"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{A(X.folderId),fe(null)},children:[a.jsx(us,{size:12})," Delete Folder"]})]}),X.type==="session"&&!X.multi&&a.jsx(a.Fragment,{children:X.sessionLifecycle!=="finished"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{dt("session",X.sessionId,X.sessionTitle??""),fe(null)},children:[a.jsx(rl,{size:12})," Rename"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{y(X.sessionId),fe(null)},children:[a.jsx(pl,{size:12})," Mark as Finished"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(bl(X.sessionExternalId),fe(null))},children:[a.jsx(hl,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),fe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(X.sessionId),fe(null)},children:[a.jsx(_o,{size:12})," Reopen"]}),a.jsxs("div",{className:`ctx-menu-item${X.sessionExternalId?"":" ctx-disabled"}`,title:X.sessionExternalId?void 0:"Session not started",onClick:()=>{X.sessionExternalId&&(bl(X.sessionExternalId),fe(null))},children:[a.jsx(hl,{size:12})," Copy Session ID"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{d(X.sessionId),fe(null)},children:[a.jsx(us,{size:12})," Delete Session"]})]})}),X.type==="session"&&X.multi&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-header",children:[ft.length," sessions selected"]}),Gt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{S(Gt),fe(null),Dt()},children:[a.jsx(pl,{size:12})," Mark ",Gt.length," as Finished"]}),vt.length>0&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{T(vt),fe(null),Dt()},children:[a.jsx(_o,{size:12})," Reopen ",vt.length]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{I([...lt]),fe(null),Dt()},children:[a.jsx(us,{size:12})," Delete ",ft.length," Sessions"]})]}),X.type==="app"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{G(X.appId),fe(null)},children:[a.jsx(rl,{size:12})," Edit App"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ve(X.appId),fe(null)},children:[a.jsx(gl,{size:12})," ",X.appPinned?"Unpin":"Pin"]}),a.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{we(X.appId),fe(null)},children:[a.jsx(us,{size:12})," Delete App"]})]})]})]})}const Xa=4,RS=({transform:t})=>({...t,y:0});function ym({tabKey:t,title:s,active:r,icon:o,badge:l,onSelect:u,onClose:d,onMenu:p}){const{attributes:g,listeners:m,setNodeRef:v,transform:k,transition:y,isDragging:S}=Od({id:t});return a.jsxs("div",{ref:v,style:{transform:js.Translate.toString(k),transition:y},className:`ide-tab ${r?"active":""} ${S?"dragging":""}`,title:s,...g,...m,onClick:u,onMouseDown:N=>{N.button===1&&N.preventDefault()},onAuxClick:N=>{N.button===1&&d()},onContextMenu:N=>{N.preventDefault(),N.stopPropagation(),p(N.clientX,N.clientY)},children:[o,s,l,a.jsx("span",{className:"ide-tab-close",onClick:N=>{N.stopPropagation(),d()},children:a.jsx(Tn,{size:12})})]})}function AS({menu:t,tabs:s,onDone:r}){const o=M(k=>k.closeTabs),l=M(k=>k.reopenClosedTab),u=M(k=>k.closedTabs.some(y=>_g(k,y.key))),d=x.useRef(null),[p,g]=x.useState({left:t.x,top:t.y});Mo(d,r,!0),Ni(r,!0),x.useLayoutEffect(()=>{if(!d.current)return;const{width:k,height:y}=d.current.getBoundingClientRect();g({left:Math.max(Xa,Math.min(t.x,window.innerWidth-k-Xa)),top:Math.max(Xa,Math.min(t.y,window.innerHeight-y-Xa))})},[t.x,t.y]);const m=t.key!==null&&s.includes(t.key)?t.key:null,v=(k,y,S=!1)=>a.jsx("div",{role:"menuitem","aria-disabled":S,className:`ctx-menu-item ${S?"ctx-disabled":""}`,onClick:()=>{S||(y(),r())},children:k});return a.jsxs("div",{ref:d,role:"menu",className:"ctx-menu",style:{position:"fixed",...p,zIndex:500},children:[m!==null&&a.jsxs(a.Fragment,{children:[v("Close",()=>o([m])),v("Close Others",()=>o(s.filter(k=>k!==m)),s.length<2),v("Close to the Right",()=>o(s.slice(s.indexOf(m)+1)),s.at(-1)===m),v("Close All",()=>o(s))]}),v("Reopen Closed Tab",l,!u)]})}function IS(){const t=M(L=>L.tabOrder),s=M(L=>L.activeSessionId),r=M(L=>L.sessions),o=M(L=>L.backgroundTasks),l=M(L=>L.selectSession),u=M(L=>L.closeTab),d=M(L=>L.setShowNewSessionDialog),p=M(L=>L.apps),g=M(L=>L.activeAppTabId),m=M(L=>L.openAppTab),v=M(L=>L.closeAppTab),k=M(L=>L.moveTab),[y,S]=x.useState(null),N=x.useRef(null),E=cv(lv(zl,{activationConstraint:{distance:5}})),T=wd({activeSessionId:s,activeAppTabId:g});x.useEffect(()=>{var L,q,K;(K=(q=(L=N.current)==null?void 0:L.querySelector(".ide-tab.active"))==null?void 0:q.scrollIntoView)==null||K.call(q,{block:"nearest",inline:"nearest"})},[T]);const I=t.filter(L=>{const{kind:q,id:K}=fr(L);return q==="app"||r.some($=>$.id===K)}),R=({active:L,over:q})=>{q&&k(String(L.id),String(q.id))},U=L=>{L.preventDefault(),S({x:L.clientX,y:L.clientY,key:null})},A=L=>{var G;const{kind:q,id:K}=fr(L),$=(ve,we)=>S({x:ve,y:we,key:L});if(q==="app"){const ve=p.find(we=>we.id===K);return a.jsx(ym,{tabKey:L,title:(ve==null?void 0:ve.title)??K,active:g===K,icon:a.jsx(ji,{iconNode:ve==null?void 0:ve.iconNode,size:12,className:"miniapp-tab-icon"}),onSelect:()=>m(K),onClose:()=>v(K),onMenu:$},L)}const ne=r.find(ve=>ve.id===K);if(!ne)return null;const pe=Dl(ne,((G=o[K])==null?void 0:G.length)??0);return a.jsx(ym,{tabKey:L,title:ne.title||K.slice(0,8),active:s===K&&g==null,icon:a.jsx(_d,{iconClass:pe.iconClass,iconText:pe.iconText,size:14}),badge:pe.dot&&a.jsx(Ed,{status:pe.dot,title:pe.dotTitle}),onSelect:()=>void l(K),onClose:()=>u(K),onMenu:$},L)};return a.jsxs(Cv,{sensors:E,collisionDetection:uv,modifiers:[RS],onDragEnd:R,children:[a.jsx(td,{items:I,strategy:fS,children:a.jsxs("div",{ref:N,className:"ide-tabs",onContextMenu:U,onWheel:L=>{L.deltaX===0&&(L.currentTarget.scrollLeft+=L.deltaY)},children:[I.map(A),a.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>d(!0),children:a.jsx(dr,{size:14})})]})}),y&&a.jsx(AS,{menu:y,tabs:I,onDone:()=>S(null)})]})}function $d(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fr=$d();function Lv(t){Fr=t}var bo={exec:()=>null};function nt(t,s=""){let r=typeof t=="string"?t:t.source;const o={replace:(l,u)=>{let d=typeof u=="string"?u:u.source;return d=d.replace(bn.caret,"$1"),r=r.replace(l,d),o},getRegex:()=>new RegExp(r,s)};return o}var bn={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")},MS=/^(?:[ \t]*(?:\n|$))+/,DS=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,LS=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,OS=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zd=/(?:[*+-]|\d{1,9}[.)])/,Ov=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Pv=nt(Ov).replace(/bull/g,zd).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(),PS=nt(Ov).replace(/bull/g,zd).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(),Fd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$S=/^[^\n]+/,Ud=/(?!\s*\])(?:\\.|[^\[\]\\])+/,zS=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ud).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),FS=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zd).getRegex(),Bl="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",Bd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,US=nt("^ {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",Bd).replace("tag",Bl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$v=nt(Fd).replace("hr",zo).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",Bl).getRegex(),BS=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$v).getRegex(),Wd={blockquote:BS,code:DS,def:zS,fences:LS,heading:OS,hr:zo,html:US,lheading:Pv,list:FS,newline:MS,paragraph:$v,table:bo,text:$S},xm=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zo).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",Bl).getRegex(),WS={...Wd,lheading:PS,table:xm,paragraph:nt(Fd).replace("hr",zo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",xm).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",Bl).getRegex()},HS={...Wd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bd).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:bo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(Fd).replace("hr",zo).replace("heading",` *#{1,6} *[^
434
+ ]`).replace("lheading",Pv).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},VS=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,GS=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zv=/^( {2,}|\\)\n(?!\s*$)/,KS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wl=/[\p{P}\p{S}]/u,Hd=/[\s\p{P}\p{S}]/u,Fv=/[^\s\p{P}\p{S}]/u,qS=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Hd).getRegex(),Uv=/(?!~)[\p{P}\p{S}]/u,YS=/(?!~)[\s\p{P}\p{S}]/u,XS=/(?:[^\s\p{P}\p{S}]|~)/u,QS=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Bv=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ZS=nt(Bv,"u").replace(/punct/g,Wl).getRegex(),JS=nt(Bv,"u").replace(/punct/g,Uv).getRegex(),Wv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",eb=nt(Wv,"gu").replace(/notPunctSpace/g,Fv).replace(/punctSpace/g,Hd).replace(/punct/g,Wl).getRegex(),tb=nt(Wv,"gu").replace(/notPunctSpace/g,XS).replace(/punctSpace/g,YS).replace(/punct/g,Uv).getRegex(),nb=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fv).replace(/punctSpace/g,Hd).replace(/punct/g,Wl).getRegex(),sb=nt(/\\(punct)/,"gu").replace(/punct/g,Wl).getRegex(),rb=nt(/^<(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(),ib=nt(Bd).replace("(?:-->|$)","-->").getRegex(),ob=nt("^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",ib).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ab=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Nl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hv=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",Nl).replace("ref",Ud).getRegex(),Vv=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ud).getRegex(),lb=nt("reflink|nolink(?!\\()","g").replace("reflink",Hv).replace("nolink",Vv).getRegex(),Vd={_backpedal:bo,anyPunctuation:sb,autolink:rb,blockSkip:QS,br:zv,code:GS,del:bo,emStrongLDelim:ZS,emStrongRDelimAst:eb,emStrongRDelimUnd:nb,escape:VS,link:ab,nolink:Vv,punctuation:qS,reflink:Hv,reflinkSearch:lb,tag:ob,text:KS,url:bo},cb={...Vd,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Nl).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nl).getRegex()},rd={...Vd,emStrongRDelimAst:tb,emStrongLDelim:JS,url:nt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ub={...rd,br:nt(zv).replace("{2,}","*").getRegex(),text:nt(rd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qa={normal:Wd,gfm:WS,pedantic:HS},uo={normal:Vd,gfm:rd,breaks:ub,pedantic:cb},db={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wm=t=>db[t];function bs(t,s){if(s){if(bn.escapeTest.test(t))return t.replace(bn.escapeReplace,wm)}else if(bn.escapeTestNoEncode.test(t))return t.replace(bn.escapeReplaceNoEncode,wm);return t}function km(t){try{t=encodeURI(t).replace(bn.percentDecode,"%")}catch{return null}return t}function Sm(t,s){var u;const r=t.replace(bn.findPipe,(d,p,g)=>{let m=!1,v=p;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=r.split(bn.splitPipe);let l=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;l<o.length;l++)o[l]=o[l].trim().replace(bn.slashPipe,"|");return o}function fo(t,s,r){const o=t.length;if(o===0)return"";let l=0;for(;l<o&&t.charAt(o-l-1)===s;)l++;return t.slice(0,o-l)}function fb(t,s){if(t.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<t.length;o++)if(t[o]==="\\")o++;else if(t[o]===s[0])r++;else if(t[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function bm(t,s,r,o,l){const u=s.href,d=s.title||null,p=t[1].replace(l.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:d,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,g}function pb(t,s,r){const o=t.match(r.other.indentCodeCompensation);if(o===null)return s;const l=o[1];return s.split(`
435
+ `).map(u=>{const d=u.match(r.other.beginningSpace);if(d===null)return u;const[p]=d;return p.length>=l.length?u.slice(l.length):u}).join(`
436
+ `)}var jl=class{constructor(t){rt(this,"options");rt(this,"rules");rt(this,"lexer");this.options=t||Fr}space(t){const s=this.rules.block.newline.exec(t);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(t){const s=this.rules.block.code.exec(t);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:fo(r,`
437
+ `)}}}fences(t){const s=this.rules.block.fences.exec(t);if(s){const r=s[0],o=pb(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(t){const s=this.rules.block.heading.exec(t);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=fo(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const s=this.rules.block.hr.exec(t);if(s)return{type:"hr",raw:fo(s[0],`
438
+ `)}}blockquote(t){const s=this.rules.block.blockquote.exec(t);if(s){let r=fo(s[0],`
439
+ `).split(`
440
+ `),o="",l="";const u=[];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(`
441
+ `),v=m.replace(this.rules.other.blockquoteSetextReplace,`
442
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
443
+ ${m}`:m,l=l?`${l}
444
+ ${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,u,!0),this.lexer.state.top=k,r.length===0)break;const y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const S=y,N=S.raw+`
445
+ `+r.join(`
446
+ `),E=this.blockquote(N);u[u.length-1]=E,o=o.substring(0,o.length-S.raw.length)+E.raw,l=l.substring(0,l.length-S.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){const S=y,N=S.raw+`
447
+ `+r.join(`
448
+ `),E=this.list(N);u[u.length-1]=E,o=o.substring(0,o.length-y.raw.length)+E.raw,l=l.substring(0,l.length-S.raw.length)+E.raw,r=N.substring(u.at(-1).raw.length).split(`
449
+ `);continue}}return{type:"blockquote",raw:o,tokens:u,text:l}}}list(t){let s=this.rules.block.list.exec(t);if(s){let r=s[1].trim();const o=r.length>1,l={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 u=this.rules.other.listItemRegex(r);let d=!1;for(;t;){let g=!1,m="",v="";if(!(s=u.exec(t))||this.rules.block.hr.test(t))break;m=s[0],t=t.substring(m.length);let k=s[2].split(`
450
+ `,1)[0].replace(this.rules.other.listReplaceTabs,I=>" ".repeat(3*I.length)),y=t.split(`
451
+ `,1)[0],S=!k.trim(),N=0;if(this.options.pedantic?(N=2,v=k.trimStart()):S?N=s[1].length+1:(N=s[2].search(this.rules.other.nonSpaceChar),N=N>4?1:N,v=k.slice(N),N+=s[1].length),S&&this.rules.other.blankLine.test(y)&&(m+=y+`
452
+ `,t=t.substring(y.length+1),g=!0),!g){const I=this.rules.other.nextBulletRegex(N),R=this.rules.other.hrRegex(N),U=this.rules.other.fencesBeginRegex(N),A=this.rules.other.headingBeginRegex(N),L=this.rules.other.htmlBeginRegex(N);for(;t;){const q=t.split(`
453
+ `,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," "),U.test(y)||A.test(y)||L.test(y)||I.test(y)||R.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=N||!y.trim())v+=`
454
+ `+K.slice(N);else{if(S||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(k)||A.test(k)||R.test(k))break;v+=`
455
+ `+y}!S&&!y.trim()&&(S=!0),m+=q+`
456
+ `,t=t.substring(q.length+1),k=K.slice(N)}}l.loose||(d?l.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(d=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(v),E&&(T=E[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:m,task:!!E,checked:T,loose:!1,text:v,tokens:[]}),l.raw+=m}const p=l.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let g=0;g<l.items.length;g++)if(this.lexer.state.top=!1,l.items[g].tokens=this.lexer.blockTokens(l.items[g].text,[]),!l.loose){const m=l.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));l.loose=v}if(l.loose)for(let g=0;g<l.items.length;g++)l.items[g].loose=!0;return l}}html(t){const s=this.rules.block.html.exec(t);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(t){const s=this.rules.block.def.exec(t);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:l}}}table(t){var d;const s=this.rules.block.table.exec(t);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Sm(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(d=s[3])!=null&&d.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
457
+ `):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.length===o.length){for(const p of o)this.rules.other.tableAlignRight.test(p)?u.align.push("right"):this.rules.other.tableAlignCenter.test(p)?u.align.push("center"):this.rules.other.tableAlignLeft.test(p)?u.align.push("left"):u.align.push(null);for(let p=0;p<r.length;p++)u.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:u.align[p]});for(const p of l)u.rows.push(Sm(p,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}lheading(t){const s=this.rules.block.lheading.exec(t);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(t){const s=this.rules.block.paragraph.exec(t);if(s){const r=s[1].charAt(s[1].length-1)===`
458
+ `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const s=this.rules.block.text.exec(t);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(t){const s=this.rules.inline.escape.exec(t);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(t){const s=this.rules.inline.tag.exec(t);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(t){const s=this.rules.inline.link.exec(t);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=fo(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=fb(s[2],"()");if(u===-2)return;if(u>-1){const p=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,p).trim(),s[3]=""}}let o=s[2],l="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],l=u[3])}else l=s[3]?s[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)),bm(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(t,s){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," "),l=s[o.toLowerCase()];if(!l){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return bm(r,l,r[0],this.lexer,this.rules)}}emStrong(t,s,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 u=[...o[0]].length-1;let d,p,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,s=s.slice(-1*t.length+u);(o=v.exec(s))!=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])&&u%3&&!((u+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,u+o.index+k+p);if(Math.min(u,p)%2){const N=y.slice(1,-1);return{type:"em",raw:y,text:N,tokens:this.lexer.inlineTokens(N)}}const S=y.slice(2,-2);return{type:"strong",raw:y,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(t){const s=this.rules.inline.code.exec(t);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(t){const s=this.rules.inline.br.exec(t);if(s)return{type:"br",raw:s[0]}}del(t){const s=this.rules.inline.del.exec(t);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(t){const s=this.rules.inline.autolink.exec(t);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let s;if(s=this.rules.inline.url.exec(t)){let o,l;if(s[2]==="@")o=s[0],l="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?l="http://"+s[0]:l=s[0]}return{type:"link",raw:s[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(t){const s=this.rules.inline.text.exec(t);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},$s=class id{constructor(s){rt(this,"tokens");rt(this,"options");rt(this,"state");rt(this,"tokenizer");rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Fr,this.options.tokenizer=this.options.tokenizer||new jl,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:bn,block:Qa.normal,inline:uo.normal};this.options.pedantic?(r.block=Qa.pedantic,r.inline=uo.pedantic):this.options.gfm&&(r.block=Qa.gfm,this.options.breaks?r.inline=uo.breaks:r.inline=uo.gfm),this.tokenizer.rules=r}static get rules(){return{block:Qa,inline:uo}}static lex(s,r){return new id(r).lex(s)}static lexInline(s,r){return new id(r).inlineTokens(s)}lex(s){s=s.replace(bn.carriageReturn,`
459
+ `),this.blockTokens(s,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(s,r=[],o=!1){var l,u,d;for(this.options.pedantic&&(s=s.replace(bn.tabCharGlobal," ").replace(bn.spaceLine,""));s;){let p;if((u=(l=this.options.extensions)==null?void 0:l.block)!=null&&u.some(m=>(p=m.call({lexer:this},s,r))?(s=s.substring(p.raw.length),r.push(p),!0):!1))continue;if(p=this.tokenizer.space(s)){s=s.substring(p.raw.length);const m=r.at(-1);p.raw.length===1&&m!==void 0?m.raw+=`
460
+ `:r.push(p);continue}if(p=this.tokenizer.code(s)){s=s.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+=`
461
+ `+p.raw,m.text+=`
462
+ `+p.text,this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(p=this.tokenizer.fences(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.heading(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.hr(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.blockquote(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.list(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.html(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.def(s)){s=s.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+=`
463
+ `+p.raw,m.text+=`
464
+ `+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(s)){s=s.substring(p.raw.length),r.push(p);continue}if(p=this.tokenizer.lheading(s)){s=s.substring(p.raw.length),r.push(p);continue}let g=s;if((d=this.options.extensions)!=null&&d.startBlock){let m=1/0;const v=s.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=s.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+=`
465
+ `+p.raw,m.text+=`
466
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p),o=g.length!==s.length,s=s.substring(p.raw.length);continue}if(p=this.tokenizer.text(s)){s=s.substring(p.raw.length);const m=r.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
467
+ `+p.raw,m.text+=`
468
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(p);continue}if(s){const m="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var p,g,m;let o=s,l=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,l.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(l=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,d="";for(;s;){u||(d=""),u=!1;let v;if((g=(p=this.options.extensions)==null?void 0:p.inline)!=null&&g.some(y=>(v=y.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.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(s,o,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let k=s;if((m=this.options.extensions)!=null&&m.startInline){let y=1/0;const S=s.slice(1);let N;this.options.extensions.startInline.forEach(E=>{N=E.call({lexer:this},S),typeof N=="number"&&N>=0&&(y=Math.min(y,N))}),y<1/0&&y>=0&&(k=s.substring(0,y+1))}if(v=this.tokenizer.inlineText(k)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),u=!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(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},Cl=class{constructor(t){rt(this,"options");rt(this,"parser");this.options=t||Fr}space(t){return""}code({text:t,lang:s,escaped:r}){var u;const o=(u=(s||"").match(bn.notSpaceStart))==null?void 0:u[0],l=t.replace(bn.endingNewline,"")+`
469
+ `;return o?'<pre><code class="language-'+bs(o)+'">'+(r?l:bs(l,!0))+`</code></pre>
470
+ `:"<pre><code>"+(r?l:bs(l,!0))+`</code></pre>
471
+ `}blockquote({tokens:t}){return`<blockquote>
472
+ ${this.parser.parse(t)}</blockquote>
473
+ `}html({text:t}){return t}heading({tokens:t,depth:s}){return`<h${s}>${this.parser.parseInline(t)}</h${s}>
474
+ `}hr(t){return`<hr>
475
+ `}list(t){const s=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 l=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+l+u+`>
476
+ `+o+"</"+l+`>
477
+ `}listitem(t){var r;let s="";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+" "+bs(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(t.tokens,!!t.loose),`<li>${s}</li>
478
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
479
+ `}table(t){let s="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);s+=this.tablerow({text:r});let o="";for(let l=0;l<t.rows.length;l++){const u=t.rows[l];r="";for(let d=0;d<u.length;d++)r+=this.tablecell(u[d]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
480
+ <thead>
481
+ `+s+`</thead>
482
+ `+o+`</table>
483
+ `}tablerow({text:t}){return`<tr>
484
+ ${t}</tr>
485
+ `}tablecell(t){const s=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+s+`</${r}>
486
+ `}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>${bs(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:s,tokens:r}){const o=this.parser.parseInline(r),l=km(t);if(l===null)return o;t=l;let u='<a href="'+t+'"';return s&&(u+=' title="'+bs(s)+'"'),u+=">"+o+"</a>",u}image({href:t,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const l=km(t);if(l===null)return bs(r);t=l;let u=`<img src="${t}" alt="${r}"`;return s&&(u+=` title="${bs(s)}"`),u+=">",u}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:bs(t.text)}},Gd=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 od{constructor(s){rt(this,"options");rt(this,"renderer");rt(this,"textRenderer");this.options=s||Fr,this.options.renderer=this.options.renderer||new Cl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gd}static parse(s,r){return new od(r).parse(s)}static parseInline(s,r){return new od(r).parseInline(s)}parse(s,r=!0){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[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<s.length&&s[d+1].type==="text";)m=s[++d],v+=`
487
+ `+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(s,r=this.renderer){var l,u;let o="";for(let d=0;d<s.length;d++){const p=s[d];if((u=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&u[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}},Gu,ol=(Gu=class{constructor(t){rt(this,"options");rt(this,"block");this.options=t||Fr}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}},rt(Gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Gu),hb=class{constructor(...t){rt(this,"defaults",$d());rt(this,"options",this.setOptions);rt(this,"parse",this.parseMarkdown(!0));rt(this,"parseInline",this.parseMarkdown(!1));rt(this,"Parser",zs);rt(this,"Renderer",Cl);rt(this,"TextRenderer",Gd);rt(this,"Lexer",$s);rt(this,"Tokenizer",jl);rt(this,"Hooks",ol);this.use(...t)}walkTokens(t,s){var o,l;let r=[];for(const u of t)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const d=u;for(const p of d.header)r=r.concat(this.walkTokens(p.tokens,s));for(const p of d.rows)for(const g of p)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{const d=u;r=r.concat(this.walkTokens(d.items,s));break}default:{const d=u;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[d.type]?this.defaults.extensions.childTokens[d.type].forEach(p=>{const g=d[p].flat(1/0);r=r.concat(this.walkTokens(g,s))}):d.tokens&&(r=r.concat(this.walkTokens(d.tokens,s)))}}return r}use(...t){const s=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(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const u=s.renderers[l.name];u?s.renderers[l.name]=function(...d){let p=l.renderer.apply(this,d);return p===!1&&(p=u.apply(this,d)),p}:s.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=s[l.level];u?u.unshift(l.tokenizer):s[l.level]=[l.tokenizer],l.start&&(l.level==="block"?s.startBlock?s.startBlock.push(l.start):s.startBlock=[l.start]:l.level==="inline"&&(s.startInline?s.startInline.push(l.start):s.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(s.childTokens[l.name]=l.childTokens)}),o.extensions=s),r.renderer){const l=this.defaults.renderer||new Cl(this.defaults);for(const u in r.renderer){if(!(u in l))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const d=u,p=r.renderer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v||""}}o.renderer=l}if(r.tokenizer){const l=this.defaults.tokenizer||new jl(this.defaults);for(const u in r.tokenizer){if(!(u in l))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const d=u,p=r.tokenizer[d],g=l[d];l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.tokenizer=l}if(r.hooks){const l=this.defaults.hooks||new ol;for(const u in r.hooks){if(!(u in l))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const d=u,p=r.hooks[d],g=l[d];ol.passThroughHooks.has(u)?l[d]=m=>{if(this.defaults.async)return Promise.resolve(p.call(l,m)).then(k=>g.call(l,k));const v=p.call(l,m);return g.call(l,v)}:l[d]=(...m)=>{let v=p.apply(l,m);return v===!1&&(v=g.apply(l,m)),v}}o.hooks=l}if(r.walkTokens){const l=this.defaults.walkTokens,u=r.walkTokens;o.walkTokens=function(d){let p=[];return p.push(u.call(this,d)),l&&(p=p.concat(l.call(this,d))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,s){return $s.lex(t,s??this.defaults)}parser(t,s){return zs.parse(t,s??this.defaults)}parseMarkdown(t){return(r,o)=>{const l={...o},u={...this.defaults,...l},d=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&l.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"));u.hooks&&(u.hooks.options=u,u.hooks.block=t);const p=u.hooks?u.hooks.provideLexer():t?$s.lex:$s.lexInline,g=u.hooks?u.hooks.provideParser():t?zs.parse:zs.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).then(m=>p(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(d);try{u.hooks&&(r=u.hooks.preprocess(r));let m=p(r,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return d(m)}}}onError(t,s){return r=>{if(r.message+=`
488
+ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An error occurred:</p><pre>"+bs(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},$r=new hb;function Ve(t,s){return $r.parse(t,s)}Ve.options=Ve.setOptions=function(t){return $r.setOptions(t),Ve.defaults=$r.defaults,Lv(Ve.defaults),Ve};Ve.getDefaults=$d;Ve.defaults=Fr;Ve.use=function(...t){return $r.use(...t),Ve.defaults=$r.defaults,Lv(Ve.defaults),Ve};Ve.walkTokens=function(t,s){return $r.walkTokens(t,s)};Ve.parseInline=$r.parseInline;Ve.Parser=zs;Ve.parser=zs.parse;Ve.Renderer=Cl;Ve.TextRenderer=Gd;Ve.Lexer=$s;Ve.lexer=$s.lex;Ve.Tokenizer=jl;Ve.Hooks=ol;Ve.parse=Ve;Ve.options;Ve.setOptions;Ve.use;Ve.walkTokens;Ve.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 Tm(t,s){(s==null||s>t.length)&&(s=t.length);for(var r=0,o=Array(s);r<s;r++)o[r]=t[r];return o}function mb(t){if(Array.isArray(t))return t}function gb(t,s){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var o,l,u,d,p=[],g=!0,m=!1;try{if(u=(r=r.call(t)).next,s!==0)for(;!(g=(o=u.call(r)).done)&&(p.push(o.value),p.length!==s);g=!0);}catch(v){m=!0,l=v}finally{try{if(!g&&r.return!=null&&(d=r.return(),Object(d)!==d))return}finally{if(m)throw l}}return p}}function vb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
489
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yb(t,s){return mb(t)||gb(t,s)||xb(t,s)||vb()}function xb(t,s){if(t){if(typeof t=="string")return Tm(t,s);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)?Tm(t,s):void 0}}const Gv=Object.entries,Nm=Object.setPrototypeOf,wb=Object.isFrozen,kb=Object.getPrototypeOf,Sb=Object.getOwnPropertyDescriptor;let rn=Object.freeze,on=Object.seal,gi=Object.create,Kv=typeof Reflect<"u"&&Reflect,ad=Kv.apply,ld=Kv.construct;rn||(rn=function(s){return s});on||(on=function(s){return s});ad||(ad=function(s,r){for(var o=arguments.length,l=new Array(o>2?o-2:0),u=2;u<o;u++)l[u-2]=arguments[u];return s.apply(r,l)});ld||(ld=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return new s(...o)});const pi=Pt(Array.prototype.forEach),bb=Pt(Array.prototype.lastIndexOf),jm=Pt(Array.prototype.pop),hi=Pt(Array.prototype.push),Tb=Pt(Array.prototype.splice),ur=Array.isArray,vo=Pt(String.prototype.toLowerCase),zu=Pt(String.prototype.toString),Cm=Pt(String.prototype.match),po=Pt(String.prototype.replace),Em=Pt(String.prototype.indexOf),Nb=Pt(String.prototype.trim),jb=Pt(Number.prototype.toString),Cb=Pt(Boolean.prototype.toString),_m=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Rm=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),Zt=Pt(Object.prototype.hasOwnProperty),ho=Pt(Object.prototype.toString),Qt=Pt(RegExp.prototype.test),Lr=Eb(TypeError);function Pt(t){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return ad(t,s,o)}}function Eb(t){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return ld(t,r)}}function He(t,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vo;if(Nm&&Nm(t,null),!ur(s))return t;let o=s.length;for(;o--;){let l=s[o];if(typeof l=="string"){const u=r(l);u!==l&&(wb(s)||(s[o]=u),l=u)}t[l]=!0}return t}function _b(t){for(let s=0;s<t.length;s++)Zt(t,s)||(t[s]=null);return t}function pn(t){const s=gi(null);for(const o of Gv(t)){var r=yb(o,2);const l=r[0],u=r[1];Zt(t,l)&&(ur(u)?s[l]=_b(u):u&&typeof u=="object"&&u.constructor===Object?s[l]=pn(u):s[l]=u)}return s}function Rb(t){switch(typeof t){case"string":return t;case"number":return jb(t);case"boolean":return Cb(t);case"bigint":return _m?_m(t):"0";case"symbol":return Rm?Rm(t):"Symbol()";case"undefined":return ho(t);case"function":case"object":{if(t===null)return ho(t);const s=t,r=ls(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:ho(o)}return ho(t)}default:return ho(t)}}function ls(t,s){for(;t!==null;){const o=Sb(t,s);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}t=kb(t)}function r(){return null}return r}function Ab(t){try{return Qt(t,""),!0}catch{return!1}}const Am=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"]),Fu=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"]),Uu=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"]),Ib=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"]),Bu=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"]),Mb=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Im=rn(["#text"]),Mm=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"]),Wu=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"]),Dm=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"]),Za=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Db=on(/{{[\w\W]*|^[\w\W]*}}/g),Lb=on(/<%[\w\W]*|^[\w\W]*%>/g),Ob=on(/\${[\w\W]*/g),Pb=on(/^data-[\-\w.\u00B7-\uFFFF]+$/),$b=on(/^aria-[\-\w]+$/),Lm=on(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zb=on(/^(?:\w+script|data):/i),Fb=on(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ub=on(/^html$/i),Bb=on(/^[a-z][.\w]*(-[.\w]+)+$/i),Om=on(/<[/\w!]/g),Pm=on(/<[/\w]/g),Wb=on(/<\/no(script|embed|frames)/i),Hb=on(/\/>/i),Wn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vb=function(){return typeof window>"u"?null:window},Gb=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(o=r.getAttribute(l));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(d){return d},createScriptURL(d){return d}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},$m=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lr=function(s,r,o,l){return Zt(s,r)&&ur(s[r])?He(l.base?pn(l.base):{},s[r],l.transform):o};function qv(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vb();const s=le=>qv(le);if(s.version="3.4.13",s.removed=[],!t||!t.document||t.document.nodeType!==Wn.document||!t.Element)return s.isSupported=!1,s;let r=t.document;const o=r,l=o.currentScript;t.DocumentFragment;const u=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=ls(y,"cloneNode"),N=ls(y,"remove"),E=ls(y,"nextSibling"),T=ls(y,"childNodes"),I=ls(y,"parentNode"),R=ls(y,"shadowRoot"),U=ls(y,"attributes"),A=d&&d.prototype?ls(d.prototype,"nodeType"):null,L=d&&d.prototype?ls(d.prototype,"nodeName"):null,q=d&&d.prototype?ls(d.prototype,"ownerDocument"):null;if(typeof u=="function"){const le=r.createElement("template");le.content&&le.content.ownerDocument&&(r=le.content.ownerDocument)}let K,$="",ne,pe=!1,G=0;const ve=function(){if(G>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.')},we=function(b){ve(),G++;try{return K.createHTML(b)}finally{G--}},Oe=function(b){ve(),G++;try{return K.createScriptURL(b)}finally{G--}},te=function(){return pe||(ne=Gb(k,l),pe=!0),ne},oe=r,ae=oe.implementation,z=oe.createNodeIterator,Q=oe.createDocumentFragment,W=oe.getElementsByTagName,C=o.importNode;let P=$m();s.isSupported=typeof Gv=="function"&&typeof I=="function"&&ae&&ae.createHTMLDocument!==void 0;const se=Db,de=Lb,X=Ob,fe=Pb,Te=$b,Ee=zb,Re=Fb,Ce=Bb;let at=Lm,Me=null;const lt=He({},[...Am,...Fu,...Uu,...Bu,...Im]);let $e=null;const en=He({},[...Mm,...Wu,...Dm,...Za]);let Fe=Object.seal(gi(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}})),Ht=null,tn=null;const wt=Object.seal(gi(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jt=!0,$t=!0,Dt=!1,Y=!0,he=!1,Ue=!0,tt=!1,mt=!1,gt=null,Ct=null,an=!1,dt=!1,Mn=!1,Dn=!1,ps=!0,hs=!1;const ts="user-content-";let Ln=!0,gn=!1,ln={},Vt=null;const vn=He({},["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 Xe=null;const Et=He({},["audio","video","img","source","image","track"]);let ft=null;const Gt=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",yt="http://www.w3.org/2000/svg",it="http://www.w3.org/1999/xhtml";let Kt=it,st=!1,Lt=null;const _=He({},[vt,yt,it],zu),ue=rn(["mi","mo","mn","ms","mtext"]);let ie=He({},ue);const ye=rn(["annotation-xml"]);let De=He({},ye);const Ge=He({},["title","style","font","a","script"]);let Le=null;const zt=["application/xhtml+xml","text/html"],On="text/html";let Be=null,yn=null;const Cs=r.createElement("form"),Us=function(b){return b instanceof RegExp||b instanceof Function},Pn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yn&&yn===b)return;(!b||typeof b!="object")&&(b={}),b=pn(b),Le=zt.indexOf(b.PARSER_MEDIA_TYPE)===-1?On:b.PARSER_MEDIA_TYPE,Be=Le==="application/xhtml+xml"?zu:vo,Me=lr(b,"ALLOWED_TAGS",lt,{transform:Be}),$e=lr(b,"ALLOWED_ATTR",en,{transform:Be}),Lt=lr(b,"ALLOWED_NAMESPACES",_,{transform:zu}),ft=lr(b,"ADD_URI_SAFE_ATTR",Gt,{transform:Be,base:Gt}),Xe=lr(b,"ADD_DATA_URI_TAGS",Et,{transform:Be,base:Et}),Vt=lr(b,"FORBID_CONTENTS",vn,{transform:Be}),Ht=lr(b,"FORBID_TAGS",pn({}),{transform:Be}),tn=lr(b,"FORBID_ATTR",pn({}),{transform:Be}),ln=Zt(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?pn(b.USE_PROFILES):b.USE_PROFILES:!1,jt=b.ALLOW_ARIA_ATTR!==!1,$t=b.ALLOW_DATA_ATTR!==!1,Dt=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,he=b.SAFE_FOR_TEMPLATES||!1,Ue=b.SAFE_FOR_XML!==!1,tt=b.WHOLE_DOCUMENT||!1,dt=b.RETURN_DOM||!1,Mn=b.RETURN_DOM_FRAGMENT||!1,Dn=b.RETURN_TRUSTED_TYPE||!1,an=b.FORCE_BODY||!1,ps=b.SANITIZE_DOM!==!1,hs=b.SANITIZE_NAMED_PROPS||!1,Ln=b.KEEP_CONTENT!==!1,gn=b.IN_PLACE||!1,at=Ab(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Lm,Kt=typeof b.NAMESPACE=="string"?b.NAMESPACE:it,ie=Zt(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?pn(b.MATHML_TEXT_INTEGRATION_POINTS):He({},ue),De=Zt(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?pn(b.HTML_INTEGRATION_POINTS):He({},ye);const F=Zt(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?pn(b.CUSTOM_ELEMENT_HANDLING):gi(null);if(Fe=gi(null),Zt(F,"tagNameCheck")&&Us(F.tagNameCheck)&&(Fe.tagNameCheck=F.tagNameCheck),Zt(F,"attributeNameCheck")&&Us(F.attributeNameCheck)&&(Fe.attributeNameCheck=F.attributeNameCheck),Zt(F,"allowCustomizedBuiltInElements")&&typeof F.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=F.allowCustomizedBuiltInElements),on(Fe),he&&($t=!1),Mn&&(dt=!0),ln&&(Me=He({},Im),$e=gi(null),ln.html===!0&&(He(Me,Am),He($e,Mm)),ln.svg===!0&&(He(Me,Fu),He($e,Wu),He($e,Za)),ln.svgFilters===!0&&(He(Me,Uu),He($e,Wu),He($e,Za)),ln.mathMl===!0&&(He(Me,Bu),He($e,Dm),He($e,Za))),wt.tagCheck=null,wt.attributeCheck=null,Zt(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?wt.tagCheck=b.ADD_TAGS:ur(b.ADD_TAGS)&&(Me===lt&&(Me=pn(Me)),He(Me,b.ADD_TAGS,Be))),Zt(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?wt.attributeCheck=b.ADD_ATTR:ur(b.ADD_ATTR)&&($e===en&&($e=pn($e)),He($e,b.ADD_ATTR,Be))),Zt(b,"ADD_URI_SAFE_ATTR")&&ur(b.ADD_URI_SAFE_ATTR)&&He(ft,b.ADD_URI_SAFE_ATTR,Be),Zt(b,"FORBID_CONTENTS")&&ur(b.FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),He(Vt,b.FORBID_CONTENTS,Be)),Zt(b,"ADD_FORBID_CONTENTS")&&ur(b.ADD_FORBID_CONTENTS)&&(Vt===vn&&(Vt=pn(Vt)),He(Vt,b.ADD_FORBID_CONTENTS,Be)),Ln&&(Me["#text"]=!0),tt&&He(Me,["html","head","body"]),Me.table&&(He(Me,["tbody"]),delete Ht.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=K;K=b.TRUSTED_TYPES_POLICY;try{$=we("")}catch(Se){throw K=Z,Se}}else b.TRUSTED_TYPES_POLICY===null?(K=void 0,$=""):(K===void 0&&(K=te()),K&&typeof $=="string"&&($=we("")));rn&&rn(b),yn=b},ms=He({},[...Fu,...Uu,...Ib]),Qe=He({},[...Bu,...Mb]),_t=function(b,F,Z){return F.namespaceURI===it?b==="svg":F.namespaceURI===vt?b==="svg"&&(Z==="annotation-xml"||ie[Z]):!!ms[b]},gs=function(b,F,Z){return F.namespaceURI===it?b==="math":F.namespaceURI===yt?b==="math"&&De[Z]:!!Qe[b]},Hl=function(b,F,Z){return F.namespaceURI===yt&&!De[Z]||F.namespaceURI===vt&&!ie[Z]?!1:!Qe[b]&&(Ge[b]||!ms[b])},kt=function(b){let F=I(b);(!F||!F.tagName)&&(F={namespaceURI:Kt,tagName:"template"});const Z=vo(b.tagName),Se=vo(F.tagName);return Lt[b.namespaceURI]?b.namespaceURI===yt?_t(Z,F,Se):b.namespaceURI===vt?gs(Z,F,Se):b.namespaceURI===it?Hl(Z,F,Se):!!(Le==="application/xhtml+xml"&&Lt[b.namespaceURI]):!1},vs=function(b){hi(s.removed,{element:b});try{I(b).removeChild(b)}catch{if(N(b),!I(b))throw Lr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Bs=function(b){gr(b);const F=T(b);if(F){const Se=[];pi(F,je=>{hi(Se,je)}),pi(Se,je=>{try{N(je)}catch{}})}const Z=U(b);if(Z)for(let Se=Z.length-1;Se>=0;--Se){const je=Z[Se],ze=je&&je.name;if(typeof ze=="string")try{b.removeAttribute(ze)}catch{}}},ys=function(b,F){try{hi(s.removed,{attribute:F.getAttributeNode(b),from:F})}catch{hi(s.removed,{attribute:null,from:F})}if(F.removeAttribute(b),b==="is")if(dt||Mn)try{vs(F)}catch{}else try{F.setAttribute(b,"")}catch{}},Ur=function(b){const F=U(b);if(F)for(let Z=F.length-1;Z>=0;--Z){const Se=F[Z],je=Se&&Se.name;if(!(typeof je!="string"||$e[Be(je)]))try{b.removeAttribute(je)}catch{}}},gr=function(b){const F=[b];for(;F.length>0;){const Z=F.pop();(A?A(Z):Z.nodeType)===Wn.element&&Ur(Z);const je=T(Z);if(je)for(let ze=je.length-1;ze>=0;--ze)F.push(je[ze])}},Fo=function(b){if(!Ue)return;const F=[b];for(;F.length>0;){const Z=F.pop(),Se=A?A(Z):Z.nodeType;if(Se===Wn.processingInstruction||Se===Wn.comment&&Qt(Pm,Z.data)){try{N(Z)}catch{}continue}if(Se===Wn.element){const ze=Z,qe=Be(L?L(Z):Z.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&qe!=="label"&&qe!=="output"&&ze.removeAttribute("for")}catch{}}const je=T(Z);if(je)for(let ze=je.length-1;ze>=0;--ze)F.push(je[ze])}},vr=function(b){let F=null,Z=null;if(an)b="<remove></remove>"+b;else{const ze=Cm(b,/^[\r\n\t ]+/);Z=ze&&ze[0]}Le==="application/xhtml+xml"&&Kt===it&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Se=K?we(b):b;if(Kt===it)try{F=new v().parseFromString(Se,Le)}catch{}if(!F||!F.documentElement){F=ae.createDocument(Kt,"template",null);try{F.documentElement.innerHTML=st?$:Se}catch{}}const je=F.body||F.documentElement;return b&&Z&&je.insertBefore(r.createTextNode(Z),je.childNodes[0]||null),Kt===it?W.call(F,tt?"html":"body")[0]:tt?F.documentElement:je},$n=function(b){const F=q?q(b):b.ownerDocument;return z.call(F||b,b,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Br=function(b){return b=po(b,se," "),b=po(b,de," "),b=po(b,X," "),b},xn=function(b){var F;b.normalize();const Z=q?q(b):b.ownerDocument,Se=z.call(Z||b,b,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let je=Se.nextNode();for(;je;)je.data=Br(je.data),je=Se.nextNode();const ze=(F=b.querySelectorAll)===null||F===void 0?void 0:F.call(b,"template");ze&&pi(ze,qe=>{Ws(qe.content)&&xn(qe.content)})},Wr=function(b){const F=L?L(b):null;return typeof F!="string"||Be(F)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==U(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==A(b)||b.childNodes!==T(b)},Ws=function(b){if(!A||typeof b!="object"||b===null)return!1;try{return A(b)===Wn.documentFragment}catch{return!1}},yr=function(b){if(!A||typeof b!="object"||b===null)return!1;try{return typeof A(b)=="number"}catch{return!1}};function wn(le,b,F){le.length!==0&&pi(le,Z=>{Z.call(s,b,F,yn)})}const Hr=function(b,F){return!!(Ue&&b.hasChildNodes()&&!yr(b.firstElementChild)&&Qt(Om,b.textContent)&&Qt(Om,b.innerHTML)||Ue&&b.namespaceURI===it&&F==="style"&&yr(b.firstElementChild)||b.nodeType===Wn.processingInstruction||Ue&&b.nodeType===Wn.comment&&Qt(Pm,b.data))},xr=function(b,F,Z){if(!Ht[F]&&Ai(F)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,F)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(F)))return!1;if(Ln&&!Vt[F]){const Se=I(b),je=T(b);if(je&&Se){const ze=je.length;for(let qe=ze-1;qe>=0;--qe){const Ze=b===Z?S(je[qe],!0):je[qe];Se.insertBefore(Ze,E(b))}}}return vs(b),!0},wr=function(b,F,Z,Se){return b.length===0?F:F===Z||F===Se?pn(F):F},Uo=function(b,F){if(wn(P.beforeSanitizeElements,b,null),b!==F&&I(b)===null)return gn&&gr(b),!0;if(Wr(b))return vs(b),!0;const Z=Be(L?L(b):b.nodeName);if(Me=wr(P.uponSanitizeElement,Me,lt,gt),wn(P.uponSanitizeElement,b,{tagName:Z,allowedTags:Me}),b!==F&&I(b)===null)return gn&&gr(b),!0;if(Hr(b,Z))return vs(b),!0;if(Ht[Z]||!(wt.tagCheck instanceof Function&&wt.tagCheck(Z))&&!Me[Z]){const je=xr(b,Z,F);return je===!1&&wn(P.afterSanitizeElements,b,null),je}if((A?A(b):b.nodeType)===Wn.element&&!kt(b)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Qt(Wb,b.innerHTML))return vs(b),!0;if(he&&b.nodeType===Wn.text){const je=Br(b.textContent);b.textContent!==je&&(hi(s.removed,{element:b.cloneNode()}),b.textContent=je)}return wn(P.afterSanitizeElements,b,null),!1},Bo=function(b,F,Z){if(tn[F]||Ue&&F==="patchsrc"||Ue&&F==="for"&&b!=="label"&&b!=="output"||ps&&(F==="id"||F==="name")&&(Z in r||Z in Cs))return!1;const Se=$e[F]||wt.attributeCheck instanceof Function&&wt.attributeCheck(F,b);if(!($t&&Qt(fe,F))){if(!(jt&&Qt(Te,F))){if(Se){if(!ft[F]){if(!Qt(at,po(Z,Re,""))){if(!((F==="src"||F==="xlink:href"||F==="href")&&b!=="script"&&Em(Z,"data:")===0&&Xe[b])){if(!(Dt&&!Qt(Ee,po(Z,Re,"")))){if(Z)return!1}}}}}else if(!(Ai(b)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,b)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(b))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,F)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(F,b))||F==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,Z)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Z))))return!1}}return!0},Ri=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ai=function(b){return!Ri[vo(b)]&&Qt(Ce,b)},Ii=function(b,F,Z,Se){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Z)switch(k.getAttributeType(b,F)){case"TrustedHTML":return we(Se);case"TrustedScriptURL":return Oe(Se)}return Se},kr=function(b,F,Z,Se){try{Z?b.setAttributeNS(Z,F,Se):b.setAttribute(F,Se),Wr(b)?vs(b):jm(s.removed)}catch{ys(F,b)}},Wo=function(b){wn(P.beforeSanitizeAttributes,b,null);const F=b.attributes;if(!F||Wr(b))return;$e=wr(P.uponSanitizeAttribute,$e,en,Ct);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let Se=F.length;const je=Be(b.nodeName);for(;Se--;){const ze=F[Se],qe=ze.name,Ze=ze.namespaceURI,St=ze.value,bt=Be(qe),Es=St;let At=qe==="value"?Es:Nb(Es);if(Z.attrName=bt,Z.attrValue=At,Z.keepAttr=!0,Z.forceKeepAttr=void 0,wn(P.uponSanitizeAttribute,b,Z),At=Z.attrValue,hs&&(bt==="id"||bt==="name")&&Em(At,ts)!==0&&(ys(qe,b),At=ts+At),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){ys(qe,b);continue}if(bt==="attributename"&&Cm(At,"href")){ys(qe,b);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){ys(qe,b);continue}if(!Y&&Qt(Hb,At)){ys(qe,b);continue}if(he&&(At=Br(At)),!Bo(je,bt,At)){ys(qe,b);continue}At=Ii(je,bt,Ze,At),At!==Es&&kr(b,qe,Ze,At)}}wn(P.afterSanitizeAttributes,b,null)},Hs=function(b){let F=null;const Z=$n(b);for(wn(P.beforeSanitizeShadowDOM,b,null);F=Z.nextNode();)if(wn(P.uponSanitizeShadowNode,F,null),Uo(F,b),Wo(F),Ws(F.content)&&Hs(F.content),(A?A(F):F.nodeType)===Wn.element){const je=R(F);Ws(je)&&(Ke(je),Hs(je))}wn(P.afterSanitizeShadowDOM,b,null)},Ke=function(b){const F=[{node:b,shadow:null}];for(;F.length>0;){const Z=F.pop();if(Z.shadow){Hs(Z.shadow);continue}const Se=Z.node,ze=(A?A(Se):Se.nodeType)===Wn.element,qe=T(Se);if(qe)for(let Ze=qe.length-1;Ze>=0;--Ze)F.push({node:qe[Ze],shadow:null});if(ze){const Ze=L?L(Se):null;if(typeof Ze=="string"&&Be(Ze)==="template"){const St=Se.content;Ws(St)&&F.push({node:St,shadow:null})}}if(ze){const Ze=R(Se);Ws(Ze)&&F.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return s.sanitize=function(le){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},F=null,Z=null,Se=null,je=null;if(st=!le,st&&(le="<!-->"),typeof le!="string"&&!yr(le)&&(le=Rb(le),typeof le!="string"))throw Lr("dirty is not a string, aborting");if(!s.isSupported)return le;mt?(Me=gt,$e=Ct):Pn(b),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(Me=pn(Me)),P.uponSanitizeAttribute.length>0&&($e=pn($e)),s.removed=[];const ze=gn&&typeof le!="string"&&yr(le);if(ze){Fo(le);const St=L?L(le):le.nodeName;if(typeof St=="string"){const bt=Be(St);if(!Me[bt]||Ht[bt])throw Bs(le),Lr("root node is forbidden and cannot be sanitized in-place")}if(Wr(le))throw Bs(le),Lr("root node is clobbered and cannot be sanitized in-place");try{Ke(le)}catch(bt){throw Bs(le),bt}}else if(yr(le))F=vr("<!---->"),Z=F.ownerDocument.importNode(le,!0),Z.nodeType===Wn.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?F=Z:F.appendChild(Z),Ke(Z);else{if(!dt&&!he&&!tt&&le.indexOf("<")===-1)return K&&Dn?we(le):le;if(F=vr(le),!F)return dt?null:Dn?$:""}F&&an&&vs(F.firstChild);const qe=ze?le:F;try{const St=$n(qe);for(;Se=St.nextNode();)Uo(Se,qe),Wo(Se),Ws(Se.content)&&Hs(Se.content)}catch(St){throw ze&&(Bs(le),pi(s.removed,bt=>{bt.element&&gr(bt.element)})),St}if(ze)return pi(s.removed,St=>{St.element&&gr(St.element)}),he&&xn(le),le;if(dt){if(he&&xn(F),Mn)for(je=Q.call(F.ownerDocument);F.firstChild;)je.appendChild(F.firstChild);else je=F;return($e.shadowroot||$e.shadowrootmode)&&(je=C.call(o,je,!0)),je}let Ze=tt?F.outerHTML:F.innerHTML;return tt&&Me["!doctype"]&&F.ownerDocument&&F.ownerDocument.doctype&&F.ownerDocument.doctype.name&&Qt(Ub,F.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+F.ownerDocument.doctype.name+`>
490
+ `+Ze),he&&(Ze=Br(Ze)),K&&Dn?we(Ze):Ze},s.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pn(le),mt=!0,gt=Me,Ct=$e},s.clearConfig=function(){yn=null,mt=!1,gt=null,Ct=null,K=ne,$=""},s.isValidAttribute=function(le,b,F){yn||Pn({});const Z=Be(le),Se=Be(b);return Bo(Z,Se,F)},s.addHook=function(le,b){typeof b=="function"&&Zt(P,le)&&hi(P[le],b)},s.removeHook=function(le,b){if(Zt(P,le)){if(b!==void 0){const F=bb(P[le],b);return F===-1?void 0:Tb(P[le],F,1)[0]}return jm(P[le])}},s.removeHooks=function(le){Zt(P,le)&&(P[le]=[])},s.removeAllHooks=function(){P=$m()},s}var Kd=qv();const Kb=new Set(["command_execution","file_change","mcp_tool_call","web_search"]),qb=100;function zm(t){return Kb.has(t.type)}function Yb({items:t,runtimeType:s,turn:r,threads:o=[]}){const[l,u]=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-qb),v=m>0?t.slice(m):t;return a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>u(k=>!k),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(Ek,{size:12})}),a.jsxs("span",{className:"tool-calls-summary",children:[g," tool call",g>1?"s":""]}),a.jsx(Eo,{size:14,className:"tool-calls-chevron",style:{transform:l?"rotate(90deg)":"none"}})]}),l&&a.jsxs("div",{className:"tool-calls-body",children:[m>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>p(!0),children:["Show ",m," earlier tool call",m>1?"s":""]})}),v.map(k=>a.jsx(Ps,{item:k,runtimeType:s,turn:r,threads:o},k.id))]})]})}Ve.setOptions({breaks:!0,gfm:!0});function Xb(t){const s=Ve.parse(t);return Kd.sanitize(s)}function Fm(t,s){var l;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,d=((l=u.textContent)==null?void 0:l.length)??0;if(o+d>s)return{node:u,offset:s-o};o+=d}return null}function Qb(t,s,r){const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),l=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const d=document.createRange();d.selectNodeContents(u),!(d.compareBoundaryPoints(Range.START_TO_END,s)<=0)&&(d.compareBoundaryPoints(Range.END_TO_START,s)>=0||l.push(u))}for(const u of l){const d=u.length;let p=0,g=d;if(u===s.startContainer&&(p=Math.min(s.startOffset,d)),u===s.endContainer&&(g=Math.min(s.endOffset,d)),p>=g)continue;g<d&&u.splitText(g);const m=p>0?u.splitText(p):u,v=r(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function Zb(t,s){t.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const l=document.createTextNode(r.textContent||"");o.replaceChild(l,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Fm(t,r.start_offset),l=Fm(t,r.end_offset);if(!o||!l)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(l.node,l.offset),Qb(t,u,()=>{const d=document.createElement("mark");return d.setAttribute("data-thread-id",r.id),r.status==="resolved"&&d.classList.add("thread-mark-resolved"),d})}}function Jb(t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.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 l=o.toString().length,u=r.toString();return{start:l,end:l+u.length,text:u}}function eT({itemId:t,turnId:s,sessionId:r,content:o,threads:l}){const u=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}),[N,E]=x.useState(!1),[T,I]=x.useState({x:0,y:0}),[R,U]=x.useState(""),[A,L]=x.useState(null),[q,K]=x.useState(!1),$=M(W=>W.createThread),ne=M(W=>W.switchRightTab),pe=M(W=>Al(W.sessionDetails[r])),G=x.useCallback(async()=>{await bl(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),ve=x.useCallback(()=>{var C;if(!A)return;const W=`
491
+ \`\`\`QUOTE
492
+ ${A.text}
493
+ \`\`\`
494
+
495
+ `;M.setState({quotedText:W}),k(!1),L(null),(C=window.getSelection())==null||C.removeAllRanges()},[A]),we=x.useMemo(()=>Xb(o||"…"),[o]),Oe=x.useMemo(()=>l.filter(W=>W.item_id===t),[l,t]);x.useEffect(()=>{u.current&&Zb(u.current,Oe)},[we,Oe]),x.useEffect(()=>{g.current=R},[R]),x.useEffect(()=>{function W(C){d.current&&!d.current.contains(C.target)&&(k(!1),g.current.trim()||E(!1))}return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[]);const te=x.useCallback(()=>{k(!1),g.current.trim()||E(!1)},[]),oe=x.useCallback(()=>{const W=u.current;if(!W)return;const C=Jb(W);if(C&&C.text.trim().length>0){const P=window.getSelection();if(P&&P.rangeCount>0&&P.anchorNode&&P.focusNode){const de=P.getRangeAt(0).getBoundingClientRect(),X=28,fe=6,Te=170;let Ee=!1;try{const at=document.createRange();at.setStart(P.focusNode,P.focusOffset),at.setEnd(P.focusNode,P.focusOffset);const Me=document.createRange();Me.setStart(P.anchorNode,P.anchorOffset),Me.setEnd(P.anchorNode,P.anchorOffset),Ee=Me.compareBoundaryPoints(Range.START_TO_START,at)>0}catch{Ee=!1}let Re=de.top-X-fe;Re<8&&(Re=de.bottom+fe);let Ce=Ee?de.left-Te:de.right;Ce=Math.max(8,Math.min(Ce,window.innerWidth-Te-8)),S({x:Ce,y:Re}),k(!0),L(C)}}else k(!1)},[]);x.useEffect(()=>{function W(C){const P=C.target;P&&(P.closest(".selection-actions")||P.closest(".thread-create-popover"))||oe()}return document.addEventListener("mouseup",W),()=>document.removeEventListener("mouseup",W)},[oe]);const ae=x.useCallback(()=>{k(!1),E(!0),I({x:y.x,y:y.y})},[y]);x.useLayoutEffect(()=>{if(!N)return;const W=p.current;if(!W)return;const C=W.offsetWidth,P=W.offsetHeight,se=8;let de=y.x,X=y.y;de-C<se&&(de=C+se),de>window.innerWidth-se&&(de=window.innerWidth-se),X<se&&(X=se),X+P>window.innerHeight-se&&(X=window.innerHeight-P-se),I({x:de,y:X})},[N,y]);const z=x.useCallback(async()=>{var W;pe||!A||!R.trim()||(await $(r,{itemId:t,turnId:s,startOffset:A.start,endOffset:A.end,selectedText:A.text,message:R.trim()}),U(""),E(!1),L(null),(W=window.getSelection())==null||W.removeAllRanges(),ne("threads"))},[A,R,$,r,t,s,ne,pe]),Q=x.useCallback(W=>{const C=W.target;if(C.tagName==="MARK"&&C.hasAttribute("data-thread-id")){W.preventDefault(),ne("threads");const P=C.getAttribute("data-thread-id");setTimeout(()=>{const se=document.getElementById(`thread-${P}`);se&&(se.scrollIntoView({behavior:"smooth",block:"center"}),se.classList.add("thread-card-highlighted"),setTimeout(()=>se.classList.remove("thread-card-highlighted"),1500))},100)}},[ne]);return a.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:d,children:[a.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:we},onMouseDown:te,onClick:Q}),a.jsx("button",{className:`copy-text-btn${q?" copied":""}`,onClick:G,title:q?"Copied":"Copy message","aria-label":"Copy message text",children:q?a.jsx(Ts,{size:14}):a.jsx(hl,{size:14})}),v&&!N&&a.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!pe&&a.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[a.jsx(fk,{size:14}),a.jsx("span",{children:"Discuss"})]}),a.jsxs("button",{className:"discuss-button",onClick:ve,title:"Quote this text in your message",children:[a.jsx(Jg,{size:14}),a.jsx("span",{children:"Quote"})]})]}),N&&a.jsxs("div",{ref:p,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[a.jsxs("div",{className:"thread-create-header",children:[a.jsxs("span",{className:"thread-create-quote",children:['"',A==null?void 0:A.text.slice(0,80),A&&A.text.length>80?"…":"",'"']}),a.jsx("button",{className:"thread-create-close",onClick:()=>{E(!1),L(null)},children:a.jsx(Tn,{size:14})})]}),a.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:R,onChange:W=>U(W.target.value),autoFocus:!0,rows:2,onKeyDown:W=>{if(W.key==="Enter"&&(W.metaKey||W.ctrlKey)&&(W.preventDefault(),z()),W.key==="Escape")if(g.current.trim()){const C=Date.now();m.current&&C-m.current<400?(m.current=0,E(!1),L(null)):m.current=C}else E(!1),L(null)}}),a.jsxs("div",{className:"thread-create-footer",children:[a.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),a.jsxs("button",{className:"thread-create-send",onClick:z,disabled:!R.trim()||pe,title:pe?"Wait for the running turn to finish first":void 0,children:[a.jsx(Do,{size:13}),a.jsx("span",{children:"Send"})]})]})]})]})}const Um=x.memo(eT),El=new Map,Yv=new Set,cd=new Set,Bm=new Map;function Xv(){cd.forEach(t=>t())}function Qv(t,s){return`${t}:${s}`}function tT(t,s,r,o,l){var g;const u=Qv(s,r),d=El.get(t)??new Map,p=new Map(d);((g=p.get(u))==null?void 0:g.answer)===l?p.delete(u):p.set(u,{itemIndex:s,groupIndex:r,question:o,answer:l}),El.set(t,p),Xv()}function nT(t){El.delete(t),Xv()}function sT(t){Yv.add(t),nT(t)}function rT(t){const s=x.useCallback(r=>(cd.add(r),()=>{cd.delete(r)}),[]);return x.useSyncExternalStore(s,()=>El.get(t)??Bm,()=>Bm)}function iT(t){return[...t].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
496
+ ${s.answer}`).join(`
497
+
498
+ `)}function Wm({item:t,turn:s}){var S;const r=t.data??{},o=x.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(N=>!!N&&Array.isArray(N.selections)&&N.selections.length>0):[],[r.groups]),l=rT(s.id),u=M(N=>s.session_id?N.sessionDetails[s.session_id]:null),d=M(N=>N.activeSessionId),p=s.items.findIndex(N=>N.id===t.id),g=u?((S=u.turns[u.turns.length-1])==null?void 0:S.id)===s.id:!0,m=Yv.has(s.id),v=m||Cg(u)||!g||s.session_id!==d,k=(N,E,T)=>{v||tT(s.id,p,N,E,T)},y=()=>{const N=[...l.values()];if(N.length===0)return;const E=iT(N);sT(s.id),M.getState().submitPrompt(E)};return a.jsxs("div",{className:"render-content ask-user-card",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(Qw,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Question"}),m&&a.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?a.jsxs("div",{className:"ask-user-groups",children:[o.map((N,E)=>a.jsxs("div",{className:"ask-user-group",children:[N.question&&a.jsx("div",{className:"ask-user-question",children:N.question}),a.jsx("div",{className:"ask-user-options",children:N.selections.map(T=>{var R;const I=((R=l.get(Qv(p,E)))==null?void 0:R.answer)===T;return a.jsx("button",{type:"button",className:`ask-user-option ${I?"selected":""}`,disabled:v,onClick:()=>k(E,N.question,T),children:T},T)})})]},E)),v?m&&a.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):a.jsxs("button",{type:"button",className:"ask-user-send",disabled:l.size===0,onClick:y,children:[a.jsx(Do,{size:12}),"Send"]})]}):r.question?a.jsx("p",{className:"user-message",children:r.question}):a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const oT={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function yo(t){return t&&oT[t]||"interrupted"}function _l(t){if(!t)return"";const s=new Date(t);return Number.isNaN(s.getTime())?"":s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function aT(t){switch(t){case"network":return"Interrupted — network error. Will resume when the connection is back.";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 lT(t){return t.items.filter(s=>s.type==="interruption").map(s=>s.data)}function cT({item:t}){const s=t.data,r=_l(s.interrupted_at);let o="";switch(s.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=s.resumed_at?`resumed ${_l(s.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return a.jsx("div",{className:"interruption-marker",title:s.detail??void 0,children:a.jsxs("span",{children:["Interrupted",r?` ${r}`:""," (",yo(s.reason),") · ",o]})})}function uT({turn:t,label:s}){const[r,o]=x.useState(!1),l=M(d=>d.addToast),u=()=>{o(!0),f0(t.session_id,t.id).catch(d=>l("error",`Could not resume the turn — ${d.message}`)).finally(()=>o(!1))};return a.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:r,children:[a.jsx(ev,{size:12}),s]})}function dT({turn:t}){const s=t.resume_state;if(!s||s==="cancelled")return null;const r=t.interrupt_reason,o=lT(t),l=o[o.length-1],u=_l(t.interrupted_at??(l==null?void 0:l.interrupted_at));if(s==="resumed"){const m=_l(l==null?void 0:l.resumed_at),v=t.status==="running"||t.status==="pending";return a.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(ev,{size:12})}),a.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",yo(r),") · resumed",m?` ${m}`:"",v?" — continuing…":""]})]})}let d,p=null,g=null;switch(s){case"waiting":d=aT(r),g="Resume now";break;case"resuming":d=`Interrupted (${yo(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${u?` ${u}`:""} (${yo(r)}) — too long ago to resume automatically.`,g="Resume";break;default:d=`Interrupted (${yo(r)}) — this turn cannot be resumed.`,p=t.error}return a.jsxs("div",{className:"interruption-banner","data-state":s,children:[a.jsx("span",{className:"banner-icon",children:r==="network"?a.jsx(rv,{size:12}):a.jsx(Ll,{size:12})}),a.jsxs("span",{className:"banner-text",children:[d,p&&a.jsx("span",{className:"banner-detail",children:p})]}),g&&a.jsx(uT,{turn:t,label:g})]})}function fT({turnId:t}){const s=M(o=>o.retryStates[t]);if(!s)return null;const r=s.errorStatus?`API error ${s.errorStatus}`:"Connection problem";return a.jsxs("div",{className:"retry-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(rv,{size:12})}),a.jsxs("span",{className:"banner-text",children:[r," — retrying (attempt ",s.attempt," of ",s.maxRetries,")…"]})]})}Ve.setOptions({breaks:!0,gfm:!0});const pT=10,hT=100;function mT({attachments:t}){const[s,r]=x.useState(null);return x.useEffect(()=>{if(!s)return;function o(l){l.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!Array.isArray(t)||t.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"attachment-pills",children:t.map((o,l)=>{const u=o.media_type.startsWith("image/"),d=`data:${o.media_type};base64,${o.data}`;return a.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>r(d):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?a.jsx("img",{src:d,alt:o.name,className:"attachment-pill-thumb"}):a.jsx(Kg,{size:12,className:"attachment-pill-icon"}),a.jsx("span",{className:"attachment-pill-name",children:o.name})]},l)})}),s&&a.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:a.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[a.jsx("img",{src:s,alt:"preview"}),a.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:a.jsx(Tn,{size:20})})]})})]})}function gT(t){const s=Ve.parse(t);return Kd.sanitize(s)}function Hm(t){var s;return(s=t.data)!=null&&s.text?t.data.text:""}function vT(t){const s=t.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:t}const Vm='<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 yT(t){return/<\/body>/i.test(t)?t.replace(/<\/body>/i,`${Vm}</body>`):t+Vm}function xT({html:t}){const[s,r]=x.useState(480),o=x.useRef(null);return x.useEffect(()=>{function l(u){var d;u.source===((d=o.current)==null?void 0:d.contentWindow)&&typeof u.data=="number"&&u.data>0&&r(u.data)}return window.addEventListener("message",l),()=>window.removeEventListener("message",l)},[]),a.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:yT(t),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const Gm=1e4;function wT({item:t,runtimeType:s,turn:r,threads:o}){var p,g,m,v,k,y,S,N;const l=t.status==="in_progress",[u,d]=x.useState(!1);switch(t.type){case"agent_message":{const{iconClass:E,iconText:T}=Qu(s??"codex");return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${E}`,children:T}),a.jsx("span",{className:"turn-header-title",children:"Agent"}),l&&a.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),a.jsx(Um,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:Hm(t)||"…",threads:o,runtimeType:s})]})}case"reasoning":return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(Yw,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),a.jsx("div",{dangerouslySetInnerHTML:{__html:gT(Hm(t))}})]});case"command_execution":{const E=t.data||{},T=vT(E.command||""),I=E.aggregated_output||"",R=E.exit_code,U=l?"running…":R!==null?`exit ${R}`:"",A=I.length>Gm,L=A&&!u?I.slice(0,Gm)+`
499
+ … (truncated, click to expand)`:I;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(nv,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Command"}),U&&a.jsx("span",{className:"turn-header-meta",children:U})]}),a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:T})}),I&&a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:L})}),A&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>d(q=>!q),children:u?"Show less":`Show full output (${(I.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const E=(p=t.data)==null?void 0:p.changes,T=Array.isArray(E)?E:[],I=`${T.length} file${T.length!==1?"s":""}`;return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(nk,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"File Changes"}),a.jsx("span",{className:"turn-header-meta",children:I})]}),a.jsx("div",{className:"file-change-list",children:T.map((R,U)=>{const A=R.kind==="add"?"A":R.kind==="delete"?"D":"M",L=R.kind==="add"?"fc-add":R.kind==="delete"?"fc-del":"fc-mod";return a.jsxs("div",{className:"file-change",children:[a.jsx("span",{className:`fc-status ${L}`,children:A}),a.jsx("span",{className:"fc-name",children:R.path})]},U)})})]})}case"mcp_tool_call":{const E=t.data||{},T=E.tool||"mcp";if(T==="Agent"){const $=E.arguments,ne=($==null?void 0:$.description)||($==null?void 0:$.prompt)||"Subagent",pe=t.status==="failed",G=l?"running…":pe?"failed":"done";return a.jsxs("div",{className:"agent-call-card",children:[a.jsx("span",{className:"agent-call-icon",children:a.jsx(mr,{size:14})}),a.jsx("span",{className:"agent-call-desc",children:ne}),a.jsx("span",{className:`agent-call-status ${l?"running":pe?"failed":"done"}`,children:G})]})}const I=E.server||"",R=E.arguments,U=E.result,A=E.error,L=t.status==="failed"||!!A,q=l?"running…":L?"failed":"done",K=((g=U==null?void 0:U.content)==null?void 0:g.filter($=>$.type==="text").map($=>$.text))??[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(wk,{size:14})}),a.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),I&&a.jsx("span",{className:"turn-header-meta",children:I}),a.jsx("span",{className:"turn-header-meta",style:L?{color:"var(--red)"}:void 0,children:q})]}),R&&Object.keys(R).length>0&&a.jsx("div",{className:"mcp-args",children:Object.entries(R).map(([$,ne])=>a.jsxs("div",{className:"mcp-arg",children:[a.jsx("span",{className:"mcp-arg-key",children:$}),$==="code"?a.jsx("pre",{className:"cmd-block",children:a.jsx("code",{children:String(ne)})}):a.jsx("span",{className:"mcp-arg-value",children:typeof ne=="string"?ne:JSON.stringify(ne,null,2)})]},$))}),K.length>0&&K.map(($,ne)=>a.jsx("pre",{className:"cmd-output",children:a.jsx("code",{children:$})},ne)),A&&a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:A})})]})}case"web_search":{const E=((m=t.data)==null?void 0:m.query)||"";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(bk,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),a.jsx("p",{className:"user-message",children:E})]})}case"todo_list":{const E=((v=t.data)==null?void 0:v.items)||[];return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(ck,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),a.jsx("ul",{className:"todo-list",children:E.map((T,I)=>a.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?a.jsx(Ts,{size:14}):a.jsx(zr,{size:14})," ",T.text]},I))})]})}case"ask_user":return a.jsx(Wm,{item:t,turn:r});case"final_result":{const E=t.data??{},T=E.text||"",I=E.html||null,R=Array.isArray(E.groups)?E.groups.filter(L=>!!L&&Array.isArray(L.selections)&&L.selections.length>0):[],{iconClass:U,iconText:A}=Qu(s??"codex");return a.jsxs(a.Fragment,{children:[(T||I)&&a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:`turn-header-icon ${U}`,children:A}),a.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&a.jsx(Um,{itemId:t.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),I&&a.jsx(xT,{html:I})]}),R.length>0&&a.jsx(Wm,{item:t,turn:r})]})}case"background_task":{const E=t.data||{},T=E.task_type||"unknown",I=E.subagent_type||null,R=E.description||"",U=E.status||"running",A=E.last_tool_name||null,L=E.token_count||null,q=T==="local_agent",K=T==="local_bash",$=q?mr:K?tv:Gg,ne=q?`Subagent${I?`: ${I}`:""}`:K?"Monitor":"Background Task",pe=U==="running"?"running…":U==="completed"?"done":U==="failed"?"failed":U==="stopped"?"stopped":U,G=t.status==="failed"||U==="failed";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx($,{size:14})}),a.jsx("span",{className:"turn-header-title",children:ne}),a.jsx("span",{className:"turn-header-meta",style:G?{color:"var(--red)"}:void 0,children:pe})]}),R&&a.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:R}),A&&l&&a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",A,L!=null&&` · ${L.toLocaleString()} tokens`]}),a.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 E=((k=t.data)==null?void 0:k.trigger)??"auto",T=((y=t.data)==null?void 0:y.pre_tokens)??0,I=((S=t.data)==null?void 0:S.post_tokens)??0,R=T>0?Math.round((1-I/T)*100):0,U=E==="manual"?"Context compacted (/compact)":"Context auto-compacted";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:a.jsx(pk,{size:14})}),a.jsx("span",{className:"turn-header-title",children:U})]}),a.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",I.toLocaleString()," tokens (",R,"% reduction)"]})]})}case"interruption":return a.jsx(cT,{item:t});case"error":{const E=((N=t.data)==null?void 0:N.message)||"Unknown error";return a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:a.jsx(Ll,{size:14})}),a.jsx("span",{className:"turn-header-title",children:"Error"})]}),a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:E})})]})}default:return null}}const Ps=x.memo(wT,(t,s)=>t.item===s.item&&t.runtimeType===s.runtimeType&&t.threads===s.threads&&t.turn.id===s.turn.id);function kT({turn:t,runtimeType:s,threads:r=[]}){Mt.trackRender("TurnContent");const[o,l]=x.useState(!1),[u,d]=x.useState(!1),[p,g]=x.useState(!1);x.useEffect(()=>{const G=t.items.some(ve=>ve.type==="background_task"&&ve.status==="in_progress");t.status==="running"||t.status==="pending"?l(!0):t.status==="completed"&&!G&&l(!1)},[t.status,t.items]);let m=-1;for(let G=t.items.length-1;G>=0;G--)if(t.items[G].type==="agent_message"){m=G;break}const v=m>=0,k=v?t.items.slice(0,m):t.items,y=t.items.some(G=>G.type==="final_result"||G.type==="ask_user"),S=!v&&t.status==="completed"&&t.agent_response&&!y?{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,E=k.filter(G=>{var ve;return!(G.type==="reasoning"&&(!((ve=G.data)!=null&&ve.text)||G.data.text===""))}).filter(G=>!(G.type==="background_task"||G.type==="ask_user"||G.type==="final_result")),T=u?0:Math.max(0,E.length-hT),I=T>0?E.slice(T):E,R=[];let U=null;for(const G of I)G.type==="agent_message"?(U&&R.push(U),U={agentMessage:G,toolItems:[],otherItems:[]}):G.type==="interruption"||G.type==="error"?(U&&R.push(U),R.push({agentMessage:null,toolItems:[],otherItems:[G]}),U=null):(U||(U={agentMessage:null,toolItems:[],otherItems:[]}),zm(G)?U.toolItems.push(G):U.otherItems.push(G));U&&R.push(U);const A=t.items.filter(G=>G.type==="background_task"),L=p?0:Math.max(0,A.length-pT),q=L>0?A.slice(L):A,K=E.filter(G=>zm(G)).length,$=K>0||E.length>0&&(t.status==="running"||t.status==="pending"),ne=t.status==="pending"&&t.resume_state==="waiting",pe=t.resume_state==="gave_up"||t.resume_state==="skipped"||t.resume_state==="unsupported";return a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:t.user_prompt}),Array.isArray(t.attachments)&&t.attachments.length>0&&a.jsx(mT,{attachments:t.attachments})]}),$&&a.jsxs("div",{className:"tool-calls",children:[a.jsxs("div",{className:"tool-calls-header",onClick:()=>l(G=>!G),children:[a.jsx("span",{className:"tool-calls-icon",children:a.jsx(ok,{size:12})}),a.jsx("span",{className:"tool-calls-summary",children:K>0?`${K} tool call${K>1?"s":""}`:ne?"interrupted":"thinking…"}),a.jsx(Eo,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&a.jsxs("div",{className:"tool-calls-body",children:[T>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>d(!0),children:["Show ",T," earlier step",T>1?"s":""]})}),R.map((G,ve)=>a.jsxs("div",{className:"intermediate-segment",children:[G.agentMessage&&a.jsx(Ps,{item:G.agentMessage,runtimeType:s,turn:t,threads:r}),G.otherItems.map(we=>a.jsx(Ps,{item:we,runtimeType:s,turn:t,threads:r},we.id)),G.toolItems.length>0&&a.jsx(Yb,{items:G.toolItems,runtimeType:s,turn:t,threads:r})]},ve))]})]}),L>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(!0),children:["Show ",L," earlier background task",L>1?"s":""]})}),q.map(G=>a.jsx(Ps,{item:G,runtimeType:s,turn:t,threads:r},`task-${G.id}`)),v&&a.jsx(Ps,{item:t.items[m],runtimeType:s,turn:t,threads:r},t.items[m].id),S&&a.jsx(Ps,{item:S,runtimeType:s,turn:t,threads:r},S.id),v&&t.items.slice(m+1).filter(G=>G.type!=="ask_user"&&G.type!=="background_task"&&G.type!=="final_result").map(G=>a.jsx(Ps,{item:G,runtimeType:s,turn:t,threads:r},G.id)),t.items.filter(G=>G.type==="final_result").map(G=>a.jsx(Ps,{item:G,runtimeType:s,turn:t,threads:r},`final-${G.id}`)),t.items.filter(G=>G.type==="ask_user").map(G=>a.jsx(Ps,{item:G,runtimeType:s,turn:t,threads:r},`ask-${G.id}`)),t.items.length===0&&!t.error&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:t.status==="running"?"Agent is thinking…":"Waiting to start…"})}),t.error&&!pe&&a.jsx("div",{className:"render-content",children:a.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:a.jsx("code",{children:t.error})})}),t.status==="running"&&a.jsx(fT,{turnId:t.id}),a.jsx(dT,{turn:t}),t.status==="aborted"&&a.jsxs("div",{className:"aborted-banner",children:[a.jsx("span",{className:"banner-icon",children:a.jsx(zr,{size:12})}),a.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const ST=x.memo(kT),bT=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘K":"Ctrl+K";function TT(){const t=M(T=>T.workspaces),s=M(T=>T.loadPickerSupport),r=M(T=>T.pickAndAddWorkspace),o=M(T=>T.createSessionInWorkspace),l=M(T=>T.setImportSessionsWorkspace);x.useEffect(()=>{s()},[s]);const u=t.filter(T=>T.deleted===0),[d,p]=x.useState(null),g=u.find(T=>T.path===d)??u[u.length-1]??null,m=(g==null?void 0:g.path)??null,[v,k]=x.useState(null);x.useEffect(()=>{if(!m)return;let T=!1;return Mg(m).then(I=>{T||k({path:m,count:I.length})}).catch(()=>{}),()=>{T=!0}},[m]);const y=v&&v.path===m?v.count:0,[S,N]=x.useState(!1);async function E(T){N(!0);try{await o(T)}finally{N(!1)}}return a.jsx("div",{className:"render-scroll welcome-scroll",children:a.jsxs("main",{className:"welcome","aria-labelledby":"welcome-title",children:[a.jsx("h1",{className:"welcome-title",id:"welcome-title",children:"Welcome to Repoburg"}),a.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."}),a.jsxs("ol",{className:"welcome-steps",children:[a.jsxs("li",{className:`welcome-step${g?" done":" current"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:g?a.jsx(Ts,{size:13}):"1"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Add a workspace"}),g?a.jsx("p",{className:"welcome-step-text",children:a.jsx("code",{title:g.path,children:g.path})}):a.jsxs("button",{className:"dialog-btn-create welcome-primary",onClick:()=>void r(),children:[a.jsx(rk,{size:14})," Open folder…"]})]})]}),a.jsxs("li",{className:`welcome-step${g?" current":" upcoming"}`,children:[a.jsx("span",{className:"welcome-step-mark","aria-hidden":"true",children:"2"}),a.jsxs("div",{className:"welcome-step-body",children:[a.jsx("h2",{className:"welcome-step-title",children:"Start your first session"}),g&&m?a.jsxs(a.Fragment,{children:[u.length>1&&a.jsxs("label",{className:"welcome-step-text welcome-target",children:["In",a.jsx("select",{className:"dialog-input dialog-select",value:m,onChange:T=>p(T.target.value),children:u.map(T=>a.jsx("option",{value:T.path,children:T.label||T.path},T.id))})]}),a.jsxs("div",{className:"welcome-actions",children:[a.jsxs("button",{className:"dialog-btn-create welcome-primary",disabled:S,onClick:()=>void E(m),children:[a.jsx(dr,{size:14})," New session"]}),y>0&&a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>l(m),children:[a.jsx(Xg,{size:14})," Import ",y," Claude Code"," ",y===1?"session":"sessions"]})]}),y>0&&a.jsxs("p",{className:"welcome-step-text",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in this folder continue right where they left off."]})]}):a.jsx("p",{className:"welcome-step-text",children:"Then start an agent session in it."})]})]})]}),a.jsxs("p",{className:"welcome-tip",children:["Later: right-click a workspace to import its Claude Code sessions, and press ",a.jsx("kbd",{children:bT})," for the command palette."]})]})})}const NT=[],Ja=50;function jT(){Mt.trackRender("RenderArea");const t=M(S=>S.activeSessionId),s=M(S=>S.activeSessionId?S.sessionDetails[S.activeSessionId]:null),r=M(S=>S.submittingPrompt),o=M(S=>S.loading),l=M(S=>!S.activeSessionId&&!NS(S.workspaces,S.sessions,S.appsRootPath)),u=(s==null?void 0:s.turns)??[],d=(s==null?void 0:s.threads)??NT,p=x.useRef(null),[g,m]=x.useState(Ja);x.useEffect(()=>{m(Ja)},[t]);const v=u.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,u.length]),o&&!s?a.jsx("div",{className:"render-scroll",children:a.jsxs("div",{className:"skeleton-bars",children:[a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"}),a.jsx("div",{className:"skeleton-bar"})]})}):s?a.jsxs("div",{className:"render-scroll",ref:p,children:[r&&a.jsx("div",{className:"turn-block",children:a.jsxs("div",{className:"turn-group",children:[a.jsxs("div",{className:"render-content",children:[a.jsxs("div",{className:"turn-header",children:[a.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),a.jsx("span",{className:"turn-header-title",children:"You"})]}),a.jsx("p",{className:"user-message",children:r})]}),a.jsx("div",{className:"render-content",children:a.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),u.length===0&&!r&&a.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),k>0&&a.jsx("div",{className:"render-load-earlier",children:a.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>m(S=>S+Ja),children:["Show ",Math.min(Ja,k)," earlier turns (",k," hidden)"]})}),y.map((S,N)=>a.jsx("div",{id:`turn-${k+N}`,className:"turn-block",children:a.jsx(ST,{turn:S,runtimeType:s.runtime_type,threads:d})},S.id))]}):l?a.jsx(TT,{}):a.jsx("div",{className:"render-scroll",children:a.jsx("div",{className:"empty-state",children:"No session selected"})})}const CT=x.memo(jT),ET=[{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 _T(t){return t.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function RT(t,s,r=[]){const o=[...ET,..._T(r)],l=new Set;return o.filter(u=>!(l.has(u.label)||(l.add(u.label),u.capability&&!s[u.capability])||t&&!u.label.toLowerCase().includes(t.toLowerCase())))}function AT({commands:t,selectedIndex:s,onSelect:r,onHover:o}){return a.jsxs("div",{className:"slash-popup",children:[a.jsx("div",{className:"slash-popup-header",children:"Commands"}),t.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),t.map((l,u)=>a.jsxs("div",{className:`slash-popup-item ${u===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(l),children:[a.jsx("span",{className:"slash-popup-label",children:l.label}),a.jsx("span",{className:"slash-popup-hint",children:l.hint})]},l.id))]})}function Hu({title:t,options:s,currentValue:r,onSelect:o,onClose:l}){return a.jsxs("div",{className:"slash-popup",children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:l,children:"← Back"}),a.jsx("span",{children:t})]}),s.map(u=>a.jsxs("div",{className:`slash-popup-item ${u.value===r?"selected":""}`,onClick:()=>o(u.value),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&a.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===r&&a.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function IT(t){return Wt("/skills")}function MT({filter:t,onSelect:s,onClose:r}){const[o,l]=x.useState([]),[u,d]=x.useState(!0),[p,g]=x.useState(0),m=x.useRef(null);x.useEffect(()=>{IT().then(l).catch(()=>l([])).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]&&s(v[p])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,p,s,r]),a.jsxs("div",{className:"slash-popup",ref:m,children:[a.jsxs("div",{className:"slash-popup-header",children:[a.jsx("button",{className:"slash-popup-back",onClick:r,children:"← Back"}),a.jsx("span",{children:"Skills"})]}),u&&a.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&a.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,y)=>a.jsxs("div",{className:`slash-popup-item ${y===p?"selected":""}`,onMouseEnter:()=>g(y),onClick:()=>s(k),children:[a.jsxs("div",{className:"slash-popup-item-main",children:[a.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&a.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&a.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function DT(){return Wt("/providers")}function LT(t,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return Wt(`/providers/${t}/commands${r}`)}const OT={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function PT(t){const[s,r]=x.useState([]),[o,l]=x.useState(!0);x.useEffect(()=>{DT().then(r).catch(()=>r([])).finally(()=>l(!1))},[]);const u=s.find(d=>d.id===t)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??OT,loading:o}}const mi=32,Vu=200;function Km(t){if(!t)return{};try{return JSON.parse(t)}catch{return{}}}function qm(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}let Ym=0;function $T(){return Ym+=1,`att-${Date.now()}-${Ym}`}function zT(){Mt.trackRender("CommandInputBar");const[t,s]=x.useState(""),r=x.useRef(null),o=x.useRef(mi),l=x.useRef(null),{submitPrompt:u,cancelTurn:d,updateRuntimeConfig:p,setShowModelSelector:g}=M(),m=M(Y=>Y.activeSessionId),v=M(Y=>Y.activeSessionId?Y.sessionDetails[Y.activeSessionId]:null),k=M(Y=>Y.quotedText),y=Cg(v),S=!!(v!=null&&v.turns.some(Y=>Y.status==="pending"&&Y.resume_state==="waiting")),N=!m,{capabilities:E}=PT(v==null?void 0:v.runtime_type),T=(v==null?void 0:v.runtime_type)??null,I=E.imageAttachments,[R,U]=x.useState([]),[A,L]=x.useState(!1),[q,K]=x.useState(null),[$,ne]=x.useState([]);x.useEffect(()=>{if(!T){ne([]);return}let Y=!1;return LT(T,(v==null?void 0:v.cwd)??void 0).then(he=>{Y||ne(he)}).catch(()=>{Y||ne([])}),()=>{Y=!0}},[T,v==null?void 0:v.cwd]);const[pe,G]=x.useState(!1),[ve,we]=x.useState(""),[Oe,te]=x.useState(0),[oe,ae]=x.useState(void 0),[z,Q]=x.useState(!1),[W,C]=x.useState(""),[P,se]=x.useState([]),de=pe?RT(ve,E,$):[];x.useEffect(()=>{k!==null&&(s(Y=>Y+k),setTimeout(()=>{if(r.current){Me(),r.current.focus();const Y=r.current.value.length;r.current.setSelectionRange(Y,Y)}},0),M.setState({quotedText:null}))},[k]),x.useEffect(()=>{if(!y)return;function Y(he){he.key==="Escape"&&(he.preventDefault(),d())}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[y,d]),x.useEffect(()=>{G(!1),ae(void 0),Q(!1),se([]),U(Y=>{for(const he of Y)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[m]),x.useEffect(()=>{if(!q)return;function Y(he){he.key==="Escape"&&(he.preventDefault(),K(null))}return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[q]);const X=x.useCallback(Y=>{if(!Y)return;const he=Array.from(Y);for(const Ue of he){const tt=new FileReader;tt.onload=()=>{const gt=tt.result.split(",")[1]??"",Ct=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;U(an=>[...an,{id:$T(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:gt,previewUrl:Ct,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),fe=x.useCallback(Y=>{U(he=>{const Ue=he.find(tt=>tt.id===Y);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(tt=>tt.id!==Y)})},[]),Te=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),!(!I||y)&&L(!0)},[I,y]),Ee=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),L(!1)},[]),Re=x.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation(),L(!1),!(!I||y)&&X(Y.dataTransfer.files)},[I,y,X]),Ce=x.useCallback(Y=>{var tt;if(!I)return;const he=(tt=Y.clipboardData)==null?void 0:tt.items;if(!he)return;const Ue=[];for(let mt=0;mt<he.length;mt++){const gt=he[mt];if(gt.type.startsWith("image/")){const Ct=gt.getAsFile();Ct&&Ue.push(Ct)}}Ue.length>0&&(Y.preventDefault(),X(Ue))},[I,X]);function at(Y){const he=r.current;he&&(he.style.height=`${Y}px`,o.current=Y)}function Me(){const Y=r.current;if(Y){if(Y.scrollHeight>Y.clientHeight){const he=Math.min(Y.scrollHeight,Vu);he!==o.current&&at(he);return}o.current>mi&&(Y.style.height="auto",at(Math.min(Y.scrollHeight,Vu)))}}function lt(){const Y=t.trim();if(!Y||y)return;let he=Y;P.length>0&&(he=`${P.map(mt=>`$${mt.name}`).join(" ")}
500
+
501
+ ${Y}`);const Ue=R.map(({id:tt,previewUrl:mt,size:gt,...Ct})=>Ct);s(""),se([]),at(mi),G(!1),ae(void 0),Q(!1);for(const tt of R)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);U([]),u(he,Ue.length>0?Ue:void 0)}function $e(Y){if(Y.insertAsText){const he=`/${Y.id} `;s(he),G(!1),ae(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=he.length;r.current.setSelectionRange(Ue,Ue),Me()}});return}Y.subPopup?ae(Y.subPopup):Y.id==="skills"?(Q(!0),C(""),G(!1),s("")):Y.id==="model"?(g(!0),G(!1),s("")):(G(!1),s(""))}function en(Y){se(he=>[...he,Y]),Q(!1),s(""),at(mi)}function Fe(Y){const he=Km(v==null?void 0:v.runtime_config);oe==="sandbox"?he.sandboxMode=Y:oe==="websearch"?he.webSearchMode=Y:oe==="network"&&(he.networkAccessEnabled=Y==="true"),p(he),ae(void 0),G(!1),s(""),at(mi)}function Ht(Y){if(Mt.markKeystroke(),pe&&!oe){if(Y.key==="ArrowDown"){Y.preventDefault(),te(he=>Math.min(he+1,de.length-1));return}if(Y.key==="ArrowUp"){Y.preventDefault(),te(he=>Math.max(he-1,0));return}if(Y.key==="Enter"){Y.preventDefault(),de[Oe]&&$e(de[Oe]);return}if(Y.key==="Escape"){Y.preventDefault(),G(!1),s("");return}}if(oe&&Y.key==="Escape"){Y.preventDefault(),ae(void 0);return}if(Y.key==="Enter"&&(Y.metaKey||Y.ctrlKey)&&!y){Y.preventDefault(),lt();return}Y.key==="Escape"&&y&&(Y.preventDefault(),d())}function tn(Y){Mt.markInputChange();const he=Y.target.value;s(he),Me(),he.startsWith("/")&&!he.includes(" ")&&!y?(G(!0),we(he.slice(1)),te(0)):(G(!1),ae(void 0)),he.startsWith("$")&&!y?(Q(!0),C(he.slice(1))):he.startsWith("$")||Q(!1)}const wt=Km(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"}],$t=[{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"}],Dt=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return a.jsxs("div",{className:`cmd-bar${A?" drag-over":""}`,onDragOver:Te,onDragLeave:Ee,onDrop:Re,children:[pe&&!oe&&a.jsx(AT,{commands:de,selectedIndex:Oe,onSelect:$e,onHover:te}),pe&&oe==="sandbox"&&a.jsx(Hu,{title:"Sandbox Mode",options:jt,currentValue:wt.sandboxMode,onSelect:Fe,onClose:()=>ae(void 0)}),pe&&oe==="websearch"&&a.jsx(Hu,{title:"Web Search",options:$t,currentValue:wt.webSearchMode,onSelect:Fe,onClose:()=>ae(void 0)}),pe&&oe==="network"&&a.jsx(Hu,{title:"Network Access",options:Dt,currentValue:wt.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>ae(void 0)}),z&&a.jsx(MT,{filter:W,onSelect:en,onClose:()=>{Q(!1),s("")}}),P.length>0&&a.jsx("div",{className:"skill-badges",children:P.map(Y=>a.jsxs("span",{className:"skill-badge",children:["$",Y.name,a.jsx("button",{className:"skill-badge-remove",onClick:()=>se(he=>he.filter(Ue=>Ue.id!==Y.id)),children:"×"})]},Y.id))}),R.length>0&&a.jsx("div",{className:"attachment-preview-area",children:R.map(Y=>a.jsxs("div",{className:"attachment-chip",title:Y.name,children:[Y.previewUrl?a.jsx("img",{src:Y.previewUrl,alt:Y.name,className:"attachment-thumb",onClick:()=>K(Y),style:{cursor:"pointer"}}):a.jsx(Kg,{size:20,className:"attachment-file-icon"}),a.jsxs("div",{className:"attachment-info",children:[a.jsx("span",{className:"attachment-name",children:Y.name}),a.jsx("span",{className:"attachment-size",children:qm(Y.size)})]}),a.jsx("button",{className:"attachment-remove",onClick:()=>fe(Y.id),title:"Remove attachment",children:a.jsx(Tn,{size:14})})]},Y.id))}),I&&!y&&!N&&a.jsx("input",{ref:l,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=""}}),a.jsxs("div",{className:"cmd-input-row",children:[I&&!y&&!N&&a.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var Y;return(Y=l.current)==null?void 0:Y.click()},title:"Attach files",disabled:y,children:a.jsx(yk,{size:16})}),a.jsx("textarea",{ref:r,className:"cmd-textarea",placeholder:N?"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||N,rows:1,style:{minHeight:mi,maxHeight:Vu},onChange:tn,onKeyDown:Ht,onPaste:Ce}),y?a.jsx("button",{className:"cmd-stop-btn",onClick:()=>d(),title:"Stop (Esc)",children:a.jsx(zr,{size:15})}):a.jsx("button",{className:"cmd-send-btn",onClick:lt,disabled:!t.trim()||N,title:"Send (⌘↵)",children:a.jsx(Vg,{size:16})})]}),q&&a.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:a.jsxs("div",{className:"image-preview-content",onClick:Y=>Y.stopPropagation(),children:[a.jsx("img",{src:q.previewUrl,alt:q.name}),a.jsxs("div",{className:"image-preview-info",children:[a.jsx("span",{children:q.name}),a.jsx("span",{children:qm(q.size)})]}),a.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:a.jsx(Tn,{size:20})})]})})]})}function FT(){const t=M(T=>T.activeSessionId),s=M(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),r=M(T=>T.activeTurnIndex),o=M(T=>T.setActiveTurnIndex),l=M(T=>T.rewindToTurn),u=M(T=>T.restoreSession),d=M(T=>T.branchFromTurn),p=(s==null?void 0:s.turns)??[],g=Al(s),m=!!(s!=null&&s.rewound_at_turn_id),v=(s==null?void 0:s.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),N=x.useRef(null);if(Mo(N,()=>S(null),!!y),Ni(()=>S(null),!!y),p.length===0)return a.jsx("div",{className:"empty-state",children:"No turns yet"});function E(T){o(T),requestAnimationFrame(()=>{var I;(I=document.getElementById(`turn-${T}`))==null||I.scrollIntoView({behavior:"smooth",block:"start"})})}return a.jsxs("div",{className:"right-section",children:[a.jsx("div",{className:"right-section-title",children:"Conversation"}),p.map((T,I)=>{const R=I===r,U=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,A=T.status==="running"||T.status==="pending";return a.jsx("div",{children:a.jsxs("div",{className:`turn-item ${R?"active":""}`,onClick:()=>E(I),onContextMenu:L=>{L.preventDefault(),S({x:L.clientX,y:L.clientY,turnId:T.id,turnIndex:I,isLast:I===p.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[a.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:a.jsx(Ck,{size:12})}),a.jsx("span",{className:"turn-item-label",children:U}),A&&a.jsx("span",{className:"turn-item-status",children:T.status==="pending"&&T.resume_state==="waiting"?"interrupted":"running…"})]})},T.id)}),y&&a.jsxs("div",{ref:N,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[a.jsxs("div",{className:`ctx-menu-item ${y.isLast||g||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||g||y.isSlashCommand||(window.confirm(k)&&l(t,y.turnId),S(null))},children:[a.jsx(Sk,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),m&&!v&&a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(t),S(null)},children:[a.jsx(_o,{size:12})," Restore Rewind"]}),a.jsxs("div",{className:"ctx-menu-item",onClick:()=>{d(t,y.turnId),S(null)},children:[a.jsx(Yg,{size:12})," Branch from Here"]})]})]})}function qd(t){return(t??[]).filter(s=>s.task_type!=="local_agent").length}const Xm=2e4;function UT(t){const s=[];return t.forEach((r,o)=>{var l;for(const u of r.items)if(u.type==="background_task"){if((((l=u.data)==null?void 0:l.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function BT({entry:t}){const{item:s,turnIndex:r,turnPrompt:o}=t,l=s.data||{},u=l.task_type||"unknown",d=l.subagent_type||null,p=l.description||"",g=l.summary||null,m=l.last_tool_name||null,v=l.token_count||null,k=l.output||"",y=s.status==="in_progress",S=l.status||"running",N=!y&&S==="running"?"stopped":S,E=u==="local_agent",T=u==="local_bash",I=E?mr:T?tv:Gg,R=E?`Subagent${d?`: ${d}`:""}`:T?"Monitor":"Background Task",U=N==="running"?"running…":N==="completed"?"done":N==="failed"?"failed":N==="stopped"?"stopped":N,A=N==="failed"||s.status==="failed"&&N!=="stopped",[L,q]=x.useState(y),[K,$]=x.useState(!1),ne=x.useRef(null);x.useEffect(()=>{y&&q(!0)},[y]),x.useEffect(()=>{L&&y&&ne.current&&(ne.current.scrollTop=ne.current.scrollHeight)},[L,y,k]);const pe=k.length>Xm,G=pe&&!K?k.slice(0,Xm)+`
502
+ … (truncated, click to expand)`:k,ve=y?null:N==="completed"?a.jsx(Ts,{size:12}):A?a.jsx(Ll,{size:12}):a.jsx(zr,{size:12});return a.jsxs("div",{className:`task-card ${y?"task-running":""} ${A?"task-failed":""}`,children:[a.jsxs("div",{className:"task-card-header",onClick:()=>q(we=>!we),style:{cursor:"pointer"},children:[a.jsx("span",{className:"task-card-icon",children:a.jsx(I,{size:14})}),a.jsx("span",{className:"task-card-type",children:R}),a.jsxs("span",{className:`task-card-status ${A?"task-status-failed":y?"task-status-running":"task-status-done"}`,children:[ve," ",U]}),a.jsx(Eo,{size:14,className:"task-card-chevron",style:{transform:L?"rotate(90deg)":"none",marginLeft:"auto"}})]}),p&&a.jsx("div",{className:"task-card-desc",children:p}),y&&m&&a.jsxs("div",{className:"task-card-meta",children:["last tool: ",m,v!=null&&` · ${v.toLocaleString()} tokens`]}),L&&a.jsxs("div",{className:"task-card-body",children:[k?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"cmd-output task-output",ref:ne,children:a.jsx("code",{children:G})}),pe&&a.jsx("button",{className:"cmd-output-toggle",onClick:()=>$(we=>!we),children:K?"Show less":`Show full output (${(k.length/1024).toFixed(0)}KB)`})]}):g?a.jsx("pre",{className:"cmd-output task-output",children:a.jsx("code",{children:g})}):y?a.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):a.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),a.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const WT=x.memo(BT);function HT(){const t=M(d=>d.activeSessionId?d.sessionDetails[d.activeSessionId]:null),s=M(d=>d.activeSessionId?d.backgroundTasks[d.activeSessionId]:void 0),r=(t==null?void 0:t.turns)??[],o=UT(r),l=[...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}),u=qd(s);return o.length===0?a.jsx("div",{className:"empty-state",children:"No background tasks yet"}):a.jsxs("div",{className:"right-section",children:[a.jsxs("div",{className:"right-section-title",children:["Background Tasks (",o.length,")",u>0&&a.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",u," running"]})]}),l.map(d=>a.jsx(WT,{entry:d},d.item.id))]})}const VT=x.memo(HT),GT="Your job is to answer questions about this session:",Qm="Understand the user's question below, read the session file given above, and answer.",KT=new Set(["claude"]);function qT(t){return KT.has(t)}function Yd(t){return t.kind==="sidecar"}function YT(t){const s=(t??[]).filter(Yd);return s.length?s[s.length-1]:null}function XT(t){if(!t.startsWith(GT))return t;const s=t.indexOf(Qm);return s<0?t:t.slice(s+Qm.length).replace(/^\n+/,"")}function QT({thread:t,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:l}=M(),[u,d]=x.useState(""),[p,g]=x.useState(!1),[m,v]=x.useState(!1);async function k(){if(!r||p)return;g(!0),await l(r,t.id,u)?s():g(!1)}async function y(){!r||m||(v(!0),await o(r,t.id),s())}const S=p||m;return a.jsx("div",{className:"dialog-overlay",onClick:S?void 0:s,children:a.jsxs("div",{className:"dialog",onClick:N=>N.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Resolve thread"}),a.jsx("button",{className:"dialog-close",onClick:s,disabled:S,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.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."}),a.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",a.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:N=>d(N.target.value),rows:3,disabled:S,autoFocus:!0})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:S,children:"Cancel"}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:S,title:"Resolve without sharing",children:[m?a.jsx(hn,{size:13,className:"spin"}):a.jsx(pl,{size:13}),"Resolve only"]}),a.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:S,children:[p?a.jsx(hn,{size:13,className:"spin"}):a.jsx(Tk,{size:13}),p?"Summarizing…":"Share & Resolve"]})]})]})})}const Zm=[];Ve.setOptions({breaks:!0,gfm:!0});function ZT(t){const s=Ve.parse(t);return Kd.sanitize(s)}function JT(t){var s,r,o;if(t.type==="agent_message"||t.type==="final_result"){const l=(s=t.data)==null?void 0:s.text;return typeof l=="string"&&l?l:null}if(t.type==="ask_user"){const l=Array.isArray((r=t.data)==null?void 0:r.groups)?t.data.groups:[],u=[(o=t.data)==null?void 0:o.question,...l.map(d=>d.question)].filter(d=>typeof d=="string"&&!!d);return u.length?u.join(`
503
+
504
+ `):null}return null}function eN(t){const s=t.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:t}function Zv({turn:t,formatPrompt:s=eN}){const r=s(t.user_prompt),o=t.items.map(JT).filter(l=>l!==null);return o.length===0&&t.status==="completed"&&t.agent_response&&o.push(t.agent_response),a.jsxs("div",{className:"thread-card-turn",children:[a.jsx("div",{className:"thread-card-user-message",children:r}),o.map((l,u)=>a.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:ZT(l)}},u)),o.length===0&&(t.status==="pending"||t.status==="running")&&a.jsx("div",{className:"thread-card-pending",children:t.status==="running"?"AI is responding…":"Waiting…"}),t.status==="failed"&&a.jsx("div",{className:"thread-card-pending",children:t.error||"Turn failed"})]})}function tN({thread:t,threadTurns:s,onStop:r,onResolve:o,onReopen:l,onDelete:u,onFollowup:d,onLocate:p}){var we,Oe,te;const[g,m]=x.useState(""),[v,k]=x.useState(!0),y=x.useRef(null),S=x.useRef(null),[N,E]=x.useState(!1),[T,I]=x.useState({x:0,y:0}),[R,U]=x.useState(""),A=s.some(hr),L=28,q=120,K=x.useRef(L);x.useEffect(()=>{const oe=S.current;oe&&(oe.scrollTop=oe.scrollHeight)},[s.length,v]);function $(oe){const ae=y.current;ae&&(ae.style.height=`${oe}px`,K.current=oe)}function ne(){const oe=y.current;if(oe){if(oe.scrollHeight>oe.clientHeight){const ae=Math.min(oe.scrollHeight,q);ae!==K.current&&$(ae);return}K.current>L&&(oe.style.height="auto",$(Math.min(oe.scrollHeight,q)))}}const pe=x.useCallback(()=>{E(!1)},[]),G=x.useCallback(()=>{const oe=S.current;if(!oe)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){E(!1);return}const z=ae.getRangeAt(0);if(!oe.contains(z.commonAncestorContainer)){E(!1);return}const Q=z.commonAncestorContainer.nodeType===Node.TEXT_NODE?z.commonAncestorContainer.parentElement:z.commonAncestorContainer;if(!(Q!=null&&Q.closest(".thread-card-ai-response"))){E(!1);return}const W=ae.toString();if(!W.trim()){E(!1);return}const C=z.getBoundingClientRect(),P=28,se=6,de=170;let X=!1;if(ae.anchorNode&&ae.focusNode)try{const Ee=document.createRange();Ee.setStart(ae.focusNode,ae.focusOffset),Ee.setEnd(ae.focusNode,ae.focusOffset);const Re=document.createRange();Re.setStart(ae.anchorNode,ae.anchorOffset),Re.setEnd(ae.anchorNode,ae.anchorOffset),X=Re.compareBoundaryPoints(Range.START_TO_START,Ee)>0}catch{X=!1}let fe=C.top-P-se;fe<8&&(fe=C.bottom+se);let Te=X?C.left-de:C.right;Te=Math.max(8,Math.min(Te,window.innerWidth-de-8)),I({x:Te,y:fe}),U(W),E(!0)},[]);x.useEffect(()=>{function oe(ae){const z=ae.target;z&&z.closest(".selection-actions")||G()}return document.addEventListener("mouseup",oe),()=>document.removeEventListener("mouseup",oe)},[G]);const ve=x.useCallback(()=>{var ae;const oe=`
505
+ \`\`\`QUOTE
506
+ ${R}
507
+ \`\`\`
508
+
509
+ `;m(z=>z+oe),E(!1),U(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){ne(),y.current.focus();const z=y.current.value.length;y.current.setSelectionRange(z,z)}},0)},[R]);return a.jsxs("div",{className:`thread-card ${t.status==="resolved"?"thread-resolved":""}`,id:`thread-${t.id}`,children:[a.jsxs("div",{className:"thread-card-header",onClick:()=>k(oe=>!oe),children:[a.jsx("div",{className:"thread-card-quote",children:t.selected_text===null?((te=(Oe=(we=t.turns)==null?void 0:we[0])==null?void 0:Oe.user_prompt)==null?void 0:te.slice(0,100))||"Quick question":`“${t.selected_text.slice(0,100)}${t.selected_text.length>100?"…":""}”`}),a.jsxs("div",{className:"thread-card-header-right",children:[t.selected_text!==null&&a.jsx("button",{className:"thread-locate-btn",onClick:oe=>{oe.stopPropagation(),p()},title:"Scroll to text",children:a.jsx(hk,{size:12})}),a.jsx("span",{className:`thread-status-badge ${t.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:t.status==="open"?"Open":"Resolved"})]})]}),v&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"thread-card-conversation",ref:S,onMouseDown:pe,children:[s.map(oe=>a.jsx(Zv,{turn:oe},oe.id)),s.length===0&&a.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),N&&a.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:a.jsxs("button",{className:"discuss-button",onClick:ve,title:"Quote this text in your follow-up",children:[a.jsx(Jg,{size:14}),a.jsx("span",{children:"Quote"})]})}),t.status==="open"&&a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:A?"Agent is running…":"Type a follow-up…",value:g,onChange:oe=>{Mt.markInputChange(),m(oe.target.value),ne()},disabled:A,rows:1,style:{minHeight:L,maxHeight:q},onKeyDown:oe=>{Mt.markKeystroke(),oe.key==="Enter"&&(oe.metaKey||oe.ctrlKey)&&!A&&g.trim()&&(oe.preventDefault(),d(g.trim()),m(""),$(L))}}),a.jsx("button",{className:"thread-card-followup-send",disabled:A||!g.trim(),onClick:()=>{d(g.trim()),m("")},children:a.jsx(Do,{size:13})}),A&&a.jsx("button",{className:"thread-card-followup-stop",onClick:r,title:"Stop this thread's turn (Esc)",children:a.jsx(zr,{size:13})})]}),a.jsxs("div",{className:"thread-card-actions",children:[t.status==="open"?a.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[a.jsx(pl,{size:13})," Resolve"]}):a.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Reopen thread",children:[a.jsx(_o,{size:13})," Reopen"]}),a.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[a.jsx(us,{size:13})," Delete"]})]})]})]})}function nN(){Mt.trackRender("ThreadsPanel");const t=M(I=>I.activeSessionId),s=M(I=>{var R;return I.activeSessionId?((R=I.sessionDetails[I.activeSessionId])==null?void 0:R.threads)??Zm:Zm}),r=x.useMemo(()=>s.filter(I=>!Yd(I)),[s]),o=M(I=>I.followupThread),l=M(I=>I.cancelThreadTurn),u=M(I=>I.reopenThread),d=M(I=>I.deleteThread),p=M(I=>I.deepLinkThreadId),g=M(I=>I.setDeepLinkThreadId),[m,v]=x.useState("open"),[k,y]=x.useState(null);x.useEffect(()=>{if(!p)return;const I=p;g(null),v(U=>r.some(A=>A.id===I&&A.status==="open")?U:"all");const R=setTimeout(()=>{const U=document.getElementById(`thread-${I}`);U&&(U.scrollIntoView({behavior:"smooth",block:"center"}),U.classList.add("thread-card-highlighted"),setTimeout(()=>U.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(R)},[p,g,r]);const S=r.filter(I=>m==="open"?I.status==="open":m==="resolved"?I.status==="resolved":!0),N=r.filter(I=>I.status==="open").length,E=r.filter(I=>I.status==="resolved").length;function T(I){setTimeout(()=>{const R=document.querySelector(`mark[data-thread-id="${I}"]`);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?a.jsxs("div",{className:"empty-state",children:[a.jsx(Zg,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"No threads yet."}),a.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):a.jsxs("div",{children:[a.jsxs("div",{className:"thread-filter-tabs",children:[a.jsxs("button",{className:`thread-filter-tab ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",N,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",E,")"]}),a.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",r.length,")"]})]}),S.length===0?a.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):S.map(I=>a.jsx(tN,{thread:I,threadTurns:I.turns??[],onStop:()=>l(t,I.id),onResolve:()=>y(I),onReopen:()=>u(t,I.id),onDelete:()=>d(t,I.id),onFollowup:R=>o(t,I.id,R),onLocate:()=>T(I.id)},I.id)),k&&a.jsx(QT,{thread:k,onClose:()=>y(null)})]}):a.jsx("div",{className:"empty-state",children:"No session selected"})}function sN(){const t=M(d=>d.apps),s=M(d=>d.activeAppTabId),r=M(d=>d.openAppTab),o=M(d=>d.startAppEdit),l=M(d=>d.toggleAppPin),u=M(d=>d.deleteApp);return t.length===0?a.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):a.jsx("div",{className:"apps-panel",children:t.map(d=>a.jsxs("div",{className:`apps-panel-row${s===d.id?" active":""}`,onClick:()=>r(d.id),title:d.description??void 0,children:[a.jsx(ji,{iconNode:d.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"apps-panel-info",children:[a.jsx("span",{className:"apps-panel-title",children:d.title}),d.description&&a.jsx("span",{className:"apps-panel-desc",children:d.description})]}),a.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:p=>{p.stopPropagation(),o(d.id)},children:a.jsx(rl,{size:12})}),a.jsx("button",{className:`apps-panel-action${d.pinned?" pinned":""}`,title:d.pinned?"Unpin app":"Pin app (sorts first)",onClick:p=>{p.stopPropagation(),l(d.id)},children:a.jsx(gl,{size:12,fill:d.pinned?"currentColor":"none"})}),a.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:p=>{p.stopPropagation(),u(d.id)},children:a.jsx(us,{size:12})})]},d.id))})}function rN(){Mt.trackRender("SidecarPanel");const t=M(T=>T.activeSessionId),s=M(T=>{var I;return T.activeSessionId?(I=T.sessionDetails[T.activeSessionId])==null?void 0:I.runtime_type:void 0}),r=M(T=>{var I;return T.activeSessionId?YT((I=T.sessionDetails[T.activeSessionId])==null?void 0:I.threads):null}),o=M(T=>T.askSidecar),l=M(T=>T.cancelThreadTurn),u=M(T=>T.deleteThread),[d,p]=x.useState(""),[g,m]=x.useState(!1),v=x.useRef(null),k=(r==null?void 0:r.turns)??[],y=k[k.length-1],S=k.some(hr);if(x.useEffect(()=>{var T,I;(I=(T=v.current)==null?void 0:T.scrollIntoView)==null||I.call(T,{block:"end"})},[k.length,y==null?void 0:y.items.length,y==null?void 0:y.status]),!t||!s)return a.jsx("div",{className:"empty-state",children:"No session selected"});if(!qT(s))return a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsxs("div",{children:["The sidecar is not available for ",s," sessions yet."]})]});const N=!S&&!g&&d.trim().length>0;async function E(){if(!t||!N)return;m(!0);const T=await o(t,d.trim());m(!1),T&&p("")}return a.jsxs("div",{className:"sidecar-panel",children:[a.jsxs("div",{className:"sidecar-conversation",children:[k.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx(mr,{size:24,style:{opacity:.3,marginBottom:8}}),a.jsx("div",{children:"Ask about this session."}),a.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):k.map(T=>a.jsx(Zv,{turn:T,formatPrompt:XT},T.id)),a.jsx("div",{ref:v})]}),a.jsxs("div",{className:"sidecar-footer",children:[a.jsxs("div",{className:"thread-card-followup",children:[a.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:S?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:d,rows:2,disabled:S,onChange:T=>{Mt.markInputChange(),p(T.target.value)},onKeyDown:T=>{Mt.markKeystroke(),T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),E())}}),S&&r?a.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>l(t,r.id),children:a.jsx(zr,{size:13})}):a.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!N,onClick:()=>void E(),children:a.jsx(Do,{size:13})})]}),r&&a.jsx("div",{className:"thread-card-actions",children:a.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:S,onClick:()=>u(t,r.id),children:[a.jsx(us,{size:13})," Clear"]})})]})]})}function iN(){var g;Mt.trackRender("RightPanel");const t=M(m=>m.activeRightTab),s=M(m=>m.switchRightTab),r=M(m=>m.rightPanelCollapsed),o=M(m=>m.toggleRightPanel),l=M(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=M(m=>m.activeSessionId?qd(m.backgroundTasks[m.activeSessionId]):0),d=((g=l==null?void 0:l.threads)==null?void 0:g.filter(m=>m.status==="open"&&!Yd(m)).length)??0,p=[{id:"turns",label:"Turns",icon:lk},{id:"sidecar",label:"Sidecar",icon:mr},{id:"tasks",label:"Tasks",icon:ak,badge:u||void 0},{id:"threads",label:"Threads",icon:Zg,badge:d||void 0},{id:"apps",label:"Apps",icon:Qg}];return r?a.jsxs("div",{className:"ide-right collapsed",children:[a.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:a.jsx(gk,{size:15})}),a.jsx("div",{className:"right-rail-divider"}),p.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return a.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${t===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>s(m.id),children:[a.jsx(v,{size:15}),m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):a.jsxs("div",{className:"ide-right",children:[a.jsxs("div",{className:"right-header",children:[a.jsx("div",{className:"right-tabs",children:p.map(m=>a.jsxs("div",{className:`right-tab ${t===m.id?"active":""}`,onClick:()=>s(m.id),children:[m.label,m.badge?a.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),a.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:a.jsx(mk,{size:14})})]}),a.jsxs("div",{className:"right-content",children:[t==="turns"&&a.jsx(FT,{}),t==="sidecar"&&a.jsx(rN,{}),t==="tasks"&&a.jsx(VT,{}),t==="threads"&&a.jsx(nN,{}),t==="apps"&&a.jsx(sN,{})]})]})}const _e={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"}},ud=[{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:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max,_e.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max,_e.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.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:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]}]}];function oN(t){return ud.find(s=>s.id===t)}function Xd(t){const s=oN(t);return(s==null?void 0:s.models)??[]}function Jv(t,s){return Xd(t).find(r=>r.slug===s)}function dd(t,s){var r;return((r=Jv(t,s))==null?void 0:r.reasoningLevels)??[]}function fd(t,s){var r;return(r=Jv(t,s))==null?void 0:r.defaultReasoning}function aN(){const{activeSessionId:t,sessions:s,updateModelConfig:r}=M(),o=M(te=>te.showModelSelector),l=M(te=>te.setShowModelSelector),u=s.find(te=>te.id===t),d=M(te=>te.models),p=M(te=>te.modelsLoading),g=M(te=>te.loadModels),[m,v]=x.useState(!1),k=x.useRef(null);if(Mo(k,()=>v(!1),m),Ni(()=>v(!1),m),x.useEffect(()=>{o&&(v(!0),l(!1))},[o,l]),x.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const y=u.runtime_type,S=u.model??"",N=u.model_reasoning_effort??"",E=d.length>0?d:[],T=Xd(y),R=[...E.length>0?E:T];if(S&&!R.some(te=>te.slug===S)){const te=T[0];R.unshift({slug:S,displayName:S,description:"Custom model",defaultReasoning:(te==null?void 0:te.defaultReasoning)??"medium",reasoningLevels:(te==null?void 0:te.reasoningLevels)??[]})}function U(te){return R.find(oe=>oe.slug===te)}function A(te){var oe;return E.length>0?((oe=U(te))==null?void 0:oe.reasoningLevels)??[]:dd(y,te)}function L(te){var oe;return E.length>0?(oe=U(te))==null?void 0:oe.defaultReasoning:fd(y,te)}const q=ud.find(te=>te.id===y),K=U(S),$=S?A(S):[],ne=(q==null?void 0:q.label)??y,pe=(K==null?void 0:K.displayName)??(S||"Default"),G=$.find(te=>te.effort===N),ve=(G==null?void 0:G.label)??(N||"Default");function we(te){var Q;const oe=A(te),z=oe.some(W=>W.effort===N)?N:L(te)??((Q=oe[0])==null?void 0:Q.effort)??"";r(te,z),v(!1)}function Oe(te){r(S,te),v(!1)}return a.jsxs("div",{className:"model-selector",ref:k,children:[a.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[a.jsx("span",{className:"model-selector-provider",children:ne}),a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-model",children:pe}),ve!=="Default"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"model-selector-sep",children:"›"}),a.jsx("span",{className:"model-selector-reasoning",children:ve})]}),a.jsx(Si,{size:12,className:"model-selector-chevron"})]}),m&&a.jsxs("div",{className:"model-selector-popover",children:[a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Provider"}),ud.map(te=>a.jsxs("div",{className:`model-selector-item ${te.id===y?"selected":""} ${te.available?"":"disabled"}`,onClick:()=>{if(te.available){if(te.id===y){v(!1);return}r("","",te.id)}},children:[a.jsx("span",{children:te.label}),!te.available&&a.jsxs("span",{className:"model-selector-coming-soon",children:[a.jsx(dk,{size:10})," Soon"]}),te.id===y&&a.jsx(Ts,{size:12})]},te.id))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Model"}),p&&a.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!p&&R.length===0&&a.jsx("div",{className:"model-selector-empty",children:"No models available"}),R.map(te=>a.jsxs("div",{className:`model-selector-item ${te.slug===S?"selected":""}`,onClick:()=>we(te.slug),children:[a.jsxs("div",{className:"model-selector-item-main",children:[a.jsx("span",{className:"model-selector-item-name",children:te.displayName}),a.jsx("span",{className:"model-selector-item-desc",children:te.description})]}),te.slug===S&&a.jsx(Ts,{size:12})]},te.slug))]}),a.jsxs("div",{className:"model-selector-column",children:[a.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),$.length===0&&a.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),$.map(te=>a.jsxs("div",{className:`model-selector-item ${te.effort===N?"selected":""}`,onClick:()=>Oe(te.effort),children:[a.jsx("span",{children:te.label}),te.effort===N&&a.jsx(Ts,{size:12})]},te.effort))]})]})]})}function mo(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Jm(){const t=M(r=>r.canGoBack),s=M(r=>r.canGoForward);return a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"sb-item sb-btn",title:"Back","aria-label":"Back",disabled:!t,onClick:()=>window.history.back(),children:a.jsx(Gw,{size:14})}),a.jsx("button",{className:"sb-item sb-btn",title:"Forward","aria-label":"Forward",disabled:!s,onClick:()=>window.history.forward(),children:a.jsx(Kw,{size:14})})]})}function eg(){const t=M(s=>s.setShowRemoteModal);return a.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>t(!0),children:[a.jsx(_k,{size:14})," Repoburg"]})}function tg(){const t=M(r=>r.usageViewOpen),s=M(r=>r.toggleUsageView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Usage Center",onClick:s,children:[a.jsx(qg,{size:14})," Usage"]})}function ng(){const t=M(r=>r.vscodeViewOpen),s=M(r=>r.toggleVscodeView);return a.jsxs("button",{className:`sb-item sb-btn${t?" sb-item-active":""}`,title:t?"Back to the agent view":"Open VS Code",onClick:s,children:[a.jsx(Jw,{size:14})," Code"]})}function lN(){Mt.trackRender("StatusBar");const t=M(v=>v.activeSessionId),s=M(v=>t?v.sessions.find(k=>k.id===t)??null:null),r=M(v=>t?v.sessionDetails[t]??null:null),o=M(v=>t?v.backgroundTasks[t]:void 0),l=M(v=>v.wsConnected),u=M(v=>v.switchRightTab),d=(r==null?void 0:r.contextUsage)??null;if(!s)return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(Jm,{}),a.jsx(eg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(tg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-spacer"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(Jh,{size:14})," K"]})]});const p=o??[],g=Dl(s,p.length),m=qd(p);return a.jsxs("div",{className:"ide-statusbar",children:[a.jsx(Jm,{}),a.jsx(eg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(ng,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(tg,{}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx(aN,{}),m>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${m} Monitor task${m>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[a.jsx(nv,{size:14})," ",m]})]}),a.jsx("div",{className:"sb-spacer"}),a.jsx("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:l?"Live":"Offline"}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:s.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),d&&a.jsx(cN,{usage:d}),a.jsx("div",{className:"sb-divider",children:"|"}),a.jsxs("div",{className:"sb-item",children:[a.jsx(Jh,{size:14})," K"]})]})}function cN({usage:t}){const s=t.percentage>=85?"var(--red)":t.percentage>=60?"var(--amber)":"var(--green)",r=`${mo(t.totalTokens)} / ${mo(t.contextWindow)} tokens`+(t.autoCompactThreshold?` · auto-compacts at ${mo(t.autoCompactThreshold)}`:"");return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sb-divider",children:"|"}),a.jsx("div",{className:"sb-context",title:r,children:a.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(t.percentage),"% / ",mo(t.totalTokens)," / ",mo(t.contextWindow)]})})]})}function sg(t){return Wt(`/vscode-web/status?folder=${encodeURIComponent(t??"")}`)}function uN(t){return ut("/vscode-web/start",{folder:t})}function dN(t){return ut("/vscode-web/heartbeat",{id:t})}const fN=1e3,pN=5*6e4;function rg({children:t}){const s=M(r=>r.toggleVscodeView);return a.jsxs("div",{className:"vscode-view vscode-view--loading",children:[t,a.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:s,children:a.jsx(Tn,{size:16})})]})}function hN(){const t=M(N=>N.vscodeState),s=M(N=>N.vscodeId),r=M(N=>N.vscodeToken),o=M(N=>N.setVscodeView),l=M(N=>{var T;const E=N.activeSessionId?N.sessions.find(I=>I.id===N.activeSessionId):null;return E!=null&&E.cwd?E.cwd:((T=N.workspaces.find(I=>I.deleted===0))==null?void 0:T.path)??null}),[u,d]=x.useState(!1),[p,g]=x.useState(0),m=x.useRef(null),v=mn(),k=v===""||v===window.location.origin,y=`${v}/vscode/${s??""}/?tkn=${r??""}${l?`&folder=${encodeURIComponent(l)}`:""}`;x.useEffect(()=>{let N=!1;function E(){m.current&&(clearInterval(m.current),m.current=null)}async function T(){try{let R=await sg(l);if((R.state==="stopped"||R.state==="error")&&(R=await uN(l)),N||(o(R.state,R.id,R.token),R.state==="running"||R.state==="error"))return;m.current=setInterval(async()=>{const U=await sg(l);N||(o(U.state,U.id,U.token),(U.state==="running"||U.state==="error"||U.state==="stopped")&&E())},fN)}catch{N||o("error",null,null)}}T();const I=setInterval(()=>{const R=M.getState().vscodeId;R&&dN(R).catch(()=>{})},pN);return()=>{N=!0,E(),clearInterval(I)}},[p,l,o]);function S(){d(!1),o("starting",null,null),g(N=>N+1)}return t!=="running"||!r||!s?a.jsx(rg,{children:t==="error"?a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"VS Code could not start."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:S,children:[a.jsx(_o,{size:14})," Retry"]})]}):a.jsxs("span",{className:"vscode-view-hint",children:[a.jsx(hn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?a.jsxs("div",{className:"vscode-view",children:[!u&&a.jsxs("div",{className:"vscode-view-overlay",children:[a.jsx(hn,{size:16,className:"spin"})," Loading VS Code…"]}),a.jsx("iframe",{src:y,title:"VS Code",className:"vscode-view-frame",onLoad:()=>d(!0)},s)]}):a.jsxs(rg,{children:[a.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),a.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(y,"_blank","noopener"),children:[a.jsx(tk,{size:14})," Open VS Code in a new tab"]})]})}function ig(t,s){const r=new URLSearchParams;t&&r.set("since",t),s&&r.set("until",s);const o=r.toString();return Wt(`/usage/summary${o?`?${o}`:""}`)}const ey="agentpane:usage-budget";function cs(t){return t>=1e6?`${(t/1e6).toFixed(t%1e6===0?0:1)}M`:t>=1e3?`${Math.round(t/1e3)}K`:String(t)}function Or(t){return`$${t>=100?t.toFixed(0):t>=1?t.toFixed(2):t.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`}function mN(t,s=new Date){if(t==="all")return{since:null,until:null};const r=new Date(s);return t==="today"?r.setHours(0,0,0,0):r.setDate(r.getDate()-(t==="7d"?7:30)),{since:r.toISOString(),until:null}}function gN(t=new Date){return new Date(t.getFullYear(),t.getMonth(),1).toISOString()}function vN(){try{const t=Number(localStorage.getItem(ey));return Number.isFinite(t)&&t>0?t:0}catch{return 0}}function yN(t){try{localStorage.setItem(ey,String(t))}catch{}}const xN={claude:"Claude",codex:"Codex",repoburg:"Repoburg"};function el({label:t,value:s,sub:r,tone:o}){return a.jsxs("div",{className:"usage-kpi",children:[a.jsx("div",{className:"usage-kpi-label",children:t}),a.jsx("div",{className:"usage-kpi-value",style:o?{color:o}:void 0,children:s}),r&&a.jsx("div",{className:"usage-kpi-sub",children:r})]})}function wN({day:t,max:s}){const r=o=>s>0?o/s*100:0;return a.jsxs("div",{className:"usage-day",title:`${t.date} · ${cs(t.input_tokens)} input · ${cs(t.cached_input_tokens)} cached · ${cs(t.output_tokens)} output · ${Or(t.cost_usd)}`,children:[a.jsxs("div",{className:"usage-day-bar",children:[a.jsx("div",{className:"usage-seg usage-seg-output",style:{height:`${r(t.output_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-cached",style:{height:`${r(t.cached_input_tokens+t.cache_write_input_tokens)}%`}}),a.jsx("div",{className:"usage-seg usage-seg-input",style:{height:`${r(t.input_tokens)}%`}})]}),a.jsx("div",{className:"usage-day-label",children:t.date.slice(5)})]})}function kN(){const t=M(R=>R.toggleUsageView),[s,r]=x.useState("30d"),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(vN),[m,v]=x.useState(null),[k,y]=x.useState(!1),S=x.useCallback(async()=>{y(!0),v(null);try{const{since:R,until:U}=mN(s),[A,L]=await Promise.all([ig(R,U),ig(gN(),null)]);l(A),d(L.totals.cost_usd)}catch(R){v(R.message)}finally{y(!1)}},[s]);x.useEffect(()=>{S()},[S]);const N=o==null?void 0:o.totals,E=p>0&&u!==null?p-u:null,T=x.useMemo(()=>Math.max(0,...((o==null?void 0:o.daily)??[]).map(R=>R.input_tokens+R.cached_input_tokens+R.output_tokens)),[o]),I=R=>{const U=Number(R.replace(",",".")),A=Number.isFinite(U)&&U>0?U:0;g(A),yN(A)};return a.jsxs("div",{className:"usage-view",children:[a.jsxs("div",{className:"usage-header",children:[a.jsxs("div",{className:"usage-title",children:[a.jsx(qg,{size:18})," Usage Center"]}),a.jsxs("div",{className:"usage-controls",children:[["today","7d","30d","all"].map(R=>a.jsx("button",{className:`usage-range-btn${s===R?" usage-range-btn-active":""}`,onClick:()=>r(R),children:R==="today"?"Today":R==="7d"?"7 days":R==="30d"?"30 days":"All"},R)),a.jsx("button",{className:"usage-range-btn",onClick:()=>void S(),title:"Refresh",children:a.jsx(kk,{size:13,className:k?"spin":void 0})}),a.jsx("button",{className:"dialog-close",title:"Close usage view","aria-label":"Close usage view",onClick:t,children:a.jsx(Tn,{size:16})})]})]}),m&&a.jsxs("div",{className:"usage-error",children:["Could not load usage data: ",m]}),!o&&!m&&a.jsx("div",{className:"usage-empty",children:"Loading…"}),o&&N&&a.jsxs("div",{className:"usage-body",children:[a.jsxs("div",{className:"usage-kpis",children:[a.jsx(el,{label:"Spend",value:Or(N.cost_usd),sub:N.unpriced_models.length>0?"excluding unpriced models":void 0}),a.jsx(el,{label:"Remaining (monthly)",value:E===null?"—":E>=0?Or(E):Or(0),sub:p>0&&u!==null?`this month ${Or(u)} / budget ${Or(p)}`:"no budget set",tone:E!==null&&E<0?"var(--red)":void 0}),a.jsx(el,{label:"Tokens",value:cs(N.input_tokens+N.cached_input_tokens+N.cache_write_input_tokens+N.output_tokens),sub:`input ${cs(N.input_tokens)} · cached ${cs(N.cached_input_tokens)} · write ${cs(N.cache_write_input_tokens)} · output ${cs(N.output_tokens)}`}),a.jsx(el,{label:"Calls",value:String(N.calls),sub:N.errors>0?`${N.errors} failed`:void 0,tone:N.errors>0?"var(--amber)":void 0})]}),a.jsxs("div",{className:"usage-budget",children:[a.jsx("label",{htmlFor:"usage-budget-input",children:"Monthly budget (USD)"}),a.jsx("input",{id:"usage-budget-input",type:"number",min:"0",step:"1",defaultValue:p>0?p:"",placeholder:"e.g. 50",onBlur:R=>I(R.target.value)}),p>0&&u!==null&&a.jsx("div",{className:"usage-budget-bar",children:a.jsx("div",{className:"usage-budget-fill",style:{width:`${Math.min(100,u/p*100)}%`,background:u>=p?"var(--red)":void 0}})})]}),N.unpriced_models.length>0&&a.jsxs("div",{className:"usage-note",children:["Unpriced models: ",N.unpriced_models.join(", ")]}),a.jsxs("div",{className:"usage-chart",children:[a.jsx("div",{className:"usage-section-title",children:"Daily usage"}),o.daily.length===0?a.jsx("div",{className:"usage-empty",children:"No usage in this range."}):a.jsx("div",{className:"usage-days",children:o.daily.map(R=>a.jsx(wN,{day:R,max:T},R.date))}),a.jsxs("div",{className:"usage-legend",children:[a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-input"})," input"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-cached"})," cached"]}),a.jsxs("span",{children:[a.jsx("span",{className:"usage-dot usage-seg-output"})," output"]})]})]}),a.jsxs("div",{className:"usage-table-wrap",children:[a.jsx("div",{className:"usage-section-title",children:"By model"}),a.jsxs("table",{className:"usage-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Runtime"}),a.jsx("th",{children:"Provider"}),a.jsx("th",{children:"Model"}),a.jsx("th",{children:"Effort"}),a.jsx("th",{children:"Calls"}),a.jsx("th",{children:"Input"}),a.jsx("th",{children:"Cached"}),a.jsx("th",{children:"Output"}),a.jsx("th",{children:"Cost"})]})}),a.jsxs("tbody",{children:[o.by_model.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:9,className:"usage-empty",children:"No usage records yet."})}),o.by_model.map(R=>a.jsxs("tr",{children:[a.jsx("td",{children:xN[R.runtime_type]??R.runtime_type}),a.jsx("td",{children:R.provider??"—"}),a.jsx("td",{title:R.model,children:R.model}),a.jsx("td",{children:R.reasoning_effort??"default"}),a.jsxs("td",{children:[R.calls,R.errors>0&&a.jsxs("span",{className:"usage-err",children:[" (",R.errors," failed)"]})]}),a.jsx("td",{children:cs(R.input_tokens)}),a.jsx("td",{children:cs(R.cached_input_tokens+R.cache_write_input_tokens)}),a.jsx("td",{children:cs(R.output_tokens)}),a.jsx("td",{children:R.cost_usd===null?a.jsx("span",{className:"usage-unpriced",children:"unknown"}):Or(R.cost_usd)})]},`${R.runtime_type}|${R.provider??""}|${R.model}|${R.reasoning_effort??""}`))]})]})]})]})]})}const og=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,SN=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,bN={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ty(){return mn()||window.location.origin}function ny(t,s){let r=s;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(og.test(o))return o;const l=SN.exec(o);if(!l)return null;let u;try{u=decodeURIComponent(l[1])}catch{return null}return u===t&&og.test(l[2])?l[2]:null}function ag(t){return/^https?:\/\//i.test(t.url)?t:{...t,url:`${ty()}${t.url}`}}function TN(t){return bN[t.slice(t.lastIndexOf(".")+1)]??"application/octet-stream"}function sy(t){return new Promise((s,r)=>{const o=new FileReader;o.onload=()=>{const l=String(o.result??"");s(l.slice(l.indexOf(",")+1))},o.onerror=()=>r(o.error??new Error("Could not read the file")),o.readAsDataURL(t)})}function NN(t,s){const r=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(t);return r?{type:s||r[1]||void 0,data:t.slice(r[0].length)}:{type:s,data:t}}async function ry(t){if(t instanceof Blob){const s=t.name;return{name:typeof s=="string"&&s?s:void 0,type:t.type||void 0,data:await sy(t)}}if(t&&typeof t=="object"&&typeof t.data=="string"){const s=t;return{name:typeof s.name=="string"&&s.name?s.name:void 0,type:typeof s.type=="string"&&s.type?s.type:void 0,data:s.data}}return null}async function jN(t){const s=await ry(t);if(!s)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return s}async function CN(t,s,r){if(s==null)return[];if(!Array.isArray(s))throw new Error("submitTurn: attachments must be an array");const o=[];for(let l=0;l<s.length;l++){const u=s[l],d=await ry(u);if(d){const{type:m,data:v}=NN(d.data,d.type);if(!m)throw new Error(`submitTurn: attachment ${l+1} has no type`);o.push({name:d.name??`attachment-${l+1}`,media_type:m,data:v});continue}const p=ny(t,u);if(!p)throw new Error(`submitTurn: attachment ${l+1} is not a file of this app`);const g=await r(p);o.push({name:p,media_type:TN(p),data:await sy(g)})}return o}const EN=`function (config) {
510
+ var nextId = 1;
511
+ var pending = new Map();
512
+ var listeners = [];
513
+ // Absolute http(s) URL, or null. Relative and #fragment hrefs are not
514
+ // external and keep their in-frame behavior.
515
+ function externalUrl(raw) {
516
+ if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
517
+ try { return new URL(raw.trim()).href; } catch (err) { return null; }
518
+ }
519
+ // New browser tab. The sandbox lets popups escape it, so the page loads
520
+ // like any other tab; noopener leaves it no handle back to this frame.
521
+ function openTab(url) {
522
+ window.open(url, '_blank', 'noopener,noreferrer');
523
+ }
524
+ // A plain external link would navigate THIS frame: the app disappears and
525
+ // most sites refuse to be framed anyway. Open it in a new tab instead.
526
+ // Bubble phase on window, so the app's own handlers run first and can
527
+ // still claim the click with preventDefault(). Modifier clicks and
528
+ // target="_blank" links already open a tab natively.
529
+ window.addEventListener('click', function (e) {
530
+ if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
531
+ var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
532
+ if (!a) return;
533
+ var target = (a.getAttribute('target') || '').toLowerCase();
534
+ if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
535
+ var url = externalUrl(a.getAttribute('href'));
536
+ if (!url) return;
537
+ e.preventDefault();
538
+ openTab(url);
539
+ });
540
+ // Stored files: <apiOrigin>/api/apps/<app-id>/files/<id>. Same reference
541
+ // rules as the pane (utils/appFiles.ts): an id, a file URL of this app on
542
+ // any origin, or an object carrying id/url.
543
+ var FILE_ID_RE = /^[a-f0-9]{64}\\.(?:png|jpg|gif|webp)$/;
544
+ var FILE_URL_RE = /^(?:https?:\\/\\/[^\\/?#]+)?\\/api\\/apps\\/([^\\/?#]+)\\/files\\/([^\\/?#]+)$/i;
545
+ function fileRefId(ref) {
546
+ if (ref && typeof ref === 'object') ref = typeof ref.id === 'string' ? ref.id : ref.url;
547
+ if (typeof ref !== 'string') return null;
548
+ var s = ref.trim();
549
+ if (FILE_ID_RE.test(s)) return s;
550
+ var m = FILE_URL_RE.exec(s);
551
+ if (!m) return null;
552
+ var owner;
553
+ try { owner = decodeURIComponent(m[1]); } catch (err) { return null; }
554
+ return owner === config.appId && FILE_ID_RE.test(m[2]) ? m[2] : null;
555
+ }
556
+ function fileUrl(ref) {
557
+ var id = fileRefId(ref);
558
+ if (!id) return typeof ref === 'string' ? ref : '';
559
+ return config.apiOrigin + '/api/apps/' + encodeURIComponent(config.appId) + '/files/' + id;
560
+ }
561
+ window.addEventListener('message', function (e) {
562
+ var msg = e.data;
563
+ if (!msg || msg.source !== 'agentpane-host') return;
564
+ if (msg.id != null && pending.has(msg.id)) {
565
+ var p = pending.get(msg.id);
566
+ pending.delete(msg.id);
567
+ if (msg.ok) {
568
+ p.resolve(msg.result);
569
+ } else {
570
+ var err = new Error(msg.error || 'bridge error');
571
+ // code 'conflict': setState's ifVersion is stale; state = the stored copy.
572
+ if (msg.code) err.code = msg.code;
573
+ if (msg.state) err.state = msg.state;
574
+ p.reject(err);
575
+ }
576
+ } else if (msg.event) {
577
+ for (var i = 0; i < listeners.length; i++) {
578
+ try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
579
+ }
580
+ }
581
+ });
582
+ function call(method, params) {
583
+ return new Promise(function (resolve, reject) {
584
+ var id = nextId++;
585
+ pending.set(id, { resolve: resolve, reject: reject });
586
+ try {
587
+ parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
588
+ } catch (err) {
589
+ // Params that cannot be cloned (functions, DOM nodes, ...).
590
+ pending.delete(id);
591
+ reject(err);
592
+ }
593
+ });
594
+ }
595
+ window.AgentPane = {
596
+ getApp: function () { return call('getApp'); },
597
+ getState: function () { return call('getState'); },
598
+ setState: function (data, opts) {
599
+ var params = { data: data };
600
+ if (opts && typeof opts.ifVersion === 'number') params.ifVersion = opts.ifVersion;
601
+ return call('setState', params);
602
+ },
603
+ createSession: function (opts) { return call('createSession', opts); },
604
+ submitTurn: function (sessionId, prompt, opts) {
605
+ var params = { sessionId: sessionId, prompt: prompt };
606
+ if (opts && opts.attachments != null) params.attachments = opts.attachments;
607
+ return call('submitTurn', params);
608
+ },
609
+ onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
610
+ onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
611
+ onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
612
+ onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
613
+ onBackgroundTasks: function (cb) { listeners.push(function (event, payload) { if (event === 'background_tasks' && payload) cb(payload); }); },
614
+ resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
615
+ openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
616
+ openUrl: function (url) {
617
+ var href = externalUrl(url);
618
+ if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
619
+ try { openTab(href); } catch (err) { return Promise.reject(err); }
620
+ return Promise.resolve({ ok: true });
621
+ },
622
+ uploadFile: function (file) { return call('uploadFile', { file: file }); },
623
+ getFile: function (ref) { return call('getFile', { ref: ref }); },
624
+ fileUrl: fileUrl
625
+ };
626
+ // Runtime error reporting — surface compile checks' blind side to the pane.
627
+ window.addEventListener('error', function (e) {
628
+ parent.postMessage({
629
+ source: 'agentpane-app', report: 'error',
630
+ message: e.message || 'Unknown error',
631
+ stack: (e.error && e.error.stack) || '',
632
+ line: e.lineno || 0, col: e.colno || 0
633
+ }, '*');
634
+ });
635
+ window.addEventListener('unhandledrejection', function (e) {
636
+ var r = e.reason;
637
+ var msg = r && (r.message || String(r)) || 'unknown';
638
+ parent.postMessage({
639
+ source: 'agentpane-app', report: 'error',
640
+ message: 'Unhandled promise rejection: ' + msg,
641
+ stack: (r && r.stack) || '', line: 0, col: 0
642
+ }, '*');
643
+ });
644
+ }`;function _N(t){return`(${EN})(${JSON.stringify(t)});`}function lg(t){return t.replace(/<\/script/gi,"<\\/script")}function RN(t,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let l=-1,u;for(;(u=o.exec(t))!==null;)l=u.index;return l}function cg(t,s,r){const o=RN(t,s);return o===-1?t+r:t.slice(0,o)+r+t.slice(o)}function AN(t,s,r){let o=t;const l=`<script>${lg(s)}<\/script>`;if(/<\/head>/i.test(o)?o=cg(o,"</head>",l):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${l}</head>`):o=`${l}${o}`,r){const u=`<script>${lg(r)}<\/script>`;o=cg(o,"</body>",u)}return o}function IN(){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 MN(t){var r;if(!(t instanceof yd)||t.status!==409)return null;const s=(r=t.body)==null?void 0:r.state;return s&&typeof s=="object"?s:null}function DN({appId:t,workspace:s=""}){const r=x.useRef(null),o=x.useRef({pinned:!1,data:null}),[l,u]=x.useState(null),[d,p]=x.useState(null),[g,m]=x.useState([]);x.useEffect(()=>{let S=!0;const N=IN(),E=I=>{const R=o.current.version;typeof I.version=="number"&&typeof R=="number"&&I.version<R||(o.current=I)};B0(t,I=>{var R,U;return(U=(R=r.current)==null?void 0:R.contentWindow)==null?void 0:U.postMessage(I,"*")},s);const T=async I=>{var K,$,ne,pe,G,ve,we,Oe,te,oe,ae,z,Q;if(I.source!==((K=r.current)==null?void 0:K.contentWindow))return;const R=I.data;if(!R||R.source!=="agentpane-app")return;if(R.report==="error"){const W={message:String(R.message??"Unknown error"),stack:String(R.stack??"")};m(C=>{const P=C[C.length-1];return P&&P.message===W.message?C:[...C,W].slice(-20)});return}if(typeof R.method!="string")return;let U=!0,A,L,q=null;try{switch(R.method){case"getApp":A={id:t};break;case"getState":try{const W=await Yh(t,s);E(W),A=W}catch{A=o.current}break;case"setState":{const W=(($=R.params)==null?void 0:$.data)??null,C=(ne=R.params)==null?void 0:ne.ifVersion,P={data:W,writer:N};typeof C=="number"&&(P.ifVersion=C);try{const se=await Pg(t,P,s);E(se),A=se}catch(se){if(q=MN(se),!q)throw se;E(q);const de=se.body;throw new Error(typeof(de==null?void 0:de.error)=="string"?de.error:"App state changed since that version")}break}case"createSession":{const W=R.params??{},C=await xd({title:typeof W.title=="string"?W.title:void 0,runtime_type:typeof W.runtime_type=="string"?W.runtime_type:void 0,model:typeof W.model=="string"?W.model:void 0,model_reasoning_effort:typeof W.model_reasoning_effort=="string"?W.model_reasoning_effort:void 0,cwd:typeof W.cwd=="string"?W.cwd:void 0,origin_app_id:t});Cu(C.id,t),M.getState().addSession(C),A=C;break}case"submitTurn":{const W=String(((pe=R.params)==null?void 0:pe.sessionId)??""),C=String(((G=R.params)==null?void 0:G.prompt)??""),P=await CN(t,(ve=R.params)==null?void 0:ve.attachments,de=>Cw(t,de)),se=await Tg(W,C,P.length?P:void 0,{originAppId:t});Cu(W,t),A=se;break}case"resolveToolCall":{const W=String(((we=R.params)==null?void 0:we.callId)??""),C=(Oe=R.params)==null?void 0:Oe.result;await bw(W,C),A={ok:!0};break}case"openSession":{if(M.getState().activeAppTabId!==t)throw new Error("openSession: the app is not on screen — call it from a click in the app");const W=typeof((te=R.params)==null?void 0:te.sessionId)=="string"?R.params.sessionId.trim():"";if(!W)throw new Error("openSession: sessionId is required");try{await M.getState().revealSession(W)}catch(C){throw new Error(`openSession: ${C instanceof Error?C.message:String(C)}`)}A={ok:!0};break}case"uploadFile":{const W=await jN((oe=R.params)==null?void 0:oe.file);try{A=ag(await Nw(t,W))}catch(C){throw new Error(`uploadFile: ${C instanceof Error?C.message:String(C)}`)}break}case"getFile":{const W=ny(t,(ae=R.params)==null?void 0:ae.ref),C=W?await jw(t,W):null;A=C?ag(C):null;break}default:throw new Error(`Unknown bridge method: ${R.method}`)}}catch(W){U=!1,L=W instanceof Error?W.message:String(W)}(Q=(z=r.current)==null?void 0:z.contentWindow)==null||Q.postMessage(q?{source:"agentpane-host",id:R.id,ok:U,error:L,code:"conflict",state:q}:{source:"agentpane-host",id:R.id,ok:U,result:A,error:L},"*")};return window.addEventListener("message",T),q0(t,I=>{var R,U;typeof I.workspace=="string"&&I.workspace!==s||I.writer!==N&&((U=(R=r.current)==null?void 0:R.contentWindow)==null||U.postMessage({source:"agentpane-host",event:"state_changed",payload:typeof I.version=="number"?{version:I.version}:{}},"*"))}),G0(t,()=>{qh(t).then(I=>{S&&(u(I),m([]))}).catch(()=>{})}),(async()=>{try{const[I,R,U]=await Promise.all([qh(t),Yh(t,s),yw(t).catch(()=>[])]);if(!S)return;o.current=R,U.forEach(A=>Cu(A.id,t)),u(I)}catch(I){S&&p(I instanceof Error?I.message:String(I))}})(),()=>{S=!1,W0(t),K0(t),Y0(t),window.removeEventListener("message",T)}},[t,s]);const v=x.useMemo(()=>l?AN(l.html,_N({appId:t,apiOrigin:ty()}),l.js):"",[l,t]);if(d)return a.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",d]});if(!v)return a.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(l==null?void 0:l.diagnostics)??[],y=k.some(S=>S.severity==="error");return a.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&a.jsxs("div",{className:`miniapp-diagnostics${y?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[a.jsx("div",{className:"miniapp-diagnostics-title",children:y?`Compile errors in ${(l==null?void 0:l.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((S,N)=>a.jsxs("div",{className:"miniapp-diag",children:[S.file,":",S.line,":",S.column," — ",S.message]},N))]}),a.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&&a.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((S,N)=>a.jsxs("div",{className:"miniapp-rt-error",children:[a.jsx("div",{className:"miniapp-rt-error-message",children:S.message}),S.stack&&a.jsx("pre",{className:"miniapp-rt-error-stack",children:S.stack})]},N))})]})}function LN({appId:t,active:s}){const r=M(y=>y.apps),o=M(y=>y.workspaces),l=M(y=>y.appWorkspaces),u=M(y=>y.setAppWorkspace),d=M(y=>y.setActiveAppTab),p=M(y=>y.startAppEdit),g=r.find(y=>y.id===t),m=l[t]??"",v=o.filter(y=>y.deleted!==1),k=m!==""&&!v.some(y=>y.path===m)?m:null;return a.jsxs("div",{className:`miniapp-view ${s?"":"miniapp-view-hidden"}`,children:[a.jsxs("div",{className:"miniapp-header",children:[a.jsx(ji,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),a.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.title)??t}),a.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=>u(t,y.target.value),children:[a.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(y=>a.jsx("option",{value:y.path,children:y.label||y.path.split("/").pop()||y.path},y.path)),k&&a.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),a.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:[a.jsx(xk,{size:13}),"Edit"]}),a.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>d(null),children:a.jsx(Tn,{size:14})})]}),a.jsx("div",{className:"miniapp-body",children:a.jsx(DN,{appId:t,workspace:m},`${t}:${m}`)})]})}function ON({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const[u,d]=x.useState(!1),p=x.useRef(0),g=x.useRef(0),m=x.useCallback(y=>{const S=y.clientX-p.current,N=t==="left"?g.current+S:g.current-S,E=Math.min(r,Math.max(s,N));l(E)},[t,s,r,l]),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,N;y.preventDefault(),y.stopPropagation();try{(N=(S=y.currentTarget)==null?void 0:S.setPointerCapture)==null||N.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:u}}function ug({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l}){const{onPointerDown:u,dragging:d}=ON({side:t,minWidth:s,maxWidth:r,getWidth:o,setWidth:l});return a.jsx("div",{className:`resize-handle ${t}${d?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${t} panel`,"data-resizing":d?"":void 0})}function PN(){Mt.trackRender("IdeWorkspace");const t=M(v=>v.sidebarWidth),s=M(v=>v.rightPanelWidth),r=M(v=>v.setSidebarWidth),o=M(v=>v.setRightPanelWidth),l=M(v=>v.rightPanelCollapsed),u=M(v=>v.vscodeViewOpen),d=M(v=>v.usageViewOpen),p=M(v=>v.activeAppTabId),g=M(v=>v.openAppTabs);x.useEffect(()=>{const v=()=>{const k=ll(),{rightPanelWidth:y,setRightPanelWidth:S}=M.getState();y>k&&S(k)};return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const m=l?`${t}px 6px 1fr ${dw}px`:`${t}px 6px 1fr 6px ${s}px`;return a.jsxs("div",{className:"ide-root",children:[a.jsxs("div",{className:`ide-layout ${u||d?"ide-hidden":""}`,style:{gridTemplateColumns:m},children:[a.jsx(_S,{}),a.jsx(ug,{side:"left",minWidth:qu,maxWidth:Yu,getWidth:()=>M.getState().sidebarWidth,setWidth:r}),a.jsxs("div",{className:"ide-center",children:[a.jsx(IS,{}),a.jsxs("div",{className:"ide-render",children:[g.map(v=>a.jsx(LN,{appId:v,active:p===v},v)),p==null&&a.jsx(CT,{})]}),a.jsx(zT,{})]}),!l&&a.jsx(ug,{side:"right",minWidth:al,maxWidth:ll(),getWidth:()=>M.getState().rightPanelWidth,setWidth:o}),a.jsx(iN,{})]}),u&&a.jsx(hN,{}),d&&a.jsx(kN,{}),a.jsx(lN,{})]})}function $N(){const{showNewSessionDialog:t,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=M(),l=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",d=(o==null?void 0:o.reasoning)??"",[p,g]=x.useState(""),[m,v]=x.useState(u),[k,y]=x.useState(d),[S,N]=x.useState("");if(!t)return null;const E=Xd(l),T=m?dd(l,m):[];function I(){r({title:p.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:S.trim()||void 0,runtime_type:l}),g(""),N("")}function R(A){A.key==="Escape"&&s(!1)}function U(A){var K;v(A);const L=dd(l,A);L.some($=>$.effort===k)||y(fd(l,A)??((K=L[0])==null?void 0:K.effort)??"")}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:A=>A.stopPropagation(),onKeyDown:R,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"New Session"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("label",{className:"dialog-label",children:["Title (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:p,onChange:A=>g(A.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Model",a.jsxs("select",{className:"dialog-input dialog-select",value:m,onChange:A=>U(A.target.value),children:[a.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(A=>a.jsxs("option",{value:A.slug,children:[A.displayName," — ",A.description]},A.slug))]})]}),T.length>0&&a.jsxs("label",{className:"dialog-label",children:["Thinking Level",a.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:A=>y(A.target.value),children:[a.jsxs("option",{value:"",children:["Default (",fd(l,m),")"]}),T.map(A=>a.jsx("option",{value:A.effort,children:A.label},A.effort))]})]}),a.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:S,onChange:A=>N(A.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>s(!1),children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:I,children:"Create"})]})]})})}function zN(t,s){const r=s!==""&&(t===s||t.startsWith(`${s}/`)),o=[r?{label:"~",path:s}:{label:"/",path:"/"}],l=t.slice(r?s.length:0);let u=o[0].path;for(const d of l.split("/").filter(Boolean))u=u==="/"?`/${d}`:`${u}/${d}`,o.push({label:d,path:u});return o}function FN(t){const s=t.filter(l=>l.deleted===0).at(-1);if(!s)return;const r=pr(s.path),o=r.lastIndexOf("/");return o>0?r.slice(0,o):void 0}function UN(){return M(s=>s.showAddWorkspaceDialog)?a.jsx(BN,{}):null}function BN(){var K;const t=M($=>$.setShowAddWorkspaceDialog),s=M($=>$.workspaces),r=M($=>$.createWorkspaceAt),o=M($=>$.addToast),[l,u]=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(()=>FN(M.getState().workspaces)),N=x.useRef(null),E=x.useCallback(()=>{v||t(!1)},[v,t]);Ni(E);const T=x.useCallback(async($,ne=!1)=>{const pe=++y.current;p(!0);let G=null,ve=null;try{G=await Rh($)}catch(we){if(ve=xi(we),ne&&$)try{G=await Rh(),ve=null}catch(Oe){ve=xi(Oe)}}pe===y.current&&(G&&u(G),m(ve),p(!1))},[]);x.useEffect(()=>{T(S,!0)},[T,S]);const I=l==null?void 0:l.path;x.useEffect(()=>{N.current&&(N.current.scrollTop=0)},[I]);const R=new Set(s.filter($=>$.deleted===0).map($=>pr($.path)));async function U($){if(!v){k(!0),m(null);try{const ne=await r($);t(!1),o("success",`Workspace added — ${ne.path}`)}catch(ne){m(xi(ne)),k(!1)}}}const A=l?zN(l.path,l.home):[],L=((K=A.at(-1))==null?void 0:K.label)??"",q=l!==null&&R.has(pr(l.path));return a.jsx("div",{className:"dialog-overlay",onClick:E,children:a.jsxs("div",{className:"dialog folder-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"folder-dialog-title",onClick:$=>$.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"folder-dialog-title",children:"Add workspace"}),a.jsx("button",{className:"dialog-close",onClick:E,"aria-label":"Close",disabled:v,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Choose a project folder",l&&a.jsxs(a.Fragment,{children:[" ","on ",a.jsx("strong",{children:l.hostname})]}),"."]}),a.jsxs("div",{className:"folder-nav",children:[a.jsx("button",{className:"folder-up",onClick:()=>(l==null?void 0:l.parent)&&void T(l.parent),disabled:!(l!=null&&l.parent),"aria-label":"Parent folder",title:"Parent folder",children:a.jsx(Vg,{size:14})}),a.jsx("nav",{className:"folder-crumbs","aria-label":"Folder path",children:A.map(($,ne)=>a.jsxs(x.Fragment,{children:[ne>0&&a.jsx(Eo,{size:12,className:"folder-crumb-sep","aria-hidden":"true"}),ne===A.length-1?a.jsx("span",{className:"folder-crumb current","aria-current":"location",title:$.path,children:$.label}):a.jsx("button",{className:"folder-crumb",onClick:()=>void T($.path),title:$.path,children:$.label})]},$.path))}),d&&l&&a.jsx(hn,{size:14,className:"spin folder-spinner","aria-label":"Loading"})]}),a.jsx("ul",{ref:N,className:`folder-list${d&&l?" loading":""}`,"aria-label":"Folders",children:l?l.folders.length===0?a.jsx("li",{className:"folder-empty",children:"No folders here."}):l.folders.map($=>a.jsxs("li",{className:"folder-item",children:[a.jsxs("button",{className:"folder-row",onClick:()=>void T($.path),title:$.path,"aria-label":$.git?`${$.name} (git repository)`:$.name,children:[$.git?a.jsx(sk,{size:15,className:"folder-icon git","aria-hidden":"true"}):a.jsx(ml,{size:15,className:"folder-icon","aria-hidden":"true"}),a.jsx("span",{className:"folder-name",children:$.name}),a.jsx(Eo,{size:13,className:"folder-chevron","aria-hidden":"true"})]}),R.has(pr($.path))?a.jsx("span",{className:"folder-tag",children:"Added"}):a.jsx("button",{className:"folder-add",onClick:()=>void U($.path),disabled:v,"aria-label":`Add ${$.name}`,children:"Add"})]},$.path)):d&&a.jsxs("li",{className:"folder-empty",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Loading folders…"]})}),(l==null?void 0:l.truncated)&&a.jsxs("p",{className:"folder-note",children:["Showing the first ",l.folders.length," folders."]}),g&&a.jsx("p",{className:"folder-error",role:"alert",children:g})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:E,disabled:v,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>l&&void U(l.path),disabled:!l||d||v||q,children:v?"Adding…":q?"Already added":`Add “${L}”`})]})]})})}const pd=6e4,hd=60*pd,tl=24*hd;function WN(t,s=Date.now()){const r=Date.parse(t);if(Number.isNaN(r))return"";const o=Math.max(0,s-r);return o<pd?"just now":o<hd?`${Math.floor(o/pd)} min ago`:o<tl?`${Math.floor(o/hd)} h ago`:o<2*tl?"yesterday":o<7*tl?`${Math.floor(o/tl)} days ago`:new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function HN(){const t=M(s=>s.importSessionsWorkspace);return t?a.jsx(VN,{workspace:t},t):null}function VN({workspace:t}){const s=M(A=>A.setImportSessionsWorkspace),r=M(A=>A.importClaudeSessions),[o,l]=x.useState(null),[u,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||s(null)},[m,s]);Ni(S),x.useEffect(()=>{let A=!1;return Mg(t).then(L=>{A||l(L)}).catch(L=>{A||d(xi(L))}),()=>{A=!0}},[t]);function N(A){g(L=>{const q=new Set(L);return q.has(A)?q.delete(A):q.add(A),q})}const E=o??[],T=E.length>0&&E.every(A=>p.has(A.session_id));async function I(){const A=E.filter($=>p.has($.session_id)).map($=>$.session_id);if(A.length===0)return;v(!0);const{imported:L,failed:q}=await r(t,A);if(v(!1),q.length===0){s(null);return}const K=new Set(L.map($=>$.import_source_id));l($=>($??[]).filter(ne=>!K.has(ne.session_id))),g(new Set(q.map($=>$.id))),y(new Map(q.map($=>[$.id,$.error])))}const R=t.split("/").pop()||t,U=p.size;return a.jsx("div",{className:"dialog-overlay",onClick:S,children:a.jsxs("div",{className:"dialog import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"import-dialog-title",onClick:A=>A.stopPropagation(),children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",id:"import-dialog-title",children:"Import Claude Code sessions"}),a.jsx("button",{className:"dialog-close",onClick:S,"aria-label":"Close",disabled:m,children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[a.jsxs("p",{className:"dialog-hint",children:["Sessions you started with ",a.jsx("code",{children:"claude"})," in ",a.jsx("strong",{title:t,children:R}),", in a terminal or an IDE. An imported session keeps its history and continues the same Claude conversation."]}),u?a.jsxs("p",{className:"import-error",role:"alert",children:["Could not list the sessions — ",u]}):o===null?a.jsxs("div",{className:"import-loading",role:"status",children:[a.jsx(hn,{size:14,className:"spin"})," Looking for sessions…"]}):o.length===0?a.jsxs("div",{className:"import-empty",children:["No Claude Code sessions to import here. Sessions you start with ",a.jsx("code",{children:"claude"})," in this folder will show up here."]}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"import-select-all",children:[a.jsx("input",{type:"checkbox",checked:T,disabled:m,onChange:()=>g(T?new Set:new Set(E.map(A=>A.session_id)))}),"Select all (",o.length,")"]}),a.jsx("ul",{className:"import-list",children:o.map(A=>{const L=k.get(A.session_id);return a.jsx("li",{children:a.jsxs("label",{className:`import-row${p.has(A.session_id)?" selected":""}`,children:[a.jsx("input",{type:"checkbox",checked:p.has(A.session_id),disabled:m,onChange:()=>N(A.session_id)}),a.jsxs("span",{className:"import-row-main",children:[a.jsx("span",{className:"import-row-title",title:A.title,children:A.title}),a.jsxs("span",{className:"import-row-meta",children:[a.jsx("span",{title:new Date(A.last_modified).toLocaleString(),children:WN(A.last_modified)}),A.git_branch&&a.jsxs("span",{className:"import-row-branch",title:"Git branch",children:[a.jsx(Yg,{size:10})," ",A.git_branch]})]}),A.recently_active&&a.jsxs("span",{className:"import-row-warn",children:[a.jsx(sv,{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&&a.jsx("span",{className:"import-row-error",role:"alert",children:L})]})]})},A.session_id)})})]})]}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:S,disabled:m,children:"Cancel"}),a.jsx("button",{className:"dialog-btn-create",onClick:()=>void I(),disabled:U===0||m,children:m?a.jsxs(a.Fragment,{children:[a.jsx(hn,{size:12,className:"spin"})," Importing…"]}):U>1?`Import ${U} sessions`:"Import"})]})]})})}const GN=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,KN=512*1024;function qN(t){const s=t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function YN(){const{appCatalogOpen:t,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:l,importAppFolder:u}=M(),[d,p]=x.useState("examples"),[g,m]=x.useState(null),[v,k]=x.useState(null),[y,S]=x.useState(!1),[N,E]=x.useState(""),[T,I]=x.useState(""),[R,U]=x.useState(""),[A,L]=x.useState(""),[q,K]=x.useState(null),[$,ne]=x.useState(""),pe=x.useRef(null);if(x.useEffect(()=>{t&&(m(null),xw().then(m).catch(()=>m([])))},[t]),x.useEffect(()=>{pe.current&&(pe.current.webkitdirectory=!0)},[d]),!t)return null;const G=new Set(r.map(z=>z.id));async function ve(z){k(z);try{await o(z)&&s()}finally{k(null)}}async function we(){if(y)return;const z=N.trim(),Q=T.trim();if(!(!z||!Q)){S(!0);try{await l({id:z,title:Q,description:R.trim()||void 0,icon:A.trim()||void 0})&&(E(""),I(""),U(""),L(""),s())}finally{S(!1)}}}async function Oe(z){const Q=Array.from(z.target.files??[]),W={};let C="";for(const P of Q){const de=(P.webkitRelativePath??"").split("/");!C&&de.length>1&&(C=de[0]);const X=de[de.length-1];if(!(!X||!GN.test(X))&&!(P.size>KN))try{W[X]=await P.text()}catch{}}K(Object.keys(W).length>0?W:null),ne(qN(C))}async function te(){if(!(y||!q||!$.trim())){S(!0);try{await u($.trim(),q)&&(K(null),ne(""),s())}finally{S(!1)}}}function oe(z){z.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return a.jsx("div",{className:"dialog-overlay",onClick:s,children:a.jsxs("div",{className:"dialog app-catalog",onClick:z=>z.stopPropagation(),onKeyDown:oe,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Add Mini App"}),a.jsx("button",{className:"dialog-close",onClick:s,children:"✕"})]}),a.jsx("div",{className:"catalog-tabs",children:ae.map(z=>a.jsx("button",{className:`catalog-tab${d===z.key?" active":""}`,onClick:()=>p(z.key),children:z.label},z.key))}),a.jsxs("div",{className:"dialog-body catalog-body",children:[d==="examples"&&a.jsx("div",{className:"catalog-examples",children:g===null?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?a.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(z=>{const Q=G.has(z.id);return a.jsxs("div",{className:"example-row",children:[a.jsx(ji,{iconNode:z.iconNode,size:14,className:"sidebar-app-icon"}),a.jsxs("div",{className:"example-info",children:[a.jsx("span",{className:"example-title",children:z.title}),z.description&&a.jsx("span",{className:"example-desc",children:z.description})]}),a.jsx("button",{className:"example-install",disabled:Q||v===z.id,onClick:()=>ve(z.id),title:Q?"Already installed":"Install this example",children:Q?"Installed":v===z.id?"Installing…":"Install"})]},z.id)})}),d==="new"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id (folder name)",a.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:z=>E(z.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),a.jsxs("label",{className:"dialog-label",children:["Title",a.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:z=>I(z.target.value),placeholder:"e.g. Todo List"})]}),a.jsxs("label",{className:"dialog-label",children:["Description (optional)",a.jsx("input",{className:"dialog-input",type:"text",value:R,onChange:z=>U(z.target.value),placeholder:"What does this app do?"})]}),a.jsxs("label",{className:"dialog-label",children:[a.jsxs("span",{children:["Icon (optional, a"," ",a.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),a.jsx("input",{className:"dialog-input",type:"text",value:A,onChange:z=>L(z.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!N.trim()||!T.trim(),onClick:we,children:[a.jsx(dr,{size:13})," Create App"]})]}),d==="upload"&&a.jsxs(a.Fragment,{children:[a.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."}),a.jsx("input",{ref:pe,type:"file",multiple:!0,onChange:Oe}),q&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["App id",a.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:z=>ne(z.target.value)})]}),a.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?", …":""]})]}),a.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!$.trim(),onClick:te,children:[a.jsx(jk,{size:13})," Import App"]})]})]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function XN(){const t=M(k=>k.showCommandPalette),s=M(k=>k.setShowCommandPalette),r=M(),[o,l]=x.useState(""),[u,d]=x.useState(0),p=x.useRef(null),g=x.useMemo(()=>{const k=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=Al(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:dr,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:Do,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:zr,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:uk,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:mr,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:vk,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&&(l(""),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[u];y&&(y.action(),s(!1))}else k.key==="Escape"&&s(!1)}return t?a.jsx("div",{className:"palette-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[a.jsxs("div",{className:"palette-search",children:[a.jsx("input",{ref:p,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{l(k.target.value),d(0)},onKeyDown:v}),a.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?a.jsx("div",{className:"palette-empty",children:"No matching commands"}):a.jsx("div",{className:"palette-list",children:m.map((k,y)=>{const S=k.icon;return a.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{k.action(),s(!1)},onMouseEnter:()=>d(y),children:[a.jsx("span",{className:"palette-item-icon",children:a.jsx(S,{size:16})}),a.jsx("span",{className:"palette-item-label",children:k.label}),a.jsx("span",{className:"palette-item-hint",children:k.hint}),y===u&&a.jsx(ek,{size:12,className:"palette-item-enter"})]},k.id)})}),a.jsxs("div",{className:"palette-footer",children:[a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↑"}),a.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"↵"})," Select"]}),a.jsxs("span",{className:"palette-footer-hint",children:[a.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const dg=/^[a-z][a-z0-9-]{1,30}$/,QN=2e3;function ZN(){const{showRemoteModal:t,setShowRemoteModal:s,selectSession:r}=M(),[o,l]=x.useState(null),[u,d]=x.useState(null),[p,g]=x.useState(!1),[m,v]=x.useState(!1),[k,y]=x.useState(!1),[S,N]=x.useState(!1),[E,T]=x.useState("main"),[I,R]=x.useState(""),[U,A]=x.useState(!1),[L,q]=x.useState(null),K=x.useRef(null);Mo(K,()=>N(!1),S);const $=m||k,ne=x.useCallback(async()=>{g(!0),d(null);try{const z=await fetch(`${mn()}/remote/status`,{headers:{Accept:"application/json"}});if(!z.ok)throw new Error(`status ${z.status}`);l(await z.json())}catch{l(null),d("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);x.useEffect(()=>{t&&(T("main"),q(null),ne())},[t,ne]);const pe=L!==null&&L.state==="running";if(x.useEffect(()=>{if(!pe)return;const z=setInterval(async()=>{try{const Q=await fetch(`${mn()}/remote/enable`,{headers:{Accept:"application/json"}});Q.ok&&q(await Q.json())}catch{}},QN);return()=>clearInterval(z)},[pe]),!t)return null;const G=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function ve(z){z.key==="Escape"&&s(!1)}async function we(z){if(dg.test(z)){A(!0);try{const Q=await fetch(`${mn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:z})});if(!Q.ok)throw new Error(`enable ${Q.status}`);q(await Q.json()),T("setup")}catch{d("Could not start the setup — check the daemon logs.")}finally{A(!1)}}}function Oe(){L!=null&&L.troubleshootingSessionId&&(r(L.troubleshootingSessionId),s(!1))}async function te(){v(!0);try{await fetch(`${mn()}/remote/disable`,{method:"POST"}),await ne()}catch{d("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function oe(){if(N(!1),!!window.confirm(`Remove the tunnel completely?
645
+
646
+ This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
647
+
648
+ 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 ne()}catch{d("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!L)return a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",a.jsx("input",{className:"dialog-input",value:I,onChange:C=>R(C.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),a.jsxs("div",{className:"dialog-footer",children:[a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>T("main"),children:"Back"}),a.jsxs("button",{className:"dialog-btn-create",disabled:!dg.test(I)||U,onClick:()=>void we(I),children:[U?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const z=["detect","provision","install","verify","ready"],Q=z.indexOf(L.step),W=L.state==="ready";return a.jsxs(a.Fragment,{children:[L.state==="running"&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),L.state==="ready"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[a.jsx(Ts,{size:14})," Setup complete — you can close this window."]}),L.state==="ready"&&L.hostname&&a.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",a.jsx("a",{href:`https://${L.hostname}`,target:"_blank",rel:"noreferrer",children:L.hostname})]}),a.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:z.map((C,P)=>{const se=W||Q>-1&&P<Q,de=!W&&P===Q&&L.state==="running";return a.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:se||de?1:.4,color:se?"var(--green)":void 0},children:[se?a.jsx(Ts,{size:13}):de?a.jsx(hn,{size:13,className:"spin"}):a.jsx(Zw,{size:9,style:{marginLeft:2,marginRight:2}}),C]},C)})}),L.logs.length>0&&a.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:L.logs.slice(-3).map(C=>C.message).join(`
649
+ `)}),L.state==="troubleshooting"&&a.jsxs(a.Fragment,{children:[a.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."}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-create",onClick:Oe,children:"Open troubleshooting session"})})]}),L.state==="failed"&&a.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",L.error]}),a.jsx("div",{className:"dialog-footer",children:a.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ne(),children:"Refresh status"})})]})}return a.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:a.jsxs("div",{className:"dialog",onClick:z=>z.stopPropagation(),onKeyDown:ve,children:[a.jsxs("div",{className:"dialog-header",children:[a.jsx("span",{className:"dialog-title",children:"Remote Access"}),a.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:a.jsx(Tn,{size:16})})]}),a.jsxs("div",{className:"dialog-body",children:[p&&a.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[a.jsx(hn,{size:14,className:"spin"})," Loading machine status…"]}),u&&a.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),E==="setup"?ae():a.jsxs(a.Fragment,{children:[G&&(o==null?void 0:o.tunnel.hostname)&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),a.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[a.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void te(),disabled:$,children:[m?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),a.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>N(z=>!z),disabled:$,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":S,children:k?a.jsx(hn,{size:14,className:"spin"}):a.jsx(Si,{size:14})}),S&&a.jsx("div",{ref:K,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:a.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void oe(),children:[a.jsx(us,{size:12})," Remove tunnel"]})})]})]}),!G&&a.jsx(a.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",a.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void we(o.tunnel.mahlas),disabled:U,children:[U?a.jsx(hn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):a.jsx(em,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>T("setup"),children:[a.jsx(em,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),a.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const JN={success:Xw,error:Ll,info:ik,warn:sv},ej=4e3;function tj({toast:t}){const s=M(d=>d.removeToast),r=JN[t.type],o=x.useRef(null);x.useEffect(()=>{function d(){o.current=setTimeout(()=>s(t.id),ej)}return d(),()=>{o.current&&clearTimeout(o.current)}},[t.id,s]);function l(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(t.id),2e3)}return a.jsxs("div",{className:`toast toast-${t.type}`,onMouseEnter:l,onMouseLeave:u,children:[a.jsx(r,{size:16}),a.jsx("span",{className:"toast-message",children:t.message}),t.undoAction&&a.jsxs("button",{className:"toast-undo",onClick:()=>{var d;(d=t.undoAction)==null||d.call(t),s(t.id)},children:[a.jsx(Nk,{size:12})," ",t.undoLabel||"Undo"]}),a.jsx("button",{className:"toast-close",onClick:()=>s(t.id),children:a.jsx(Tn,{size:14})})]})}function nj(){const t=M(s=>s.toasts);return t.length===0?null:a.jsx("div",{className:"toast-container",children:t.map(s=>a.jsx(tj,{toast:s},s.id))})}function sj(){const[t]=x.useState(iw),[s,r]=x.useState(!1),[o,l]=x.useState(!1),u=x.useRef(void 0);x.useEffect(()=>()=>clearTimeout(u.current),[]);async function d(){await bl(Uh)&&(r(!0),l(!0),clearTimeout(u.current),u.current=setTimeout(()=>r(!1),1500))}return a.jsxs("main",{className:"daemon-download",children:[a.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),t&&a.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg app to continue."}),a.jsxs("div",{className:"daemon-download-install",children:[t&&a.jsx("p",{className:"daemon-download-label",children:"Not installed? Run this in Terminal:"}),a.jsxs("div",{className:"daemon-download-cmd",onCopy:()=>l(!0),children:[a.jsx("span",{className:"daemon-download-prompt","aria-hidden":"true",children:"$"}),a.jsx("code",{children:Uh}),a.jsx("button",{type:"button",className:`daemon-download-copy${s?" copied":""}`,onClick:()=>void d(),"aria-label":"Copy the install command",title:s?"Copied":"Copy",children:s?a.jsx(Ts,{size:15}):a.jsx(hl,{size:15})})]}),!t&&a.jsx("p",{className:"daemon-download-meta",children:"Apple Silicon · macOS 13+"})]}),o&&a.jsx("p",{className:"daemon-download-hint",children:"Paste it into Terminal and press Return. Repoburg installs and opens in your menu bar."}),(t||o)&&a.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[a.jsx(hn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Jn=null,Ti=null,To=1e3;const rj=1e4;function ij(){const t=mn();return t?`${t.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function md(){Jn&&(Jn.readyState===WebSocket.OPEN||Jn.readyState===WebSocket.CONNECTING)||(Jn=new WebSocket(ij()),Jn.onopen=()=>{const t=To>1e3;if(To=1e3,M.getState().setWsConnected(!0),M.getState().addLogEntry("INFO","WebSocket connected"),t){X0();const s=M.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Jn.onclose=()=>{M.getState().setWsConnected(!1),M.getState().addLogEntry("WARN","WebSocket disconnected"),M.getState().addToast("warn","WebSocket disconnected — reconnecting…"),aj()},Jn.onerror=()=>{},Jn.onmessage=t=>{try{const s=JSON.parse(t.data);Mt.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof t.data=="string"?t.data.length:0);const r=lj[s.event];r&&r(s.data)}catch{}})}function oj(){Ti&&(clearTimeout(Ti),Ti=null),Jn&&(Jn.onclose=null,Jn.close(),Jn=null),M.getState().setWsConnected(!1)}function aj(){Ti||(Ti=window.setTimeout(()=>{Ti=null,md()},To),To=Math.min(To*2,rj))}const lj={"turn:created":t=>{const s=t;M.getState().onTurnCreated(s.sessionId,s.turn)},"turn:started":t=>{const s=t;Mt.note(`turn:started — ${s.turnId.slice(0,8)}`),M.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":t=>{const s=t;M.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":t=>{const s=t;M.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":t=>{const s=t;M.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":t=>{const s=t;M.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":t=>{const s=t;Mt.note(`turn:completed — ${s.turnId.slice(0,8)}`),M.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":t=>{const s=t;M.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":t=>{const s=t,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage,...s.autoCompactThreshold?{autoCompactThreshold:s.autoCompactThreshold}:{}};M.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":t=>{const s=t;M.getState().onTurnFailed(s.sessionId,s.turnId,s.error,s.resumeState)},"turn:interrupted":t=>{const s=t;Mt.note(`turn:interrupted — ${s.turnId.slice(0,8)} (${s.reason})`),M.getState().onTurnInterrupted(s.sessionId,s.turnId,{reason:s.reason,interruptedAt:s.interruptedAt,attempts:s.attempts,detail:s.detail??null})},"turn:resuming":t=>{const s=t;M.getState().onTurnResuming(s.sessionId,s.turnId,s.attempt)},"turn:resumed":t=>{const s=t;M.getState().onTurnResumed(s.sessionId,s.turnId)},"turn:retrying":t=>{const s=t;M.getState().onTurnRetrying(s.sessionId,s.turnId,{attempt:s.attempt,maxRetries:s.maxRetries,retryDelayMs:s.retryDelayMs,errorStatus:s.errorStatus??null,error:s.error??null})},"turn:cancelled":t=>{const s=t;M.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":t=>{const s=t;M.getState().onSessionTitle(s.sessionId,s.title)},"session:touched":t=>{const s=t;M.getState().onSessionTouched(s.sessionId)},"session:updated":t=>{const s=t;M.getState().onSessionUpdated(s.session)},background_tasks:t=>{const s=t;Mt.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),M.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"background_tasks:snapshot":t=>{const s=t;M.getState().onBackgroundTasksSnapshot(s.sessions??{})},"thread:created":t=>{const s=t;M.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":t=>{const s=t;M.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":t=>{const s=t;M.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":t=>{const s=t;M.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":t=>{const s=t;H0(s.appId,s.callId,s.tool,s.args??{},s.workspace)},"app:source:updated":t=>{Q0(t.appId),M.getState().refreshApps()},"app:state_changed":t=>{const{appId:s,...r}=t;Dg(s,r)}};function cj(){const t=M(s=>s.init);return x.useEffect(()=>{o0();function s(){t(),md()}const{daemonStatus:r,setDaemonStatus:o}=M.getState();let l=null;r==="ready"?s():l=aw({onMissing:()=>o("missing"),onReady:()=>{o("ready"),s()}});function u(){if(document.visibilityState!=="visible")return;const d=M.getState(),p=d.activeSessionId;if(!p)return;const g=d.sessionDetails[p];d.wsConnected||md(),g&&g.is_running===1&&(d.refreshActiveSession(),d.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{l==null||l(),oj(),document.removeEventListener("visibilitychange",u)}},[t]),null}const iy="agentpaneView";function gd(t){return{tab:wd(t),vscode:t.vscodeViewOpen,usage:t.usageViewOpen}}function oy(t,s){return t.tab===s.tab&&t.vscode===s.vscode&&t.usage===s.usage}function fg(t){return t.tab===null&&!t.vscode&&!t.usage}function pg(t,s){return s.tab!==null&&!t.tabOrder.includes(s.tab)?!1:!oy(s,gd(t))}function hg(t){const s=t==null?void 0:t[iy];return typeof(s==null?void 0:s.index)=="number"?s:null}function uj(t,s){if(t.vscodeViewOpen!==s.vscode&&t.toggleVscodeView(),t.usageViewOpen!==s.usage&&t.toggleUsageView(),s.tab===null)return;const{kind:r,id:o}=fr(s.tab);r==="app"?t.openAppTab(o):t.activeSessionId===o?t.setActiveAppTab(null):t.selectSession(o)}function dj(t){let s=hg(window.history.state)??{index:0,newest:0,view:gd(t.getState())},r=s.newest,o=!1;const l=new Map([[s.index,s.view]]),u=y=>{const S=t.getState();for(let N=s.index+y;N>=0&&N<=r;N+=y){const E=l.get(N);if(!E||pg(S,E))return!0}return!1},d=()=>{const y=u(-1),S=u(1),N=t.getState();(N.canGoBack!==y||N.canGoForward!==S)&&t.setState({canGoBack:y,canGoForward:S})},p=()=>({[iy]:{...s,newest:r}}),g=()=>{window.history.replaceState({...window.history.state,...p()},"")},m=y=>{if(l.set(s.index,s.view),fg(s.view))s={...s,view:y},g();else{s={index:s.index+1,newest:s.index+1,view:y},r=s.index;for(const S of l.keys())S>r&&l.delete(S);window.history.pushState(p(),"")}l.set(s.index,y)},v=y=>{const S=hg(y.state);if(!S)return;l.set(S.index,S.view),r=Math.max(r,S.index);const N=t.getState(),E=Math.sign(S.index-s.index);if(E!==0&&!pg(N,S.view)){const T=S.index+E;window.history.go(T<0||T>r?s.index-S.index:E);return}s=S,g(),o=!0;try{uj(N,S.view)}finally{o=!1}d()};g(),d(),window.addEventListener("popstate",v);const k=t.subscribe((y,S)=>{const N=y.activeSessionId!==S.activeSessionId||y.activeAppTabId!==S.activeAppTabId||y.vscodeViewOpen!==S.vscodeViewOpen||y.usageViewOpen!==S.usageViewOpen;if(!(!N&&y.tabOrder===S.tabOrder)){if(N&&!o){const E=gd(y);!fg(E)&&!oy(E,s.view)&&m(E)}d()}});return()=>{k(),window.removeEventListener("popstate",v)}}function fj(){const t=M(u=>u.loading),s=M(u=>u.error),r=M(u=>u.sessions),o=M(u=>u.daemonStatus),l=M(u=>u.setShowCommandPalette);return x.useEffect(()=>Mt.start(),[]),x.useEffect(()=>dj(M),[]),x.useEffect(()=>{function u(d){(d.metaKey||d.ctrlKey)&&d.key==="k"&&(d.preventDefault(),l(!0))}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]),a.jsxs(a.Fragment,{children:[a.jsx(cj,{}),o==="missing"?a.jsx(sj,{}):o==="checking"||t&&r.length===0?a.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?a.jsxs("div",{className:"empty-state",children:["Error: ",s]}):a.jsxs(a.Fragment,{children:[a.jsx(PN,{}),a.jsx($N,{}),a.jsx(UN,{}),a.jsx(HN,{}),a.jsx(YN,{}),a.jsx(ZN,{}),a.jsx(XN,{}),a.jsx(nj,{})]})]})}Yx.createRoot(document.getElementById("root")).render(a.jsx(ot.StrictMode,{children:a.jsx(fj,{})}));