repoburg 1.3.267 → 1.3.269

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.
@@ -1,542 +0,0 @@
1
- var _y=Object.defineProperty;var jy=(n,r,s)=>r in n?_y(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var ot=(n,r,s)=>jy(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function _m(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Jc={exports:{}},Xi={},eu={exports:{}},He={};/**
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 Up;function Ry(){if(Up)return He;Up=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function x(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function R(A,j,X){this.props=A,this.context=j,this.refs=C,this.updater=X||T}R.prototype.isReactComponent={},R.prototype.setState=function(A,j){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,j,"setState")},R.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function L(){}L.prototype=R.prototype;function b(A,j,X){this.props=A,this.context=j,this.refs=C,this.updater=X||T}var U=b.prototype=new L;U.constructor=b,E(U,R.prototype),U.isPureReactComponent=!0;var P=Array.isArray,W=Object.prototype.hasOwnProperty,K={current:null},q={key:!0,ref:!0,__self:!0,__source:!0};function G(A,j,X){var se,ve={},Se=null,Pe=null;if(j!=null)for(se in j.ref!==void 0&&(Pe=j.ref),j.key!==void 0&&(Se=""+j.key),j)W.call(j,se)&&!q.hasOwnProperty(se)&&(ve[se]=j[se]);var Re=arguments.length-2;if(Re===1)ve.children=X;else if(1<Re){for(var Me=Array(Re),Ne=0;Ne<Re;Ne++)Me[Ne]=arguments[Ne+2];ve.children=Me}if(A&&A.defaultProps)for(se in Re=A.defaultProps,Re)ve[se]===void 0&&(ve[se]=Re[se]);return{$$typeof:n,type:A,key:Se,ref:Pe,props:ve,_owner:K.current}}function ce(A,j){return{$$typeof:n,type:A.type,key:j,ref:A.ref,props:A.props,_owner:A._owner}}function pe(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function ue(A){var j={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(X){return j[X]})}var de=/\/+/g;function he(A,j){return typeof A=="object"&&A!==null&&A.key!=null?ue(""+A.key):j.toString(36)}function Le(A,j,X,se,ve){var Se=typeof A;(Se==="undefined"||Se==="boolean")&&(A=null);var Pe=!1;if(A===null)Pe=!0;else switch(Se){case"string":case"number":Pe=!0;break;case"object":switch(A.$$typeof){case n:case r:Pe=!0}}if(Pe)return Pe=A,ve=ve(Pe),A=se===""?"."+he(Pe,0):se,P(ve)?(X="",A!=null&&(X=A.replace(de,"$&/")+"/"),Le(ve,j,X,"",function(Ne){return Ne})):ve!=null&&(pe(ve)&&(ve=ce(ve,X+(!ve.key||Pe&&Pe.key===ve.key?"":(""+ve.key).replace(de,"$&/")+"/")+A)),j.push(ve)),1;if(Pe=0,se=se===""?".":se+":",P(A))for(var Re=0;Re<A.length;Re++){Se=A[Re];var Me=se+he(Se,Re);Pe+=Le(Se,j,X,Me,ve)}else if(Me=x(A),typeof Me=="function")for(A=Me.call(A),Re=0;!(Se=A.next()).done;)Se=Se.value,Me=se+he(Se,Re++),Pe+=Le(Se,j,X,Me,ve);else if(Se==="object")throw j=String(A),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.");return Pe}function te(A,j,X){if(A==null)return A;var se=[],ve=0;return Le(A,se,"","",function(Se){return j.call(X,Se,ve++)}),se}function ie(A){if(A._status===-1){var j=A._result;j=j(),j.then(function(X){(A._status===0||A._status===-1)&&(A._status=1,A._result=X)},function(X){(A._status===0||A._status===-1)&&(A._status=2,A._result=X)}),A._status===-1&&(A._status=0,A._result=j)}if(A._status===1)return A._result.default;throw A._result}var le={current:null},$={transition:null},Y={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:$,ReactCurrentOwner:K};function H(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:te,forEach:function(A,j,X){te(A,function(){j.apply(this,arguments)},X)},count:function(A){var j=0;return te(A,function(){j++}),j},toArray:function(A){return te(A,function(j){return j})||[]},only:function(A){if(!pe(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},He.Component=R,He.Fragment=s,He.Profiler=a,He.PureComponent=b,He.StrictMode=o,He.Suspense=m,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,He.act=H,He.cloneElement=function(A,j,X){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var se=E({},A.props),ve=A.key,Se=A.ref,Pe=A._owner;if(j!=null){if(j.ref!==void 0&&(Se=j.ref,Pe=K.current),j.key!==void 0&&(ve=""+j.key),A.type&&A.type.defaultProps)var Re=A.type.defaultProps;for(Me in j)W.call(j,Me)&&!q.hasOwnProperty(Me)&&(se[Me]=j[Me]===void 0&&Re!==void 0?Re[Me]:j[Me])}var Me=arguments.length-2;if(Me===1)se.children=X;else if(1<Me){Re=Array(Me);for(var Ne=0;Ne<Me;Ne++)Re[Ne]=arguments[Ne+2];se.children=Re}return{$$typeof:n,type:A.type,key:ve,ref:Se,props:se,_owner:Pe}},He.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},He.createElement=G,He.createFactory=function(A){var j=G.bind(null,A);return j.type=A,j},He.createRef=function(){return{current:null}},He.forwardRef=function(A){return{$$typeof:p,render:A}},He.isValidElement=pe,He.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:ie}},He.memo=function(A,j){return{$$typeof:g,type:A,compare:j===void 0?null:j}},He.startTransition=function(A){var j=$.transition;$.transition={};try{A()}finally{$.transition=j}},He.unstable_act=H,He.useCallback=function(A,j){return le.current.useCallback(A,j)},He.useContext=function(A){return le.current.useContext(A)},He.useDebugValue=function(){},He.useDeferredValue=function(A){return le.current.useDeferredValue(A)},He.useEffect=function(A,j){return le.current.useEffect(A,j)},He.useId=function(){return le.current.useId()},He.useImperativeHandle=function(A,j,X){return le.current.useImperativeHandle(A,j,X)},He.useInsertionEffect=function(A,j){return le.current.useInsertionEffect(A,j)},He.useLayoutEffect=function(A,j){return le.current.useLayoutEffect(A,j)},He.useMemo=function(A,j){return le.current.useMemo(A,j)},He.useReducer=function(A,j,X){return le.current.useReducer(A,j,X)},He.useRef=function(A){return le.current.useRef(A)},He.useState=function(A){return le.current.useState(A)},He.useSyncExternalStore=function(A,j,X){return le.current.useSyncExternalStore(A,j,X)},He.useTransition=function(){return le.current.useTransition()},He.version="18.3.1",He}var Bp;function Vu(){return Bp||(Bp=1,eu.exports=Ry()),eu.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 Wp;function Ay(){if(Wp)return Xi;Wp=1;var n=Vu(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(p,m,g){var v,k={},x=null,T=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(T=m.ref);for(v in m)o.call(m,v)&&!u.hasOwnProperty(v)&&(k[v]=m[v]);if(p&&p.defaultProps)for(v in m=p.defaultProps,m)k[v]===void 0&&(k[v]=m[v]);return{$$typeof:r,type:p,key:x,ref:T,props:k,_owner:a.current}}return Xi.Fragment=s,Xi.jsx=f,Xi.jsxs=f,Xi}var Hp;function Iy(){return Hp||(Hp=1,Jc.exports=Ay()),Jc.exports}var c=Iy(),w=Vu();const st=_m(w);var _a={},tu={exports:{}},Nn={},nu={exports:{}},ru={};/**
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 Vp;function Dy(){return Vp||(Vp=1,(function(n){function r($,Y){var H=$.length;$.push(Y);e:for(;0<H;){var A=H-1>>>1,j=$[A];if(0<a(j,Y))$[A]=Y,$[H]=j,H=A;else break e}}function s($){return $.length===0?null:$[0]}function o($){if($.length===0)return null;var Y=$[0],H=$.pop();if(H!==Y){$[0]=H;e:for(var A=0,j=$.length,X=j>>>1;A<X;){var se=2*(A+1)-1,ve=$[se],Se=se+1,Pe=$[Se];if(0>a(ve,H))Se<j&&0>a(Pe,ve)?($[A]=Pe,$[Se]=H,A=Se):($[A]=ve,$[se]=H,A=se);else if(Se<j&&0>a(Pe,H))$[A]=Pe,$[Se]=H,A=Se;else break e}}return Y}function a($,Y){var H=$.sortIndex-Y.sortIndex;return H!==0?H:$.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],g=[],v=1,k=null,x=3,T=!1,E=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,b=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($){for(var Y=s(g);Y!==null;){if(Y.callback===null)o(g);else if(Y.startTime<=$)o(g),Y.sortIndex=Y.expirationTime,r(m,Y);else break;Y=s(g)}}function P($){if(C=!1,U($),!E)if(s(m)!==null)E=!0,ie(W);else{var Y=s(g);Y!==null&&le(P,Y.startTime-$)}}function W($,Y){E=!1,C&&(C=!1,L(G),G=-1),T=!0;var H=x;try{for(U(Y),k=s(m);k!==null&&(!(k.expirationTime>Y)||$&&!ue());){var A=k.callback;if(typeof A=="function"){k.callback=null,x=k.priorityLevel;var j=A(k.expirationTime<=Y);Y=n.unstable_now(),typeof j=="function"?k.callback=j:k===s(m)&&o(m),U(Y)}else o(m);k=s(m)}if(k!==null)var X=!0;else{var se=s(g);se!==null&&le(P,se.startTime-Y),X=!1}return X}finally{k=null,x=H,T=!1}}var K=!1,q=null,G=-1,ce=5,pe=-1;function ue(){return!(n.unstable_now()-pe<ce)}function de(){if(q!==null){var $=n.unstable_now();pe=$;var Y=!0;try{Y=q(!0,$)}finally{Y?he():(K=!1,q=null)}}else K=!1}var he;if(typeof b=="function")he=function(){b(de)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,te=Le.port2;Le.port1.onmessage=de,he=function(){te.postMessage(null)}}else he=function(){R(de,0)};function ie($){q=$,K||(K=!0,he())}function le($,Y){G=R(function(){$(n.unstable_now())},Y)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_continueExecution=function(){E||T||(E=!0,ie(W))},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ce=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return s(m)},n.unstable_next=function($){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var H=x;x=Y;try{return $()}finally{x=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=x;x=$;try{return Y()}finally{x=H}},n.unstable_scheduleCallback=function($,Y,H){var A=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?A+H:A):H=A,$){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=H+j,$={id:v++,callback:Y,priorityLevel:$,startTime:H,expirationTime:j,sortIndex:-1},H>A?($.sortIndex=H,r(g,$),s(m)===null&&$===s(g)&&(C?(L(G),G=-1):C=!0,le(P,H-A))):($.sortIndex=j,r(m,$),E||T||(E=!0,ie(W))),$},n.unstable_shouldYield=ue,n.unstable_wrapCallback=function($){var Y=x;return function(){var H=x;x=Y;try{return $.apply(this,arguments)}finally{x=H}}}})(ru)),ru}var qp;function My(){return qp||(qp=1,nu.exports=Dy()),nu.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 Gp;function Ly(){if(Gp)return Nn;Gp=1;var n=Vu(),r=My();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[: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 x(e){return m.call(k,e)?!0:m.call(v,e)?!1:g.test(e)?k[e]=!0:(v[e]=!0,!1)}function T(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,i,l){if(t===null||typeof t>"u"||T(e,t,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,i,l,d,h,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=y}var R={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){R[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];R[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){R[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){R[e]=new C(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){R[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){R[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){R[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){R[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){R[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var L=/[\-:]([a-z])/g;function b(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(L,b);R[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(L,b);R[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(L,b);R[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){R[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),R.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){R[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function U(e,t,i,l){var d=R.hasOwnProperty(t)?R[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(E(t,i,d,l)&&(i=null),l||d===null?x(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var P=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),K=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),ce=Symbol.for("react.profiler"),pe=Symbol.for("react.provider"),ue=Symbol.for("react.context"),de=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),Le=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=$&&e[$]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,A;function j(e){if(A===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);A=t&&t[1]||""}return`
34
- `+A+e}var X=!1;function se(e,t){if(!e||X)return"";X=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(B){var l=B}Reflect.construct(e,[],t)}else{try{t.call()}catch(B){l=B}e.call(t.prototype)}else{try{throw Error()}catch(B){l=B}e()}}catch(B){if(B&&l&&typeof B.stack=="string"){for(var d=B.stack.split(`
35
- `),h=l.stack.split(`
36
- `),y=d.length-1,N=h.length-1;1<=y&&0<=N&&d[y]!==h[N];)N--;for(;1<=y&&0<=N;y--,N--)if(d[y]!==h[N]){if(y!==1||N!==1)do if(y--,N--,0>N||d[y]!==h[N]){var I=`
37
- `+d[y].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=y&&0<=N);break}}}finally{X=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?j(e):""}function ve(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function Se(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 q:return"Fragment";case K:return"Portal";case ce:return"Profiler";case G:return"StrictMode";case he:return"Suspense";case Le:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ue:return(e.displayName||"Context")+".Consumer";case pe:return(e._context.displayName||"Context")+".Provider";case de:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case ie:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}function Pe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(t);case 8:return t===G?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ne(e){var t=Me(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,h=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(y){l=""+y,h.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rt(e){e._valueTracker||(e._valueTracker=Ne(e))}function Oe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Me(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function mt(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 Fe(e,t){var i=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function _t(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Re(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ue(e,t){t=t.checked,t!=null&&U(e,"checked",t,!1)}function Yt(e,t){Ue(e,t);var i=Re(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?at(e,t.type,i):t.hasOwnProperty("defaultValue")&&at(e,t.type,Re(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function On(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function at(e,t,i){(t!=="number"||mt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var yt=Array.isArray;function lt(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Re(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Ft(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return H({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function V(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(s(92));if(yt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Re(i)}}function me(e,t){var i=Re(t.value),l=Re(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Be(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Je(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 ct(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Je(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ut,gt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(t,i,l,d)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ut=ut||document.createElement("div"),ut.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ut.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xt(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var xt={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},Kn=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){Kn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function En(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function yr(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=En(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Yn=H({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 un(e,t){if(t){if(Yn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function zn(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mt=null,dn=null,nt=null;function At(e){if(e=Li(e)){if(typeof Mt!="function")throw Error(s(280));var t=e.stateNode;t&&(t=Wo(t),Mt(e.stateNode,e.type,t))}}function jt(e){dn?nt?nt.push(e):nt=[e]:dn=e}function Ut(){if(dn){var e=dn,t=nt;if(nt=dn=null,At(e),t)for(e=0;e<t.length;e++)At(t[e])}}function _(e,t){return e(t)}function re(){}var Q=!1;function ge(e,t,i){if(Q)return e(t,i);Q=!0;try{return _(e,t,i)}finally{Q=!1,(dn!==null||nt!==null)&&(re(),Ut())}}function Ce(e,t){var i=e.stateNode;if(i===null)return null;var l=Wo(i);if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var We=!1;if(p)try{var je={};Object.defineProperty(je,"passive",{get:function(){We=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch{We=!1}function et(e,t,i,l,d,h,y,N,I){var B=Array.prototype.slice.call(arguments,3);try{t.apply(i,B)}catch(ee){this.onError(ee)}}var ft=!1,wt=null,kt=!1,rn=null,fn={onError:function(e){ft=!0,wt=e}};function lr(e,t,i,l,d,h,y,N,I){ft=!1,wt=null,et.apply(fn,arguments)}function Ir(e,t,i,l,d,h,y,N,I){if(lr.apply(this,arguments),ft){if(ft){var B=wt;ft=!1,wt=null}else throw Error(s(198));kt||(kt=!0,rn=B)}}function Ee(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function it(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Xn(e){if(Ee(e)!==e)throw Error(s(188))}function To(e){var t=e.alternate;if(!t){if(t=Ee(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var h=d.alternate;if(h===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===i)return Xn(d),e;if(h===l)return Xn(d),t;h=h.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=h;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,l=h;break}if(N===l){y=!0,l=d,i=h;break}N=N.sibling}if(!y){for(N=h.child;N;){if(N===i){y=!0,i=h,l=d;break}if(N===l){y=!0,l=h,i=d;break}N=N.sibling}if(!y)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function Es(e){return e=To(e),e!==null?gi(e):null}function gi(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gi(e);if(t!==null)return t;e=e.sibling}return null}var vi=r.unstable_scheduleCallback,bo=r.unstable_cancelCallback,Tl=r.unstable_shouldYield,bl=r.unstable_requestPaint,St=r.unstable_now,cr=r.unstable_getCurrentPriorityLevel,Dr=r.unstable_ImmediatePriority,ur=r.unstable_UserBlockingPriority,_s=r.unstable_NormalPriority,ns=r.unstable_LowPriority,No=r.unstable_IdlePriority,rs=null,_n=null;function js(e){if(_n&&typeof _n.onCommitFiberRoot=="function")try{_n.onCommitFiberRoot(rs,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:ss,Rs=Math.log,Mr=Math.LN2;function ss(e){return e>>>=0,e===0?32:31-(Rs(e)/Mr|0)|0}var hn=64,As=4194304;function is(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 os(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,h=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?l=is(N):(h&=y,h!==0&&(l=is(h)))}else y=i&~d,y!==0?l=is(y):h!==0&&(l=is(h));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,h=t&-t,d>=h||d===16&&(h&4194240)!==0))return t;if((l&4)!==0&&(l|=i&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)i=31-pn(t),d=1<<i,l|=e[i],t&=~d;return l}function Co(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Eo(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes;0<h;){var y=31-pn(h),N=1<<y,I=d[y];I===-1?((N&i)===0||(N&l)!==0)&&(d[y]=Co(N,t)):I<=t&&(e.expiredLanes|=N),h&=~N}}function yi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xi(){var e=hn;return hn<<=1,(hn&4194240)===0&&(hn=64),e}function wi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function as(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=i}function _o(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-pn(i),h=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~h}}function Lr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-pn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ge=0;function oe(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,O,Z,we,_e,$e=!1,Ke=[],Xe=null,Tt=null,bt=null,xr=new Map,It=new Map,Pr=[],Xg="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 Td(e,t){switch(e){case"focusin":case"focusout":Xe=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":xr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function ki(e,t,i,l,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:h,targetContainers:[d]},t!==null&&(t=Li(t),t!==null&&O(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Qg(e,t,i,l,d){switch(t){case"focusin":return Xe=ki(Xe,e,t,i,l,d),!0;case"dragenter":return Tt=ki(Tt,e,t,i,l,d),!0;case"mouseover":return bt=ki(bt,e,t,i,l,d),!0;case"pointerover":var h=d.pointerId;return xr.set(h,ki(xr.get(h)||null,e,t,i,l,d)),!0;case"gotpointercapture":return h=d.pointerId,It.set(h,ki(It.get(h)||null,e,t,i,l,d)),!0}return!1}function bd(e){var t=ls(e.target);if(t!==null){var i=Ee(t);if(i!==null){if(t=i.tag,t===13){if(t=it(i),t!==null){e.blockedOn=t,_e(e.priority,function(){Z(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Cl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);tn=l,i.target.dispatchEvent(l),tn=null}else return t=Li(i),t!==null&&O(t),e.blockedOn=i,!1;t.shift()}return!0}function Nd(e,t,i){jo(e)&&i.delete(t)}function Zg(){$e=!1,Xe!==null&&jo(Xe)&&(Xe=null),Tt!==null&&jo(Tt)&&(Tt=null),bt!==null&&jo(bt)&&(bt=null),xr.forEach(Nd),It.forEach(Nd)}function Si(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Zg)))}function Ti(e){function t(d){return Si(d,e)}if(0<Ke.length){Si(Ke[0],e);for(var i=1;i<Ke.length;i++){var l=Ke[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Xe!==null&&Si(Xe,e),Tt!==null&&Si(Tt,e),bt!==null&&Si(bt,e),xr.forEach(t),It.forEach(t),i=0;i<Pr.length;i++)l=Pr[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Pr.length&&(i=Pr[0],i.blockedOn===null);)bd(i),i.blockedOn===null&&Pr.shift()}var Is=P.ReactCurrentBatchConfig,Ro=!0;function Jg(e,t,i,l){var d=Ge,h=Is.transition;Is.transition=null;try{Ge=1,Nl(e,t,i,l)}finally{Ge=d,Is.transition=h}}function ev(e,t,i,l){var d=Ge,h=Is.transition;Is.transition=null;try{Ge=4,Nl(e,t,i,l)}finally{Ge=d,Is.transition=h}}function Nl(e,t,i,l){if(Ro){var d=Cl(e,t,i,l);if(d===null)Wl(e,t,l,Ao,i),Td(e,l);else if(Qg(d,e,t,i,l))l.stopPropagation();else if(Td(e,l),t&4&&-1<Xg.indexOf(e)){for(;d!==null;){var h=Li(d);if(h!==null&&S(h),h=Cl(e,t,i,l),h===null&&Wl(e,t,l,Ao,i),h===d)break;d=h}d!==null&&l.stopPropagation()}else Wl(e,t,l,null,i)}}var Ao=null;function Cl(e,t,i,l){if(Ao=null,e=nn(l),e=ls(e),e!==null)if(t=Ee(e),t===null)e=null;else if(i=t.tag,i===13){if(e=it(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ao=e,null}function Cd(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(cr()){case Dr:return 1;case ur:return 4;case _s:case ns:return 16;case No:return 536870912;default:return 16}default:return 16}}var Or=null,El=null,Io=null;function Ed(){if(Io)return Io;var e,t=El,i=t.length,l,d="value"in Or?Or.value:Or.textContent,h=d.length;for(e=0;e<i&&t[e]===d[e];e++);var y=i-e;for(l=1;l<=y&&t[i-l]===d[h-l];l++);return Io=d.slice(e,1<l?1-l:void 0)}function Do(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Mo(){return!0}function _d(){return!1}function jn(e){function t(i,l,d,h,y){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=h,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(h):h[N]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Mo:_d,this.isPropagationStopped=_d,this}return H(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Mo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Mo)},persist:function(){},isPersistent:Mo}),t}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_l=jn(Ds),bi=H({},Ds,{view:0,detail:0}),tv=jn(bi),jl,Rl,Ni,Lo=H({},bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Il,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!==Ni&&(Ni&&e.type==="mousemove"?(jl=e.screenX-Ni.screenX,Rl=e.screenY-Ni.screenY):Rl=jl=0,Ni=e),jl)},movementY:function(e){return"movementY"in e?e.movementY:Rl}}),jd=jn(Lo),nv=H({},Lo,{dataTransfer:0}),rv=jn(nv),sv=H({},bi,{relatedTarget:0}),Al=jn(sv),iv=H({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),ov=jn(iv),av=H({},Ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lv=jn(av),cv=H({},Ds,{data:0}),Rd=jn(cv),uv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dv={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"},fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fv[e])?!!t[e]:!1}function Il(){return pv}var hv=H({},bi,{key:function(e){if(e.key){var t=uv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Do(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Il,charCode:function(e){return e.type==="keypress"?Do(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Do(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),mv=jn(hv),gv=H({},Lo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ad=jn(gv),vv=H({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Il}),yv=jn(vv),xv=H({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),wv=jn(xv),kv=H({},Lo,{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}),Sv=jn(kv),Tv=[9,13,27,32],Dl=p&&"CompositionEvent"in window,Ci=null;p&&"documentMode"in document&&(Ci=document.documentMode);var bv=p&&"TextEvent"in window&&!Ci,Id=p&&(!Dl||Ci&&8<Ci&&11>=Ci),Dd=" ",Md=!1;function Ld(e,t){switch(e){case"keyup":return Tv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ms=!1;function Nv(e,t){switch(e){case"compositionend":return Pd(t);case"keypress":return t.which!==32?null:(Md=!0,Dd);case"textInput":return e=t.data,e===Dd&&Md?null:e;default:return null}}function Cv(e,t){if(Ms)return e==="compositionend"||!Dl&&Ld(e,t)?(e=Ed(),Io=El=Or=null,Ms=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Id&&t.locale!=="ko"?null:t.data;default:return null}}var Ev={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 Od(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ev[e.type]:t==="textarea"}function zd(e,t,i,l){jt(l),t=Fo(t,"onChange"),0<t.length&&(i=new _l("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ei=null,_i=null;function _v(e){nf(e,0)}function Po(e){var t=$s(e);if(Oe(t))return e}function jv(e,t){if(e==="change")return t}var $d=!1;if(p){var Ml;if(p){var Ll="oninput"in document;if(!Ll){var Fd=document.createElement("div");Fd.setAttribute("oninput","return;"),Ll=typeof Fd.oninput=="function"}Ml=Ll}else Ml=!1;$d=Ml&&(!document.documentMode||9<document.documentMode)}function Ud(){Ei&&(Ei.detachEvent("onpropertychange",Bd),_i=Ei=null)}function Bd(e){if(e.propertyName==="value"&&Po(_i)){var t=[];zd(t,_i,e,nn(e)),ge(_v,t)}}function Rv(e,t,i){e==="focusin"?(Ud(),Ei=t,_i=i,Ei.attachEvent("onpropertychange",Bd)):e==="focusout"&&Ud()}function Av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Po(_i)}function Iv(e,t){if(e==="click")return Po(t)}function Dv(e,t){if(e==="input"||e==="change")return Po(t)}function Mv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Qn=typeof Object.is=="function"?Object.is:Mv;function ji(e,t){if(Qn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(t,d)||!Qn(e[d],t[d]))return!1}return!0}function Wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hd(e,t){var i=Wd(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Wd(i)}}function Vd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qd(){for(var e=window,t=mt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=mt(e.document)}return t}function Pl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Lv(e){var t=qd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Vd(i.ownerDocument.documentElement,i)){if(l!==null&&Pl(i)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(e,i.value.length);else if(e=(t=i.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,h=Math.min(l.start,d);l=l.end===void 0?h:Math.min(l.end,d),!e.extend&&h>l&&(d=l,l=h,h=d),d=Hd(i,h);var y=Hd(i,l);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),h>l?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Pv=p&&"documentMode"in document&&11>=document.documentMode,Ls=null,Ol=null,Ri=null,zl=!1;function Gd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;zl||Ls==null||Ls!==mt(l)||(l=Ls,"selectionStart"in l&&Pl(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ri&&ji(Ri,l)||(Ri=l,l=Fo(Ol,"onSelect"),0<l.length&&(t=new _l("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Ls)))}function Oo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ps={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionend:Oo("Transition","TransitionEnd")},$l={},Kd={};p&&(Kd=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function zo(e){if($l[e])return $l[e];if(!Ps[e])return e;var t=Ps[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Kd)return $l[e]=t[i];return e}var Yd=zo("animationend"),Xd=zo("animationiteration"),Qd=zo("animationstart"),Zd=zo("transitionend"),Jd=new Map,ef="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 zr(e,t){Jd.set(e,t),u(t,[e])}for(var Fl=0;Fl<ef.length;Fl++){var Ul=ef[Fl],Ov=Ul.toLowerCase(),zv=Ul[0].toUpperCase()+Ul.slice(1);zr(Ov,"on"+zv)}zr(Yd,"onAnimationEnd"),zr(Xd,"onAnimationIteration"),zr(Qd,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(Zd,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("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 Ai="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(" "),$v=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ai));function tf(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,Ir(l,t,void 0,e),e.currentTarget=null}function nf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=l.event;l=l.listeners;e:{var h=void 0;if(t)for(var y=l.length-1;0<=y;y--){var N=l[y],I=N.instance,B=N.currentTarget;if(N=N.listener,I!==h&&d.isPropagationStopped())break e;tf(d,N,B),h=I}else for(y=0;y<l.length;y++){if(N=l[y],I=N.instance,B=N.currentTarget,N=N.listener,I!==h&&d.isPropagationStopped())break e;tf(d,N,B),h=I}}}if(kt)throw e=rn,kt=!1,rn=null,e}function pt(e,t){var i=t[Yl];i===void 0&&(i=t[Yl]=new Set);var l=e+"__bubble";i.has(l)||(rf(t,e,2,!1),i.add(l))}function Bl(e,t,i){var l=0;t&&(l|=4),rf(i,e,l,t)}var $o="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[$o]){e[$o]=!0,o.forEach(function(i){i!=="selectionchange"&&($v.has(i)||Bl(i,!1,e),Bl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$o]||(t[$o]=!0,Bl("selectionchange",!1,t))}}function rf(e,t,i,l){switch(Cd(t)){case 1:var d=Jg;break;case 4:d=ev;break;default:d=Nl}i=d.bind(null,t,i,e),d=void 0,!We||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(t,i,{capture:!0,passive:d}):e.addEventListener(t,i,!0):d!==void 0?e.addEventListener(t,i,{passive:d}):e.addEventListener(t,i,!1)}function Wl(e,t,i,l,d){var h=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=l.return;y!==null;){var I=y.tag;if((I===3||I===4)&&(I=y.stateNode.containerInfo,I===d||I.nodeType===8&&I.parentNode===d))return;y=y.return}for(;N!==null;){if(y=ls(N),y===null)return;if(I=y.tag,I===5||I===6){l=h=y;continue e}N=N.parentNode}}l=l.return}ge(function(){var B=h,ee=nn(i),ne=[];e:{var J=Jd.get(e);if(J!==void 0){var fe=_l,xe=e;switch(e){case"keypress":if(Do(i)===0)break e;case"keydown":case"keyup":fe=mv;break;case"focusin":xe="focus",fe=Al;break;case"focusout":xe="blur",fe=Al;break;case"beforeblur":case"afterblur":fe=Al;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":fe=jd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=yv;break;case Yd:case Xd:case Qd:fe=ov;break;case Zd:fe=wv;break;case"scroll":fe=tv;break;case"wheel":fe=Sv;break;case"copy":case"cut":case"paste":fe=lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=Ad}var ke=(t&4)!==0,Dt=!ke&&e==="scroll",z=ke?J!==null?J+"Capture":null:J;ke=[];for(var D=B,F;D!==null;){F=D;var ae=F.stateNode;if(F.tag===5&&ae!==null&&(F=ae,z!==null&&(ae=Ce(D,z),ae!=null&&ke.push(Di(D,ae,F)))),Dt)break;D=D.return}0<ke.length&&(J=new fe(J,xe,null,i,ee),ne.push({event:J,listeners:ke}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",J&&i!==tn&&(xe=i.relatedTarget||i.fromElement)&&(ls(xe)||xe[wr]))break e;if((fe||J)&&(J=ee.window===ee?ee:(J=ee.ownerDocument)?J.defaultView||J.parentWindow:window,fe?(xe=i.relatedTarget||i.toElement,fe=B,xe=xe?ls(xe):null,xe!==null&&(Dt=Ee(xe),xe!==Dt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(fe=null,xe=B),fe!==xe)){if(ke=jd,ae="onMouseLeave",z="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(ke=Ad,ae="onPointerLeave",z="onPointerEnter",D="pointer"),Dt=fe==null?J:$s(fe),F=xe==null?J:$s(xe),J=new ke(ae,D+"leave",fe,i,ee),J.target=Dt,J.relatedTarget=F,ae=null,ls(ee)===B&&(ke=new ke(z,D+"enter",xe,i,ee),ke.target=F,ke.relatedTarget=Dt,ae=ke),Dt=ae,fe&&xe)t:{for(ke=fe,z=xe,D=0,F=ke;F;F=Os(F))D++;for(F=0,ae=z;ae;ae=Os(ae))F++;for(;0<D-F;)ke=Os(ke),D--;for(;0<F-D;)z=Os(z),F--;for(;D--;){if(ke===z||z!==null&&ke===z.alternate)break t;ke=Os(ke),z=Os(z)}ke=null}else ke=null;fe!==null&&sf(ne,J,fe,ke,!1),xe!==null&&Dt!==null&&sf(ne,Dt,xe,ke,!0)}}e:{if(J=B?$s(B):window,fe=J.nodeName&&J.nodeName.toLowerCase(),fe==="select"||fe==="input"&&J.type==="file")var Te=jv;else if(Od(J))if($d)Te=Dv;else{Te=Av;var Ie=Rv}else(fe=J.nodeName)&&fe.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(Te=Iv);if(Te&&(Te=Te(e,B))){zd(ne,Te,i,ee);break e}Ie&&Ie(e,J,B),e==="focusout"&&(Ie=J._wrapperState)&&Ie.controlled&&J.type==="number"&&at(J,"number",J.value)}switch(Ie=B?$s(B):window,e){case"focusin":(Od(Ie)||Ie.contentEditable==="true")&&(Ls=Ie,Ol=B,Ri=null);break;case"focusout":Ri=Ol=Ls=null;break;case"mousedown":zl=!0;break;case"contextmenu":case"mouseup":case"dragend":zl=!1,Gd(ne,i,ee);break;case"selectionchange":if(Pv)break;case"keydown":case"keyup":Gd(ne,i,ee)}var De;if(Dl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ms?Ld(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(Id&&i.locale!=="ko"&&(Ms||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ms&&(De=Ed()):(Or=ee,El="value"in Or?Or.value:Or.textContent,Ms=!0)),Ie=Fo(B,ze),0<Ie.length&&(ze=new Rd(ze,e,null,i,ee),ne.push({event:ze,listeners:Ie}),De?ze.data=De:(De=Pd(i),De!==null&&(ze.data=De)))),(De=bv?Nv(e,i):Cv(e,i))&&(B=Fo(B,"onBeforeInput"),0<B.length&&(ee=new Rd("onBeforeInput","beforeinput",null,i,ee),ne.push({event:ee,listeners:B}),ee.data=De))}nf(ne,t)})}function Di(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Fo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,h=d.stateNode;d.tag===5&&h!==null&&(d=h,h=Ce(e,i),h!=null&&l.unshift(Di(e,h,d)),h=Ce(e,t),h!=null&&l.push(Di(e,h,d))),e=e.return}return l}function Os(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sf(e,t,i,l,d){for(var h=t._reactName,y=[];i!==null&&i!==l;){var N=i,I=N.alternate,B=N.stateNode;if(I!==null&&I===l)break;N.tag===5&&B!==null&&(N=B,d?(I=Ce(i,h),I!=null&&y.unshift(Di(i,I,N))):d||(I=Ce(i,h),I!=null&&y.push(Di(i,I,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var Fv=/\r\n?/g,Uv=/\u0000|\uFFFD/g;function of(e){return(typeof e=="string"?e:""+e).replace(Fv,`
38
- `).replace(Uv,"")}function Uo(e,t,i){if(t=of(t),of(e)!==t&&i)throw Error(s(425))}function Bo(){}var Hl=null,Vl=null;function ql(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gl=typeof setTimeout=="function"?setTimeout:void 0,Bv=typeof clearTimeout=="function"?clearTimeout:void 0,af=typeof Promise=="function"?Promise:void 0,Wv=typeof queueMicrotask=="function"?queueMicrotask:typeof af<"u"?function(e){return af.resolve(null).then(e).catch(Hv)}:Gl;function Hv(e){setTimeout(function(){throw e})}function Kl(e,t){var i=t,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Ti(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ti(t)}function $r(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return e;t--}else i==="/$"&&t++}e=e.previousSibling}return null}var zs=Math.random().toString(36).slice(2),dr="__reactFiber$"+zs,Mi="__reactProps$"+zs,wr="__reactContainer$"+zs,Yl="__reactEvents$"+zs,Vv="__reactListeners$"+zs,qv="__reactHandles$"+zs;function ls(e){var t=e[dr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[wr]||i[dr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=lf(e);e!==null;){if(i=e[dr])return i;e=lf(e)}return t}e=i,i=e.parentNode}return null}function Li(e){return e=e[dr]||e[wr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $s(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Wo(e){return e[Mi]||null}var Xl=[],Fs=-1;function Fr(e){return{current:e}}function ht(e){0>Fs||(e.current=Xl[Fs],Xl[Fs]=null,Fs--)}function dt(e,t){Fs++,Xl[Fs]=e.current,e.current=t}var Ur={},sn=Fr(Ur),wn=Fr(!1),cs=Ur;function Us(e,t){var i=e.type.contextTypes;if(!i)return Ur;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},h;for(h in i)d[h]=t[h];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function kn(e){return e=e.childContextTypes,e!=null}function Ho(){ht(wn),ht(sn)}function cf(e,t,i){if(sn.current!==Ur)throw Error(s(168));dt(sn,t),dt(wn,i)}function uf(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(s(108,Pe(e)||"Unknown",d));return H({},i,l)}function Vo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ur,cs=sn.current,dt(sn,e),dt(wn,wn.current),!0}function df(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=uf(e,t,cs),l.__reactInternalMemoizedMergedChildContext=e,ht(wn),ht(sn),dt(sn,e)):ht(wn),dt(wn,i)}var kr=null,qo=!1,Ql=!1;function ff(e){kr===null?kr=[e]:kr.push(e)}function Gv(e){qo=!0,ff(e)}function Br(){if(!Ql&&kr!==null){Ql=!0;var e=0,t=Ge;try{var i=kr;for(Ge=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}kr=null,qo=!1}catch(d){throw kr!==null&&(kr=kr.slice(e+1)),vi(Dr,Br),d}finally{Ge=t,Ql=!1}}return null}var Bs=[],Ws=0,Go=null,Ko=0,$n=[],Fn=0,us=null,Sr=1,Tr="";function ds(e,t){Bs[Ws++]=Ko,Bs[Ws++]=Go,Go=e,Ko=t}function pf(e,t,i){$n[Fn++]=Sr,$n[Fn++]=Tr,$n[Fn++]=us,us=e;var l=Sr;e=Tr;var d=32-pn(l)-1;l&=~(1<<d),i+=1;var h=32-pn(t)+d;if(30<h){var y=d-d%5;h=(l&(1<<y)-1).toString(32),l>>=y,d-=y,Sr=1<<32-pn(t)+d|i<<d|l,Tr=h+e}else Sr=1<<h|i<<d|l,Tr=e}function Zl(e){e.return!==null&&(ds(e,1),pf(e,1,0))}function Jl(e){for(;e===Go;)Go=Bs[--Ws],Bs[Ws]=null,Ko=Bs[--Ws],Bs[Ws]=null;for(;e===us;)us=$n[--Fn],$n[Fn]=null,Tr=$n[--Fn],$n[Fn]=null,Sr=$n[--Fn],$n[Fn]=null}var Rn=null,An=null,vt=!1,Zn=null;function hf(e,t){var i=Hn(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=e,t=e.deletions,t===null?(e.deletions=[i],e.flags|=16):t.push(i)}function mf(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Rn=e,An=$r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rn=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=us!==null?{id:Sr,overflow:Tr}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Hn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,Rn=e,An=null,!0):!1;default:return!1}}function ec(e){return(e.mode&1)!==0&&(e.flags&128)===0}function tc(e){if(vt){var t=An;if(t){var i=t;if(!mf(e,t)){if(ec(e))throw Error(s(418));t=$r(i.nextSibling);var l=Rn;t&&mf(e,t)?hf(l,i):(e.flags=e.flags&-4097|2,vt=!1,Rn=e)}}else{if(ec(e))throw Error(s(418));e.flags=e.flags&-4097|2,vt=!1,Rn=e}}}function gf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rn=e}function Yo(e){if(e!==Rn)return!1;if(!vt)return gf(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ql(e.type,e.memoizedProps)),t&&(t=An)){if(ec(e))throw vf(),Error(s(418));for(;t;)hf(e,t),t=$r(t.nextSibling)}if(gf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){An=$r(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}An=null}}else An=Rn?$r(e.stateNode.nextSibling):null;return!0}function vf(){for(var e=An;e;)e=$r(e.nextSibling)}function Hs(){An=Rn=null,vt=!1}function nc(e){Zn===null?Zn=[e]:Zn.push(e)}var Kv=P.ReactCurrentBatchConfig;function Pi(e,t,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(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(y){var N=d.refs;y===null?delete N[h]:N[h]=y},t._stringRef=h,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Xo(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yf(e){var t=e._init;return t(e._payload)}function xf(e){function t(z,D){if(e){var F=z.deletions;F===null?(z.deletions=[D],z.flags|=16):F.push(D)}}function i(z,D){if(!e)return null;for(;D!==null;)t(z,D),D=D.sibling;return null}function l(z,D){for(z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function d(z,D){return z=Xr(z,D),z.index=0,z.sibling=null,z}function h(z,D,F){return z.index=F,e?(F=z.alternate,F!==null?(F=F.index,F<D?(z.flags|=2,D):F):(z.flags|=2,D)):(z.flags|=1048576,D)}function y(z){return e&&z.alternate===null&&(z.flags|=2),z}function N(z,D,F,ae){return D===null||D.tag!==6?(D=Gc(F,z.mode,ae),D.return=z,D):(D=d(D,F),D.return=z,D)}function I(z,D,F,ae){var Te=F.type;return Te===q?ee(z,D,F.props.children,ae,F.key):D!==null&&(D.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ie&&yf(Te)===D.type)?(ae=d(D,F.props),ae.ref=Pi(z,D,F),ae.return=z,ae):(ae=wa(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Pi(z,D,F),ae.return=z,ae)}function B(z,D,F,ae){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Kc(F,z.mode,ae),D.return=z,D):(D=d(D,F.children||[]),D.return=z,D)}function ee(z,D,F,ae,Te){return D===null||D.tag!==7?(D=xs(F,z.mode,ae,Te),D.return=z,D):(D=d(D,F),D.return=z,D)}function ne(z,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Gc(""+D,z.mode,F),D.return=z,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case W:return F=wa(D.type,D.key,D.props,null,z.mode,F),F.ref=Pi(z,null,D),F.return=z,F;case K:return D=Kc(D,z.mode,F),D.return=z,D;case ie:var ae=D._init;return ne(z,ae(D._payload),F)}if(yt(D)||Y(D))return D=xs(D,z.mode,F,null),D.return=z,D;Xo(z,D)}return null}function J(z,D,F,ae){var Te=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Te!==null?null:N(z,D,""+F,ae);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Te?I(z,D,F,ae):null;case K:return F.key===Te?B(z,D,F,ae):null;case ie:return Te=F._init,J(z,D,Te(F._payload),ae)}if(yt(F)||Y(F))return Te!==null?null:ee(z,D,F,ae,null);Xo(z,F)}return null}function fe(z,D,F,ae,Te){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return z=z.get(F)||null,N(D,z,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case W:return z=z.get(ae.key===null?F:ae.key)||null,I(D,z,ae,Te);case K:return z=z.get(ae.key===null?F:ae.key)||null,B(D,z,ae,Te);case ie:var Ie=ae._init;return fe(z,D,F,Ie(ae._payload),Te)}if(yt(ae)||Y(ae))return z=z.get(F)||null,ee(D,z,ae,Te,null);Xo(D,ae)}return null}function xe(z,D,F,ae){for(var Te=null,Ie=null,De=D,ze=D=0,Ht=null;De!==null&&ze<F.length;ze++){De.index>ze?(Ht=De,De=null):Ht=De.sibling;var Qe=J(z,De,F[ze],ae);if(Qe===null){De===null&&(De=Ht);break}e&&De&&Qe.alternate===null&&t(z,De),D=h(Qe,D,ze),Ie===null?Te=Qe:Ie.sibling=Qe,Ie=Qe,De=Ht}if(ze===F.length)return i(z,De),vt&&ds(z,ze),Te;if(De===null){for(;ze<F.length;ze++)De=ne(z,F[ze],ae),De!==null&&(D=h(De,D,ze),Ie===null?Te=De:Ie.sibling=De,Ie=De);return vt&&ds(z,ze),Te}for(De=l(z,De);ze<F.length;ze++)Ht=fe(De,z,ze,F[ze],ae),Ht!==null&&(e&&Ht.alternate!==null&&De.delete(Ht.key===null?ze:Ht.key),D=h(Ht,D,ze),Ie===null?Te=Ht:Ie.sibling=Ht,Ie=Ht);return e&&De.forEach(function(Qr){return t(z,Qr)}),vt&&ds(z,ze),Te}function ke(z,D,F,ae){var Te=Y(F);if(typeof Te!="function")throw Error(s(150));if(F=Te.call(F),F==null)throw Error(s(151));for(var Ie=Te=null,De=D,ze=D=0,Ht=null,Qe=F.next();De!==null&&!Qe.done;ze++,Qe=F.next()){De.index>ze?(Ht=De,De=null):Ht=De.sibling;var Qr=J(z,De,Qe.value,ae);if(Qr===null){De===null&&(De=Ht);break}e&&De&&Qr.alternate===null&&t(z,De),D=h(Qr,D,ze),Ie===null?Te=Qr:Ie.sibling=Qr,Ie=Qr,De=Ht}if(Qe.done)return i(z,De),vt&&ds(z,ze),Te;if(De===null){for(;!Qe.done;ze++,Qe=F.next())Qe=ne(z,Qe.value,ae),Qe!==null&&(D=h(Qe,D,ze),Ie===null?Te=Qe:Ie.sibling=Qe,Ie=Qe);return vt&&ds(z,ze),Te}for(De=l(z,De);!Qe.done;ze++,Qe=F.next())Qe=fe(De,z,ze,Qe.value,ae),Qe!==null&&(e&&Qe.alternate!==null&&De.delete(Qe.key===null?ze:Qe.key),D=h(Qe,D,ze),Ie===null?Te=Qe:Ie.sibling=Qe,Ie=Qe);return e&&De.forEach(function(Ey){return t(z,Ey)}),vt&&ds(z,ze),Te}function Dt(z,D,F,ae){if(typeof F=="object"&&F!==null&&F.type===q&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Te=F.key,Ie=D;Ie!==null;){if(Ie.key===Te){if(Te=F.type,Te===q){if(Ie.tag===7){i(z,Ie.sibling),D=d(Ie,F.props.children),D.return=z,z=D;break e}}else if(Ie.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===ie&&yf(Te)===Ie.type){i(z,Ie.sibling),D=d(Ie,F.props),D.ref=Pi(z,Ie,F),D.return=z,z=D;break e}i(z,Ie);break}else t(z,Ie);Ie=Ie.sibling}F.type===q?(D=xs(F.props.children,z.mode,ae,F.key),D.return=z,z=D):(ae=wa(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Pi(z,D,F),ae.return=z,z=ae)}return y(z);case K:e:{for(Ie=F.key;D!==null;){if(D.key===Ie)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i(z,D.sibling),D=d(D,F.children||[]),D.return=z,z=D;break e}else{i(z,D);break}else t(z,D);D=D.sibling}D=Kc(F,z.mode,ae),D.return=z,z=D}return y(z);case ie:return Ie=F._init,Dt(z,D,Ie(F._payload),ae)}if(yt(F))return xe(z,D,F,ae);if(Y(F))return ke(z,D,F,ae);Xo(z,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i(z,D.sibling),D=d(D,F),D.return=z,z=D):(i(z,D),D=Gc(F,z.mode,ae),D.return=z,z=D),y(z)):i(z,D)}return Dt}var Vs=xf(!0),wf=xf(!1),Qo=Fr(null),Zo=null,qs=null,rc=null;function sc(){rc=qs=Zo=null}function ic(e){var t=Qo.current;ht(Qo),e._currentValue=t}function oc(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Gs(e,t){Zo=e,rc=qs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Un(e){var t=e._currentValue;if(rc!==e)if(e={context:e,memoizedValue:t,next:null},qs===null){if(Zo===null)throw Error(s(308));qs=e,Zo.dependencies={lanes:0,firstContext:e}}else qs=qs.next=e;return t}var fs=null;function ac(e){fs===null?fs=[e]:fs.push(e)}function kf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,ac(t)):(i.next=d.next,d.next=i),t.interleaved=i,br(e,l)}function br(e,t){e.lanes|=t;var i=e.alternate;for(i!==null&&(i.lanes|=t),i=e,e=e.return;e!==null;)e.childLanes|=t,i=e.alternate,i!==null&&(i.childLanes|=t),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Wr=!1;function lc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Nr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,br(e,i)}return d=l.interleaved,d===null?(t.next=t,ac(l)):(t.next=d.next,d.next=t),l.interleaved=t,br(e,i)}function Jo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Lr(e,i)}}function Tf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};h===null?d=h=y:h=h.next=y,i=i.next}while(i!==null);h===null?d=h=t:h=h.next=t}else d=h=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}function ea(e,t,i,l){var d=e.updateQueue;Wr=!1;var h=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var I=N,B=I.next;I.next=null,y===null?h=B:y.next=B,y=I;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,N=ee.lastBaseUpdate,N!==y&&(N===null?ee.firstBaseUpdate=B:N.next=B,ee.lastBaseUpdate=I))}if(h!==null){var ne=d.baseState;y=0,ee=B=I=null,N=h;do{var J=N.lane,fe=N.eventTime;if((l&J)===J){ee!==null&&(ee=ee.next={eventTime:fe,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var xe=e,ke=N;switch(J=t,fe=i,ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){ne=xe.call(fe,ne,J);break e}ne=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,J=typeof xe=="function"?xe.call(fe,ne,J):xe,J==null)break e;ne=H({},ne,J);break e;case 2:Wr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,J=d.effects,J===null?d.effects=[N]:J.push(N))}else fe={eventTime:fe,lane:J,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ee===null?(B=ee=fe,I=ne):ee=ee.next=fe,y|=J;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;J=N,N=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);if(ee===null&&(I=ne),d.baseState=I,d.firstBaseUpdate=B,d.lastBaseUpdate=ee,t=d.shared.interleaved,t!==null){d=t;do y|=d.lane,d=d.next;while(d!==t)}else h===null&&(d.shared.lanes=0);ms|=y,e.lanes=y,e.memoizedState=ne}}function bf(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var Oi={},fr=Fr(Oi),zi=Fr(Oi),$i=Fr(Oi);function ps(e){if(e===Oi)throw Error(s(174));return e}function cc(e,t){switch(dt($i,t),dt(zi,e),dt(fr,Oi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ct(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ct(t,e)}ht(fr),dt(fr,t)}function Ks(){ht(fr),ht(zi),ht($i)}function Nf(e){ps($i.current);var t=ps(fr.current),i=ct(t,e.type);t!==i&&(dt(zi,e),dt(fr,i))}function uc(e){zi.current===e&&(ht(fr),ht(zi))}var Nt=Fr(0);function ta(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dc=[];function fc(){for(var e=0;e<dc.length;e++)dc[e]._workInProgressVersionPrimary=null;dc.length=0}var na=P.ReactCurrentDispatcher,pc=P.ReactCurrentBatchConfig,hs=0,Ct=null,Ot=null,Bt=null,ra=!1,Fi=!1,Ui=0,Yv=0;function on(){throw Error(s(321))}function hc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Qn(e[i],t[i]))return!1;return!0}function mc(e,t,i,l,d,h){if(hs=h,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,na.current=e===null||e.memoizedState===null?Jv:ey,e=i(l,d),Fi){h=0;do{if(Fi=!1,Ui=0,25<=h)throw Error(s(301));h+=1,Bt=Ot=null,t.updateQueue=null,na.current=ty,e=i(l,d)}while(Fi)}if(na.current=oa,t=Ot!==null&&Ot.next!==null,hs=0,Bt=Ot=Ct=null,ra=!1,t)throw Error(s(300));return e}function gc(){var e=Ui!==0;return Ui=0,e}function pr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Ct.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function Bn(){if(Ot===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var t=Bt===null?Ct.memoizedState:Bt.next;if(t!==null)Bt=t,Ot=e;else{if(e===null)throw Error(s(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Bt===null?Ct.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Bi(e,t){return typeof t=="function"?t(e):t}function vc(e){var t=Bn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=Ot,d=l.baseQueue,h=i.pending;if(h!==null){if(d!==null){var y=d.next;d.next=h.next,h.next=y}l.baseQueue=d=h,i.pending=null}if(d!==null){h=d.next,l=l.baseState;var N=y=null,I=null,B=h;do{var ee=B.lane;if((hs&ee)===ee)I!==null&&(I=I.next={lane:0,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),l=B.hasEagerState?B.eagerState:e(l,B.action);else{var ne={lane:ee,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null};I===null?(N=I=ne,y=l):I=I.next=ne,Ct.lanes|=ee,ms|=ee}B=B.next}while(B!==null&&B!==h);I===null?y=l:I.next=N,Qn(l,t.memoizedState)||(Sn=!0),t.memoizedState=l,t.baseState=y,t.baseQueue=I,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do h=d.lane,Ct.lanes|=h,ms|=h,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function yc(e){var t=Bn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,h=t.memoizedState;if(d!==null){i.pending=null;var y=d=d.next;do h=e(h,y.action),y=y.next;while(y!==d);Qn(h,t.memoizedState)||(Sn=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,l]}function Cf(){}function Ef(e,t){var i=Ct,l=Bn(),d=t(),h=!Qn(l.memoizedState,d);if(h&&(l.memoizedState=d,Sn=!0),l=l.queue,xc(Rf.bind(null,i,l,e),[e]),l.getSnapshot!==t||h||Bt!==null&&Bt.memoizedState.tag&1){if(i.flags|=2048,Wi(9,jf.bind(null,i,l,d,t),void 0,null),Wt===null)throw Error(s(349));(hs&30)!==0||_f(i,t,d)}return d}function _f(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function jf(e,t,i,l){t.value=i,t.getSnapshot=l,Af(t)&&If(e)}function Rf(e,t,i){return i(function(){Af(t)&&If(e)})}function Af(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Qn(e,i)}catch{return!0}}function If(e){var t=br(e,1);t!==null&&nr(t,e,1,-1)}function Df(e){var t=pr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:e},t.queue=e,e=e.dispatch=Zv.bind(null,Ct,e),[t.memoizedState,e]}function Wi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function Mf(){return Bn().memoizedState}function sa(e,t,i,l){var d=pr();Ct.flags|=e,d.memoizedState=Wi(1|t,i,void 0,l===void 0?null:l)}function ia(e,t,i,l){var d=Bn();l=l===void 0?null:l;var h=void 0;if(Ot!==null){var y=Ot.memoizedState;if(h=y.destroy,l!==null&&hc(l,y.deps)){d.memoizedState=Wi(t,i,h,l);return}}Ct.flags|=e,d.memoizedState=Wi(1|t,i,h,l)}function Lf(e,t){return sa(8390656,8,e,t)}function xc(e,t){return ia(2048,8,e,t)}function Pf(e,t){return ia(4,2,e,t)}function Of(e,t){return ia(4,4,e,t)}function zf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $f(e,t,i){return i=i!=null?i.concat([e]):null,ia(4,4,zf.bind(null,t,e),i)}function wc(){}function Ff(e,t){var i=Bn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&hc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Uf(e,t){var i=Bn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&hc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Bf(e,t,i){return(hs&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=i):(Qn(i,t)||(i=xi(),Ct.lanes|=i,ms|=i,e.baseState=!0),t)}function Xv(e,t){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var l=pc.transition;pc.transition={};try{e(!1),t()}finally{Ge=i,pc.transition=l}}function Wf(){return Bn().memoizedState}function Qv(e,t,i){var l=Kr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Hf(e))Vf(t,i);else if(i=kf(e,t,i,l),i!==null){var d=gn();nr(i,e,l,d),qf(i,t,l)}}function Zv(e,t,i){var l=Kr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hf(e))Vf(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var y=t.lastRenderedState,N=h(y,i);if(d.hasEagerState=!0,d.eagerState=N,Qn(N,y)){var I=t.interleaved;I===null?(d.next=d,ac(t)):(d.next=I.next,I.next=d),t.interleaved=d;return}}catch{}finally{}i=kf(e,t,d,l),i!==null&&(d=gn(),nr(i,e,l,d),qf(i,t,l))}}function Hf(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function Vf(e,t){Fi=ra=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function qf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Lr(e,i)}}var oa={readContext:Un,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},Jv={readContext:Un,useCallback:function(e,t){return pr().memoizedState=[e,t===void 0?null:t],e},useContext:Un,useEffect:Lf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,sa(4194308,4,zf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return sa(4194308,4,e,t)},useInsertionEffect:function(e,t){return sa(4,2,e,t)},useMemo:function(e,t){var i=pr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=pr();return t=i!==void 0?i(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Qv.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=pr();return e={current:e},t.memoizedState=e},useState:Df,useDebugValue:wc,useDeferredValue:function(e){return pr().memoizedState=e},useTransition:function(){var e=Df(!1),t=e[0];return e=Xv.bind(null,e[1]),pr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=pr();if(vt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Wt===null)throw Error(s(349));(hs&30)!==0||_f(l,t,i)}d.memoizedState=i;var h={value:i,getSnapshot:t};return d.queue=h,Lf(Rf.bind(null,l,h,e),[e]),l.flags|=2048,Wi(9,jf.bind(null,l,h,i,t),void 0,null),i},useId:function(){var e=pr(),t=Wt.identifierPrefix;if(vt){var i=Tr,l=Sr;i=(l&~(1<<32-pn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Ui++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Yv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ey={readContext:Un,useCallback:Ff,useContext:Un,useEffect:xc,useImperativeHandle:$f,useInsertionEffect:Pf,useLayoutEffect:Of,useMemo:Uf,useReducer:vc,useRef:Mf,useState:function(){return vc(Bi)},useDebugValue:wc,useDeferredValue:function(e){var t=Bn();return Bf(t,Ot.memoizedState,e)},useTransition:function(){var e=vc(Bi)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Cf,useSyncExternalStore:Ef,useId:Wf,unstable_isNewReconciler:!1},ty={readContext:Un,useCallback:Ff,useContext:Un,useEffect:xc,useImperativeHandle:$f,useInsertionEffect:Pf,useLayoutEffect:Of,useMemo:Uf,useReducer:yc,useRef:Mf,useState:function(){return yc(Bi)},useDebugValue:wc,useDeferredValue:function(e){var t=Bn();return Ot===null?t.memoizedState=e:Bf(t,Ot.memoizedState,e)},useTransition:function(){var e=yc(Bi)[0],t=Bn().memoizedState;return[e,t]},useMutableSource:Cf,useSyncExternalStore:Ef,useId:Wf,unstable_isNewReconciler:!1};function Jn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function kc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var aa={isMounted:function(e){return(e=e._reactInternals)?Ee(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Kr(e),h=Nr(l,d);h.payload=t,i!=null&&(h.callback=i),t=Hr(e,h,d),t!==null&&(nr(t,e,d,l),Jo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Kr(e),h=Nr(l,d);h.tag=1,h.payload=t,i!=null&&(h.callback=i),t=Hr(e,h,d),t!==null&&(nr(t,e,d,l),Jo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=gn(),l=Kr(e),d=Nr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Hr(e,d,l),t!==null&&(nr(t,e,l,i),Jo(t,e,l))}};function Gf(e,t,i,l,d,h,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,h,y):t.prototype&&t.prototype.isPureReactComponent?!ji(i,l)||!ji(d,h):!0}function Kf(e,t,i){var l=!1,d=Ur,h=t.contextType;return typeof h=="object"&&h!==null?h=Un(h):(d=kn(t)?cs:sn.current,l=t.contextTypes,h=(l=l!=null)?Us(e,d):Ur),t=new t(i,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=aa,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=h),t}function Yf(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&aa.enqueueReplaceState(t,t.state,null)}function Sc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},lc(e);var h=t.contextType;typeof h=="object"&&h!==null?d.context=Un(h):(h=kn(t)?cs:sn.current,d.context=Us(e,h)),d.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(kc(e,t,h,i),d.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(t=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),t!==d.state&&aa.enqueueReplaceState(d,d.state,null),ea(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Ys(e,t){try{var i="",l=t;do i+=ve(l),l=l.return;while(l);var d=i}catch(h){d=`
39
- Error generating stack: `+h.message+`
40
- `+h.stack}return{value:e,source:t,stack:d,digest:null}}function Tc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function bc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var ny=typeof WeakMap=="function"?WeakMap:Map;function Xf(e,t,i){i=Nr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){ha||(ha=!0,$c=l),bc(e,t)},i}function Qf(e,t,i){i=Nr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=t.value;i.payload=function(){return l(d)},i.callback=function(){bc(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(i.callback=function(){bc(e,t),typeof l!="function"&&(qr===null?qr=new Set([this]):qr.add(this));var y=t.stack;this.componentDidCatch(t.value,{componentStack:y!==null?y:""})}),i}function Zf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new ny;var d=new Set;l.set(t,d)}else d=l.get(t),d===void 0&&(d=new Set,l.set(t,d));d.has(i)||(d.add(i),e=gy.bind(null,e,t,i),t.then(e,e))}function Jf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ep(e,t,i,l,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=Nr(-1,1),t.tag=2,Hr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var ry=P.ReactCurrentOwner,Sn=!1;function mn(e,t,i,l){t.child=e===null?wf(t,null,i,l):Vs(t,e.child,i,l)}function tp(e,t,i,l,d){i=i.render;var h=t.ref;return Gs(t,d),l=mc(e,t,i,l,h,d),i=gc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Cr(e,t,d)):(vt&&i&&Zl(t),t.flags|=1,mn(e,t,l,d),t.child)}function np(e,t,i,l,d){if(e===null){var h=i.type;return typeof h=="function"&&!qc(h)&&h.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=h,rp(e,t,h,l,d)):(e=wa(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,(e.lanes&d)===0){var y=h.memoizedProps;if(i=i.compare,i=i!==null?i:ji,i(y,l)&&e.ref===t.ref)return Cr(e,t,d)}return t.flags|=1,e=Xr(h,l),e.ref=t.ref,e.return=t,t.child=e}function rp(e,t,i,l,d){if(e!==null){var h=e.memoizedProps;if(ji(h,l)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=l=h,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Cr(e,t,d)}return Nc(e,t,i,l,d)}function sp(e,t,i){var l=t.pendingProps,d=l.children,h=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(Qs,In),In|=i;else{if((i&1073741824)===0)return e=h!==null?h.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(Qs,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=h!==null?h.baseLanes:i,dt(Qs,In),In|=l}else h!==null?(l=h.baseLanes|i,t.memoizedState=null):l=i,dt(Qs,In),In|=l;return mn(e,t,d,i),t.child}function ip(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Nc(e,t,i,l,d){var h=kn(i)?cs:sn.current;return h=Us(t,h),Gs(t,d),i=mc(e,t,i,l,h,d),l=gc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Cr(e,t,d)):(vt&&l&&Zl(t),t.flags|=1,mn(e,t,i,d),t.child)}function op(e,t,i,l,d){if(kn(i)){var h=!0;Vo(t)}else h=!1;if(Gs(t,d),t.stateNode===null)ca(e,t),Kf(t,i,l),Sc(t,i,l,d),l=!0;else if(e===null){var y=t.stateNode,N=t.memoizedProps;y.props=N;var I=y.context,B=i.contextType;typeof B=="object"&&B!==null?B=Un(B):(B=kn(i)?cs:sn.current,B=Us(t,B));var ee=i.getDerivedStateFromProps,ne=typeof ee=="function"||typeof y.getSnapshotBeforeUpdate=="function";ne||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==l||I!==B)&&Yf(t,y,l,B),Wr=!1;var J=t.memoizedState;y.state=J,ea(t,l,y,d),I=t.memoizedState,N!==l||J!==I||wn.current||Wr?(typeof ee=="function"&&(kc(t,i,ee,l),I=t.memoizedState),(N=Wr||Gf(t,i,N,l,J,I,B))?(ne||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(t.flags|=4194308)):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=I),y.props=l,y.state=I,y.context=B,l=N):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{y=t.stateNode,Sf(e,t),N=t.memoizedProps,B=t.type===t.elementType?N:Jn(t.type,N),y.props=B,ne=t.pendingProps,J=y.context,I=i.contextType,typeof I=="object"&&I!==null?I=Un(I):(I=kn(i)?cs:sn.current,I=Us(t,I));var fe=i.getDerivedStateFromProps;(ee=typeof fe=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==ne||J!==I)&&Yf(t,y,l,I),Wr=!1,J=t.memoizedState,y.state=J,ea(t,l,y,d);var xe=t.memoizedState;N!==ne||J!==xe||wn.current||Wr?(typeof fe=="function"&&(kc(t,i,fe,l),xe=t.memoizedState),(B=Wr||Gf(t,i,B,l,J,xe,I)||!1)?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,xe,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,xe,I)),typeof y.componentDidUpdate=="function"&&(t.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=xe),y.props=l,y.state=xe,y.context=I,l=B):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),l=!1)}return Cc(e,t,i,l,h,d)}function Cc(e,t,i,l,d,h){ip(e,t);var y=(t.flags&128)!==0;if(!l&&!y)return d&&df(t,i,!1),Cr(e,t,h);l=t.stateNode,ry.current=t;var N=y&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&y?(t.child=Vs(t,e.child,null,h),t.child=Vs(t,null,N,h)):mn(e,t,N,h),t.memoizedState=l.state,d&&df(t,i,!0),t.child}function ap(e){var t=e.stateNode;t.pendingContext?cf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&cf(e,t.context,!1),cc(e,t.containerInfo)}function lp(e,t,i,l,d){return Hs(),nc(d),t.flags|=256,mn(e,t,i,l),t.child}var Ec={dehydrated:null,treeContext:null,retryLane:0};function _c(e){return{baseLanes:e,cachePool:null,transitions:null}}function cp(e,t,i){var l=t.pendingProps,d=Nt.current,h=!1,y=(t.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),dt(Nt,d&1),e===null)return tc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(y=l.children,e=l.fallback,h?(l=t.mode,h=t.child,y={mode:"hidden",children:y},(l&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=y):h=ka(y,l,0,null),e=xs(e,l,i,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=_c(i),t.memoizedState=Ec,e):jc(t,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return sy(e,t,y,l,N,d,i);if(h){h=l.fallback,y=t.mode,d=e.child,N=d.sibling;var I={mode:"hidden",children:l.children};return(y&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=I,t.deletions=null):(l=Xr(d,I),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?h=Xr(N,h):(h=xs(h,y,i,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,l=h,h=t.child,y=e.child.memoizedState,y=y===null?_c(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},h.memoizedState=y,h.childLanes=e.childLanes&~i,t.memoizedState=Ec,l}return h=e.child,e=h.sibling,l=Xr(h,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=i),l.return=t,l.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=l,t.memoizedState=null,l}function jc(e,t){return t=ka({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function la(e,t,i,l){return l!==null&&nc(l),Vs(t,e.child,null,i),e=jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sy(e,t,i,l,d,h,y){if(i)return t.flags&256?(t.flags&=-257,l=Tc(Error(s(422))),la(e,t,y,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=l.fallback,d=t.mode,l=ka({mode:"visible",children:l.children},d,0,null),h=xs(h,d,y,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,(t.mode&1)!==0&&Vs(t,e.child,null,y),t.child.memoizedState=_c(y),t.memoizedState=Ec,h);if((t.mode&1)===0)return la(e,t,y,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,h=Error(s(419)),l=Tc(h,l,void 0),la(e,t,y,l)}if(N=(y&e.childLanes)!==0,Sn||N){if(l=Wt,l!==null){switch(y&-y){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|y))!==0?0:d,d!==0&&d!==h.retryLane&&(h.retryLane=d,br(e,d),nr(l,e,d,-1))}return Vc(),l=Tc(Error(s(421))),la(e,t,y,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=vy.bind(null,e),d._reactRetry=t,null):(e=h.treeContext,An=$r(d.nextSibling),Rn=t,vt=!0,Zn=null,e!==null&&($n[Fn++]=Sr,$n[Fn++]=Tr,$n[Fn++]=us,Sr=e.id,Tr=e.overflow,us=t),t=jc(t,l.children),t.flags|=4096,t)}function up(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),oc(e.return,t,i)}function Rc(e,t,i,l,d){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=l,h.tail=i,h.tailMode=d)}function dp(e,t,i){var l=t.pendingProps,d=l.revealOrder,h=l.tail;if(mn(e,t,l.children,i),l=Nt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&up(e,i,t);else if(e.tag===19)up(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(dt(Nt,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&ta(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Rc(t,!1,d,i,h);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&ta(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Rc(t,!0,i,null,h);break;case"together":Rc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ca(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Cr(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ms|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=Xr(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Xr(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function iy(e,t,i){switch(t.tag){case 3:ap(t),Hs();break;case 5:Nf(t);break;case 1:kn(t.type)&&Vo(t);break;case 4:cc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;dt(Qo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(dt(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?cp(e,t,i):(dt(Nt,Nt.current&1),e=Cr(e,t,i),e!==null?e.sibling:null);dt(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return dp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),dt(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,sp(e,t,i)}return Cr(e,t,i)}var fp,Ac,pp,hp;fp=function(e,t){for(var i=t.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===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},Ac=function(){},pp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ps(fr.current);var h=null;switch(i){case"input":d=Fe(e,d),l=Fe(e,l),h=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),h=[];break;case"textarea":d=Ft(e,d),l=Ft(e,l),h=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Bo)}un(i,l);var y;i=null;for(B in d)if(!l.hasOwnProperty(B)&&d.hasOwnProperty(B)&&d[B]!=null)if(B==="style"){var N=d[B];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}else B!=="dangerouslySetInnerHTML"&&B!=="children"&&B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(a.hasOwnProperty(B)?h||(h=[]):(h=h||[]).push(B,null));for(B in l){var I=l[B];if(N=d!=null?d[B]:void 0,l.hasOwnProperty(B)&&I!==N&&(I!=null||N!=null))if(B==="style")if(N){for(y in N)!N.hasOwnProperty(y)||I&&I.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in I)I.hasOwnProperty(y)&&N[y]!==I[y]&&(i||(i={}),i[y]=I[y])}else i||(h||(h=[]),h.push(B,i)),i=I;else B==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,N=N?N.__html:void 0,I!=null&&N!==I&&(h=h||[]).push(B,I)):B==="children"?typeof I!="string"&&typeof I!="number"||(h=h||[]).push(B,""+I):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&(a.hasOwnProperty(B)?(I!=null&&B==="onScroll"&&pt("scroll",e),h||N===I||(h=[])):(h=h||[]).push(B,I))}i&&(h=h||[]).push("style",i);var B=h;(t.updateQueue=B)&&(t.flags|=4)}},hp=function(e,t,i,l){i!==l&&(t.flags|=4)};function Hi(e,t){if(!vt)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function an(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function oy(e,t,i){var l=t.pendingProps;switch(Jl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return kn(t.type)&&Ho(),an(t),null;case 3:return l=t.stateNode,Ks(),ht(wn),ht(sn),fc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Yo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Zn!==null&&(Bc(Zn),Zn=null))),Ac(e,t),an(t),null;case 5:uc(t);var d=ps($i.current);if(i=t.type,e!==null&&t.stateNode!=null)pp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return an(t),null}if(e=ps(fr.current),Yo(t)){l=t.stateNode,i=t.type;var h=t.memoizedProps;switch(l[dr]=t,l[Mi]=h,e=(t.mode&1)!==0,i){case"dialog":pt("cancel",l),pt("close",l);break;case"iframe":case"object":case"embed":pt("load",l);break;case"video":case"audio":for(d=0;d<Ai.length;d++)pt(Ai[d],l);break;case"source":pt("error",l);break;case"img":case"image":case"link":pt("error",l),pt("load",l);break;case"details":pt("toggle",l);break;case"input":_t(l,h),pt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!h.multiple},pt("invalid",l);break;case"textarea":V(l,h),pt("invalid",l)}un(i,h),d=null;for(var y in h)if(h.hasOwnProperty(y)){var N=h[y];y==="children"?typeof N=="string"?l.textContent!==N&&(h.suppressHydrationWarning!==!0&&Uo(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(h.suppressHydrationWarning!==!0&&Uo(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&pt("scroll",l)}switch(i){case"input":rt(l),On(l,h,!0);break;case"textarea":rt(l),Be(l);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(l.onclick=Bo)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{y=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Je(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=y.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=y.createElement(i,{is:l.is}):(e=y.createElement(i),i==="select"&&(y=e,l.multiple?y.multiple=!0:l.size&&(y.size=l.size))):e=y.createElementNS(e,i),e[dr]=t,e[Mi]=l,fp(e,t,!1,!1),t.stateNode=e;e:{switch(y=zn(i,l),i){case"dialog":pt("cancel",e),pt("close",e),d=l;break;case"iframe":case"object":case"embed":pt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ai.length;d++)pt(Ai[d],e);d=l;break;case"source":pt("error",e),d=l;break;case"img":case"image":case"link":pt("error",e),pt("load",e),d=l;break;case"details":pt("toggle",e),d=l;break;case"input":_t(e,l),d=Fe(e,l),pt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),pt("invalid",e);break;case"textarea":V(e,l),d=Ft(e,l),pt("invalid",e);break;default:d=l}un(i,d),N=d;for(h in N)if(N.hasOwnProperty(h)){var I=N[h];h==="style"?yr(e,I):h==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&&gt(e,I)):h==="children"?typeof I=="string"?(i!=="textarea"||I!=="")&&Xt(e,I):typeof I=="number"&&Xt(e,""+I):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(a.hasOwnProperty(h)?I!=null&&h==="onScroll"&&pt("scroll",e):I!=null&&U(e,h,I,y))}switch(i){case"input":rt(e),On(e,l,!1);break;case"textarea":rt(e),Be(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Re(l.value));break;case"select":e.multiple=!!l.multiple,h=l.value,h!=null?lt(e,!!l.multiple,h,!1):l.defaultValue!=null&&lt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Bo)}switch(i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return an(t),null;case 6:if(e&&t.stateNode!=null)hp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=ps($i.current),ps(fr.current),Yo(t)){if(l=t.stateNode,i=t.memoizedProps,l[dr]=t,(h=l.nodeValue!==i)&&(e=Rn,e!==null))switch(e.tag){case 3:Uo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Uo(l.nodeValue,i,(e.mode&1)!==0)}h&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[dr]=t,t.stateNode=l}return an(t),null;case 13:if(ht(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&An!==null&&(t.mode&1)!==0&&(t.flags&128)===0)vf(),Hs(),t.flags|=98560,h=!1;else if(h=Yo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!h)throw Error(s(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(s(317));h[dr]=t}else Hs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;an(t),h=!1}else Zn!==null&&(Bc(Zn),Zn=null),h=!0;if(!h)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=i,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Nt.current&1)!==0?zt===0&&(zt=3):Vc())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Ks(),Ac(e,t),e===null&&Ii(t.stateNode.containerInfo),an(t),null;case 10:return ic(t.type._context),an(t),null;case 17:return kn(t.type)&&Ho(),an(t),null;case 19:if(ht(Nt),h=t.memoizedState,h===null)return an(t),null;if(l=(t.flags&128)!==0,y=h.rendering,y===null)if(l)Hi(h,!1);else{if(zt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(y=ta(e),y!==null){for(t.flags|=128,Hi(h,!1),l=y.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)h=i,e=l,h.flags&=14680066,y=h.alternate,y===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=y.childLanes,h.lanes=y.lanes,h.child=y.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=y.memoizedProps,h.memoizedState=y.memoizedState,h.updateQueue=y.updateQueue,h.type=y.type,e=y.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return dt(Nt,Nt.current&1|2),t.child}e=e.sibling}h.tail!==null&&St()>Zs&&(t.flags|=128,l=!0,Hi(h,!1),t.lanes=4194304)}else{if(!l)if(e=ta(y),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Hi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!vt)return an(t),null}else 2*St()-h.renderingStartTime>Zs&&i!==1073741824&&(t.flags|=128,l=!0,Hi(h,!1),t.lanes=4194304);h.isBackwards?(y.sibling=t.child,t.child=y):(i=h.last,i!==null?i.sibling=y:t.child=y,h.last=y)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=St(),t.sibling=null,i=Nt.current,dt(Nt,l?i&1|2:i&1),t):(an(t),null);case 22:case 23:return Hc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(In&1073741824)!==0&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function ay(e,t){switch(Jl(t),t.tag){case 1:return kn(t.type)&&Ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),ht(wn),ht(sn),fc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return uc(t),null;case 13:if(ht(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Hs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ht(Nt),null;case 4:return Ks(),null;case 10:return ic(t.type._context),null;case 22:case 23:return Hc(),null;case 24:return null;default:return null}}var ua=!1,ln=!1,ly=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Xs(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Rt(e,t,l)}else i.current=null}function Ic(e,t,i){try{i()}catch(l){Rt(e,t,l)}}var mp=!1;function cy(e,t){if(Hl=Ro,e=qd(),Pl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var y=0,N=-1,I=-1,B=0,ee=0,ne=e,J=null;t:for(;;){for(var fe;ne!==i||d!==0&&ne.nodeType!==3||(N=y+d),ne!==h||l!==0&&ne.nodeType!==3||(I=y+l),ne.nodeType===3&&(y+=ne.nodeValue.length),(fe=ne.firstChild)!==null;)J=ne,ne=fe;for(;;){if(ne===e)break t;if(J===i&&++B===d&&(N=y),J===h&&++ee===l&&(I=y),(fe=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=fe}i=N===-1||I===-1?null:{start:N,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(Vl={focusedElem:e,selectionRange:i},Ro=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ke=xe.memoizedProps,Dt=xe.memoizedState,z=t.stateNode,D=z.getSnapshotBeforeUpdate(t.elementType===t.type?ke:Jn(t.type,ke),Dt);z.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ae){Rt(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return xe=mp,mp=!1,xe}function Vi(e,t,i){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var h=d.destroy;d.destroy=void 0,h!==void 0&&Ic(t,i,h)}d=d.next}while(d!==l)}}function da(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==t)}}function Dc(e){var t=e.ref;if(t!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof t=="function"?t(e):t.current=e}}function gp(e){var t=e.alternate;t!==null&&(e.alternate=null,gp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dr],delete t[Mi],delete t[Yl],delete t[Vv],delete t[qv])),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 yp(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 Mc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Bo));else if(l!==4&&(e=e.child,e!==null))for(Mc(e,t,i),e=e.sibling;e!==null;)Mc(e,t,i),e=e.sibling}function Lc(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Lc(e,t,i),e=e.sibling;e!==null;)Lc(e,t,i),e=e.sibling}var Qt=null,er=!1;function Vr(e,t,i){for(i=i.child;i!==null;)xp(e,t,i),i=i.sibling}function xp(e,t,i){if(_n&&typeof _n.onCommitFiberUnmount=="function")try{_n.onCommitFiberUnmount(rs,i)}catch{}switch(i.tag){case 5:ln||Xs(i,t);case 6:var l=Qt,d=er;Qt=null,Vr(e,t,i),Qt=l,er=d,Qt!==null&&(er?(e=Qt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Qt.removeChild(i.stateNode));break;case 18:Qt!==null&&(er?(e=Qt,i=i.stateNode,e.nodeType===8?Kl(e.parentNode,i):e.nodeType===1&&Kl(e,i),Ti(e)):Kl(Qt,i.stateNode));break;case 4:l=Qt,d=er,Qt=i.stateNode.containerInfo,er=!0,Vr(e,t,i),Qt=l,er=d;break;case 0:case 11:case 14:case 15:if(!ln&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var h=d,y=h.destroy;h=h.tag,y!==void 0&&((h&2)!==0||(h&4)!==0)&&Ic(i,t,y),d=d.next}while(d!==l)}Vr(e,t,i);break;case 1:if(!ln&&(Xs(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){Rt(i,t,N)}Vr(e,t,i);break;case 21:Vr(e,t,i);break;case 22:i.mode&1?(ln=(l=ln)||i.memoizedState!==null,Vr(e,t,i),ln=l):Vr(e,t,i);break;default:Vr(e,t,i)}}function wp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new ly),t.forEach(function(l){var d=yy.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function tr(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var h=e,y=t,N=y;e:for(;N!==null;){switch(N.tag){case 5:Qt=N.stateNode,er=!1;break e;case 3:Qt=N.stateNode.containerInfo,er=!0;break e;case 4:Qt=N.stateNode.containerInfo,er=!0;break e}N=N.return}if(Qt===null)throw Error(s(160));xp(h,y,d),Qt=null,er=!1;var I=d.alternate;I!==null&&(I.return=null),d.return=null}catch(B){Rt(d,t,B)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)kp(t,e),t=t.sibling}function kp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(tr(t,e),hr(e),l&4){try{Vi(3,e,e.return),da(3,e)}catch(ke){Rt(e,e.return,ke)}try{Vi(5,e,e.return)}catch(ke){Rt(e,e.return,ke)}}break;case 1:tr(t,e),hr(e),l&512&&i!==null&&Xs(i,i.return);break;case 5:if(tr(t,e),hr(e),l&512&&i!==null&&Xs(i,i.return),e.flags&32){var d=e.stateNode;try{Xt(d,"")}catch(ke){Rt(e,e.return,ke)}}if(l&4&&(d=e.stateNode,d!=null)){var h=e.memoizedProps,y=i!==null?i.memoizedProps:h,N=e.type,I=e.updateQueue;if(e.updateQueue=null,I!==null)try{N==="input"&&h.type==="radio"&&h.name!=null&&Ue(d,h),zn(N,y);var B=zn(N,h);for(y=0;y<I.length;y+=2){var ee=I[y],ne=I[y+1];ee==="style"?yr(d,ne):ee==="dangerouslySetInnerHTML"?gt(d,ne):ee==="children"?Xt(d,ne):U(d,ee,ne,B)}switch(N){case"input":Yt(d,h);break;case"textarea":me(d,h);break;case"select":var J=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!h.multiple;var fe=h.value;fe!=null?lt(d,!!h.multiple,fe,!1):J!==!!h.multiple&&(h.defaultValue!=null?lt(d,!!h.multiple,h.defaultValue,!0):lt(d,!!h.multiple,h.multiple?[]:"",!1))}d[Mi]=h}catch(ke){Rt(e,e.return,ke)}}break;case 6:if(tr(t,e),hr(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,h=e.memoizedProps;try{d.nodeValue=h}catch(ke){Rt(e,e.return,ke)}}break;case 3:if(tr(t,e),hr(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ti(t.containerInfo)}catch(ke){Rt(e,e.return,ke)}break;case 4:tr(t,e),hr(e);break;case 13:tr(t,e),hr(e),d=e.child,d.flags&8192&&(h=d.memoizedState!==null,d.stateNode.isHidden=h,!h||d.alternate!==null&&d.alternate.memoizedState!==null||(zc=St())),l&4&&wp(e);break;case 22:if(ee=i!==null&&i.memoizedState!==null,e.mode&1?(ln=(B=ln)||ee,tr(t,e),ln=B):tr(t,e),hr(e),l&8192){if(B=e.memoizedState!==null,(e.stateNode.isHidden=B)&&!ee&&(e.mode&1)!==0)for(ye=e,ee=e.child;ee!==null;){for(ne=ye=ee;ye!==null;){switch(J=ye,fe=J.child,J.tag){case 0:case 11:case 14:case 15:Vi(4,J,J.return);break;case 1:Xs(J,J.return);var xe=J.stateNode;if(typeof xe.componentWillUnmount=="function"){l=J,i=J.return;try{t=l,xe.props=t.memoizedProps,xe.state=t.memoizedState,xe.componentWillUnmount()}catch(ke){Rt(l,i,ke)}}break;case 5:Xs(J,J.return);break;case 22:if(J.memoizedState!==null){bp(ne);continue}}fe!==null?(fe.return=J,ye=fe):bp(ne)}ee=ee.sibling}e:for(ee=null,ne=e;;){if(ne.tag===5){if(ee===null){ee=ne;try{d=ne.stateNode,B?(h=d.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(N=ne.stateNode,I=ne.memoizedProps.style,y=I!=null&&I.hasOwnProperty("display")?I.display:null,N.style.display=En("display",y))}catch(ke){Rt(e,e.return,ke)}}}else if(ne.tag===6){if(ee===null)try{ne.stateNode.nodeValue=B?"":ne.memoizedProps}catch(ke){Rt(e,e.return,ke)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===e)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===e)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===e)break e;ee===ne&&(ee=null),ne=ne.return}ee===ne&&(ee=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:tr(t,e),hr(e),l&4&&wp(e);break;case 21:break;default:tr(t,e),hr(e)}}function hr(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(vp(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(Xt(d,""),l.flags&=-33);var h=yp(e);Lc(e,h,d);break;case 3:case 4:var y=l.stateNode.containerInfo,N=yp(e);Mc(e,N,y);break;default:throw Error(s(161))}}catch(I){Rt(e,e.return,I)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uy(e,t,i){ye=e,Sp(e)}function Sp(e,t,i){for(var l=(e.mode&1)!==0;ye!==null;){var d=ye,h=d.child;if(d.tag===22&&l){var y=d.memoizedState!==null||ua;if(!y){var N=d.alternate,I=N!==null&&N.memoizedState!==null||ln;N=ua;var B=ln;if(ua=y,(ln=I)&&!B)for(ye=d;ye!==null;)y=ye,I=y.child,y.tag===22&&y.memoizedState!==null?Np(d):I!==null?(I.return=y,ye=I):Np(d);for(;h!==null;)ye=h,Sp(h),h=h.sibling;ye=d,ua=N,ln=B}Tp(e)}else(d.subtreeFlags&8772)!==0&&h!==null?(h.return=d,ye=h):Tp(e)}}function Tp(e){for(;ye!==null;){var t=ye;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ln||da(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ln)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:Jn(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&bf(t,h,l);break;case 3:var y=t.updateQueue;if(y!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}bf(t,y,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var I=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&i.focus();break;case"img":I.src&&(i.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var B=t.alternate;if(B!==null){var ee=B.memoizedState;if(ee!==null){var ne=ee.dehydrated;ne!==null&&Ti(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}ln||t.flags&512&&Dc(t)}catch(J){Rt(t,t.return,J)}}if(t===e){ye=null;break}if(i=t.sibling,i!==null){i.return=t.return,ye=i;break}ye=t.return}}function bp(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var i=t.sibling;if(i!==null){i.return=t.return,ye=i;break}ye=t.return}}function Np(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{da(4,t)}catch(I){Rt(t,i,I)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(I){Rt(t,d,I)}}var h=t.return;try{Dc(t)}catch(I){Rt(t,h,I)}break;case 5:var y=t.return;try{Dc(t)}catch(I){Rt(t,y,I)}}}catch(I){Rt(t,t.return,I)}if(t===e){ye=null;break}var N=t.sibling;if(N!==null){N.return=t.return,ye=N;break}ye=t.return}}var dy=Math.ceil,fa=P.ReactCurrentDispatcher,Pc=P.ReactCurrentOwner,Wn=P.ReactCurrentBatchConfig,Ye=0,Wt=null,Lt=null,Zt=0,In=0,Qs=Fr(0),zt=0,qi=null,ms=0,pa=0,Oc=0,Gi=null,Tn=null,zc=0,Zs=1/0,Er=null,ha=!1,$c=null,qr=null,ma=!1,Gr=null,ga=0,Ki=0,Fc=null,va=-1,ya=0;function gn(){return(Ye&6)!==0?St():va!==-1?va:va=St()}function Kr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&Zt!==0?Zt&-Zt:Kv.transition!==null?(ya===0&&(ya=xi()),ya):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:Cd(e.type)),e)}function nr(e,t,i,l){if(50<Ki)throw Ki=0,Fc=null,Error(s(185));as(e,i,l),((Ye&2)===0||e!==Wt)&&(e===Wt&&((Ye&2)===0&&(pa|=i),zt===4&&Yr(e,Zt)),bn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(Zs=St()+500,qo&&Br()))}function bn(e,t){var i=e.callbackNode;Eo(e,t);var l=os(e,e===Wt?Zt:0);if(l===0)i!==null&&bo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&bo(i),t===1)e.tag===0?Gv(Ep.bind(null,e)):ff(Ep.bind(null,e)),Wv(function(){(Ye&6)===0&&Br()}),i=null;else{switch(oe(l)){case 1:i=Dr;break;case 4:i=ur;break;case 16:i=_s;break;case 536870912:i=No;break;default:i=_s}i=Lp(i,Cp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function Cp(e,t){if(va=-1,ya=0,(Ye&6)!==0)throw Error(s(327));var i=e.callbackNode;if(Js()&&e.callbackNode!==i)return null;var l=os(e,e===Wt?Zt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=xa(e,l);else{t=l;var d=Ye;Ye|=2;var h=jp();(Wt!==e||Zt!==t)&&(Er=null,Zs=St()+500,vs(e,t));do try{hy();break}catch(N){_p(e,N)}while(!0);sc(),fa.current=h,Ye=d,Lt!==null?t=0:(Wt=null,Zt=0,t=zt)}if(t!==0){if(t===2&&(d=yi(e),d!==0&&(l=d,t=Uc(e,d))),t===1)throw i=qi,vs(e,0),Yr(e,l),bn(e,St()),i;if(t===6)Yr(e,l);else{if(d=e.current.alternate,(l&30)===0&&!fy(d)&&(t=xa(e,l),t===2&&(h=yi(e),h!==0&&(l=h,t=Uc(e,h))),t===1))throw i=qi,vs(e,0),Yr(e,l),bn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:ys(e,Tn,Er);break;case 3:if(Yr(e,l),(l&130023424)===l&&(t=zc+500-St(),10<t)){if(os(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){gn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Gl(ys.bind(null,e,Tn,Er),t);break}ys(e,Tn,Er);break;case 4:if(Yr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var y=31-pn(l);h=1<<y,y=t[y],y>d&&(d=y),l&=~h}if(l=d,l=St()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*dy(l/1960))-l,10<l){e.timeoutHandle=Gl(ys.bind(null,e,Tn,Er),l);break}ys(e,Tn,Er);break;case 5:ys(e,Tn,Er);break;default:throw Error(s(329))}}}return bn(e,St()),e.callbackNode===i?Cp.bind(null,e):null}function Uc(e,t){var i=Gi;return e.current.memoizedState.isDehydrated&&(vs(e,t).flags|=256),e=xa(e,t),e!==2&&(t=Tn,Tn=i,t!==null&&Bc(t)),e}function Bc(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function fy(e){for(var t=e;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],h=d.getSnapshot;d=d.value;try{if(!Qn(h(),d))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yr(e,t){for(t&=~Oc,t&=~pa,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-pn(t),l=1<<i;e[i]=-1,t&=~l}}function Ep(e){if((Ye&6)!==0)throw Error(s(327));Js();var t=os(e,0);if((t&1)===0)return bn(e,St()),null;var i=xa(e,t);if(e.tag!==0&&i===2){var l=yi(e);l!==0&&(t=l,i=Uc(e,l))}if(i===1)throw i=qi,vs(e,0),Yr(e,t),bn(e,St()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ys(e,Tn,Er),bn(e,St()),null}function Wc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(Zs=St()+500,qo&&Br())}}function gs(e){Gr!==null&&Gr.tag===0&&(Ye&6)===0&&Js();var t=Ye;Ye|=1;var i=Wn.transition,l=Ge;try{if(Wn.transition=null,Ge=1,e)return e()}finally{Ge=l,Wn.transition=i,Ye=t,(Ye&6)===0&&Br()}}function Hc(){In=Qs.current,ht(Qs)}function vs(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Bv(i)),Lt!==null)for(i=Lt.return;i!==null;){var l=i;switch(Jl(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Ho();break;case 3:Ks(),ht(wn),ht(sn),fc();break;case 5:uc(l);break;case 4:Ks();break;case 13:ht(Nt);break;case 19:ht(Nt);break;case 10:ic(l.type._context);break;case 22:case 23:Hc()}i=i.return}if(Wt=e,Lt=e=Xr(e.current,null),Zt=In=t,zt=0,qi=null,Oc=pa=ms=0,Tn=Gi=null,fs!==null){for(t=0;t<fs.length;t++)if(i=fs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,h=i.pending;if(h!==null){var y=h.next;h.next=d,l.next=y}i.pending=l}fs=null}return e}function _p(e,t){do{var i=Lt;try{if(sc(),na.current=oa,ra){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}ra=!1}if(hs=0,Bt=Ot=Ct=null,Fi=!1,Ui=0,Pc.current=null,i===null||i.return===null){zt=1,qi=t,Lt=null;break}e:{var h=e,y=i.return,N=i,I=t;if(t=Zt,N.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var B=I,ee=N,ne=ee.tag;if((ee.mode&1)===0&&(ne===0||ne===11||ne===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 fe=Jf(y);if(fe!==null){fe.flags&=-257,ep(fe,y,N,h,t),fe.mode&1&&Zf(h,B,t),t=fe,I=B;var xe=t.updateQueue;if(xe===null){var ke=new Set;ke.add(I),t.updateQueue=ke}else xe.add(I);break e}else{if((t&1)===0){Zf(h,B,t),Vc();break e}I=Error(s(426))}}else if(vt&&N.mode&1){var Dt=Jf(y);if(Dt!==null){(Dt.flags&65536)===0&&(Dt.flags|=256),ep(Dt,y,N,h,t),nc(Ys(I,N));break e}}h=I=Ys(I,N),zt!==4&&(zt=2),Gi===null?Gi=[h]:Gi.push(h),h=y;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var z=Xf(h,I,t);Tf(h,z);break e;case 1:N=I;var D=h.type,F=h.stateNode;if((h.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(qr===null||!qr.has(F)))){h.flags|=65536,t&=-t,h.lanes|=t;var ae=Qf(h,N,t);Tf(h,ae);break e}}h=h.return}while(h!==null)}Ap(i)}catch(Te){t=Te,Lt===i&&i!==null&&(Lt=i=i.return);continue}break}while(!0)}function jp(){var e=fa.current;return fa.current=oa,e===null?oa:e}function Vc(){(zt===0||zt===3||zt===2)&&(zt=4),Wt===null||(ms&268435455)===0&&(pa&268435455)===0||Yr(Wt,Zt)}function xa(e,t){var i=Ye;Ye|=2;var l=jp();(Wt!==e||Zt!==t)&&(Er=null,vs(e,t));do try{py();break}catch(d){_p(e,d)}while(!0);if(sc(),Ye=i,fa.current=l,Lt!==null)throw Error(s(261));return Wt=null,Zt=0,zt}function py(){for(;Lt!==null;)Rp(Lt)}function hy(){for(;Lt!==null&&!Tl();)Rp(Lt)}function Rp(e){var t=Mp(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?Ap(e):Lt=t,Pc.current=null}function Ap(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=oy(i,t,In),i!==null){Lt=i;return}}else{if(i=ay(i,t),i!==null){i.flags&=32767,Lt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zt=6,Lt=null;return}}if(t=t.sibling,t!==null){Lt=t;return}Lt=t=e}while(t!==null);zt===0&&(zt=5)}function ys(e,t,i){var l=Ge,d=Wn.transition;try{Wn.transition=null,Ge=1,my(e,t,i,l)}finally{Wn.transition=d,Ge=l}return null}function my(e,t,i,l){do Js();while(Gr!==null);if((Ye&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var h=i.lanes|i.childLanes;if(_o(e,h),e===Wt&&(Lt=Wt=null,Zt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ma||(ma=!0,Lp(_s,function(){return Js(),null})),h=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||h){h=Wn.transition,Wn.transition=null;var y=Ge;Ge=1;var N=Ye;Ye|=4,Pc.current=null,cy(e,i),kp(i,e),Lv(Vl),Ro=!!Hl,Vl=Hl=null,e.current=i,uy(i),bl(),Ye=N,Ge=y,Wn.transition=h}else e.current=i;if(ma&&(ma=!1,Gr=e,ga=d),h=e.pendingLanes,h===0&&(qr=null),js(i.stateNode),bn(e,St()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(ha)throw ha=!1,e=$c,$c=null,e;return(ga&1)!==0&&e.tag!==0&&Js(),h=e.pendingLanes,(h&1)!==0?e===Fc?Ki++:(Ki=0,Fc=e):Ki=0,Br(),null}function Js(){if(Gr!==null){var e=oe(ga),t=Wn.transition,i=Ge;try{if(Wn.transition=null,Ge=16>e?16:e,Gr===null)var l=!1;else{if(e=Gr,Gr=null,ga=0,(Ye&6)!==0)throw Error(s(331));var d=Ye;for(Ye|=4,ye=e.current;ye!==null;){var h=ye,y=h.child;if((ye.flags&16)!==0){var N=h.deletions;if(N!==null){for(var I=0;I<N.length;I++){var B=N[I];for(ye=B;ye!==null;){var ee=ye;switch(ee.tag){case 0:case 11:case 15:Vi(8,ee,h)}var ne=ee.child;if(ne!==null)ne.return=ee,ye=ne;else for(;ye!==null;){ee=ye;var J=ee.sibling,fe=ee.return;if(gp(ee),ee===B){ye=null;break}if(J!==null){J.return=fe,ye=J;break}ye=fe}}}var xe=h.alternate;if(xe!==null){var ke=xe.child;if(ke!==null){xe.child=null;do{var Dt=ke.sibling;ke.sibling=null,ke=Dt}while(ke!==null)}}ye=h}}if((h.subtreeFlags&2064)!==0&&y!==null)y.return=h,ye=y;else e:for(;ye!==null;){if(h=ye,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:Vi(9,h,h.return)}var z=h.sibling;if(z!==null){z.return=h.return,ye=z;break e}ye=h.return}}var D=e.current;for(ye=D;ye!==null;){y=ye;var F=y.child;if((y.subtreeFlags&2064)!==0&&F!==null)F.return=y,ye=F;else e:for(y=D;ye!==null;){if(N=ye,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:da(9,N)}}catch(Te){Rt(N,N.return,Te)}if(N===y){ye=null;break e}var ae=N.sibling;if(ae!==null){ae.return=N.return,ye=ae;break e}ye=N.return}}if(Ye=d,Br(),_n&&typeof _n.onPostCommitFiberRoot=="function")try{_n.onPostCommitFiberRoot(rs,e)}catch{}l=!0}return l}finally{Ge=i,Wn.transition=t}}return!1}function Ip(e,t,i){t=Ys(i,t),t=Xf(e,t,1),e=Hr(e,t,1),t=gn(),e!==null&&(as(e,1,t),bn(e,t))}function Rt(e,t,i){if(e.tag===3)Ip(e,e,i);else for(;t!==null;){if(t.tag===3){Ip(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(qr===null||!qr.has(l))){e=Ys(i,e),e=Qf(t,e,1),t=Hr(t,e,1),e=gn(),t!==null&&(as(t,1,e),bn(t,e));break}}t=t.return}}function gy(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=gn(),e.pingedLanes|=e.suspendedLanes&i,Wt===e&&(Zt&i)===i&&(zt===4||zt===3&&(Zt&130023424)===Zt&&500>St()-zc?vs(e,0):Oc|=i),bn(e,t)}function Dp(e,t){t===0&&((e.mode&1)===0?t=1:(t=As,As<<=1,(As&130023424)===0&&(As=4194304)));var i=gn();e=br(e,t),e!==null&&(as(e,t,i),bn(e,i))}function vy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Dp(e,i)}function yy(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),Dp(e,i)}var Mp;Mp=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||wn.current)Sn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return Sn=!1,iy(e,t,i);Sn=(e.flags&131072)!==0}else Sn=!1,vt&&(t.flags&1048576)!==0&&pf(t,Ko,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;ca(e,t),e=t.pendingProps;var d=Us(t,sn.current);Gs(t,i),d=mc(null,t,l,e,d,i);var h=gc();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kn(l)?(h=!0,Vo(t)):h=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,lc(t),d.updater=aa,t.stateNode=d,d._reactInternals=t,Sc(t,l,e,i),t=Cc(null,t,l,!0,h,i)):(t.tag=0,vt&&h&&Zl(t),mn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(ca(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=wy(l),e=Jn(l,e),d){case 0:t=Nc(null,t,l,e,i);break e;case 1:t=op(null,t,l,e,i);break e;case 11:t=tp(null,t,l,e,i);break e;case 14:t=np(null,t,l,Jn(l.type,e),i);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),Nc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),op(e,t,l,d,i);case 3:e:{if(ap(t),e===null)throw Error(s(387));l=t.pendingProps,h=t.memoizedState,d=h.element,Sf(e,t),ea(t,l,null,i);var y=t.memoizedState;if(l=y.element,h.isDehydrated)if(h={element:l,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){d=Ys(Error(s(423)),t),t=lp(e,t,l,i,d);break e}else if(l!==d){d=Ys(Error(s(424)),t),t=lp(e,t,l,i,d);break e}else for(An=$r(t.stateNode.containerInfo.firstChild),Rn=t,vt=!0,Zn=null,i=wf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Hs(),l===d){t=Cr(e,t,i);break e}mn(e,t,l,i)}t=t.child}return t;case 5:return Nf(t),e===null&&tc(t),l=t.type,d=t.pendingProps,h=e!==null?e.memoizedProps:null,y=d.children,ql(l,d)?y=null:h!==null&&ql(l,h)&&(t.flags|=32),ip(e,t),mn(e,t,y,i),t.child;case 6:return e===null&&tc(t),null;case 13:return cp(e,t,i);case 4:return cc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Vs(t,null,l,i):mn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),tp(e,t,l,d,i);case 7:return mn(e,t,t.pendingProps,i),t.child;case 8:return mn(e,t,t.pendingProps.children,i),t.child;case 12:return mn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,h=t.memoizedProps,y=d.value,dt(Qo,l._currentValue),l._currentValue=y,h!==null)if(Qn(h.value,y)){if(h.children===d.children&&!wn.current){t=Cr(e,t,i);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var N=h.dependencies;if(N!==null){y=h.child;for(var I=N.firstContext;I!==null;){if(I.context===l){if(h.tag===1){I=Nr(-1,i&-i),I.tag=2;var B=h.updateQueue;if(B!==null){B=B.shared;var ee=B.pending;ee===null?I.next=I:(I.next=ee.next,ee.next=I),B.pending=I}}h.lanes|=i,I=h.alternate,I!==null&&(I.lanes|=i),oc(h.return,i,t),N.lanes|=i;break}I=I.next}}else if(h.tag===10)y=h.type===t.type?null:h.child;else if(h.tag===18){if(y=h.return,y===null)throw Error(s(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),oc(y,i,t),y=h.sibling}else y=h.child;if(y!==null)y.return=h;else for(y=h;y!==null;){if(y===t){y=null;break}if(h=y.sibling,h!==null){h.return=y.return,y=h;break}y=y.return}h=y}mn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Gs(t,i),d=Un(d),l=l(d),t.flags|=1,mn(e,t,l,i),t.child;case 14:return l=t.type,d=Jn(l,t.pendingProps),d=Jn(l.type,d),np(e,t,l,d,i);case 15:return rp(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Jn(l,d),ca(e,t),t.tag=1,kn(l)?(e=!0,Vo(t)):e=!1,Gs(t,i),Kf(t,l,d),Sc(t,l,d,i),Cc(null,t,l,!0,e,i);case 19:return dp(e,t,i);case 22:return sp(e,t,i)}throw Error(s(156,t.tag))};function Lp(e,t){return vi(e,t)}function xy(e,t,i,l){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=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(e,t,i,l){return new xy(e,t,i,l)}function qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wy(e){if(typeof e=="function")return qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===de)return 11;if(e===te)return 14}return 2}function Xr(e,t){var i=e.alternate;return i===null?(i=Hn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,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,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function wa(e,t,i,l,d,h){var y=2;if(l=e,typeof e=="function")qc(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case q:return xs(i.children,d,h,t);case G:y=8,d|=8;break;case ce:return e=Hn(12,i,t,d|2),e.elementType=ce,e.lanes=h,e;case he:return e=Hn(13,i,t,d),e.elementType=he,e.lanes=h,e;case Le:return e=Hn(19,i,t,d),e.elementType=Le,e.lanes=h,e;case le:return ka(i,d,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:y=10;break e;case ue:y=9;break e;case de:y=11;break e;case te:y=14;break e;case ie:y=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Hn(y,i,t,d),t.elementType=e,t.type=l,t.lanes=h,t}function xs(e,t,i,l){return e=Hn(7,e,l,t),e.lanes=i,e}function ka(e,t,i,l){return e=Hn(22,e,l,t),e.elementType=le,e.lanes=i,e.stateNode={isHidden:!1},e}function Gc(e,t,i){return e=Hn(6,e,null,t),e.lanes=i,e}function Kc(e,t,i){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ky(e,t,i,l,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wi(0),this.expirationTimes=wi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Yc(e,t,i,l,d,h,y,N,I){return e=new ky(e,t,i,N,I),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Hn(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},lc(h),e}function Sy(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Pp(e){if(!e)return Ur;e=e._reactInternals;e:{if(Ee(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(kn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(kn(i))return uf(e,i,t)}return t}function Op(e,t,i,l,d,h,y,N,I){return e=Yc(i,l,!0,e,d,h,y,N,I),e.context=Pp(null),i=e.current,l=gn(),d=Kr(i),h=Nr(l,d),h.callback=t??null,Hr(i,h,d),e.current.lanes=d,as(e,d,l),bn(e,l),e}function Sa(e,t,i,l){var d=t.current,h=gn(),y=Kr(d);return i=Pp(i),t.context===null?t.context=i:t.pendingContext=i,t=Nr(h,y),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Hr(d,t,y),e!==null&&(nr(e,d,y,h),Jo(e,d,y)),y}function Ta(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 zp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Xc(e,t){zp(e,t),(e=e.alternate)&&zp(e,t)}function Ty(){return null}var $p=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}ba.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Sa(e,t,null,null)},ba.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gs(function(){Sa(null,e,null,null)}),t[wr]=null}};function ba(e){this._internalRoot=e}ba.prototype.unstable_scheduleHydration=function(e){if(e){var t=we();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Pr.length&&t!==0&&t<Pr[i].priority;i++);Pr.splice(i,0,e),i===0&&bd(e)}};function Zc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Na(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fp(){}function by(e,t,i,l,d){if(d){if(typeof l=="function"){var h=l;l=function(){var B=Ta(y);h.call(B)}}var y=Op(t,l,e,0,null,!1,!1,"",Fp);return e._reactRootContainer=y,e[wr]=y.current,Ii(e.nodeType===8?e.parentNode:e),gs(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var B=Ta(I);N.call(B)}}var I=Yc(e,0,!1,null,null,!1,!1,"",Fp);return e._reactRootContainer=I,e[wr]=I.current,Ii(e.nodeType===8?e.parentNode:e),gs(function(){Sa(t,I,i,l)}),I}function Ca(e,t,i,l,d){var h=i._reactRootContainer;if(h){var y=h;if(typeof d=="function"){var N=d;d=function(){var I=Ta(y);N.call(I)}}Sa(t,y,e,d)}else y=by(i,t,e,d,l);return Ta(y)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=is(t.pendingLanes);i!==0&&(Lr(t,i|1),bn(t,St()),(Ye&6)===0&&(Zs=St()+500,Br()))}break;case 13:gs(function(){var l=br(e,1);if(l!==null){var d=gn();nr(l,e,1,d)}}),Xc(e,1)}},O=function(e){if(e.tag===13){var t=br(e,134217728);if(t!==null){var i=gn();nr(t,e,134217728,i)}Xc(e,134217728)}},Z=function(e){if(e.tag===13){var t=Kr(e),i=br(e,t);if(i!==null){var l=gn();nr(i,e,t,l)}Xc(e,t)}},we=function(){return Ge},_e=function(e,t){var i=Ge;try{return Ge=e,t()}finally{Ge=i}},Mt=function(e,t,i){switch(t){case"input":if(Yt(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var d=Wo(l);if(!d)throw Error(s(90));Oe(l),Yt(l,d)}}}break;case"textarea":me(e,i);break;case"select":t=i.value,t!=null&&lt(e,!!i.multiple,t,!1)}},_=Wc,re=gs;var Ny={usingClientEntryPoint:!1,Events:[Li,$s,Wo,jt,Ut,Wc]},Yi={findFiberByHostInstance:ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Cy={bundleType:Yi.bundleType,version:Yi.version,rendererPackageName:Yi.rendererPackageName,rendererConfig:Yi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Es(e),e===null?null:e.stateNode},findFiberByHostInstance:Yi.findFiberByHostInstance||Ty,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 Ea=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ea.isDisabled&&Ea.supportsFiber)try{rs=Ea.inject(Cy),_n=Ea}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ny,Nn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zc(t))throw Error(s(200));return Sy(e,t,null,i)},Nn.createRoot=function(e,t){if(!Zc(e))throw Error(s(299));var i=!1,l="",d=$p;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Yc(e,1,!1,null,null,i,!1,l,d),e[wr]=t.current,Ii(e.nodeType===8?e.parentNode:e),new Qc(t)},Nn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=Es(t),e=e===null?null:e.stateNode,e},Nn.flushSync=function(e){return gs(e)},Nn.hydrate=function(e,t,i){if(!Na(t))throw Error(s(200));return Ca(null,e,t,!0,i)},Nn.hydrateRoot=function(e,t,i){if(!Zc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,h="",y=$p;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),t=Op(t,null,e,1,i??null,d,!1,h,y),e[wr]=t.current,Ii(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,d]:t.mutableSourceEagerHydrationData.push(i,d);return new ba(t)},Nn.render=function(e,t,i){if(!Na(t))throw Error(s(200));return Ca(null,e,t,!1,i)},Nn.unmountComponentAtNode=function(e){if(!Na(e))throw Error(s(40));return e._reactRootContainer?(gs(function(){Ca(null,null,e,!1,function(){e._reactRootContainer=null,e[wr]=null})}),!0):!1},Nn.unstable_batchedUpdates=Wc,Nn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!Na(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return Ca(e,t,i,!1,l)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var Kp;function jm(){if(Kp)return tu.exports;Kp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),tu.exports=Ly(),tu.exports}var Yp;function Py(){if(Yp)return _a;Yp=1;var n=jm();return _a.createRoot=n.createRoot,_a.hydrateRoot=n.hydrateRoot,_a}var Oy=Py();const zy=_m(Oy),Xp=n=>{let r;const s=new Set,o=(g,v)=>{const k=typeof g=="function"?g(r):g;if(!Object.is(k,r)){const x=r;r=v??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(T=>T(r,x))}},a=()=>r,p={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(s.add(g),()=>s.delete(g))},m=r=n(o,a,p);return p},$y=(n=>n?Xp(n):Xp),Fy=n=>n;function Uy(n,r=Fy){const s=st.useSyncExternalStore(n.subscribe,st.useCallback(()=>r(n.getState()),[n,r]),st.useCallback(()=>r(n.getInitialState()),[n,r]));return st.useDebugValue(s),s}const By=n=>{const r=$y(n),s=o=>Uy(r,o);return Object.assign(s,r),s},Wy=(n=>By),Rm="agentpane:machines",Am="agentpane:active-machine";function Hy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function Im(n){return`${n}.repoburg.com`}function Dm(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function Mm(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function Lm(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function Pm(){return Mm(Rm,[]).filter(r=>Hy(r.mahlas)&&r.hostname===Im(r.mahlas))}function Vy(n){const r={mahlas:n,hostname:Im(n),lastConnectedAt:new Date().toISOString()},s=Pm(),o=[r,...s.filter(a=>a.mahlas!==n)];return Lm(Rm,o),r}function qy(){const n=Mm(Am,null);return n?Pm().find(r=>r.mahlas===n)??null:null}function Gy(n){Lm(Am,n)}function Ky(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Dm(n);r&&(Vy(r),Gy(r))}const Qp="http://localhost:9998",Yy=["agent.repoburg.com"];function ir(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const s=n.get("host");if(s)return`https://${s}`;const o=window.location.hostname;if(Yy.includes(o))return Qp;if(Dm(o))return"";const a=qy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Qp}const Xy="/api";async function vo(n,r,s){const o=await fetch(`${ir()}${Xy}${r}`,{method:n,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return o.json()}function yn(n){return vo("GET",n)}function Et(n,r){return vo("POST",n,r)}function ul(n){return vo("DELETE",n)}function vr(n,r){return vo("PATCH",n,r)}function Qy(n,r){return vo("PUT",n,r)}function Zy(){return yn("/sessions")}function Qi(n){return yn(`/sessions/${n}`)}function qu(n){return Et("/sessions",n)}function Zp(n){return ul(`/sessions/${n}`)}function Om(n,r,s){return Et(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{}})}function Jy(n){return Et(`/sessions/${n}/cancel`)}function ex(n,r){return Et(`/sessions/${n}/turns/${r}/resume`)}function tx(n,r){return vr(`/sessions/${n}`,{title:r})}function Jp(n){return vr(`/sessions/${n}`,{lifecycle:"finished"})}function eh(n){return vr(`/sessions/${n}`,{lifecycle:"working"})}function nx(n,r){return vr(`/sessions/${n}`,{starred:r})}function th(n){return vr(`/sessions/${n}`,{has_unreviewed:0})}function rx(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),vr(`/sessions/${n}`,a)}function sx(n,r){return vr(`/sessions/${n}`,{runtime_config:r})}function ix(n,r){return Et(`/sessions/${n}/rewind`,{turn_id:r})}function ox(n){return Et(`/sessions/${n}/restore`,{})}function ax(n,r,s){return Et(`/sessions/${n}/branch`,{turn_id:r,title:s})}function zm(){return yn("/workspaces")}function lx(n,r){return Et("/workspaces",{path:n,label:r})}function cx(n){return Et("/workspaces/hide",{path:n})}async function ux(){const n=await fetch(`${ir()}/api/pick-directory`);if(n.status===204)return{cancelled:!0};if(!n.ok)throw new Error(`GET /api/pick-directory failed: ${n.status} ${n.statusText}`);return n.json()}function $m(){return yn("/folders")}function dx(n,r){return Et("/folders",{workspace_path:n,name:r})}function nh(n,r){return vr(`/folders/${n}`,r)}function fx(n){return ul(`/folders/${n}`)}function px(n){return Et("/sessions/reorder",{moves:n})}function Ts(n){return n.status==="pending"||n.status==="running"}function Fm(n){return!!(n!=null&&n.turns.some(Ts))}function dl(n){return n?n.turns.some(Ts)||(n.threads??[]).some(r=>(r.turns??[]).some(Ts)):!1}const Um=1;function Bm(){let n="";try{n=ir()}catch{}return`agentpane:tabs:${n||window.location.origin}`}function rh(n){return Array.isArray(n)&&n.every(r=>typeof r=="string")}function sh(n){return n===null||typeof n=="string"}function hx(n){if(n==null)return null;let r;try{r=JSON.parse(n)}catch{return null}if(typeof r!="object"||r===null)return null;const s=r;return s.v!==Um||!rh(s.openTabs)||!sh(s.activeSessionId)||!rh(s.openAppTabs)||!sh(s.activeAppTabId)?null:{openTabs:s.openTabs,activeSessionId:s.activeSessionId,openAppTabs:s.openAppTabs,activeAppTabId:s.activeAppTabId}}const Wm=[()=>window.sessionStorage,()=>window.localStorage];function mx(){const n=Bm();for(const r of Wm)try{const s=hx(r().getItem(n));if(s)return s}catch{}return null}function gx(n){const r=Bm(),s=JSON.stringify({v:Um,openTabs:n.openTabs,activeSessionId:n.activeSessionId,openAppTabs:n.openAppTabs,activeAppTabId:n.activeAppTabId});for(const o of Wm)try{o().setItem(r,s)}catch{}}function vx(n){return n.subscribe((r,s)=>{(r.openTabs!==s.openTabs||r.activeSessionId!==s.activeSessionId||r.openAppTabs!==s.openAppTabs||r.activeAppTabId!==s.activeAppTabId)&&gx(r)})}function Ba(n){return[...new Set(n)]}function yx(n,r,s,o){const a=g=>s===null||s.has(g),u=Ba(((n==null?void 0:n.openTabs)??[]).filter(g=>r.has(g))),f=Ba(((n==null?void 0:n.openAppTabs)??[]).filter(a));let p=(n==null?void 0:n.activeSessionId)??null;p!==null&&!r.has(p)&&(p=null),p!==null&&!u.includes(p)&&u.push(p),p??(p=u.at(-1)??null);let m=(n==null?void 0:n.activeAppTabId)??null;return m!==null&&!a(m)&&(m=null),m!==null&&!f.includes(m)&&f.push(m),o!==null&&r.has(o)&&(u.includes(o)||u.push(o),p=o,m=null),{openTabs:u,activeSessionId:p,openAppTabs:f,activeAppTabId:m}}function xx(){const n=new URLSearchParams(window.location.search);return{session:n.get("session"),thread:n.get("thread")}}function wx(){const n=new URL(window.location.href);!n.searchParams.has("session")&&!n.searchParams.has("thread")||(n.searchParams.delete("session"),n.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",n))}let su=0;async function kx(n,r){const s=await Promise.allSettled(n.map(u=>r(u))),o=new Map;let a=null;return s.forEach((u,f)=>{var p;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((p=u.reason)==null?void 0:p.message)??"Request failed")}),{updated:o,firstError:a}}function ih(n,r){const s={...n.sessionDetails};r.forEach(p=>delete s[p]);const o={...n.backgroundTasks};r.forEach(p=>delete o[p]);const a=n.openTabs.filter(p=>!r.has(p));let u=n.activeSessionId,f=n.activeTurnIndex;if(u&&r.has(u)){u=a.length>0?a[a.length-1]:null;const p=u?s[u]:null;f=p&&p.turns.length>0?p.turns.length-1:0}return{sessions:n.sessions.filter(p=>!r.has(p.id)),sessionDetails:s,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function Sx(n){const r={...n};return delete r.turns,delete r.threads,delete r.contextUsage,r}async function oh(n,r,s,o,a){if(s.length===0)return;n({error:null});const{updated:u,firstError:f}=await kx(s,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const p=s.length-u.size;if(p===0)r().addToast("info",`${s.length} session${s.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);r().addToast(p===s.length?"error":"warn",`${m} ${u.size} of ${s.length} — ${p} failed`)}}const Tx=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const s=xx(),o=mx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&n({lastModelConfig:JSON.parse(a)})}catch{}n({loading:!0,error:null});try{const a=r().loadApps(),[u,f,p]=await Promise.all([Zy(),zm(),$m()]);n({sessions:u,workspaces:f,folders:p,loading:!1}),wx();const m=await a,g=yx(o,new Set(u.map(v=>v.id)),m?new Set(r().apps.map(v=>v.id)):null,s.session);n(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Ba([...g.openTabs,...v.openTabs]),openAppTabs:Ba([...g.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:g.activeAppTabId}}),g.activeSessionId&&!r().activeSessionId&&await r().selectSession(g.activeSessionId,{keepAppView:!0}),s.thread&&n({activeRightTab:"threads",deepLinkThreadId:s.thread})}catch(a){n({loading:!1,error:a.message})}},selectSession:async(s,o)=>{const a=++su,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=p=>p.includes(s)?p:[...p,s];if(r().sessionDetails[s]){const p=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:"turns",...u,openTabs:f(r().openTabs)}),p.has_unreviewed===1&&(th(s).catch(()=>{}),n(m=>({sessions:m.sessions.map(g=>g.id===s?{...g,has_unreviewed:0}:g),sessionDetails:{...m.sessionDetails,[s]:{...p,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const p=await Qi(s);if(a!==su){n(m=>({sessionDetails:{...m.sessionDetails,[s]:p},openTabs:f(m.openTabs),loading:!1}));return}n(m=>({sessionDetails:{...m.sessionDetails,[s]:p},activeSessionId:s,activeTurnIndex:p.turns.length>0?p.turns.length-1:0,activeRightTab:"turns",...u,openTabs:f(m.openTabs),loading:!1})),p.has_unreviewed===1&&(th(s).catch(()=>{}),n(m=>({sessions:m.sessions.map(g=>g.id===s?{...g,has_unreviewed:0}:g),sessionDetails:{...m.sessionDetails,[s]:{...p,has_unreviewed:0}}})))}catch(p){n(a===su?{loading:!1,error:p.message}:{loading:!1})}},closeTab:s=>{n(o=>{const a=o.openTabs.filter(u=>u!==s);if(o.activeSessionId===s&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===s?null:o.activeSessionId}})},updateModelConfig:async(s,o,a)=>{const u=r().activeSessionId;if(u){n({error:null});try{const f=await rx(u,s,o,a),p={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:p}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(p)),n(m=>({sessions:m.sessions.map(g=>g.id===u?f:g),sessionDetails:m.sessionDetails[u]?{...m.sessionDetails,[u]:{...m.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:m.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async s=>{n({error:null});try{const o=await qu(s);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(o.id),r().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),r().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},addSession:s=>{n(o=>({sessions:o.sessions.some(a=>a.id===s.id)?o.sessions:[s,...o.sessions]}))},revealSession:async s=>{let o=r().sessionDetails[s];if(!o){const a=await Qi(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a}})),o=a}r().sessions.some(a=>a.id===s)||r().addSession(Sx(o)),await r().selectSession(s)},deleteSession:async s=>{var a;n({error:null});const o=(a=r().sessions.find(u=>u.id===s))==null?void 0:a.title;try{await Zp(s),n(u=>ih(u,new Set([s]))),r().addLogEntry("INFO",`Session deleted — ${s.slice(0,8)}`),r().addToast("info",`Session "${o||s.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),r().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(s,o)=>{n({error:null});try{const a=await tx(s,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async s=>{n({error:null});try{const o=await Jp(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),r().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async s=>{await oh(n,r,s,Jp,"marked as finished")},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await nx(s,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async s=>{n({error:null});try{const o=await eh(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session reopened")}catch(o){n({error:o.message}),r().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async s=>{await oh(n,r,s,eh,"reopened")},deleteSessionMany:async s=>{if(s.length===0)return;n({error:null});const o=await Promise.allSettled(s.map(f=>Zp(f))),a=new Set;if(o.forEach((f,p)=>{f.status==="fulfilled"&&a.add(s[p])}),a.size===0){n({error:"Failed to delete sessions"}),r().addToast("error","Failed to delete sessions");return}n(f=>ih(f,a)),r().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=s.length-a.size;u===0?r().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),r().addToast("warn",`Deleted ${a.size} of ${s.length} — ${u} failed`))},submitPrompt:async(s,o)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:s}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(p=>p.id===a?{...p,is_running:1,status:"running"}:p)}:{}});try{const u=await Om(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const p=f.sessionDetails[a];if(!p)return{submittingPrompt:null};const m=p.turns.findIndex(v=>v.id===u.id);if(m>=0)return{submittingPrompt:null,activeTurnIndex:m};const g={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...p,turns:[...p.turns,g]}},activeTurnIndex:p.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),r().addLogEntry("ERROR",`Turn failed — ${u.message}`),r().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const p=f.sessionDetails[a];if(!p)return{};const m=dl(p)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...p,is_running:m,status:m?"running":"active"}},sessions:f.sessions.map(g=>g.id===a?{...g,is_running:m,status:m?"running":"active"}:g)}})}}},cancelTurn:async()=>{const s=r().activeSessionId;if(s)try{await Jy(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await ix(s,o),u=await Qi(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(p=>p.id===s?{...p,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:p),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),r().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),r().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async s=>{n({error:null});try{const o=await ox(s),a=await Qi(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a},sessions:u.sessions.map(f=>f.id===s?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),r().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),r().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(s,o,a)=>{n({error:null});try{const u=await ax(s,o,a);n(f=>({sessions:[u,...f.sessions]})),await r().selectSession(u.id),r().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),r().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async s=>{const o=r().activeSessionId;if(o){n({error:null});try{const a=await sx(o,JSON.stringify(s));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const s=r().activeSessionId;if(s)try{const o=await Qi(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===s?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),bx=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await lx(s.trim());n(a=>({workspaces:[...a.workspaces,o]})),r().addToast("success",`Workspace added — ${o.path}`)}catch(o){r().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async s=>{n({error:null});try{await cx(s);const o=await zm();n({workspaces:o}),r().addToast("info","Workspace hidden")}catch(o){r().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async s=>{n({error:null});try{const o=r().lastModelConfig,a=await qu({cwd:s,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});n(u=>({sessions:[a,...u.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${s} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${s.split("/").pop()||s}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const s=await ux();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),Ns=new Map,Gu=new Map,Ku=new Map,Yu=new Map;function Nx(n,r){Ns.set(n,r)}function Cx(n){Ns.delete(n)}function iu(n,r){Gu.set(n,r)}function ah(n,r,s){const o=Gu.get(n);if(!o)return;const a=Ns.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Ex(n,r,s,o){const a=Ns.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function _x(n,r,s,o){const a=Gu.get(n);if(!a)return;const u=Ns.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function jx(n,r){Ku.set(n,r)}function Rx(n){Ku.delete(n)}function Ax(n,r){Yu.set(n,r)}function Ix(n){Yu.delete(n)}function Dx(n){var s;const r=Ns.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=Yu.get(n))==null||s()}function Mx(n){var s;const r=Ns.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=Ku.get(n))==null||s()}const Lx=(n,r)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:s=>n({wsConnected:s}),onTurnCreated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[s]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=ei(a.sessions,s,()=>({is_running:1,status:"running"})),f=a.sessionDetails[s];if(!f)return{sessions:u};const p=f.turns.findIndex(m=>m.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Vn(f,o,m=>({...m,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===s&&p>=0?p:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=lh(a)?ws(u.retryStates,o):u.retryStates,p=u.sessionDetails[s];return p?{sessionDetails:{...u.sessionDetails,[s]:Vn(p,o,m=>au(m,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Vn(f,o,p=>au(p,a))}}:{}})},onItemCompleted:(s,o,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",p=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${g} completed: ${p}`):r().addToast("error",`${g} failed: ${p}`)}n(u=>{const f=lh(a)?ws(u.retryStates,o):u.retryStates,p=u.sessionDetails[s];return p?{retryStates:f,sessionDetails:{...u.sessionDetails,[s]:Vn(p,o,m=>{var v,k;let g=au(m,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(g={...g,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const x=g.thoughts?g.thoughts+`
41
- `+a.data.text:a.data.text;g={...g,thoughts:x}}return g})}}:{retryStates:f}})},onItemDelta:(s,o,a,u)=>{_x(s,o,a,u),n(f=>{const p=ws(f.retryStates,o),m=f.sessionDetails[s];return m?{sessionDetails:{...f.sessionDetails,[s]:Vn(m,o,g=>Ox(g,a,u))},retryStates:p}:{retryStates:p}})},onTurnCompleted:(s,o,a,u,f)=>{const p=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${p} in / ${m} out`),ah(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(g=>{const v=g.sessionDetails[s],k=v?Vn(v,o,R=>({...R,status:"completed",token_usage:a??R.token_usage??null,...f&&!R.agent_response?{agent_response:f}:{}})):null,x=ou(k),T=x&&k?ja(k):"active",E=ei(g.sessions,s,R=>({is_running:x,status:T,has_unreviewed:u?1:R.has_unreviewed})),C=ws(g.retryStates,o);return k?{sessionDetails:{...g.sessionDetails,[s]:{...k,is_running:x,status:T,has_unreviewed:u?1:k.has_unreviewed}},sessions:E,retryStates:C}:{sessions:E,retryStates:C}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Vn(f,o,p=>({...p,token_usage:a}))}}:{}})},onContextUsageUpdated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(s,o,a,u)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),ah(s,"turn:failed",{turnId:o,error:a}),n(f=>{const p=f.sessionDetails[s],m=a.includes("cancelled")||a.includes("aborted"),g=m?"aborted":"failed",v=p?Vn(p,o,C=>({...C,status:g,error:a,...u?{resume_state:u}:{},items:C.items.map(R=>R.status==="in_progress"?{...R,status:"failed"}:R)})):null,k=ou(v),x=k&&v?ja(v):m?"active":"failed",T=ei(f.sessions,s,()=>({is_running:k,status:x})),E=ws(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[s]:{...v,is_running:k,status:x}},sessions:T,retryStates:E}:{sessions:T,retryStates:E}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s],f=u?Vn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(x=>x.status==="in_progress"?{...x,status:"completed"}:x)})):null,p=ou(f),m=p&&f?ja(f):"active",g=ei(a.sessions,s,()=>({is_running:p,status:m})),v=ws(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[s]:{...f,is_running:p,status:m}},sessions:g,retryStates:v}:{sessions:g,retryStates:v}})},onTurnInterrupted:(s,o,a)=>{r().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),r().addToast("warn",Px(a.reason)),n(u=>{const f=u.sessionDetails[s],p=f?Vn(f,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts})):null,m=p?ja(p):"interrupted",g=ei(u.sessions,s,()=>({is_running:1,status:m})),v=ws(u.retryStates,o);return p?{sessionDetails:{...u.sessionDetails,[s]:{...p,is_running:1,status:m}},sessions:g,retryStates:v}:{sessions:g,retryStates:v}})},onTurnResuming:(s,o,a)=>{r().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),n(u=>{const f=ei(u.sessions,s,()=>({is_running:1,status:"running"})),p=u.sessionDetails[s];return p?{sessionDetails:{...u.sessionDetails,[s]:{...Vn(p,o,m=>({...m,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:f}:{sessions:f}})},onTurnResumed:(s,o)=>{r().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),r().addToast("success","Interrupted turn resumed"),n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:Vn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(s,o,a)=>{r().addLogEntry("WARN",`turn:retrying — ${s.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),n(u=>({retryStates:{...u.retryStates,[o]:a}}))},onSessionTitle:(s,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,title:o}:u),sessionDetails:a.sessionDetails[s]?{...a.sessionDetails,[s]:{...a.sessionDetails[s],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(s,o)=>{n(a=>{if(o.length===0&&!a.backgroundTasks[s])return{};const u={...a.backgroundTasks};return o.length>0?u[s]=o:delete u[s],{backgroundTasks:u}})},onBackgroundTasksSnapshot:s=>{const o={};for(const[a,u]of Object.entries(s))u.length>0&&(o[a]=u);n({backgroundTasks:o})}});function Px(n){switch(n){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 ja(n){const r=[...n.turns,...(n.threads??[]).flatMap(s=>s.turns??[])].filter(Ts);return r.length>0&&r.every(s=>s.status==="pending"&&s.resume_state==="waiting")?"interrupted":"running"}function lh(n){return n.type!=="background_task"&&n.type!=="error"&&n.type!=="interruption"}function ws(n,r){if(!(r in n))return n;const s={...n};return delete s[r],s}function ou(n){return n&&(n.turns.some(Ts)||(n.threads??[]).some(s=>(s.turns??[]).some(Ts)))?1:0}function ei(n,r,s){return n.some(o=>o.id===r)?n.map(o=>o.id===r?{...o,...s(o)}:o):n}function Vn(n,r,s){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===r)?{...a,turns:(a.turns??[]).map(u=>u.id===r?s(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===r?s(a):a),threads:o}}function au(n,r){const s=n.items.findIndex(o=>o.external_item_id===r.external_item_id);if(s>=0){const o=[...n.items];return o[s]=r,{...n,items:o}}if(r.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,r]}}return{...n,items:[...n.items,r]}}function Ox(n,r,s){var u;const o=n.items.findIndex(f=>f.external_item_id===r);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+s,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:s},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:s}}function zx(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return yn(`/providers/${n}/models${s}`)}const bu=160,Nu=480,$x=240,Wa=220,Fx=300,Ux=600;function Ha(){return typeof window>"u"?Ux:Math.max(Wa,Math.round(window.innerWidth*.7))}const ch="agentpane:sidebar-width",uh="agentpane:right-panel-width";function dh(n,r,s,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(s,Math.max(r,u)):o}catch{return o}}const fh=200,Bx=(n,r)=>({activeRightTab:"turns",changesScope:"session",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,selectedChangePath:null,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:dh(ch,bu,Nu,$x),rightPanelWidth:dh(uh,Wa,Ha(),Fx),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:s=>n({activeTurnIndex:s}),switchRightTab:s=>n({activeRightTab:s}),setChangesScope:s=>n({changesScope:s}),setShowNewSessionDialog:s=>n({showNewSessionDialog:s}),setShowRemoteModal:s=>n({showRemoteModal:s}),setShowCommandPalette:s=>n({showCommandPalette:s}),setShowModelSelector:s=>n({showModelSelector:s}),setSelectedChangePath:s=>n({selectedChangePath:s}),setDeepLinkThreadId:s=>n({deepLinkThreadId:s}),setSidebarWidth:s=>{const o=Math.min(Nu,Math.max(bu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(ch,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(Ha(),Math.max(Wa,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(uh,String(o))}catch{}},toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(s,o,a)=>n({vscodeState:s,vscodeId:o,vscodeToken:a}),addToast:(s,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(p=>({toasts:[...p.toasts,{id:f,type:s,message:o,undoAction:a,undoLabel:u}]}))},removeToast:s=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==s)}))},addLogEntry:(s,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:s,message:o}];return f.length>fh&&f.splice(0,f.length-fh),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await zx(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),Wx=(n,r)=>({createThread:async(s,o)=>{try{await Et(`/sessions/${s}/threads`,o),r().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(s,o,a)=>{try{await Et(`/sessions/${s}/threads/${o}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){r().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(s,o)=>{try{await Et(`/sessions/${s}/cancel?threadId=${encodeURIComponent(o)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(s,o)=>{try{await vr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await vr(`/sessions/${s}/threads/${o}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(s,o,a)=>{try{const u=await Et(`/sessions/${s}/threads/${o}/summarize`,{directives:a}),f=`
42
- [Shared from a resolved discussion thread — summary of its findings]
43
-
44
- \`\`\`QUOTE
45
- ${u.summary}
46
- \`\`\`
47
-
48
- `;return n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(u){return r().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(s,o)=>{try{await ul(`/sessions/${s}/threads/${o}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:(f.threads??[]).map(p=>p.id===o?{...p,turns:[...p.turns??[],{...a,items:[]}]}:p)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const p=(f.threads??[]).map(m=>m.id===o?{...m,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:m);return{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:p}}}})},onThreadDeleted:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),Hx=(n,r)=>({folders:[],loadFolders:async()=>{const s=await $m();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await dx(s,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(s,o)=>{try{const a=await nh(s,{name:o});n(u=>({folders:u.folders.map(f=>f.id===s?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async s=>{const o=r().folders,a=r().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==s),sessions:u.sessions.map(f=>f.folder_id===s?{...f,folder_id:null}:f)}));try{await fx(s)}catch(u){n({folders:o,sessions:a}),r().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async s=>{if(s.length===0)return;const o=r().sessions,a=new Map(s.map(u=>[u.id,u]));n(u=>({sessions:u.sessions.map(f=>{const p=a.get(f.id);return p?{...f,folder_id:p.folder_id,sort_order:p.sort_order}:f})}));try{await px(s)}catch(u){n({sessions:o}),r().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async s=>{const o=r().folders,a=new Map(s.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(s.map((u,f)=>nh(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function ph(){return yn("/apps")}function Vx(){return yn("/apps/root")}function hh(n){return yn(`/apps/${n}/source`)}function mh(n,r=""){return yn(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function Hm(n,r,s=""){return Qy(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function qx(n){return ul(`/apps/${n}`)}function Gx(n){return yn(`/apps/${n}/sessions`)}function Kx(){return yn("/apps/examples")}function Yx(n){return Et(`/apps/examples/${n}/install`,{})}function Xx(n){return Et("/apps",n)}function Qx(n,r){return Et("/apps/import",{id:n,files:r})}function Zx(n,r,s){return Et(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function Jx(n,r){return Et(`/apps/${n}/edit-session`,r)}const Oa=new Set;async function lu(n,r){Oa.add(r),await n().loadApps();const s=n().apps.find(o=>o.id===r);n().openAppTab(r),n().addToast("success",`Mini app added: ${(s==null?void 0:s.title)??r}`)}const Cu="agentpane:app-workspaces";function e0(){try{const n=JSON.parse(localStorage.getItem(Cu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const t0=(n,r)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:e0(),loadApps:async()=>{try{const[s,o]=await Promise.all([ph(),Vx().catch(()=>null)]);return s.forEach(a=>Oa.add(a.id)),n(o?{apps:s,appsRootPath:o.root}:{apps:s}),!0}catch{return!1}},refreshApps:async()=>{try{const s=await ph();for(const o of s)Oa.has(o.id)||(Oa.add(o.id),r().addToast("success",`New mini app discovered: ${o.title}`));n({apps:s})}catch{}},openAppTab:s=>{n(o=>({activeAppTabId:s,openAppTabs:o.openAppTabs.includes(s)?o.openAppTabs:[...o.openAppTabs,s]}))},closeAppTab:s=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==s);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===s?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:s=>n({activeAppTabId:s}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(s,o)=>{n(a=>{const u={...a.appWorkspaces,[s]:o};try{localStorage.setItem(Cu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await Yx(s),await lu(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await Xx(s),await lu(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await Qx(s,o),await lu(r,s),!0}catch(a){return r().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async s=>{try{const o=r().lastModelConfig,a=await Jx(s,{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});r().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await r().selectSession(a.id),r().addLogEntry("INFO",`App edit session opened for ${s}`)}catch(o){r().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async s=>{const o=r().apps.find(a=>a.id===s);if(o)try{await Hm(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await qx(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(Cu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==s),openAppTabs:o.openAppTabs.filter(u=>u!==s),activeAppTabId:o.activeAppTabId===s?null:o.activeAppTabId,appWorkspaces:a}}),r().addToast("success",`Mini app deleted: ${s}`)}catch(o){r().addToast("error",`Failed to delete app — ${o.message}`)}}}),gh=3e3,Mn={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Ln=[];let Va=0,Xu=0,qa=0,Qu=0,Ga=0,Zu=0,Ju=0;const fo=new Map,po=new Map;let ai=new Map,ii=0,li=new Map,cu=!1;function Ka(n,r,s){if(Ln.push({t:Date.now(),cat:n,msg:r,ms:s}),Ln.length>gh){const o=Ln.length-gh;Ln.splice(0,o),Cn=Math.max(0,Cn-o)}}function oi(n,r,s){Ka(n,r,s),console.log(`[perf:${n}] ${r}`)}function Vm(n){oi("note",n)}function qm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function n0(n,r){let s=ai.get(n);s||ai.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=fo.get(n);o||fo.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function r0(){ii++,Ju++}function s0(n){li.set(n,(li.get(n)??0)+1),po.set(n,(po.get(n)??0)+1)}let za=0;function i0(){za=performance.now()}function o0(){const n=performance.now(),r=za?n-za:null;za=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Mn.keypressMs&&oi("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const a0=5e3,Gm=500,vh=2e3;let Cn=0,uu=!1;function l0(n){return Et("/perf-log",{entries:n}).then(()=>{Cn+=n.length})}function c0(){if(uu||Cn>=Ln.length)return;const n=Ln.slice(Cn,Cn+Gm);n.length!==0&&(uu=!0,l0(n).catch(()=>{Ln.length-Cn>vh&&(Cn=Math.max(Cn,Ln.length-vh))}).finally(()=>{uu=!1}))}function yh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Cn>=Ln.length)return;const n=Ln.slice(Cn,Cn+Gm);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ir()}/api/perf-log`,r),Cn+=n.length}catch{}}function u0(){let n=0;for(const o of ai.values())n+=o.n;const r=[];if(n>0){const o=[...ai.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${qm(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}ii>0&&r.push(`store ${ii}/s`);const s=[...li.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(s.length>0&&r.push(`renders ${s.join(" ")}`),r.length>0){const o=r.join(" · ");Ka("stat",o);const a=[...li.values()].some(u=>u>Mn.renderPerSecLog);(n>Mn.wsPerSecLog||ii>Mn.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ai=new Map,ii=0,li=new Map}function d0(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",s=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${s}`}return n?"window":"unknown"}function f0(){if(cu||typeof window>"u")return()=>{};cu=!0,Va=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Mn.lagMs&&(Xu++,qa=Math.max(qa,f),oi("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(s)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const p=m=>{const g=m-u;u=m,g>Mn.frameGapMs&&oi("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(p)};f=window.requestAnimationFrame(p),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var p;for(const m of f.getEntries()){const g=m.duration;if(g<Mn.longtaskBufferMs)continue;Qu++,Ga=Math.max(Ga,g);const v=(p=m.attribution)==null?void 0:p[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",x=`long task ${Math.round(g)}ms (${k})`;g>=Mn.longtaskLogMs?oi("longtask",x,g):Ka("longtask",x,g)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const p of f.getEntries()){const m=p.duration,g=p.processingStart-p.startTime;Zu++;const v=`${p.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${d0(p.target)}`;m>=Mn.eventLogMs?oi("input",v,m):Ka("input",v,m)}});u.observe({type:"event",durationThreshold:Mn.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(u0,1e3);n.push(()=>window.clearInterval(o)),Vm("perf logger session started");const a=window.setInterval(c0,a0);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",yh),n.push(()=>window.removeEventListener("beforeunload",yh)),window.__agentPanePerf={dump:Km,reset:Ym},()=>{n.forEach(u=>u()),cu=!1}}function Km(){const n=[],r=Va?Math.round((Date.now()-Va)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Ln.length} buffered entries`),n.push(`event-loop lag: ${Xu} blocks >${Mn.lagMs}ms (max ${Math.round(qa)}ms)`),n.push(`long tasks: ${Qu} ≥${Mn.longtaskBufferMs}ms (max ${Math.round(Ga)}ms)`),n.push(`slow input events (≥${Mn.eventBufferMs}ms): ${Zu}`),n.push(`store updates: ${Ju} total`),fo.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...fo.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${qm(o.bytes)}`)}if(po.size>0){n.push("render counts by component:");for(const[s,o]of[...po.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Ln.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
49
- `)}function Ym(){Ln.length=0,Cn=0,Va=Date.now(),Xu=0,qa=0,Qu=0,Ga=0,Zu=0,Ju=0,fo.clear(),po.clear(),ai=new Map,ii=0,li=new Map}const Kt={start:f0,note:Vm,trackWsEvent:n0,trackStoreUpdate:r0,trackRender:s0,markKeystroke:i0,markInputChange:o0,dump:Km,reset:Ym},M=Wy()((...n)=>({...Tx(...n),...bx(...n),...Lx(...n),...Bx(...n),...Wx(...n),...Hx(...n),...t0(...n)}));typeof window<"u"&&(M.subscribe(()=>Kt.trackStoreUpdate()),vx(M));function Eu(n){switch(n){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 p0(n,r,s=!1,o="working",a=0){if(o==="finished")return"";if(n==="interrupted")return"interrupted";if(r)return"running";if(a>0)return"background";if(s&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function h0(n,r,s=!1,o="working",a=0){if(o==="finished")return"Finished";if(n==="interrupted")return"Interrupted";if(r)return"Running";if(a>0)return"Background";if(s&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function fl(n,r=0){const s=n.is_running===1,o=n.lifecycle==="finished",a=Eu(n.runtime_type),u=p0(n.status,s,n.has_unreviewed===1,n.lifecycle,r),f=h0(n.status,s,n.has_unreviewed===1,n.lifecycle,r);return{dot:u,label:f,dotTitle:u==="background"?`${r} background task${r===1?"":"s"} running`:f,iconClass:a.iconClass,iconText:a.iconText,isRunning:s,isFinished:o,backgroundTaskCount:r}}function pl(n,r,s=!0){w.useEffect(()=>{if(!s)return;function o(a){n.current&&!n.current.contains(a.target)&&r()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,r,s])}function ed(n,r=!0){w.useEffect(()=>{if(!r)return;function s(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r])}function td({status:n,size:r=6,title:s}){return c.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0,title:s})}function nd({iconClass:n,iconText:r,size:s=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:s!==20?{width:s,height:s,fontSize:s*.45}:void 0,children:r})}/**
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 m0=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Xm=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).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 g0={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 v0=w.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...p},m)=>w.createElement("svg",{ref:m,...g0,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:Xm("lucide",a),...p},[...f.map(([g,v])=>w.createElement(g,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 be=(n,r)=>{const s=w.forwardRef(({className:o,...a},u)=>w.createElement(v0,{ref:u,iconNode:r,className:Xm(`lucide-${m0(n)}`,o),...a}));return s.displayName=`${n}`,s};/**
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 y0=be("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
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 _u=be("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"}]]);/**
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 x0=be("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"}]]);/**
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 ts=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 ci=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 rd=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 hl=be("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"}]]);/**
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 w0=be("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 Ya=be("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
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 k0=be("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"}]]);/**
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 S0=be("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
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 T0=be("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"}]]);/**
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 Qm=be("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"}]]);/**
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 xh=be("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"}]]);/**
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 ju=be("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"}]]);/**
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 b0=be("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
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 N0=be("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"}]]);/**
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 C0=be("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
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 E0=be("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"}]]);/**
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 Zm=be("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"}]]);/**
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 du=be("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"}]]);/**
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 Ru=be("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"}]]);/**
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 _0=be("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"}]]);/**
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 j0=be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
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 R0=be("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"}]]);/**
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 A0=be("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"}]]);/**
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 I0=be("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"}]]);/**
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 D0=be("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"}]]);/**
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 sr=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 M0=be("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"}]]);/**
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 L0=be("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"}]]);/**
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 P0=be("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"}]]);/**
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 O0=be("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"}]]);/**
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 wh=be("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"}]]);/**
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 z0=be("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
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 $0=be("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"}]]);/**
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 $a=be("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"}]]);/**
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 F0=be("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"}]]);/**
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 U0=be("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"}]]);/**
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 Ss=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 Jm=be("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"}]]);/**
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 B0=be("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"}]]);/**
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 ho=be("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"}]]);/**
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 eg=be("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"}]]);/**
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 tg=be("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"}]]);/**
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 W0=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 ml=be("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"}]]);/**
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 H0=be("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"}]]);/**
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 fi=be("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
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 Xa=be("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"}]]);/**
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 ng=be("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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 gr=be("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"}]]);/**
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 V0=be("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"}]]);/**
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 q0=be("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"}]]);/**
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 G0=be("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"}]]);/**
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 K0=be("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"}]]);/**
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 rg=be("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"}]]);/**
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 Y0=be("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"}]]);/**
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 Pn=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
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 X0=be("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"}]]);var ro=jm();function Q0(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>o=>{r.forEach(a=>a(o))},r)}const gl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pi(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function sd(n){return"nodeType"in n}function xn(n){var r,s;return n?pi(n)?n:sd(n)&&(r=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?r:window:window}function id(n){const{Document:r}=xn(n);return n instanceof r}function yo(n){return pi(n)?!1:n instanceof xn(n).HTMLElement}function sg(n){return n instanceof xn(n).SVGElement}function hi(n){return n?pi(n)?n.document:sd(n)?id(n)?n:yo(n)||sg(n)?n.ownerDocument:document:document:document}const or=gl?w.useLayoutEffect:w.useEffect;function vl(n){const r=w.useRef(n);return or(()=>{r.current=n}),w.useCallback(function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r.current==null?void 0:r.current(...o)},[])}function Z0(){const n=w.useRef(null),r=w.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),s=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,s]}function mo(n,r){r===void 0&&(r=[n]);const s=w.useRef(n);return or(()=>{s.current!==n&&(s.current=n)},r),s}function xo(n,r){const s=w.useRef();return w.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...r])}function Qa(n){const r=vl(n),s=w.useRef(null),o=w.useCallback(a=>{a!==s.current&&(r==null||r(a,s.current)),s.current=a},[]);return[s,o]}function Za(n){const r=w.useRef();return w.useEffect(()=>{r.current=n},[n]),r.current}let fu={};function wo(n,r){return w.useMemo(()=>{if(r)return r;const s=fu[n]==null?0:fu[n]+1;return fu[n]=s,n+"-"+s},[n,r])}function ig(n){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const p=Object.entries(f);for(const[m,g]of p){const v=u[m];v!=null&&(u[m]=v+n*g)}return u},{...r})}}const ui=ig(1),Ja=ig(-1);function J0(n){return"clientX"in n&&"clientY"in n}function yl(n){if(!n)return!1;const{KeyboardEvent:r}=xn(n.target);return r&&n instanceof r}function ew(n){if(!n)return!1;const{TouchEvent:r}=xn(n.target);return r&&n instanceof r}function el(n){if(ew(n)){if(n.touches&&n.touches.length){const{clientX:r,clientY:s}=n.touches[0];return{x:r,y:s}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:r,clientY:s}=n.changedTouches[0];return{x:r,y:s}}}return J0(n)?{x:n.clientX,y:n.clientY}:null}const Ar=Object.freeze({Translate:{toString(n){if(!n)return;const{x:r,y:s}=n;return"translate3d("+(r?Math.round(r):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:r,scaleY:s}=n;return"scaleX("+r+") scaleY("+s+")"}},Transform:{toString(n){if(n)return[Ar.Translate.toString(n),Ar.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:s,easing:o}=n;return r+" "+s+"ms "+o}}}),kh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function tw(n){return n.matches(kh)?n:n.querySelector(kh)}const nw={display:"none"};function rw(n){let{id:r,value:s}=n;return st.createElement("div",{id:r,style:nw},s)}function sw(n){let{id:r,announcement:s,ariaLiveType:o="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return st.createElement("div",{id:r,style:a,role:"status","aria-live":o,"aria-atomic":!0},s)}function iw(){const[n,r]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&r(o)},[]),announcement:n}}const og=w.createContext(null);function ow(n){const r=w.useContext(og);w.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function aw(){const[n]=w.useState(()=>new Set),r=w.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[w.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var p;return(p=f[a])==null?void 0:p.call(f,u)})},[n]),r]}const lw={draggable:`
370
- To pick up a draggable item, press the space bar.
371
- While dragging, use the arrow keys to move the item.
372
- Press space again to drop the item in its new position, or press escape to cancel.
373
- `},cw={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was moved over droppable area "+s.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was dropped over droppable area "+s.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function uw(n){let{announcements:r=cw,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=lw}=n;const{announce:u,announcement:f}=iw(),p=wo("DndLiveRegion"),[m,g]=w.useState(!1);if(w.useEffect(()=>{g(!0)},[]),ow(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(r.onDragStart({active:x}))},onDragMove(k){let{active:x,over:T}=k;r.onDragMove&&u(r.onDragMove({active:x,over:T}))},onDragOver(k){let{active:x,over:T}=k;u(r.onDragOver({active:x,over:T}))},onDragEnd(k){let{active:x,over:T}=k;u(r.onDragEnd({active:x,over:T}))},onDragCancel(k){let{active:x,over:T}=k;u(r.onDragCancel({active:x,over:T}))}}),[u,r])),!m)return null;const v=st.createElement(st.Fragment,null,st.createElement(rw,{id:o,value:a.draggable}),st.createElement(sw,{id:p,announcement:f}));return s?ro.createPortal(v,s):v}var $t;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})($t||($t={}));function tl(){}function dw(n,r){return w.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function fw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const ar=Object.freeze({x:0,y:0});function pw(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function hw(n,r){const s=el(n);if(!s)return"0 0";const o={x:(s.x-r.left)/r.width*100,y:(s.y-r.top)/r.height*100};return o.x+"% "+o.y+"%"}function mw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function gw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function vw(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function Sh(n,r,s){return r===void 0&&(r=n.left),s===void 0&&(s=n.top),{x:r+n.width*.5,y:s+n.height*.5}}const yw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=Sh(r,r.left,r.top),u=[];for(const f of o){const{id:p}=f,m=s.get(p);if(m){const g=pw(Sh(m),a);u.push({id:p,data:{droppableContainer:f,value:g}})}}return u.sort(mw)};function xw(n,r){const s=Math.max(r.top,n.top),o=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),u=Math.min(r.top+r.height,n.top+n.height),f=a-o,p=u-s;if(o<a&&s<u){const m=r.width*r.height,g=n.width*n.height,v=f*p,k=v/(m+g-v);return Number(k.toFixed(4))}return 0}const ww=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,p=s.get(f);if(p){const m=xw(p,r);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(gw)};function kw(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function ag(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:ar}function Sw(n){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...s})}}const Tw=Sw(1);function lg(n){if(n.startsWith("matrix3d(")){const r=n.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(n.startsWith("matrix(")){const r=n.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function bw(n,r,s){const o=lg(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:p}=o,m=n.left-f-(1-a)*parseFloat(s),g=n.top-p-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),v=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:v,height:k,top:g,right:m+v,bottom:g+k,left:m}}const Nw={ignoreTransform:!1};function mi(n,r){r===void 0&&(r=Nw);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:g,transformOrigin:v}=xn(n).getComputedStyle(n);g&&(s=bw(s,g,v))}const{top:o,left:a,width:u,height:f,bottom:p,right:m}=s;return{top:o,left:a,width:u,height:f,bottom:p,right:m}}function Th(n){return mi(n,{ignoreTransform:!0})}function Cw(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function Ew(n,r){return r===void 0&&(r=xn(n).getComputedStyle(n)),r.position==="fixed"}function _w(n,r){r===void 0&&(r=xn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=r[a];return typeof u=="string"?s.test(u):!1})}function od(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(id(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!yo(a)||sg(a)||s.includes(a))return s;const u=xn(n).getComputedStyle(a);return a!==n&&_w(a,u)&&s.push(a),Ew(a,u)?s:o(a.parentNode)}return n?o(n):s}function cg(n){const[r]=od(n,1);return r??null}function pu(n){return!gl||!n?null:pi(n)?n:sd(n)?id(n)||n===hi(n).scrollingElement?window:yo(n)?n:null:null}function ug(n){return pi(n)?n.scrollX:n.scrollLeft}function dg(n){return pi(n)?n.scrollY:n.scrollTop}function Au(n){return{x:ug(n),y:dg(n)}}var Gt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Gt||(Gt={}));function fg(n){return!gl||!n?!1:n===document.scrollingElement}function pg(n){const r={x:0,y:0},s=fg(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},a=n.scrollTop<=r.y,u=n.scrollLeft<=r.x,f=n.scrollTop>=o.y,p=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:p,maxScroll:o,minScroll:r}}const jw={x:.2,y:.2};function Rw(n,r,s,o,a){let{top:u,left:f,right:p,bottom:m}=s;o===void 0&&(o=10),a===void 0&&(a=jw);const{isTop:g,isBottom:v,isLeft:k,isRight:x}=pg(n),T={x:0,y:0},E={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!g&&u<=r.top+C.height?(T.y=Gt.Backward,E.y=o*Math.abs((r.top+C.height-u)/C.height)):!v&&m>=r.bottom-C.height&&(T.y=Gt.Forward,E.y=o*Math.abs((r.bottom-C.height-m)/C.height)),!x&&p>=r.right-C.width?(T.x=Gt.Forward,E.x=o*Math.abs((r.right-C.width-p)/C.width)):!k&&f<=r.left+C.width&&(T.x=Gt.Backward,E.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:T,speed:E}}function Aw(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:r,left:s,right:o,bottom:a}=n.getBoundingClientRect();return{top:r,left:s,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function hg(n){return n.reduce((r,s)=>ui(r,Au(s)),ar)}function Iw(n){return n.reduce((r,s)=>r+ug(s),0)}function Dw(n){return n.reduce((r,s)=>r+dg(s),0)}function mg(n,r){if(r===void 0&&(r=mi),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);cg(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const Mw=[["x",["left","right"],Iw],["y",["top","bottom"],Dw]];class ad{constructor(r,s){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=od(s),a=hg(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,p]of Mw)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=p(o),v=a[u]-g;return this.rect[m]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class oo{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=r}add(r,s,o){var a;(a=this.target)==null||a.addEventListener(r,s,o),this.listeners.push([r,s,o])}}function Lw(n){const{EventTarget:r}=xn(n);return n instanceof r?n:hi(n)}function hu(n,r){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof r=="number"?Math.sqrt(s**2+o**2)>r:"x"in r&&"y"in r?s>r.x&&o>r.y:"x"in r?s>r.x:"y"in r?o>r.y:!1}var Gn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Gn||(Gn={}));function bh(n){n.preventDefault()}function Pw(n){n.stopPropagation()}var Ze;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ze||(Ze={}));const gg={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},Ow=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case Ze.Right:return{...s,x:s.x+25};case Ze.Left:return{...s,x:s.x-25};case Ze.Down:return{...s,y:s.y+25};case Ze.Up:return{...s,y:s.y-25}}};class vg{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;const{event:{target:s}}=r;this.props=r,this.listeners=new oo(hi(s)),this.windowListeners=new oo(xn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&mg(o),s(ar)}handleKeyDown(r){if(yl(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=gg,coordinateGetter:f=Ow,scrollBehavior:p="smooth"}=a,{code:m}=r;if(u.end.includes(m)){this.handleEnd(r);return}if(u.cancel.includes(m)){this.handleCancel(r);return}const{collisionRect:g}=o.current,v=g?{x:g.left,y:g.top}:ar;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(r,{active:s,context:o.current,currentCoordinates:v});if(k){const x=Ja(k,v),T={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const R=r.code,{isTop:L,isRight:b,isLeft:U,isBottom:P,maxScroll:W,minScroll:K}=pg(C),q=Aw(C),G={x:Math.min(R===Ze.Right?q.right-q.width/2:q.right,Math.max(R===Ze.Right?q.left:q.left+q.width/2,k.x)),y:Math.min(R===Ze.Down?q.bottom-q.height/2:q.bottom,Math.max(R===Ze.Down?q.top:q.top+q.height/2,k.y))},ce=R===Ze.Right&&!b||R===Ze.Left&&!U,pe=R===Ze.Down&&!P||R===Ze.Up&&!L;if(ce&&G.x!==k.x){const ue=C.scrollLeft+x.x,de=R===Ze.Right&&ue<=W.x||R===Ze.Left&&ue>=K.x;if(de&&!x.y){C.scrollTo({left:ue,behavior:p});return}de?T.x=C.scrollLeft-ue:T.x=R===Ze.Right?C.scrollLeft-W.x:C.scrollLeft-K.x,T.x&&C.scrollBy({left:-T.x,behavior:p});break}else if(pe&&G.y!==k.y){const ue=C.scrollTop+x.y,de=R===Ze.Down&&ue<=W.y||R===Ze.Up&&ue>=K.y;if(de&&!x.x){C.scrollTo({top:ue,behavior:p});return}de?T.y=C.scrollTop-ue:T.y=R===Ze.Down?C.scrollTop-W.y:C.scrollTop-K.y,T.y&&C.scrollBy({top:-T.y,behavior:p});break}}this.handleMove(r,ui(Ja(k,this.referenceCoordinates),T))}}}handleMove(r,s){const{onMove:o}=this.props;r.preventDefault(),o(s)}handleEnd(r){const{onEnd:s}=this.props;r.preventDefault(),this.detach(),s()}handleCancel(r){const{onCancel:s}=this.props;r.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}vg.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=gg,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function Nh(n){return!!(n&&"distance"in n)}function Ch(n){return!!(n&&"delay"in n)}class ld{constructor(r,s,o){var a;o===void 0&&(o=Lw(r.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=r,this.events=s;const{event:u}=r,{target:f}=u;this.props=r,this.events=s,this.document=hi(f),this.documentListeners=new oo(this.document),this.listeners=new oo(o),this.windowListeners=new oo(xn(f)),this.initialCoordinates=(a=el(u))!=null?a:ar,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:r,props:{options:{activationConstraint:s,bypassActivationConstraint:o}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(Gn.Resize,this.handleCancel),this.windowListeners.add(Gn.DragStart,bh),this.windowListeners.add(Gn.VisibilityChange,this.handleCancel),this.windowListeners.add(Gn.ContextMenu,bh),this.documentListeners.add(Gn.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ch(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(Nh(s)){this.handlePending(s);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(r,s){const{active:o,onPending:a}=this.props;a(o,r,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:r}=this,{onStart:s}=this.props;r&&(this.activated=!0,this.documentListeners.add(Gn.Click,Pw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gn.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!a)return;const m=(s=el(r))!=null?s:ar,g=Ja(a,m);if(!o&&p){if(Nh(p)){if(p.tolerance!=null&&hu(g,p.tolerance))return this.handleCancel();if(hu(g,p.distance))return this.handleStart()}if(Ch(p)&&hu(g,p.tolerance))return this.handleCancel();this.handlePending(p,g);return}r.cancelable&&r.preventDefault(),f(m)}handleEnd(){const{onAbort:r,onEnd:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleCancel(){const{onAbort:r,onCancel:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleKeydown(r){r.code===Ze.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const zw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cd extends ld{constructor(r){const{event:s}=r,o=hi(s.target);super(r,zw,o)}}cd.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const $w={move:{name:"mousemove"},end:{name:"mouseup"}};var Iu;(function(n){n[n.RightClick=2]="RightClick"})(Iu||(Iu={}));class Fw extends ld{constructor(r){super(r,$w,hi(r.event.target))}}Fw.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===Iu.RightClick?!1:(o==null||o({event:s}),!0)}}];const mu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Uw extends ld{constructor(r){super(r,mu)}static setup(){return window.addEventListener(mu.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(mu.move.name,r)};function r(){}}}Uw.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;const{touches:a}=s;return a.length>1?!1:(o==null||o({event:s}),!0)}}];var ao;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ao||(ao={}));var nl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(nl||(nl={}));function Bw(n){let{acceleration:r,activator:s=ao.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:p=nl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:v,delta:k,threshold:x}=n;const T=Hw({delta:k,disabled:!u}),[E,C]=Z0(),R=w.useRef({x:0,y:0}),L=w.useRef({x:0,y:0}),b=w.useMemo(()=>{switch(s){case ao.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case ao.DraggableRect:return a}},[s,a,m]),U=w.useRef(null),P=w.useCallback(()=>{const K=U.current;if(!K)return;const q=R.current.x*L.current.x,G=R.current.y*L.current.y;K.scrollBy(q,G)},[]),W=w.useMemo(()=>p===nl.TreeOrder?[...g].reverse():g,[p,g]);w.useEffect(()=>{if(!u||!g.length||!b){C();return}for(const K of W){if((o==null?void 0:o(K))===!1)continue;const q=g.indexOf(K),G=v[q];if(!G)continue;const{direction:ce,speed:pe}=Rw(K,G,b,r,x);for(const ue of["x","y"])T[ue][ce[ue]]||(pe[ue]=0,ce[ue]=0);if(pe.x>0||pe.y>0){C(),U.current=K,E(P,f),R.current=pe,L.current=ce;return}}R.current={x:0,y:0},L.current={x:0,y:0},C()},[r,P,o,C,u,f,JSON.stringify(b),JSON.stringify(T),E,g,W,v,JSON.stringify(x)])}const Ww={x:{[Gt.Backward]:!1,[Gt.Forward]:!1},y:{[Gt.Backward]:!1,[Gt.Forward]:!1}};function Hw(n){let{delta:r,disabled:s}=n;const o=Za(r);return xo(a=>{if(s||!o||!a)return Ww;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Gt.Backward]:a.x[Gt.Backward]||u.x===-1,[Gt.Forward]:a.x[Gt.Forward]||u.x===1},y:{[Gt.Backward]:a.y[Gt.Backward]||u.y===-1,[Gt.Forward]:a.y[Gt.Forward]||u.y===1}}},[s,r,o])}function Vw(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return xo(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function qw(n,r){return w.useMemo(()=>n.reduce((s,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,o)}));return[...s,...u]},[]),[n,r])}var go;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(go||(go={}));var Du;(function(n){n.Optimized="optimized"})(Du||(Du={}));const Eh=new Map;function Gw(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=w.useState(null),{frequency:p,measure:m,strategy:g}=a,v=w.useRef(n),k=R(),x=mo(k),T=w.useCallback(function(L){L===void 0&&(L=[]),!x.current&&f(b=>b===null?L:b.concat(L.filter(U=>!b.includes(U))))},[x]),E=w.useRef(null),C=xo(L=>{if(k&&!s)return Eh;if(!L||L===Eh||v.current!==n||u!=null){const b=new Map;for(let U of n){if(!U)continue;if(u&&u.length>0&&!u.includes(U.id)&&U.rect.current){b.set(U.id,U.rect.current);continue}const P=U.node.current,W=P?new ad(m(P),P):null;U.rect.current=W,W&&b.set(U.id,W)}return b}return L},[n,u,s,k,m]);return w.useEffect(()=>{v.current=n},[n]),w.useEffect(()=>{k||T()},[s,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof p!="number"||E.current!==null||(E.current=setTimeout(()=>{T(),E.current=null},p))},[p,k,T,...o]),{droppableRects:C,measureDroppableContainers:T,measuringScheduled:u!=null};function R(){switch(g){case go.Always:return!1;case go.BeforeDragging:return s;default:return!s}}}function ud(n,r){return xo(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function Kw(n,r){return ud(n,r)}function Yw(n){let{callback:r,disabled:s}=n;const o=vl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function xl(n){let{callback:r,disabled:s}=n;const o=vl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Xw(n){return new ad(mi(n),n)}function _h(n,r,s){r===void 0&&(r=Xw);const[o,a]=w.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??s)!=null?g:null}const v=r(n);return JSON.stringify(m)===JSON.stringify(v)?m:v})}const f=Yw({callback(m){if(n)for(const g of m){const{type:v,target:k}=g;if(v==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),p=xl({callback:u});return or(()=>{u(),n?(p==null||p.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),f==null||f.disconnect())},[n]),o}function Qw(n){const r=ud(n);return ag(n,r)}const jh=[];function Zw(n){const r=w.useRef(n),s=xo(o=>n?o&&o!==jh&&n&&r.current&&n.parentNode===r.current.parentNode?o:od(n):jh,[n]);return w.useEffect(()=>{r.current=n},[n]),s}function Jw(n){const[r,s]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=pu(u.target);f&&s(p=>p?(p.set(f,Au(f)),new Map(p)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(m=>{const g=pu(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,Au(g)]):null}).filter(m=>m!=null);s(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(m=>{const g=pu(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>ui(u,f),ar):hg(n):ar,[n,r])}function Rh(n,r){r===void 0&&(r=[]);const s=w.useRef(null);return w.useEffect(()=>{s.current=null},r),w.useEffect(()=>{const o=n!==ar;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?Ja(n,s.current):ar}function ek(n){w.useEffect(()=>{if(!gl)return;const r=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of r)s==null||s()}},n.map(r=>{let{sensor:s}=r;return s}))}function tk(n,r){return w.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function yg(n){return w.useMemo(()=>n?Cw(n):null,[n])}const Ah=[];function nk(n,r){r===void 0&&(r=mi);const[s]=n,o=yg(s?xn(s):null),[a,u]=w.useState(Ah);function f(){u(()=>n.length?n.map(m=>fg(m)?o:new ad(r(m),m)):Ah)}const p=xl({callback:f});return or(()=>{p==null||p.disconnect(),f(),n.forEach(m=>p==null?void 0:p.observe(m))},[n]),a}function xg(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return yo(r)?r:n}function rk(n){let{measure:r}=n;const[s,o]=w.useState(null),a=w.useCallback(g=>{for(const{target:v}of g)if(yo(v)){o(k=>{const x=r(v);return k?{...k,width:x.width,height:x.height}:x});break}},[r]),u=xl({callback:a}),f=w.useCallback(g=>{const v=xg(g);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?r(v):null)},[r,u]),[p,m]=Qa(f);return w.useMemo(()=>({nodeRef:p,rect:s,setRef:m}),[s,p,m])}const sk=[{sensor:cd,options:{}},{sensor:vg,options:{}}],ik={current:{}},Fa={draggable:{measure:Th},droppable:{measure:Th,strategy:go.WhileDragging,frequency:Du.Optimized},dragOverlay:{measure:mi}};class lo extends Map{get(r){var s;return r!=null&&(s=super.get(r))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:s}=r;return!s})}getNodeFor(r){var s,o;return(s=(o=this.get(r))==null?void 0:o.node.current)!=null?s:void 0}}const ok={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:tl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Fa,measureDroppableContainers:tl,windowRect:null,measuringScheduled:!1},wg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:tl,draggableNodes:new Map,over:null,measureDroppableContainers:tl},ko=w.createContext(wg),kg=w.createContext(ok);function ak(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lo}}}function lk(n,r){switch(r.type){case $t.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case $t.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:r.coordinates.x-n.draggable.initialCoordinates.x,y:r.coordinates.y-n.draggable.initialCoordinates.y}}};case $t.DragEnd:case $t.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new lo(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case $t.SetDroppableDisabled:{const{id:s,key:o,disabled:a}=r,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new lo(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case $t.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new lo(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function ck(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=w.useContext(ko),u=Za(o),f=Za(s==null?void 0:s.id);return w.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!yl(u)||document.activeElement===u.target)return;const p=a.get(f);if(!p)return;const{activatorNode:m,node:g}=p;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const v of[m.current,g.current]){if(!v)continue;const k=tw(v);if(k){k.focus();break}}})}},[o,r,a,f,u]),null}function Sg(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function uk(n){return w.useMemo(()=>({draggable:{...Fa.draggable,...n==null?void 0:n.draggable},droppable:{...Fa.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Fa.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function dk(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:p}=typeof a=="boolean"?{x:a,y:a}:a;or(()=>{if(!f&&!p||!r){u.current=!1;return}if(u.current||!o)return;const g=r==null?void 0:r.node.current;if(!g||g.isConnected===!1)return;const v=s(g),k=ag(v,o);if(f||(k.x=0),p||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=cg(g);x&&x.scrollBy({top:k.y,left:k.x})}},[r,f,p,o,s])}const wl=w.createContext({...ar,scaleX:1,scaleY:1});var Jr;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Jr||(Jr={}));const fk=w.memo(function(r){var s,o,a,u;let{id:f,accessibility:p,autoScroll:m=!0,children:g,sensors:v=sk,collisionDetection:k=ww,measuring:x,modifiers:T,...E}=r;const C=w.useReducer(lk,void 0,ak),[R,L]=C,[b,U]=aw(),[P,W]=w.useState(Jr.Uninitialized),K=P===Jr.Initialized,{draggable:{active:q,nodes:G,translate:ce},droppable:{containers:pe}}=R,ue=q!=null?G.get(q):null,de=w.useRef({initial:null,translated:null}),he=w.useMemo(()=>{var nt;return q!=null?{id:q,data:(nt=ue==null?void 0:ue.data)!=null?nt:ik,rect:de}:null},[q,ue]),Le=w.useRef(null),[te,ie]=w.useState(null),[le,$]=w.useState(null),Y=mo(E,Object.values(E)),H=wo("DndDescribedBy",f),A=w.useMemo(()=>pe.getEnabled(),[pe]),j=uk(x),{droppableRects:X,measureDroppableContainers:se,measuringScheduled:ve}=Gw(A,{dragging:K,dependencies:[ce.x,ce.y],config:j.droppable}),Se=Vw(G,q),Pe=w.useMemo(()=>le?el(le):null,[le]),Re=dn(),Me=Kw(Se,j.draggable.measure);dk({activeNode:q!=null?G.get(q):null,config:Re.layoutShiftCompensation,initialRect:Me,measure:j.draggable.measure});const Ne=_h(Se,j.draggable.measure,Me),rt=_h(Se?Se.parentElement:null),Oe=w.useRef({activatorEvent:null,active:null,activeNode:Se,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:pe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),mt=pe.getNodeFor((s=Oe.current.over)==null?void 0:s.id),Fe=rk({measure:j.dragOverlay.measure}),_t=(o=Fe.nodeRef.current)!=null?o:Se,Ue=K?(a=Fe.rect)!=null?a:Ne:null,Yt=!!(Fe.nodeRef.current&&Fe.rect),On=Qw(Yt?null:Ne),at=yg(_t?xn(_t):null),yt=Zw(K?mt??Se:null),lt=nk(yt),Ft=Sg(T,{transform:{x:ce.x-On.x,y:ce.y-On.y,scaleX:1,scaleY:1},activatorEvent:le,active:he,activeNodeRect:Ne,containerNodeRect:rt,draggingNodeRect:Ue,over:Oe.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:yt,scrollableAncestorRects:lt,windowRect:at}),V=Pe?ui(Pe,ce):null,me=Jw(yt),Be=Rh(me),Je=Rh(me,[Ne]),ct=ui(Ft,Be),ut=Ue?Tw(Ue,Ft):null,gt=he&&ut?k({active:he,collisionRect:ut,droppableRects:X,droppableContainers:A,pointerCoordinates:V}):null,Xt=vw(gt,"id"),[xt,Kn]=w.useState(null),En=Yt?Ft:ui(Ft,Je),yr=kw(En,(u=xt==null?void 0:xt.rect)!=null?u:null,Ne),Yn=w.useRef(null),un=w.useCallback((nt,At)=>{let{sensor:jt,options:Ut}=At;if(Le.current==null)return;const _=G.get(Le.current);if(!_)return;const re=nt.nativeEvent,Q=new jt({active:Le.current,activeNode:_,event:re,options:Ut,context:Oe,onAbort(Ce){if(!G.get(Ce))return;const{onDragAbort:je}=Y.current,et={id:Ce};je==null||je(et),b({type:"onDragAbort",event:et})},onPending(Ce,We,je,et){if(!G.get(Ce))return;const{onDragPending:wt}=Y.current,kt={id:Ce,constraint:We,initialCoordinates:je,offset:et};wt==null||wt(kt),b({type:"onDragPending",event:kt})},onStart(Ce){const We=Le.current;if(We==null)return;const je=G.get(We);if(!je)return;const{onDragStart:et}=Y.current,ft={activatorEvent:re,active:{id:We,data:je.data,rect:de}};ro.unstable_batchedUpdates(()=>{et==null||et(ft),W(Jr.Initializing),L({type:$t.DragStart,initialCoordinates:Ce,active:We}),b({type:"onDragStart",event:ft}),ie(Yn.current),$(re)})},onMove(Ce){L({type:$t.DragMove,coordinates:Ce})},onEnd:ge($t.DragEnd),onCancel:ge($t.DragCancel)});Yn.current=Q;function ge(Ce){return async function(){const{active:je,collisions:et,over:ft,scrollAdjustedTranslate:wt}=Oe.current;let kt=null;if(je&&wt){const{cancelDrop:rn}=Y.current;kt={activatorEvent:re,active:je,collisions:et,delta:wt,over:ft},Ce===$t.DragEnd&&typeof rn=="function"&&await Promise.resolve(rn(kt))&&(Ce=$t.DragCancel)}Le.current=null,ro.unstable_batchedUpdates(()=>{L({type:Ce}),W(Jr.Uninitialized),Kn(null),ie(null),$(null),Yn.current=null;const rn=Ce===$t.DragEnd?"onDragEnd":"onDragCancel";if(kt){const fn=Y.current[rn];fn==null||fn(kt),b({type:rn,event:kt})}})}}},[G]),zn=w.useCallback((nt,At)=>(jt,Ut)=>{const _=jt.nativeEvent,re=G.get(Ut);if(Le.current!==null||!re||_.dndKit||_.defaultPrevented)return;const Q={active:re};nt(jt,At.options,Q)===!0&&(_.dndKit={capturedBy:At.sensor},Le.current=Ut,un(jt,At))},[G,un]),tn=qw(v,zn);ek(v),or(()=>{Ne&&P===Jr.Initializing&&W(Jr.Initialized)},[Ne,P]),w.useEffect(()=>{const{onDragMove:nt}=Y.current,{active:At,activatorEvent:jt,collisions:Ut,over:_}=Oe.current;if(!At||!jt)return;const re={active:At,activatorEvent:jt,collisions:Ut,delta:{x:ct.x,y:ct.y},over:_};ro.unstable_batchedUpdates(()=>{nt==null||nt(re),b({type:"onDragMove",event:re})})},[ct.x,ct.y]),w.useEffect(()=>{const{active:nt,activatorEvent:At,collisions:jt,droppableContainers:Ut,scrollAdjustedTranslate:_}=Oe.current;if(!nt||Le.current==null||!At||!_)return;const{onDragOver:re}=Y.current,Q=Ut.get(Xt),ge=Q&&Q.rect.current?{id:Q.id,rect:Q.rect.current,data:Q.data,disabled:Q.disabled}:null,Ce={active:nt,activatorEvent:At,collisions:jt,delta:{x:_.x,y:_.y},over:ge};ro.unstable_batchedUpdates(()=>{Kn(ge),re==null||re(Ce),b({type:"onDragOver",event:Ce})})},[Xt]),or(()=>{Oe.current={activatorEvent:le,active:he,activeNode:Se,collisionRect:ut,collisions:gt,droppableRects:X,draggableNodes:G,draggingNode:_t,draggingNodeRect:Ue,droppableContainers:pe,over:xt,scrollableAncestors:yt,scrollAdjustedTranslate:ct},de.current={initial:Ue,translated:ut}},[he,Se,gt,ut,G,_t,Ue,X,pe,xt,yt,ct]),Bw({...Re,delta:ce,draggingRect:ut,pointerCoordinates:V,scrollableAncestors:yt,scrollableAncestorRects:lt});const nn=w.useMemo(()=>({active:he,activeNode:Se,activeNodeRect:Ne,activatorEvent:le,collisions:gt,containerNodeRect:rt,dragOverlay:Fe,draggableNodes:G,droppableContainers:pe,droppableRects:X,over:xt,measureDroppableContainers:se,scrollableAncestors:yt,scrollableAncestorRects:lt,measuringConfiguration:j,measuringScheduled:ve,windowRect:at}),[he,Se,Ne,le,gt,rt,Fe,G,pe,X,xt,se,yt,lt,j,ve,at]),Mt=w.useMemo(()=>({activatorEvent:le,activators:tn,active:he,activeNodeRect:Ne,ariaDescribedById:{draggable:H},dispatch:L,draggableNodes:G,over:xt,measureDroppableContainers:se}),[le,tn,he,Ne,L,H,G,xt,se]);return st.createElement(og.Provider,{value:U},st.createElement(ko.Provider,{value:Mt},st.createElement(kg.Provider,{value:nn},st.createElement(wl.Provider,{value:yr},g)),st.createElement(ck,{disabled:(p==null?void 0:p.restoreFocus)===!1})),st.createElement(uw,{...p,hiddenTextDescribedById:H}));function dn(){const nt=(te==null?void 0:te.autoScrollEnabled)===!1,At=typeof m=="object"?m.enabled===!1:m===!1,jt=K&&!nt&&!At;return typeof m=="object"?{...m,enabled:jt}:{enabled:jt}}}),pk=w.createContext(null),Ih="button",hk="Draggable";function mk(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=wo(hk),{activators:f,activatorEvent:p,active:m,activeNodeRect:g,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(ko),{role:T=Ih,roleDescription:E="draggable",tabIndex:C=0}=a??{},R=(m==null?void 0:m.id)===r,L=w.useContext(R?wl:pk),[b,U]=Qa(),[P,W]=Qa(),K=tk(f,r),q=mo(s);or(()=>(k.set(r,{id:r,key:u,node:b,activatorNode:P,data:q}),()=>{const ce=k.get(r);ce&&ce.key===u&&k.delete(r)}),[k,r]);const G=w.useMemo(()=>({role:T,tabIndex:C,"aria-disabled":o,"aria-pressed":R&&T===Ih?!0:void 0,"aria-roledescription":E,"aria-describedby":v.draggable}),[o,T,C,R,E,v.draggable]);return{active:m,activatorEvent:p,activeNodeRect:g,attributes:G,isDragging:R,listeners:o?void 0:K,node:b,over:x,setNodeRef:U,setActivatorNodeRef:W,transform:L}}function Tg(){return w.useContext(kg)}const gk="Droppable",vk={timeout:25};function bg(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=wo(gk),{active:f,dispatch:p,over:m,measureDroppableContainers:g}=w.useContext(ko),v=w.useRef({disabled:s}),k=w.useRef(!1),x=w.useRef(null),T=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:R}={...vk,...a},L=mo(C??o),b=w.useCallback(()=>{if(!k.current){k.current=!0;return}T.current!=null&&clearTimeout(T.current),T.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),T.current=null},R)},[R]),U=xl({callback:b,disabled:E||!f}),P=w.useCallback((G,ce)=>{U&&(ce&&(U.unobserve(ce),k.current=!1),G&&U.observe(G))},[U]),[W,K]=Qa(P),q=mo(r);return w.useEffect(()=>{!U||!W.current||(U.disconnect(),k.current=!1,U.observe(W.current))},[W,U]),w.useEffect(()=>(p({type:$t.RegisterDroppable,element:{id:o,key:u,disabled:s,node:W,rect:x,data:q}}),()=>p({type:$t.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{s!==v.current.disabled&&(p({type:$t.SetDroppableDisabled,id:o,key:u,disabled:s}),v.current.disabled=s)},[o,u,s,p]),{active:f,rect:x,isOver:(m==null?void 0:m.id)===o,node:W,over:m,setNodeRef:K}}function yk(n){let{animation:r,children:s}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),p=Za(s);return!s&&!o&&p&&a(p),or(()=>{if(!u)return;const m=o==null?void 0:o.key,g=o==null?void 0:o.props.id;if(m==null||g==null){a(null);return}Promise.resolve(r(g,u)).then(()=>{a(null)})},[r,o,u]),st.createElement(st.Fragment,null,s,o?w.cloneElement(o,{ref:f}):null)}const xk={x:0,y:0,scaleX:1,scaleY:1};function wk(n){let{children:r}=n;return st.createElement(ko.Provider,{value:wg},st.createElement(wl.Provider,{value:xk},r))}const kk={position:"fixed",touchAction:"none"},Sk=n=>yl(n)?"transform 250ms ease":void 0,Tk=w.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:p,style:m,transform:g,transition:v=Sk}=n;if(!p)return null;const k=a?g:{...g,scaleX:1,scaleY:1},x={...kk,width:p.width,height:p.height,top:p.top,left:p.left,transform:Ar.Transform.toString(k),transformOrigin:a&&o?hw(o,p):void 0,transition:typeof v=="function"?v(o):v,...m};return st.createElement(s,{className:f,style:x,ref:r},u)}),bk=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[p,m]of Object.entries(u.active))m!==void 0&&(a[p]=s.node.style.getPropertyValue(p),s.node.style.setProperty(p,m));if(u!=null&&u.dragOverlay)for(const[p,m]of Object.entries(u.dragOverlay))m!==void 0&&o.node.style.setProperty(p,m);return f!=null&&f.active&&s.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))s.node.style.setProperty(m,g);f!=null&&f.active&&s.node.classList.remove(f.active)}},Nk=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:Ar.Transform.toString(r)},{transform:Ar.Transform.toString(s)}]},Ck={duration:250,easing:"ease",keyframes:Nk,sideEffects:bk({styles:{active:{opacity:"0"}}})};function Ek(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return vl((u,f)=>{if(r===null)return;const p=s.get(u);if(!p)return;const m=p.node.current;if(!m)return;const g=xg(f);if(!g)return;const{transform:v}=xn(f).getComputedStyle(f),k=lg(v);if(!k)return;const x=typeof r=="function"?r:_k(r);return mg(m,a.draggable.measure),x({active:{id:u,data:p.data,node:m,rect:a.draggable.measure(m)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function _k(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...Ck,...n};return u=>{let{active:f,dragOverlay:p,transform:m,...g}=u;if(!r)return;const v={x:p.rect.left-f.rect.left,y:p.rect.top-f.rect.top},k={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/p.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/p.rect.height:1},x={x:m.x-v.x,y:m.y-v.y,...k},T=a({...g,active:f,dragOverlay:p,transform:{initial:m,final:x}}),[E]=T,C=T[T.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const R=o==null?void 0:o({active:f,dragOverlay:p,...g}),L=p.node.animate(T,{duration:r,easing:s,fill:"forwards"});return new Promise(b=>{L.onfinish=()=>{R==null||R(),b()}})}}let Dh=0;function jk(n){return w.useMemo(()=>{if(n!=null)return Dh++,Dh},[n])}const Rk=st.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:p="div",className:m,zIndex:g=999}=n;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:T,draggableNodes:E,droppableContainers:C,dragOverlay:R,over:L,measuringConfiguration:b,scrollableAncestors:U,scrollableAncestorRects:P,windowRect:W}=Tg(),K=w.useContext(wl),q=jk(k==null?void 0:k.id),G=Sg(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:T,draggingNodeRect:R.rect,over:L,overlayNodeRect:R.rect,scrollableAncestors:U,scrollableAncestorRects:P,transform:K,windowRect:W}),ce=ud(x),pe=Ek({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:b}),ue=ce?R.setRef:void 0;return st.createElement(wk,null,st.createElement(yk,{animation:pe},k&&q?st.createElement(Tk,{key:q,id:k.id,ref:ue,as:p,activatorEvent:v,adjustScale:r,className:m,transition:u,rect:ce,style:{zIndex:g,...a},transform:G},s):null))});function Ng(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function Ak(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function Ra(n){return n!==null&&n>=0}function Ik(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;return!0}function Dk(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Cg=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=Ng(r,o,s),f=r[a],p=u[a];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},Aa={scaleX:1,scaleY:1},Mh=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const p=(r=u[s])!=null?r:o;if(!p)return null;if(a===s){const g=u[f];return g?{x:0,y:s<f?g.top+g.height-(p.top+p.height):g.top-p.top,...Aa}:null}const m=Mk(u,a,s);return a>s&&a<=f?{x:0,y:-p.height-m,...Aa}:a<s&&a>=f?{x:0,y:p.height+m,...Aa}:{x:0,y:0,...Aa}};function Mk(n,r,s){const o=n[r],a=n[r-1],u=n[r+1];return o?s<r?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const Eg="Sortable",_g=st.createContext({activeIndex:-1,containerId:Eg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Cg,disabled:{draggable:!1,droppable:!1}});function Lh(n){let{children:r,id:s,items:o,strategy:a=Cg,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:m,over:g,measureDroppableContainers:v}=Tg(),k=wo(Eg,s),x=p.rect!==null,T=w.useMemo(()=>o.map(K=>typeof K=="object"&&"id"in K?K.id:K),[o]),E=f!=null,C=f?T.indexOf(f.id):-1,R=g?T.indexOf(g.id):-1,L=w.useRef(T),b=!Ik(T,L.current),U=R!==-1&&C===-1||b,P=Dk(u);or(()=>{b&&E&&v(T)},[b,T,E,v]),w.useEffect(()=>{L.current=T},[T]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:P,disableTransforms:U,items:T,overIndex:R,useDragOverlay:x,sortedRects:Ak(T,m),strategy:a}),[C,k,P.draggable,P.droppable,U,T,R,m,x,a]);return st.createElement(_g.Provider,{value:W},r)}const Lk=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return Ng(s,o,a).indexOf(r)},Pk=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:p,previousContainerId:m,transition:g}=n;return!g||!o||p!==u&&a===f?!1:s?!0:f!==a&&r===m},Ok={duration:200,easing:"ease"},jg="transform",zk=Ar.Transition.toString({property:jg,duration:0,easing:"linear"}),$k={roleDescription:"sortable"};function Fk(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=w.useState(null),p=w.useRef(s);return or(()=>{if(!r&&s!==p.current&&o.current){const m=a.current;if(m){const g=mi(o.current,{ignoreTransform:!0}),v={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(v.x||v.y)&&f(v)}}s!==p.current&&(p.current=s)},[r,s,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Rg(n){let{animateLayoutChanges:r=Pk,attributes:s,disabled:o,data:a,getNewIndex:u=Lk,id:f,strategy:p,resizeObserverConfig:m,transition:g=Ok}=n;const{items:v,containerId:k,activeIndex:x,disabled:T,disableTransforms:E,sortedRects:C,overIndex:R,useDragOverlay:L,strategy:b}=w.useContext(_g),U=Uk(o,T),P=v.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:P,items:v},...a}),[k,a,P,v]),K=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:q,node:G,isOver:ce,setNodeRef:pe}=bg({id:f,data:W,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:K,...m}}),{active:ue,activatorEvent:de,activeNodeRect:he,attributes:Le,setNodeRef:te,listeners:ie,isDragging:le,over:$,setActivatorNodeRef:Y,transform:H}=mk({id:f,data:W,attributes:{...$k,...s},disabled:U.draggable}),A=Q0(pe,te),j=!!ue,X=j&&!E&&Ra(x)&&Ra(R),se=!L&&le,ve=se&&X?H:null,Pe=X?ve??(p??b)({rects:C,activeNodeRect:he,activeIndex:x,overIndex:R,index:P}):null,Re=Ra(x)&&Ra(R)?u({id:f,items:v,activeIndex:x,overIndex:R}):P,Me=ue==null?void 0:ue.id,Ne=w.useRef({activeId:Me,items:v,newIndex:Re,containerId:k}),rt=v!==Ne.current.items,Oe=r({active:ue,containerId:k,isDragging:le,isSorting:j,id:f,index:P,items:v,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:g,wasDragging:Ne.current.activeId!=null}),mt=Fk({disabled:!Oe,index:P,node:G,rect:q});return w.useEffect(()=>{j&&Ne.current.newIndex!==Re&&(Ne.current.newIndex=Re),k!==Ne.current.containerId&&(Ne.current.containerId=k),v!==Ne.current.items&&(Ne.current.items=v)},[j,Re,k,v]),w.useEffect(()=>{if(Me===Ne.current.activeId)return;if(Me!=null&&Ne.current.activeId==null){Ne.current.activeId=Me;return}const _t=setTimeout(()=>{Ne.current.activeId=Me},50);return()=>clearTimeout(_t)},[Me]),{active:ue,activeIndex:x,attributes:Le,data:W,rect:q,index:P,newIndex:Re,items:v,isOver:ce,isSorting:j,isDragging:le,listeners:ie,node:G,overIndex:R,over:$,setNodeRef:A,setActivatorNodeRef:Y,setDroppableNodeRef:pe,setDraggableNodeRef:te,transform:mt??Pe,transition:Fe()};function Fe(){if(mt||rt&&Ne.current.newIndex===P)return zk;if(!(se&&!yl(de)||!g)&&(j||Oe))return Ar.Transition.toString({...g,property:jg})}}function Uk(n,r){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:r.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:r.droppable}}Ze.Down,Ze.Right,Ze.Up,Ze.Left;function Ia(n){const[r,s]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{s(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,o]}async function Mu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const s=document.execCommand("copy");return document.body.removeChild(r),s}catch{return!1}}}function rl(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Ph(n,r){if(!r||!n.cwd)return!1;const s=rl(n.cwd),o=rl(r);return s.startsWith(`${o}/`)}function Bk(n,r){const s=new Map;for(const f of r){const p=f.cwd||"(no directory)",m=s.get(p)??[];m.push(f),s.set(p,m)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:s.get(f.path)??[],workspace:f})}for(const[f,p]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:p,workspace:null});return u}function sl(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Oh(n,r,s,o){const a=r.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&s.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function zh(n,r){return{working:sl(n.sessions.filter(s=>s.lifecycle!=="finished")),finished:sl(n.sessions.filter(s=>s.lifecycle==="finished")),finishedCollapsed:r.has(n.finishedKey)}}function Da(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function Wk(n){const r=new Set(n.map(o=>o.name));if(!r.has("New Folder"))return"New Folder";let s=2;for(;r.has(`New Folder ${s}`);)s++;return`New Folder ${s}`}function $h({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=bg({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function dd({inputRef:n,value:r,onChange:s,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:r,onChange:u=>s(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function Hk({s:n,backgroundTaskCount:r,isActive:s,isSelected:o,appIcon:a,renaming:u,renameValue:f,renameRef:p,onRenameValue:m,onRenameConfirm:g,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:T}){const{attributes:E,listeners:C,setNodeRef:R,transform:L,transition:b,isDragging:U}=Rg({id:`s:${n.id}`}),P=fl(n,r);return c.jsxs("div",{ref:R,style:{transform:Ar.Transform.toString(L),transition:b},className:`tree-item ${s?"active":""}${o?" selected":""} ${P.isFinished?"tree-item-finished":""}${U?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(nd,{iconClass:P.iconClass,iconText:P.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:a}),u?c.jsx(dd,{inputRef:p,value:f,onChange:m,onConfirm:g,onCancel:v}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!u&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:W=>{W.stopPropagation(),T()},onPointerDown:W=>W.stopPropagation(),children:c.jsx(Xa,{size:10,fill:n.starred?"currentColor":"none"})}),P.dot&&c.jsx(td,{status:P.dot,title:P.dotTitle})]})}function Vk({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:p,onRenameCancel:m,onToggle:g,onCtxMenu:v,children:k}){const{attributes:x,listeners:T,setNodeRef:E,transform:C,transition:R,isDragging:L,over:b}=Rg({id:`f:${n.id}`}),U=b!=null&&String(b.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:Ar.Transform.toString(C),transition:R},className:`tree-folder ${s?"collapsed":""}${L?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${U?" drop-over":""}`,...x,...T,onClick:()=>{o||g()},onContextMenu:v,children:o?c.jsx(dd,{inputRef:u,value:a,onChange:f,onConfirm:p,onCancel:m}):c.jsxs(c.Fragment,{children:[c.jsx(ci,{size:8,className:"tree-chevron"}),c.jsx(Ru,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:r})]})}),!s&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function qk(){const n=M(_=>_.sessions),r=M(_=>_.backgroundTasks),s=M(_=>_.workspaces),o=M(_=>_.folders),a=M(_=>_.activeSessionId),u=M(_=>_.selectSession),f=M(_=>_.deleteSession),p=M(_=>_.removeWorkspace),m=M(_=>_.createSessionInWorkspace),g=M(_=>_.pickAndAddWorkspace),v=M(_=>_.renameSession),k=M(_=>_.markFinished),x=M(_=>_.markFinishedMany),T=M(_=>_.toggleStar),E=M(_=>_.reopenSession),C=M(_=>_.reopenSessionMany),R=M(_=>_.deleteSessionMany),L=M(_=>_.createSidebarFolder),b=M(_=>_.renameFolder),U=M(_=>_.deleteFolder),P=M(_=>_.applyMoves),W=M(_=>_.reorderFolders),K=M(_=>_.apps),q=M(_=>_.appsRootPath),G=M(_=>_.activeAppTabId),ce=M(_=>_.openAppTab),pe=M(_=>_.startAppEdit),ue=M(_=>_.toggleAppPin),de=M(_=>_.deleteApp),he=M(_=>_.openAppCatalog),[Le,te]=Ia("agentpane:sidebar-ws-collapsed"),[ie,le]=Ia("agentpane:sidebar-sub-collapsed"),[$,Y]=Ia("agentpane:sidebar-folders-collapsed"),[H,A]=Ia("agentpane:sidebar-app-edits-collapsed"),[j,X]=w.useState(null),[se,ve]=w.useState(null),[Se,Pe]=w.useState(""),[Re,Me]=w.useState(null),[Ne,rt]=w.useState(new Set),[Oe,mt]=w.useState(null),Fe=w.useRef(null),_t=w.useRef(null),Ue=w.useRef(null),Yt=w.useRef(!1),On=fw(dw(cd,{activationConstraint:{distance:5}}));function at(){rt(new Set),mt(null)}pl(Fe,()=>X(null),!!j),ed(()=>{X(null),at()},!!j||Ne.size>0),w.useLayoutEffect(()=>{const _=Fe.current;if(!j||!_)return;const re=8,{offsetWidth:Q,offsetHeight:ge}=_,Ce=j.x+Q>window.innerWidth-re?Math.max(re,j.x-Q):j.x,We=j.y+ge>window.innerHeight-re?Math.max(re,j.y-ge):j.y;_.style.left=`${Ce}px`,_.style.top=`${We}px`},[j]);const yt=w.useMemo(()=>new Map(n.map(_=>[_.id,_])),[n]),lt=w.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),Ft=w.useMemo(()=>{const _=new Map;for(const re of[...o].sort((Q,ge)=>Q.sort_order-ge.sort_order)){const Q=_.get(re.workspace_path)??[];Q.push(re),_.set(re.workspace_path,Q)}return _},[o]);function V(_){te(re=>{const Q=new Set(re);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function me(_){le(re=>{const Q=new Set(re);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function Be(_){Y(re=>{const Q=new Set(re);return Q.has(_)?Q.delete(_):Q.add(_),Q})}function Je(_){A(re=>{const Q=new Set(re);return Q.has(_)?Q.delete(_):Q.add(_),Q})}w.useEffect(()=>{se&&_t.current&&(_t.current.focus(),_t.current.select())},[se]),w.useEffect(()=>{var _,re,Q;Yt.current||!a||(Yt.current=!0,(Q=(re=(_=Ue.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:re.scrollIntoView)==null||Q.call(re,{block:"nearest"}))},[a]);function ct(_,re,Q,ge=""){ve({kind:_,id:re}),Pe(Q||ge)}function ut(){if(se){const _=Se.trim();_&&(se.kind==="session"?v(se.id,_):b(se.id,_))}ve(null)}function gt(){ve(null),Pe("")}async function Xt(_){const re=Wk(Ft.get(_)??[]),Q=await L(_,re);Q&&ct("folder",Q.id,Q.name)}function xt(_){const re=String(_.active.id);if(re.startsWith("s:")){const Q=yt.get(re.slice(2));Q&&Me({kind:"session",label:Q.title||Q.id.slice(0,8)})}else if(re.startsWith("f:")){const Q=lt.get(re.slice(2));Q&&Me({kind:"folder",label:Q.name})}}function Kn(_){Me(null);const{active:re,over:Q}=_;if(!Q)return;const ge=String(re.id),Ce=String(Q.id);if(ge.startsWith("s:")){const We=yt.get(ge.slice(2));if(!We)return;const je=We.cwd||"(no directory)",et=Da(We,lt);let ft,wt;if(Ce.startsWith("f:")){const Ee=lt.get(Ce.slice(2));if(!Ee)return;ft=Ee.workspace_path,wt=Ee.id}else if(Ce.startsWith("s:")){const Ee=yt.get(Ce.slice(2));if(!Ee)return;ft=Ee.cwd||"(no directory)",wt=Da(Ee,lt)}else if(Ce.startsWith("c:")){const Ee=Ce.slice(2),it=Ee.lastIndexOf("|");ft=Ee.slice(0,it);const Xn=Ee.slice(it+1);wt=Xn==="root"?null:Xn}else return;if(ft!==je)return;const kt=sl(n.filter(Ee=>(Ee.cwd||"(no directory)")===ft&&Da(Ee,lt)===wt)),rn=kt.filter(Ee=>Ee.id!==We.id);let fn=rn.length;if(Ce.startsWith("s:")){const Ee=rn.findIndex(it=>it.id===Ce.slice(2));Ee>=0&&(fn=Ee)}const lr=[...rn.slice(0,fn),We,...rn.slice(fn)],Ir=[];if(wt===et){if(lr.length===kt.length&&lr.every((Ee,it)=>Ee.id===kt[it].id))return;lr.forEach((Ee,it)=>Ir.push({id:Ee.id,folder_id:wt,sort_order:lr.length-1-it}))}else{const Ee=sl(n.filter(it=>(it.cwd||"(no directory)")===je&&Da(it,lt)===et)).filter(it=>it.id!==We.id);Ee.forEach((it,Xn)=>Ir.push({id:it.id,folder_id:et,sort_order:Ee.length-1-Xn})),lr.forEach((it,Xn)=>Ir.push({id:it.id,folder_id:wt,sort_order:lr.length-1-Xn}))}P(Ir);return}if(ge.startsWith("f:")){if(!Ce.startsWith("f:"))return;const We=lt.get(ge.slice(2)),je=lt.get(Ce.slice(2));if(!We||!je||We.id===je.id||We.workspace_path!==je.workspace_path)return;const et=(Ft.get(We.workspace_path)??[]).map(kt=>kt.id),ft=et.indexOf(We.id),wt=et.indexOf(je.id);et.splice(wt,0,...et.splice(ft,1)),W(et)}}const En=Bk(s,q?n.filter(_=>!Ph(_,q)):n),yr=w.useMemo(()=>{const _=new Map;if(!q)return _;const re=rl(q);for(const Q of n){if(!Ph(Q,q))continue;const ge=rl(Q.cwd).slice(re.length+1).split("/")[0],Ce=_.get(ge)??[];Ce.push(Q),_.set(ge,Ce)}return _},[n,q]);function Yn(_){return{folder:null,sessions:yr.get(_)??[],finishedKey:`app:${_}:finished`,hidden:H.has(_)}}const un=[],zn=_=>{if(_.hidden)return;const{working:re,finished:Q,finishedCollapsed:ge}=zh(_,ie);un.push(...re.map(Ce=>Ce.id)),ge||un.push(...Q.map(Ce=>Ce.id))};for(const _ of En){if(Le.has(_.path))continue;const re=Ft.get(_.path)??[],Q=new Set(re.map(ge=>ge.id));Oh(_,re,Q,$).forEach(zn)}K.forEach(_=>zn(Yn(_.id)));const tn=n.filter(_=>Ne.has(_.id)),nn=tn.filter(_=>_.lifecycle!=="finished").map(_=>_.id),Mt=tn.filter(_=>_.lifecycle==="finished").map(_=>_.id);function dn(_,re){if(re.metaKey||re.ctrlKey){re.preventDefault(),mt(_.id),rt(Q=>{const ge=new Set(Q);return ge.has(_.id)?ge.delete(_.id):ge.add(_.id),ge});return}if(re.shiftKey){re.preventDefault();const Q=Oe??_.id;mt(Q);const ge=un.indexOf(Q),Ce=un.indexOf(_.id);if(ge>=0&&Ce>=0){const[We,je]=ge<Ce?[ge,Ce]:[Ce,ge];rt(new Set(un.slice(We,je+1)))}return}at(),mt(_.id),u(_.id)}function nt(_,re){re.preventDefault();const Q=Ne.has(_.id)&&Ne.size>1;Ne.has(_.id)||(rt(new Set),mt(_.id)),X({x:re.clientX,y:re.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:Q})}function At(_){var Q;const re=_.origin_app_id?K.find(ge=>ge.id===_.origin_app_id):null;return c.jsx(Hk,{s:_,backgroundTaskCount:((Q=r[_.id])==null?void 0:Q.length)??0,isActive:a===_.id,isSelected:Ne.has(_.id),appIcon:re?re.icon??"◧":null,renaming:(se==null?void 0:se.kind)==="session"&&se.id===_.id,renameValue:Se,renameRef:_t,onRenameValue:Pe,onRenameConfirm:ut,onRenameCancel:gt,onSelect:ge=>dn(_,ge),onToggleStar:()=>T(_.id),onCtxMenu:ge=>nt(_,ge)},_.id)}function jt(_){var Q;const re=fl(_,((Q=r[_.id])==null?void 0:Q.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ne.has(_.id)?" selected":""}${re.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ge=>dn(_,ge),onContextMenu:ge=>nt(_,ge),children:[c.jsx(nd,{iconClass:re.iconClass,iconText:re.iconText,size:14}),(se==null?void 0:se.kind)==="session"&&se.id===_.id?c.jsx(dd,{inputRef:_t,value:Se,onChange:Pe,onConfirm:ut,onCancel:gt}):c.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),re.dot&&c.jsx(td,{status:re.dot,title:re.dotTitle})]},_.id)}function Ut(_,re="workspace"){const{working:Q,finished:ge,finishedCollapsed:Ce}=zh(_,ie),We=re==="workspace"?At:jt,je=c.jsxs(c.Fragment,{children:[Q.length===0&&ge.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):Q.map(We),ge.length>0&&c.jsxs("div",{className:`tree-subgroup ${Ce?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>me(_.finishedKey),children:[c.jsx(ci,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ge.length})]}),!Ce&&c.jsx("div",{className:"tree-subgroup-items",children:ge.map(We)})]})]});if(re==="app")return je;const et=[...Q,...ge].map(ft=>`s:${ft.id}`);return c.jsx(Lh,{items:et,strategy:Mh,children:je})}return c.jsxs("div",{className:"ide-sidebar",ref:Ue,children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>g(),children:c.jsx(Ss,{size:14})})]}),c.jsxs(fk,{sensors:On,collisionDetection:yw,onDragStart:xt,onDragEnd:Kn,children:[En.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):En.map(_=>{const re=Le.has(_.path),Q=Ft.get(_.path)??[],ge=new Set(Q.map(je=>je.id)),Ce=Oh(_,Q,ge,$),We=Ce[Ce.length-1];return c.jsxs("div",{className:`tree-section ${re?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>V(_.path),onContextMenu:je=>{je.preventDefault(),X({x:je.clientX,y:je.clientY,type:"workspace",path:_.path})},children:[c.jsx(ci,{size:9,className:"tree-chevron"}),c.jsx(Ru,{size:14}),c.jsx("span",{className:"tree-section-label",children:_.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:je=>{je.stopPropagation(),m(_.path)},children:c.jsx(Ss,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:je=>{je.stopPropagation(),Xt(_.path)},children:c.jsx(du,{size:11})}),c.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!re&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Lh,{items:Q.map(je=>`f:${je.id}`),strategy:Mh,children:Ce.filter(je=>je.folder).map(je=>c.jsx(Vk,{folder:je.folder,count:je.sessions.length,collapsed:je.hidden,renaming:(se==null?void 0:se.kind)==="folder"&&se.id===je.folder.id,renameValue:Se,renameRef:_t,onRenameValue:Pe,onRenameConfirm:ut,onRenameCancel:gt,onToggle:()=>Be(je.folder.id),onCtxMenu:et=>{et.preventDefault(),X({x:et.clientX,y:et.clientY,type:"folder",folderId:je.folder.id,folderName:je.folder.name})},children:c.jsx($h,{id:`c:${_.path}|${je.folder.id}`,children:Ut(je)})},je.folder.id))}),c.jsx($h,{id:`c:${_.path}|root`,children:Ut(We)})]})]},_.path)}),c.jsx(Rk,{children:Re&&c.jsxs("div",{className:"drag-overlay",children:[Re.kind==="folder"&&c.jsx(Ru,{size:12}),c.jsx("span",{children:Re.label})]})})]}),c.jsxs("div",{className:"sidebar-apps",children:[c.jsxs("div",{className:"sidebar-header sidebar-apps-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Apps"}),c.jsx("button",{className:"sidebar-add",title:"Add mini app",onClick:()=>he(),children:c.jsx(Ss,{size:14})})]}),K.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),K.map(_=>{const re=Yn(_.id),Q=re.sessions.length>0&&!re.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${G===_.id?" active":""}`,title:_.description??void 0,onClick:()=>ce(_.id),onContextMenu:ge=>{ge.preventDefault(),X({x:ge.clientX,y:ge.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[re.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${Q?"":" closed"}`,title:"Edit sessions of this app",onClick:ge=>{ge.stopPropagation(),Je(_.id)},children:c.jsx(ci,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:_.icon??"◧"}),c.jsx("span",{className:"tree-label",children:_.title}),re.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:re.sessions.length}),_.pinned&&c.jsx(Xa,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),Q&&c.jsx("div",{className:"sidebar-app-edits",children:Ut(re,"app")})]},_.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>g(),children:[c.jsx(du,{size:14}),c.jsx("span",{children:"Add workspace"})]}),j&&c.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:j.x,top:j.y,zIndex:500},children:[j.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{m(j.path),X(null)},children:[c.jsx(Ss,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Xt(j.path),X(null)},children:[c.jsx(du,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{p(j.path),X(null)},children:[c.jsx(gr,{size:12})," Hide Workspace"]})]}),j.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ct("folder",j.folderId,j.folderName??""),X(null)},children:[c.jsx($a,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{U(j.folderId),X(null)},children:[c.jsx(gr,{size:12})," Delete Folder"]})]}),j.type==="session"&&!j.multi&&c.jsx(c.Fragment,{children:j.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ct("session",j.sessionId,j.sessionTitle??""),X(null)},children:[c.jsx($a,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(j.sessionId),X(null)},children:[c.jsx(Ya,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${j.sessionExternalId?"":" ctx-disabled"}`,title:j.sessionExternalId?void 0:"Session not started",onClick:()=>{j.sessionExternalId&&(Mu(j.sessionExternalId),X(null))},children:[c.jsx(ju,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(j.sessionId),X(null)},children:[c.jsx(gr,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(j.sessionId),X(null)},children:[c.jsx(ho,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${j.sessionExternalId?"":" ctx-disabled"}`,title:j.sessionExternalId?void 0:"Session not started",onClick:()=>{j.sessionExternalId&&(Mu(j.sessionExternalId),X(null))},children:[c.jsx(ju,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(j.sessionId),X(null)},children:[c.jsx(gr,{size:12})," Delete Session"]})]})}),j.type==="session"&&j.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[tn.length," sessions selected"]}),nn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(nn),X(null),at()},children:[c.jsx(Ya,{size:12})," Mark ",nn.length," as Finished"]}),Mt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(Mt),X(null),at()},children:[c.jsx(ho,{size:12})," Reopen ",Mt.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{R([...Ne]),X(null),at()},children:[c.jsx(gr,{size:12})," Delete ",tn.length," Sessions"]})]}),j.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{pe(j.appId),X(null)},children:[c.jsx($a,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(j.appId),X(null)},children:[c.jsx(Xa,{size:12})," ",j.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{de(j.appId),X(null)},children:[c.jsx(gr,{size:12})," Delete App"]})]})]})]})}function Gk(){const n=M(T=>T.openTabs),r=M(T=>T.activeSessionId),s=M(T=>T.sessions),o=M(T=>T.backgroundTasks),a=M(T=>T.selectSession),u=M(T=>T.closeTab),f=M(T=>T.setShowNewSessionDialog),p=M(T=>T.apps),m=M(T=>T.openAppTabs),g=M(T=>T.activeAppTabId),v=M(T=>T.openAppTab),k=M(T=>T.closeAppTab),x=M(T=>T.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(T=>{var L;const E=s.find(b=>b.id===T);if(!E)return null;const C=fl(E,((L=o[T])==null?void 0:L.length)??0),R=r===T&&g==null;return c.jsxs("div",{className:`ide-tab ${R?"active":""}`,onClick:()=>{g!=null&&x(null),a(T)},children:[c.jsx(nd,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||T.slice(0,8),C.dot&&c.jsx(td,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:b=>{b.stopPropagation(),u(T)},children:c.jsx(Pn,{size:12})})]},T)}),m.map(T=>{const E=p.find(R=>R.id===T),C=g===T;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>v(T),children:[E!=null&&E.icon?c.jsx("span",{className:"miniapp-tab-icon",children:E.icon}):c.jsx(A0,{size:12}),(E==null?void 0:E.title)??T,c.jsx("span",{className:"ide-tab-close",onClick:R=>{R.stopPropagation(),k(T)},children:c.jsx(Pn,{size:12})})]},T)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(Ss,{size:14})})]})}function fd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Cs=fd();function Ag(n){Cs=n}var co={exec:()=>null};function tt(n,r=""){let s=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(vn.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var vn={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Kk=/^(?:[ \t]*(?:\n|$))+/,Yk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Xk=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,So=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pd=/(?:[*+-]|\d{1,9}[.)])/,Ig=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dg=tt(Ig).replace(/bull/g,pd).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(),Zk=tt(Ig).replace(/bull/g,pd).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(),hd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jk=/^[^\n]+/,md=/(?!\s*\])(?:\\.|[^\[\]\\])+/,e1=tt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",md).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),t1=tt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pd).getRegex(),kl="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",gd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,n1=tt("^ {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",gd).replace("tag",kl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mg=tt(hd).replace("hr",So).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",kl).getRegex(),r1=tt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mg).getRegex(),vd={blockquote:r1,code:Yk,def:e1,fences:Xk,heading:Qk,hr:So,html:n1,lheading:Dg,list:t1,newline:Kk,paragraph:Mg,table:co,text:Jk},Fh=tt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",So).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",kl).getRegex(),s1={...vd,lheading:Zk,table:Fh,paragraph:tt(hd).replace("hr",So).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Fh).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",kl).getRegex()},i1={...vd,html:tt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gd).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:co,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:tt(hd).replace("hr",So).replace("heading",` *#{1,6} *[^
374
- ]`).replace("lheading",Dg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},o1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,a1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lg=/^( {2,}|\\)\n(?!\s*$)/,l1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Sl=/[\p{P}\p{S}]/u,yd=/[\s\p{P}\p{S}]/u,Pg=/[^\s\p{P}\p{S}]/u,c1=tt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,yd).getRegex(),Og=/(?!~)[\p{P}\p{S}]/u,u1=/(?!~)[\s\p{P}\p{S}]/u,d1=/(?:[^\s\p{P}\p{S}]|~)/u,f1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,zg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,p1=tt(zg,"u").replace(/punct/g,Sl).getRegex(),h1=tt(zg,"u").replace(/punct/g,Og).getRegex(),$g="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",m1=tt($g,"gu").replace(/notPunctSpace/g,Pg).replace(/punctSpace/g,yd).replace(/punct/g,Sl).getRegex(),g1=tt($g,"gu").replace(/notPunctSpace/g,d1).replace(/punctSpace/g,u1).replace(/punct/g,Og).getRegex(),v1=tt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pg).replace(/punctSpace/g,yd).replace(/punct/g,Sl).getRegex(),y1=tt(/\\(punct)/,"gu").replace(/punct/g,Sl).getRegex(),x1=tt(/^<(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(),w1=tt(gd).replace("(?:-->|$)","-->").getRegex(),k1=tt("^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",w1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),il=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,S1=tt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",il).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fg=tt(/^!?\[(label)\]\[(ref)\]/).replace("label",il).replace("ref",md).getRegex(),Ug=tt(/^!?\[(ref)\](?:\[\])?/).replace("ref",md).getRegex(),T1=tt("reflink|nolink(?!\\()","g").replace("reflink",Fg).replace("nolink",Ug).getRegex(),xd={_backpedal:co,anyPunctuation:y1,autolink:x1,blockSkip:f1,br:Lg,code:a1,del:co,emStrongLDelim:p1,emStrongRDelimAst:m1,emStrongRDelimUnd:v1,escape:o1,link:S1,nolink:Ug,punctuation:c1,reflink:Fg,reflinkSearch:T1,tag:k1,text:l1,url:co},b1={...xd,link:tt(/^!?\[(label)\]\((.*?)\)/).replace("label",il).getRegex(),reflink:tt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",il).getRegex()},Lu={...xd,emStrongRDelimAst:g1,emStrongLDelim:h1,url:tt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},N1={...Lu,br:tt(Lg).replace("{2,}","*").getRegex(),text:tt(Lu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ma={normal:vd,gfm:s1,pedantic:i1},Zi={normal:xd,gfm:Lu,breaks:N1,pedantic:b1},C1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Uh=n=>C1[n];function mr(n,r){if(r){if(vn.escapeTest.test(n))return n.replace(vn.escapeReplace,Uh)}else if(vn.escapeTestNoEncode.test(n))return n.replace(vn.escapeReplaceNoEncode,Uh);return n}function Bh(n){try{n=encodeURI(n).replace(vn.percentDecode,"%")}catch{return null}return n}function Wh(n,r){var u;const s=n.replace(vn.findPipe,(f,p,m)=>{let g=!1,v=p;for(;--v>=0&&m[v]==="\\";)g=!g;return g?"|":" |"}),o=s.split(vn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(vn.slashPipe,"|");return o}function Ji(n,r,s){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===r;)a++;return n.slice(0,o-a)}function E1(n,r){if(n.indexOf(r[1])===-1)return-1;let s=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===r[0])s++;else if(n[o]===r[1]&&(s--,s<0))return o;return s>0?-2:-1}function Hh(n,r,s,o,a){const u=r.href,f=r.title||null,p=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:s,href:u,title:f,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,m}function _1(n,r,s){const o=n.match(s.other.indentCodeCompensation);if(o===null)return r;const a=o[1];return r.split(`
375
- `).map(u=>{const f=u.match(s.other.beginningSpace);if(f===null)return u;const[p]=f;return p.length>=a.length?u.slice(a.length):u}).join(`
376
- `)}var ol=class{constructor(n){ot(this,"options");ot(this,"rules");ot(this,"lexer");this.options=n||Cs}space(n){const r=this.rules.block.newline.exec(n);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(n){const r=this.rules.block.code.exec(n);if(r){const s=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ji(s,`
377
- `)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=_1(s,r[3]||"",this.rules);return{type:"code",raw:s,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let s=r[2].trim();if(this.rules.other.endingHash.test(s)){const o=Ji(s,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(s=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:Ji(r[0],`
378
- `)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let s=Ji(r[0],`
379
- `).split(`
380
- `),o="",a="";const u=[];for(;s.length>0;){let f=!1;const p=[];let m;for(m=0;m<s.length;m++)if(this.rules.other.blockquoteStart.test(s[m]))p.push(s[m]),f=!0;else if(!f)p.push(s[m]);else break;s=s.slice(m);const g=p.join(`
381
- `),v=g.replace(this.rules.other.blockquoteSetextReplace,`
382
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
383
- ${g}`:g,a=a?`${a}
384
- ${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,s.length===0)break;const x=u.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){const T=x,E=T.raw+`
385
- `+s.join(`
386
- `),C=this.blockquote(E);u[u.length-1]=C,o=o.substring(0,o.length-T.raw.length)+C.raw,a=a.substring(0,a.length-T.text.length)+C.text;break}else if((x==null?void 0:x.type)==="list"){const T=x,E=T.raw+`
387
- `+s.join(`
388
- `),C=this.list(E);u[u.length-1]=C,o=o.substring(0,o.length-x.raw.length)+C.raw,a=a.substring(0,a.length-T.raw.length)+C.raw,s=E.substring(u.at(-1).raw.length).split(`
389
- `);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let r=this.rules.block.list.exec(n);if(r){let s=r[1].trim();const o=s.length>1,a={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");const u=this.rules.other.listItemRegex(s);let f=!1;for(;n;){let m=!1,g="",v="";if(!(r=u.exec(n))||this.rules.block.hr.test(n))break;g=r[0],n=n.substring(g.length);let k=r[2].split(`
390
- `,1)[0].replace(this.rules.other.listReplaceTabs,L=>" ".repeat(3*L.length)),x=n.split(`
391
- `,1)[0],T=!k.trim(),E=0;if(this.options.pedantic?(E=2,v=k.trimStart()):T?E=r[1].length+1:(E=r[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,v=k.slice(E),E+=r[1].length),T&&this.rules.other.blankLine.test(x)&&(g+=x+`
392
- `,n=n.substring(x.length+1),m=!0),!m){const L=this.rules.other.nextBulletRegex(E),b=this.rules.other.hrRegex(E),U=this.rules.other.fencesBeginRegex(E),P=this.rules.other.headingBeginRegex(E),W=this.rules.other.htmlBeginRegex(E);for(;n;){const K=n.split(`
393
- `,1)[0];let q;if(x=K,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),q=x):q=x.replace(this.rules.other.tabCharGlobal," "),U.test(x)||P.test(x)||W.test(x)||L.test(x)||b.test(x))break;if(q.search(this.rules.other.nonSpaceChar)>=E||!x.trim())v+=`
394
- `+q.slice(E);else{if(T||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||U.test(k)||P.test(k)||b.test(k))break;v+=`
395
- `+x}!T&&!x.trim()&&(T=!0),g+=K+`
396
- `,n=n.substring(K.length+1),k=q.slice(E)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let C=null,R;this.options.gfm&&(C=this.rules.other.listIsTask.exec(v),C&&(R=C[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!C,checked:R,loose:!1,text:v,tokens:[]}),a.raw+=g}const p=a.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m=0;m<a.items.length;m++)if(this.lexer.state.top=!1,a.items[m].tokens=this.lexer.blockTokens(a.items[m].text,[]),!a.loose){const g=a.items[m].tokens.filter(k=>k.type==="space"),v=g.length>0&&g.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=v}if(a.loose)for(let m=0;m<a.items.length;m++)a.items[m].loose=!0;return a}}html(n){const r=this.rules.block.html.exec(n);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(n){const r=this.rules.block.def.exec(n);if(r){const s=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:s,raw:r[0],href:o,title:a}}}table(n){var f;const r=this.rules.block.table.exec(n);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const s=Wh(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=r[3])!=null&&f.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
397
- `):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(s.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<s.length;p++)u.header.push({text:s[p],tokens:this.lexer.inline(s[p]),header:!0,align:u.align[p]});for(const p of a)u.rows.push(Wh(p,u.header.length).map((m,g)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:u.align[g]})));return u}}lheading(n){const r=this.rules.block.lheading.exec(n);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(n){const r=this.rules.block.paragraph.exec(n);if(r){const s=r[1].charAt(r[1].length-1)===`
398
- `?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:s,tokens:this.lexer.inline(s)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(n){const r=this.rules.inline.tag.exec(n);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(n){const r=this.rules.inline.link.exec(n);if(r){const s=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const u=Ji(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=E1(r[2],"()");if(u===-2)return;if(u>-1){const p=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,p).trim(),r[3]=""}}let o=r[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?o=o.slice(1):o=o.slice(1,-1)),Hh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(n,r){let s;if((s=this.rules.inline.reflink.exec(n))||(s=this.rules.inline.nolink.exec(n))){const o=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[o.toLowerCase()];if(!a){const u=s[0].charAt(0);return{type:"text",raw:u,text:u}}return Hh(s,a,s[0],this.lexer,this.rules)}}emStrong(n,r,s=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const u=[...o[0]].length-1;let f,p,m=u,g=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,r=r.slice(-1*n.length+u);(o=v.exec(r))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(p=[...f].length,o[3]||o[4]){m+=p;continue}else if((o[5]||o[6])&&u%3&&!((u+p)%3)){g+=p;continue}if(m-=p,m>0)continue;p=Math.min(p,p+m+g);const k=[...o[0]][0].length,x=n.slice(0,u+o.index+k+p);if(Math.min(u,p)%2){const E=x.slice(1,-1);return{type:"em",raw:x,text:E,tokens:this.lexer.inlineTokens(E)}}const T=x.slice(2,-2);return{type:"strong",raw:x,text:T,tokens:this.lexer.inlineTokens(T)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let s=r[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return o&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:r[0],text:s}}}br(n){const r=this.rules.inline.br.exec(n);if(r)return{type:"br",raw:r[0]}}del(n){const r=this.rules.inline.del.exec(n);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(n){const r=this.rules.inline.autolink.exec(n);if(r){let s,o;return r[2]==="@"?(s=r[1],o="mailto:"+s):(s=r[1],o=s),{type:"link",raw:r[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(n){var s;let r;if(r=this.rules.inline.url.exec(n)){let o,a;if(r[2]==="@")o=r[0],a="mailto:"+o;else{let u;do u=r[0],r[0]=((s=this.rules.inline._backpedal.exec(r[0]))==null?void 0:s[0])??"";while(u!==r[0]);o=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){const s=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:s}}}},jr=class Pu{constructor(r){ot(this,"tokens");ot(this,"options");ot(this,"state");ot(this,"tokenizer");ot(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Cs,this.options.tokenizer=this.options.tokenizer||new ol,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 s={other:vn,block:Ma.normal,inline:Zi.normal};this.options.pedantic?(s.block=Ma.pedantic,s.inline=Zi.pedantic):this.options.gfm&&(s.block=Ma.gfm,this.options.breaks?s.inline=Zi.breaks:s.inline=Zi.gfm),this.tokenizer.rules=s}static get rules(){return{block:Ma,inline:Zi}}static lex(r,s){return new Pu(s).lex(r)}static lexInline(r,s){return new Pu(s).inlineTokens(r)}lex(r){r=r.replace(vn.carriageReturn,`
399
- `),this.blockTokens(r,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){const o=this.inlineQueue[s];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,s=[],o=!1){var a,u,f;for(this.options.pedantic&&(r=r.replace(vn.tabCharGlobal," ").replace(vn.spaceLine,""));r;){let p;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(p=g.call({lexer:this},r,s))?(r=r.substring(p.raw.length),s.push(p),!0):!1))continue;if(p=this.tokenizer.space(r)){r=r.substring(p.raw.length);const g=s.at(-1);p.raw.length===1&&g!==void 0?g.raw+=`
400
- `:s.push(p);continue}if(p=this.tokenizer.code(r)){r=r.substring(p.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
401
- `+p.raw,g.text+=`
402
- `+p.text,this.inlineQueue.at(-1).src=g.text):s.push(p);continue}if(p=this.tokenizer.fences(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.heading(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.hr(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.blockquote(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.list(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.html(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.def(r)){r=r.substring(p.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
403
- `+p.raw,g.text+=`
404
- `+p.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title});continue}if(p=this.tokenizer.table(r)){r=r.substring(p.raw.length),s.push(p);continue}if(p=this.tokenizer.lheading(r)){r=r.substring(p.raw.length),s.push(p);continue}let m=r;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const v=r.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},v),typeof k=="number"&&k>=0&&(g=Math.min(g,k))}),g<1/0&&g>=0&&(m=r.substring(0,g+1))}if(this.state.top&&(p=this.tokenizer.paragraph(m))){const g=s.at(-1);o&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
405
- `+p.raw,g.text+=`
406
- `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(p),o=m.length!==r.length,r=r.substring(p.raw.length);continue}if(p=this.tokenizer.text(r)){r=r.substring(p.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
407
- `+p.raw,g.text+=`
408
- `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(p);continue}if(r){const g="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,s}inline(r,s=[]){return this.inlineQueue.push({src:r,tokens:s}),s}inlineTokens(r,s=[]){var p,m,g;let o=r,a=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,f="";for(;r;){u||(f=""),u=!1;let v;if((m=(p=this.options.extensions)==null?void 0:p.inline)!=null&&m.some(x=>(v=x.call({lexer:this},r,s))?(r=r.substring(v.raw.length),s.push(v),!0):!1))continue;if(v=this.tokenizer.escape(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.tag(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.link(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(v.raw.length);const x=s.at(-1);v.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):s.push(v);continue}if(v=this.tokenizer.emStrong(r,o,f)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.codespan(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.br(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.del(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.autolink(r)){r=r.substring(v.raw.length),s.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(r))){r=r.substring(v.raw.length),s.push(v);continue}let k=r;if((g=this.options.extensions)!=null&&g.startInline){let x=1/0;const T=r.slice(1);let E;this.options.extensions.startInline.forEach(C=>{E=C.call({lexer:this},T),typeof E=="number"&&E>=0&&(x=Math.min(x,E))}),x<1/0&&x>=0&&(k=r.substring(0,x+1))}if(v=this.tokenizer.inlineText(k)){r=r.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(f=v.raw.slice(-1)),u=!0;const x=s.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):s.push(v);continue}if(r){const x="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return s}},al=class{constructor(n){ot(this,"options");ot(this,"parser");this.options=n||Cs}space(n){return""}code({text:n,lang:r,escaped:s}){var u;const o=(u=(r||"").match(vn.notSpaceStart))==null?void 0:u[0],a=n.replace(vn.endingNewline,"")+`
409
- `;return o?'<pre><code class="language-'+mr(o)+'">'+(s?a:mr(a,!0))+`</code></pre>
410
- `:"<pre><code>"+(s?a:mr(a,!0))+`</code></pre>
411
- `}blockquote({tokens:n}){return`<blockquote>
412
- ${this.parser.parse(n)}</blockquote>
413
- `}html({text:n}){return n}heading({tokens:n,depth:r}){return`<h${r}>${this.parser.parseInline(n)}</h${r}>
414
- `}hr(n){return`<hr>
415
- `}list(n){const r=n.ordered,s=n.start;let o="";for(let f=0;f<n.items.length;f++){const p=n.items[f];o+=this.listitem(p)}const a=r?"ol":"ul",u=r&&s!==1?' start="'+s+'"':"";return"<"+a+u+`>
416
- `+o+"</"+a+`>
417
- `}listitem(n){var s;let r="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((s=n.tokens[0])==null?void 0:s.type)==="paragraph"?(n.tokens[0].text=o+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=o+" "+mr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):r+=o+" "}return r+=this.parser.parse(n.tokens,!!n.loose),`<li>${r}</li>
418
- `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
419
- `}table(n){let r="",s="";for(let a=0;a<n.header.length;a++)s+=this.tablecell(n.header[a]);r+=this.tablerow({text:s});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];s="";for(let f=0;f<u.length;f++)s+=this.tablecell(u[f]);o+=this.tablerow({text:s})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
420
- <thead>
421
- `+r+`</thead>
422
- `+o+`</table>
423
- `}tablerow({text:n}){return`<tr>
424
- ${n}</tr>
425
- `}tablecell(n){const r=this.parser.parseInline(n.tokens),s=n.header?"th":"td";return(n.align?`<${s} align="${n.align}">`:`<${s}>`)+r+`</${s}>
426
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${mr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:r,tokens:s}){const o=this.parser.parseInline(s),a=Bh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return r&&(u+=' title="'+mr(r)+'"'),u+=">"+o+"</a>",u}image({href:n,title:r,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));const a=Bh(n);if(a===null)return mr(s);n=a;let u=`<img src="${n}" alt="${s}"`;return r&&(u+=` title="${mr(r)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:mr(n.text)}},wd=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Rr=class Ou{constructor(r){ot(this,"options");ot(this,"renderer");ot(this,"textRenderer");this.options=r||Cs,this.options.renderer=this.options.renderer||new al,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wd}static parse(r,s){return new Ou(s).parse(r)}static parseInline(r,s){return new Ou(s).parseInline(r)}parse(r,s=!0){var a,u;let o="";for(let f=0;f<r.length;f++){const p=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[p.type]){const g=p,v=this.options.extensions.renderers[g.type].call({parser:this},g);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){o+=v||"";continue}}const m=p;switch(m.type){case"space":{o+=this.renderer.space(m);continue}case"hr":{o+=this.renderer.hr(m);continue}case"heading":{o+=this.renderer.heading(m);continue}case"code":{o+=this.renderer.code(m);continue}case"table":{o+=this.renderer.table(m);continue}case"blockquote":{o+=this.renderer.blockquote(m);continue}case"list":{o+=this.renderer.list(m);continue}case"html":{o+=this.renderer.html(m);continue}case"paragraph":{o+=this.renderer.paragraph(m);continue}case"text":{let g=m,v=this.renderer.text(g);for(;f+1<r.length&&r[f+1].type==="text";)g=r[++f],v+=`
427
- `+this.renderer.text(g);s?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}parseInline(r,s=this.renderer){var a,u;let o="";for(let f=0;f<r.length;f++){const p=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[p.type]){const g=this.options.extensions.renderers[p.type].call({parser:this},p);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){o+=g||"";continue}}const m=p;switch(m.type){case"escape":{o+=s.text(m);break}case"html":{o+=s.html(m);break}case"link":{o+=s.link(m);break}case"image":{o+=s.image(m);break}case"strong":{o+=s.strong(m);break}case"em":{o+=s.em(m);break}case"codespan":{o+=s.codespan(m);break}case"br":{o+=s.br(m);break}case"del":{o+=s.del(m);break}case"text":{o+=s.text(m);break}default:{const g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},Tu,Ua=(Tu=class{constructor(n){ot(this,"options");ot(this,"block");this.options=n||Cs}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?jr.lex:jr.lexInline}provideParser(){return this.block?Rr.parse:Rr.parseInline}},ot(Tu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Tu),j1=class{constructor(...n){ot(this,"defaults",fd());ot(this,"options",this.setOptions);ot(this,"parse",this.parseMarkdown(!0));ot(this,"parseInline",this.parseMarkdown(!1));ot(this,"Parser",Rr);ot(this,"Renderer",al);ot(this,"TextRenderer",wd);ot(this,"Lexer",jr);ot(this,"Tokenizer",ol);ot(this,"Hooks",Ua);this.use(...n)}walkTokens(n,r){var o,a;let s=[];for(const u of n)switch(s=s.concat(r.call(this,u)),u.type){case"table":{const f=u;for(const p of f.header)s=s.concat(this.walkTokens(p.tokens,r));for(const p of f.rows)for(const m of p)s=s.concat(this.walkTokens(m.tokens,r));break}case"list":{const f=u;s=s.concat(this.walkTokens(f.items,r));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(p=>{const m=f[p].flat(1/0);s=s.concat(this.walkTokens(m,r))}):f.tokens&&(s=s.concat(this.walkTokens(f.tokens,r)))}}return s}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(s=>{const o={...s};if(o.async=this.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=r.renderers[a.name];u?r.renderers[a.name]=function(...f){let p=a.renderer.apply(this,f);return p===!1&&(p=u.apply(this,f)),p}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=r[a.level];u?u.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),o.extensions=r),s.renderer){const a=this.defaults.renderer||new al(this.defaults);for(const u in s.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,p=s.renderer[f],m=a[f];a[f]=(...g)=>{let v=p.apply(a,g);return v===!1&&(v=m.apply(a,g)),v||""}}o.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new ol(this.defaults);for(const u in s.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,p=s.tokenizer[f],m=a[f];a[f]=(...g)=>{let v=p.apply(a,g);return v===!1&&(v=m.apply(a,g)),v}}o.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Ua;for(const u in s.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,p=s.hooks[f],m=a[f];Ua.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(p.call(a,g)).then(k=>m.call(a,k));const v=p.call(a,g);return m.call(a,v)}:a[f]=(...g)=>{let v=p.apply(a,g);return v===!1&&(v=m.apply(a,g)),v}}o.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,u=s.walkTokens;o.walkTokens=function(f){let p=[];return p.push(u.call(this,f)),a&&(p=p.concat(a.call(this,f))),p}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return jr.lex(n,r??this.defaults)}parser(n,r){return Rr.parse(n,r??this.defaults)}parseMarkdown(n){return(s,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(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 s>"u"||s===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const p=u.hooks?u.hooks.provideLexer():n?jr.lex:jr.lexInline,m=u.hooks?u.hooks.provideParser():n?Rr.parse:Rr.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(s):s).then(g=>p(g,u)).then(g=>u.hooks?u.hooks.processAllTokens(g):g).then(g=>u.walkTokens?Promise.all(this.walkTokens(g,u.walkTokens)).then(()=>g):g).then(g=>m(g,u)).then(g=>u.hooks?u.hooks.postprocess(g):g).catch(f);try{u.hooks&&(s=u.hooks.preprocess(s));let g=p(s,u);u.hooks&&(g=u.hooks.processAllTokens(g)),u.walkTokens&&this.walkTokens(g,u.walkTokens);let v=m(g,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(g){return f(g)}}}onError(n,r){return s=>{if(s.message+=`
428
- Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+mr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},bs=new j1;function qe(n,r){return bs.parse(n,r)}qe.options=qe.setOptions=function(n){return bs.setOptions(n),qe.defaults=bs.defaults,Ag(qe.defaults),qe};qe.getDefaults=fd;qe.defaults=Cs;qe.use=function(...n){return bs.use(...n),qe.defaults=bs.defaults,Ag(qe.defaults),qe};qe.walkTokens=function(n,r){return bs.walkTokens(n,r)};qe.parseInline=bs.parseInline;qe.Parser=Rr;qe.parser=Rr.parse;qe.Renderer=al;qe.TextRenderer=wd;qe.Lexer=jr;qe.lexer=jr.lex;qe.Tokenizer=ol;qe.Hooks=Ua;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;Rr.parse;jr.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 Vh(n,r){(r==null||r>n.length)&&(r=n.length);for(var s=0,o=Array(r);s<r;s++)o[s]=n[s];return o}function R1(n){if(Array.isArray(n))return n}function A1(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,u,f,p=[],m=!0,g=!1;try{if(u=(s=s.call(n)).next,r!==0)for(;!(m=(o=u.call(s)).done)&&(p.push(o.value),p.length!==r);m=!0);}catch(v){g=!0,a=v}finally{try{if(!m&&s.return!=null&&(f=s.return(),Object(f)!==f))return}finally{if(g)throw a}}return p}}function I1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
429
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D1(n,r){return R1(n)||A1(n,r)||M1(n,r)||I1()}function M1(n,r){if(n){if(typeof n=="string")return Vh(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Vh(n,r):void 0}}const Bg=Object.entries,qh=Object.setPrototypeOf,L1=Object.isFrozen,P1=Object.getPrototypeOf,O1=Object.getOwnPropertyDescriptor;let Jt=Object.freeze,en=Object.seal,si=Object.create,Wg=typeof Reflect<"u"&&Reflect,zu=Wg.apply,$u=Wg.construct;Jt||(Jt=function(r){return r});en||(en=function(r){return r});zu||(zu=function(r,s){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r.apply(s,a)});$u||($u=function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return new r(...o)});const ti=Pt(Array.prototype.forEach),z1=Pt(Array.prototype.lastIndexOf),Gh=Pt(Array.prototype.pop),ni=Pt(Array.prototype.push),$1=Pt(Array.prototype.splice),es=Array.isArray,so=Pt(String.prototype.toLowerCase),gu=Pt(String.prototype.toString),Kh=Pt(String.prototype.match),eo=Pt(String.prototype.replace),Yh=Pt(String.prototype.indexOf),F1=Pt(String.prototype.trim),U1=Pt(Number.prototype.toString),B1=Pt(Boolean.prototype.toString),Xh=typeof BigInt>"u"?null:Pt(BigInt.prototype.toString),Qh=typeof Symbol>"u"?null:Pt(Symbol.prototype.toString),qt=Pt(Object.prototype.hasOwnProperty),to=Pt(Object.prototype.toString),Vt=Pt(RegExp.prototype.test),ks=W1(TypeError);function Pt(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return zu(n,r,o)}}function W1(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return $u(n,s)}}function Ve(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:so;if(qh&&qh(n,null),!es(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(L1(r)||(r[o]=u),a=u)}n[a]=!0}return n}function H1(n){for(let r=0;r<n.length;r++)qt(n,r)||(n[r]=null);return n}function cn(n){const r=si(null);for(const o of Bg(n)){var s=D1(o,2);const a=s[0],u=s[1];qt(n,a)&&(es(u)?r[a]=H1(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=cn(u):r[a]=u)}return r}function V1(n){switch(typeof n){case"string":return n;case"number":return U1(n);case"boolean":return B1(n);case"bigint":return Xh?Xh(n):"0";case"symbol":return Qh?Qh(n):"Symbol()";case"undefined":return to(n);case"function":case"object":{if(n===null)return to(n);const r=n,s=rr(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:to(o)}return to(n)}default:return to(n)}}function rr(n,r){for(;n!==null;){const o=O1(n,r);if(o){if(o.get)return Pt(o.get);if(typeof o.value=="function")return Pt(o.value)}n=P1(n)}function s(){return null}return s}function q1(n){try{return Vt(n,""),!0}catch{return!1}}const Zh=Jt(["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"]),vu=Jt(["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"]),yu=Jt(["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"]),G1=Jt(["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"]),xu=Jt(["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"]),K1=Jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Jh=Jt(["#text"]),em=Jt(["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=Jt(["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"]),tm=Jt(["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"]),La=Jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y1=en(/{{[\w\W]*|^[\w\W]*}}/g),X1=en(/<%[\w\W]*|^[\w\W]*%>/g),Q1=en(/\${[\w\W]*/g),Z1=en(/^data-[\-\w.\u00B7-\uFFFF]+$/),J1=en(/^aria-[\-\w]+$/),nm=en(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eS=en(/^(?:\w+script|data):/i),tS=en(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nS=en(/^html$/i),rS=en(/^[a-z][.\w]*(-[.\w]+)+$/i),rm=en(/<[/\w!]/g),sm=en(/<[/\w]/g),sS=en(/<\/no(script|embed|frames)/i),iS=en(/\/>/i),Dn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},oS=function(){return typeof window>"u"?null:window},aS=function(r,s){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(o=s.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return r.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},im=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Zr=function(r,s,o,a){return qt(r,s)&&es(r[s])?Ve(a.base?cn(a.base):{},r[s],a.transform):o};function Hg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oS();const r=oe=>Hg(oe);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==Dn.document||!n.Element)return r.isSupported=!1,r;let s=n.document;const o=s,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,p=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,k=n.trustedTypes,x=p.prototype,T=rr(x,"cloneNode"),E=rr(x,"remove"),C=rr(x,"nextSibling"),R=rr(x,"childNodes"),L=rr(x,"parentNode"),b=rr(x,"shadowRoot"),U=rr(x,"attributes"),P=f&&f.prototype?rr(f.prototype,"nodeType"):null,W=f&&f.prototype?rr(f.prototype,"nodeName"):null,K=f&&f.prototype?rr(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const oe=s.createElement("template");oe.content&&oe.content.ownerDocument&&(s=oe.content.ownerDocument)}let q,G="",ce,pe=!1,ue=0;const de=function(){if(ue>0)throw ks('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.')},he=function(S){de(),ue++;try{return q.createHTML(S)}finally{ue--}},Le=function(S){de(),ue++;try{return q.createScriptURL(S)}finally{ue--}},te=function(){return pe||(ce=aS(k,a),pe=!0),ce},ie=s,le=ie.implementation,$=ie.createNodeIterator,Y=ie.createDocumentFragment,H=ie.getElementsByTagName,A=o.importNode;let j=im();r.isSupported=typeof Bg=="function"&&typeof L=="function"&&le&&le.createHTMLDocument!==void 0;const X=Y1,se=X1,ve=Q1,Se=Z1,Pe=J1,Re=eS,Me=tS,Ne=rS;let rt=nm,Oe=null;const mt=Ve({},[...Zh,...vu,...yu,...xu,...Jh]);let Fe=null;const _t=Ve({},[...em,...wu,...tm,...La]);let Ue=Object.seal(si(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}})),Yt=null,On=null;const at=Object.seal(si(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let yt=!0,lt=!0,Ft=!1,V=!0,me=!1,Be=!0,Je=!1,ct=!1,ut=null,gt=null,Xt=!1,xt=!1,Kn=!1,En=!1,yr=!0,Yn=!1;const un="user-content-";let zn=!0,tn=!1,nn={},Mt=null;const dn=Ve({},["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 nt=null;const At=Ve({},["audio","video","img","source","image","track"]);let jt=null;const Ut=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_="http://www.w3.org/1998/Math/MathML",re="http://www.w3.org/2000/svg",Q="http://www.w3.org/1999/xhtml";let ge=Q,Ce=!1,We=null;const je=Ve({},[_,re,Q],gu),et=Jt(["mi","mo","mn","ms","mtext"]);let ft=Ve({},et);const wt=Jt(["annotation-xml"]);let kt=Ve({},wt);const rn=Ve({},["title","style","font","a","script"]);let fn=null;const lr=["application/xhtml+xml","text/html"],Ir="text/html";let Ee=null,it=null;const Xn=s.createElement("form"),To=function(S){return S instanceof RegExp||S instanceof Function},Es=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(it&&it===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),fn=lr.indexOf(S.PARSER_MEDIA_TYPE)===-1?Ir:S.PARSER_MEDIA_TYPE,Ee=fn==="application/xhtml+xml"?gu:so,Oe=Zr(S,"ALLOWED_TAGS",mt,{transform:Ee}),Fe=Zr(S,"ALLOWED_ATTR",_t,{transform:Ee}),We=Zr(S,"ALLOWED_NAMESPACES",je,{transform:gu}),jt=Zr(S,"ADD_URI_SAFE_ATTR",Ut,{transform:Ee,base:Ut}),nt=Zr(S,"ADD_DATA_URI_TAGS",At,{transform:Ee,base:At}),Mt=Zr(S,"FORBID_CONTENTS",dn,{transform:Ee}),Yt=Zr(S,"FORBID_TAGS",cn({}),{transform:Ee}),On=Zr(S,"FORBID_ATTR",cn({}),{transform:Ee}),nn=qt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,yt=S.ALLOW_ARIA_ATTR!==!1,lt=S.ALLOW_DATA_ATTR!==!1,Ft=S.ALLOW_UNKNOWN_PROTOCOLS||!1,V=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=S.SAFE_FOR_TEMPLATES||!1,Be=S.SAFE_FOR_XML!==!1,Je=S.WHOLE_DOCUMENT||!1,xt=S.RETURN_DOM||!1,Kn=S.RETURN_DOM_FRAGMENT||!1,En=S.RETURN_TRUSTED_TYPE||!1,Xt=S.FORCE_BODY||!1,yr=S.SANITIZE_DOM!==!1,Yn=S.SANITIZE_NAMED_PROPS||!1,zn=S.KEEP_CONTENT!==!1,tn=S.IN_PLACE||!1,rt=q1(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:nm,ge=typeof S.NAMESPACE=="string"?S.NAMESPACE:Q,ft=qt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ve({},et),kt=qt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ve({},wt);const O=qt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):si(null);if(Ue=si(null),qt(O,"tagNameCheck")&&To(O.tagNameCheck)&&(Ue.tagNameCheck=O.tagNameCheck),qt(O,"attributeNameCheck")&&To(O.attributeNameCheck)&&(Ue.attributeNameCheck=O.attributeNameCheck),qt(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(Ue.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),en(Ue),me&&(lt=!1),Kn&&(xt=!0),nn&&(Oe=Ve({},Jh),Fe=si(null),nn.html===!0&&(Ve(Oe,Zh),Ve(Fe,em)),nn.svg===!0&&(Ve(Oe,vu),Ve(Fe,wu),Ve(Fe,La)),nn.svgFilters===!0&&(Ve(Oe,yu),Ve(Fe,wu),Ve(Fe,La)),nn.mathMl===!0&&(Ve(Oe,xu),Ve(Fe,tm),Ve(Fe,La))),at.tagCheck=null,at.attributeCheck=null,qt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?at.tagCheck=S.ADD_TAGS:es(S.ADD_TAGS)&&(Oe===mt&&(Oe=cn(Oe)),Ve(Oe,S.ADD_TAGS,Ee))),qt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?at.attributeCheck=S.ADD_ATTR:es(S.ADD_ATTR)&&(Fe===_t&&(Fe=cn(Fe)),Ve(Fe,S.ADD_ATTR,Ee))),qt(S,"ADD_URI_SAFE_ATTR")&&es(S.ADD_URI_SAFE_ATTR)&&Ve(jt,S.ADD_URI_SAFE_ATTR,Ee),qt(S,"FORBID_CONTENTS")&&es(S.FORBID_CONTENTS)&&(Mt===dn&&(Mt=cn(Mt)),Ve(Mt,S.FORBID_CONTENTS,Ee)),qt(S,"ADD_FORBID_CONTENTS")&&es(S.ADD_FORBID_CONTENTS)&&(Mt===dn&&(Mt=cn(Mt)),Ve(Mt,S.ADD_FORBID_CONTENTS,Ee)),zn&&(Oe["#text"]=!0),Je&&Ve(Oe,["html","head","body"]),Oe.table&&(Ve(Oe,["tbody"]),delete Yt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw ks('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ks('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=q;q=S.TRUSTED_TYPES_POLICY;try{G=he("")}catch(we){throw q=Z,we}}else S.TRUSTED_TYPES_POLICY===null?(q=void 0,G=""):(q===void 0&&(q=te()),q&&typeof G=="string"&&(G=he("")));Jt&&Jt(S),it=S},gi=Ve({},[...vu,...yu,...G1]),vi=Ve({},[...xu,...K1]),bo=function(S,O,Z){return O.namespaceURI===Q?S==="svg":O.namespaceURI===_?S==="svg"&&(Z==="annotation-xml"||ft[Z]):!!gi[S]},Tl=function(S,O,Z){return O.namespaceURI===Q?S==="math":O.namespaceURI===re?S==="math"&&kt[Z]:!!vi[S]},bl=function(S,O,Z){return O.namespaceURI===re&&!kt[Z]||O.namespaceURI===_&&!ft[Z]?!1:!vi[S]&&(rn[S]||!gi[S])},St=function(S){let O=L(S);(!O||!O.tagName)&&(O={namespaceURI:ge,tagName:"template"});const Z=so(S.tagName),we=so(O.tagName);return We[S.namespaceURI]?S.namespaceURI===re?bo(Z,O,we):S.namespaceURI===_?Tl(Z,O,we):S.namespaceURI===Q?bl(Z,O,we):!!(fn==="application/xhtml+xml"&&We[S.namespaceURI]):!1},cr=function(S){ni(r.removed,{element:S});try{L(S).removeChild(S)}catch{if(E(S),!L(S))throw ks("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Dr=function(S){ns(S);const O=R(S);if(O){const we=[];ti(O,_e=>{ni(we,_e)}),ti(we,_e=>{try{E(_e)}catch{}})}const Z=U(S);if(Z)for(let we=Z.length-1;we>=0;--we){const _e=Z[we],$e=_e&&_e.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},ur=function(S,O){try{ni(r.removed,{attribute:O.getAttributeNode(S),from:O})}catch{ni(r.removed,{attribute:null,from:O})}if(O.removeAttribute(S),S==="is")if(xt||Kn)try{cr(O)}catch{}else try{O.setAttribute(S,"")}catch{}},_s=function(S){const O=U(S);if(O)for(let Z=O.length-1;Z>=0;--Z){const we=O[Z],_e=we&&we.name;if(!(typeof _e!="string"||Fe[Ee(_e)]))try{S.removeAttribute(_e)}catch{}}},ns=function(S){const O=[S];for(;O.length>0;){const Z=O.pop();(P?P(Z):Z.nodeType)===Dn.element&&_s(Z);const _e=R(Z);if(_e)for(let $e=_e.length-1;$e>=0;--$e)O.push(_e[$e])}},No=function(S){if(!Be)return;const O=[S];for(;O.length>0;){const Z=O.pop(),we=P?P(Z):Z.nodeType;if(we===Dn.processingInstruction||we===Dn.comment&&Vt(sm,Z.data)){try{E(Z)}catch{}continue}if(we===Dn.element){const $e=Z,Ke=Ee(W?W(Z):Z.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&$e.removeAttribute("for")}catch{}}const _e=R(Z);if(_e)for(let $e=_e.length-1;$e>=0;--$e)O.push(_e[$e])}},rs=function(S){let O=null,Z=null;if(Xt)S="<remove></remove>"+S;else{const $e=Kh(S,/^[\r\n\t ]+/);Z=$e&&$e[0]}fn==="application/xhtml+xml"&&ge===Q&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const we=q?he(S):S;if(ge===Q)try{O=new v().parseFromString(we,fn)}catch{}if(!O||!O.documentElement){O=le.createDocument(ge,"template",null);try{O.documentElement.innerHTML=Ce?G:we}catch{}}const _e=O.body||O.documentElement;return S&&Z&&_e.insertBefore(s.createTextNode(Z),_e.childNodes[0]||null),ge===Q?H.call(O,Je?"html":"body")[0]:Je?O.documentElement:_e},_n=function(S){const O=K?K(S):S.ownerDocument;return $.call(O||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},js=function(S){return S=eo(S,X," "),S=eo(S,se," "),S=eo(S,ve," "),S},pn=function(S){var O;S.normalize();const Z=K?K(S):S.ownerDocument,we=$.call(Z||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let _e=we.nextNode();for(;_e;)_e.data=js(_e.data),_e=we.nextNode();const $e=(O=S.querySelectorAll)===null||O===void 0?void 0:O.call(S,"template");$e&&ti($e,Ke=>{Mr(Ke.content)&&pn(Ke.content)})},Rs=function(S){const O=W?W(S):null;return typeof O!="string"||Ee(O)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==U(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==P(S)||S.childNodes!==R(S)},Mr=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return P(S)===Dn.documentFragment}catch{return!1}},ss=function(S){if(!P||typeof S!="object"||S===null)return!1;try{return typeof P(S)=="number"}catch{return!1}};function hn(oe,S,O){oe.length!==0&&ti(oe,Z=>{Z.call(r,S,O,it)})}const As=function(S,O){return!!(Be&&S.hasChildNodes()&&!ss(S.firstElementChild)&&Vt(rm,S.textContent)&&Vt(rm,S.innerHTML)||Be&&S.namespaceURI===Q&&O==="style"&&ss(S.firstElementChild)||S.nodeType===Dn.processingInstruction||Be&&S.nodeType===Dn.comment&&Vt(sm,S.data))},is=function(S,O,Z){if(!Yt[O]&&xi(O)&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,O)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(O)))return!1;if(zn&&!Mt[O]){const we=L(S),_e=R(S);if(_e&&we){const $e=_e.length;for(let Ke=$e-1;Ke>=0;--Ke){const Xe=S===Z?T(_e[Ke],!0):_e[Ke];we.insertBefore(Xe,C(S))}}}return cr(S),!0},os=function(S,O,Z,we){return S.length===0?O:O===Z||O===we?cn(O):O},Co=function(S,O){if(hn(j.beforeSanitizeElements,S,null),S!==O&&L(S)===null)return tn&&ns(S),!0;if(Rs(S))return cr(S),!0;const Z=Ee(W?W(S):S.nodeName);if(Oe=os(j.uponSanitizeElement,Oe,mt,ut),hn(j.uponSanitizeElement,S,{tagName:Z,allowedTags:Oe}),S!==O&&L(S)===null)return tn&&ns(S),!0;if(As(S,Z))return cr(S),!0;if(Yt[Z]||!(at.tagCheck instanceof Function&&at.tagCheck(Z))&&!Oe[Z]){const _e=is(S,Z,O);return _e===!1&&hn(j.afterSanitizeElements,S,null),_e}if((P?P(S):S.nodeType)===Dn.element&&!St(S)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&Vt(sS,S.innerHTML))return cr(S),!0;if(me&&S.nodeType===Dn.text){const _e=js(S.textContent);S.textContent!==_e&&(ni(r.removed,{element:S.cloneNode()}),S.textContent=_e)}return hn(j.afterSanitizeElements,S,null),!1},Eo=function(S,O,Z){if(On[O]||Be&&O==="patchsrc"||Be&&O==="for"&&S!=="label"&&S!=="output"||yr&&(O==="id"||O==="name")&&(Z in s||Z in Xn))return!1;const we=Fe[O]||at.attributeCheck instanceof Function&&at.attributeCheck(O,S);if(!(lt&&Vt(Se,O))){if(!(yt&&Vt(Pe,O))){if(we){if(!jt[O]){if(!Vt(rt,eo(Z,Me,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&S!=="script"&&Yh(Z,"data:")===0&&nt[S])){if(!(Ft&&!Vt(Re,eo(Z,Me,"")))){if(Z)return!1}}}}}else if(!(xi(S)&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,S)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(S))&&(Ue.attributeNameCheck instanceof RegExp&&Vt(Ue.attributeNameCheck,O)||Ue.attributeNameCheck instanceof Function&&Ue.attributeNameCheck(O,S))||O==="is"&&Ue.allowCustomizedBuiltInElements&&(Ue.tagNameCheck instanceof RegExp&&Vt(Ue.tagNameCheck,Z)||Ue.tagNameCheck instanceof Function&&Ue.tagNameCheck(Z))))return!1}}return!0},yi=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),xi=function(S){return!yi[so(S)]&&Vt(Ne,S)},wi=function(S,O,Z,we){if(q&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Z)switch(k.getAttributeType(S,O)){case"TrustedHTML":return he(we);case"TrustedScriptURL":return Le(we)}return we},as=function(S,O,Z,we){try{Z?S.setAttributeNS(Z,O,we):S.setAttribute(O,we),Rs(S)?cr(S):Gh(r.removed)}catch{ur(O,S)}},_o=function(S){hn(j.beforeSanitizeAttributes,S,null);const O=S.attributes;if(!O||Rs(S))return;Fe=os(j.uponSanitizeAttribute,Fe,_t,gt);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Fe,forceKeepAttr:void 0};let we=O.length;const _e=Ee(S.nodeName);for(;we--;){const $e=O[we],Ke=$e.name,Xe=$e.namespaceURI,Tt=$e.value,bt=Ee(Ke),xr=Tt;let It=Ke==="value"?xr:F1(xr);if(Z.attrName=bt,Z.attrValue=It,Z.keepAttr=!0,Z.forceKeepAttr=void 0,hn(j.uponSanitizeAttribute,S,Z),It=Z.attrValue,Yn&&(bt==="id"||bt==="name")&&Yh(It,un)!==0&&(ur(Ke,S),It=un+It),Be&&Vt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){ur(Ke,S);continue}if(bt==="attributename"&&Kh(It,"href")){ur(Ke,S);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){ur(Ke,S);continue}if(!V&&Vt(iS,It)){ur(Ke,S);continue}if(me&&(It=js(It)),!Eo(_e,bt,It)){ur(Ke,S);continue}It=wi(_e,bt,Xe,It),It!==xr&&as(S,Ke,Xe,It)}}hn(j.afterSanitizeAttributes,S,null)},Lr=function(S){let O=null;const Z=_n(S);for(hn(j.beforeSanitizeShadowDOM,S,null);O=Z.nextNode();)if(hn(j.uponSanitizeShadowNode,O,null),Co(O,S),_o(O),Mr(O.content)&&Lr(O.content),(P?P(O):O.nodeType)===Dn.element){const _e=b(O);Mr(_e)&&(Ge(_e),Lr(_e))}hn(j.afterSanitizeShadowDOM,S,null)},Ge=function(S){const O=[{node:S,shadow:null}];for(;O.length>0;){const Z=O.pop();if(Z.shadow){Lr(Z.shadow);continue}const we=Z.node,$e=(P?P(we):we.nodeType)===Dn.element,Ke=R(we);if(Ke)for(let Xe=Ke.length-1;Xe>=0;--Xe)O.push({node:Ke[Xe],shadow:null});if($e){const Xe=W?W(we):null;if(typeof Xe=="string"&&Ee(Xe)==="template"){const Tt=we.content;Mr(Tt)&&O.push({node:Tt,shadow:null})}}if($e){const Xe=b(we);Mr(Xe)&&O.push({node:null,shadow:Xe},{node:Xe,shadow:null})}}};return r.sanitize=function(oe){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,Z=null,we=null,_e=null;if(Ce=!oe,Ce&&(oe="<!-->"),typeof oe!="string"&&!ss(oe)&&(oe=V1(oe),typeof oe!="string"))throw ks("dirty is not a string, aborting");if(!r.isSupported)return oe;ct?(Oe=ut,Fe=gt):Es(S),(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&(Oe=cn(Oe)),j.uponSanitizeAttribute.length>0&&(Fe=cn(Fe)),r.removed=[];const $e=tn&&typeof oe!="string"&&ss(oe);if($e){No(oe);const Tt=W?W(oe):oe.nodeName;if(typeof Tt=="string"){const bt=Ee(Tt);if(!Oe[bt]||Yt[bt])throw Dr(oe),ks("root node is forbidden and cannot be sanitized in-place")}if(Rs(oe))throw Dr(oe),ks("root node is clobbered and cannot be sanitized in-place");try{Ge(oe)}catch(bt){throw Dr(oe),bt}}else if(ss(oe))O=rs("<!---->"),Z=O.ownerDocument.importNode(oe,!0),Z.nodeType===Dn.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?O=Z:O.appendChild(Z),Ge(Z);else{if(!xt&&!me&&!Je&&oe.indexOf("<")===-1)return q&&En?he(oe):oe;if(O=rs(oe),!O)return xt?null:En?G:""}O&&Xt&&cr(O.firstChild);const Ke=$e?oe:O;try{const Tt=_n(Ke);for(;we=Tt.nextNode();)Co(we,Ke),_o(we),Mr(we.content)&&Lr(we.content)}catch(Tt){throw $e&&(Dr(oe),ti(r.removed,bt=>{bt.element&&ns(bt.element)})),Tt}if($e)return ti(r.removed,Tt=>{Tt.element&&ns(Tt.element)}),me&&pn(oe),oe;if(xt){if(me&&pn(O),Kn)for(_e=Y.call(O.ownerDocument);O.firstChild;)_e.appendChild(O.firstChild);else _e=O;return(Fe.shadowroot||Fe.shadowrootmode)&&(_e=A.call(o,_e,!0)),_e}let Xe=Je?O.outerHTML:O.innerHTML;return Je&&Oe["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Vt(nS,O.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
430
- `+Xe),me&&(Xe=js(Xe)),q&&En?he(Xe):Xe},r.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Es(oe),ct=!0,ut=Oe,gt=Fe},r.clearConfig=function(){it=null,ct=!1,ut=null,gt=null,q=ce,G=""},r.isValidAttribute=function(oe,S,O){it||Es({});const Z=Ee(oe),we=Ee(S);return Eo(Z,we,O)},r.addHook=function(oe,S){typeof S=="function"&&qt(j,oe)&&ni(j[oe],S)},r.removeHook=function(oe,S){if(qt(j,oe)){if(S!==void 0){const O=z1(j[oe],S);return O===-1?void 0:$1(j[oe],O,1)[0]}return Gh(j[oe])}},r.removeHooks=function(oe){qt(j,oe)&&(j[oe]=[])},r.removeAllHooks=function(){j=im()},r}var kd=Hg();const lS=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function om(n){return lS.has(n.type)}function cS({items:n,runtimeType:r,turn:s,threads:o=[]}){const[a,u]=w.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(p=>!p),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(Y0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(rd,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(p=>c.jsx(_r,{item:p,runtimeType:r,turn:s,threads:o},p.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function uS(n){const r=qe.parse(n);return kd.sanitize(r)}function am(n,r){var a;const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;s.nextNode();){const u=s.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>r)return{node:u,offset:r-o};o+=f}return null}function dS(n,r,s){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,r)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,r)>=0||a.push(u))}for(const u of a){const f=u.length;let p=0,m=f;if(u===r.startContainer&&(p=Math.min(r.startOffset,f)),u===r.endContainer&&(m=Math.min(r.endOffset,f)),p>=m)continue;m<f&&u.splitText(m);const g=p>0?u.splitText(p):u,v=s(),k=g.parentNode;k&&(k.insertBefore(v,g),v.appendChild(g))}}function fS(n,r){n.querySelectorAll("mark[data-thread-id]").forEach(s=>{const o=s.parentNode;if(!o)return;const a=document.createTextNode(s.textContent||"");o.replaceChild(a,s),o.normalize()});for(const s of r){if(s.start_offset===null||s.end_offset===null)continue;const o=am(n,s.start_offset),a=am(n,s.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),dS(n,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",s.id),s.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function pS(n){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const s=r.getRangeAt(0);if(s.collapsed||!n.contains(s.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(s.startContainer,s.startOffset);const a=o.toString().length,u=s.toString();return{start:a,end:a+u.length,text:u}}function hS({itemId:n,turnId:r,sessionId:s,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),p=w.useRef(null),m=w.useRef(""),g=w.useRef(0),[v,k]=w.useState(!1),[x,T]=w.useState({x:0,y:0}),[E,C]=w.useState(!1),[R,L]=w.useState({x:0,y:0}),[b,U]=w.useState(""),[P,W]=w.useState(null),[K,q]=w.useState(!1),G=M(H=>H.createThread),ce=M(H=>H.switchRightTab),pe=M(H=>dl(H.sessionDetails[s])),ue=w.useCallback(async()=>{await Mu(o||""),q(!0),setTimeout(()=>q(!1),1500)},[o]),de=w.useCallback(()=>{var A;if(!P)return;const H=`
431
- \`\`\`QUOTE
432
- ${P.text}
433
- \`\`\`
434
-
435
- `;M.setState({quotedText:H}),k(!1),W(null),(A=window.getSelection())==null||A.removeAllRanges()},[P]),he=w.useMemo(()=>uS(o||"…"),[o]),Le=w.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);w.useEffect(()=>{u.current&&fS(u.current,Le)},[he,Le]),w.useEffect(()=>{m.current=b},[b]),w.useEffect(()=>{function H(A){f.current&&!f.current.contains(A.target)&&(k(!1),m.current.trim()||C(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const te=w.useCallback(()=>{k(!1),m.current.trim()||C(!1)},[]),ie=w.useCallback(()=>{const H=u.current;if(!H)return;const A=pS(H);if(A&&A.text.trim().length>0){const j=window.getSelection();if(j&&j.rangeCount>0&&j.anchorNode&&j.focusNode){const se=j.getRangeAt(0).getBoundingClientRect(),ve=28,Se=6,Pe=170;let Re=!1;try{const rt=document.createRange();rt.setStart(j.focusNode,j.focusOffset),rt.setEnd(j.focusNode,j.focusOffset);const Oe=document.createRange();Oe.setStart(j.anchorNode,j.anchorOffset),Oe.setEnd(j.anchorNode,j.anchorOffset),Re=Oe.compareBoundaryPoints(Range.START_TO_START,rt)>0}catch{Re=!1}let Me=se.top-ve-Se;Me<8&&(Me=se.bottom+Se);let Ne=Re?se.left-Pe:se.right;Ne=Math.max(8,Math.min(Ne,window.innerWidth-Pe-8)),T({x:Ne,y:Me}),k(!0),W(A)}}else k(!1)},[]);w.useEffect(()=>{function H(A){const j=A.target;j&&(j.closest(".selection-actions")||j.closest(".thread-create-popover"))||ie()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[ie]);const le=w.useCallback(()=>{k(!1),C(!0),L({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!E)return;const H=p.current;if(!H)return;const A=H.offsetWidth,j=H.offsetHeight,X=8;let se=x.x,ve=x.y;se-A<X&&(se=A+X),se>window.innerWidth-X&&(se=window.innerWidth-X),ve<X&&(ve=X),ve+j>window.innerHeight-X&&(ve=window.innerHeight-j-X),L({x:se,y:ve})},[E,x]);const $=w.useCallback(async()=>{var H;pe||!P||!b.trim()||(await G(s,{itemId:n,turnId:r,startOffset:P.start,endOffset:P.end,selectedText:P.text,message:b.trim()}),U(""),C(!1),W(null),(H=window.getSelection())==null||H.removeAllRanges(),ce("threads"))},[P,b,G,s,n,r,ce,pe]),Y=w.useCallback(H=>{const A=H.target;if(A.tagName==="MARK"&&A.hasAttribute("data-thread-id")){H.preventDefault(),ce("threads");const j=A.getAttribute("data-thread-id");setTimeout(()=>{const X=document.getElementById(`thread-${j}`);X&&(X.scrollIntoView({behavior:"smooth",block:"center"}),X.classList.add("thread-card-highlighted"),setTimeout(()=>X.classList.remove("thread-card-highlighted"),1500))},100)}},[ce]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:he},onMouseDown:te,onClick:Y}),c.jsx("button",{className:`copy-text-btn${K?" copied":""}`,onClick:ue,title:K?"Copied":"Copy message","aria-label":"Copy message text",children:K?c.jsx(ts,{size:14}):c.jsx(ju,{size:14})}),v&&!E&&c.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!pe&&c.jsxs("button",{className:"discuss-button",onClick:le,title:"Start a discussion about this text",children:[c.jsx(L0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:de,title:"Quote this text in your message",children:[c.jsx(Jm,{size:14}),c.jsx("span",{children:"Quote"})]})]}),E&&c.jsxs("div",{ref:p,className:"thread-create-popover",style:{left:R.x,top:R.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',P==null?void 0:P.text.slice(0,80),P&&P.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),W(null)},children:c.jsx(Pn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:b,onChange:H=>U(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),$()),H.key==="Escape")if(m.current.trim()){const A=Date.now();g.current&&A-g.current<400?(g.current=0,C(!1),W(null)):g.current=A}else C(!1),W(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:$,disabled:!b.trim()||pe,title:pe?"Wait for the running turn to finish first":void 0,children:[c.jsx(ml,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const lm=w.memo(hS),ll=new Map,Vg=new Set,Fu=new Set,cm=new Map;function qg(){Fu.forEach(n=>n())}function Gg(n,r){return`${n}:${r}`}function mS(n,r,s,o,a){var m;const u=Gg(r,s),f=ll.get(n)??new Map,p=new Map(f);((m=p.get(u))==null?void 0:m.answer)===a?p.delete(u):p.set(u,{itemIndex:r,groupIndex:s,question:o,answer:a}),ll.set(n,p),qg()}function gS(n){ll.delete(n),qg()}function vS(n){Vg.add(n),gS(n)}function yS(n){const r=w.useCallback(s=>(Fu.add(s),()=>{Fu.delete(s)}),[]);return w.useSyncExternalStore(r,()=>ll.get(n)??cm,()=>cm)}function xS(n){return[...n].sort((r,s)=>r.itemIndex-s.itemIndex||r.groupIndex-s.groupIndex).map(r=>`> ${r.question}
436
- ${r.answer}`).join(`
437
-
438
- `)}function um({item:n,turn:r}){var T;const s=n.data??{},o=w.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(E=>!!E&&Array.isArray(E.selections)&&E.selections.length>0):[],[s.groups]),a=yS(r.id),u=M(E=>r.session_id?E.sessionDetails[r.session_id]:null),f=M(E=>E.activeSessionId),p=r.items.findIndex(E=>E.id===n.id),m=u?((T=u.turns[u.turns.length-1])==null?void 0:T.id)===r.id:!0,g=Vg.has(r.id),v=g||Fm(u)||!m||r.session_id!==f,k=(E,C,R)=>{v||mS(r.id,p,E,C,R)},x=()=>{const E=[...a.values()];if(E.length===0)return;const C=xS(E);vS(r.id),M.getState().submitPrompt(C)};return c.jsxs("div",{className:"render-content ask-user-card",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(k0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),g&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((E,C)=>c.jsxs("div",{className:"ask-user-group",children:[E.question&&c.jsx("div",{className:"ask-user-question",children:E.question}),c.jsx("div",{className:"ask-user-options",children:E.selections.map(R=>{var b;const L=((b=a.get(Gg(p,C)))==null?void 0:b.answer)===R;return c.jsx("button",{type:"button",className:`ask-user-option ${L?"selected":""}`,disabled:v,onClick:()=>k(C,E.question,R),children:R},R)})})]},C)),v?g&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[c.jsx(ml,{size:12}),"Send"]})]}):s.question?c.jsx("p",{className:"user-message",children:s.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const wS={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function io(n){return n&&wS[n]||"interrupted"}function cl(n){if(!n)return"";const r=new Date(n);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function kS(n){switch(n){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 SS(n){return n.items.filter(r=>r.type==="interruption").map(r=>r.data)}function TS({item:n}){const r=n.data,s=cl(r.interrupted_at);let o="";switch(r.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=r.resumed_at?`resumed ${cl(r.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return c.jsx("div",{className:"interruption-marker",title:r.detail??void 0,children:c.jsxs("span",{children:["Interrupted",s?` ${s}`:""," (",io(r.reason),") · ",o]})})}function bS({turn:n,label:r}){const[s,o]=w.useState(!1),a=M(f=>f.addToast),u=()=>{o(!0),ex(n.session_id,n.id).catch(f=>a("error",`Could not resume the turn — ${f.message}`)).finally(()=>o(!1))};return c.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:s,children:[c.jsx(eg,{size:12}),r]})}function NS({turn:n}){const r=n.resume_state;if(!r||r==="cancelled")return null;const s=n.interrupt_reason,o=SS(n),a=o[o.length-1],u=cl(n.interrupted_at??(a==null?void 0:a.interrupted_at));if(r==="resumed"){const g=cl(a==null?void 0:a.resumed_at),v=n.status==="running"||n.status==="pending";return c.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(eg,{size:12})}),c.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",io(s),") · resumed",g?` ${g}`:"",v?" — continuing…":""]})]})}let f,p=null,m=null;switch(r){case"waiting":f=kS(s),m="Resume now";break;case"resuming":f=`Interrupted (${io(s)}) — resuming from where it left off…`;break;case"gave_up":{const g=Math.max(o.length,1);f=`Interrupted ${g===1?"once":`${g} times`} — automatic resume stopped.`,p=n.error&&!n.error.startsWith("Automatic resume stopped")?n.error:null,m="Resume";break}case"skipped":f=`Interrupted${u?` ${u}`:""} (${io(s)}) — too long ago to resume automatically.`,m="Resume";break;default:f=`Interrupted (${io(s)}) — this turn cannot be resumed.`,p=n.error}return c.jsxs("div",{className:"interruption-banner","data-state":r,children:[c.jsx("span",{className:"banner-icon",children:s==="network"?c.jsx(rg,{size:12}):c.jsx(hl,{size:12})}),c.jsxs("span",{className:"banner-text",children:[f,p&&c.jsx("span",{className:"banner-detail",children:p})]}),m&&c.jsx(bS,{turn:n,label:m})]})}function CS({turnId:n}){const r=M(o=>o.retryStates[n]);if(!r)return null;const s=r.errorStatus?`API error ${r.errorStatus}`:"Connection problem";return c.jsxs("div",{className:"retry-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(rg,{size:12})}),c.jsxs("span",{className:"banner-text",children:[s," — retrying (attempt ",r.attempt," of ",r.maxRetries,")…"]})]})}qe.setOptions({breaks:!0,gfm:!0});function ES({attachments:n}){const[r,s]=w.useState(null);return w.useEffect(()=>{if(!r)return;function o(a){a.key==="Escape"&&s(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),!Array.isArray(n)||n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"attachment-pills",children:n.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return c.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>s(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?c.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):c.jsx(Zm,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),r&&c.jsx("div",{className:"image-preview-modal",onClick:()=>s(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:r,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>s(null),children:c.jsx(Pn,{size:20})})]})})]})}function _S(n){const r=qe.parse(n);return kd.sanitize(r)}function dm(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function jS(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const fm='<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 RS(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${fm}</body>`):n+fm}function AS({html:n}){const[r,s]=w.useState(480),o=w.useRef(null);return w.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&s(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:RS(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const pm=1e4;function IS({item:n,runtimeType:r,turn:s,threads:o}){var p,m,g,v,k,x,T,E;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:R}=Eu(r??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${C}`,children:R}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(lm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:dm(n)||"…",threads:o,runtimeType:r})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(x0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:_S(dm(n))}})]});case"command_execution":{const C=n.data||{},R=jS(C.command||""),L=C.aggregated_output||"",b=C.exit_code,U=a?"running…":b!==null?`exit ${b}`:"",P=L.length>pm,W=P&&!u?L.slice(0,pm)+`
439
- … (truncated, click to expand)`:L;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(ng,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),U&&c.jsx("span",{className:"turn-header-meta",children:U})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:R})}),L&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),P&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(K=>!K),children:u?"Show less":`Show full output (${(L.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(p=n.data)==null?void 0:p.changes,R=Array.isArray(C)?C:[],L=`${R.length} file${R.length!==1?"s":""}`;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(E0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:L})]}),c.jsx("div",{className:"file-change-list",children:R.map((b,U)=>{const P=b.kind==="add"?"A":b.kind==="delete"?"D":"M",W=b.kind==="add"?"fc-add":b.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:P}),c.jsx("span",{className:"fc-name",children:b.path})]},U)})})]})}case"mcp_tool_call":{const C=n.data||{},R=C.tool||"mcp";if(R==="Agent"){const G=C.arguments,ce=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",pe=n.status==="failed",ue=a?"running…":pe?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(_u,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ce}),c.jsx("span",{className:`agent-call-status ${a?"running":pe?"failed":"done"}`,children:ue})]})}const L=C.server||"",b=C.arguments,U=C.result,P=C.error,W=n.status==="failed"||!!P,K=a?"running…":W?"failed":"done",q=((m=U==null?void 0:U.content)==null?void 0:m.filter(G=>G.type==="text").map(G=>G.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(U0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",R]}),L&&c.jsx("span",{className:"turn-header-meta",children:L}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:K})]}),b&&Object.keys(b).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(b).map(([G,ce])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:G}),G==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ce)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ce=="string"?ce:JSON.stringify(ce,null,2)})]},G))}),q.length>0&&q.map((G,ce)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},ce)),P&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:P})})]})}case"web_search":{const C=((g=n.data)==null?void 0:g.query)||"";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(W0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((v=n.data)==null?void 0:v.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(I0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((R,L)=>c.jsxs("li",{className:R.completed?"todo-done":"todo-pending",children:[R.completed?c.jsx(ts,{size:14}):c.jsx(fi,{size:14})," ",R.text]},L))})]})}case"ask_user":return c.jsx(um,{item:n,turn:s});case"final_result":{const C=n.data??{},R=C.text||"",L=C.html||null,b=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:U,iconText:P}=Eu(r??"codex");return c.jsxs(c.Fragment,{children:[(R||L)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${U}`,children:P}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),R&&c.jsx(lm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:R,threads:o,runtimeType:r}),L&&c.jsx(AS,{html:L})]}),b.length>0&&c.jsx(um,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},R=C.task_type||"unknown",L=C.subagent_type||null,b=C.description||"",U=C.status||"running",P=C.last_tool_name||null,W=C.token_count||null,K=R==="local_agent",q=R==="local_bash",G=K?_u:q?tg:Qm,ce=K?`Subagent${L?`: ${L}`:""}`:q?"Monitor":"Background Task",pe=U==="running"?"running…":U==="completed"?"done":U==="failed"?"failed":U==="stopped"?"stopped":U,ue=n.status==="failed"||U==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(G,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ce}),c.jsx("span",{className:"turn-header-meta",style:ue?{color:"var(--red)"}:void 0,children:pe})]}),b&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:b}),P&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",P,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.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 C=((k=n.data)==null?void 0:k.trigger)??"auto",R=((x=n.data)==null?void 0:x.pre_tokens)??0,L=((T=n.data)==null?void 0:T.post_tokens)??0,b=R>0?Math.round((1-L/R)*100):0,U=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(O0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:U})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[R.toLocaleString()," → ",L.toLocaleString()," tokens (",b,"% reduction)"]})]})}case"interruption":return c.jsx(TS,{item:n});case"error":{const C=((E=n.data)==null?void 0:E.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(hl,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const _r=w.memo(IS,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function DS({turn:n,runtimeType:r,threads:s=[]}){Kt.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const b=n.items.some(U=>U.type==="background_task"&&U.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!b&&a(!1)},[n.status,n.items]);let u=-1;for(let b=n.items.length-1;b>=0;b--)if(n.items[b].type==="agent_message"){u=b;break}const f=u>=0,p=f?n.items.slice(0,u):n.items,m=n.items.some(b=>b.type==="final_result"||b.type==="ask_user"),g=!f&&n.status==="completed"&&n.agent_response&&!m?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=p.filter(b=>{var U;return!(b.type==="reasoning"&&(!((U=b.data)!=null&&U.text)||b.data.text===""))}).filter(b=>!(b.type==="background_task"||b.type==="ask_user"||b.type==="final_result")),x=[];let T=null;for(const b of k)b.type==="agent_message"?(T&&x.push(T),T={agentMessage:b,toolItems:[],otherItems:[]}):b.type==="interruption"||b.type==="error"?(T&&x.push(T),x.push({agentMessage:null,toolItems:[],otherItems:[b]}),T=null):(T||(T={agentMessage:null,toolItems:[],otherItems:[]}),om(b)?T.toolItems.push(b):T.otherItems.push(b));T&&x.push(T);const E=k.filter(b=>om(b)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending"),R=n.status==="pending"&&n.resume_state==="waiting",L=n.resume_state==="gave_up"||n.resume_state==="skipped"||n.resume_state==="unsupported";return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(ES,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(b=>!b),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(R0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:R?"interrupted":"thinking…"}),c.jsx(rd,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((b,U)=>c.jsxs("div",{className:"intermediate-segment",children:[b.agentMessage&&c.jsx(_r,{item:b.agentMessage,runtimeType:r,turn:n,threads:s}),b.otherItems.map(P=>c.jsx(_r,{item:P,runtimeType:r,turn:n,threads:s},P.id)),b.toolItems.length>0&&c.jsx(cS,{items:b.toolItems,runtimeType:r,turn:n,threads:s})]},U))})]}),n.items.filter(b=>b.type==="background_task").map(b=>c.jsx(_r,{item:b,runtimeType:r,turn:n,threads:s},`task-${b.id}`)),f&&c.jsx(_r,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),g&&c.jsx(_r,{item:g,runtimeType:r,turn:n,threads:s},g.id),f&&n.items.slice(u+1).filter(b=>b.type!=="ask_user"&&b.type!=="background_task"&&b.type!=="final_result").map(b=>c.jsx(_r,{item:b,runtimeType:r,turn:n,threads:s},b.id)),n.items.filter(b=>b.type==="final_result").map(b=>c.jsx(_r,{item:b,runtimeType:r,turn:n,threads:s},`final-${b.id}`)),n.items.filter(b=>b.type==="ask_user").map(b=>c.jsx(_r,{item:b,runtimeType:r,turn:n,threads:s},`ask-${b.id}`)),n.items.length===0&&!n.error&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:n.status==="running"?"Agent is thinking…":"Waiting to start…"})}),n.error&&!L&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="running"&&c.jsx(CS,{turnId:n.id}),c.jsx(NS,{turn:n}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(fi,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const MS=w.memo(DS);function Kg(n,r="session",s=0){const o=[];if(r==="session")n.forEach((u,f)=>hm(u,f,o));else{const u=n[s];u&&hm(u,s,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function hm(n,r,s){var o;for(const a of n.items)if(a.type==="file_change"&&((o=a.data)!=null&&o.changes)){const u=a.data.changes;for(const f of u)s.push({path:f.path,kind:f.kind,turnIdx:r})}}const LS=[],Pa=50;function PS(){Kt.trackRender("RenderArea");const n=M(L=>L.activeSessionId),r=M(L=>L.activeSessionId?L.sessionDetails[L.activeSessionId]:null),s=M(L=>L.activeTurnIndex),o=M(L=>L.activeRightTab),a=M(L=>L.changesScope),u=M(L=>L.submittingPrompt),f=M(L=>L.loading),p=M(L=>L.selectedChangePath),m=M(L=>L.setSelectedChangePath),g=(r==null?void 0:r.turns)??[],v=(r==null?void 0:r.threads)??LS,k=w.useRef(null),[x,T]=w.useState(Pa);w.useEffect(()=>{T(Pa)},[n]);const E=g.filter(L=>!L.thread_id),C=Math.max(0,E.length-x),R=E.slice(C);if(w.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[n,g.length]),w.useEffect(()=>{if(!p||o!=="changes")return;const L=setTimeout(()=>{const b=p.replace(/[^a-zA-Z0-9]/g,"-"),U=document.getElementById(`diff-${b}`);U&&(U.scrollIntoView({behavior:"smooth",block:"start"}),U.classList.add("diff-highlight"),setTimeout(()=>U.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(L)},[p,o,m]),o==="changes"){if(!r)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const L=Kg(g,a,s);return L.length===0?c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):c.jsx("div",{className:"render-scroll",ref:k,children:c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{style:{marginBottom:"20px"},children:[c.jsx("span",{style:{fontSize:"16px",fontWeight:600,color:"var(--text)"},children:a==="session"?"All Session Changes":"Current Turn Changes"}),c.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px"},children:[L.length," file",L.length>1?"s":""]})]}),L.map(b=>{const U=b.path.split("/").pop()||b.path,P=b.path.replace("/"+U,""),W=b.kind==="add"?"Added":b.kind==="delete"?"Deleted":"Modified",K=b.kind==="add"?"fc-add":b.kind==="delete"?"fc-del":"fc-mod",q=b.kind==="add"?"A":b.kind==="delete"?"D":"M",G=b.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${G}`,children:[c.jsx("span",{className:`diff-file-status ${K}`,children:q}),c.jsxs("span",{className:"diff-file-name",children:[P&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[P,"/"]}),U]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${K}`,children:W})})]}),c.jsx("p",{style:{color:"var(--text-muted)",fontSize:"12px",fontStyle:"italic",padding:"8px 16px"},children:"Diff content not available (Codex SDK limitation)."})]},b.path)})]})})}return f&&!r?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):r?c.jsxs("div",{className:"render-scroll",ref:k,children:[u&&c.jsx("div",{className:"turn-block",children:c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:u})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),g.length===0&&!u&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),C>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>T(L=>L+Pa),children:["Show ",Math.min(Pa,C)," earlier turns (",C," hidden)"]})}),R.map((L,b)=>c.jsx("div",{id:`turn-${C+b}`,className:"turn-block",children:c.jsx(MS,{turn:L,runtimeType:r.runtime_type,threads:v})},L.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const OS=w.memo(PS),zS=[{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 $S(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function FS(n,r,s=[]){const o=[...zS,...$S(s)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!r[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function US({commands:n,selectedIndex:r,onSelect:s,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===r?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>s(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function ku({title:n,options:r,currentValue:s,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),r.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===s?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===s&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function BS(n){return yn("/skills")}function WS({filter:n,onSelect:r,onClose:s}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[p,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{BS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{m(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),m(T=>Math.min(T+1,v.length-1))):x.key==="ArrowUp"?(x.preventDefault(),m(T=>Math.max(T-1,0))):x.key==="Enter"?(x.preventDefault(),v[p]&&r(v[p])):x.key==="Escape"&&(x.preventDefault(),s())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,p,r,s]),c.jsxs("div",{className:"slash-popup",ref:g,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:s,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===p?"selected":""}`,onMouseEnter:()=>m(x),onClick:()=>r(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function HS(){return yn("/providers")}function VS(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return yn(`/providers/${n}/commands${s}`)}const qS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function GS(n){const[r,s]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{HS().then(s).catch(()=>s([])).finally(()=>a(!1))},[]);const u=r.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??qS,loading:o}}const ri=32,Su=200;function mm(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function gm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let vm=0;function KS(){return vm+=1,`att-${Date.now()}-${vm}`}function YS(){Kt.trackRender("CommandInputBar");const[n,r]=w.useState(""),s=w.useRef(null),o=w.useRef(ri),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:p,setShowModelSelector:m}=M(),g=M(V=>V.activeSessionId),v=M(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),k=M(V=>V.quotedText),x=Fm(v),T=!!(v!=null&&v.turns.some(V=>V.status==="pending"&&V.resume_state==="waiting")),E=!g,{capabilities:C}=GS(v==null?void 0:v.runtime_type),R=(v==null?void 0:v.runtime_type)??null,L=C.imageAttachments,[b,U]=w.useState([]),[P,W]=w.useState(!1),[K,q]=w.useState(null),[G,ce]=w.useState([]);w.useEffect(()=>{if(!R){ce([]);return}let V=!1;return VS(R,(v==null?void 0:v.cwd)??void 0).then(me=>{V||ce(me)}).catch(()=>{V||ce([])}),()=>{V=!0}},[R,v==null?void 0:v.cwd]);const[pe,ue]=w.useState(!1),[de,he]=w.useState(""),[Le,te]=w.useState(0),[ie,le]=w.useState(void 0),[$,Y]=w.useState(!1),[H,A]=w.useState(""),[j,X]=w.useState([]),se=pe?FS(de,C,G):[];w.useEffect(()=>{k!==null&&(r(V=>V+k),setTimeout(()=>{if(s.current){Oe(),s.current.focus();const V=s.current.value.length;s.current.setSelectionRange(V,V)}},0),M.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function V(me){me.key==="Escape"&&(me.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[x,f]),w.useEffect(()=>{ue(!1),le(void 0),Y(!1),X([]),U(V=>{for(const me of V)me.previewUrl&&URL.revokeObjectURL(me.previewUrl);return[]})},[g]),w.useEffect(()=>{if(!K)return;function V(me){me.key==="Escape"&&(me.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[K]);const ve=w.useCallback(V=>{if(!V)return;const me=Array.from(V);for(const Be of me){const Je=new FileReader;Je.onload=()=>{const ut=Je.result.split(",")[1]??"",gt=Be.type.startsWith("image/")?URL.createObjectURL(Be):void 0;U(Xt=>[...Xt,{id:KS(),name:Be.name,media_type:Be.type||"application/octet-stream",data:ut,previewUrl:gt,size:Be.size}])},Je.readAsDataURL(Be)}},[]),Se=w.useCallback(V=>{U(me=>{const Be=me.find(Je=>Je.id===V);return Be!=null&&Be.previewUrl&&URL.revokeObjectURL(Be.previewUrl),me.filter(Je=>Je.id!==V)})},[]),Pe=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!L||x)&&W(!0)},[L,x]),Re=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),W(!1)},[]),Me=w.useCallback(V=>{V.preventDefault(),V.stopPropagation(),W(!1),!(!L||x)&&ve(V.dataTransfer.files)},[L,x,ve]),Ne=w.useCallback(V=>{var Je;if(!L)return;const me=(Je=V.clipboardData)==null?void 0:Je.items;if(!me)return;const Be=[];for(let ct=0;ct<me.length;ct++){const ut=me[ct];if(ut.type.startsWith("image/")){const gt=ut.getAsFile();gt&&Be.push(gt)}}Be.length>0&&(V.preventDefault(),ve(Be))},[L,ve]);function rt(V){const me=s.current;me&&(me.style.height=`${V}px`,o.current=V)}function Oe(){const V=s.current;if(V){if(V.scrollHeight>V.clientHeight){const me=Math.min(V.scrollHeight,Su);me!==o.current&&rt(me);return}o.current>ri&&(V.style.height="auto",rt(Math.min(V.scrollHeight,Su)))}}function mt(){const V=n.trim();if(!V||x)return;let me=V;j.length>0&&(me=`${j.map(ct=>`$${ct.name}`).join(" ")}
440
-
441
- ${V}`);const Be=b.map(({id:Je,previewUrl:ct,size:ut,...gt})=>gt);r(""),X([]),rt(ri),ue(!1),le(void 0),Y(!1);for(const Je of b)Je.previewUrl&&URL.revokeObjectURL(Je.previewUrl);U([]),u(me,Be.length>0?Be:void 0)}function Fe(V){if(V.insertAsText){const me=`/${V.id} `;r(me),ue(!1),le(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Be=me.length;s.current.setSelectionRange(Be,Be),Oe()}});return}V.subPopup?le(V.subPopup):V.id==="skills"?(Y(!0),A(""),ue(!1),r("")):V.id==="model"?(m(!0),ue(!1),r("")):(ue(!1),r(""))}function _t(V){X(me=>[...me,V]),Y(!1),r(""),rt(ri)}function Ue(V){const me=mm(v==null?void 0:v.runtime_config);ie==="sandbox"?me.sandboxMode=V:ie==="websearch"?me.webSearchMode=V:ie==="network"&&(me.networkAccessEnabled=V==="true"),p(me),le(void 0),ue(!1),r(""),rt(ri)}function Yt(V){if(Kt.markKeystroke(),pe&&!ie){if(V.key==="ArrowDown"){V.preventDefault(),te(me=>Math.min(me+1,se.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),te(me=>Math.max(me-1,0));return}if(V.key==="Enter"){V.preventDefault(),se[Le]&&Fe(se[Le]);return}if(V.key==="Escape"){V.preventDefault(),ue(!1),r("");return}}if(ie&&V.key==="Escape"){V.preventDefault(),le(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!x){V.preventDefault(),mt();return}V.key==="Escape"&&x&&(V.preventDefault(),f())}function On(V){Kt.markInputChange();const me=V.target.value;r(me),Oe(),me.startsWith("/")&&!me.includes(" ")&&!x?(ue(!0),he(me.slice(1)),te(0)):(ue(!1),le(void 0)),me.startsWith("$")&&!x?(Y(!0),A(me.slice(1))):me.startsWith("$")||Y(!1)}const at=mm(v==null?void 0:v.runtime_config),yt=[{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"}],lt=[{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"}],Ft=[{value:"false",label:"Disabled",description:"No network access"},{value:"true",label:"Enabled",description:"Allow network access in sandbox"}];return c.jsxs("div",{className:`cmd-bar${P?" drag-over":""}`,onDragOver:Pe,onDragLeave:Re,onDrop:Me,children:[pe&&!ie&&c.jsx(US,{commands:se,selectedIndex:Le,onSelect:Fe,onHover:te}),pe&&ie==="sandbox"&&c.jsx(ku,{title:"Sandbox Mode",options:yt,currentValue:at.sandboxMode,onSelect:Ue,onClose:()=>le(void 0)}),pe&&ie==="websearch"&&c.jsx(ku,{title:"Web Search",options:lt,currentValue:at.webSearchMode,onSelect:Ue,onClose:()=>le(void 0)}),pe&&ie==="network"&&c.jsx(ku,{title:"Network Access",options:Ft,currentValue:at.networkAccessEnabled===!0?"true":"false",onSelect:Ue,onClose:()=>le(void 0)}),$&&c.jsx(WS,{filter:H,onSelect:_t,onClose:()=>{Y(!1),r("")}}),j.length>0&&c.jsx("div",{className:"skill-badges",children:j.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>X(me=>me.filter(Be=>Be.id!==V.id)),children:"×"})]},V.id))}),b.length>0&&c.jsx("div",{className:"attachment-preview-area",children:b.map(V=>c.jsxs("div",{className:"attachment-chip",title:V.name,children:[V.previewUrl?c.jsx("img",{src:V.previewUrl,alt:V.name,className:"attachment-thumb",onClick:()=>q(V),style:{cursor:"pointer"}}):c.jsx(Zm,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:V.name}),c.jsx("span",{className:"attachment-size",children:gm(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>Se(V.id),title:"Remove attachment",children:c.jsx(Pn,{size:14})})]},V.id))}),L&&!x&&!E&&c.jsx("input",{ref:a,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:V=>{ve(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[L&&!x&&!E&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var V;return(V=a.current)==null?void 0:V.click()},title:"Attach files",disabled:x,children:c.jsx($0,{size:16})}),c.jsx("textarea",{ref:s,className:"cmd-textarea",placeholder:E?"Select or create a session…":T?"Interrupted — waiting to resume…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:x||E,rows:1,style:{minHeight:ri,maxHeight:Su},onChange:On,onKeyDown:Yt,onPaste:Ne}),x?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(fi,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:mt,disabled:!n.trim()||E,title:"Send (⌘↵)",children:c.jsx(y0,{size:16})})]}),K&&c.jsx("div",{className:"image-preview-modal",onClick:()=>q(null),children:c.jsxs("div",{className:"image-preview-content",onClick:V=>V.stopPropagation(),children:[c.jsx("img",{src:K.previewUrl,alt:K.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:K.name}),c.jsx("span",{children:gm(K.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:c.jsx(Pn,{size:20})})]})})]})}function XS(){const n=M(R=>R.activeSessionId),r=M(R=>R.activeSessionId?R.sessionDetails[R.activeSessionId]:null),s=M(R=>R.activeTurnIndex),o=M(R=>R.setActiveTurnIndex),a=M(R=>R.rewindToTurn),u=M(R=>R.restoreSession),f=M(R=>R.branchFromTurn),p=(r==null?void 0:r.turns)??[],m=dl(r),g=!!(r!=null&&r.rewound_at_turn_id),v=(r==null?void 0:r.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.",[x,T]=w.useState(null),E=w.useRef(null);if(pl(E,()=>T(null),!!x),ed(()=>T(null),!!x),p.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(R){o(R),requestAnimationFrame(()=>{var L;(L=document.getElementById(`turn-${R}`))==null||L.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),p.map((R,L)=>{const b=L===s,U=R.user_prompt.length>50?R.user_prompt.slice(0,50)+"…":R.user_prompt,P=R.status==="running"||R.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${b?"active":""}`,onClick:()=>C(L),onContextMenu:W=>{W.preventDefault(),T({x:W.clientX,y:W.clientY,turnId:R.id,turnIndex:L,isLast:L===p.length-1,isSlashCommand:R.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(K0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:U}),P&&c.jsx("span",{className:"turn-item-status",children:R.status==="pending"&&R.resume_state==="waiting"?"interrupted":"running…"})]})},R.id)}),x&&c.jsxs("div",{ref:E,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${x.isLast||m||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||m||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),T(null))},children:[c.jsx(B0,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),g&&!v&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),T(null)},children:[c.jsx(ho,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),T(null)},children:[c.jsx(_0,{size:12})," Branch from Here"]})]})]})}function QS(){const n=M(p=>p.activeSessionId?p.sessionDetails[p.activeSessionId]:null),r=M(p=>p.changesScope),s=M(p=>p.setChangesScope),o=M(p=>p.activeTurnIndex),a=M(p=>p.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Kg(u,r,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${r==="session"?"active":""}`,onClick:()=>s("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${r==="turngroup"?"active":""}`,onClick:()=>s("turngroup"),children:"Current Turn"})]}),f.length===0?c.jsx("div",{className:"empty-state",children:"No file changes in this scope"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Changed Files (",f.length,")"]}),f.map(p=>{const m=p.kind==="add"?"fc-add":p.kind==="delete"?"fc-del":"fc-mod",g=p.kind==="add"?"A":p.kind==="delete"?"D":"M",v=p.path.split("/").pop()||p.path,k=p.path.replace("/"+v,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(p.path),children:[c.jsx("span",{className:`fc-status ${m}`,children:g}),c.jsxs("span",{className:"fc-name",children:[k&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[k,"/"]}),v]})]},p.path)})]})]})}const ym=2e4;function ZS(n){const r=[];return n.forEach((s,o)=>{var a;for(const u of s.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;r.push({item:u,turnIndex:o,turnPrompt:s.user_prompt})}}),r}function JS({entry:n}){const{item:r,turnIndex:s,turnPrompt:o}=n,a=r.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,p=a.description||"",m=a.status||"running",g=a.summary||null,v=a.last_tool_name||null,k=a.token_count||null,x=a.output||"",T=r.status==="in_progress",E=u==="local_agent",C=u==="local_bash",R=E?_u:C?tg:Qm,L=E?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",b=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,U=r.status==="failed"||m==="failed",[P,W]=w.useState(T),[K,q]=w.useState(!1),G=w.useRef(null);w.useEffect(()=>{T&&W(!0)},[T]),w.useEffect(()=>{P&&T&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[P,T,x]);const ce=x.length>ym,pe=ce&&!K?x.slice(0,ym)+`
442
- … (truncated, click to expand)`:x,ue=T?null:m==="completed"?c.jsx(ts,{size:12}):U?c.jsx(hl,{size:12}):c.jsx(fi,{size:12});return c.jsxs("div",{className:`task-card ${T?"task-running":""} ${U?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(de=>!de),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(R,{size:14})}),c.jsx("span",{className:"task-card-type",children:L}),c.jsxs("span",{className:`task-card-status ${U?"task-status-failed":T?"task-status-running":"task-status-done"}`,children:[ue," ",b]}),c.jsx(rd,{size:14,className:"task-card-chevron",style:{transform:P?"rotate(90deg)":"none",marginLeft:"auto"}})]}),p&&c.jsx("div",{className:"task-card-desc",children:p}),T&&v&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),P&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:G,children:c.jsx("code",{children:pe})}),ce&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>q(de=>!de),children:K?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):g?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:g})}):T?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",s+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const eT=w.memo(JS);function tT(){var m,g;const n=M(v=>v.activeSessionId?v.sessionDetails[v.activeSessionId]:null),r=M(v=>v.activeSessionId?v.backgroundTasks[v.activeSessionId]:void 0),s=(n==null?void 0:n.turns)??[],o=r??[],a=ZS(s),u=[...a].sort((v,k)=>{const x=v.item.status==="in_progress",T=k.item.status==="in_progress";return x&&!T?-1:!x&&T?1:k.turnIndex-v.turnIndex}),f=new Map;for(const v of o)v.task_type==="local_bash"&&f.set(v.task_id,v.task_type);for(const v of a)if(v.item.status==="in_progress"){const k=((m=v.item.data)==null?void 0:m.task_id)??v.item.external_item_id,x=((g=v.item.data)==null?void 0:g.task_type)??"unknown";f.set(k,x)}const p=[...f.values()].filter(v=>v==="local_bash").length;return a.length===0?c.jsx("div",{className:"empty-state",children:"No background tasks yet"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Background Tasks (",a.length,")",p>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",p," running"]})]}),u.map(v=>c.jsx(eT,{entry:v},v.item.id))]})}const nT=w.memo(tT);function rT({thread:n,onClose:r}){const{activeSessionId:s,resolveThread:o,shareThread:a}=M(),[u,f]=w.useState(""),[p,m]=w.useState(!1),[g,v]=w.useState(!1);async function k(){if(!s||p)return;m(!0),await a(s,n.id,u)?r():m(!1)}async function x(){!s||g||(v(!0),await o(s,n.id),r())}const T=p||g;return c.jsx("div",{className:"dialog-overlay",onClick:T?void 0:r,children:c.jsxs("div",{className:"dialog",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Resolve thread"}),c.jsx("button",{className:"dialog-close",onClick:r,disabled:T,children:c.jsx(Pn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.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."}),c.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",c.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:E=>f(E.target.value),rows:3,disabled:T,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:T,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:T,title:"Resolve without sharing",children:[g?c.jsx(sr,{size:13,className:"spin"}):c.jsx(Ya,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:T,children:[p?c.jsx(sr,{size:13,className:"spin"}):c.jsx(H0,{size:13}),p?"Summarizing…":"Share & Resolve"]})]})]})})}const xm=[];qe.setOptions({breaks:!0,gfm:!0});function sT(n){const r=qe.parse(n);return kd.sanitize(r)}function iT(n){var r,s,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(r=n.data)==null?void 0:r.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((s=n.data)==null?void 0:s.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
443
-
444
- `):null}return null}function oT(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function aT({turn:n}){const r=oT(n.user_prompt),s=n.items.map(iT).filter(o=>o!==null);return s.length===0&&n.status==="completed"&&n.agent_response&&s.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:r}),s.map((o,a)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:sT(o)}},a)),s.length===0&&(n.status==="pending"||n.status==="running")&&c.jsx("div",{className:"thread-card-pending",children:n.status==="running"?"AI is responding…":"Waiting…"}),n.status==="failed"&&c.jsx("div",{className:"thread-card-pending",children:n.error||"Turn failed"})]})}function lT({thread:n,threadTurns:r,onStop:s,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:p}){var he,Le,te;const[m,g]=w.useState(""),[v,k]=w.useState(!0),x=w.useRef(null),T=w.useRef(null),[E,C]=w.useState(!1),[R,L]=w.useState({x:0,y:0}),[b,U]=w.useState(""),P=r.some(Ts),W=28,K=120,q=w.useRef(W);w.useEffect(()=>{const ie=T.current;ie&&(ie.scrollTop=ie.scrollHeight)},[r.length,v]);function G(ie){const le=x.current;le&&(le.style.height=`${ie}px`,q.current=ie)}function ce(){const ie=x.current;if(ie){if(ie.scrollHeight>ie.clientHeight){const le=Math.min(ie.scrollHeight,K);le!==q.current&&G(le);return}q.current>W&&(ie.style.height="auto",G(Math.min(ie.scrollHeight,K)))}}const pe=w.useCallback(()=>{C(!1)},[]),ue=w.useCallback(()=>{const ie=T.current;if(!ie)return;const le=window.getSelection();if(!le||le.rangeCount===0||le.isCollapsed){C(!1);return}const $=le.getRangeAt(0);if(!ie.contains($.commonAncestorContainer)){C(!1);return}const Y=$.commonAncestorContainer.nodeType===Node.TEXT_NODE?$.commonAncestorContainer.parentElement:$.commonAncestorContainer;if(!(Y!=null&&Y.closest(".thread-card-ai-response"))){C(!1);return}const H=le.toString();if(!H.trim()){C(!1);return}const A=$.getBoundingClientRect(),j=28,X=6,se=170;let ve=!1;if(le.anchorNode&&le.focusNode)try{const Re=document.createRange();Re.setStart(le.focusNode,le.focusOffset),Re.setEnd(le.focusNode,le.focusOffset);const Me=document.createRange();Me.setStart(le.anchorNode,le.anchorOffset),Me.setEnd(le.anchorNode,le.anchorOffset),ve=Me.compareBoundaryPoints(Range.START_TO_START,Re)>0}catch{ve=!1}let Se=A.top-j-X;Se<8&&(Se=A.bottom+X);let Pe=ve?A.left-se:A.right;Pe=Math.max(8,Math.min(Pe,window.innerWidth-se-8)),L({x:Pe,y:Se}),U(H),C(!0)},[]);w.useEffect(()=>{function ie(le){const $=le.target;$&&$.closest(".selection-actions")||ue()}return document.addEventListener("mouseup",ie),()=>document.removeEventListener("mouseup",ie)},[ue]);const de=w.useCallback(()=>{var le;const ie=`
445
- \`\`\`QUOTE
446
- ${b}
447
- \`\`\`
448
-
449
- `;g($=>$+ie),C(!1),U(""),(le=window.getSelection())==null||le.removeAllRanges(),setTimeout(()=>{if(x.current){ce(),x.current.focus();const $=x.current.value.length;x.current.setSelectionRange($,$)}},0)},[b]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(ie=>!ie),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((te=(Le=(he=n.turns)==null?void 0:he[0])==null?void 0:Le.user_prompt)==null?void 0:te.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),c.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&c.jsx("button",{className:"thread-locate-btn",onClick:ie=>{ie.stopPropagation(),p()},title:"Scroll to text",children:c.jsx(z0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),v&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:T,onMouseDown:pe,children:[r.map(ie=>c.jsx(aT,{turn:ie},ie.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:R.x,top:R.y},children:c.jsxs("button",{className:"discuss-button",onClick:de,title:"Quote this text in your follow-up",children:[c.jsx(Jm,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:P?"Agent is running…":"Type a follow-up…",value:m,onChange:ie=>{Kt.markInputChange(),g(ie.target.value),ce()},disabled:P,rows:1,style:{minHeight:W,maxHeight:K},onKeyDown:ie=>{Kt.markKeystroke(),ie.key==="Enter"&&(ie.metaKey||ie.ctrlKey)&&!P&&m.trim()&&(ie.preventDefault(),f(m.trim()),g(""),G(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:P||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(ml,{size:13})}),P&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(fi,{size:13})})]}),c.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?c.jsxs("button",{className:"thread-action-btn",onClick:o,title:"Resolve thread",children:[c.jsx(Ya,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(ho,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(gr,{size:13})," Delete"]})]})]})]})}function cT(){Kt.trackRender("ThreadsPanel");const n=M(b=>b.activeSessionId),r=M(b=>{var U;return b.activeSessionId?((U=b.sessionDetails[b.activeSessionId])==null?void 0:U.threads)??xm:xm}),s=M(b=>b.followupThread),o=M(b=>b.cancelThreadTurn),a=M(b=>b.reopenThread),u=M(b=>b.deleteThread),f=M(b=>b.activeRightTab),p=M(b=>b.switchRightTab),m=M(b=>b.deepLinkThreadId),g=M(b=>b.setDeepLinkThreadId),[v,k]=w.useState("open"),[x,T]=w.useState(null);w.useEffect(()=>{if(!m)return;const b=m;g(null),k(P=>r.some(W=>W.id===b&&W.status==="open")?P:"all");const U=setTimeout(()=>{const P=document.getElementById(`thread-${b}`);P&&(P.scrollIntoView({behavior:"smooth",block:"center"}),P.classList.add("thread-card-highlighted"),setTimeout(()=>P.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(U)},[m,g,r]);const E=r.filter(b=>v==="open"?b.status==="open":v==="resolved"?b.status==="resolved":!0),C=r.filter(b=>b.status==="open").length,R=r.filter(b=>b.status==="resolved").length;function L(b){f==="changes"&&p("turns"),setTimeout(()=>{const U=document.querySelector(`mark[data-thread-id="${b}"]`);U&&(U.scrollIntoView({behavior:"smooth",block:"center"}),U.classList.add("thread-mark-flash"),setTimeout(()=>U.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(P0,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"No threads yet."}),c.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):c.jsxs("div",{children:[c.jsxs("div",{className:"thread-filter-tabs",children:[c.jsxs("button",{className:`thread-filter-tab ${v==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${v==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",R,")"]}),c.jsxs("button",{className:`thread-filter-tab ${v==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",r.length,")"]})]}),E.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",v," threads."]}):E.map(b=>c.jsx(lT,{thread:b,threadTurns:b.turns??[],onStop:()=>o(n,b.id),onResolve:()=>T(b),onReopen:()=>a(n,b.id),onDelete:()=>u(n,b.id),onFollowup:U=>s(n,b.id,U),onLocate:()=>L(b.id)},b.id)),x&&c.jsx(rT,{thread:x,onClose:()=>T(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function uT(){const n=M(f=>f.apps),r=M(f=>f.activeAppTabId),s=M(f=>f.openAppTab),o=M(f=>f.startAppEdit),a=M(f=>f.toggleAppPin),u=M(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${r===f.id?" active":""}`,onClick:()=>s(f.id),title:f.description??void 0,children:[c.jsx("span",{className:"sidebar-app-icon",children:f.icon??"◧"}),c.jsxs("div",{className:"apps-panel-info",children:[c.jsx("span",{className:"apps-panel-title",children:f.title}),f.description&&c.jsx("span",{className:"apps-panel-desc",children:f.description})]}),c.jsx("button",{className:"apps-panel-action",title:"Edit app with the agent",onClick:p=>{p.stopPropagation(),o(f.id)},children:c.jsx($a,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:p=>{p.stopPropagation(),a(f.id)},children:c.jsx(Xa,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:p=>{p.stopPropagation(),u(f.id)},children:c.jsx(gr,{size:12})})]},f.id))})}function dT(){var f;Kt.trackRender("RightPanel");const n=M(p=>p.activeRightTab),r=M(p=>p.switchRightTab),s=M(p=>p.activeSessionId?p.sessionDetails[p.activeSessionId]:null),o=M(p=>{var m;return p.activeSessionId?((m=p.backgroundTasks[p.activeSessionId])==null?void 0:m.length)??0:0}),a=((f=s==null?void 0:s.threads)==null?void 0:f.filter(p=>p.status==="open").length)??0,u=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:o||void 0},{id:"threads",label:"Threads",badge:a||void 0},{id:"apps",label:"Apps"}];return c.jsxs("div",{className:"ide-right",children:[c.jsx("div",{className:"right-tabs",children:u.map(p=>c.jsxs("div",{className:`right-tab ${n===p.id?"active":""}`,onClick:()=>r(p.id),children:[p.label,p.badge?c.jsx("span",{className:"right-tab-badge",children:p.badge}):null]},p.id))}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(XS,{}),n==="changes"&&c.jsx(QS,{}),n==="tasks"&&c.jsx(nT,{}),n==="threads"&&c.jsx(cT,{}),n==="apps"&&c.jsx(uT,{})]})]})}const Ae={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"}},Uu=[{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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.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:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]}]}];function fT(n){return Uu.find(r=>r.id===n)}function Sd(n){const r=fT(n);return(r==null?void 0:r.models)??[]}function Yg(n,r){return Sd(n).find(s=>s.slug===r)}function Bu(n,r){var s;return((s=Yg(n,r))==null?void 0:s.reasoningLevels)??[]}function Wu(n,r){var s;return(s=Yg(n,r))==null?void 0:s.defaultReasoning}function pT(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=M(),o=M(te=>te.showModelSelector),a=M(te=>te.setShowModelSelector),u=r.find(te=>te.id===n),f=M(te=>te.models),p=M(te=>te.modelsLoading),m=M(te=>te.loadModels),[g,v]=w.useState(!1),k=w.useRef(null);if(pl(k,()=>v(!1),g),ed(()=>v(!1),g),w.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&m(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,m]),!u)return null;const x=u.runtime_type,T=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],R=Sd(x),b=[...C.length>0?C:R];if(T&&!b.some(te=>te.slug===T)){const te=R[0];b.unshift({slug:T,displayName:T,description:"Custom model",defaultReasoning:(te==null?void 0:te.defaultReasoning)??"medium",reasoningLevels:(te==null?void 0:te.reasoningLevels)??[]})}function U(te){return b.find(ie=>ie.slug===te)}function P(te){var ie;return C.length>0?((ie=U(te))==null?void 0:ie.reasoningLevels)??[]:Bu(x,te)}function W(te){var ie;return C.length>0?(ie=U(te))==null?void 0:ie.defaultReasoning:Wu(x,te)}const K=Uu.find(te=>te.id===x),q=U(T),G=T?P(T):[],ce=(K==null?void 0:K.label)??x,pe=(q==null?void 0:q.displayName)??(T||"Default"),ue=G.find(te=>te.effort===E),de=(ue==null?void 0:ue.label)??(E||"Default");function he(te){var Y;const ie=P(te),$=ie.some(H=>H.effort===E)?E:W(te)??((Y=ie[0])==null?void 0:Y.effort)??"";s(te,$),v(!1)}function Le(te){s(T,te),v(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!g),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ce}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:pe}),de!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:de})]}),c.jsx(ci,{size:12,className:"model-selector-chevron"})]}),g&&c.jsxs("div",{className:"model-selector-popover",children:[c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Uu.map(te=>c.jsxs("div",{className:`model-selector-item ${te.id===x?"selected":""} ${te.available?"":"disabled"}`,onClick:()=>{if(te.available){if(te.id===x){v(!1);return}s("","",te.id)}},children:[c.jsx("span",{children:te.label}),!te.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(M0,{size:10})," Soon"]}),te.id===x&&c.jsx(ts,{size:12})]},te.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),p&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!p&&b.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),b.map(te=>c.jsxs("div",{className:`model-selector-item ${te.slug===T?"selected":""}`,onClick:()=>he(te.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:te.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:te.description})]}),te.slug===T&&c.jsx(ts,{size:12})]},te.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),G.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),G.map(te=>c.jsxs("div",{className:`model-selector-item ${te.effort===E?"selected":""}`,onClick:()=>Le(te.effort),children:[c.jsx("span",{children:te.label}),te.effort===E&&c.jsx(ts,{size:12})]},te.effort))]})]})]})}function no(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function wm(){const n=M(r=>r.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(X0,{size:14})," Repoburg"]})}function km(){const n=M(s=>s.vscodeViewOpen),r=M(s=>s.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[c.jsx(T0,{size:14})," Code"]})}function hT(){var x,T;Kt.trackRender("StatusBar");const n=M(E=>E.activeSessionId),r=M(E=>n?E.sessions.find(C=>C.id===n)??null:null),s=M(E=>n?E.sessionDetails[n]??null:null),o=M(E=>n?E.backgroundTasks[n]:void 0),a=M(E=>E.wsConnected),u=M(E=>E.switchRightTab),f=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(wm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(km,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(xh,{size:14})," K"]})]});const p=o??[],m=fl(r,p.length),g=new Set,v=new Map;for(const E of p)g.add(E.task_id),v.set(E.task_id,E.task_type);for(const E of(s==null?void 0:s.turns)??[])for(const C of E.items)if(C.type==="background_task"&&C.status==="in_progress"){const R=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,L=((T=C.data)==null?void 0:T.task_type)??"unknown";g.add(R),v.set(R,L)}const k=[...v.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(wm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(km,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(pT,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[c.jsx(ng,{size:14})," ",k]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:m.dot==="background"?{color:"var(--purple)"}:r.status==="failed"?{color:"var(--red)"}:void 0,title:m.dot==="background"?m.dotTitle:void 0,children:m.label}),f&&c.jsx(mT,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(xh,{size:14})," K"]})]})}function mT({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${no(n.totalTokens)} / ${no(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${no(n.autoCompactThreshold)}`:"");return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:s,children:c.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",no(n.totalTokens)," / ",no(n.contextWindow)]})})]})}function Sm(n){return yn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function gT(n){return Et("/vscode-web/start",{folder:n})}function vT(n){return Et("/vscode-web/heartbeat",{id:n})}const yT=1e3,xT=5*6e4;function Tm({children:n}){const r=M(s=>s.toggleVscodeView);return c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[n,c.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:r,children:c.jsx(Pn,{size:16})})]})}function wT(){const n=M(E=>E.vscodeState),r=M(E=>E.vscodeId),s=M(E=>E.vscodeToken),o=M(E=>E.setVscodeView),a=M(E=>{var R;const C=E.activeSessionId?E.sessions.find(L=>L.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((R=E.workspaces.find(L=>L.deleted===0))==null?void 0:R.path)??null}),[u,f]=w.useState(!1),[p,m]=w.useState(0),g=w.useRef(null),v=ir(),k=v===""||v===window.location.origin,x=`${v}/vscode/${r??""}/?tkn=${s??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){g.current&&(clearInterval(g.current),g.current=null)}async function R(){try{let b=await Sm(a);if((b.state==="stopped"||b.state==="error")&&(b=await gT(a)),E||(o(b.state,b.id,b.token),b.state==="running"||b.state==="error"))return;g.current=setInterval(async()=>{const U=await Sm(a);E||(o(U.state,U.id,U.token),(U.state==="running"||U.state==="error"||U.state==="stopped")&&C())},yT)}catch{E||o("error",null,null)}}R();const L=setInterval(()=>{const b=M.getState().vscodeId;b&&vT(b).catch(()=>{})},xT);return()=>{E=!0,C(),clearInterval(L)}},[p,a,o]);function T(){f(!1),o("starting",null,null),m(E=>E+1)}return n!=="running"||!s||!r?c.jsx(Tm,{children:n==="error"?c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"VS Code could not start."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:T,children:[c.jsx(ho,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(sr,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(sr,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]}):c.jsxs(Tm,{children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[c.jsx(N0,{size:14})," Open VS Code in a new tab"]})]})}const kT=`(function () {
450
- var nextId = 1;
451
- var pending = new Map();
452
- var listeners = [];
453
- // Absolute http(s) URL, or null. Relative and #fragment hrefs are not
454
- // external and keep their in-frame behavior.
455
- function externalUrl(raw) {
456
- if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
457
- try { return new URL(raw.trim()).href; } catch (err) { return null; }
458
- }
459
- // New browser tab. The sandbox lets popups escape it, so the page loads
460
- // like any other tab; noopener leaves it no handle back to this frame.
461
- function openTab(url) {
462
- window.open(url, '_blank', 'noopener,noreferrer');
463
- }
464
- // A plain external link would navigate THIS frame: the app disappears and
465
- // most sites refuse to be framed anyway. Open it in a new tab instead.
466
- // Bubble phase on window, so the app's own handlers run first and can
467
- // still claim the click with preventDefault(). Modifier clicks and
468
- // target="_blank" links already open a tab natively.
469
- window.addEventListener('click', function (e) {
470
- if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
471
- var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
472
- if (!a) return;
473
- var target = (a.getAttribute('target') || '').toLowerCase();
474
- if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
475
- var url = externalUrl(a.getAttribute('href'));
476
- if (!url) return;
477
- e.preventDefault();
478
- openTab(url);
479
- });
480
- window.addEventListener('message', function (e) {
481
- var msg = e.data;
482
- if (!msg || msg.source !== 'agentpane-host') return;
483
- if (msg.id != null && pending.has(msg.id)) {
484
- var p = pending.get(msg.id);
485
- pending.delete(msg.id);
486
- if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
487
- } else if (msg.event) {
488
- for (var i = 0; i < listeners.length; i++) {
489
- try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
490
- }
491
- }
492
- });
493
- function call(method, params) {
494
- return new Promise(function (resolve, reject) {
495
- var id = nextId++;
496
- pending.set(id, { resolve: resolve, reject: reject });
497
- parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
498
- });
499
- }
500
- window.AgentPane = {
501
- getApp: function () { return call('getApp'); },
502
- getState: function () { return call('getState'); },
503
- setState: function (data) { return call('setState', { data: data }); },
504
- createSession: function (opts) { return call('createSession', opts); },
505
- submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
506
- onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
507
- onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
508
- onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
509
- onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
510
- resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
511
- openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
512
- openUrl: function (url) {
513
- var href = externalUrl(url);
514
- if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
515
- try { openTab(href); } catch (err) { return Promise.reject(err); }
516
- return Promise.resolve({ ok: true });
517
- }
518
- };
519
- // Runtime error reporting — surface compile checks' blind side to the pane.
520
- window.addEventListener('error', function (e) {
521
- parent.postMessage({
522
- source: 'agentpane-app', report: 'error',
523
- message: e.message || 'Unknown error',
524
- stack: (e.error && e.error.stack) || '',
525
- line: e.lineno || 0, col: e.colno || 0
526
- }, '*');
527
- });
528
- window.addEventListener('unhandledrejection', function (e) {
529
- var r = e.reason;
530
- var msg = r && (r.message || String(r)) || 'unknown';
531
- parent.postMessage({
532
- source: 'agentpane-app', report: 'error',
533
- message: 'Unhandled promise rejection: ' + msg,
534
- stack: (r && r.stack) || '', line: 0, col: 0
535
- }, '*');
536
- });
537
- })();`;function bm(n){return n.replace(/<\/script/gi,"<\\/script")}function ST(n,r){const s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(s,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function Nm(n,r,s){const o=ST(n,r);return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function TT(n,r,s){let o=n;const a=`<script>${bm(r)}<\/script>`;if(/<\/head>/i.test(o)?o=Nm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${bm(s)}<\/script>`;o=Nm(o,"</body>",u)}return o}function bT({appId:n,workspace:r=""}){const s=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,p]=w.useState(null),[m,g]=w.useState([]);w.useEffect(()=>{let x=!0;Nx(n,E=>{var C,R;return(R=(C=s.current)==null?void 0:C.contentWindow)==null?void 0:R.postMessage(E,"*")});const T=async E=>{var U,P,W,K,q,G,ce,pe,ue;if(E.source!==((U=s.current)==null?void 0:U.contentWindow))return;const C=E.data;if(!C||C.source!=="agentpane-app")return;if(C.report==="error"){const de={message:String(C.message??"Unknown error"),stack:String(C.stack??"")};g(he=>{const Le=he[he.length-1];return Le&&Le.message===de.message?he:[...he,de].slice(-20)});return}if(typeof C.method!="string")return;let R=!0,L,b;try{switch(C.method){case"getApp":L={id:n};break;case"getState":L=o.current;break;case"setState":{const de=((P=C.params)==null?void 0:P.data)??null,he=await Hm(n,{data:de},r);o.current=he,L=he;break}case"createSession":{const de=C.params??{},he=await qu({title:typeof de.title=="string"?de.title:void 0,runtime_type:typeof de.runtime_type=="string"?de.runtime_type:void 0,model:typeof de.model=="string"?de.model:void 0,model_reasoning_effort:typeof de.model_reasoning_effort=="string"?de.model_reasoning_effort:void 0,cwd:typeof de.cwd=="string"?de.cwd:void 0,origin_app_id:n});iu(he.id,n),M.getState().addSession(he),L=he;break}case"submitTurn":{const de=String(((W=C.params)==null?void 0:W.sessionId)??""),he=String(((K=C.params)==null?void 0:K.prompt)??""),Le=await Om(de,he);iu(de,n),L=Le;break}case"resolveToolCall":{const de=String(((q=C.params)==null?void 0:q.callId)??""),he=(G=C.params)==null?void 0:G.result;await Zx(de,he),L={ok:!0};break}case"openSession":{if(M.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const de=typeof((ce=C.params)==null?void 0:ce.sessionId)=="string"?C.params.sessionId.trim():"";if(!de)throw new Error("openSession: sessionId is required");try{await M.getState().revealSession(de)}catch(he){throw new Error(`openSession: ${he instanceof Error?he.message:String(he)}`)}L={ok:!0};break}default:throw new Error(`Unknown bridge method: ${C.method}`)}}catch(de){R=!1,b=de instanceof Error?de.message:String(de)}(ue=(pe=s.current)==null?void 0:pe.contentWindow)==null||ue.postMessage({source:"agentpane-host",id:C.id,ok:R,result:L,error:b},"*")};return window.addEventListener("message",T),Ax(n,()=>{mh(n,r).then(E=>{x&&(o.current=E)}).catch(()=>{})}),jx(n,()=>{hh(n).then(E=>{x&&(u(E),g([]))}).catch(()=>{})}),(async()=>{try{const[E,C,R]=await Promise.all([hh(n),mh(n,r),Gx(n).catch(()=>[])]);if(!x)return;o.current=C,R.forEach(L=>iu(L.id,n)),u(E)}catch(E){x&&p(E instanceof Error?E.message:String(E))}})(),()=>{x=!1,Cx(n),Rx(n),Ix(n),window.removeEventListener("message",T)}},[n,r]);const v=w.useMemo(()=>a?TT(a.html,kT,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),k.map((x,T)=>c.jsxs("div",{className:"miniapp-diag",children:[x.file,":",x.line,":",x.column," — ",x.message]},T))]}),c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${n}`,srcDoc:v}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((x,T)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:x.message}),x.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:x.stack})]},T))})]})}function NT({appId:n,active:r}){const s=M(x=>x.apps),o=M(x=>x.workspaces),a=M(x=>x.appWorkspaces),u=M(x=>x.setAppWorkspace),f=M(x=>x.setActiveAppTab),p=M(x=>x.startAppEdit),m=s.find(x=>x.id===n),g=a[n]??"",v=o.filter(x=>x.deleted!==1),k=g!==""&&!v.some(x=>x.path===g)?g:null;return c.jsxs("div",{className:`miniapp-view ${r?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(m==null?void 0:m.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(m==null?void 0:m.title)??n}),c.jsxs("select",{className:"miniapp-workspace-select",title:"Workspace this app instance is bound to (state and pinning are scoped per workspace)",value:g,onChange:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(x=>c.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void p(n),children:[c.jsx(F0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Pn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(bT,{appId:n,workspace:g},`${n}:${g}`)})]})}function CT({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),p=w.useRef(0),m=w.useRef(0),g=w.useCallback(x=>{const T=x.clientX-p.current,E=n==="left"?m.current+T:m.current-T,C=Math.min(s,Math.max(r,E));a(C)},[n,r,s,a]),v=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(x=>{var T,E;x.preventDefault(),x.stopPropagation();try{(E=(T=x.currentTarget)==null?void 0:T.setPointerCapture)==null||E.call(T,x.pointerId)}catch{}p.current=x.clientX,m.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",v)},[o,g,v]),dragging:u}}function Cm({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=CT({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function ET(){Kt.trackRender("IdeWorkspace");const n=M(m=>m.sidebarWidth),r=M(m=>m.rightPanelWidth),s=M(m=>m.setSidebarWidth),o=M(m=>m.setRightPanelWidth),a=M(m=>m.vscodeViewOpen),u=M(m=>m.activeAppTabId),f=M(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const g=Ha(),{rightPanelWidth:v,setRightPanelWidth:k}=M.getState();v>g&&k(g)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const p=`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:p},children:[c.jsx(qk,{}),c.jsx(Cm,{side:"left",minWidth:bu,maxWidth:Nu,getWidth:()=>M.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(Gk,{}),c.jsxs("div",{className:"ide-render",children:[f.map(m=>c.jsx(NT,{appId:m,active:u===m},m)),u==null&&c.jsx(OS,{})]}),c.jsx(YS,{})]}),c.jsx(Cm,{side:"right",minWidth:Wa,maxWidth:Ha(),getWidth:()=>M.getState().rightPanelWidth,setWidth:o}),c.jsx(dT,{})]}),a&&c.jsx(wT,{}),c.jsx(hT,{})]})}function _T(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=M(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[p,m]=w.useState(""),[g,v]=w.useState(u),[k,x]=w.useState(f),[T,E]=w.useState("");if(!n)return null;const C=Sd(a),R=g?Bu(a,g):[];function L(){s({title:p.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:T.trim()||void 0,runtime_type:a}),m(""),E("")}function b(P){P.key==="Escape"&&r(!1)}function U(P){var q;v(P);const W=Bu(a,P);W.some(G=>G.effort===k)||x(Wu(a,P)??((q=W[0])==null?void 0:q.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:b,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Pn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsxs("label",{className:"dialog-label",children:["Title (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:p,onChange:P=>m(P.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Model",c.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:P=>U(P.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(P=>c.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),R.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Wu(a,g),")"]}),R.map(P=>c.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:T,onChange:P=>E(P.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:L,children:"Create"})]})]})})}const jT=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,RT=512*1024;function AT(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function IT(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=M(),[f,p]=w.useState("examples"),[m,g]=w.useState(null),[v,k]=w.useState(null),[x,T]=w.useState(!1),[E,C]=w.useState(""),[R,L]=w.useState(""),[b,U]=w.useState(""),[P,W]=w.useState(""),[K,q]=w.useState(null),[G,ce]=w.useState(""),pe=w.useRef(null);if(w.useEffect(()=>{n&&(g(null),Kx().then(g).catch(()=>g([])))},[n]),w.useEffect(()=>{pe.current&&(pe.current.webkitdirectory=!0)},[f]),!n)return null;const ue=new Set(s.map($=>$.id));async function de($){k($);try{await o($)&&r()}finally{k(null)}}async function he(){if(x)return;const $=E.trim(),Y=R.trim();if(!(!$||!Y)){T(!0);try{await a({id:$,title:Y,description:b.trim()||void 0,icon:P.trim()||void 0})&&(C(""),L(""),U(""),W(""),r())}finally{T(!1)}}}async function Le($){const Y=Array.from($.target.files??[]),H={};let A="";for(const j of Y){const se=(j.webkitRelativePath??"").split("/");!A&&se.length>1&&(A=se[0]);const ve=se[se.length-1];if(!(!ve||!jT.test(ve))&&!(j.size>RT))try{H[ve]=await j.text()}catch{}}q(Object.keys(H).length>0?H:null),ce(AT(A))}async function te(){if(!(x||!K||!G.trim())){T(!0);try{await u(G.trim(),K)&&(q(null),ce(""),r())}finally{T(!1)}}}function ie($){$.key==="Escape"&&r()}const le=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:r,children:c.jsxs("div",{className:"dialog app-catalog",onClick:$=>$.stopPropagation(),onKeyDown:ie,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:r,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:le.map($=>c.jsx("button",{className:`catalog-tab${f===$.key?" active":""}`,onClick:()=>p($.key),children:$.label},$.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:m===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):m.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):m.map($=>{const Y=ue.has($.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:$.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:$.title}),$.description&&c.jsx("span",{className:"example-desc",children:$.description})]}),c.jsx("button",{className:"example-install",disabled:Y||v===$.id,onClick:()=>de($.id),title:Y?"Already installed":"Install this example",children:Y?"Installed":v===$.id?"Installing…":"Install"})]},$.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:$=>C($.target.value),placeholder:"e.g. todo-list",autoFocus:!0})]}),c.jsxs("label",{className:"dialog-label",children:["Title",c.jsx("input",{className:"dialog-input",type:"text",value:R,onChange:$=>L($.target.value),placeholder:"e.g. Todo List"})]}),c.jsxs("label",{className:"dialog-label",children:["Description (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:b,onChange:$=>U($.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:["Icon (optional, emoji)",c.jsx("input",{className:"dialog-input",type:"text",value:P,onChange:$=>W($.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!R.trim(),onClick:he,children:[c.jsx(Ss,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.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."}),c.jsx("input",{ref:pe,type:"file",multiple:!0,onChange:Le}),K&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:G,onChange:$=>ce($.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(K).length," file(s):"," ",Object.keys(K).slice(0,6).join(", "),Object.keys(K).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!K||!G.trim(),onClick:te,children:[c.jsx(G0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function DT(){const n=M(k=>k.showCommandPalette),r=M(k=>k.setShowCommandPalette),s=M(),[o,a]=w.useState(""),[u,f]=w.useState(0),p=w.useRef(null),m=w.useMemo(()=>{const k=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,x=dl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Ss,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:gr,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ml,action:()=>{const T=document.querySelector(".cmd-input");T==null||T.focus()},available:!!s.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:fi,action:()=>s.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:D0,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:C0,action:()=>s.switchRightTab("changes"),available:!!s.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Pn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),g=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=m.filter(T=>T.available);return k?x.filter(T=>T.label.toLowerCase().includes(k)||T.hint.toLowerCase().includes(k)):x},[m,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=p.current)==null?void 0:k.focus()},50))},[n]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=g[u];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:p,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:v}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:g.map((k,x)=>{const T=k.icon;return c.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(T,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&c.jsx(b0,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Em=/^[a-z][a-z0-9-]{1,30}$/,MT=2e3;function LT(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=M(),[o,a]=w.useState(null),[u,f]=w.useState(null),[p,m]=w.useState(!1),[g,v]=w.useState(!1),[k,x]=w.useState(!1),[T,E]=w.useState(!1),[C,R]=w.useState("main"),[L,b]=w.useState(""),[U,P]=w.useState(!1),[W,K]=w.useState(null),q=w.useRef(null);pl(q,()=>E(!1),T);const G=g||k,ce=w.useCallback(async()=>{m(!0),f(null);try{const $=await fetch(`${ir()}/remote/status`,{headers:{Accept:"application/json"}});if(!$.ok)throw new Error(`status ${$.status}`);a(await $.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(R("main"),K(null),ce())},[n,ce]);const pe=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!pe)return;const $=setInterval(async()=>{try{const Y=await fetch(`${ir()}/remote/enable`,{headers:{Accept:"application/json"}});Y.ok&&K(await Y.json())}catch{}},MT);return()=>clearInterval($)},[pe]),!n)return null;const ue=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function de($){$.key==="Escape"&&r(!1)}async function he($){if(Em.test($)){P(!0);try{const Y=await fetch(`${ir()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:$})});if(!Y.ok)throw new Error(`enable ${Y.status}`);K(await Y.json()),R("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Le(){W!=null&&W.troubleshootingSessionId&&(s(W.troubleshootingSessionId),r(!1))}async function te(){v(!0);try{await fetch(`${ir()}/remote/disable`,{method:"POST"}),await ce()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function ie(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
538
-
539
- This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
540
-
541
- This cannot be undone.`)){x(!0);try{const Y=await fetch(`${ir()}/remote/uninstall`,{method:"DELETE"});if(!Y.ok)throw new Error(`uninstall ${Y.status}`);await ce()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function le(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:L,onChange:A=>b(A.target.value.toLowerCase()),placeholder:"my-macbook",autoFocus:!0})]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The machine will be reachable at https://<name>.repoburg.com"}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>R("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!Em.test(L)||U,onClick:()=>void he(L),children:[U?c.jsx(sr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const $=["detect","provision","install","verify","ready"],Y=$.indexOf(W.step),H=W.state==="ready";return c.jsxs(c.Fragment,{children:[W.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(sr,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),W.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(ts,{size:14})," Setup complete — you can close this window."]}),W.state==="ready"&&W.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${W.hostname}`,target:"_blank",rel:"noreferrer",children:W.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:$.map((A,j)=>{const X=H||Y>-1&&j<Y,se=!H&&j===Y&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:X||se?1:.4,color:X?"var(--green)":void 0},children:[X?c.jsx(ts,{size:13}):se?c.jsx(sr,{size:13,className:"spin"}):c.jsx(S0,{size:9,style:{marginLeft:2,marginRight:2}}),A]},A)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(A=>A.message).join(`
542
- `)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.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."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Le,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ce(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:$=>$.stopPropagation(),onKeyDown:de,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Pn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[p&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(sr,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?le():c.jsxs(c.Fragment,{children:[ue&&(o==null?void 0:o.tunnel.hostname)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["This machine is reachable at"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})]}),c.jsxs("div",{style:{position:"relative",display:"flex",marginTop:8},children:[c.jsxs("button",{className:"dialog-btn-cancel",style:{flex:1,borderTopRightRadius:0,borderBottomRightRadius:0},onClick:()=>void te(),disabled:G,children:[g?c.jsx(sr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>E($=>!$),disabled:G,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":T,children:k?c.jsx(sr,{size:14,className:"spin"}):c.jsx(ci,{size:14})}),T&&c.jsx("div",{ref:q,className:"ctx-menu",role:"menu",style:{position:"absolute",right:0,top:"calc(100% + 4px)",zIndex:10},children:c.jsxs("div",{className:"ctx-menu-item ctx-danger",role:"menuitem",onClick:()=>void ie(),children:[c.jsx(gr,{size:12})," Remove tunnel"]})})]})]}),!ue&&c.jsx(c.Fragment,{children:o!=null&&o.tunnel.provisioned&&o.tunnel.mahlas&&o.tunnel.hostname?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"dialog-label",children:["Tunnel exists as"," ",c.jsx("a",{href:`https://${o.tunnel.hostname}`,target:"_blank",rel:"noreferrer",children:o.tunnel.hostname})," ","but the connection is stopped."]}),c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>void he(o.tunnel.mahlas),disabled:U,children:[U?c.jsx(sr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(wh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Resume tunnel connection"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"dialog-btn-create",style:{width:"100%"},onClick:()=>R("setup"),children:[c.jsx(wh,{size:16,style:{verticalAlign:"middle",marginRight:6}}),"Make this machine remote"]}),c.jsx("div",{className:"dialog-label",style:{opacity:.7,marginTop:-4},children:"The daemon sets everything up and shows the progress here."})]})})]})]})]})})}const PT={success:w0,error:hl,info:j0,warn:V0},OT=4e3;function zT({toast:n}){const r=M(f=>f.removeToast),s=PT[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),OT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,r]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>r(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(s,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[c.jsx(q0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Pn,{size:14})})]})}function $T(){const n=M(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(zT,{toast:r},r.id))})}let qn=null,di=null,uo=1e3;const FT=1e4;function UT(){const n=ir();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Hu(){qn&&(qn.readyState===WebSocket.OPEN||qn.readyState===WebSocket.CONNECTING)||(qn=new WebSocket(UT()),qn.onopen=()=>{const n=uo>1e3;if(uo=1e3,M.getState().setWsConnected(!0),M.getState().addLogEntry("INFO","WebSocket connected"),n){const r=M.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},qn.onclose=()=>{M.getState().setWsConnected(!1),M.getState().addLogEntry("WARN","WebSocket disconnected"),M.getState().addToast("warn","WebSocket disconnected — reconnecting…"),WT()},qn.onerror=()=>{},qn.onmessage=n=>{try{const r=JSON.parse(n.data);Kt.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=HT[r.event];s&&s(r.data)}catch{}})}function BT(){di&&(clearTimeout(di),di=null),qn&&(qn.onclose=null,qn.close(),qn=null),M.getState().setWsConnected(!1)}function WT(){di||(di=window.setTimeout(()=>{di=null,Hu()},uo),uo=Math.min(uo*2,FT))}const HT={"turn:created":n=>{const r=n;M.getState().onTurnCreated(r.sessionId,r.turn)},"turn:started":n=>{const r=n;Kt.note(`turn:started — ${r.turnId.slice(0,8)}`),M.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;M.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;M.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;M.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;M.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;Kt.note(`turn:completed — ${r.turnId.slice(0,8)}`),M.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;M.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage,...r.autoCompactThreshold?{autoCompactThreshold:r.autoCompactThreshold}:{}};M.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;M.getState().onTurnFailed(r.sessionId,r.turnId,r.error,r.resumeState)},"turn:interrupted":n=>{const r=n;Kt.note(`turn:interrupted — ${r.turnId.slice(0,8)} (${r.reason})`),M.getState().onTurnInterrupted(r.sessionId,r.turnId,{reason:r.reason,interruptedAt:r.interruptedAt,attempts:r.attempts,detail:r.detail??null})},"turn:resuming":n=>{const r=n;M.getState().onTurnResuming(r.sessionId,r.turnId,r.attempt)},"turn:resumed":n=>{const r=n;M.getState().onTurnResumed(r.sessionId,r.turnId)},"turn:retrying":n=>{const r=n;M.getState().onTurnRetrying(r.sessionId,r.turnId,{attempt:r.attempt,maxRetries:r.maxRetries,retryDelayMs:r.retryDelayMs,errorStatus:r.errorStatus??null,error:r.error??null})},"turn:cancelled":n=>{const r=n;M.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;M.getState().onSessionTitle(r.sessionId,r.title)},background_tasks:n=>{const r=n;Kt.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),M.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"background_tasks:snapshot":n=>{const r=n;M.getState().onBackgroundTasksSnapshot(r.sessions??{})},"thread:created":n=>{const r=n;M.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;M.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;M.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;M.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Ex(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{Mx(n.appId)},"app:state_changed":n=>{Dx(n.appId)}};function VT(){const n=M(r=>r.init);return w.useEffect(()=>{Ky(),n(),Hu();function r(){if(document.visibilityState!=="visible")return;const s=M.getState(),o=s.activeSessionId;if(!o)return;const a=s.sessionDetails[o];s.wsConnected||Hu(),a&&a.is_running===1&&(s.refreshActiveSession(),s.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",r),()=>{BT(),document.removeEventListener("visibilitychange",r)}},[n]),null}function qT(){const n=M(a=>a.loading),r=M(a=>a.error),s=M(a=>a.sessions),o=M(a=>a.setShowCommandPalette);return w.useEffect(()=>Kt.start(),[]),w.useEffect(()=>{function a(u){(u.metaKey||u.ctrlKey)&&u.key==="k"&&(u.preventDefault(),o(!0))}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[o]),c.jsxs(c.Fragment,{children:[c.jsx(VT,{}),n&&s.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&s.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",r]}):c.jsxs(c.Fragment,{children:[c.jsx(ET,{}),c.jsx(_T,{}),c.jsx(IT,{}),c.jsx(LT,{}),c.jsx(DT,{}),c.jsx($T,{})]})]})}zy.createRoot(document.getElementById("root")).render(c.jsx(st.StrictMode,{children:c.jsx(qT,{})}));