repoburg 1.3.236 → 1.3.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-pane/frontend/dist/assets/index-CUR0-YML.js +475 -0
- package/agent-pane/frontend/dist/assets/index-DbznBcr3.css +1 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/daemon/dist/serviceManager.js +7 -0
- package/daemon/dist/serviceManager.spec.js +18 -0
- package/package.json +1 -1
- package/agent-pane/frontend/dist/assets/index-BKidPoB0.js +0 -475
- package/agent-pane/frontend/dist/assets/index-qS_kafxG.css +0 -1
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
var oy=Object.defineProperty;var ly=(n,r,s)=>r in n?oy(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var ut=(n,r,s)=>ly(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 dm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wc={exports:{}},Vi={},Hc={exports:{}},Ve={};/**
|
|
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 Ip;function ay(){if(Ip)return Ve;Ip=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"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),w=Symbol.iterator;function y(E){return E===null||typeof E!="object"?null:(E=w&&E[w]||E["@@iterator"],typeof E=="function"?E:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,C={};function T(E,D,ie){this.props=E,this.context=D,this.refs=C,this.updater=ie||N}T.prototype.isReactComponent={},T.prototype.setState=function(E,D){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,D,"setState")},T.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function P(){}P.prototype=T.prototype;function M(E,D,ie){this.props=E,this.context=D,this.refs=C,this.updater=ie||N}var H=M.prototype=new P;H.constructor=M,R(H,T.prototype),H.isPureReactComponent=!0;var I=Array.isArray,W=Object.prototype.hasOwnProperty,Y={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function V(E,D,ie){var oe,ve={},pe=null,Ae=null;if(D!=null)for(oe in D.ref!==void 0&&(Ae=D.ref),D.key!==void 0&&(pe=""+D.key),D)W.call(D,oe)&&!K.hasOwnProperty(oe)&&(ve[oe]=D[oe]);var Ce=arguments.length-2;if(Ce===1)ve.children=ie;else if(1<Ce){for(var be=Array(Ce),we=0;we<Ce;we++)be[we]=arguments[we+2];ve.children=be}if(E&&E.defaultProps)for(oe in Ce=E.defaultProps,Ce)ve[oe]===void 0&&(ve[oe]=Ce[oe]);return{$$typeof:n,type:E,key:pe,ref:Ae,props:ve,_owner:Y.current}}function ne(E,D){return{$$typeof:n,type:E.type,key:D,ref:E.ref,props:E.props,_owner:E._owner}}function ae(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function fe(E){var D={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(ie){return D[ie]})}var Le=/\/+/g;function Re(E,D){return typeof E=="object"&&E!==null&&E.key!=null?fe(""+E.key):D.toString(36)}function Pe(E,D,ie,oe,ve){var pe=typeof E;(pe==="undefined"||pe==="boolean")&&(E=null);var Ae=!1;if(E===null)Ae=!0;else switch(pe){case"string":case"number":Ae=!0;break;case"object":switch(E.$$typeof){case n:case r:Ae=!0}}if(Ae)return Ae=E,ve=ve(Ae),E=oe===""?"."+Re(Ae,0):oe,I(ve)?(ie="",E!=null&&(ie=E.replace(Le,"$&/")+"/"),Pe(ve,D,ie,"",function(we){return we})):ve!=null&&(ae(ve)&&(ve=ne(ve,ie+(!ve.key||Ae&&Ae.key===ve.key?"":(""+ve.key).replace(Le,"$&/")+"/")+E)),D.push(ve)),1;if(Ae=0,oe=oe===""?".":oe+":",I(E))for(var Ce=0;Ce<E.length;Ce++){pe=E[Ce];var be=oe+Re(pe,Ce);Ae+=Pe(pe,D,ie,be,ve)}else if(be=y(E),typeof be=="function")for(E=be.call(E),Ce=0;!(pe=E.next()).done;)pe=pe.value,be=oe+Re(pe,Ce++),Ae+=Pe(pe,D,ie,be,ve);else if(pe==="object")throw D=String(E),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return Ae}function Z(E,D,ie){if(E==null)return E;var oe=[],ve=0;return Pe(E,oe,"","",function(pe){return D.call(ie,pe,ve++)}),oe}function te(E){if(E._status===-1){var D=E._result;D=D(),D.then(function(ie){(E._status===0||E._status===-1)&&(E._status=1,E._result=ie)},function(ie){(E._status===0||E._status===-1)&&(E._status=2,E._result=ie)}),E._status===-1&&(E._status=0,E._result=D)}if(E._status===1)return E._result.default;throw E._result}var le={current:null},j={transition:null},q={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:j,ReactCurrentOwner:Y};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ve.Children={map:Z,forEach:function(E,D,ie){Z(E,function(){D.apply(this,arguments)},ie)},count:function(E){var D=0;return Z(E,function(){D++}),D},toArray:function(E){return Z(E,function(D){return D})||[]},only:function(E){if(!ae(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ve.Component=T,Ve.Fragment=s,Ve.Profiler=a,Ve.PureComponent=M,Ve.StrictMode=o,Ve.Suspense=m,Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Ve.act=B,Ve.cloneElement=function(E,D,ie){if(E==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+E+".");var oe=R({},E.props),ve=E.key,pe=E.ref,Ae=E._owner;if(D!=null){if(D.ref!==void 0&&(pe=D.ref,Ae=Y.current),D.key!==void 0&&(ve=""+D.key),E.type&&E.type.defaultProps)var Ce=E.type.defaultProps;for(be in D)W.call(D,be)&&!K.hasOwnProperty(be)&&(oe[be]=D[be]===void 0&&Ce!==void 0?Ce[be]:D[be])}var be=arguments.length-2;if(be===1)oe.children=ie;else if(1<be){Ce=Array(be);for(var we=0;we<be;we++)Ce[we]=arguments[we+2];oe.children=Ce}return{$$typeof:n,type:E.type,key:ve,ref:pe,props:oe,_owner:Ae}},Ve.createContext=function(E){return E={$$typeof:f,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},E.Provider={$$typeof:u,_context:E},E.Consumer=E},Ve.createElement=V,Ve.createFactory=function(E){var D=V.bind(null,E);return D.type=E,D},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(E){return{$$typeof:h,render:E}},Ve.isValidElement=ae,Ve.lazy=function(E){return{$$typeof:x,_payload:{_status:-1,_result:E},_init:te}},Ve.memo=function(E,D){return{$$typeof:g,type:E,compare:D===void 0?null:D}},Ve.startTransition=function(E){var D=j.transition;j.transition={};try{E()}finally{j.transition=D}},Ve.unstable_act=B,Ve.useCallback=function(E,D){return le.current.useCallback(E,D)},Ve.useContext=function(E){return le.current.useContext(E)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(E){return le.current.useDeferredValue(E)},Ve.useEffect=function(E,D){return le.current.useEffect(E,D)},Ve.useId=function(){return le.current.useId()},Ve.useImperativeHandle=function(E,D,ie){return le.current.useImperativeHandle(E,D,ie)},Ve.useInsertionEffect=function(E,D){return le.current.useInsertionEffect(E,D)},Ve.useLayoutEffect=function(E,D){return le.current.useLayoutEffect(E,D)},Ve.useMemo=function(E,D){return le.current.useMemo(E,D)},Ve.useReducer=function(E,D,ie){return le.current.useReducer(E,D,ie)},Ve.useRef=function(E){return le.current.useRef(E)},Ve.useState=function(E){return le.current.useState(E)},Ve.useSyncExternalStore=function(E,D,ie){return le.current.useSyncExternalStore(E,D,ie)},Ve.useTransition=function(){return le.current.useTransition()},Ve.version="18.3.1",Ve}var Dp;function Lu(){return Dp||(Dp=1,Hc.exports=ay()),Hc.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 Mp;function cy(){if(Mp)return Vi;Mp=1;var n=Lu(),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(h,m,g){var x,w={},y=null,N=null;g!==void 0&&(y=""+g),m.key!==void 0&&(y=""+m.key),m.ref!==void 0&&(N=m.ref);for(x in m)o.call(m,x)&&!u.hasOwnProperty(x)&&(w[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)w[x]===void 0&&(w[x]=m[x]);return{$$typeof:r,type:h,key:y,ref:N,props:w,_owner:a.current}}return Vi.Fragment=s,Vi.jsx=f,Vi.jsxs=f,Vi}var Lp;function uy(){return Lp||(Lp=1,Wc.exports=cy()),Wc.exports}var c=uy(),k=Lu();const lt=dm(k);var Sl={},Vc={exports:{}},Nn={},Gc={exports:{}},qc={};/**
|
|
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 Pp;function dy(){return Pp||(Pp=1,(function(n){function r(j,q){var B=j.length;j.push(q);e:for(;0<B;){var E=B-1>>>1,D=j[E];if(0<a(D,q))j[E]=q,j[B]=D,B=E;else break e}}function s(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var q=j[0],B=j.pop();if(B!==q){j[0]=B;e:for(var E=0,D=j.length,ie=D>>>1;E<ie;){var oe=2*(E+1)-1,ve=j[oe],pe=oe+1,Ae=j[pe];if(0>a(ve,B))pe<D&&0>a(Ae,ve)?(j[E]=Ae,j[pe]=B,E=pe):(j[E]=ve,j[oe]=B,E=oe);else if(pe<D&&0>a(Ae,B))j[E]=Ae,j[pe]=B,E=pe;else break e}}return q}function a(j,q){var B=j.sortIndex-q.sortIndex;return B!==0?B:j.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var m=[],g=[],x=1,w=null,y=3,N=!1,R=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function H(j){for(var q=s(g);q!==null;){if(q.callback===null)o(g);else if(q.startTime<=j)o(g),q.sortIndex=q.expirationTime,r(m,q);else break;q=s(g)}}function I(j){if(C=!1,H(j),!R)if(s(m)!==null)R=!0,te(W);else{var q=s(g);q!==null&&le(I,q.startTime-j)}}function W(j,q){R=!1,C&&(C=!1,P(V),V=-1),N=!0;var B=y;try{for(H(q),w=s(m);w!==null&&(!(w.expirationTime>q)||j&&!fe());){var E=w.callback;if(typeof E=="function"){w.callback=null,y=w.priorityLevel;var D=E(w.expirationTime<=q);q=n.unstable_now(),typeof D=="function"?w.callback=D:w===s(m)&&o(m),H(q)}else o(m);w=s(m)}if(w!==null)var ie=!0;else{var oe=s(g);oe!==null&&le(I,oe.startTime-q),ie=!1}return ie}finally{w=null,y=B,N=!1}}var Y=!1,K=null,V=-1,ne=5,ae=-1;function fe(){return!(n.unstable_now()-ae<ne)}function Le(){if(K!==null){var j=n.unstable_now();ae=j;var q=!0;try{q=K(!0,j)}finally{q?Re():(Y=!1,K=null)}}else Y=!1}var Re;if(typeof M=="function")Re=function(){M(Le)};else if(typeof MessageChannel<"u"){var Pe=new MessageChannel,Z=Pe.port2;Pe.port1.onmessage=Le,Re=function(){Z.postMessage(null)}}else Re=function(){T(Le,0)};function te(j){K=j,Y||(Y=!0,Re())}function le(j,q){V=T(function(){j(n.unstable_now())},q)}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(j){j.callback=null},n.unstable_continueExecution=function(){R||N||(R=!0,te(W))},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return s(m)},n.unstable_next=function(j){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var B=y;y=q;try{return j()}finally{y=B}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var B=y;y=j;try{return q()}finally{y=B}},n.unstable_scheduleCallback=function(j,q,B){var E=n.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?E+B:E):B=E,j){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=B+D,j={id:x++,callback:q,priorityLevel:j,startTime:B,expirationTime:D,sortIndex:-1},B>E?(j.sortIndex=B,r(g,j),s(m)===null&&j===s(g)&&(C?(P(V),V=-1):C=!0,le(I,B-E))):(j.sortIndex=D,r(m,j),R||N||(R=!0,te(W))),j},n.unstable_shouldYield=fe,n.unstable_wrapCallback=function(j){var q=y;return function(){var B=y;y=q;try{return j.apply(this,arguments)}finally{y=B}}}})(qc)),qc}var zp;function fy(){return zp||(zp=1,Gc.exports=dy()),Gc.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 Op;function py(){if(Op)return Nn;Op=1;var n=Lu(),r=fy();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 h=!(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]*$/,x={},w={};function y(e){return m.call(w,e)?!0:m.call(x,e)?!1:g.test(e)?w[e]=!0:(x[e]=!0,!1)}function N(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 R(e,t,i,l){if(t===null||typeof t>"u"||N(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,p,v){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=p,this.removeEmptyString=v}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[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];T[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[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){T[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function M(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(P,M);T[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(P,M);T[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(P,M);T[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function H(e,t,i,l){var d=T.hasOwnProperty(t)?T[t]:null;(d!==null?d.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(R(t,i,d,l)&&(i=null),l||d===null?y(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 I=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),Y=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.provider"),fe=Symbol.for("react.context"),Le=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Pe=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),j=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=j&&e[j]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,E;function D(e){if(E===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);E=t&&t[1]||""}return`
|
|
34
|
+
`+E+e}var ie=!1;function oe(e,t){if(!e||ie)return"";ie=!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(U){var l=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){l=U}e.call(t.prototype)}else{try{throw Error()}catch(U){l=U}e()}}catch(U){if(U&&l&&typeof U.stack=="string"){for(var d=U.stack.split(`
|
|
35
|
+
`),p=l.stack.split(`
|
|
36
|
+
`),v=d.length-1,b=p.length-1;1<=v&&0<=b&&d[v]!==p[b];)b--;for(;1<=v&&0<=b;v--,b--)if(d[v]!==p[b]){if(v!==1||b!==1)do if(v--,b--,0>b||d[v]!==p[b]){var _=`
|
|
37
|
+
`+d[v].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=v&&0<=b);break}}}finally{ie=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?D(e):""}function ve(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case Y:return"Portal";case ne:return"Profiler";case V:return"StrictMode";case Re:return"Suspense";case Pe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case fe:return(e.displayName||"Context")+".Consumer";case ae:return(e._context.displayName||"Context")+".Provider";case Le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}function Ae(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 pe(t);case 8:return t===V?"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 Ce(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function we(e){var t=be(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,p=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(v){l=""+v,p.call(this,v)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function at(e){e._valueTracker||(e._valueTracker=we(e))}function Ie(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=be(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function xt(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 ze(e,t){var i=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function dt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Ce(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 Be(e,t){t=t.checked,t!=null&&H(e,"checked",t,!1)}function nn(e,t){Be(e,t);var i=Ce(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")?Mt(e,t.type,i):t.hasOwnProperty("defaultValue")&&Mt(e,t.type,Ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yn(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 Mt(e,t,i){(t!=="number"||xt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Tt=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=""+Ce(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 G(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function he(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(Tt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Ce(i)}}function Ue(e,t){var i=Ce(t.value),l=Ce(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 nt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function wt(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 ft(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?wt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ot,Ot=(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(ot=ot||document.createElement("div"),ot.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var kt={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},zn=["Webkit","ms","Moz","O"];Object.keys(kt).forEach(function(e){zn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kt[t]=kt[e]})});function z(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||kt.hasOwnProperty(e)&&kt[e]?(""+t).trim():t+"px"}function Oe(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=z(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Te=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fe(e,t){if(t){if(Te[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 $e(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 ue=null;function We(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var He=null,jt=null,Ge=null;function mt(e){if(e=Ri(e)){if(typeof He!="function")throw Error(s(280));var t=e.stateNode;t&&(t=zo(t),He(e.stateNode,e.type,t))}}function gt(e){jt?Ge?Ge.push(e):Ge=[e]:jt=e}function Bt(){if(jt){var e=jt,t=Ge;if(Ge=jt=null,mt(e),t)for(e=0;e<t.length;e++)mt(t[e])}}function ct(e,t){return e(t)}function pt(){}var Ee=!1;function qe(e,t,i){if(Ee)return e(t,i);Ee=!0;try{return ct(e,t,i)}finally{Ee=!1,(jt!==null||Ge!==null)&&(pt(),Bt())}}function Ke(e,t){var i=e.stateNode;if(i===null)return null;var l=zo(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 sn=!1;if(h)try{var Wt={};Object.defineProperty(Wt,"passive",{get:function(){sn=!0}}),window.addEventListener("test",Wt,Wt),window.removeEventListener("test",Wt,Wt)}catch{sn=!1}function xn(e,t,i,l,d,p,v,b,_){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(J){this.onError(J)}}var dn=!1,_n=null,Xt=!1,qn=null,Kn={onError:function(e){dn=!0,_n=e}};function da(e,t,i,l,d,p,v,b,_){dn=!1,_n=null,xn.apply(Kn,arguments)}function fa(e,t,i,l,d,p,v,b,_){if(da.apply(this,arguments),dn){if(dn){var U=_n;dn=!1,_n=null}else throw Error(s(198));Xt||(Xt=!0,qn=U)}}function rt(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 mr(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 go(e){if(rt(e)!==e)throw Error(s(188))}function vo(e){var t=e.alternate;if(!t){if(t=rt(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 p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return go(d),e;if(p===l)return go(d),t;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,b=d.child;b;){if(b===i){v=!0,i=d,l=p;break}if(b===l){v=!0,l=d,i=p;break}b=b.sibling}if(!v){for(b=p.child;b;){if(b===i){v=!0,i=p,l=d;break}if(b===l){v=!0,l=p,i=d;break}b=b.sibling}if(!v)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 Ss(e){return e=vo(e),e!==null?di(e):null}function di(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=di(e);if(t!==null)return t;e=e.sibling}return null}var fi=r.unstable_scheduleCallback,yo=r.unstable_cancelCallback,pa=r.unstable_shouldYield,ha=r.unstable_requestPaint,bt=r.unstable_now,ir=r.unstable_getCurrentPriorityLevel,Rr=r.unstable_ImmediatePriority,or=r.unstable_UserBlockingPriority,Ts=r.unstable_NormalPriority,Jr=r.unstable_LowPriority,xo=r.unstable_IdlePriority,es=null,jn=null;function bs(e){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(es,e,void 0,(e.current.flags&128)===128)}catch{}}var fn=Math.clz32?Math.clz32:ts,Ns=Math.log,Ar=Math.LN2;function ts(e){return e>>>=0,e===0?32:31-(Ns(e)/Ar|0)|0}var pn=64,Cs=4194304;function ns(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 rs(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,v=i&268435455;if(v!==0){var b=v&~d;b!==0?l=ns(b):(p&=v,p!==0&&(l=ns(p)))}else v=i&~d,v!==0?l=ns(v):p!==0&&(l=ns(p));if(l===0)return 0;if(t!==0&&t!==l&&(t&d)===0&&(d=l&-l,p=t&-t,d>=p||d===16&&(p&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-fn(t),d=1<<i,l|=e[i],t&=~d;return l}function wo(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 ko(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var v=31-fn(p),b=1<<v,_=d[v];_===-1?((b&i)===0||(b&l)!==0)&&(d[v]=wo(b,t)):_<=t&&(e.expiredLanes|=b),p&=~b}}function pi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hi(){var e=pn;return pn<<=1,(pn&4194240)===0&&(pn=64),e}function mi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ss(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=i}function So(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-fn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Ir(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-fn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Qe=0;function re(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,O,X,ge,ke,Me=!1,Ze=[],et=null,Nt=null,Ct=null,gr=new Map,It=new Map,Dr=[],_g="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 hd(e,t){switch(e){case"focusin":case"focusout":et=null;break;case"dragenter":case"dragleave":Nt=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":gr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function gi(e,t,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},t!==null&&(t=Ri(t),t!==null&&O(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function jg(e,t,i,l,d){switch(t){case"focusin":return et=gi(et,e,t,i,l,d),!0;case"dragenter":return Nt=gi(Nt,e,t,i,l,d),!0;case"mouseover":return Ct=gi(Ct,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return gr.set(p,gi(gr.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,It.set(p,gi(It.get(p)||null,e,t,i,l,d)),!0}return!1}function md(e){var t=is(e.target);if(t!==null){var i=rt(t);if(i!==null){if(t=i.tag,t===13){if(t=mr(i),t!==null){e.blockedOn=t,ke(e.priority,function(){X(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 To(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ga(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);ue=l,i.target.dispatchEvent(l),ue=null}else return t=Ri(i),t!==null&&O(t),e.blockedOn=i,!1;t.shift()}return!0}function gd(e,t,i){To(e)&&i.delete(t)}function Rg(){Me=!1,et!==null&&To(et)&&(et=null),Nt!==null&&To(Nt)&&(Nt=null),Ct!==null&&To(Ct)&&(Ct=null),gr.forEach(gd),It.forEach(gd)}function vi(e,t){e.blockedOn===t&&(e.blockedOn=null,Me||(Me=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Rg)))}function yi(e){function t(d){return vi(d,e)}if(0<Ze.length){vi(Ze[0],e);for(var i=1;i<Ze.length;i++){var l=Ze[i];l.blockedOn===e&&(l.blockedOn=null)}}for(et!==null&&vi(et,e),Nt!==null&&vi(Nt,e),Ct!==null&&vi(Ct,e),gr.forEach(t),It.forEach(t),i=0;i<Dr.length;i++)l=Dr[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Dr.length&&(i=Dr[0],i.blockedOn===null);)md(i),i.blockedOn===null&&Dr.shift()}var Es=I.ReactCurrentBatchConfig,bo=!0;function Ag(e,t,i,l){var d=Qe,p=Es.transition;Es.transition=null;try{Qe=1,ma(e,t,i,l)}finally{Qe=d,Es.transition=p}}function Ig(e,t,i,l){var d=Qe,p=Es.transition;Es.transition=null;try{Qe=4,ma(e,t,i,l)}finally{Qe=d,Es.transition=p}}function ma(e,t,i,l){if(bo){var d=ga(e,t,i,l);if(d===null)Da(e,t,l,No,i),hd(e,l);else if(jg(d,e,t,i,l))l.stopPropagation();else if(hd(e,l),t&4&&-1<_g.indexOf(e)){for(;d!==null;){var p=Ri(d);if(p!==null&&S(p),p=ga(e,t,i,l),p===null&&Da(e,t,l,No,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Da(e,t,l,null,i)}}var No=null;function ga(e,t,i,l){if(No=null,e=We(l),e=is(e),e!==null)if(t=rt(e),t===null)e=null;else if(i=t.tag,i===13){if(e=mr(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 No=e,null}function vd(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(ir()){case Rr:return 1;case or:return 4;case Ts:case Jr:return 16;case xo:return 536870912;default:return 16}default:return 16}}var Mr=null,va=null,Co=null;function yd(){if(Co)return Co;var e,t=va,i=t.length,l,d="value"in Mr?Mr.value:Mr.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var v=i-e;for(l=1;l<=v&&t[i-l]===d[p-l];l++);return Co=d.slice(e,1<l?1-l:void 0)}function Eo(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 _o(){return!0}function xd(){return!1}function Rn(e){function t(i,l,d,p,v){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(i=e[b],this[b]=i?i(p):p[b]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?_o:xd,this.isPropagationStopped=xd,this}return B(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=_o)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),t}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ya=Rn(_s),xi=B({},_s,{view:0,detail:0}),Dg=Rn(xi),xa,wa,wi,jo=B({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sa,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!==wi&&(wi&&e.type==="mousemove"?(xa=e.screenX-wi.screenX,wa=e.screenY-wi.screenY):wa=xa=0,wi=e),xa)},movementY:function(e){return"movementY"in e?e.movementY:wa}}),wd=Rn(jo),Mg=B({},jo,{dataTransfer:0}),Lg=Rn(Mg),Pg=B({},xi,{relatedTarget:0}),ka=Rn(Pg),zg=B({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),Og=Rn(zg),$g=B({},_s,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fg=Rn($g),Ug=B({},_s,{data:0}),kd=Rn(Ug),Bg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wg={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"},Hg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Hg[e])?!!t[e]:!1}function Sa(){return Vg}var Gg=B({},xi,{key:function(e){if(e.key){var t=Bg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Eo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Wg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sa,charCode:function(e){return e.type==="keypress"?Eo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Eo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qg=Rn(Gg),Kg=B({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sd=Rn(Kg),Yg=B({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sa}),Xg=Rn(Yg),Qg=B({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zg=Rn(Qg),Jg=B({},jo,{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}),ev=Rn(Jg),tv=[9,13,27,32],Ta=h&&"CompositionEvent"in window,ki=null;h&&"documentMode"in document&&(ki=document.documentMode);var nv=h&&"TextEvent"in window&&!ki,Td=h&&(!Ta||ki&&8<ki&&11>=ki),bd=" ",Nd=!1;function Cd(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 Ed(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var js=!1;function rv(e,t){switch(e){case"compositionend":return Ed(t);case"keypress":return t.which!==32?null:(Nd=!0,bd);case"textInput":return e=t.data,e===bd&&Nd?null:e;default:return null}}function sv(e,t){if(js)return e==="compositionend"||!Ta&&Cd(e,t)?(e=yd(),Co=va=Mr=null,js=!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 Td&&t.locale!=="ko"?null:t.data;default:return null}}var iv={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 _d(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iv[e.type]:t==="textarea"}function jd(e,t,i,l){gt(l),t=Mo(t,"onChange"),0<t.length&&(i=new ya("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Si=null,Ti=null;function ov(e){qd(e,0)}function Ro(e){var t=Ms(e);if(Ie(t))return e}function lv(e,t){if(e==="change")return t}var Rd=!1;if(h){var ba;if(h){var Na="oninput"in document;if(!Na){var Ad=document.createElement("div");Ad.setAttribute("oninput","return;"),Na=typeof Ad.oninput=="function"}ba=Na}else ba=!1;Rd=ba&&(!document.documentMode||9<document.documentMode)}function Id(){Si&&(Si.detachEvent("onpropertychange",Dd),Ti=Si=null)}function Dd(e){if(e.propertyName==="value"&&Ro(Ti)){var t=[];jd(t,Ti,e,We(e)),qe(ov,t)}}function av(e,t,i){e==="focusin"?(Id(),Si=t,Ti=i,Si.attachEvent("onpropertychange",Dd)):e==="focusout"&&Id()}function cv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(Ti)}function uv(e,t){if(e==="click")return Ro(t)}function dv(e,t){if(e==="input"||e==="change")return Ro(t)}function fv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:fv;function bi(e,t){if(Yn(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)||!Yn(e[d],t[d]))return!1}return!0}function Md(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ld(e,t){var i=Md(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=Md(i)}}function Pd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zd(){for(var e=window,t=xt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=xt(e.document)}return t}function Ca(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 pv(e){var t=zd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Pd(i.ownerDocument.documentElement,i)){if(l!==null&&Ca(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,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=Ld(i,p);var v=Ld(i,l);d&&v&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.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 hv=h&&"documentMode"in document&&11>=document.documentMode,Rs=null,Ea=null,Ni=null,_a=!1;function Od(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;_a||Rs==null||Rs!==xt(l)||(l=Rs,"selectionStart"in l&&Ca(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}),Ni&&bi(Ni,l)||(Ni=l,l=Mo(Ea,"onSelect"),0<l.length&&(t=new ya("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Rs)))}function Ao(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var As={animationend:Ao("Animation","AnimationEnd"),animationiteration:Ao("Animation","AnimationIteration"),animationstart:Ao("Animation","AnimationStart"),transitionend:Ao("Transition","TransitionEnd")},ja={},$d={};h&&($d=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function Io(e){if(ja[e])return ja[e];if(!As[e])return e;var t=As[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in $d)return ja[e]=t[i];return e}var Fd=Io("animationend"),Ud=Io("animationiteration"),Bd=Io("animationstart"),Wd=Io("transitionend"),Hd=new Map,Vd="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 Lr(e,t){Hd.set(e,t),u(t,[e])}for(var Ra=0;Ra<Vd.length;Ra++){var Aa=Vd[Ra],mv=Aa.toLowerCase(),gv=Aa[0].toUpperCase()+Aa.slice(1);Lr(mv,"on"+gv)}Lr(Fd,"onAnimationEnd"),Lr(Ud,"onAnimationIteration"),Lr(Bd,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(Wd,"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 Ci="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(" "),vv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Gd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,fa(l,t,void 0,e),e.currentTarget=null}function qd(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 p=void 0;if(t)for(var v=l.length-1;0<=v;v--){var b=l[v],_=b.instance,U=b.currentTarget;if(b=b.listener,_!==p&&d.isPropagationStopped())break e;Gd(d,b,U),p=_}else for(v=0;v<l.length;v++){if(b=l[v],_=b.instance,U=b.currentTarget,b=b.listener,_!==p&&d.isPropagationStopped())break e;Gd(d,b,U),p=_}}}if(Xt)throw e=qn,Xt=!1,qn=null,e}function vt(e,t){var i=t[$a];i===void 0&&(i=t[$a]=new Set);var l=e+"__bubble";i.has(l)||(Kd(t,e,2,!1),i.add(l))}function Ia(e,t,i){var l=0;t&&(l|=4),Kd(i,e,l,t)}var Do="_reactListening"+Math.random().toString(36).slice(2);function Ei(e){if(!e[Do]){e[Do]=!0,o.forEach(function(i){i!=="selectionchange"&&(vv.has(i)||Ia(i,!1,e),Ia(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Do]||(t[Do]=!0,Ia("selectionchange",!1,t))}}function Kd(e,t,i,l){switch(vd(t)){case 1:var d=Ag;break;case 4:d=Ig;break;default:d=ma}i=d.bind(null,t,i,e),d=void 0,!sn||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 Da(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var b=l.stateNode.containerInfo;if(b===d||b.nodeType===8&&b.parentNode===d)break;if(v===4)for(v=l.return;v!==null;){var _=v.tag;if((_===3||_===4)&&(_=v.stateNode.containerInfo,_===d||_.nodeType===8&&_.parentNode===d))return;v=v.return}for(;b!==null;){if(v=is(b),v===null)return;if(_=v.tag,_===5||_===6){l=p=v;continue e}b=b.parentNode}}l=l.return}qe(function(){var U=p,J=We(i),ee=[];e:{var Q=Hd.get(e);if(Q!==void 0){var ce=ya,me=e;switch(e){case"keypress":if(Eo(i)===0)break e;case"keydown":case"keyup":ce=qg;break;case"focusin":me="focus",ce=ka;break;case"focusout":me="blur",ce=ka;break;case"beforeblur":case"afterblur":ce=ka;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":ce=wd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Lg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=Xg;break;case Fd:case Ud:case Bd:ce=Og;break;case Wd:ce=Zg;break;case"scroll":ce=Dg;break;case"wheel":ce=ev;break;case"copy":case"cut":case"paste":ce=Fg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=Sd}var ye=(t&4)!==0,Dt=!ye&&e==="scroll",$=ye?Q!==null?Q+"Capture":null:Q;ye=[];for(var A=U,F;A!==null;){F=A;var se=F.stateNode;if(F.tag===5&&se!==null&&(F=se,$!==null&&(se=Ke(A,$),se!=null&&ye.push(_i(A,se,F)))),Dt)break;A=A.return}0<ye.length&&(Q=new ce(Q,me,null,i,J),ee.push({event:Q,listeners:ye}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",Q&&i!==ue&&(me=i.relatedTarget||i.fromElement)&&(is(me)||me[vr]))break e;if((ce||Q)&&(Q=J.window===J?J:(Q=J.ownerDocument)?Q.defaultView||Q.parentWindow:window,ce?(me=i.relatedTarget||i.toElement,ce=U,me=me?is(me):null,me!==null&&(Dt=rt(me),me!==Dt||me.tag!==5&&me.tag!==6)&&(me=null)):(ce=null,me=U),ce!==me)){if(ye=wd,se="onMouseLeave",$="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ye=Sd,se="onPointerLeave",$="onPointerEnter",A="pointer"),Dt=ce==null?Q:Ms(ce),F=me==null?Q:Ms(me),Q=new ye(se,A+"leave",ce,i,J),Q.target=Dt,Q.relatedTarget=F,se=null,is(J)===U&&(ye=new ye($,A+"enter",me,i,J),ye.target=F,ye.relatedTarget=Dt,se=ye),Dt=se,ce&&me)t:{for(ye=ce,$=me,A=0,F=ye;F;F=Is(F))A++;for(F=0,se=$;se;se=Is(se))F++;for(;0<A-F;)ye=Is(ye),A--;for(;0<F-A;)$=Is($),F--;for(;A--;){if(ye===$||$!==null&&ye===$.alternate)break t;ye=Is(ye),$=Is($)}ye=null}else ye=null;ce!==null&&Yd(ee,Q,ce,ye,!1),me!==null&&Dt!==null&&Yd(ee,Dt,me,ye,!0)}}e:{if(Q=U?Ms(U):window,ce=Q.nodeName&&Q.nodeName.toLowerCase(),ce==="select"||ce==="input"&&Q.type==="file")var xe=lv;else if(_d(Q))if(Rd)xe=dv;else{xe=cv;var _e=av}else(ce=Q.nodeName)&&ce.toLowerCase()==="input"&&(Q.type==="checkbox"||Q.type==="radio")&&(xe=uv);if(xe&&(xe=xe(e,U))){jd(ee,xe,i,J);break e}_e&&_e(e,Q,U),e==="focusout"&&(_e=Q._wrapperState)&&_e.controlled&&Q.type==="number"&&Mt(Q,"number",Q.value)}switch(_e=U?Ms(U):window,e){case"focusin":(_d(_e)||_e.contentEditable==="true")&&(Rs=_e,Ea=U,Ni=null);break;case"focusout":Ni=Ea=Rs=null;break;case"mousedown":_a=!0;break;case"contextmenu":case"mouseup":case"dragend":_a=!1,Od(ee,i,J);break;case"selectionchange":if(hv)break;case"keydown":case"keyup":Od(ee,i,J)}var je;if(Ta)e:{switch(e){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else js?Cd(e,i)&&(De="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(De="onCompositionStart");De&&(Td&&i.locale!=="ko"&&(js||De!=="onCompositionStart"?De==="onCompositionEnd"&&js&&(je=yd()):(Mr=J,va="value"in Mr?Mr.value:Mr.textContent,js=!0)),_e=Mo(U,De),0<_e.length&&(De=new kd(De,e,null,i,J),ee.push({event:De,listeners:_e}),je?De.data=je:(je=Ed(i),je!==null&&(De.data=je)))),(je=nv?rv(e,i):sv(e,i))&&(U=Mo(U,"onBeforeInput"),0<U.length&&(J=new kd("onBeforeInput","beforeinput",null,i,J),ee.push({event:J,listeners:U}),J.data=je))}qd(ee,t)})}function _i(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Mo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Ke(e,i),p!=null&&l.unshift(_i(e,p,d)),p=Ke(e,t),p!=null&&l.push(_i(e,p,d))),e=e.return}return l}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var b=i,_=b.alternate,U=b.stateNode;if(_!==null&&_===l)break;b.tag===5&&U!==null&&(b=U,d?(_=Ke(i,p),_!=null&&v.unshift(_i(i,_,b))):d||(_=Ke(i,p),_!=null&&v.push(_i(i,_,b)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var yv=/\r\n?/g,xv=/\u0000|\uFFFD/g;function Xd(e){return(typeof e=="string"?e:""+e).replace(yv,`
|
|
38
|
+
`).replace(xv,"")}function Lo(e,t,i){if(t=Xd(t),Xd(e)!==t&&i)throw Error(s(425))}function Po(){}var Ma=null,La=null;function Pa(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 za=typeof setTimeout=="function"?setTimeout:void 0,wv=typeof clearTimeout=="function"?clearTimeout:void 0,Qd=typeof Promise=="function"?Promise:void 0,kv=typeof queueMicrotask=="function"?queueMicrotask:typeof Qd<"u"?function(e){return Qd.resolve(null).then(e).catch(Sv)}:za;function Sv(e){setTimeout(function(){throw e})}function Oa(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),yi(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);yi(t)}function Pr(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 Zd(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 Ds=Math.random().toString(36).slice(2),lr="__reactFiber$"+Ds,ji="__reactProps$"+Ds,vr="__reactContainer$"+Ds,$a="__reactEvents$"+Ds,Tv="__reactListeners$"+Ds,bv="__reactHandles$"+Ds;function is(e){var t=e[lr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[vr]||i[lr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=Zd(e);e!==null;){if(i=e[lr])return i;e=Zd(e)}return t}e=i,i=e.parentNode}return null}function Ri(e){return e=e[lr]||e[vr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ms(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function zo(e){return e[ji]||null}var Fa=[],Ls=-1;function zr(e){return{current:e}}function yt(e){0>Ls||(e.current=Fa[Ls],Fa[Ls]=null,Ls--)}function ht(e,t){Ls++,Fa[Ls]=e.current,e.current=t}var Or={},on=zr(Or),wn=zr(!1),os=Or;function Ps(e,t){var i=e.type.contextTypes;if(!i)return Or;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=t[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function kn(e){return e=e.childContextTypes,e!=null}function Oo(){yt(wn),yt(on)}function Jd(e,t,i){if(on.current!==Or)throw Error(s(168));ht(on,t),ht(wn,i)}function ef(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,Ae(e)||"Unknown",d));return B({},i,l)}function $o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Or,os=on.current,ht(on,e),ht(wn,wn.current),!0}function tf(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=ef(e,t,os),l.__reactInternalMemoizedMergedChildContext=e,yt(wn),yt(on),ht(on,e)):yt(wn),ht(wn,i)}var yr=null,Fo=!1,Ua=!1;function nf(e){yr===null?yr=[e]:yr.push(e)}function Nv(e){Fo=!0,nf(e)}function $r(){if(!Ua&&yr!==null){Ua=!0;var e=0,t=Qe;try{var i=yr;for(Qe=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}yr=null,Fo=!1}catch(d){throw yr!==null&&(yr=yr.slice(e+1)),fi(Rr,$r),d}finally{Qe=t,Ua=!1}}return null}var zs=[],Os=0,Uo=null,Bo=0,On=[],$n=0,ls=null,xr=1,wr="";function as(e,t){zs[Os++]=Bo,zs[Os++]=Uo,Uo=e,Bo=t}function rf(e,t,i){On[$n++]=xr,On[$n++]=wr,On[$n++]=ls,ls=e;var l=xr;e=wr;var d=32-fn(l)-1;l&=~(1<<d),i+=1;var p=32-fn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,xr=1<<32-fn(t)+d|i<<d|l,wr=p+e}else xr=1<<p|i<<d|l,wr=e}function Ba(e){e.return!==null&&(as(e,1),rf(e,1,0))}function Wa(e){for(;e===Uo;)Uo=zs[--Os],zs[Os]=null,Bo=zs[--Os],zs[Os]=null;for(;e===ls;)ls=On[--$n],On[$n]=null,wr=On[--$n],On[$n]=null,xr=On[--$n],On[$n]=null}var An=null,In=null,St=!1,Xn=null;function sf(e,t){var i=Wn(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 of(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,An=e,In=Pr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,An=e,In=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=ls!==null?{id:xr,overflow:wr}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Wn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,An=e,In=null,!0):!1;default:return!1}}function Ha(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Va(e){if(St){var t=In;if(t){var i=t;if(!of(e,t)){if(Ha(e))throw Error(s(418));t=Pr(i.nextSibling);var l=An;t&&of(e,t)?sf(l,i):(e.flags=e.flags&-4097|2,St=!1,An=e)}}else{if(Ha(e))throw Error(s(418));e.flags=e.flags&-4097|2,St=!1,An=e}}}function lf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;An=e}function Wo(e){if(e!==An)return!1;if(!St)return lf(e),St=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pa(e.type,e.memoizedProps)),t&&(t=In)){if(Ha(e))throw af(),Error(s(418));for(;t;)sf(e,t),t=Pr(t.nextSibling)}if(lf(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){In=Pr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}In=null}}else In=An?Pr(e.stateNode.nextSibling):null;return!0}function af(){for(var e=In;e;)e=Pr(e.nextSibling)}function $s(){In=An=null,St=!1}function Ga(e){Xn===null?Xn=[e]:Xn.push(e)}var Cv=I.ReactCurrentBatchConfig;function Ai(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,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(v){var b=d.refs;v===null?delete b[p]:b[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Ho(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cf(e){var t=e._init;return t(e._payload)}function uf(e){function t($,A){if(e){var F=$.deletions;F===null?($.deletions=[A],$.flags|=16):F.push(A)}}function i($,A){if(!e)return null;for(;A!==null;)t($,A),A=A.sibling;return null}function l($,A){for($=new Map;A!==null;)A.key!==null?$.set(A.key,A):$.set(A.index,A),A=A.sibling;return $}function d($,A){return $=qr($,A),$.index=0,$.sibling=null,$}function p($,A,F){return $.index=F,e?(F=$.alternate,F!==null?(F=F.index,F<A?($.flags|=2,A):F):($.flags|=2,A)):($.flags|=1048576,A)}function v($){return e&&$.alternate===null&&($.flags|=2),$}function b($,A,F,se){return A===null||A.tag!==6?(A=zc(F,$.mode,se),A.return=$,A):(A=d(A,F),A.return=$,A)}function _($,A,F,se){var xe=F.type;return xe===K?J($,A,F.props.children,se,F.key):A!==null&&(A.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===te&&cf(xe)===A.type)?(se=d(A,F.props),se.ref=Ai($,A,F),se.return=$,se):(se=hl(F.type,F.key,F.props,null,$.mode,se),se.ref=Ai($,A,F),se.return=$,se)}function U($,A,F,se){return A===null||A.tag!==4||A.stateNode.containerInfo!==F.containerInfo||A.stateNode.implementation!==F.implementation?(A=Oc(F,$.mode,se),A.return=$,A):(A=d(A,F.children||[]),A.return=$,A)}function J($,A,F,se,xe){return A===null||A.tag!==7?(A=gs(F,$.mode,se,xe),A.return=$,A):(A=d(A,F),A.return=$,A)}function ee($,A,F){if(typeof A=="string"&&A!==""||typeof A=="number")return A=zc(""+A,$.mode,F),A.return=$,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case W:return F=hl(A.type,A.key,A.props,null,$.mode,F),F.ref=Ai($,null,A),F.return=$,F;case Y:return A=Oc(A,$.mode,F),A.return=$,A;case te:var se=A._init;return ee($,se(A._payload),F)}if(Tt(A)||q(A))return A=gs(A,$.mode,F,null),A.return=$,A;Ho($,A)}return null}function Q($,A,F,se){var xe=A!==null?A.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return xe!==null?null:b($,A,""+F,se);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===xe?_($,A,F,se):null;case Y:return F.key===xe?U($,A,F,se):null;case te:return xe=F._init,Q($,A,xe(F._payload),se)}if(Tt(F)||q(F))return xe!==null?null:J($,A,F,se,null);Ho($,F)}return null}function ce($,A,F,se,xe){if(typeof se=="string"&&se!==""||typeof se=="number")return $=$.get(F)||null,b(A,$,""+se,xe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case W:return $=$.get(se.key===null?F:se.key)||null,_(A,$,se,xe);case Y:return $=$.get(se.key===null?F:se.key)||null,U(A,$,se,xe);case te:var _e=se._init;return ce($,A,F,_e(se._payload),xe)}if(Tt(se)||q(se))return $=$.get(F)||null,J(A,$,se,xe,null);Ho(A,se)}return null}function me($,A,F,se){for(var xe=null,_e=null,je=A,De=A=0,Gt=null;je!==null&&De<F.length;De++){je.index>De?(Gt=je,je=null):Gt=je.sibling;var tt=Q($,je,F[De],se);if(tt===null){je===null&&(je=Gt);break}e&&je&&tt.alternate===null&&t($,je),A=p(tt,A,De),_e===null?xe=tt:_e.sibling=tt,_e=tt,je=Gt}if(De===F.length)return i($,je),St&&as($,De),xe;if(je===null){for(;De<F.length;De++)je=ee($,F[De],se),je!==null&&(A=p(je,A,De),_e===null?xe=je:_e.sibling=je,_e=je);return St&&as($,De),xe}for(je=l($,je);De<F.length;De++)Gt=ce(je,$,De,F[De],se),Gt!==null&&(e&&Gt.alternate!==null&&je.delete(Gt.key===null?De:Gt.key),A=p(Gt,A,De),_e===null?xe=Gt:_e.sibling=Gt,_e=Gt);return e&&je.forEach(function(Kr){return t($,Kr)}),St&&as($,De),xe}function ye($,A,F,se){var xe=q(F);if(typeof xe!="function")throw Error(s(150));if(F=xe.call(F),F==null)throw Error(s(151));for(var _e=xe=null,je=A,De=A=0,Gt=null,tt=F.next();je!==null&&!tt.done;De++,tt=F.next()){je.index>De?(Gt=je,je=null):Gt=je.sibling;var Kr=Q($,je,tt.value,se);if(Kr===null){je===null&&(je=Gt);break}e&&je&&Kr.alternate===null&&t($,je),A=p(Kr,A,De),_e===null?xe=Kr:_e.sibling=Kr,_e=Kr,je=Gt}if(tt.done)return i($,je),St&&as($,De),xe;if(je===null){for(;!tt.done;De++,tt=F.next())tt=ee($,tt.value,se),tt!==null&&(A=p(tt,A,De),_e===null?xe=tt:_e.sibling=tt,_e=tt);return St&&as($,De),xe}for(je=l($,je);!tt.done;De++,tt=F.next())tt=ce(je,$,De,tt.value,se),tt!==null&&(e&&tt.alternate!==null&&je.delete(tt.key===null?De:tt.key),A=p(tt,A,De),_e===null?xe=tt:_e.sibling=tt,_e=tt);return e&&je.forEach(function(iy){return t($,iy)}),St&&as($,De),xe}function Dt($,A,F,se){if(typeof F=="object"&&F!==null&&F.type===K&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var xe=F.key,_e=A;_e!==null;){if(_e.key===xe){if(xe=F.type,xe===K){if(_e.tag===7){i($,_e.sibling),A=d(_e,F.props.children),A.return=$,$=A;break e}}else if(_e.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===te&&cf(xe)===_e.type){i($,_e.sibling),A=d(_e,F.props),A.ref=Ai($,_e,F),A.return=$,$=A;break e}i($,_e);break}else t($,_e);_e=_e.sibling}F.type===K?(A=gs(F.props.children,$.mode,se,F.key),A.return=$,$=A):(se=hl(F.type,F.key,F.props,null,$.mode,se),se.ref=Ai($,A,F),se.return=$,$=se)}return v($);case Y:e:{for(_e=F.key;A!==null;){if(A.key===_e)if(A.tag===4&&A.stateNode.containerInfo===F.containerInfo&&A.stateNode.implementation===F.implementation){i($,A.sibling),A=d(A,F.children||[]),A.return=$,$=A;break e}else{i($,A);break}else t($,A);A=A.sibling}A=Oc(F,$.mode,se),A.return=$,$=A}return v($);case te:return _e=F._init,Dt($,A,_e(F._payload),se)}if(Tt(F))return me($,A,F,se);if(q(F))return ye($,A,F,se);Ho($,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,A!==null&&A.tag===6?(i($,A.sibling),A=d(A,F),A.return=$,$=A):(i($,A),A=zc(F,$.mode,se),A.return=$,$=A),v($)):i($,A)}return Dt}var Fs=uf(!0),df=uf(!1),Vo=zr(null),Go=null,Us=null,qa=null;function Ka(){qa=Us=Go=null}function Ya(e){var t=Vo.current;yt(Vo),e._currentValue=t}function Xa(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 Bs(e,t){Go=e,qa=Us=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Sn=!0),e.firstContext=null)}function Fn(e){var t=e._currentValue;if(qa!==e)if(e={context:e,memoizedValue:t,next:null},Us===null){if(Go===null)throw Error(s(308));Us=e,Go.dependencies={lanes:0,firstContext:e}}else Us=Us.next=e;return t}var cs=null;function Qa(e){cs===null?cs=[e]:cs.push(e)}function ff(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,Qa(t)):(i.next=d.next,d.next=i),t.interleaved=i,kr(e,l)}function kr(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 Fr=!1;function Za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pf(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 Sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ur(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Je&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,kr(e,i)}return d=l.interleaved,d===null?(t.next=t,Qa(l)):(t.next=d.next,d.next=t),l.interleaved=t,kr(e,i)}function qo(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,Ir(e,i)}}function hf(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var v={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=v:p=p.next=v,i=i.next}while(i!==null);p===null?d=p=t:p=p.next=t}else d=p=t;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,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 Ko(e,t,i,l){var d=e.updateQueue;Fr=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,b=d.shared.pending;if(b!==null){d.shared.pending=null;var _=b,U=_.next;_.next=null,v===null?p=U:v.next=U,v=_;var J=e.alternate;J!==null&&(J=J.updateQueue,b=J.lastBaseUpdate,b!==v&&(b===null?J.firstBaseUpdate=U:b.next=U,J.lastBaseUpdate=_))}if(p!==null){var ee=d.baseState;v=0,J=U=_=null,b=p;do{var Q=b.lane,ce=b.eventTime;if((l&Q)===Q){J!==null&&(J=J.next={eventTime:ce,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var me=e,ye=b;switch(Q=t,ce=i,ye.tag){case 1:if(me=ye.payload,typeof me=="function"){ee=me.call(ce,ee,Q);break e}ee=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=ye.payload,Q=typeof me=="function"?me.call(ce,ee,Q):me,Q==null)break e;ee=B({},ee,Q);break e;case 2:Fr=!0}}b.callback!==null&&b.lane!==0&&(e.flags|=64,Q=d.effects,Q===null?d.effects=[b]:Q.push(b))}else ce={eventTime:ce,lane:Q,tag:b.tag,payload:b.payload,callback:b.callback,next:null},J===null?(U=J=ce,_=ee):J=J.next=ce,v|=Q;if(b=b.next,b===null){if(b=d.shared.pending,b===null)break;Q=b,b=Q.next,Q.next=null,d.lastBaseUpdate=Q,d.shared.pending=null}}while(!0);if(J===null&&(_=ee),d.baseState=_,d.firstBaseUpdate=U,d.lastBaseUpdate=J,t=d.shared.interleaved,t!==null){d=t;do v|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);fs|=v,e.lanes=v,e.memoizedState=ee}}function mf(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 Ii={},ar=zr(Ii),Di=zr(Ii),Mi=zr(Ii);function us(e){if(e===Ii)throw Error(s(174));return e}function Ja(e,t){switch(ht(Mi,t),ht(Di,e),ht(ar,Ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ft(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ft(t,e)}yt(ar),ht(ar,t)}function Ws(){yt(ar),yt(Di),yt(Mi)}function gf(e){us(Mi.current);var t=us(ar.current),i=ft(t,e.type);t!==i&&(ht(Di,e),ht(ar,i))}function ec(e){Di.current===e&&(yt(ar),yt(Di))}var Et=zr(0);function Yo(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 tc=[];function nc(){for(var e=0;e<tc.length;e++)tc[e]._workInProgressVersionPrimary=null;tc.length=0}var Xo=I.ReactCurrentDispatcher,rc=I.ReactCurrentBatchConfig,ds=0,_t=null,$t=null,Ht=null,Qo=!1,Li=!1,Pi=0,Ev=0;function ln(){throw Error(s(321))}function sc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Yn(e[i],t[i]))return!1;return!0}function ic(e,t,i,l,d,p){if(ds=p,_t=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xo.current=e===null||e.memoizedState===null?Av:Iv,e=i(l,d),Li){p=0;do{if(Li=!1,Pi=0,25<=p)throw Error(s(301));p+=1,Ht=$t=null,t.updateQueue=null,Xo.current=Dv,e=i(l,d)}while(Li)}if(Xo.current=el,t=$t!==null&&$t.next!==null,ds=0,Ht=$t=_t=null,Qo=!1,t)throw Error(s(300));return e}function oc(){var e=Pi!==0;return Pi=0,e}function cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?_t.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Un(){if($t===null){var e=_t.alternate;e=e!==null?e.memoizedState:null}else e=$t.next;var t=Ht===null?_t.memoizedState:Ht.next;if(t!==null)Ht=t,$t=e;else{if(e===null)throw Error(s(310));$t=e,e={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},Ht===null?_t.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function zi(e,t){return typeof t=="function"?t(e):t}function lc(e){var t=Un(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=$t,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var v=d.next;d.next=p.next,p.next=v}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var b=v=null,_=null,U=p;do{var J=U.lane;if((ds&J)===J)_!==null&&(_=_.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),l=U.hasEagerState?U.eagerState:e(l,U.action);else{var ee={lane:J,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};_===null?(b=_=ee,v=l):_=_.next=ee,_t.lanes|=J,fs|=J}U=U.next}while(U!==null&&U!==p);_===null?v=l:_.next=b,Yn(l,t.memoizedState)||(Sn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=_,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,_t.lanes|=p,fs|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function ac(e){var t=Un(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var v=d=d.next;do p=e(p,v.action),v=v.next;while(v!==d);Yn(p,t.memoizedState)||(Sn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function vf(){}function yf(e,t){var i=_t,l=Un(),d=t(),p=!Yn(l.memoizedState,d);if(p&&(l.memoizedState=d,Sn=!0),l=l.queue,cc(kf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ht!==null&&Ht.memoizedState.tag&1){if(i.flags|=2048,Oi(9,wf.bind(null,i,l,d,t),void 0,null),Vt===null)throw Error(s(349));(ds&30)!==0||xf(i,t,d)}return d}function xf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function wf(e,t,i,l){t.value=i,t.getSnapshot=l,Sf(t)&&Tf(e)}function kf(e,t,i){return i(function(){Sf(t)&&Tf(e)})}function Sf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Yn(e,i)}catch{return!0}}function Tf(e){var t=kr(e,1);t!==null&&er(t,e,1,-1)}function bf(e){var t=cr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:e},t.queue=e,e=e.dispatch=Rv.bind(null,_t,e),[t.memoizedState,e]}function Oi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.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 Nf(){return Un().memoizedState}function Zo(e,t,i,l){var d=cr();_t.flags|=e,d.memoizedState=Oi(1|t,i,void 0,l===void 0?null:l)}function Jo(e,t,i,l){var d=Un();l=l===void 0?null:l;var p=void 0;if($t!==null){var v=$t.memoizedState;if(p=v.destroy,l!==null&&sc(l,v.deps)){d.memoizedState=Oi(t,i,p,l);return}}_t.flags|=e,d.memoizedState=Oi(1|t,i,p,l)}function Cf(e,t){return Zo(8390656,8,e,t)}function cc(e,t){return Jo(2048,8,e,t)}function Ef(e,t){return Jo(4,2,e,t)}function _f(e,t){return Jo(4,4,e,t)}function jf(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 Rf(e,t,i){return i=i!=null?i.concat([e]):null,Jo(4,4,jf.bind(null,t,e),i)}function uc(){}function Af(e,t){var i=Un();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&sc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function If(e,t){var i=Un();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&sc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Df(e,t,i){return(ds&21)===0?(e.baseState&&(e.baseState=!1,Sn=!0),e.memoizedState=i):(Yn(i,t)||(i=hi(),_t.lanes|=i,fs|=i,e.baseState=!0),t)}function _v(e,t){var i=Qe;Qe=i!==0&&4>i?i:4,e(!0);var l=rc.transition;rc.transition={};try{e(!1),t()}finally{Qe=i,rc.transition=l}}function Mf(){return Un().memoizedState}function jv(e,t,i){var l=Vr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Lf(e))Pf(t,i);else if(i=ff(e,t,i,l),i!==null){var d=mn();er(i,e,l,d),zf(i,t,l)}}function Rv(e,t,i){var l=Vr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Lf(e))Pf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var v=t.lastRenderedState,b=p(v,i);if(d.hasEagerState=!0,d.eagerState=b,Yn(b,v)){var _=t.interleaved;_===null?(d.next=d,Qa(t)):(d.next=_.next,_.next=d),t.interleaved=d;return}}catch{}finally{}i=ff(e,t,d,l),i!==null&&(d=mn(),er(i,e,l,d),zf(i,t,l))}}function Lf(e){var t=e.alternate;return e===_t||t!==null&&t===_t}function Pf(e,t){Li=Qo=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function zf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Ir(e,i)}}var el={readContext:Fn,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},Av={readContext:Fn,useCallback:function(e,t){return cr().memoizedState=[e,t===void 0?null:t],e},useContext:Fn,useEffect:Cf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Zo(4194308,4,jf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zo(4,2,e,t)},useMemo:function(e,t){var i=cr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=cr();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=jv.bind(null,_t,e),[l.memoizedState,e]},useRef:function(e){var t=cr();return e={current:e},t.memoizedState=e},useState:bf,useDebugValue:uc,useDeferredValue:function(e){return cr().memoizedState=e},useTransition:function(){var e=bf(!1),t=e[0];return e=_v.bind(null,e[1]),cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=_t,d=cr();if(St){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Vt===null)throw Error(s(349));(ds&30)!==0||xf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,Cf(kf.bind(null,l,p,e),[e]),l.flags|=2048,Oi(9,wf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=cr(),t=Vt.identifierPrefix;if(St){var i=wr,l=xr;i=(l&~(1<<32-fn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Pi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Ev++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Iv={readContext:Fn,useCallback:Af,useContext:Fn,useEffect:cc,useImperativeHandle:Rf,useInsertionEffect:Ef,useLayoutEffect:_f,useMemo:If,useReducer:lc,useRef:Nf,useState:function(){return lc(zi)},useDebugValue:uc,useDeferredValue:function(e){var t=Un();return Df(t,$t.memoizedState,e)},useTransition:function(){var e=lc(zi)[0],t=Un().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:yf,useId:Mf,unstable_isNewReconciler:!1},Dv={readContext:Fn,useCallback:Af,useContext:Fn,useEffect:cc,useImperativeHandle:Rf,useInsertionEffect:Ef,useLayoutEffect:_f,useMemo:If,useReducer:ac,useRef:Nf,useState:function(){return ac(zi)},useDebugValue:uc,useDeferredValue:function(e){var t=Un();return $t===null?t.memoizedState=e:Df(t,$t.memoizedState,e)},useTransition:function(){var e=ac(zi)[0],t=Un().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:yf,useId:Mf,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=B({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function dc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:B({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tl={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Vr(e),p=Sr(l,d);p.payload=t,i!=null&&(p.callback=i),t=Ur(e,p,d),t!==null&&(er(t,e,d,l),qo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=mn(),d=Vr(e),p=Sr(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Ur(e,p,d),t!==null&&(er(t,e,d,l),qo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=mn(),l=Vr(e),d=Sr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Ur(e,d,l),t!==null&&(er(t,e,l,i),qo(t,e,l))}};function Of(e,t,i,l,d,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,v):t.prototype&&t.prototype.isPureReactComponent?!bi(i,l)||!bi(d,p):!0}function $f(e,t,i){var l=!1,d=Or,p=t.contextType;return typeof p=="object"&&p!==null?p=Fn(p):(d=kn(t)?os:on.current,l=t.contextTypes,p=(l=l!=null)?Ps(e,d):Or),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=tl,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Ff(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&&tl.enqueueReplaceState(t,t.state,null)}function fc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},Za(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Fn(p):(p=kn(t)?os:on.current,d.context=Ps(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(dc(e,t,p,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&&tl.enqueueReplaceState(d,d.state,null),Ko(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Hs(e,t){try{var i="",l=t;do i+=ve(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
|
+
Error generating stack: `+p.message+`
|
|
40
|
+
`+p.stack}return{value:e,source:t,stack:d,digest:null}}function pc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function hc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var Mv=typeof WeakMap=="function"?WeakMap:Map;function Uf(e,t,i){i=Sr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){al||(al=!0,jc=l),hc(e,t)},i}function Bf(e,t,i){i=Sr(-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(){hc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){hc(e,t),typeof l!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Wf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Mv;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=Kv.bind(null,e,t,i),t.then(e,e))}function Hf(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 Vf(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=Sr(-1,1),t.tag=2,Ur(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Lv=I.ReactCurrentOwner,Sn=!1;function hn(e,t,i,l){t.child=e===null?df(t,null,i,l):Fs(t,e.child,i,l)}function Gf(e,t,i,l,d){i=i.render;var p=t.ref;return Bs(t,d),l=ic(e,t,i,l,p,d),i=oc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Tr(e,t,d)):(St&&i&&Ba(t),t.flags|=1,hn(e,t,l,d),t.child)}function qf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Pc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Kf(e,t,p,l,d)):(e=hl(i.type,null,l,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var v=p.memoizedProps;if(i=i.compare,i=i!==null?i:bi,i(v,l)&&e.ref===t.ref)return Tr(e,t,d)}return t.flags|=1,e=qr(p,l),e.ref=t.ref,e.return=t,t.child=e}function Kf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(bi(p,l)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Tr(e,t,d)}return mc(e,t,i,l,d)}function Yf(e,t,i){var l=t.pendingProps,d=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(Gs,Dn),Dn|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(Gs,Dn),Dn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ht(Gs,Dn),Dn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ht(Gs,Dn),Dn|=l;return hn(e,t,d,i),t.child}function Xf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function mc(e,t,i,l,d){var p=kn(i)?os:on.current;return p=Ps(t,p),Bs(t,d),i=ic(e,t,i,l,p,d),l=oc(),e!==null&&!Sn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Tr(e,t,d)):(St&&l&&Ba(t),t.flags|=1,hn(e,t,i,d),t.child)}function Qf(e,t,i,l,d){if(kn(i)){var p=!0;$o(t)}else p=!1;if(Bs(t,d),t.stateNode===null)rl(e,t),$f(t,i,l),fc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,b=t.memoizedProps;v.props=b;var _=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=Fn(U):(U=kn(i)?os:on.current,U=Ps(t,U));var J=i.getDerivedStateFromProps,ee=typeof J=="function"||typeof v.getSnapshotBeforeUpdate=="function";ee||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==l||_!==U)&&Ff(t,v,l,U),Fr=!1;var Q=t.memoizedState;v.state=Q,Ko(t,l,v,d),_=t.memoizedState,b!==l||Q!==_||wn.current||Fr?(typeof J=="function"&&(dc(t,i,J,l),_=t.memoizedState),(b=Fr||Of(t,i,b,l,Q,_,U))?(ee||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=_),v.props=l,v.state=_,v.context=U,l=b):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,pf(e,t),b=t.memoizedProps,U=t.type===t.elementType?b:Qn(t.type,b),v.props=U,ee=t.pendingProps,Q=v.context,_=i.contextType,typeof _=="object"&&_!==null?_=Fn(_):(_=kn(i)?os:on.current,_=Ps(t,_));var ce=i.getDerivedStateFromProps;(J=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(b!==ee||Q!==_)&&Ff(t,v,l,_),Fr=!1,Q=t.memoizedState,v.state=Q,Ko(t,l,v,d);var me=t.memoizedState;b!==ee||Q!==me||wn.current||Fr?(typeof ce=="function"&&(dc(t,i,ce,l),me=t.memoizedState),(U=Fr||Of(t,i,U,l,Q,me,_)||!1)?(J||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,me,_),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,me,_)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=me),v.props=l,v.state=me,v.context=_,l=U):(typeof v.componentDidUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),l=!1)}return gc(e,t,i,l,p,d)}function gc(e,t,i,l,d,p){Xf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&tf(t,i,!1),Tr(e,t,p);l=t.stateNode,Lv.current=t;var b=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Fs(t,e.child,null,p),t.child=Fs(t,null,b,p)):hn(e,t,b,p),t.memoizedState=l.state,d&&tf(t,i,!0),t.child}function Zf(e){var t=e.stateNode;t.pendingContext?Jd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jd(e,t.context,!1),Ja(e,t.containerInfo)}function Jf(e,t,i,l,d){return $s(),Ga(d),t.flags|=256,hn(e,t,i,l),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0};function yc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ep(e,t,i){var l=t.pendingProps,d=Et.current,p=!1,v=(t.flags&128)!==0,b;if((b=v)||(b=e!==null&&e.memoizedState===null?!1:(d&2)!==0),b?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ht(Et,d&1),e===null)return Va(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):(v=l.children,e=l.fallback,p?(l=t.mode,p=t.child,v={mode:"hidden",children:v},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=v):p=ml(v,l,0,null),e=gs(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=yc(i),t.memoizedState=vc,e):xc(t,v));if(d=e.memoizedState,d!==null&&(b=d.dehydrated,b!==null))return Pv(e,t,v,l,b,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,b=d.sibling;var _={mode:"hidden",children:l.children};return(v&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=_,t.deletions=null):(l=qr(d,_),l.subtreeFlags=d.subtreeFlags&14680064),b!==null?p=qr(b,p):(p=gs(p,v,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,v=e.child.memoizedState,v=v===null?yc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=vc,l}return p=e.child,e=p.sibling,l=qr(p,{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 xc(e,t){return t=ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nl(e,t,i,l){return l!==null&&Ga(l),Fs(t,e.child,null,i),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=pc(Error(s(422))),nl(e,t,v,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=ml({mode:"visible",children:l.children},d,0,null),p=gs(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Fs(t,e.child,null,v),t.child.memoizedState=yc(v),t.memoizedState=vc,p);if((t.mode&1)===0)return nl(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var b=l.dgst;return l=b,p=Error(s(419)),l=pc(p,l,void 0),nl(e,t,v,l)}if(b=(v&e.childLanes)!==0,Sn||b){if(l=Vt,l!==null){switch(v&-v){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|v))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,kr(e,d),er(l,e,d,-1))}return Lc(),l=pc(Error(s(421))),nl(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=Yv.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,In=Pr(d.nextSibling),An=t,St=!0,Xn=null,e!==null&&(On[$n++]=xr,On[$n++]=wr,On[$n++]=ls,xr=e.id,wr=e.overflow,ls=t),t=xc(t,l.children),t.flags|=4096,t)}function tp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Xa(e.return,t,i)}function wc(e,t,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function np(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(hn(e,t,l.children,i),l=Et.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&&tp(e,i,t);else if(e.tag===19)tp(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(ht(Et,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&&Yo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),wc(t,!1,d,i,p);break;case"backwards":for(i=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Yo(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}wc(t,!0,i,null,p);break;case"together":wc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tr(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fs|=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=qr(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=qr(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function zv(e,t,i){switch(t.tag){case 3:Zf(t),$s();break;case 5:gf(t);break;case 1:kn(t.type)&&$o(t);break;case 4:Ja(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ht(Vo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ht(Et,Et.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?ep(e,t,i):(ht(Et,Et.current&1),e=Tr(e,t,i),e!==null?e.sibling:null);ht(Et,Et.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return np(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ht(Et,Et.current),l)break;return null;case 22:case 23:return t.lanes=0,Yf(e,t,i)}return Tr(e,t,i)}var rp,kc,sp,ip;rp=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}},kc=function(){},sp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,us(ar.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=B({},d,{value:void 0}),l=B({},l,{value:void 0}),p=[];break;case"textarea":d=G(e,d),l=G(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Po)}Fe(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var b=d[U];for(v in b)b.hasOwnProperty(v)&&(i||(i={}),i[v]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(a.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in l){var _=l[U];if(b=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&_!==b&&(_!=null||b!=null))if(U==="style")if(b){for(v in b)!b.hasOwnProperty(v)||_&&_.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in _)_.hasOwnProperty(v)&&b[v]!==_[v]&&(i||(i={}),i[v]=_[v])}else i||(p||(p=[]),p.push(U,i)),i=_;else U==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,b=b?b.__html:void 0,_!=null&&b!==_&&(p=p||[]).push(U,_)):U==="children"?typeof _!="string"&&typeof _!="number"||(p=p||[]).push(U,""+_):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(_!=null&&U==="onScroll"&&vt("scroll",e),p||b===_||(p=[])):(p=p||[]).push(U,_))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},ip=function(e,t,i,l){i!==l&&(t.flags|=4)};function $i(e,t){if(!St)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 Ov(e,t,i){var l=t.pendingProps;switch(Wa(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)&&Oo(),an(t),null;case 3:return l=t.stateNode,Ws(),yt(wn),yt(on),nc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Wo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Xn!==null&&(Ic(Xn),Xn=null))),kc(e,t),an(t),null;case 5:ec(t);var d=us(Mi.current);if(i=t.type,e!==null&&t.stateNode!=null)sp(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=us(ar.current),Wo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[lr]=t,l[ji]=p,e=(t.mode&1)!==0,i){case"dialog":vt("cancel",l),vt("close",l);break;case"iframe":case"object":case"embed":vt("load",l);break;case"video":case"audio":for(d=0;d<Ci.length;d++)vt(Ci[d],l);break;case"source":vt("error",l);break;case"img":case"image":case"link":vt("error",l),vt("load",l);break;case"details":vt("toggle",l);break;case"input":dt(l,p),vt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},vt("invalid",l);break;case"textarea":he(l,p),vt("invalid",l)}Fe(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var b=p[v];v==="children"?typeof b=="string"?l.textContent!==b&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,b,e),d=["children",b]):typeof b=="number"&&l.textContent!==""+b&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,b,e),d=["children",""+b]):a.hasOwnProperty(v)&&b!=null&&v==="onScroll"&&vt("scroll",l)}switch(i){case"input":at(l),yn(l,p,!0);break;case"textarea":at(l),nt(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Po)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{v=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=wt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=v.createElement(i,{is:l.is}):(e=v.createElement(i),i==="select"&&(v=e,l.multiple?v.multiple=!0:l.size&&(v.size=l.size))):e=v.createElementNS(e,i),e[lr]=t,e[ji]=l,rp(e,t,!1,!1),t.stateNode=e;e:{switch(v=$e(i,l),i){case"dialog":vt("cancel",e),vt("close",e),d=l;break;case"iframe":case"object":case"embed":vt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ci.length;d++)vt(Ci[d],e);d=l;break;case"source":vt("error",e),d=l;break;case"img":case"image":case"link":vt("error",e),vt("load",e),d=l;break;case"details":vt("toggle",e),d=l;break;case"input":dt(e,l),d=ze(e,l),vt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=B({},l,{value:void 0}),vt("invalid",e);break;case"textarea":he(e,l),d=G(e,l),vt("invalid",e);break;default:d=l}Fe(i,d),b=d;for(p in b)if(b.hasOwnProperty(p)){var _=b[p];p==="style"?Oe(e,_):p==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,_!=null&&Ot(e,_)):p==="children"?typeof _=="string"?(i!=="textarea"||_!=="")&&rn(e,_):typeof _=="number"&&rn(e,""+_):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?_!=null&&p==="onScroll"&&vt("scroll",e):_!=null&&H(e,p,_,v))}switch(i){case"input":at(e),yn(e,l,!1);break;case"textarea":at(e),nt(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Ce(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?Lt(e,!!l.multiple,p,!1):l.defaultValue!=null&&Lt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Po)}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)ip(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=us(Mi.current),us(ar.current),Wo(t)){if(l=t.stateNode,i=t.memoizedProps,l[lr]=t,(p=l.nodeValue!==i)&&(e=An,e!==null))switch(e.tag){case 3:Lo(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Lo(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[lr]=t,t.stateNode=l}return an(t),null;case 13:if(yt(Et),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(St&&In!==null&&(t.mode&1)!==0&&(t.flags&128)===0)af(),$s(),t.flags|=98560,p=!1;else if(p=Wo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[lr]=t}else $s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;an(t),p=!1}else Xn!==null&&(Ic(Xn),Xn=null),p=!0;if(!p)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||(Et.current&1)!==0?Ft===0&&(Ft=3):Lc())),t.updateQueue!==null&&(t.flags|=4),an(t),null);case 4:return Ws(),kc(e,t),e===null&&Ei(t.stateNode.containerInfo),an(t),null;case 10:return Ya(t.type._context),an(t),null;case 17:return kn(t.type)&&Oo(),an(t),null;case 19:if(yt(Et),p=t.memoizedState,p===null)return an(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)$i(p,!1);else{if(Ft!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=Yo(e),v!==null){for(t.flags|=128,$i(p,!1),l=v.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=i,i=t.child;i!==null;)p=i,e=l,p.flags&=14680066,v=p.alternate,v===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=v.childLanes,p.lanes=v.lanes,p.child=v.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=v.memoizedProps,p.memoizedState=v.memoizedState,p.updateQueue=v.updateQueue,p.type=v.type,e=v.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ht(Et,Et.current&1|2),t.child}e=e.sibling}p.tail!==null&&bt()>qs&&(t.flags|=128,l=!0,$i(p,!1),t.lanes=4194304)}else{if(!l)if(e=Yo(v),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),$i(p,!0),p.tail===null&&p.tailMode==="hidden"&&!v.alternate&&!St)return an(t),null}else 2*bt()-p.renderingStartTime>qs&&i!==1073741824&&(t.flags|=128,l=!0,$i(p,!1),t.lanes=4194304);p.isBackwards?(v.sibling=t.child,t.child=v):(i=p.last,i!==null?i.sibling=v:t.child=v,p.last=v)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=bt(),t.sibling=null,i=Et.current,ht(Et,l?i&1|2:i&1),t):(an(t),null);case 22:case 23:return Mc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Dn&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 $v(e,t){switch(Wa(t),t.tag){case 1:return kn(t.type)&&Oo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ws(),yt(wn),yt(on),nc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ec(t),null;case 13:if(yt(Et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));$s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return yt(Et),null;case 4:return Ws(),null;case 10:return Ya(t.type._context),null;case 22:case 23:return Mc(),null;case 24:return null;default:return null}}var sl=!1,cn=!1,Fv=typeof WeakSet=="function"?WeakSet:Set,de=null;function Vs(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 Sc(e,t,i){try{i()}catch(l){Rt(e,t,l)}}var op=!1;function Uv(e,t){if(Ma=bo,e=zd(),Ca(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,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var v=0,b=-1,_=-1,U=0,J=0,ee=e,Q=null;t:for(;;){for(var ce;ee!==i||d!==0&&ee.nodeType!==3||(b=v+d),ee!==p||l!==0&&ee.nodeType!==3||(_=v+l),ee.nodeType===3&&(v+=ee.nodeValue.length),(ce=ee.firstChild)!==null;)Q=ee,ee=ce;for(;;){if(ee===e)break t;if(Q===i&&++U===d&&(b=v),Q===p&&++J===l&&(_=v),(ce=ee.nextSibling)!==null)break;ee=Q,Q=ee.parentNode}ee=ce}i=b===-1||_===-1?null:{start:b,end:_}}else i=null}i=i||{start:0,end:0}}else i=null;for(La={focusedElem:e,selectionRange:i},bo=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var me=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(me!==null){var ye=me.memoizedProps,Dt=me.memoizedState,$=t.stateNode,A=$.getSnapshotBeforeUpdate(t.elementType===t.type?ye:Qn(t.type,ye),Dt);$.__reactInternalSnapshotBeforeUpdate=A}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(se){Rt(t,t.return,se)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return me=op,op=!1,me}function Fi(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 p=d.destroy;d.destroy=void 0,p!==void 0&&Sc(t,i,p)}d=d.next}while(d!==l)}}function il(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 Tc(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 lp(e){var t=e.alternate;t!==null&&(e.alternate=null,lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lr],delete t[ji],delete t[$a],delete t[Tv],delete t[bv])),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 ap(e){return e.tag===5||e.tag===3||e.tag===4}function cp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ap(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 bc(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=Po));else if(l!==4&&(e=e.child,e!==null))for(bc(e,t,i),e=e.sibling;e!==null;)bc(e,t,i),e=e.sibling}function Nc(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(Nc(e,t,i),e=e.sibling;e!==null;)Nc(e,t,i),e=e.sibling}var Qt=null,Zn=!1;function Br(e,t,i){for(i=i.child;i!==null;)up(e,t,i),i=i.sibling}function up(e,t,i){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(es,i)}catch{}switch(i.tag){case 5:cn||Vs(i,t);case 6:var l=Qt,d=Zn;Qt=null,Br(e,t,i),Qt=l,Zn=d,Qt!==null&&(Zn?(e=Qt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Qt.removeChild(i.stateNode));break;case 18:Qt!==null&&(Zn?(e=Qt,i=i.stateNode,e.nodeType===8?Oa(e.parentNode,i):e.nodeType===1&&Oa(e,i),yi(e)):Oa(Qt,i.stateNode));break;case 4:l=Qt,d=Zn,Qt=i.stateNode.containerInfo,Zn=!0,Br(e,t,i),Qt=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!cn&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,v=p.destroy;p=p.tag,v!==void 0&&((p&2)!==0||(p&4)!==0)&&Sc(i,t,v),d=d.next}while(d!==l)}Br(e,t,i);break;case 1:if(!cn&&(Vs(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(b){Rt(i,t,b)}Br(e,t,i);break;case 21:Br(e,t,i);break;case 22:i.mode&1?(cn=(l=cn)||i.memoizedState!==null,Br(e,t,i),cn=l):Br(e,t,i);break;default:Br(e,t,i)}}function dp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Fv),t.forEach(function(l){var d=Xv.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function Jn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,v=t,b=v;e:for(;b!==null;){switch(b.tag){case 5:Qt=b.stateNode,Zn=!1;break e;case 3:Qt=b.stateNode.containerInfo,Zn=!0;break e;case 4:Qt=b.stateNode.containerInfo,Zn=!0;break e}b=b.return}if(Qt===null)throw Error(s(160));up(p,v,d),Qt=null,Zn=!1;var _=d.alternate;_!==null&&(_.return=null),d.return=null}catch(U){Rt(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fp(t,e),t=t.sibling}function fp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),ur(e),l&4){try{Fi(3,e,e.return),il(3,e)}catch(ye){Rt(e,e.return,ye)}try{Fi(5,e,e.return)}catch(ye){Rt(e,e.return,ye)}}break;case 1:Jn(t,e),ur(e),l&512&&i!==null&&Vs(i,i.return);break;case 5:if(Jn(t,e),ur(e),l&512&&i!==null&&Vs(i,i.return),e.flags&32){var d=e.stateNode;try{rn(d,"")}catch(ye){Rt(e,e.return,ye)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,b=e.type,_=e.updateQueue;if(e.updateQueue=null,_!==null)try{b==="input"&&p.type==="radio"&&p.name!=null&&Be(d,p),$e(b,v);var U=$e(b,p);for(v=0;v<_.length;v+=2){var J=_[v],ee=_[v+1];J==="style"?Oe(d,ee):J==="dangerouslySetInnerHTML"?Ot(d,ee):J==="children"?rn(d,ee):H(d,J,ee,U)}switch(b){case"input":nn(d,p);break;case"textarea":Ue(d,p);break;case"select":var Q=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var ce=p.value;ce!=null?Lt(d,!!p.multiple,ce,!1):Q!==!!p.multiple&&(p.defaultValue!=null?Lt(d,!!p.multiple,p.defaultValue,!0):Lt(d,!!p.multiple,p.multiple?[]:"",!1))}d[ji]=p}catch(ye){Rt(e,e.return,ye)}}break;case 6:if(Jn(t,e),ur(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ye){Rt(e,e.return,ye)}}break;case 3:if(Jn(t,e),ur(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ye){Rt(e,e.return,ye)}break;case 4:Jn(t,e),ur(e);break;case 13:Jn(t,e),ur(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(_c=bt())),l&4&&dp(e);break;case 22:if(J=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(U=cn)||J,Jn(t,e),cn=U):Jn(t,e),ur(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!J&&(e.mode&1)!==0)for(de=e,J=e.child;J!==null;){for(ee=de=J;de!==null;){switch(Q=de,ce=Q.child,Q.tag){case 0:case 11:case 14:case 15:Fi(4,Q,Q.return);break;case 1:Vs(Q,Q.return);var me=Q.stateNode;if(typeof me.componentWillUnmount=="function"){l=Q,i=Q.return;try{t=l,me.props=t.memoizedProps,me.state=t.memoizedState,me.componentWillUnmount()}catch(ye){Rt(l,i,ye)}}break;case 5:Vs(Q,Q.return);break;case 22:if(Q.memoizedState!==null){mp(ee);continue}}ce!==null?(ce.return=Q,de=ce):mp(ee)}J=J.sibling}e:for(J=null,ee=e;;){if(ee.tag===5){if(J===null){J=ee;try{d=ee.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(b=ee.stateNode,_=ee.memoizedProps.style,v=_!=null&&_.hasOwnProperty("display")?_.display:null,b.style.display=z("display",v))}catch(ye){Rt(e,e.return,ye)}}}else if(ee.tag===6){if(J===null)try{ee.stateNode.nodeValue=U?"":ee.memoizedProps}catch(ye){Rt(e,e.return,ye)}}else if((ee.tag!==22&&ee.tag!==23||ee.memoizedState===null||ee===e)&&ee.child!==null){ee.child.return=ee,ee=ee.child;continue}if(ee===e)break e;for(;ee.sibling===null;){if(ee.return===null||ee.return===e)break e;J===ee&&(J=null),ee=ee.return}J===ee&&(J=null),ee.sibling.return=ee.return,ee=ee.sibling}}break;case 19:Jn(t,e),ur(e),l&4&&dp(e);break;case 21:break;default:Jn(t,e),ur(e)}}function ur(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(ap(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&&(rn(d,""),l.flags&=-33);var p=cp(e);Nc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,b=cp(e);bc(e,b,v);break;default:throw Error(s(161))}}catch(_){Rt(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Bv(e,t,i){de=e,pp(e)}function pp(e,t,i){for(var l=(e.mode&1)!==0;de!==null;){var d=de,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||sl;if(!v){var b=d.alternate,_=b!==null&&b.memoizedState!==null||cn;b=sl;var U=cn;if(sl=v,(cn=_)&&!U)for(de=d;de!==null;)v=de,_=v.child,v.tag===22&&v.memoizedState!==null?gp(d):_!==null?(_.return=v,de=_):gp(d);for(;p!==null;)de=p,pp(p),p=p.sibling;de=d,sl=b,cn=U}hp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,de=p):hp(e)}}function hp(e){for(;de!==null;){var t=de;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:cn||il(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!cn)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:Qn(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&mf(t,p,l);break;case 3:var v=t.updateQueue;if(v!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}mf(t,v,i)}break;case 5:var b=t.stateNode;if(i===null&&t.flags&4){i=b;var _=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":_.autoFocus&&i.focus();break;case"img":_.src&&(i.src=_.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var U=t.alternate;if(U!==null){var J=U.memoizedState;if(J!==null){var ee=J.dehydrated;ee!==null&&yi(ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||t.flags&512&&Tc(t)}catch(Q){Rt(t,t.return,Q)}}if(t===e){de=null;break}if(i=t.sibling,i!==null){i.return=t.return,de=i;break}de=t.return}}function mp(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var i=t.sibling;if(i!==null){i.return=t.return,de=i;break}de=t.return}}function gp(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{il(4,t)}catch(_){Rt(t,i,_)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(_){Rt(t,d,_)}}var p=t.return;try{Tc(t)}catch(_){Rt(t,p,_)}break;case 5:var v=t.return;try{Tc(t)}catch(_){Rt(t,v,_)}}}catch(_){Rt(t,t.return,_)}if(t===e){de=null;break}var b=t.sibling;if(b!==null){b.return=t.return,de=b;break}de=t.return}}var Wv=Math.ceil,ol=I.ReactCurrentDispatcher,Cc=I.ReactCurrentOwner,Bn=I.ReactCurrentBatchConfig,Je=0,Vt=null,Pt=null,Zt=0,Dn=0,Gs=zr(0),Ft=0,Ui=null,fs=0,ll=0,Ec=0,Bi=null,Tn=null,_c=0,qs=1/0,br=null,al=!1,jc=null,Wr=null,cl=!1,Hr=null,ul=0,Wi=0,Rc=null,dl=-1,fl=0;function mn(){return(Je&6)!==0?bt():dl!==-1?dl:dl=bt()}function Vr(e){return(e.mode&1)===0?1:(Je&2)!==0&&Zt!==0?Zt&-Zt:Cv.transition!==null?(fl===0&&(fl=hi()),fl):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:vd(e.type)),e)}function er(e,t,i,l){if(50<Wi)throw Wi=0,Rc=null,Error(s(185));ss(e,i,l),((Je&2)===0||e!==Vt)&&(e===Vt&&((Je&2)===0&&(ll|=i),Ft===4&&Gr(e,Zt)),bn(e,l),i===1&&Je===0&&(t.mode&1)===0&&(qs=bt()+500,Fo&&$r()))}function bn(e,t){var i=e.callbackNode;ko(e,t);var l=rs(e,e===Vt?Zt:0);if(l===0)i!==null&&yo(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&yo(i),t===1)e.tag===0?Nv(yp.bind(null,e)):nf(yp.bind(null,e)),kv(function(){(Je&6)===0&&$r()}),i=null;else{switch(re(l)){case 1:i=Rr;break;case 4:i=or;break;case 16:i=Ts;break;case 536870912:i=xo;break;default:i=Ts}i=Cp(i,vp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function vp(e,t){if(dl=-1,fl=0,(Je&6)!==0)throw Error(s(327));var i=e.callbackNode;if(Ks()&&e.callbackNode!==i)return null;var l=rs(e,e===Vt?Zt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var d=Je;Je|=2;var p=wp();(Vt!==e||Zt!==t)&&(br=null,qs=bt()+500,hs(e,t));do try{Gv();break}catch(b){xp(e,b)}while(!0);Ka(),ol.current=p,Je=d,Pt!==null?t=0:(Vt=null,Zt=0,t=Ft)}if(t!==0){if(t===2&&(d=pi(e),d!==0&&(l=d,t=Ac(e,d))),t===1)throw i=Ui,hs(e,0),Gr(e,l),bn(e,bt()),i;if(t===6)Gr(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Hv(d)&&(t=pl(e,l),t===2&&(p=pi(e),p!==0&&(l=p,t=Ac(e,p))),t===1))throw i=Ui,hs(e,0),Gr(e,l),bn(e,bt()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:ms(e,Tn,br);break;case 3:if(Gr(e,l),(l&130023424)===l&&(t=_c+500-bt(),10<t)){if(rs(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){mn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=za(ms.bind(null,e,Tn,br),t);break}ms(e,Tn,br);break;case 4:if(Gr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-fn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=bt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Wv(l/1960))-l,10<l){e.timeoutHandle=za(ms.bind(null,e,Tn,br),l);break}ms(e,Tn,br);break;case 5:ms(e,Tn,br);break;default:throw Error(s(329))}}}return bn(e,bt()),e.callbackNode===i?vp.bind(null,e):null}function Ac(e,t){var i=Bi;return e.current.memoizedState.isDehydrated&&(hs(e,t).flags|=256),e=pl(e,t),e!==2&&(t=Tn,Tn=i,t!==null&&Ic(t)),e}function Ic(e){Tn===null?Tn=e:Tn.push.apply(Tn,e)}function Hv(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],p=d.getSnapshot;d=d.value;try{if(!Yn(p(),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 Gr(e,t){for(t&=~Ec,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-fn(t),l=1<<i;e[i]=-1,t&=~l}}function yp(e){if((Je&6)!==0)throw Error(s(327));Ks();var t=rs(e,0);if((t&1)===0)return bn(e,bt()),null;var i=pl(e,t);if(e.tag!==0&&i===2){var l=pi(e);l!==0&&(t=l,i=Ac(e,l))}if(i===1)throw i=Ui,hs(e,0),Gr(e,t),bn(e,bt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ms(e,Tn,br),bn(e,bt()),null}function Dc(e,t){var i=Je;Je|=1;try{return e(t)}finally{Je=i,Je===0&&(qs=bt()+500,Fo&&$r())}}function ps(e){Hr!==null&&Hr.tag===0&&(Je&6)===0&&Ks();var t=Je;Je|=1;var i=Bn.transition,l=Qe;try{if(Bn.transition=null,Qe=1,e)return e()}finally{Qe=l,Bn.transition=i,Je=t,(Je&6)===0&&$r()}}function Mc(){Dn=Gs.current,yt(Gs)}function hs(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,wv(i)),Pt!==null)for(i=Pt.return;i!==null;){var l=i;switch(Wa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Oo();break;case 3:Ws(),yt(wn),yt(on),nc();break;case 5:ec(l);break;case 4:Ws();break;case 13:yt(Et);break;case 19:yt(Et);break;case 10:Ya(l.type._context);break;case 22:case 23:Mc()}i=i.return}if(Vt=e,Pt=e=qr(e.current,null),Zt=Dn=t,Ft=0,Ui=null,Ec=ll=fs=0,Tn=Bi=null,cs!==null){for(t=0;t<cs.length;t++)if(i=cs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var v=p.next;p.next=d,l.next=v}i.pending=l}cs=null}return e}function xp(e,t){do{var i=Pt;try{if(Ka(),Xo.current=el,Qo){for(var l=_t.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Qo=!1}if(ds=0,Ht=$t=_t=null,Li=!1,Pi=0,Cc.current=null,i===null||i.return===null){Ft=1,Ui=t,Pt=null;break}e:{var p=e,v=i.return,b=i,_=t;if(t=Zt,b.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){var U=_,J=b,ee=J.tag;if((J.mode&1)===0&&(ee===0||ee===11||ee===15)){var Q=J.alternate;Q?(J.updateQueue=Q.updateQueue,J.memoizedState=Q.memoizedState,J.lanes=Q.lanes):(J.updateQueue=null,J.memoizedState=null)}var ce=Hf(v);if(ce!==null){ce.flags&=-257,Vf(ce,v,b,p,t),ce.mode&1&&Wf(p,U,t),t=ce,_=U;var me=t.updateQueue;if(me===null){var ye=new Set;ye.add(_),t.updateQueue=ye}else me.add(_);break e}else{if((t&1)===0){Wf(p,U,t),Lc();break e}_=Error(s(426))}}else if(St&&b.mode&1){var Dt=Hf(v);if(Dt!==null){(Dt.flags&65536)===0&&(Dt.flags|=256),Vf(Dt,v,b,p,t),Ga(Hs(_,b));break e}}p=_=Hs(_,b),Ft!==4&&(Ft=2),Bi===null?Bi=[p]:Bi.push(p),p=v;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var $=Uf(p,_,t);hf(p,$);break e;case 1:b=_;var A=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Wr===null||!Wr.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var se=Bf(p,b,t);hf(p,se);break e}}p=p.return}while(p!==null)}Sp(i)}catch(xe){t=xe,Pt===i&&i!==null&&(Pt=i=i.return);continue}break}while(!0)}function wp(){var e=ol.current;return ol.current=el,e===null?el:e}function Lc(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Vt===null||(fs&268435455)===0&&(ll&268435455)===0||Gr(Vt,Zt)}function pl(e,t){var i=Je;Je|=2;var l=wp();(Vt!==e||Zt!==t)&&(br=null,hs(e,t));do try{Vv();break}catch(d){xp(e,d)}while(!0);if(Ka(),Je=i,ol.current=l,Pt!==null)throw Error(s(261));return Vt=null,Zt=0,Ft}function Vv(){for(;Pt!==null;)kp(Pt)}function Gv(){for(;Pt!==null&&!pa();)kp(Pt)}function kp(e){var t=Np(e.alternate,e,Dn);e.memoizedProps=e.pendingProps,t===null?Sp(e):Pt=t,Cc.current=null}function Sp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Ov(i,t,Dn),i!==null){Pt=i;return}}else{if(i=$v(i,t),i!==null){i.flags&=32767,Pt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Ft===0&&(Ft=5)}function ms(e,t,i){var l=Qe,d=Bn.transition;try{Bn.transition=null,Qe=1,qv(e,t,i,l)}finally{Bn.transition=d,Qe=l}return null}function qv(e,t,i,l){do Ks();while(Hr!==null);if((Je&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 p=i.lanes|i.childLanes;if(So(e,p),e===Vt&&(Pt=Vt=null,Zt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||cl||(cl=!0,Cp(Ts,function(){return Ks(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Bn.transition,Bn.transition=null;var v=Qe;Qe=1;var b=Je;Je|=4,Cc.current=null,Uv(e,i),fp(i,e),pv(La),bo=!!Ma,La=Ma=null,e.current=i,Bv(i),ha(),Je=b,Qe=v,Bn.transition=p}else e.current=i;if(cl&&(cl=!1,Hr=e,ul=d),p=e.pendingLanes,p===0&&(Wr=null),bs(i.stateNode),bn(e,bt()),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(al)throw al=!1,e=jc,jc=null,e;return(ul&1)!==0&&e.tag!==0&&Ks(),p=e.pendingLanes,(p&1)!==0?e===Rc?Wi++:(Wi=0,Rc=e):Wi=0,$r(),null}function Ks(){if(Hr!==null){var e=re(ul),t=Bn.transition,i=Qe;try{if(Bn.transition=null,Qe=16>e?16:e,Hr===null)var l=!1;else{if(e=Hr,Hr=null,ul=0,(Je&6)!==0)throw Error(s(331));var d=Je;for(Je|=4,de=e.current;de!==null;){var p=de,v=p.child;if((de.flags&16)!==0){var b=p.deletions;if(b!==null){for(var _=0;_<b.length;_++){var U=b[_];for(de=U;de!==null;){var J=de;switch(J.tag){case 0:case 11:case 15:Fi(8,J,p)}var ee=J.child;if(ee!==null)ee.return=J,de=ee;else for(;de!==null;){J=de;var Q=J.sibling,ce=J.return;if(lp(J),J===U){de=null;break}if(Q!==null){Q.return=ce,de=Q;break}de=ce}}}var me=p.alternate;if(me!==null){var ye=me.child;if(ye!==null){me.child=null;do{var Dt=ye.sibling;ye.sibling=null,ye=Dt}while(ye!==null)}}de=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,de=v;else e:for(;de!==null;){if(p=de,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Fi(9,p,p.return)}var $=p.sibling;if($!==null){$.return=p.return,de=$;break e}de=p.return}}var A=e.current;for(de=A;de!==null;){v=de;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,de=F;else e:for(v=A;de!==null;){if(b=de,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:il(9,b)}}catch(xe){Rt(b,b.return,xe)}if(b===v){de=null;break e}var se=b.sibling;if(se!==null){se.return=b.return,de=se;break e}de=b.return}}if(Je=d,$r(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(es,e)}catch{}l=!0}return l}finally{Qe=i,Bn.transition=t}}return!1}function Tp(e,t,i){t=Hs(i,t),t=Uf(e,t,1),e=Ur(e,t,1),t=mn(),e!==null&&(ss(e,1,t),bn(e,t))}function Rt(e,t,i){if(e.tag===3)Tp(e,e,i);else for(;t!==null;){if(t.tag===3){Tp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Wr===null||!Wr.has(l))){e=Hs(i,e),e=Bf(t,e,1),t=Ur(t,e,1),e=mn(),t!==null&&(ss(t,1,e),bn(t,e));break}}t=t.return}}function Kv(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=mn(),e.pingedLanes|=e.suspendedLanes&i,Vt===e&&(Zt&i)===i&&(Ft===4||Ft===3&&(Zt&130023424)===Zt&&500>bt()-_c?hs(e,0):Ec|=i),bn(e,t)}function bp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Cs,Cs<<=1,(Cs&130023424)===0&&(Cs=4194304)));var i=mn();e=kr(e,t),e!==null&&(ss(e,t,i),bn(e,i))}function Yv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),bp(e,i)}function Xv(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),bp(e,i)}var Np;Np=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,zv(e,t,i);Sn=(e.flags&131072)!==0}else Sn=!1,St&&(t.flags&1048576)!==0&&rf(t,Bo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;rl(e,t),e=t.pendingProps;var d=Ps(t,on.current);Bs(t,i),d=ic(null,t,l,e,d,i);var p=oc();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)?(p=!0,$o(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Za(t),d.updater=tl,t.stateNode=d,d._reactInternals=t,fc(t,l,e,i),t=gc(null,t,l,!0,p,i)):(t.tag=0,St&&p&&Ba(t),hn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Zv(l),e=Qn(l,e),d){case 0:t=mc(null,t,l,e,i);break e;case 1:t=Qf(null,t,l,e,i);break e;case 11:t=Gf(null,t,l,e,i);break e;case 14:t=qf(null,t,l,Qn(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:Qn(l,d),mc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Qf(e,t,l,d,i);case 3:e:{if(Zf(t),e===null)throw Error(s(387));l=t.pendingProps,p=t.memoizedState,d=p.element,pf(e,t),Ko(t,l,null,i);var v=t.memoizedState;if(l=v.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Hs(Error(s(423)),t),t=Jf(e,t,l,i,d);break e}else if(l!==d){d=Hs(Error(s(424)),t),t=Jf(e,t,l,i,d);break e}else for(In=Pr(t.stateNode.containerInfo.firstChild),An=t,St=!0,Xn=null,i=df(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if($s(),l===d){t=Tr(e,t,i);break e}hn(e,t,l,i)}t=t.child}return t;case 5:return gf(t),e===null&&Va(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Pa(l,d)?v=null:p!==null&&Pa(l,p)&&(t.flags|=32),Xf(e,t),hn(e,t,v,i),t.child;case 6:return e===null&&Va(t),null;case 13:return ep(e,t,i);case 4:return Ja(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fs(t,null,l,i):hn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Gf(e,t,l,d,i);case 7:return hn(e,t,t.pendingProps,i),t.child;case 8:return hn(e,t,t.pendingProps.children,i),t.child;case 12:return hn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,v=d.value,ht(Vo,l._currentValue),l._currentValue=v,p!==null)if(Yn(p.value,v)){if(p.children===d.children&&!wn.current){t=Tr(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var b=p.dependencies;if(b!==null){v=p.child;for(var _=b.firstContext;_!==null;){if(_.context===l){if(p.tag===1){_=Sr(-1,i&-i),_.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var J=U.pending;J===null?_.next=_:(_.next=J.next,J.next=_),U.pending=_}}p.lanes|=i,_=p.alternate,_!==null&&(_.lanes|=i),Xa(p.return,i,t),b.lanes|=i;break}_=_.next}}else if(p.tag===10)v=p.type===t.type?null:p.child;else if(p.tag===18){if(v=p.return,v===null)throw Error(s(341));v.lanes|=i,b=v.alternate,b!==null&&(b.lanes|=i),Xa(v,i,t),v=p.sibling}else v=p.child;if(v!==null)v.return=p;else for(v=p;v!==null;){if(v===t){v=null;break}if(p=v.sibling,p!==null){p.return=v.return,v=p;break}v=v.return}p=v}hn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Bs(t,i),d=Fn(d),l=l(d),t.flags|=1,hn(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),qf(e,t,l,d,i);case 15:return Kf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),rl(e,t),t.tag=1,kn(l)?(e=!0,$o(t)):e=!1,Bs(t,i),$f(t,l,d),fc(t,l,d,i),gc(null,t,l,!0,e,i);case 19:return np(e,t,i);case 22:return Yf(e,t,i)}throw Error(s(156,t.tag))};function Cp(e,t){return fi(e,t)}function Qv(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 Wn(e,t,i,l){return new Qv(e,t,i,l)}function Pc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zv(e){if(typeof e=="function")return Pc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Le)return 11;if(e===Z)return 14}return 2}function qr(e,t){var i=e.alternate;return i===null?(i=Wn(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 hl(e,t,i,l,d,p){var v=2;if(l=e,typeof e=="function")Pc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return gs(i.children,d,p,t);case V:v=8,d|=8;break;case ne:return e=Wn(12,i,t,d|2),e.elementType=ne,e.lanes=p,e;case Re:return e=Wn(13,i,t,d),e.elementType=Re,e.lanes=p,e;case Pe:return e=Wn(19,i,t,d),e.elementType=Pe,e.lanes=p,e;case le:return ml(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ae:v=10;break e;case fe:v=9;break e;case Le:v=11;break e;case Z:v=14;break e;case te:v=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Wn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function gs(e,t,i,l){return e=Wn(7,e,l,t),e.lanes=i,e}function ml(e,t,i,l){return e=Wn(22,e,l,t),e.elementType=le,e.lanes=i,e.stateNode={isHidden:!1},e}function zc(e,t,i){return e=Wn(6,e,null,t),e.lanes=i,e}function Oc(e,t,i){return t=Wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Jv(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=mi(0),this.expirationTimes=mi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mi(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function $c(e,t,i,l,d,p,v,b,_){return e=new Jv(e,t,i,b,_),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Wn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Za(p),e}function ey(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Y,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function Ep(e){if(!e)return Or;e=e._reactInternals;e:{if(rt(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 ef(e,i,t)}return t}function _p(e,t,i,l,d,p,v,b,_){return e=$c(i,l,!0,e,d,p,v,b,_),e.context=Ep(null),i=e.current,l=mn(),d=Vr(i),p=Sr(l,d),p.callback=t??null,Ur(i,p,d),e.current.lanes=d,ss(e,d,l),bn(e,l),e}function gl(e,t,i,l){var d=t.current,p=mn(),v=Vr(d);return i=Ep(i),t.context===null?t.context=i:t.pendingContext=i,t=Sr(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Ur(d,t,v),e!==null&&(er(e,d,v,p),qo(e,d,v)),v}function vl(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 jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Fc(e,t){jp(e,t),(e=e.alternate)&&jp(e,t)}function ty(){return null}var Rp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Uc(e){this._internalRoot=e}yl.prototype.render=Uc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));gl(e,t,null,null)},yl.prototype.unmount=Uc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ps(function(){gl(null,e,null,null)}),t[vr]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ge();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Dr.length&&t!==0&&t<Dr[i].priority;i++);Dr.splice(i,0,e),i===0&&md(e)}};function Bc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ap(){}function ny(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=vl(v);p.call(U)}}var v=_p(t,l,e,0,null,!1,!1,"",Ap);return e._reactRootContainer=v,e[vr]=v.current,Ei(e.nodeType===8?e.parentNode:e),ps(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var b=l;l=function(){var U=vl(_);b.call(U)}}var _=$c(e,0,!1,null,null,!1,!1,"",Ap);return e._reactRootContainer=_,e[vr]=_.current,Ei(e.nodeType===8?e.parentNode:e),ps(function(){gl(t,_,i,l)}),_}function wl(e,t,i,l,d){var p=i._reactRootContainer;if(p){var v=p;if(typeof d=="function"){var b=d;d=function(){var _=vl(v);b.call(_)}}gl(t,v,e,d)}else v=ny(i,t,e,d,l);return vl(v)}S=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=ns(t.pendingLanes);i!==0&&(Ir(t,i|1),bn(t,bt()),(Je&6)===0&&(qs=bt()+500,$r()))}break;case 13:ps(function(){var l=kr(e,1);if(l!==null){var d=mn();er(l,e,1,d)}}),Fc(e,1)}},O=function(e){if(e.tag===13){var t=kr(e,134217728);if(t!==null){var i=mn();er(t,e,134217728,i)}Fc(e,134217728)}},X=function(e){if(e.tag===13){var t=Vr(e),i=kr(e,t);if(i!==null){var l=mn();er(i,e,t,l)}Fc(e,t)}},ge=function(){return Qe},ke=function(e,t){var i=Qe;try{return Qe=e,t()}finally{Qe=i}},He=function(e,t,i){switch(t){case"input":if(nn(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=zo(l);if(!d)throw Error(s(90));Ie(l),nn(l,d)}}}break;case"textarea":Ue(e,i);break;case"select":t=i.value,t!=null&&Lt(e,!!i.multiple,t,!1)}},ct=Dc,pt=ps;var ry={usingClientEntryPoint:!1,Events:[Ri,Ms,zo,gt,Bt,Dc]},Hi={findFiberByHostInstance:is,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},sy={bundleType:Hi.bundleType,version:Hi.version,rendererPackageName:Hi.rendererPackageName,rendererConfig:Hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ss(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.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 kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kl.isDisabled&&kl.supportsFiber)try{es=kl.inject(sy),jn=kl}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ry,Nn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bc(t))throw Error(s(200));return ey(e,t,null,i)},Nn.createRoot=function(e,t){if(!Bc(e))throw Error(s(299));var i=!1,l="",d=Rp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=$c(e,1,!1,null,null,i,!1,l,d),e[vr]=t.current,Ei(e.nodeType===8?e.parentNode:e),new Uc(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=Ss(t),e=e===null?null:e.stateNode,e},Nn.flushSync=function(e){return ps(e)},Nn.hydrate=function(e,t,i){if(!xl(t))throw Error(s(200));return wl(null,e,t,!0,i)},Nn.hydrateRoot=function(e,t,i){if(!Bc(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Rp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=_p(t,null,e,1,i??null,d,!1,p,v),e[vr]=t.current,Ei(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 yl(t)},Nn.render=function(e,t,i){if(!xl(t))throw Error(s(200));return wl(null,e,t,!1,i)},Nn.unmountComponentAtNode=function(e){if(!xl(e))throw Error(s(40));return e._reactRootContainer?(ps(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[vr]=null})}),!0):!1},Nn.unstable_batchedUpdates=Dc,Nn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!xl(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return wl(e,t,i,!1,l)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var $p;function fm(){if($p)return Vc.exports;$p=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(),Vc.exports=py(),Vc.exports}var Fp;function hy(){if(Fp)return Sl;Fp=1;var n=fm();return Sl.createRoot=n.createRoot,Sl.hydrateRoot=n.hydrateRoot,Sl}var my=hy();const gy=dm(my),Up=n=>{let r;const s=new Set,o=(g,x)=>{const w=typeof g=="function"?g(r):g;if(!Object.is(w,r)){const y=r;r=x??(typeof w!="object"||w===null)?w:Object.assign({},r,w),s.forEach(N=>N(r,y))}},a=()=>r,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(s.add(g),()=>s.delete(g))},m=r=n(o,a,h);return h},vy=(n=>n?Up(n):Up),yy=n=>n;function xy(n,r=yy){const s=lt.useSyncExternalStore(n.subscribe,lt.useCallback(()=>r(n.getState()),[n,r]),lt.useCallback(()=>r(n.getInitialState()),[n,r]));return lt.useDebugValue(s),s}const wy=n=>{const r=vy(n),s=o=>xy(r,o);return Object.assign(s,r),s},ky=(n=>wy),pm="agentpane:machines",hm="agentpane:active-machine";function Sy(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function mm(n){return`${n}.repoburg.com`}function Pu(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function gm(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function vm(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function ym(){return gm(pm,[]).filter(r=>Sy(r.mahlas)&&r.hostname===mm(r.mahlas))}function Ty(n){const r={mahlas:n,hostname:mm(n),lastConnectedAt:new Date().toISOString()},s=ym(),o=[r,...s.filter(a=>a.mahlas!==n)];return vm(pm,o),r}function by(){const n=gm(hm,null);return n?ym().find(r=>r.mahlas===n)??null:null}function Ny(n){vm(hm,n)}function Cy(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Pu(n);r&&(Ty(r),Ny(r))}const Bp="http://localhost:9998",Ey=["agent.repoburg.com"];function pr(){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(Ey.includes(o))return Bp;if(Pu(o))return"";const a=by();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Bp}const _y="/api";async function co(n,r,s){const o=await fetch(`${pr()}${_y}${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 En(n){return co("GET",n)}function At(n,r){return co("POST",n,r)}function ea(n){return co("DELETE",n)}function hr(n,r){return co("PATCH",n,r)}function jy(n,r){return co("PUT",n,r)}function Ry(){return En("/sessions")}function Tl(n){return En(`/sessions/${n}`)}function zu(n){return At("/sessions",n)}function Wp(n){return ea(`/sessions/${n}`)}function xm(n,r,s){return At(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{}})}function Ay(n){return At(`/sessions/${n}/cancel`)}function Iy(n,r){return hr(`/sessions/${n}`,{title:r})}function Hp(n){return hr(`/sessions/${n}`,{lifecycle:"finished"})}function Vp(n){return hr(`/sessions/${n}`,{lifecycle:"working"})}function Dy(n,r){return hr(`/sessions/${n}`,{starred:r})}function Gp(n){return hr(`/sessions/${n}`,{has_unreviewed:0})}function My(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),hr(`/sessions/${n}`,a)}function Ly(n,r){return hr(`/sessions/${n}`,{runtime_config:r})}function Py(n,r){return At(`/sessions/${n}/rewind`,{turn_id:r})}function zy(n){return At(`/sessions/${n}/restore`,{})}function Oy(n,r,s){return At(`/sessions/${n}/branch`,{turn_id:r,title:s})}function wm(){return En("/workspaces")}function $y(n,r){return At("/workspaces",{path:n,label:r})}function Fy(n){return At("/workspaces/hide",{path:n})}async function Uy(){const n=await fetch(`${pr()}/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 km(){return En("/folders")}function By(n,r){return At("/folders",{workspace_path:n,name:r})}function qp(n,r){return hr(`/folders/${n}`,r)}function Wy(n){return ea(`/folders/${n}`)}function Hy(n){return At("/sessions/reorder",{moves:n})}function oi(n){return n.status==="pending"||n.status==="running"}function Sm(n){return!!(n!=null&&n.turns.some(oi))}function ta(n){return n?n.turns.some(oi)||(n.threads??[]).some(r=>(r.turns??[]).some(oi)):!1}async function Kp(n,r){const s=await Promise.allSettled(n.map(u=>r(u))),o=new Map;let a=null;return s.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}const Vy=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var s;try{const o=localStorage.getItem("agentpane:last-model-config");o&&n({lastModelConfig:JSON.parse(o)})}catch{}n({loading:!0,error:null});try{const[o,a,u]=await Promise.all([Ry(),wm(),km()]);n({sessions:o,workspaces:a,folders:u,loading:!1});const f=new URLSearchParams(window.location.search),h=f.get("session"),m=f.get("thread"),g=h&&o.some(x=>x.id===h)?h:(s=o[0])==null?void 0:s.id;g&&!r().activeSessionId&&await r().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async s=>{if(r().sessionDetails[s]){const o=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",openTabs:r().openTabs.includes(s)?r().openTabs:[...r().openTabs,s]}),o.has_unreviewed===1&&(Gp(s).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[s]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await Tl(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeSessionId:s,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",loading:!1})),o.has_unreviewed===1&&(Gp(s).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[s]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},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 My(u,s,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),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 zu(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}`)}},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 Wp(s),n(u=>{const f={...u.sessionDetails};delete f[s];const h=u.openTabs.filter(x=>x!==s);let m=u.activeSessionId,g=u.activeTurnIndex;if(u.activeSessionId===s){m=h.length>0?h[h.length-1]:null;const x=m?f[m]:null;g=x&&x.turns.length>0?x.turns.length-1:0}return{sessions:u.sessions.filter(x=>x.id!==s),sessionDetails:f,openTabs:h,activeSessionId:m,activeTurnIndex:g}}),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 Iy(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 Hp(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=>{if(s.length===0)return;n({error:null});const{updated:o,firstError:a}=await Kp(s,Hp);o.size>0&&n(f=>({sessions:f.sessions.map(h=>o.get(h.id)??h)}));const u=s.length-o.size;u===0?r().addToast("info",`${s.length} session${s.length===1?"":"s"} marked as finished`):(n({error:a}),r().addToast(u===s.length?"error":"warn",`Marked ${o.size} of ${s.length} — ${u} failed`))},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await Dy(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 Vp(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=>{if(s.length===0)return;n({error:null});const{updated:o,firstError:a}=await Kp(s,Vp);o.size>0&&n(f=>({sessions:f.sessions.map(h=>o.get(h.id)??h)}));const u=s.length-o.size;u===0?r().addToast("info",`${s.length} session${s.length===1?"":"s"} reopened`):(n({error:a}),r().addToast(u===s.length?"error":"warn",`Reopened ${o.size} of ${s.length} — ${u} failed`))},deleteSessionMany:async s=>{if(s.length===0)return;n({error:null});const o=await Promise.allSettled(s.map(f=>Wp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(s[h])}),a.size===0){n({error:"Failed to delete sessions"}),r().addToast("error","Failed to delete sessions");return}n(f=>{const h={...f.sessionDetails};a.forEach(w=>delete h[w]);const m=f.openTabs.filter(w=>!a.has(w));let g=f.activeSessionId,x=f.activeTurnIndex;if(g&&a.has(g)){g=m.length>0?m[m.length-1]:null;const w=g?h[g]:null;x=w&&w.turns.length>0?w.turns.length-1:0}return{sessions:f.sessions.filter(w=>!a.has(w.id)),sessionDetails:h,openTabs:m,activeSessionId:g,activeTurnIndex:x}}),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(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await xm(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.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 h=f.sessionDetails[a];if(!h)return{};const m=ta(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,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 Ay(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await Py(s,o),u=await Tl(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(h=>h.id===s?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),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 zy(s),a=await Tl(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 Oy(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 Ly(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 Tl(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})}}}),Gy=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await $y(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 Fy(s);const o=await wm();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 zu({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 Uy();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),ws=new Map,Ou=new Map,$u=new Map,Fu=new Map;function qy(n,r){ws.set(n,r)}function Ky(n){ws.delete(n)}function Kc(n,r){Ou.set(n,r)}function Yp(n,r,s){const o=Ou.get(n);if(!o)return;const a=ws.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Yy(n,r,s,o){const a=ws.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function Xy(n,r,s,o){const a=Ou.get(n);if(!a)return;const u=ws.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function Qy(n,r){$u.set(n,r)}function Zy(n){$u.delete(n)}function Jy(n,r){Fu.set(n,r)}function ex(n){Fu.delete(n)}function tx(n){var s;const r=ws.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=Fu.get(n))==null||s()}function nx(n){var s;const r=ws.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=$u.get(n))==null||s()}const rx=(n,r)=>({wsConnected:!1,setWsConnected:s=>n({wsConnected:s}),onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=a.sessionDetails[s];if(!u)return{};const f=u.turns.findIndex(h=>h.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Nr(u,o,h=>({...h,status:"running"})),is_running:1,status:"running"}},sessions:a.sessions.map(h=>h.id===s?{...h,is_running:1,status:"running"}:h),activeTurnIndex:a.activeSessionId===s&&f>=0?f:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Nr(f,o,h=>Xc(h,a))}}:{}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Nr(f,o,h=>Xc(h,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",h=u.description||"background task",g=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${g} completed: ${h}`):r().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Nr(f,o,h=>{var g,x;let m=Xc(h,a);if(a.type==="agent_message"&&((g=a.data)!=null&&g.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((x=a.data)!=null&&x.text)){const w=m.thoughts?m.thoughts+`
|
|
41
|
+
`+a.data.text:a.data.text;m={...m,thoughts:w}}return m})}}:{}})},onItemDelta:(s,o,a,u)=>{Xy(s,o,a,u),n(f=>{const h=f.sessionDetails[s];return h?{sessionDetails:{...f.sessionDetails,[s]:Nr(h,o,m=>sx(m,a,u))}}:{}})},onTurnCompleted:(s,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Yp(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(g=>{const x=g.sessionDetails[s];if(!x)return{};const w=Nr(x,o,N=>({...N,status:"completed",token_usage:a??N.token_usage??null,...f&&!N.agent_response?{agent_response:f}:{}})),y=Yc(w);return{sessionDetails:{...g.sessionDetails,[s]:{...w,is_running:y,status:y?"running":"active",has_unreviewed:u?1:x.has_unreviewed}},sessions:g.sessions.map(N=>N.id===s?{...N,is_running:y,status:y?"running":"active",has_unreviewed:u?1:N.has_unreviewed}:N)}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Nr(f,o,h=>({...h,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)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),Yp(s,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=Nr(f,o,y=>({...y,status:m,error:a,items:y.items.map(N=>N.status==="in_progress"?{...N,status:"failed"}:N)})),x=Yc(g),w=x?"running":h?"active":"failed";return{sessionDetails:{...u.sessionDetails,[s]:{...g,is_running:x,status:w}},sessions:u.sessions.map(y=>y.id===s?{...y,is_running:x,status:w}:y)}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s];if(!u)return{};const f=Nr(u,o,m=>({...m,status:"aborted",items:m.items.map(g=>g.status==="in_progress"?{...g,status:"completed"}:g)})),h=Yc(f);return{sessionDetails:{...a.sessionDetails,[s]:{...f,is_running:h,status:h?"running":"active"}},sessions:a.sessions.map(m=>m.id===s?{...m,is_running:h,status:h?"running":"active"}:m)}})},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=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,backgroundTasks:o}}}:{}})}});function Yc(n){return n.turns.some(oi)||(n.threads??[]).some(s=>(s.turns??[]).some(oi))?1:0}function Nr(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 Xc(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 sx(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 ix(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return En(`/providers/${n}/models${s}`)}const hu=160,mu=480,ox=240,Pl=220,lx=300,ax=600;function zl(){return typeof window>"u"?ax:Math.max(Pl,Math.round(window.innerWidth*.7))}const Xp="agentpane:sidebar-width",Qp="agentpane:right-panel-width";function Zp(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 Jp=200,cx=(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:Zp(Xp,hu,mu,ox),rightPanelWidth:Zp(Qp,Pl,zl(),lx),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(mu,Math.max(hu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(Xp,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(zl(),Math.max(Pl,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(Qp,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(h=>({toasts:[...h.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>Jp&&f.splice(0,f.length-Jp),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await ix(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),ux=(n,r)=>({createThread:async(s,o)=>{try{await At(`/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 At(`/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 At(`/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 hr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await hr(`/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 At(`/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 ea(`/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(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=(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:h}}}})},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)}}}:{}})}}),dx=(n,r)=>({folders:[],loadFolders:async()=>{const s=await km();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await By(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 qp(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 Wy(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 h=a.get(f.id);return h?{...f,folder_id:h.folder_id,sort_order:h.sort_order}:f})}));try{await Hy(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)=>qp(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function eh(){return En("/apps")}function th(n){return En(`/apps/${n}/source`)}function nh(n,r=""){return En(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function Tm(n,r,s=""){return jy(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function fx(n){return ea(`/apps/${n}`)}function px(n){return En(`/apps/${n}/sessions`)}function hx(){return En("/apps/examples")}function mx(n){return At(`/apps/examples/${n}/install`,{})}function gx(n){return At("/apps",n)}function vx(n,r){return At("/apps/import",{id:n,files:r})}function yx(n,r,s){return At(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function xx(n,r){return At(`/apps/${n}/edit-session`,r)}const Al=new Set;async function Qc(n,r){Al.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 gu="agentpane:app-workspaces";function wx(){try{const n=JSON.parse(localStorage.getItem(gu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const kx=(n,r)=>({apps:[],openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:wx(),loadApps:async()=>{try{const s=await eh();s.forEach(o=>Al.add(o.id)),n({apps:s})}catch{}},refreshApps:async()=>{try{const s=await eh();for(const o of s)Al.has(o.id)||(Al.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(gu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await mx(s),await Qc(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await gx(s),await Qc(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await vx(s,o),await Qc(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 xx(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),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,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 Tm(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await fx(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(gu,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}`)}}}),rh=3e3,Ln={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Pn=[];let Ol=0,Uu=0,$l=0,Bu=0,Fl=0,Wu=0,Hu=0;const ro=new Map,so=new Map;let ni=new Map,ei=0,ri=new Map,Zc=!1;function Ul(n,r,s){if(Pn.push({t:Date.now(),cat:n,msg:r,ms:s}),Pn.length>rh){const o=Pn.length-rh;Pn.splice(0,o),Cn=Math.max(0,Cn-o)}}function ti(n,r,s){Ul(n,r,s),console.log(`[perf:${n}] ${r}`)}function bm(n){ti("note",n)}function Nm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function Sx(n,r){let s=ni.get(n);s||ni.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=ro.get(n);o||ro.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function Tx(){ei++,Hu++}function bx(n){ri.set(n,(ri.get(n)??0)+1),so.set(n,(so.get(n)??0)+1)}let Il=0;function Nx(){Il=performance.now()}function Cx(){const n=performance.now(),r=Il?n-Il:null;Il=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Ln.keypressMs&&ti("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Ex=5e3,Cm=500,sh=2e3;let Cn=0,Jc=!1;function _x(n){return At("/perf-log",{entries:n}).then(()=>{Cn+=n.length})}function jx(){if(Jc||Cn>=Pn.length)return;const n=Pn.slice(Cn,Cn+Cm);n.length!==0&&(Jc=!0,_x(n).catch(()=>{Pn.length-Cn>sh&&(Cn=Math.max(Cn,Pn.length-sh))}).finally(()=>{Jc=!1}))}function ih(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Cn>=Pn.length)return;const n=Pn.slice(Cn,Cn+Cm);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${pr()}/api/perf-log`,r),Cn+=n.length}catch{}}function Rx(){let n=0;for(const o of ni.values())n+=o.n;const r=[];if(n>0){const o=[...ni.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Nm(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}ei>0&&r.push(`store ${ei}/s`);const s=[...ri.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(" · ");Ul("stat",o);const a=[...ri.values()].some(u=>u>Ln.renderPerSecLog);(n>Ln.wsPerSecLog||ei>Ln.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ni=new Map,ei=0,ri=new Map}function Ax(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 Ix(){if(Zc||typeof window>"u")return()=>{};Zc=!0,Ol=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Ln.lagMs&&(Uu++,$l=Math.max($l,f),ti("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 h=m=>{const g=m-u;u=m,g>Ln.frameGapMs&&ti("lag",`frame gap ${Math.round(g)}ms`),f=window.requestAnimationFrame(h)};f=window.requestAnimationFrame(h),n.push(()=>window.cancelAnimationFrame(f))}if(typeof PerformanceObserver<"u"){try{const u=new PerformanceObserver(f=>{var h;for(const m of f.getEntries()){const g=m.duration;if(g<Ln.longtaskBufferMs)continue;Bu++,Fl=Math.max(Fl,g);const x=(h=m.attribution)==null?void 0:h[0],w=(x==null?void 0:x.containerName)||(x==null?void 0:x.name)||"unknown",y=`long task ${Math.round(g)}ms (${w})`;g>=Ln.longtaskLogMs?ti("longtask",y,g):Ul("longtask",y,g)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const m=h.duration,g=h.processingStart-h.startTime;Wu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${Ax(h.target)}`;m>=Ln.eventLogMs?ti("input",x,m):Ul("input",x,m)}});u.observe({type:"event",durationThreshold:Ln.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(Rx,1e3);n.push(()=>window.clearInterval(o)),bm("perf logger session started");const a=window.setInterval(jx,Ex);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ih),n.push(()=>window.removeEventListener("beforeunload",ih)),window.__agentPanePerf={dump:Em,reset:_m},()=>{n.forEach(u=>u()),Zc=!1}}function Em(){const n=[],r=Ol?Math.round((Date.now()-Ol)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Pn.length} buffered entries`),n.push(`event-loop lag: ${Uu} blocks >${Ln.lagMs}ms (max ${Math.round($l)}ms)`),n.push(`long tasks: ${Bu} ≥${Ln.longtaskBufferMs}ms (max ${Math.round(Fl)}ms)`),n.push(`slow input events (≥${Ln.eventBufferMs}ms): ${Wu}`),n.push(`store updates: ${Hu} total`),ro.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...ro.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${Nm(o.bytes)}`)}if(so.size>0){n.push("render counts by component:");for(const[s,o]of[...so.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Pn.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
|
|
49
|
+
`)}function _m(){Pn.length=0,Cn=0,Ol=Date.now(),Uu=0,$l=0,Bu=0,Fl=0,Wu=0,Hu=0,ro.clear(),so.clear(),ni=new Map,ei=0,ri=new Map}const en={start:Ix,note:bm,trackWsEvent:Sx,trackStoreUpdate:Tx,trackRender:bx,markKeystroke:Nx,markInputChange:Cx,dump:Em,reset:_m},L=ky()((...n)=>({...Vy(...n),...Gy(...n),...rx(...n),...cx(...n),...ux(...n),...dx(...n),...kx(...n)}));typeof window<"u"&&L.subscribe(()=>en.trackStoreUpdate());function vu(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 Dx(n,r){const s=new Date(n).getTime(),o=r?new Date(r).getTime():Date.now(),a=Math.max(0,Math.floor((o-s)/1e3));if(a<60)return`${a}s`;const u=Math.floor(a/60),f=a%60;if(u<60)return`${u}m ${f}s`;const h=Math.floor(u/60),m=u%60;return`${h}h ${m}m`}function Mx(n,r,s=!1,o="working"){if(o==="finished")return"";if(r)return"running";if(s&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Lx(n,r,s=!1,o="working"){if(o==="finished")return"Finished";if(r)return"Running";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 Vu(n){const r=n.is_running===1,s=n.lifecycle==="finished",o=vu(n.runtime_type);return{dot:Mx(n.status,r,n.has_unreviewed===1,n.lifecycle),label:Lx(n.status,r,n.has_unreviewed===1,n.lifecycle),iconClass:o.iconClass,iconText:o.iconText,isRunning:r,isFinished:s}}function na(n,r,s=!0){k.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 Gu(n,r=!0){k.useEffect(()=>{if(!r)return;function s(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r])}function qu({status:n,size:r=6}){return c.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0})}function jm({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 Px=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rm=(...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 zx={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 Ox=k.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>k.createElement("svg",{ref:m,...zx,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:Rm("lucide",a),...h},[...f.map(([g,x])=>k.createElement(g,x)),...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 Se=(n,r)=>{const s=k.forwardRef(({className:o,...a},u)=>k.createElement(Ox,{ref:u,iconNode:r,className:Rm(`lucide-${Px(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 $x=Se("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 yu=Se("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 Fx=Se("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 Zr=Se("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 io=Se("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 Ku=Se("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 Yu=Se("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 Ux=Se("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 Bl=Se("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 Bx=Se("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 Wx=Se("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 Hx=Se("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 Am=Se("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 oh=Se("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 xu=Se("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 Vx=Se("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 Gx=Se("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"}]]);/**
|
|
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 qx=Se("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"}]]);/**
|
|
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 Im=Se("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"}]]);/**
|
|
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 eu=Se("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"}]]);/**
|
|
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 wu=Se("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"}]]);/**
|
|
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 Kx=Se("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"}]]);/**
|
|
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 Yx=Se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 Xx=Se("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"}]]);/**
|
|
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 Qx=Se("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"}]]);/**
|
|
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 Zx=Se("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"}]]);/**
|
|
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 Jx=Se("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"}]]);/**
|
|
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 nr=Se("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 e0=Se("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"}]]);/**
|
|
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 t0=Se("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"}]]);/**
|
|
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 n0=Se("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"}]]);/**
|
|
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 r0=Se("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"}]]);/**
|
|
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 lh=Se("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"}]]);/**
|
|
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 s0=Se("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
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 i0=Se("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"}]]);/**
|
|
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 Dl=Se("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"}]]);/**
|
|
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 o0=Se("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"}]]);/**
|
|
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 l0=Se("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"}]]);/**
|
|
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 ys=Se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 Dm=Se("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"}]]);/**
|
|
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 a0=Se("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"}]]);/**
|
|
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 oo=Se("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"}]]);/**
|
|
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 Mm=Se("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"}]]);/**
|
|
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 c0=Se("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 ra=Se("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"}]]);/**
|
|
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 u0=Se("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"}]]);/**
|
|
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 li=Se("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Wl=Se("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"}]]);/**
|
|
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 Lm=Se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
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 fr=Se("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"}]]);/**
|
|
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 d0=Se("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"}]]);/**
|
|
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 f0=Se("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"}]]);/**
|
|
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 p0=Se("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"}]]);/**
|
|
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 h0=Se("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"}]]);/**
|
|
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 m0=Se("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"}]]);/**
|
|
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 Gn=Se("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 g0=Se("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 Xi=fm();function v0(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return k.useMemo(()=>o=>{r.forEach(a=>a(o))},r)}const sa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ai(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function Xu(n){return"nodeType"in n}function vn(n){var r,s;return n?ai(n)?n:Xu(n)&&(r=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?r:window:window}function Qu(n){const{Document:r}=vn(n);return n instanceof r}function uo(n){return ai(n)?!1:n instanceof vn(n).HTMLElement}function Pm(n){return n instanceof vn(n).SVGElement}function ci(n){return n?ai(n)?n.document:Xu(n)?Qu(n)?n:uo(n)||Pm(n)?n.ownerDocument:document:document:document}const rr=sa?k.useLayoutEffect:k.useEffect;function ia(n){const r=k.useRef(n);return rr(()=>{r.current=n}),k.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 y0(){const n=k.useRef(null),r=k.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),s=k.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,s]}function lo(n,r){r===void 0&&(r=[n]);const s=k.useRef(n);return rr(()=>{s.current!==n&&(s.current=n)},r),s}function fo(n,r){const s=k.useRef();return k.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...r])}function Hl(n){const r=ia(n),s=k.useRef(null),o=k.useCallback(a=>{a!==s.current&&(r==null||r(a,s.current)),s.current=a},[]);return[s,o]}function Vl(n){const r=k.useRef();return k.useEffect(()=>{r.current=n},[n]),r.current}let tu={};function po(n,r){return k.useMemo(()=>{if(r)return r;const s=tu[n]==null?0:tu[n]+1;return tu[n]=s,n+"-"+s},[n,r])}function zm(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 h=Object.entries(f);for(const[m,g]of h){const x=u[m];x!=null&&(u[m]=x+n*g)}return u},{...r})}}const si=zm(1),Gl=zm(-1);function x0(n){return"clientX"in n&&"clientY"in n}function oa(n){if(!n)return!1;const{KeyboardEvent:r}=vn(n.target);return r&&n instanceof r}function w0(n){if(!n)return!1;const{TouchEvent:r}=vn(n.target);return r&&n instanceof r}function ql(n){if(w0(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 x0(n)?{x:n.clientX,y:n.clientY}:null}const jr=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[jr.Translate.toString(n),jr.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:s,easing:o}=n;return r+" "+s+"ms "+o}}}),ah="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k0(n){return n.matches(ah)?n:n.querySelector(ah)}const S0={display:"none"};function T0(n){let{id:r,value:s}=n;return lt.createElement("div",{id:r,style:S0},s)}function b0(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 lt.createElement("div",{id:r,style:a,role:"status","aria-live":o,"aria-atomic":!0},s)}function N0(){const[n,r]=k.useState("");return{announce:k.useCallback(o=>{o!=null&&r(o)},[]),announcement:n}}const Om=k.createContext(null);function C0(n){const r=k.useContext(Om);k.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function E0(){const[n]=k.useState(()=>new Set),r=k.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[k.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),r]}const _0={draggable:`
|
|
355
|
+
To pick up a draggable item, press the space bar.
|
|
356
|
+
While dragging, use the arrow keys to move the item.
|
|
357
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
358
|
+
`},j0={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 R0(n){let{announcements:r=j0,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=_0}=n;const{announce:u,announcement:f}=N0(),h=po("DndLiveRegion"),[m,g]=k.useState(!1);if(k.useEffect(()=>{g(!0)},[]),C0(k.useMemo(()=>({onDragStart(w){let{active:y}=w;u(r.onDragStart({active:y}))},onDragMove(w){let{active:y,over:N}=w;r.onDragMove&&u(r.onDragMove({active:y,over:N}))},onDragOver(w){let{active:y,over:N}=w;u(r.onDragOver({active:y,over:N}))},onDragEnd(w){let{active:y,over:N}=w;u(r.onDragEnd({active:y,over:N}))},onDragCancel(w){let{active:y,over:N}=w;u(r.onDragCancel({active:y,over:N}))}}),[u,r])),!m)return null;const x=lt.createElement(lt.Fragment,null,lt.createElement(T0,{id:o,value:a.draggable}),lt.createElement(b0,{id:h,announcement:f}));return s?Xi.createPortal(x,s):x}var Ut;(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"})(Ut||(Ut={}));function Kl(){}function A0(n,r){return k.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function I0(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return k.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const sr=Object.freeze({x:0,y:0});function D0(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function M0(n,r){const s=ql(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 L0(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function P0(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function z0(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function ch(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 O0=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=ch(r,r.left,r.top),u=[];for(const f of o){const{id:h}=f,m=s.get(h);if(m){const g=D0(ch(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(L0)};function $0(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,h=u-s;if(o<a&&s<u){const m=r.width*r.height,g=n.width*n.height,x=f*h,w=x/(m+g-x);return Number(w.toFixed(4))}return 0}const F0=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=s.get(f);if(h){const m=$0(h,r);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(P0)};function U0(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function $m(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:sr}function B0(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,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...s})}}const W0=B0(1);function Fm(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 H0(n,r,s){const o=Fm(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(s),g=n.top-h-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),x=a?n.width/a:n.width,w=u?n.height/u:n.height;return{width:x,height:w,top:g,right:m+x,bottom:g+w,left:m}}const V0={ignoreTransform:!1};function ui(n,r){r===void 0&&(r=V0);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:g,transformOrigin:x}=vn(n).getComputedStyle(n);g&&(s=H0(s,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=s;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function uh(n){return ui(n,{ignoreTransform:!0})}function G0(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function q0(n,r){return r===void 0&&(r=vn(n).getComputedStyle(n)),r.position==="fixed"}function K0(n,r){r===void 0&&(r=vn(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 Zu(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(Qu(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!uo(a)||Pm(a)||s.includes(a))return s;const u=vn(n).getComputedStyle(a);return a!==n&&K0(a,u)&&s.push(a),q0(a,u)?s:o(a.parentNode)}return n?o(n):s}function Um(n){const[r]=Zu(n,1);return r??null}function nu(n){return!sa||!n?null:ai(n)?n:Xu(n)?Qu(n)||n===ci(n).scrollingElement?window:uo(n)?n:null:null}function Bm(n){return ai(n)?n.scrollX:n.scrollLeft}function Wm(n){return ai(n)?n.scrollY:n.scrollTop}function ku(n){return{x:Bm(n),y:Wm(n)}}var Yt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Yt||(Yt={}));function Hm(n){return!sa||!n?!1:n===document.scrollingElement}function Vm(n){const r={x:0,y:0},s=Hm(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,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:r}}const Y0={x:.2,y:.2};function X0(n,r,s,o,a){let{top:u,left:f,right:h,bottom:m}=s;o===void 0&&(o=10),a===void 0&&(a=Y0);const{isTop:g,isBottom:x,isLeft:w,isRight:y}=Vm(n),N={x:0,y:0},R={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!g&&u<=r.top+C.height?(N.y=Yt.Backward,R.y=o*Math.abs((r.top+C.height-u)/C.height)):!x&&m>=r.bottom-C.height&&(N.y=Yt.Forward,R.y=o*Math.abs((r.bottom-C.height-m)/C.height)),!y&&h>=r.right-C.width?(N.x=Yt.Forward,R.x=o*Math.abs((r.right-C.width-h)/C.width)):!w&&f<=r.left+C.width&&(N.x=Yt.Backward,R.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:N,speed:R}}function Q0(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 Gm(n){return n.reduce((r,s)=>si(r,ku(s)),sr)}function Z0(n){return n.reduce((r,s)=>r+Bm(s),0)}function J0(n){return n.reduce((r,s)=>r+Wm(s),0)}function qm(n,r){if(r===void 0&&(r=ui),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);Um(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const ew=[["x",["left","right"],Z0],["y",["top","bottom"],J0]];class Ju{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=Zu(s),a=Gm(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,h]of ew)for(const m of f)Object.defineProperty(this,m,{get:()=>{const g=h(o),x=a[u]-g;return this.rect[m]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Zi{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 tw(n){const{EventTarget:r}=vn(n);return n instanceof r?n:ci(n)}function ru(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 Vn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Vn||(Vn={}));function dh(n){n.preventDefault()}function nw(n){n.stopPropagation()}var st;(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"})(st||(st={}));const Km={start:[st.Space,st.Enter],cancel:[st.Esc],end:[st.Space,st.Enter,st.Tab]},rw=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case st.Right:return{...s,x:s.x+25};case st.Left:return{...s,x:s.x-25};case st.Down:return{...s,y:s.y+25};case st.Up:return{...s,y:s.y-25}}};class Ym{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 Zi(ci(s)),this.windowListeners=new Zi(vn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vn.Resize,this.handleCancel),this.windowListeners.add(Vn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&qm(o),s(sr)}handleKeyDown(r){if(oa(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=Km,coordinateGetter:f=rw,scrollBehavior:h="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,x=g?{x:g.left,y:g.top}:sr;this.referenceCoordinates||(this.referenceCoordinates=x);const w=f(r,{active:s,context:o.current,currentCoordinates:x});if(w){const y=Gl(w,x),N={x:0,y:0},{scrollableAncestors:R}=o.current;for(const C of R){const T=r.code,{isTop:P,isRight:M,isLeft:H,isBottom:I,maxScroll:W,minScroll:Y}=Vm(C),K=Q0(C),V={x:Math.min(T===st.Right?K.right-K.width/2:K.right,Math.max(T===st.Right?K.left:K.left+K.width/2,w.x)),y:Math.min(T===st.Down?K.bottom-K.height/2:K.bottom,Math.max(T===st.Down?K.top:K.top+K.height/2,w.y))},ne=T===st.Right&&!M||T===st.Left&&!H,ae=T===st.Down&&!I||T===st.Up&&!P;if(ne&&V.x!==w.x){const fe=C.scrollLeft+y.x,Le=T===st.Right&&fe<=W.x||T===st.Left&&fe>=Y.x;if(Le&&!y.y){C.scrollTo({left:fe,behavior:h});return}Le?N.x=C.scrollLeft-fe:N.x=T===st.Right?C.scrollLeft-W.x:C.scrollLeft-Y.x,N.x&&C.scrollBy({left:-N.x,behavior:h});break}else if(ae&&V.y!==w.y){const fe=C.scrollTop+y.y,Le=T===st.Down&&fe<=W.y||T===st.Up&&fe>=Y.y;if(Le&&!y.x){C.scrollTo({top:fe,behavior:h});return}Le?N.y=C.scrollTop-fe:N.y=T===st.Down?C.scrollTop-W.y:C.scrollTop-Y.y,N.y&&C.scrollBy({top:-N.y,behavior:h});break}}this.handleMove(r,si(Gl(w,this.referenceCoordinates),N))}}}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()}}Ym.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=Km,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function fh(n){return!!(n&&"distance"in n)}function ph(n){return!!(n&&"delay"in n)}class ed{constructor(r,s,o){var a;o===void 0&&(o=tw(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=ci(f),this.documentListeners=new Zi(this.document),this.listeners=new Zi(o),this.windowListeners=new Zi(vn(f)),this.initialCoordinates=(a=ql(u))!=null?a:sr,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(Vn.Resize,this.handleCancel),this.windowListeners.add(Vn.DragStart,dh),this.windowListeners.add(Vn.VisibilityChange,this.handleCancel),this.windowListeners.add(Vn.ContextMenu,dh),this.documentListeners.add(Vn.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ph(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(fh(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(Vn.Click,nw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vn.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(s=ql(r))!=null?s:sr,g=Gl(a,m);if(!o&&h){if(fh(h)){if(h.tolerance!=null&&ru(g,h.tolerance))return this.handleCancel();if(ru(g,h.distance))return this.handleStart()}if(ph(h)&&ru(g,h.tolerance))return this.handleCancel();this.handlePending(h,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===st.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const sw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class td extends ed{constructor(r){const{event:s}=r,o=ci(s.target);super(r,sw,o)}}td.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 iw={move:{name:"mousemove"},end:{name:"mouseup"}};var Su;(function(n){n[n.RightClick=2]="RightClick"})(Su||(Su={}));class ow extends ed{constructor(r){super(r,iw,ci(r.event.target))}}ow.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===Su.RightClick?!1:(o==null||o({event:s}),!0)}}];const su={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class lw extends ed{constructor(r){super(r,su)}static setup(){return window.addEventListener(su.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(su.move.name,r)};function r(){}}}lw.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 Ji;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Ji||(Ji={}));var Yl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Yl||(Yl={}));function aw(n){let{acceleration:r,activator:s=Ji.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Yl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:w,threshold:y}=n;const N=uw({delta:w,disabled:!u}),[R,C]=y0(),T=k.useRef({x:0,y:0}),P=k.useRef({x:0,y:0}),M=k.useMemo(()=>{switch(s){case Ji.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Ji.DraggableRect:return a}},[s,a,m]),H=k.useRef(null),I=k.useCallback(()=>{const Y=H.current;if(!Y)return;const K=T.current.x*P.current.x,V=T.current.y*P.current.y;Y.scrollBy(K,V)},[]),W=k.useMemo(()=>h===Yl.TreeOrder?[...g].reverse():g,[h,g]);k.useEffect(()=>{if(!u||!g.length||!M){C();return}for(const Y of W){if((o==null?void 0:o(Y))===!1)continue;const K=g.indexOf(Y),V=x[K];if(!V)continue;const{direction:ne,speed:ae}=X0(Y,V,M,r,y);for(const fe of["x","y"])N[fe][ne[fe]]||(ae[fe]=0,ne[fe]=0);if(ae.x>0||ae.y>0){C(),H.current=Y,R(I,f),T.current=ae,P.current=ne;return}}T.current={x:0,y:0},P.current={x:0,y:0},C()},[r,I,o,C,u,f,JSON.stringify(M),JSON.stringify(N),R,g,W,x,JSON.stringify(y)])}const cw={x:{[Yt.Backward]:!1,[Yt.Forward]:!1},y:{[Yt.Backward]:!1,[Yt.Forward]:!1}};function uw(n){let{delta:r,disabled:s}=n;const o=Vl(r);return fo(a=>{if(s||!o||!a)return cw;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Yt.Backward]:a.x[Yt.Backward]||u.x===-1,[Yt.Forward]:a.x[Yt.Forward]||u.x===1},y:{[Yt.Backward]:a.y[Yt.Backward]||u.y===-1,[Yt.Forward]:a.y[Yt.Forward]||u.y===1}}},[s,r,o])}function dw(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return fo(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function fw(n,r){return k.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 ao;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ao||(ao={}));var Tu;(function(n){n.Optimized="optimized"})(Tu||(Tu={}));const hh=new Map;function pw(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=k.useState(null),{frequency:h,measure:m,strategy:g}=a,x=k.useRef(n),w=T(),y=lo(w),N=k.useCallback(function(P){P===void 0&&(P=[]),!y.current&&f(M=>M===null?P:M.concat(P.filter(H=>!M.includes(H))))},[y]),R=k.useRef(null),C=fo(P=>{if(w&&!s)return hh;if(!P||P===hh||x.current!==n||u!=null){const M=new Map;for(let H of n){if(!H)continue;if(u&&u.length>0&&!u.includes(H.id)&&H.rect.current){M.set(H.id,H.rect.current);continue}const I=H.node.current,W=I?new Ju(m(I),I):null;H.rect.current=W,W&&M.set(H.id,W)}return M}return P},[n,u,s,w,m]);return k.useEffect(()=>{x.current=n},[n]),k.useEffect(()=>{w||N()},[s,w]),k.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),k.useEffect(()=>{w||typeof h!="number"||R.current!==null||(R.current=setTimeout(()=>{N(),R.current=null},h))},[h,w,N,...o]),{droppableRects:C,measureDroppableContainers:N,measuringScheduled:u!=null};function T(){switch(g){case ao.Always:return!1;case ao.BeforeDragging:return s;default:return!s}}}function nd(n,r){return fo(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function hw(n,r){return nd(n,r)}function mw(n){let{callback:r,disabled:s}=n;const o=ia(r),a=k.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function la(n){let{callback:r,disabled:s}=n;const o=ia(r),a=k.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function gw(n){return new Ju(ui(n),n)}function mh(n,r,s){r===void 0&&(r=gw);const[o,a]=k.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??s)!=null?g:null}const x=r(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=mw({callback(m){if(n)for(const g of m){const{type:x,target:w}=g;if(x==="childList"&&w instanceof HTMLElement&&w.contains(n)){u();break}}}}),h=la({callback:u});return rr(()=>{u(),n?(h==null||h.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),f==null||f.disconnect())},[n]),o}function vw(n){const r=nd(n);return $m(n,r)}const gh=[];function yw(n){const r=k.useRef(n),s=fo(o=>n?o&&o!==gh&&n&&r.current&&n.parentNode===r.current.parentNode?o:Zu(n):gh,[n]);return k.useEffect(()=>{r.current=n},[n]),s}function xw(n){const[r,s]=k.useState(null),o=k.useRef(n),a=k.useCallback(u=>{const f=nu(u.target);f&&s(h=>h?(h.set(f,ku(f)),new Map(h)):null)},[]);return k.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=nu(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,ku(g)]):null}).filter(m=>m!=null);s(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=nu(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),k.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>si(u,f),sr):Gm(n):sr,[n,r])}function vh(n,r){r===void 0&&(r=[]);const s=k.useRef(null);return k.useEffect(()=>{s.current=null},r),k.useEffect(()=>{const o=n!==sr;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?Gl(n,s.current):sr}function ww(n){k.useEffect(()=>{if(!sa)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 kw(n,r){return k.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function Xm(n){return k.useMemo(()=>n?G0(n):null,[n])}const yh=[];function Sw(n,r){r===void 0&&(r=ui);const[s]=n,o=Xm(s?vn(s):null),[a,u]=k.useState(yh);function f(){u(()=>n.length?n.map(m=>Hm(m)?o:new Ju(r(m),m)):yh)}const h=la({callback:f});return rr(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function Qm(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return uo(r)?r:n}function Tw(n){let{measure:r}=n;const[s,o]=k.useState(null),a=k.useCallback(g=>{for(const{target:x}of g)if(uo(x)){o(w=>{const y=r(x);return w?{...w,width:y.width,height:y.height}:y});break}},[r]),u=la({callback:a}),f=k.useCallback(g=>{const x=Qm(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?r(x):null)},[r,u]),[h,m]=Hl(f);return k.useMemo(()=>({nodeRef:h,rect:s,setRef:m}),[s,h,m])}const bw=[{sensor:td,options:{}},{sensor:Ym,options:{}}],Nw={current:{}},Ml={draggable:{measure:uh},droppable:{measure:uh,strategy:ao.WhileDragging,frequency:Tu.Optimized},dragOverlay:{measure:ui}};class eo 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 Cw={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Kl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ml,measureDroppableContainers:Kl,windowRect:null,measuringScheduled:!1},Zm={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Kl,draggableNodes:new Map,over:null,measureDroppableContainers:Kl},ho=k.createContext(Zm),Jm=k.createContext(Cw);function Ew(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eo}}}function _w(n,r){switch(r.type){case Ut.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Ut.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 Ut.DragEnd:case Ut.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ut.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new eo(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case Ut.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 eo(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Ut.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new eo(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function jw(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=k.useContext(ho),u=Vl(o),f=Vl(s==null?void 0:s.id);return k.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!oa(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:m,node:g}=h;if(!m.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[m.current,g.current]){if(!x)continue;const w=k0(x);if(w){w.focus();break}}})}},[o,r,a,f,u]),null}function eg(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function Rw(n){return k.useMemo(()=>({draggable:{...Ml.draggable,...n==null?void 0:n.draggable},droppable:{...Ml.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ml.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 Aw(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=k.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;rr(()=>{if(!f&&!h||!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 x=s(g),w=$m(x,o);if(f||(w.x=0),h||(w.y=0),u.current=!0,Math.abs(w.x)>0||Math.abs(w.y)>0){const y=Um(g);y&&y.scrollBy({top:w.y,left:w.x})}},[r,f,h,o,s])}const aa=k.createContext({...sr,scaleX:1,scaleY:1});var Xr;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Xr||(Xr={}));const Iw=k.memo(function(r){var s,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=bw,collisionDetection:w=F0,measuring:y,modifiers:N,...R}=r;const C=k.useReducer(_w,void 0,Ew),[T,P]=C,[M,H]=E0(),[I,W]=k.useState(Xr.Uninitialized),Y=I===Xr.Initialized,{draggable:{active:K,nodes:V,translate:ne},droppable:{containers:ae}}=T,fe=K!=null?V.get(K):null,Le=k.useRef({initial:null,translated:null}),Re=k.useMemo(()=>{var Ge;return K!=null?{id:K,data:(Ge=fe==null?void 0:fe.data)!=null?Ge:Nw,rect:Le}:null},[K,fe]),Pe=k.useRef(null),[Z,te]=k.useState(null),[le,j]=k.useState(null),q=lo(R,Object.values(R)),B=po("DndDescribedBy",f),E=k.useMemo(()=>ae.getEnabled(),[ae]),D=Rw(y),{droppableRects:ie,measureDroppableContainers:oe,measuringScheduled:ve}=pw(E,{dragging:Y,dependencies:[ne.x,ne.y],config:D.droppable}),pe=dw(V,K),Ae=k.useMemo(()=>le?ql(le):null,[le]),Ce=jt(),be=hw(pe,D.draggable.measure);Aw({activeNode:K!=null?V.get(K):null,config:Ce.layoutShiftCompensation,initialRect:be,measure:D.draggable.measure});const we=mh(pe,D.draggable.measure,be),at=mh(pe?pe.parentElement:null),Ie=k.useRef({activatorEvent:null,active:null,activeNode:pe,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:V,draggingNode:null,draggingNodeRect:null,droppableContainers:ae,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xt=ae.getNodeFor((s=Ie.current.over)==null?void 0:s.id),ze=Tw({measure:D.dragOverlay.measure}),dt=(o=ze.nodeRef.current)!=null?o:pe,Be=Y?(a=ze.rect)!=null?a:we:null,nn=!!(ze.nodeRef.current&&ze.rect),yn=vw(nn?null:we),Mt=Xm(dt?vn(dt):null),Tt=yw(Y?xt??pe:null),Lt=Sw(Tt),G=eg(N,{transform:{x:ne.x-yn.x,y:ne.y-yn.y,scaleX:1,scaleY:1},activatorEvent:le,active:Re,activeNodeRect:we,containerNodeRect:at,draggingNodeRect:Be,over:Ie.current.over,overlayNodeRect:ze.rect,scrollableAncestors:Tt,scrollableAncestorRects:Lt,windowRect:Mt}),he=Ae?si(Ae,ne):null,Ue=xw(Tt),nt=vh(Ue),wt=vh(Ue,[we]),ft=si(G,nt),ot=Be?W0(Be,G):null,Ot=Re&&ot?w({active:Re,collisionRect:ot,droppableRects:ie,droppableContainers:E,pointerCoordinates:he}):null,rn=z0(Ot,"id"),[kt,zn]=k.useState(null),z=nn?G:si(G,wt),Oe=U0(z,(u=kt==null?void 0:kt.rect)!=null?u:null,we),Te=k.useRef(null),Fe=k.useCallback((Ge,mt)=>{let{sensor:gt,options:Bt}=mt;if(Pe.current==null)return;const ct=V.get(Pe.current);if(!ct)return;const pt=Ge.nativeEvent,Ee=new gt({active:Pe.current,activeNode:ct,event:pt,options:Bt,context:Ie,onAbort(Ke){if(!V.get(Ke))return;const{onDragAbort:Wt}=q.current,xn={id:Ke};Wt==null||Wt(xn),M({type:"onDragAbort",event:xn})},onPending(Ke,sn,Wt,xn){if(!V.get(Ke))return;const{onDragPending:_n}=q.current,Xt={id:Ke,constraint:sn,initialCoordinates:Wt,offset:xn};_n==null||_n(Xt),M({type:"onDragPending",event:Xt})},onStart(Ke){const sn=Pe.current;if(sn==null)return;const Wt=V.get(sn);if(!Wt)return;const{onDragStart:xn}=q.current,dn={activatorEvent:pt,active:{id:sn,data:Wt.data,rect:Le}};Xi.unstable_batchedUpdates(()=>{xn==null||xn(dn),W(Xr.Initializing),P({type:Ut.DragStart,initialCoordinates:Ke,active:sn}),M({type:"onDragStart",event:dn}),te(Te.current),j(pt)})},onMove(Ke){P({type:Ut.DragMove,coordinates:Ke})},onEnd:qe(Ut.DragEnd),onCancel:qe(Ut.DragCancel)});Te.current=Ee;function qe(Ke){return async function(){const{active:Wt,collisions:xn,over:dn,scrollAdjustedTranslate:_n}=Ie.current;let Xt=null;if(Wt&&_n){const{cancelDrop:qn}=q.current;Xt={activatorEvent:pt,active:Wt,collisions:xn,delta:_n,over:dn},Ke===Ut.DragEnd&&typeof qn=="function"&&await Promise.resolve(qn(Xt))&&(Ke=Ut.DragCancel)}Pe.current=null,Xi.unstable_batchedUpdates(()=>{P({type:Ke}),W(Xr.Uninitialized),zn(null),te(null),j(null),Te.current=null;const qn=Ke===Ut.DragEnd?"onDragEnd":"onDragCancel";if(Xt){const Kn=q.current[qn];Kn==null||Kn(Xt),M({type:qn,event:Xt})}})}}},[V]),$e=k.useCallback((Ge,mt)=>(gt,Bt)=>{const ct=gt.nativeEvent,pt=V.get(Bt);if(Pe.current!==null||!pt||ct.dndKit||ct.defaultPrevented)return;const Ee={active:pt};Ge(gt,mt.options,Ee)===!0&&(ct.dndKit={capturedBy:mt.sensor},Pe.current=Bt,Fe(gt,mt))},[V,Fe]),ue=fw(x,$e);ww(x),rr(()=>{we&&I===Xr.Initializing&&W(Xr.Initialized)},[we,I]),k.useEffect(()=>{const{onDragMove:Ge}=q.current,{active:mt,activatorEvent:gt,collisions:Bt,over:ct}=Ie.current;if(!mt||!gt)return;const pt={active:mt,activatorEvent:gt,collisions:Bt,delta:{x:ft.x,y:ft.y},over:ct};Xi.unstable_batchedUpdates(()=>{Ge==null||Ge(pt),M({type:"onDragMove",event:pt})})},[ft.x,ft.y]),k.useEffect(()=>{const{active:Ge,activatorEvent:mt,collisions:gt,droppableContainers:Bt,scrollAdjustedTranslate:ct}=Ie.current;if(!Ge||Pe.current==null||!mt||!ct)return;const{onDragOver:pt}=q.current,Ee=Bt.get(rn),qe=Ee&&Ee.rect.current?{id:Ee.id,rect:Ee.rect.current,data:Ee.data,disabled:Ee.disabled}:null,Ke={active:Ge,activatorEvent:mt,collisions:gt,delta:{x:ct.x,y:ct.y},over:qe};Xi.unstable_batchedUpdates(()=>{zn(qe),pt==null||pt(Ke),M({type:"onDragOver",event:Ke})})},[rn]),rr(()=>{Ie.current={activatorEvent:le,active:Re,activeNode:pe,collisionRect:ot,collisions:Ot,droppableRects:ie,draggableNodes:V,draggingNode:dt,draggingNodeRect:Be,droppableContainers:ae,over:kt,scrollableAncestors:Tt,scrollAdjustedTranslate:ft},Le.current={initial:Be,translated:ot}},[Re,pe,Ot,ot,V,dt,Be,ie,ae,kt,Tt,ft]),aw({...Ce,delta:ne,draggingRect:ot,pointerCoordinates:he,scrollableAncestors:Tt,scrollableAncestorRects:Lt});const We=k.useMemo(()=>({active:Re,activeNode:pe,activeNodeRect:we,activatorEvent:le,collisions:Ot,containerNodeRect:at,dragOverlay:ze,draggableNodes:V,droppableContainers:ae,droppableRects:ie,over:kt,measureDroppableContainers:oe,scrollableAncestors:Tt,scrollableAncestorRects:Lt,measuringConfiguration:D,measuringScheduled:ve,windowRect:Mt}),[Re,pe,we,le,Ot,at,ze,V,ae,ie,kt,oe,Tt,Lt,D,ve,Mt]),He=k.useMemo(()=>({activatorEvent:le,activators:ue,active:Re,activeNodeRect:we,ariaDescribedById:{draggable:B},dispatch:P,draggableNodes:V,over:kt,measureDroppableContainers:oe}),[le,ue,Re,we,P,B,V,kt,oe]);return lt.createElement(Om.Provider,{value:H},lt.createElement(ho.Provider,{value:He},lt.createElement(Jm.Provider,{value:We},lt.createElement(aa.Provider,{value:Oe},g)),lt.createElement(jw,{disabled:(h==null?void 0:h.restoreFocus)===!1})),lt.createElement(R0,{...h,hiddenTextDescribedById:B}));function jt(){const Ge=(Z==null?void 0:Z.autoScrollEnabled)===!1,mt=typeof m=="object"?m.enabled===!1:m===!1,gt=Y&&!Ge&&!mt;return typeof m=="object"?{...m,enabled:gt}:{enabled:gt}}}),Dw=k.createContext(null),xh="button",Mw="Draggable";function Lw(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=po(Mw),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:w,over:y}=k.useContext(ho),{role:N=xh,roleDescription:R="draggable",tabIndex:C=0}=a??{},T=(m==null?void 0:m.id)===r,P=k.useContext(T?aa:Dw),[M,H]=Hl(),[I,W]=Hl(),Y=kw(f,r),K=lo(s);rr(()=>(w.set(r,{id:r,key:u,node:M,activatorNode:I,data:K}),()=>{const ne=w.get(r);ne&&ne.key===u&&w.delete(r)}),[w,r]);const V=k.useMemo(()=>({role:N,tabIndex:C,"aria-disabled":o,"aria-pressed":T&&N===xh?!0:void 0,"aria-roledescription":R,"aria-describedby":x.draggable}),[o,N,C,T,R,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:V,isDragging:T,listeners:o?void 0:Y,node:M,over:y,setNodeRef:H,setActivatorNodeRef:W,transform:P}}function tg(){return k.useContext(Jm)}const Pw="Droppable",zw={timeout:25};function ng(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=po(Pw),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=k.useContext(ho),x=k.useRef({disabled:s}),w=k.useRef(!1),y=k.useRef(null),N=k.useRef(null),{disabled:R,updateMeasurementsFor:C,timeout:T}={...zw,...a},P=lo(C??o),M=k.useCallback(()=>{if(!w.current){w.current=!0;return}N.current!=null&&clearTimeout(N.current),N.current=setTimeout(()=>{g(Array.isArray(P.current)?P.current:[P.current]),N.current=null},T)},[T]),H=la({callback:M,disabled:R||!f}),I=k.useCallback((V,ne)=>{H&&(ne&&(H.unobserve(ne),w.current=!1),V&&H.observe(V))},[H]),[W,Y]=Hl(I),K=lo(r);return k.useEffect(()=>{!H||!W.current||(H.disconnect(),w.current=!1,H.observe(W.current))},[W,H]),k.useEffect(()=>(h({type:Ut.RegisterDroppable,element:{id:o,key:u,disabled:s,node:W,rect:y,data:K}}),()=>h({type:Ut.UnregisterDroppable,key:u,id:o})),[o]),k.useEffect(()=>{s!==x.current.disabled&&(h({type:Ut.SetDroppableDisabled,id:o,key:u,disabled:s}),x.current.disabled=s)},[o,u,s,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:W,over:m,setNodeRef:Y}}function Ow(n){let{animation:r,children:s}=n;const[o,a]=k.useState(null),[u,f]=k.useState(null),h=Vl(s);return!s&&!o&&h&&a(h),rr(()=>{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]),lt.createElement(lt.Fragment,null,s,o?k.cloneElement(o,{ref:f}):null)}const $w={x:0,y:0,scaleX:1,scaleY:1};function Fw(n){let{children:r}=n;return lt.createElement(ho.Provider,{value:Zm},lt.createElement(aa.Provider,{value:$w},r))}const Uw={position:"fixed",touchAction:"none"},Bw=n=>oa(n)?"transform 250ms ease":void 0,Ww=k.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Bw}=n;if(!h)return null;const w=a?g:{...g,scaleX:1,scaleY:1},y={...Uw,width:h.width,height:h.height,top:h.top,left:h.left,transform:jr.Transform.toString(w),transformOrigin:a&&o?M0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return lt.createElement(s,{className:f,style:y,ref:r},u)}),Hw=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,m]of Object.entries(u.active))m!==void 0&&(a[h]=s.node.style.getPropertyValue(h),s.node.style.setProperty(h,m));if(u!=null&&u.dragOverlay)for(const[h,m]of Object.entries(u.dragOverlay))m!==void 0&&o.node.style.setProperty(h,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)}},Vw=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:jr.Transform.toString(r)},{transform:jr.Transform.toString(s)}]},Gw={duration:250,easing:"ease",keyframes:Vw,sideEffects:Hw({styles:{active:{opacity:"0"}}})};function qw(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return ia((u,f)=>{if(r===null)return;const h=s.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=Qm(f);if(!g)return;const{transform:x}=vn(f).getComputedStyle(f),w=Fm(x);if(!w)return;const y=typeof r=="function"?r:Kw(r);return qm(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:w})})}function Kw(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...Gw,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!r)return;const x={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},w={scaleX:m.scaleX!==1?f.rect.width*m.scaleX/h.rect.width:1,scaleY:m.scaleY!==1?f.rect.height*m.scaleY/h.rect.height:1},y={x:m.x-x.x,y:m.y-x.y,...w},N=a({...g,active:f,dragOverlay:h,transform:{initial:m,final:y}}),[R]=N,C=N[N.length-1];if(JSON.stringify(R)===JSON.stringify(C))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...g}),P=h.node.animate(N,{duration:r,easing:s,fill:"forwards"});return new Promise(M=>{P.onfinish=()=>{T==null||T(),M()}})}}let wh=0;function Yw(n){return k.useMemo(()=>{if(n!=null)return wh++,wh},[n])}const Xw=lt.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:m,zIndex:g=999}=n;const{activatorEvent:x,active:w,activeNodeRect:y,containerNodeRect:N,draggableNodes:R,droppableContainers:C,dragOverlay:T,over:P,measuringConfiguration:M,scrollableAncestors:H,scrollableAncestorRects:I,windowRect:W}=tg(),Y=k.useContext(aa),K=Yw(w==null?void 0:w.id),V=eg(f,{activatorEvent:x,active:w,activeNodeRect:y,containerNodeRect:N,draggingNodeRect:T.rect,over:P,overlayNodeRect:T.rect,scrollableAncestors:H,scrollableAncestorRects:I,transform:Y,windowRect:W}),ne=nd(y),ae=qw({config:o,draggableNodes:R,droppableContainers:C,measuringConfiguration:M}),fe=ne?T.setRef:void 0;return lt.createElement(Fw,null,lt.createElement(Ow,{animation:ae},w&&K?lt.createElement(Ww,{key:K,id:w.id,ref:fe,as:h,activatorEvent:x,adjustScale:r,className:m,transition:u,rect:ne,style:{zIndex:g,...a},transform:V},s):null))});function rg(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function Qw(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function bl(n){return n!==null&&n>=0}function Zw(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 Jw(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const sg=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=rg(r,o,s),f=r[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Nl={scaleX:1,scaleY:1},kh=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(r=u[s])!=null?r:o;if(!h)return null;if(a===s){const g=u[f];return g?{x:0,y:s<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Nl}:null}const m=e1(u,a,s);return a>s&&a<=f?{x:0,y:-h.height-m,...Nl}:a<s&&a>=f?{x:0,y:h.height+m,...Nl}:{x:0,y:0,...Nl}};function e1(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 ig="Sortable",og=lt.createContext({activeIndex:-1,containerId:ig,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:sg,disabled:{draggable:!1,droppable:!1}});function Sh(n){let{children:r,id:s,items:o,strategy:a=sg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=tg(),w=po(ig,s),y=h.rect!==null,N=k.useMemo(()=>o.map(Y=>typeof Y=="object"&&"id"in Y?Y.id:Y),[o]),R=f!=null,C=f?N.indexOf(f.id):-1,T=g?N.indexOf(g.id):-1,P=k.useRef(N),M=!Zw(N,P.current),H=T!==-1&&C===-1||M,I=Jw(u);rr(()=>{M&&R&&x(N)},[M,N,R,x]),k.useEffect(()=>{P.current=N},[N]);const W=k.useMemo(()=>({activeIndex:C,containerId:w,disabled:I,disableTransforms:H,items:N,overIndex:T,useDragOverlay:y,sortedRects:Qw(N,m),strategy:a}),[C,w,I.draggable,I.droppable,H,N,T,m,y,a]);return lt.createElement(og.Provider,{value:W},r)}const t1=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return rg(s,o,a).indexOf(r)},n1=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:s?!0:f!==a&&r===m},r1={duration:200,easing:"ease"},lg="transform",s1=jr.Transition.toString({property:lg,duration:0,easing:"linear"}),i1={roleDescription:"sortable"};function o1(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=k.useState(null),h=k.useRef(s);return rr(()=>{if(!r&&s!==h.current&&o.current){const m=a.current;if(m){const g=ui(o.current,{ignoreTransform:!0}),x={x:m.left-g.left,y:m.top-g.top,scaleX:m.width/g.width,scaleY:m.height/g.height};(x.x||x.y)&&f(x)}}s!==h.current&&(h.current=s)},[r,s,o,a]),k.useEffect(()=>{u&&f(null)},[u]),u}function ag(n){let{animateLayoutChanges:r=n1,attributes:s,disabled:o,data:a,getNewIndex:u=t1,id:f,strategy:h,resizeObserverConfig:m,transition:g=r1}=n;const{items:x,containerId:w,activeIndex:y,disabled:N,disableTransforms:R,sortedRects:C,overIndex:T,useDragOverlay:P,strategy:M}=k.useContext(og),H=l1(o,N),I=x.indexOf(f),W=k.useMemo(()=>({sortable:{containerId:w,index:I,items:x},...a}),[w,a,I,x]),Y=k.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:V,isOver:ne,setNodeRef:ae}=ng({id:f,data:W,disabled:H.droppable,resizeObserverConfig:{updateMeasurementsFor:Y,...m}}),{active:fe,activatorEvent:Le,activeNodeRect:Re,attributes:Pe,setNodeRef:Z,listeners:te,isDragging:le,over:j,setActivatorNodeRef:q,transform:B}=Lw({id:f,data:W,attributes:{...i1,...s},disabled:H.draggable}),E=v0(ae,Z),D=!!fe,ie=D&&!R&&bl(y)&&bl(T),oe=!P&&le,ve=oe&&ie?B:null,Ae=ie?ve??(h??M)({rects:C,activeNodeRect:Re,activeIndex:y,overIndex:T,index:I}):null,Ce=bl(y)&&bl(T)?u({id:f,items:x,activeIndex:y,overIndex:T}):I,be=fe==null?void 0:fe.id,we=k.useRef({activeId:be,items:x,newIndex:Ce,containerId:w}),at=x!==we.current.items,Ie=r({active:fe,containerId:w,isDragging:le,isSorting:D,id:f,index:I,items:x,newIndex:we.current.newIndex,previousItems:we.current.items,previousContainerId:we.current.containerId,transition:g,wasDragging:we.current.activeId!=null}),xt=o1({disabled:!Ie,index:I,node:V,rect:K});return k.useEffect(()=>{D&&we.current.newIndex!==Ce&&(we.current.newIndex=Ce),w!==we.current.containerId&&(we.current.containerId=w),x!==we.current.items&&(we.current.items=x)},[D,Ce,w,x]),k.useEffect(()=>{if(be===we.current.activeId)return;if(be!=null&&we.current.activeId==null){we.current.activeId=be;return}const dt=setTimeout(()=>{we.current.activeId=be},50);return()=>clearTimeout(dt)},[be]),{active:fe,activeIndex:y,attributes:Pe,data:W,rect:K,index:I,newIndex:Ce,items:x,isOver:ne,isSorting:D,isDragging:le,listeners:te,node:V,overIndex:T,over:j,setNodeRef:E,setActivatorNodeRef:q,setDroppableNodeRef:ae,setDraggableNodeRef:Z,transform:xt??Ae,transition:ze()};function ze(){if(xt||at&&we.current.newIndex===I)return s1;if(!(oe&&!oa(Le)||!g)&&(D||Ie))return jr.Transition.toString({...g,property:lg})}}function l1(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}}st.Down,st.Right,st.Up,st.Left;function iu(n){const[r,s]=k.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=k.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 bu(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 a1(n,r){const s=new Map;for(const f of r){const h=f.cwd||"(no directory)",m=s.get(h)??[];m.push(f),s.set(h,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,h]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function Ys(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Cl(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function c1(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 Th({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=ng({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function u1({s:n,isActive:r,isSelected:s,appIcon:o,renaming:a,renameValue:u,renameRef:f,onRenameValue:h,onRenameConfirm:m,onRenameCancel:g,onSelect:x,onCtxMenu:w,onToggleStar:y}){const{attributes:N,listeners:R,setNodeRef:C,transform:T,transition:P,isDragging:M}=ag({id:`s:${n.id}`}),H=Vu(n);return c.jsxs("div",{ref:C,style:{transform:jr.Transform.toString(T),transition:P},className:`tree-item ${r?"active":""}${s?" selected":""} ${H.isFinished?"tree-item-finished":""}${M?" dragging":""}${n.starred?" tree-item-starred":""}`,...N,...R,onClick:x,onContextMenu:w,children:[c.jsx(jm,{iconClass:H.iconClass,iconText:H.iconText,size:16}),o&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:o}),a?c.jsx("input",{ref:f,className:"tree-rename-input",value:u,onChange:I=>h(I.target.value),onClick:I=>I.stopPropagation(),onPointerDown:I=>I.stopPropagation(),onKeyDown:I=>{I.key==="Enter"&&m(),I.key==="Escape"&&g()},onBlur:m}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!a&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:I=>{I.stopPropagation(),y()},onPointerDown:I=>I.stopPropagation(),children:c.jsx(Wl,{size:10,fill:n.starred?"currentColor":"none"})}),H.dot&&c.jsx(qu,{status:H.dot})]})}function d1({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:w}){const{attributes:y,listeners:N,setNodeRef:R,transform:C,transition:T,isDragging:P,over:M}=ag({id:`f:${n.id}`}),H=M!=null&&String(M.id).startsWith("s:");return c.jsxs("div",{ref:R,style:{transform:jr.Transform.toString(C),transition:T},className:`tree-folder ${s?"collapsed":""}${P?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${H?" drop-over":""}`,...y,...N,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:I=>f(I.target.value),onClick:I=>I.stopPropagation(),onPointerDown:I=>I.stopPropagation(),onKeyDown:I=>{I.key==="Enter"&&h(),I.key==="Escape"&&m()},onBlur:h}):c.jsxs(c.Fragment,{children:[c.jsx(io,{size:8,className:"tree-chevron"}),c.jsx(wu,{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:w})]})}function f1(){const n=L(z=>z.sessions),r=L(z=>z.workspaces),s=L(z=>z.folders),o=L(z=>z.activeSessionId),a=L(z=>z.selectSession),u=L(z=>z.deleteSession),f=L(z=>z.removeWorkspace),h=L(z=>z.createSessionInWorkspace),m=L(z=>z.pickAndAddWorkspace),g=L(z=>z.renameSession),x=L(z=>z.markFinished),w=L(z=>z.markFinishedMany),y=L(z=>z.toggleStar),N=L(z=>z.reopenSession),R=L(z=>z.reopenSessionMany),C=L(z=>z.deleteSessionMany),T=L(z=>z.createSidebarFolder),P=L(z=>z.renameFolder),M=L(z=>z.deleteFolder),H=L(z=>z.applyMoves),I=L(z=>z.reorderFolders),W=L(z=>z.apps),Y=L(z=>z.activeAppTabId),K=L(z=>z.openAppTab),V=L(z=>z.startAppEdit),ne=L(z=>z.toggleAppPin),ae=L(z=>z.deleteApp),fe=L(z=>z.openAppCatalog),[Le,Re]=iu("agentpane:sidebar-ws-collapsed"),[Pe,Z]=iu("agentpane:sidebar-sub-collapsed"),[te,le]=iu("agentpane:sidebar-folders-collapsed"),[j,q]=k.useState(null),[B,E]=k.useState(null),[D,ie]=k.useState(""),[oe,ve]=k.useState(null),[pe,Ae]=k.useState(new Set),[Ce,be]=k.useState(null),we=k.useRef(null),at=k.useRef(null),Ie=I0(A0(td,{activationConstraint:{distance:5}}));function xt(){Ae(new Set),be(null)}na(we,()=>q(null),!!j),Gu(()=>{q(null),xt()},!!j||pe.size>0);const ze=k.useMemo(()=>new Map(n.map(z=>[z.id,z])),[n]),dt=k.useMemo(()=>new Map(s.map(z=>[z.id,z])),[s]),Be=k.useMemo(()=>{const z=new Map;for(const Oe of[...s].sort((Te,Fe)=>Te.sort_order-Fe.sort_order)){const Te=z.get(Oe.workspace_path)??[];Te.push(Oe),z.set(Oe.workspace_path,Te)}return z},[s]);function nn(z){Re(Oe=>{const Te=new Set(Oe);return Te.has(z)?Te.delete(z):Te.add(z),Te})}function yn(z){Z(Oe=>{const Te=new Set(Oe);return Te.has(z)?Te.delete(z):Te.add(z),Te})}function Mt(z){le(Oe=>{const Te=new Set(Oe);return Te.has(z)?Te.delete(z):Te.add(z),Te})}k.useEffect(()=>{B&&at.current&&(at.current.focus(),at.current.select())},[B]);function Tt(z,Oe,Te,Fe=""){E({kind:z,id:Oe}),ie(Te||Fe)}function Lt(){if(B){const z=D.trim();z&&(B.kind==="session"?g(B.id,z):P(B.id,z))}E(null)}function G(){E(null),ie("")}async function he(z){const Oe=c1(Be.get(z)??[]),Te=await T(z,Oe);Te&&Tt("folder",Te.id,Te.name)}function Ue(z){const Oe=String(z.active.id);if(Oe.startsWith("s:")){const Te=ze.get(Oe.slice(2));Te&&ve({kind:"session",label:Te.title||Te.id.slice(0,8)})}else if(Oe.startsWith("f:")){const Te=dt.get(Oe.slice(2));Te&&ve({kind:"folder",label:Te.name})}}function nt(z){ve(null);const{active:Oe,over:Te}=z;if(!Te)return;const Fe=String(Oe.id),$e=String(Te.id);if(Fe.startsWith("s:")){const ue=ze.get(Fe.slice(2));if(!ue)return;const We=ue.cwd||"(no directory)",He=Cl(ue,dt);let jt,Ge;if($e.startsWith("f:")){const Ee=dt.get($e.slice(2));if(!Ee)return;jt=Ee.workspace_path,Ge=Ee.id}else if($e.startsWith("s:")){const Ee=ze.get($e.slice(2));if(!Ee)return;jt=Ee.cwd||"(no directory)",Ge=Cl(Ee,dt)}else if($e.startsWith("c:")){const Ee=$e.slice(2),qe=Ee.lastIndexOf("|");jt=Ee.slice(0,qe);const Ke=Ee.slice(qe+1);Ge=Ke==="root"?null:Ke}else return;if(jt!==We)return;const mt=Ys(n.filter(Ee=>(Ee.cwd||"(no directory)")===jt&&Cl(Ee,dt)===Ge)),gt=mt.filter(Ee=>Ee.id!==ue.id);let Bt=gt.length;if($e.startsWith("s:")){const Ee=gt.findIndex(qe=>qe.id===$e.slice(2));Ee>=0&&(Bt=Ee)}const ct=[...gt.slice(0,Bt),ue,...gt.slice(Bt)],pt=[];if(Ge===He){if(ct.length===mt.length&&ct.every((Ee,qe)=>Ee.id===mt[qe].id))return;ct.forEach((Ee,qe)=>pt.push({id:Ee.id,folder_id:Ge,sort_order:ct.length-1-qe}))}else{const Ee=Ys(n.filter(qe=>(qe.cwd||"(no directory)")===We&&Cl(qe,dt)===He)).filter(qe=>qe.id!==ue.id);Ee.forEach((qe,Ke)=>pt.push({id:qe.id,folder_id:He,sort_order:Ee.length-1-Ke})),ct.forEach((qe,Ke)=>pt.push({id:qe.id,folder_id:Ge,sort_order:ct.length-1-Ke}))}H(pt);return}if(Fe.startsWith("f:")){if(!$e.startsWith("f:"))return;const ue=dt.get(Fe.slice(2)),We=dt.get($e.slice(2));if(!ue||!We||ue.id===We.id||ue.workspace_path!==We.workspace_path)return;const He=(Be.get(ue.workspace_path)??[]).map(mt=>mt.id),jt=He.indexOf(ue.id),Ge=He.indexOf(We.id);He.splice(Ge,0,...He.splice(jt,1)),I(He)}}const wt=a1(r,n),ft=[];for(const z of wt){if(Le.has(z.path))continue;const Oe=Be.get(z.path)??[],Te=new Set(Oe.map($e=>$e.id)),Fe=($e,ue)=>{for(const We of Ys($e.filter(He=>He.lifecycle!=="finished")))ft.push(We.id);if(!Pe.has(ue))for(const We of Ys($e.filter(He=>He.lifecycle==="finished")))ft.push(We.id)};for(const $e of Oe)te.has($e.id)||Fe(z.sessions.filter(ue=>ue.folder_id===$e.id),`folder:${$e.id}:finished`);Fe(z.sessions.filter($e=>!($e.folder_id&&Te.has($e.folder_id))),`${z.path}:finished`)}const ot=n.filter(z=>pe.has(z.id)),Ot=ot.filter(z=>z.lifecycle!=="finished").map(z=>z.id),rn=ot.filter(z=>z.lifecycle==="finished").map(z=>z.id);function kt(z){const Oe=z.origin_app_id?W.find(Fe=>Fe.id===z.origin_app_id):null,Te=Fe=>{if(Fe.metaKey||Fe.ctrlKey){Fe.preventDefault(),be(z.id),Ae($e=>{const ue=new Set($e);return ue.has(z.id)?ue.delete(z.id):ue.add(z.id),ue});return}if(Fe.shiftKey){Fe.preventDefault();const $e=Ce??z.id;be($e);const ue=ft.indexOf($e),We=ft.indexOf(z.id);if(ue>=0&&We>=0){const[He,jt]=ue<We?[ue,We]:[We,ue];Ae(new Set(ft.slice(He,jt+1)))}return}xt(),be(z.id),a(z.id)};return c.jsx(u1,{s:z,isActive:o===z.id,isSelected:pe.has(z.id),appIcon:Oe?Oe.icon??"◧":null,renaming:(B==null?void 0:B.kind)==="session"&&B.id===z.id,renameValue:D,renameRef:at,onRenameValue:ie,onRenameConfirm:Lt,onRenameCancel:G,onSelect:Te,onToggleStar:()=>y(z.id),onCtxMenu:Fe=>{Fe.preventDefault();const $e=pe.has(z.id)&&pe.size>1;pe.has(z.id)||(Ae(new Set),be(z.id)),q({x:Fe.clientX,y:Fe.clientY,type:"session",sessionId:z.id,sessionTitle:z.title,sessionLifecycle:z.lifecycle,sessionExternalId:z.external_thread_id,multi:$e})}},z.id)}function zn(z,Oe){const Te=Ys(z.filter(We=>We.lifecycle!=="finished")),Fe=Ys(z.filter(We=>We.lifecycle==="finished")),$e=[...Te,...Fe].map(We=>`s:${We.id}`),ue=Pe.has(Oe);return c.jsxs(Sh,{items:$e,strategy:kh,children:[Te.length===0&&Fe.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):Te.map(kt),Fe.length>0&&c.jsxs("div",{className:`tree-subgroup ${ue?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>yn(Oe),children:[c.jsx(io,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:Fe.length})]}),!ue&&c.jsx("div",{className:"tree-subgroup-items",children:Fe.map(kt)})]})]})}return c.jsxs("div",{className:"ide-sidebar",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:()=>m(),children:c.jsx(ys,{size:14})})]}),c.jsxs(Iw,{sensors:Ie,collisionDetection:O0,onDragStart:Ue,onDragEnd:nt,children:[wt.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):wt.map(z=>{const Oe=Le.has(z.path),Te=Be.get(z.path)??[],Fe=new Set(Te.map(ue=>ue.id)),$e=z.sessions.filter(ue=>!(ue.folder_id&&Fe.has(ue.folder_id)));return c.jsxs("div",{className:`tree-section ${Oe?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>nn(z.path),onContextMenu:ue=>{ue.preventDefault(),q({x:ue.clientX,y:ue.clientY,type:"workspace",path:z.path})},children:[c.jsx(io,{size:9,className:"tree-chevron"}),c.jsx(wu,{size:14}),c.jsx("span",{className:"tree-section-label",children:z.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:ue=>{ue.stopPropagation(),h(z.path)},children:c.jsx(ys,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:ue=>{ue.stopPropagation(),he(z.path)},children:c.jsx(eu,{size:11})}),c.jsx("span",{className:"tree-count",children:z.sessions.length})]}),!Oe&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Sh,{items:Te.map(ue=>`f:${ue.id}`),strategy:kh,children:Te.map(ue=>{const We=z.sessions.filter(He=>He.folder_id===ue.id);return c.jsx(d1,{folder:ue,count:We.length,collapsed:te.has(ue.id),renaming:(B==null?void 0:B.kind)==="folder"&&B.id===ue.id,renameValue:D,renameRef:at,onRenameValue:ie,onRenameConfirm:Lt,onRenameCancel:G,onToggle:()=>Mt(ue.id),onCtxMenu:He=>{He.preventDefault(),q({x:He.clientX,y:He.clientY,type:"folder",folderId:ue.id,folderName:ue.name})},children:c.jsx(Th,{id:`c:${z.path}|${ue.id}`,children:zn(We,`folder:${ue.id}:finished`)})},ue.id)})}),c.jsx(Th,{id:`c:${z.path}|root`,children:zn($e,`${z.path}:finished`)})]})]},z.path)}),c.jsx(Xw,{children:oe&&c.jsxs("div",{className:"drag-overlay",children:[oe.kind==="folder"&&c.jsx(wu,{size:12}),c.jsx("span",{children:oe.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:()=>fe(),children:c.jsx(ys,{size:14})})]}),W.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),W.map(z=>c.jsxs("div",{className:`sidebar-app-row${Y===z.id?" active":""}`,title:z.description??void 0,onClick:()=>K(z.id),onContextMenu:Oe=>{Oe.preventDefault(),q({x:Oe.clientX,y:Oe.clientY,type:"app",appId:z.id,appPinned:z.pinned})},children:[c.jsx("span",{className:"sidebar-app-icon",children:z.icon??"◧"}),c.jsx("span",{className:"tree-label",children:z.title}),z.pinned&&c.jsx(Wl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]},z.id))]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(eu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),j&&c.jsxs("div",{ref:we,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:()=>{h(j.path),q(null)},children:[c.jsx(ys,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{he(j.path),q(null)},children:[c.jsx(eu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(j.path),q(null)},children:[c.jsx(fr,{size:12})," Hide Workspace"]})]}),j.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Tt("folder",j.folderId,j.folderName??""),q(null)},children:[c.jsx(Dl,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{M(j.folderId),q(null)},children:[c.jsx(fr,{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:()=>{Tt("session",j.sessionId,j.sessionTitle??""),q(null)},children:[c.jsx(Dl,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(j.sessionId),q(null)},children:[c.jsx(Bl,{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&&(bu(j.sessionExternalId),q(null))},children:[c.jsx(xu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(j.sessionId),q(null)},children:[c.jsx(fr,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(j.sessionId),q(null)},children:[c.jsx(oo,{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&&(bu(j.sessionExternalId),q(null))},children:[c.jsx(xu,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(j.sessionId),q(null)},children:[c.jsx(fr,{size:12})," Delete Session"]})]})}),j.type==="session"&&j.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[ot.length," sessions selected"]}),Ot.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{w(Ot),q(null),xt()},children:[c.jsx(Bl,{size:12})," Mark ",Ot.length," as Finished"]}),rn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{R(rn),q(null),xt()},children:[c.jsx(oo,{size:12})," Reopen ",rn.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{C([...pe]),q(null),xt()},children:[c.jsx(fr,{size:12})," Delete ",ot.length," Sessions"]})]}),j.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{V(j.appId),q(null)},children:[c.jsx(Dl,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ne(j.appId),q(null)},children:[c.jsx(Wl,{size:12})," ",j.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{ae(j.appId),q(null)},children:[c.jsx(fr,{size:12})," Delete App"]})]})]})]})}function p1(){const n=L(y=>y.openTabs),r=L(y=>y.activeSessionId),s=L(y=>y.sessions),o=L(y=>y.selectSession),a=L(y=>y.closeTab),u=L(y=>y.setShowNewSessionDialog),f=L(y=>y.apps),h=L(y=>y.openAppTabs),m=L(y=>y.activeAppTabId),g=L(y=>y.openAppTab),x=L(y=>y.closeAppTab),w=L(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const N=s.find(T=>T.id===y);if(!N)return null;const R=Vu(N),C=r===y&&m==null;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>{m!=null&&w(null),o(y)},children:[c.jsx(jm,{iconClass:R.iconClass,iconText:R.iconText,size:14}),N.title||y.slice(0,8),R.dot&&c.jsx(qu,{status:R.dot}),c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),a(y)},children:c.jsx(Gn,{size:12})})]},y)}),h.map(y=>{const N=f.find(C=>C.id===y),R=m===y;return c.jsxs("div",{className:`ide-tab ${R?"active":""}`,onClick:()=>g(y),children:[N!=null&&N.icon?c.jsx("span",{className:"miniapp-tab-icon",children:N.icon}):c.jsx(Qx,{size:12}),(N==null?void 0:N.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:C=>{C.stopPropagation(),x(y)},children:c.jsx(Gn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(ys,{size:14})})]})}function rd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ks=rd();function cg(n){ks=n}var to={exec:()=>null};function it(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(gn.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var gn={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")},h1=/^(?:[ \t]*(?:\n|$))+/,m1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,g1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,v1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sd=/(?:[*+-]|\d{1,9}[.)])/,ug=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dg=it(ug).replace(/bull/g,sd).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(),y1=it(ug).replace(/bull/g,sd).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(),id=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,x1=/^[^\n]+/,od=/(?!\s*\])(?:\\.|[^\[\]\\])+/,w1=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",od).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k1=it(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,sd).getRegex(),ca="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",ld=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,S1=it("^ {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",ld).replace("tag",ca).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fg=it(id).replace("hr",mo).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",ca).getRegex(),T1=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fg).getRegex(),ad={blockquote:T1,code:m1,def:w1,fences:g1,heading:v1,hr:mo,html:S1,lheading:dg,list:k1,newline:h1,paragraph:fg,table:to,text:x1},bh=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mo).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",ca).getRegex(),b1={...ad,lheading:y1,table:bh,paragraph:it(id).replace("hr",mo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bh).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",ca).getRegex()},N1={...ad,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ld).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:to,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(id).replace("hr",mo).replace("heading",` *#{1,6} *[^
|
|
359
|
+
]`).replace("lheading",dg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pg=/^( {2,}|\\)\n(?!\s*$)/,_1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ua=/[\p{P}\p{S}]/u,cd=/[\s\p{P}\p{S}]/u,hg=/[^\s\p{P}\p{S}]/u,j1=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,cd).getRegex(),mg=/(?!~)[\p{P}\p{S}]/u,R1=/(?!~)[\s\p{P}\p{S}]/u,A1=/(?:[^\s\p{P}\p{S}]|~)/u,I1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,gg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,D1=it(gg,"u").replace(/punct/g,ua).getRegex(),M1=it(gg,"u").replace(/punct/g,mg).getRegex(),vg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",L1=it(vg,"gu").replace(/notPunctSpace/g,hg).replace(/punctSpace/g,cd).replace(/punct/g,ua).getRegex(),P1=it(vg,"gu").replace(/notPunctSpace/g,A1).replace(/punctSpace/g,R1).replace(/punct/g,mg).getRegex(),z1=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hg).replace(/punctSpace/g,cd).replace(/punct/g,ua).getRegex(),O1=it(/\\(punct)/,"gu").replace(/punct/g,ua).getRegex(),$1=it(/^<(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(),F1=it(ld).replace("(?:-->|$)","-->").getRegex(),U1=it("^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",F1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,B1=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Xl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yg=it(/^!?\[(label)\]\[(ref)\]/).replace("label",Xl).replace("ref",od).getRegex(),xg=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",od).getRegex(),W1=it("reflink|nolink(?!\\()","g").replace("reflink",yg).replace("nolink",xg).getRegex(),ud={_backpedal:to,anyPunctuation:O1,autolink:$1,blockSkip:I1,br:pg,code:E1,del:to,emStrongLDelim:D1,emStrongRDelimAst:L1,emStrongRDelimUnd:z1,escape:C1,link:B1,nolink:xg,punctuation:j1,reflink:yg,reflinkSearch:W1,tag:U1,text:_1,url:to},H1={...ud,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",Xl).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xl).getRegex()},Nu={...ud,emStrongRDelimAst:P1,emStrongLDelim:M1,url:it(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},V1={...Nu,br:it(pg).replace("{2,}","*").getRegex(),text:it(Nu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},El={normal:ad,gfm:b1,pedantic:N1},Gi={normal:ud,gfm:Nu,breaks:V1,pedantic:H1},G1={"&":"&","<":"<",">":">",'"':""","'":"'"},Nh=n=>G1[n];function dr(n,r){if(r){if(gn.escapeTest.test(n))return n.replace(gn.escapeReplace,Nh)}else if(gn.escapeTestNoEncode.test(n))return n.replace(gn.escapeReplaceNoEncode,Nh);return n}function Ch(n){try{n=encodeURI(n).replace(gn.percentDecode,"%")}catch{return null}return n}function Eh(n,r){var u;const s=n.replace(gn.findPipe,(f,h,m)=>{let g=!1,x=h;for(;--x>=0&&m[x]==="\\";)g=!g;return g?"|":" |"}),o=s.split(gn.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(gn.slashPipe,"|");return o}function qi(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 q1(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 _h(n,r,s,o,a){const u=r.href,f=r.title||null,h=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:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function K1(n,r,s){const o=n.match(s.other.indentCodeCompensation);if(o===null)return r;const a=o[1];return r.split(`
|
|
360
|
+
`).map(u=>{const f=u.match(s.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
361
|
+
`)}var Ql=class{constructor(n){ut(this,"options");ut(this,"rules");ut(this,"lexer");this.options=n||ks}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:qi(s,`
|
|
362
|
+
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=K1(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=qi(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:qi(r[0],`
|
|
363
|
+
`)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let s=qi(r[0],`
|
|
364
|
+
`).split(`
|
|
365
|
+
`),o="",a="";const u=[];for(;s.length>0;){let f=!1;const h=[];let m;for(m=0;m<s.length;m++)if(this.rules.other.blockquoteStart.test(s[m]))h.push(s[m]),f=!0;else if(!f)h.push(s[m]);else break;s=s.slice(m);const g=h.join(`
|
|
366
|
+
`),x=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
367
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
368
|
+
${g}`:g,a=a?`${a}
|
|
369
|
+
${x}`:x;const w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,u,!0),this.lexer.state.top=w,s.length===0)break;const y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const N=y,R=N.raw+`
|
|
370
|
+
`+s.join(`
|
|
371
|
+
`),C=this.blockquote(R);u[u.length-1]=C,o=o.substring(0,o.length-N.raw.length)+C.raw,a=a.substring(0,a.length-N.text.length)+C.text;break}else if((y==null?void 0:y.type)==="list"){const N=y,R=N.raw+`
|
|
372
|
+
`+s.join(`
|
|
373
|
+
`),C=this.list(R);u[u.length-1]=C,o=o.substring(0,o.length-y.raw.length)+C.raw,a=a.substring(0,a.length-N.raw.length)+C.raw,s=R.substring(u.at(-1).raw.length).split(`
|
|
374
|
+
`);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="",x="";if(!(r=u.exec(n))||this.rules.block.hr.test(n))break;g=r[0],n=n.substring(g.length);let w=r[2].split(`
|
|
375
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,P=>" ".repeat(3*P.length)),y=n.split(`
|
|
376
|
+
`,1)[0],N=!w.trim(),R=0;if(this.options.pedantic?(R=2,x=w.trimStart()):N?R=r[1].length+1:(R=r[2].search(this.rules.other.nonSpaceChar),R=R>4?1:R,x=w.slice(R),R+=r[1].length),N&&this.rules.other.blankLine.test(y)&&(g+=y+`
|
|
377
|
+
`,n=n.substring(y.length+1),m=!0),!m){const P=this.rules.other.nextBulletRegex(R),M=this.rules.other.hrRegex(R),H=this.rules.other.fencesBeginRegex(R),I=this.rules.other.headingBeginRegex(R),W=this.rules.other.htmlBeginRegex(R);for(;n;){const Y=n.split(`
|
|
378
|
+
`,1)[0];let K;if(y=Y,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),H.test(y)||I.test(y)||W.test(y)||P.test(y)||M.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=R||!y.trim())x+=`
|
|
379
|
+
`+K.slice(R);else{if(N||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||H.test(w)||I.test(w)||M.test(w))break;x+=`
|
|
380
|
+
`+y}!N&&!y.trim()&&(N=!0),g+=Y+`
|
|
381
|
+
`,n=n.substring(Y.length+1),w=K.slice(R)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let C=null,T;this.options.gfm&&(C=this.rules.other.listIsTask.exec(x),C&&(T=C[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!C,checked:T,loose:!1,text:x,tokens:[]}),a.raw+=g}const h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.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(w=>w.type==="space"),x=g.length>0&&g.some(w=>this.rules.other.anyLine.test(w.raw));a.loose=x}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=Eh(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(`
|
|
382
|
+
`):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(s.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<s.length;h++)u.header.push({text:s[h],tokens:this.lexer.inline(s[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Eh(h,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)===`
|
|
383
|
+
`?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=qi(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=q1(r[2],"()");if(u===-2)return;if(u>-1){const h=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,h).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)),_h(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 _h(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,h,m=u,g=0;const x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,r=r.slice(-1*n.length+u);(o=x.exec(r))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){m+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);const w=[...o[0]][0].length,y=n.slice(0,u+o.index+w+h);if(Math.min(u,h)%2){const R=y.slice(1,-1);return{type:"em",raw:y,text:R,tokens:this.lexer.inlineTokens(R)}}const N=y.slice(2,-2);return{type:"strong",raw:y,text:N,tokens:this.lexer.inlineTokens(N)}}}}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}}}},Er=class Cu{constructor(r){ut(this,"tokens");ut(this,"options");ut(this,"state");ut(this,"tokenizer");ut(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||ks,this.options.tokenizer=this.options.tokenizer||new Ql,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:gn,block:El.normal,inline:Gi.normal};this.options.pedantic?(s.block=El.pedantic,s.inline=Gi.pedantic):this.options.gfm&&(s.block=El.gfm,this.options.breaks?s.inline=Gi.breaks:s.inline=Gi.gfm),this.tokenizer.rules=s}static get rules(){return{block:El,inline:Gi}}static lex(r,s){return new Cu(s).lex(r)}static lexInline(r,s){return new Cu(s).inlineTokens(r)}lex(r){r=r.replace(gn.carriageReturn,`
|
|
384
|
+
`),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(gn.tabCharGlobal," ").replace(gn.spaceLine,""));r;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},r,s))?(r=r.substring(h.raw.length),s.push(h),!0):!1))continue;if(h=this.tokenizer.space(r)){r=r.substring(h.raw.length);const g=s.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
385
|
+
`:s.push(h);continue}if(h=this.tokenizer.code(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
386
|
+
`+h.raw,g.text+=`
|
|
387
|
+
`+h.text,this.inlineQueue.at(-1).src=g.text):s.push(h);continue}if(h=this.tokenizer.fences(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.heading(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.hr(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.blockquote(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.list(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.html(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.def(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="paragraph"||(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
388
|
+
`+h.raw,g.text+=`
|
|
389
|
+
`+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.lheading(r)){r=r.substring(h.raw.length),s.push(h);continue}let m=r;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const x=r.slice(1);let w;this.options.extensions.startBlock.forEach(y=>{w=y.call({lexer:this},x),typeof w=="number"&&w>=0&&(g=Math.min(g,w))}),g<1/0&&g>=0&&(m=r.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=s.at(-1);o&&(g==null?void 0:g.type)==="paragraph"?(g.raw+=`
|
|
390
|
+
`+h.raw,g.text+=`
|
|
391
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(h),o=m.length!==r.length,r=r.substring(h.raw.length);continue}if(h=this.tokenizer.text(r)){r=r.substring(h.raw.length);const g=s.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=`
|
|
392
|
+
`+h.raw,g.text+=`
|
|
393
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):s.push(h);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 h,m,g;let o=r,a=null;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)x.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 x;if((m=(h=this.options.extensions)==null?void 0:h.inline)!=null&&m.some(y=>(x=y.call({lexer:this},r,s))?(r=r.substring(x.raw.length),s.push(x),!0):!1))continue;if(x=this.tokenizer.escape(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.tag(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.link(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(x.raw.length);const y=s.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):s.push(x);continue}if(x=this.tokenizer.emStrong(r,o,f)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.codespan(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.br(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.del(r)){r=r.substring(x.raw.length),s.push(x);continue}if(x=this.tokenizer.autolink(r)){r=r.substring(x.raw.length),s.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(r))){r=r.substring(x.raw.length),s.push(x);continue}let w=r;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const N=r.slice(1);let R;this.options.extensions.startInline.forEach(C=>{R=C.call({lexer:this},N),typeof R=="number"&&R>=0&&(y=Math.min(y,R))}),y<1/0&&y>=0&&(w=r.substring(0,y+1))}if(x=this.tokenizer.inlineText(w)){r=r.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(f=x.raw.slice(-1)),u=!0;const y=s.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):s.push(x);continue}if(r){const y="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return s}},Zl=class{constructor(n){ut(this,"options");ut(this,"parser");this.options=n||ks}space(n){return""}code({text:n,lang:r,escaped:s}){var u;const o=(u=(r||"").match(gn.notSpaceStart))==null?void 0:u[0],a=n.replace(gn.endingNewline,"")+`
|
|
394
|
+
`;return o?'<pre><code class="language-'+dr(o)+'">'+(s?a:dr(a,!0))+`</code></pre>
|
|
395
|
+
`:"<pre><code>"+(s?a:dr(a,!0))+`</code></pre>
|
|
396
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
397
|
+
${this.parser.parse(n)}</blockquote>
|
|
398
|
+
`}html({text:n}){return n}heading({tokens:n,depth:r}){return`<h${r}>${this.parser.parseInline(n)}</h${r}>
|
|
399
|
+
`}hr(n){return`<hr>
|
|
400
|
+
`}list(n){const r=n.ordered,s=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=r?"ol":"ul",u=r&&s!==1?' start="'+s+'"':"";return"<"+a+u+`>
|
|
401
|
+
`+o+"</"+a+`>
|
|
402
|
+
`}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+" "+dr(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>
|
|
403
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
404
|
+
`}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>
|
|
405
|
+
<thead>
|
|
406
|
+
`+r+`</thead>
|
|
407
|
+
`+o+`</table>
|
|
408
|
+
`}tablerow({text:n}){return`<tr>
|
|
409
|
+
${n}</tr>
|
|
410
|
+
`}tablecell(n){const r=this.parser.parseInline(n.tokens),s=n.header?"th":"td";return(n.align?`<${s} align="${n.align}">`:`<${s}>`)+r+`</${s}>
|
|
411
|
+
`}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>${dr(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=Ch(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return r&&(u+=' title="'+dr(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=Ch(n);if(a===null)return dr(s);n=a;let u=`<img src="${n}" alt="${s}"`;return r&&(u+=` title="${dr(r)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:dr(n.text)}},dd=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""}},_r=class Eu{constructor(r){ut(this,"options");ut(this,"renderer");ut(this,"textRenderer");this.options=r||ks,this.options.renderer=this.options.renderer||new Zl,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dd}static parse(r,s){return new Eu(s).parse(r)}static parseInline(r,s){return new Eu(s).parseInline(r)}parse(r,s=!0){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type)){o+=x||"";continue}}const m=h;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,x=this.renderer.text(g);for(;f+1<r.length&&r[f+1].type==="text";)g=r[++f],x+=`
|
|
412
|
+
`+this.renderer.text(g);s?o+=this.renderer.paragraph({type:"paragraph",raw:x,text:x,tokens:[{type:"text",raw:x,text:x,escaped:!0}]}):o+=x;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 h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=g||"";continue}}const m=h;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}},pu,Ll=(pu=class{constructor(n){ut(this,"options");ut(this,"block");this.options=n||ks}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Er.lex:Er.lexInline}provideParser(){return this.block?_r.parse:_r.parseInline}},ut(pu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),pu),Y1=class{constructor(...n){ut(this,"defaults",rd());ut(this,"options",this.setOptions);ut(this,"parse",this.parseMarkdown(!0));ut(this,"parseInline",this.parseMarkdown(!1));ut(this,"Parser",_r);ut(this,"Renderer",Zl);ut(this,"TextRenderer",dd);ut(this,"Lexer",Er);ut(this,"Tokenizer",Ql);ut(this,"Hooks",Ll);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 h of f.header)s=s.concat(this.walkTokens(h.tokens,r));for(const h of f.rows)for(const m of h)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(h=>{const m=f[h].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 h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}: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 Zl(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,h=s.renderer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x||""}}o.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new Ql(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,h=s.tokenizer[f],m=a[f];a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Ll;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,h=s.hooks[f],m=a[f];Ll.passThroughHooks.has(u)?a[f]=g=>{if(this.defaults.async)return Promise.resolve(h.call(a,g)).then(w=>m.call(a,w));const x=h.call(a,g);return m.call(a,x)}:a[f]=(...g)=>{let x=h.apply(a,g);return x===!1&&(x=m.apply(a,g)),x}}o.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,u=s.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Er.lex(n,r??this.defaults)}parser(n,r){return _r.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 h=u.hooks?u.hooks.provideLexer():n?Er.lex:Er.lexInline,m=u.hooks?u.hooks.provideParser():n?_r.parse:_r.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(s):s).then(g=>h(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=h(s,u);u.hooks&&(g=u.hooks.processAllTokens(g)),u.walkTokens&&this.walkTokens(g,u.walkTokens);let x=m(g,u);return u.hooks&&(x=u.hooks.postprocess(x)),x}catch(g){return f(g)}}}onError(n,r){return s=>{if(s.message+=`
|
|
413
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+dr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},xs=new Y1;function Xe(n,r){return xs.parse(n,r)}Xe.options=Xe.setOptions=function(n){return xs.setOptions(n),Xe.defaults=xs.defaults,cg(Xe.defaults),Xe};Xe.getDefaults=rd;Xe.defaults=ks;Xe.use=function(...n){return xs.use(...n),Xe.defaults=xs.defaults,cg(Xe.defaults),Xe};Xe.walkTokens=function(n,r){return xs.walkTokens(n,r)};Xe.parseInline=xs.parseInline;Xe.Parser=_r;Xe.parser=_r.parse;Xe.Renderer=Zl;Xe.TextRenderer=dd;Xe.Lexer=Er;Xe.lexer=Er.lex;Xe.Tokenizer=Ql;Xe.Hooks=Ll;Xe.parse=Xe;Xe.options;Xe.setOptions;Xe.use;Xe.walkTokens;Xe.parseInline;_r.parse;Er.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 jh(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 X1(n){if(Array.isArray(n))return n}function Q1(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(s=s.call(n)).next,r!==0)for(;!(m=(o=u.call(s)).done)&&(h.push(o.value),h.length!==r);m=!0);}catch(x){g=!0,a=x}finally{try{if(!m&&s.return!=null&&(f=s.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function Z1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
414
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J1(n,r){return X1(n)||Q1(n,r)||ek(n,r)||Z1()}function ek(n,r){if(n){if(typeof n=="string")return jh(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)?jh(n,r):void 0}}const wg=Object.entries,Rh=Object.setPrototypeOf,tk=Object.isFrozen,nk=Object.getPrototypeOf,rk=Object.getOwnPropertyDescriptor;let Jt=Object.freeze,tn=Object.seal,Js=Object.create,kg=typeof Reflect<"u"&&Reflect,_u=kg.apply,ju=kg.construct;Jt||(Jt=function(r){return r});tn||(tn=function(r){return r});_u||(_u=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)});ju||(ju=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 Xs=zt(Array.prototype.forEach),sk=zt(Array.prototype.lastIndexOf),Ah=zt(Array.prototype.pop),Qs=zt(Array.prototype.push),ik=zt(Array.prototype.splice),Qr=Array.isArray,Qi=zt(String.prototype.toLowerCase),ou=zt(String.prototype.toString),Ih=zt(String.prototype.match),Ki=zt(String.prototype.replace),Dh=zt(String.prototype.indexOf),ok=zt(String.prototype.trim),lk=zt(Number.prototype.toString),ak=zt(Boolean.prototype.toString),Mh=typeof BigInt>"u"?null:zt(BigInt.prototype.toString),Lh=typeof Symbol>"u"?null:zt(Symbol.prototype.toString),Kt=zt(Object.prototype.hasOwnProperty),Yi=zt(Object.prototype.toString),qt=zt(RegExp.prototype.test),vs=ck(TypeError);function zt(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 _u(n,r,o)}}function ck(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return ju(n,s)}}function Ye(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qi;if(Rh&&Rh(n,null),!Qr(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(tk(r)||(r[o]=u),a=u)}n[a]=!0}return n}function uk(n){for(let r=0;r<n.length;r++)Kt(n,r)||(n[r]=null);return n}function un(n){const r=Js(null);for(const o of wg(n)){var s=J1(o,2);const a=s[0],u=s[1];Kt(n,a)&&(Qr(u)?r[a]=uk(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=un(u):r[a]=u)}return r}function dk(n){switch(typeof n){case"string":return n;case"number":return lk(n);case"boolean":return ak(n);case"bigint":return Mh?Mh(n):"0";case"symbol":return Lh?Lh(n):"Symbol()";case"undefined":return Yi(n);case"function":case"object":{if(n===null)return Yi(n);const r=n,s=tr(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:Yi(o)}return Yi(n)}default:return Yi(n)}}function tr(n,r){for(;n!==null;){const o=rk(n,r);if(o){if(o.get)return zt(o.get);if(typeof o.value=="function")return zt(o.value)}n=nk(n)}function s(){return null}return s}function fk(n){try{return qt(n,""),!0}catch{return!1}}const Ph=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"]),lu=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"]),au=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"]),pk=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"]),cu=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"]),hk=Jt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zh=Jt(["#text"]),Oh=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"]),uu=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"]),$h=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"]),_l=Jt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mk=tn(/{{[\w\W]*|^[\w\W]*}}/g),gk=tn(/<%[\w\W]*|^[\w\W]*%>/g),vk=tn(/\${[\w\W]*/g),yk=tn(/^data-[\-\w.\u00B7-\uFFFF]+$/),xk=tn(/^aria-[\-\w]+$/),Fh=tn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wk=tn(/^(?:\w+script|data):/i),kk=tn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sk=tn(/^html$/i),Tk=tn(/^[a-z][.\w]*(-[.\w]+)+$/i),Uh=tn(/<[/\w!]/g),Bh=tn(/<[/\w]/g),bk=tn(/<\/no(script|embed|frames)/i),Nk=tn(/\/>/i),Mn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ck=function(){return typeof window>"u"?null:window},Ek=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}},Wh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Yr=function(r,s,o,a){return Kt(r,s)&&Qr(r[s])?Ye(a.base?un(a.base):{},r[s],a.transform):o};function Sg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ck();const r=re=>Sg(re);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==Mn.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,h=n.Element,m=n.NodeFilter,g=n.NamedNodeMap;g===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const x=n.DOMParser,w=n.trustedTypes,y=h.prototype,N=tr(y,"cloneNode"),R=tr(y,"remove"),C=tr(y,"nextSibling"),T=tr(y,"childNodes"),P=tr(y,"parentNode"),M=tr(y,"shadowRoot"),H=tr(y,"attributes"),I=f&&f.prototype?tr(f.prototype,"nodeType"):null,W=f&&f.prototype?tr(f.prototype,"nodeName"):null,Y=f&&f.prototype?tr(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const re=s.createElement("template");re.content&&re.content.ownerDocument&&(s=re.content.ownerDocument)}let K,V="",ne,ae=!1,fe=0;const Le=function(){if(fe>0)throw vs('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.')},Re=function(S){Le(),fe++;try{return K.createHTML(S)}finally{fe--}},Pe=function(S){Le(),fe++;try{return K.createScriptURL(S)}finally{fe--}},Z=function(){return ae||(ne=Ek(w,a),ae=!0),ne},te=s,le=te.implementation,j=te.createNodeIterator,q=te.createDocumentFragment,B=te.getElementsByTagName,E=o.importNode;let D=Wh();r.isSupported=typeof wg=="function"&&typeof P=="function"&&le&&le.createHTMLDocument!==void 0;const ie=mk,oe=gk,ve=vk,pe=yk,Ae=xk,Ce=wk,be=kk,we=Tk;let at=Fh,Ie=null;const xt=Ye({},[...Ph,...lu,...au,...cu,...zh]);let ze=null;const dt=Ye({},[...Oh,...uu,...$h,..._l]);let Be=Object.seal(Js(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}})),nn=null,yn=null;const Mt=Object.seal(Js(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Tt=!0,Lt=!0,G=!1,he=!0,Ue=!1,nt=!0,wt=!1,ft=!1,ot=null,Ot=null,rn=!1,kt=!1,zn=!1,z=!1,Oe=!0,Te=!1;const Fe="user-content-";let $e=!0,ue=!1,We={},He=null;const jt=Ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ge=null;const mt=Ye({},["audio","video","img","source","image","track"]);let gt=null;const Bt=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ct="http://www.w3.org/1998/Math/MathML",pt="http://www.w3.org/2000/svg",Ee="http://www.w3.org/1999/xhtml";let qe=Ee,Ke=!1,sn=null;const Wt=Ye({},[ct,pt,Ee],ou),xn=Jt(["mi","mo","mn","ms","mtext"]);let dn=Ye({},xn);const _n=Jt(["annotation-xml"]);let Xt=Ye({},_n);const qn=Ye({},["title","style","font","a","script"]);let Kn=null;const da=["application/xhtml+xml","text/html"],fa="text/html";let rt=null,mr=null;const go=s.createElement("form"),vo=function(S){return S instanceof RegExp||S instanceof Function},Ss=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mr&&mr===S)return;(!S||typeof S!="object")&&(S={}),S=un(S),Kn=da.indexOf(S.PARSER_MEDIA_TYPE)===-1?fa:S.PARSER_MEDIA_TYPE,rt=Kn==="application/xhtml+xml"?ou:Qi,Ie=Yr(S,"ALLOWED_TAGS",xt,{transform:rt}),ze=Yr(S,"ALLOWED_ATTR",dt,{transform:rt}),sn=Yr(S,"ALLOWED_NAMESPACES",Wt,{transform:ou}),gt=Yr(S,"ADD_URI_SAFE_ATTR",Bt,{transform:rt,base:Bt}),Ge=Yr(S,"ADD_DATA_URI_TAGS",mt,{transform:rt,base:mt}),He=Yr(S,"FORBID_CONTENTS",jt,{transform:rt}),nn=Yr(S,"FORBID_TAGS",un({}),{transform:rt}),yn=Yr(S,"FORBID_ATTR",un({}),{transform:rt}),We=Kt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?un(S.USE_PROFILES):S.USE_PROFILES:!1,Tt=S.ALLOW_ARIA_ATTR!==!1,Lt=S.ALLOW_DATA_ATTR!==!1,G=S.ALLOW_UNKNOWN_PROTOCOLS||!1,he=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=S.SAFE_FOR_TEMPLATES||!1,nt=S.SAFE_FOR_XML!==!1,wt=S.WHOLE_DOCUMENT||!1,kt=S.RETURN_DOM||!1,zn=S.RETURN_DOM_FRAGMENT||!1,z=S.RETURN_TRUSTED_TYPE||!1,rn=S.FORCE_BODY||!1,Oe=S.SANITIZE_DOM!==!1,Te=S.SANITIZE_NAMED_PROPS||!1,$e=S.KEEP_CONTENT!==!1,ue=S.IN_PLACE||!1,at=fk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:Fh,qe=typeof S.NAMESPACE=="string"?S.NAMESPACE:Ee,dn=Kt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?un(S.MATHML_TEXT_INTEGRATION_POINTS):Ye({},xn),Xt=Kt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?un(S.HTML_INTEGRATION_POINTS):Ye({},_n);const O=Kt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?un(S.CUSTOM_ELEMENT_HANDLING):Js(null);if(Be=Js(null),Kt(O,"tagNameCheck")&&vo(O.tagNameCheck)&&(Be.tagNameCheck=O.tagNameCheck),Kt(O,"attributeNameCheck")&&vo(O.attributeNameCheck)&&(Be.attributeNameCheck=O.attributeNameCheck),Kt(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(Be.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),tn(Be),Ue&&(Lt=!1),zn&&(kt=!0),We&&(Ie=Ye({},zh),ze=Js(null),We.html===!0&&(Ye(Ie,Ph),Ye(ze,Oh)),We.svg===!0&&(Ye(Ie,lu),Ye(ze,uu),Ye(ze,_l)),We.svgFilters===!0&&(Ye(Ie,au),Ye(ze,uu),Ye(ze,_l)),We.mathMl===!0&&(Ye(Ie,cu),Ye(ze,$h),Ye(ze,_l))),Mt.tagCheck=null,Mt.attributeCheck=null,Kt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?Mt.tagCheck=S.ADD_TAGS:Qr(S.ADD_TAGS)&&(Ie===xt&&(Ie=un(Ie)),Ye(Ie,S.ADD_TAGS,rt))),Kt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?Mt.attributeCheck=S.ADD_ATTR:Qr(S.ADD_ATTR)&&(ze===dt&&(ze=un(ze)),Ye(ze,S.ADD_ATTR,rt))),Kt(S,"ADD_URI_SAFE_ATTR")&&Qr(S.ADD_URI_SAFE_ATTR)&&Ye(gt,S.ADD_URI_SAFE_ATTR,rt),Kt(S,"FORBID_CONTENTS")&&Qr(S.FORBID_CONTENTS)&&(He===jt&&(He=un(He)),Ye(He,S.FORBID_CONTENTS,rt)),Kt(S,"ADD_FORBID_CONTENTS")&&Qr(S.ADD_FORBID_CONTENTS)&&(He===jt&&(He=un(He)),Ye(He,S.ADD_FORBID_CONTENTS,rt)),$e&&(Ie["#text"]=!0),wt&&Ye(Ie,["html","head","body"]),Ie.table&&(Ye(Ie,["tbody"]),delete nn.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=K;K=S.TRUSTED_TYPES_POLICY;try{V=Re("")}catch(ge){throw K=X,ge}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,V=""):(K===void 0&&(K=Z()),K&&typeof V=="string"&&(V=Re("")));Jt&&Jt(S),mr=S},di=Ye({},[...lu,...au,...pk]),fi=Ye({},[...cu,...hk]),yo=function(S,O,X){return O.namespaceURI===Ee?S==="svg":O.namespaceURI===ct?S==="svg"&&(X==="annotation-xml"||dn[X]):!!di[S]},pa=function(S,O,X){return O.namespaceURI===Ee?S==="math":O.namespaceURI===pt?S==="math"&&Xt[X]:!!fi[S]},ha=function(S,O,X){return O.namespaceURI===pt&&!Xt[X]||O.namespaceURI===ct&&!dn[X]?!1:!fi[S]&&(qn[S]||!di[S])},bt=function(S){let O=P(S);(!O||!O.tagName)&&(O={namespaceURI:qe,tagName:"template"});const X=Qi(S.tagName),ge=Qi(O.tagName);return sn[S.namespaceURI]?S.namespaceURI===pt?yo(X,O,ge):S.namespaceURI===ct?pa(X,O,ge):S.namespaceURI===Ee?ha(X,O,ge):!!(Kn==="application/xhtml+xml"&&sn[S.namespaceURI]):!1},ir=function(S){Qs(r.removed,{element:S});try{P(S).removeChild(S)}catch{if(R(S),!P(S))throw vs("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rr=function(S){Jr(S);const O=T(S);if(O){const ge=[];Xs(O,ke=>{Qs(ge,ke)}),Xs(ge,ke=>{try{R(ke)}catch{}})}const X=H(S);if(X)for(let ge=X.length-1;ge>=0;--ge){const ke=X[ge],Me=ke&&ke.name;if(typeof Me=="string")try{S.removeAttribute(Me)}catch{}}},or=function(S,O){try{Qs(r.removed,{attribute:O.getAttributeNode(S),from:O})}catch{Qs(r.removed,{attribute:null,from:O})}if(O.removeAttribute(S),S==="is")if(kt||zn)try{ir(O)}catch{}else try{O.setAttribute(S,"")}catch{}},Ts=function(S){const O=H(S);if(O)for(let X=O.length-1;X>=0;--X){const ge=O[X],ke=ge&&ge.name;if(!(typeof ke!="string"||ze[rt(ke)]))try{S.removeAttribute(ke)}catch{}}},Jr=function(S){const O=[S];for(;O.length>0;){const X=O.pop();(I?I(X):X.nodeType)===Mn.element&&Ts(X);const ke=T(X);if(ke)for(let Me=ke.length-1;Me>=0;--Me)O.push(ke[Me])}},xo=function(S){if(!nt)return;const O=[S];for(;O.length>0;){const X=O.pop(),ge=I?I(X):X.nodeType;if(ge===Mn.processingInstruction||ge===Mn.comment&&qt(Bh,X.data)){try{R(X)}catch{}continue}if(ge===Mn.element){const Me=X,Ze=rt(W?W(X):X.nodeName);try{Me.hasAttribute&&Me.hasAttribute("patchsrc")&&Me.removeAttribute("patchsrc"),Me.hasAttribute&&Me.hasAttribute("for")&&Ze!=="label"&&Ze!=="output"&&Me.removeAttribute("for")}catch{}}const ke=T(X);if(ke)for(let Me=ke.length-1;Me>=0;--Me)O.push(ke[Me])}},es=function(S){let O=null,X=null;if(rn)S="<remove></remove>"+S;else{const Me=Ih(S,/^[\r\n\t ]+/);X=Me&&Me[0]}Kn==="application/xhtml+xml"&&qe===Ee&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const ge=K?Re(S):S;if(qe===Ee)try{O=new x().parseFromString(ge,Kn)}catch{}if(!O||!O.documentElement){O=le.createDocument(qe,"template",null);try{O.documentElement.innerHTML=Ke?V:ge}catch{}}const ke=O.body||O.documentElement;return S&&X&&ke.insertBefore(s.createTextNode(X),ke.childNodes[0]||null),qe===Ee?B.call(O,wt?"html":"body")[0]:wt?O.documentElement:ke},jn=function(S){const O=Y?Y(S):S.ownerDocument;return j.call(O||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},bs=function(S){return S=Ki(S,ie," "),S=Ki(S,oe," "),S=Ki(S,ve," "),S},fn=function(S){var O;S.normalize();const X=Y?Y(S):S.ownerDocument,ge=j.call(X||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let ke=ge.nextNode();for(;ke;)ke.data=bs(ke.data),ke=ge.nextNode();const Me=(O=S.querySelectorAll)===null||O===void 0?void 0:O.call(S,"template");Me&&Xs(Me,Ze=>{Ar(Ze.content)&&fn(Ze.content)})},Ns=function(S){const O=W?W(S):null;return typeof O!="string"||rt(O)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==H(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==I(S)||S.childNodes!==T(S)},Ar=function(S){if(!I||typeof S!="object"||S===null)return!1;try{return I(S)===Mn.documentFragment}catch{return!1}},ts=function(S){if(!I||typeof S!="object"||S===null)return!1;try{return typeof I(S)=="number"}catch{return!1}};function pn(re,S,O){re.length!==0&&Xs(re,X=>{X.call(r,S,O,mr)})}const Cs=function(S,O){return!!(nt&&S.hasChildNodes()&&!ts(S.firstElementChild)&&qt(Uh,S.textContent)&&qt(Uh,S.innerHTML)||nt&&S.namespaceURI===Ee&&O==="style"&&ts(S.firstElementChild)||S.nodeType===Mn.processingInstruction||nt&&S.nodeType===Mn.comment&&qt(Bh,S.data))},ns=function(S,O,X){if(!nn[O]&&hi(O)&&(Be.tagNameCheck instanceof RegExp&&qt(Be.tagNameCheck,O)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(O)))return!1;if($e&&!He[O]){const ge=P(S),ke=T(S);if(ke&&ge){const Me=ke.length;for(let Ze=Me-1;Ze>=0;--Ze){const et=S===X?N(ke[Ze],!0):ke[Ze];ge.insertBefore(et,C(S))}}}return ir(S),!0},rs=function(S,O,X,ge){return S.length===0?O:O===X||O===ge?un(O):O},wo=function(S,O){if(pn(D.beforeSanitizeElements,S,null),S!==O&&P(S)===null)return ue&&Jr(S),!0;if(Ns(S))return ir(S),!0;const X=rt(W?W(S):S.nodeName);if(Ie=rs(D.uponSanitizeElement,Ie,xt,ot),pn(D.uponSanitizeElement,S,{tagName:X,allowedTags:Ie}),S!==O&&P(S)===null)return ue&&Jr(S),!0;if(Cs(S,X))return ir(S),!0;if(nn[X]||!(Mt.tagCheck instanceof Function&&Mt.tagCheck(X))&&!Ie[X]){const ke=ns(S,X,O);return ke===!1&&pn(D.afterSanitizeElements,S,null),ke}if((I?I(S):S.nodeType)===Mn.element&&!bt(S)||(X==="noscript"||X==="noembed"||X==="noframes")&&qt(bk,S.innerHTML))return ir(S),!0;if(Ue&&S.nodeType===Mn.text){const ke=bs(S.textContent);S.textContent!==ke&&(Qs(r.removed,{element:S.cloneNode()}),S.textContent=ke)}return pn(D.afterSanitizeElements,S,null),!1},ko=function(S,O,X){if(yn[O]||nt&&O==="patchsrc"||nt&&O==="for"&&S!=="label"&&S!=="output"||Oe&&(O==="id"||O==="name")&&(X in s||X in go))return!1;const ge=ze[O]||Mt.attributeCheck instanceof Function&&Mt.attributeCheck(O,S);if(!(Lt&&qt(pe,O))){if(!(Tt&&qt(Ae,O))){if(ge){if(!gt[O]){if(!qt(at,Ki(X,be,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&S!=="script"&&Dh(X,"data:")===0&&Ge[S])){if(!(G&&!qt(Ce,Ki(X,be,"")))){if(X)return!1}}}}}else if(!(hi(S)&&(Be.tagNameCheck instanceof RegExp&&qt(Be.tagNameCheck,S)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(S))&&(Be.attributeNameCheck instanceof RegExp&&qt(Be.attributeNameCheck,O)||Be.attributeNameCheck instanceof Function&&Be.attributeNameCheck(O,S))||O==="is"&&Be.allowCustomizedBuiltInElements&&(Be.tagNameCheck instanceof RegExp&&qt(Be.tagNameCheck,X)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(X))))return!1}}return!0},pi=Ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),hi=function(S){return!pi[Qi(S)]&&qt(we,S)},mi=function(S,O,X,ge){if(K&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!X)switch(w.getAttributeType(S,O)){case"TrustedHTML":return Re(ge);case"TrustedScriptURL":return Pe(ge)}return ge},ss=function(S,O,X,ge){try{X?S.setAttributeNS(X,O,ge):S.setAttribute(O,ge),Ns(S)?ir(S):Ah(r.removed)}catch{or(O,S)}},So=function(S){pn(D.beforeSanitizeAttributes,S,null);const O=S.attributes;if(!O||Ns(S))return;ze=rs(D.uponSanitizeAttribute,ze,dt,Ot);const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let ge=O.length;const ke=rt(S.nodeName);for(;ge--;){const Me=O[ge],Ze=Me.name,et=Me.namespaceURI,Nt=Me.value,Ct=rt(Ze),gr=Nt;let It=Ze==="value"?gr:ok(gr);if(X.attrName=Ct,X.attrValue=It,X.keepAttr=!0,X.forceKeepAttr=void 0,pn(D.uponSanitizeAttribute,S,X),It=X.attrValue,Te&&(Ct==="id"||Ct==="name")&&Dh(It,Fe)!==0&&(or(Ze,S),It=Fe+It),nt&&qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,It)){or(Ze,S);continue}if(Ct==="attributename"&&Ih(It,"href")){or(Ze,S);continue}if(!X.forceKeepAttr){if(!X.keepAttr){or(Ze,S);continue}if(!he&&qt(Nk,It)){or(Ze,S);continue}if(Ue&&(It=bs(It)),!ko(ke,Ct,It)){or(Ze,S);continue}It=mi(ke,Ct,et,It),It!==gr&&ss(S,Ze,et,It)}}pn(D.afterSanitizeAttributes,S,null)},Ir=function(S){let O=null;const X=jn(S);for(pn(D.beforeSanitizeShadowDOM,S,null);O=X.nextNode();)if(pn(D.uponSanitizeShadowNode,O,null),wo(O,S),So(O),Ar(O.content)&&Ir(O.content),(I?I(O):O.nodeType)===Mn.element){const ke=M(O);Ar(ke)&&(Qe(ke),Ir(ke))}pn(D.afterSanitizeShadowDOM,S,null)},Qe=function(S){const O=[{node:S,shadow:null}];for(;O.length>0;){const X=O.pop();if(X.shadow){Ir(X.shadow);continue}const ge=X.node,Me=(I?I(ge):ge.nodeType)===Mn.element,Ze=T(ge);if(Ze)for(let et=Ze.length-1;et>=0;--et)O.push({node:Ze[et],shadow:null});if(Me){const et=W?W(ge):null;if(typeof et=="string"&&rt(et)==="template"){const Nt=ge.content;Ar(Nt)&&O.push({node:Nt,shadow:null})}}if(Me){const et=M(ge);Ar(et)&&O.push({node:null,shadow:et},{node:et,shadow:null})}}};return r.sanitize=function(re){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,X=null,ge=null,ke=null;if(Ke=!re,Ke&&(re="<!-->"),typeof re!="string"&&!ts(re)&&(re=dk(re),typeof re!="string"))throw vs("dirty is not a string, aborting");if(!r.isSupported)return re;ft?(Ie=ot,ze=Ot):Ss(S),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(Ie=un(Ie)),D.uponSanitizeAttribute.length>0&&(ze=un(ze)),r.removed=[];const Me=ue&&typeof re!="string"&&ts(re);if(Me){xo(re);const Nt=W?W(re):re.nodeName;if(typeof Nt=="string"){const Ct=rt(Nt);if(!Ie[Ct]||nn[Ct])throw Rr(re),vs("root node is forbidden and cannot be sanitized in-place")}if(Ns(re))throw Rr(re),vs("root node is clobbered and cannot be sanitized in-place");try{Qe(re)}catch(Ct){throw Rr(re),Ct}}else if(ts(re))O=es("<!---->"),X=O.ownerDocument.importNode(re,!0),X.nodeType===Mn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?O=X:O.appendChild(X),Qe(X);else{if(!kt&&!Ue&&!wt&&re.indexOf("<")===-1)return K&&z?Re(re):re;if(O=es(re),!O)return kt?null:z?V:""}O&&rn&&ir(O.firstChild);const Ze=Me?re:O;try{const Nt=jn(Ze);for(;ge=Nt.nextNode();)wo(ge,Ze),So(ge),Ar(ge.content)&&Ir(ge.content)}catch(Nt){throw Me&&(Rr(re),Xs(r.removed,Ct=>{Ct.element&&Jr(Ct.element)})),Nt}if(Me)return Xs(r.removed,Nt=>{Nt.element&&Jr(Nt.element)}),Ue&&fn(re),re;if(kt){if(Ue&&fn(O),zn)for(ke=q.call(O.ownerDocument);O.firstChild;)ke.appendChild(O.firstChild);else ke=O;return(ze.shadowroot||ze.shadowrootmode)&&(ke=E.call(o,ke,!0)),ke}let et=wt?O.outerHTML:O.innerHTML;return wt&&Ie["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&qt(Sk,O.ownerDocument.doctype.name)&&(et="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
415
|
+
`+et),Ue&&(et=bs(et)),K&&z?Re(et):et},r.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ss(re),ft=!0,ot=Ie,Ot=ze},r.clearConfig=function(){mr=null,ft=!1,ot=null,Ot=null,K=ne,V=""},r.isValidAttribute=function(re,S,O){mr||Ss({});const X=rt(re),ge=rt(S);return ko(X,ge,O)},r.addHook=function(re,S){typeof S=="function"&&Kt(D,re)&&Qs(D[re],S)},r.removeHook=function(re,S){if(Kt(D,re)){if(S!==void 0){const O=sk(D[re],S);return O===-1?void 0:ik(D[re],O,1)[0]}return Ah(D[re])}},r.removeHooks=function(re){Kt(D,re)&&(D[re]=[])},r.removeAllHooks=function(){D=Wh()},r}var fd=Sg();const _k=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Hh(n){return _k.has(n.type)}function jk({items:n,runtimeType:r,turn:s,threads:o=[]}){const[a,u]=k.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(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(m0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(Ku,{size:14,className:"tool-calls-chevron",style:{transform:a?"rotate(90deg)":"none"}})]}),a&&c.jsx("div",{className:"tool-calls-body",children:n.map(h=>c.jsx(Cr,{item:h,runtimeType:r,turn:s,threads:o},h.id))})]})}Xe.setOptions({breaks:!0,gfm:!0});function Rk(n){const r=Xe.parse(n);return fd.sanitize(r)}function Vh(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 Ak(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=Vh(n,s.start_offset),a=Vh(n,s.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset);const f=document.createElement("mark");f.setAttribute("data-thread-id",s.id),s.status==="resolved"&&f.classList.add("thread-mark-resolved");try{u.surroundContents(f)}catch{const h=u.extractContents();f.appendChild(h),u.insertNode(f)}}}function Ik(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 Dk({itemId:n,turnId:r,sessionId:s,content:o,threads:a}){const u=k.useRef(null),f=k.useRef(null),h=k.useRef(null),m=k.useRef(""),g=k.useRef(0),[x,w]=k.useState(!1),[y,N]=k.useState({x:0,y:0}),[R,C]=k.useState(!1),[T,P]=k.useState({x:0,y:0}),[M,H]=k.useState(""),[I,W]=k.useState(null),[Y,K]=k.useState(!1),V=L(B=>B.createThread),ne=L(B=>B.switchRightTab),ae=L(B=>ta(B.sessionDetails[s])),fe=k.useCallback(async()=>{await bu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),Le=k.useCallback(()=>{var E;if(!I)return;const B=`
|
|
416
|
+
\`\`\`QUOTE
|
|
417
|
+
${I.text}
|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
`;L.setState({quotedText:B}),w(!1),W(null),(E=window.getSelection())==null||E.removeAllRanges()},[I]),Re=k.useMemo(()=>Rk(o||"…"),[o]),Pe=k.useMemo(()=>a.filter(B=>B.item_id===n),[a,n]);k.useEffect(()=>{u.current&&Ak(u.current,Pe)},[Re,Pe]),k.useEffect(()=>{m.current=M},[M]),k.useEffect(()=>{function B(E){f.current&&!f.current.contains(E.target)&&(w(!1),m.current.trim()||C(!1))}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const Z=k.useCallback(()=>{w(!1),m.current.trim()||C(!1)},[]),te=k.useCallback(()=>{const B=u.current;if(!B)return;const E=Ik(B);if(E&&E.text.trim().length>0){const D=window.getSelection();if(D&&D.rangeCount>0&&D.anchorNode&&D.focusNode){const oe=D.getRangeAt(0).getBoundingClientRect(),ve=28,pe=6,Ae=170;let Ce=!1;try{const at=document.createRange();at.setStart(D.focusNode,D.focusOffset),at.setEnd(D.focusNode,D.focusOffset);const Ie=document.createRange();Ie.setStart(D.anchorNode,D.anchorOffset),Ie.setEnd(D.anchorNode,D.anchorOffset),Ce=Ie.compareBoundaryPoints(Range.START_TO_START,at)>0}catch{Ce=!1}let be=oe.top-ve-pe;be<8&&(be=oe.bottom+pe);let we=Ce?oe.left-Ae:oe.right;we=Math.max(8,Math.min(we,window.innerWidth-Ae-8)),N({x:we,y:be}),w(!0),W(E)}}else w(!1)},[]);k.useEffect(()=>{function B(E){const D=E.target;D&&(D.closest(".selection-actions")||D.closest(".thread-create-popover"))||te()}return document.addEventListener("mouseup",B),()=>document.removeEventListener("mouseup",B)},[te]);const le=k.useCallback(()=>{w(!1),C(!0),P({x:y.x,y:y.y})},[y]);k.useLayoutEffect(()=>{if(!R)return;const B=h.current;if(!B)return;const E=B.offsetWidth,D=B.offsetHeight,ie=8;let oe=y.x,ve=y.y;oe-E<ie&&(oe=E+ie),oe>window.innerWidth-ie&&(oe=window.innerWidth-ie),ve<ie&&(ve=ie),ve+D>window.innerHeight-ie&&(ve=window.innerHeight-D-ie),P({x:oe,y:ve})},[R,y]);const j=k.useCallback(async()=>{var B;ae||!I||!M.trim()||(await V(s,{itemId:n,turnId:r,startOffset:I.start,endOffset:I.end,selectedText:I.text,message:M.trim()}),H(""),C(!1),W(null),(B=window.getSelection())==null||B.removeAllRanges(),ne("threads"))},[I,M,V,s,n,r,ne,ae]),q=k.useCallback(B=>{const E=B.target;if(E.tagName==="MARK"&&E.hasAttribute("data-thread-id")){B.preventDefault(),ne("threads");const D=E.getAttribute("data-thread-id");setTimeout(()=>{const ie=document.getElementById(`thread-${D}`);ie&&(ie.scrollIntoView({behavior:"smooth",block:"center"}),ie.classList.add("thread-card-highlighted"),setTimeout(()=>ie.classList.remove("thread-card-highlighted"),1500))},100)}},[ne]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Re},onMouseDown:Z,onClick:q}),c.jsx("button",{className:`copy-text-btn${Y?" copied":""}`,onClick:fe,title:Y?"Copied":"Copy message","aria-label":"Copy message text",children:Y?c.jsx(Zr,{size:14}):c.jsx(xu,{size:14})}),x&&!R&&c.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!ae&&c.jsxs("button",{className:"discuss-button",onClick:le,title:"Start a discussion about this text",children:[c.jsx(t0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:Le,title:"Quote this text in your message",children:[c.jsx(Dm,{size:14}),c.jsx("span",{children:"Quote"})]})]}),R&&c.jsxs("div",{ref:h,className:"thread-create-popover",style:{left:T.x,top:T.y},children:[c.jsxs("div",{className:"thread-create-header",children:[c.jsxs("span",{className:"thread-create-quote",children:['"',I==null?void 0:I.text.slice(0,80),I&&I.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),W(null)},children:c.jsx(Gn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:M,onChange:B=>H(B.target.value),autoFocus:!0,rows:2,onKeyDown:B=>{if(B.key==="Enter"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),j()),B.key==="Escape")if(m.current.trim()){const E=Date.now();g.current&&E-g.current<400?(g.current=0,C(!1),W(null)):g.current=E}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:j,disabled:!M.trim()||ae,title:ae?"Wait for the running turn to finish first":void 0,children:[c.jsx(ra,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Gh=k.memo(Dk),Jl=new Map,Tg=new Set,Ru=new Set,qh=new Map;function bg(){Ru.forEach(n=>n())}function Ng(n,r){return`${n}:${r}`}function Mk(n,r,s,o,a){var m;const u=Ng(r,s),f=Jl.get(n)??new Map,h=new Map(f);((m=h.get(u))==null?void 0:m.answer)===a?h.delete(u):h.set(u,{itemIndex:r,groupIndex:s,question:o,answer:a}),Jl.set(n,h),bg()}function Lk(n){Jl.delete(n),bg()}function Pk(n){Tg.add(n),Lk(n)}function zk(n){const r=k.useCallback(s=>(Ru.add(s),()=>{Ru.delete(s)}),[]);return k.useSyncExternalStore(r,()=>Jl.get(n)??qh,()=>qh)}function Ok(n){return[...n].sort((r,s)=>r.itemIndex-s.itemIndex||r.groupIndex-s.groupIndex).map(r=>`> ${r.question}
|
|
421
|
+
${r.answer}`).join(`
|
|
422
|
+
|
|
423
|
+
`)}function Kh({item:n,turn:r}){var N;const s=n.data??{},o=k.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(R=>!!R&&Array.isArray(R.selections)&&R.selections.length>0):[],[s.groups]),a=zk(r.id),u=L(R=>r.session_id?R.sessionDetails[r.session_id]:null),f=L(R=>R.activeSessionId),h=r.items.findIndex(R=>R.id===n.id),m=u?((N=u.turns[u.turns.length-1])==null?void 0:N.id)===r.id:!0,g=Tg.has(r.id),x=g||Sm(u)||!m||r.session_id!==f,w=(R,C,T)=>{x||Mk(r.id,h,R,C,T)},y=()=>{const R=[...a.values()];if(R.length===0)return;const C=Ok(R);Pk(r.id),L.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(Bx,{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((R,C)=>c.jsxs("div",{className:"ask-user-group",children:[R.question&&c.jsx("div",{className:"ask-user-question",children:R.question}),c.jsx("div",{className:"ask-user-options",children:R.selections.map(T=>{var M;const P=((M=a.get(Ng(h,C)))==null?void 0:M.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${P?"selected":""}`,disabled:x,onClick:()=>w(C,R.question,T),children:T},T)})})]},C)),x?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:y,children:[c.jsx(ra,{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"})]})}Xe.setOptions({breaks:!0,gfm:!0});function $k({attachments:n}){const[r,s]=k.useState(null);return k.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(Im,{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(Gn,{size:20})})]})})]})}function Fk(n){const r=Xe.parse(n);return fd.sanitize(r)}function Yh(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function Uk(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const Xh='<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 Bk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${Xh}</body>`):n+Xh}function Wk({html:n}){const[r,s]=k.useState(480),o=k.useRef(null);return k.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:Bk(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const Qh=1e4;function Hk({item:n,runtimeType:r,turn:s,threads:o}){var h,m,g,x,w,y,N,R;const a=n.status==="in_progress",[u,f]=k.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:T}=vu(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:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Gh,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:Yh(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(Fx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:Fk(Yh(n))}})]});case"command_execution":{const C=n.data||{},T=Uk(C.command||""),P=C.aggregated_output||"",M=C.exit_code,H=a?"running…":M!==null?`exit ${M}`:"",I=P.length>Qh,W=I&&!u?P.slice(0,Qh)+`
|
|
424
|
+
… (truncated, click to expand)`:P;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(Lm,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),H&&c.jsx("span",{className:"turn-header-meta",children:H})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),P&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),I&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(Y=>!Y),children:u?"Show less":`Show full output (${(P.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,T=Array.isArray(C)?C:[],P=`${T.length} file${T.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(qx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:P})]}),c.jsx("div",{className:"file-change-list",children:T.map((M,H)=>{const I=M.kind==="add"?"A":M.kind==="delete"?"D":"M",W=M.kind==="add"?"fc-add":M.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:I}),c.jsx("span",{className:"fc-name",children:M.path})]},H)})})]})}case"mcp_tool_call":{const C=n.data||{},T=C.tool||"mcp";if(T==="Agent"){const V=C.arguments,ne=(V==null?void 0:V.description)||(V==null?void 0:V.prompt)||"Subagent",ae=n.status==="failed",fe=a?"running…":ae?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(yu,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ne}),c.jsx("span",{className:`agent-call-status ${a?"running":ae?"failed":"done"}`,children:fe})]})}const P=C.server||"",M=C.arguments,H=C.result,I=C.error,W=n.status==="failed"||!!I,Y=a?"running…":W?"failed":"done",K=((m=H==null?void 0:H.content)==null?void 0:m.filter(V=>V.type==="text").map(V=>V.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(l0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),P&&c.jsx("span",{className:"turn-header-meta",children:P}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:Y})]}),M&&Object.keys(M).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(M).map(([V,ne])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:V}),V==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ne)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ne=="string"?ne:JSON.stringify(ne,null,2)})]},V))}),K.length>0&&K.map((V,ne)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:V})},ne)),I&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:I})})]})}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(c0,{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=((x=n.data)==null?void 0:x.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(Zx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((T,P)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(Zr,{size:14}):c.jsx(li,{size:14})," ",T.text]},P))})]})}case"ask_user":return c.jsx(Kh,{item:n,turn:s});case"final_result":{const C=n.data??{},T=C.text||"",P=C.html||null,M=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:H,iconText:I}=vu(r??"codex");return c.jsxs(c.Fragment,{children:[(T||P)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${H}`,children:I}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(Gh,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:T,threads:o,runtimeType:r}),P&&c.jsx(Wk,{html:P})]}),M.length>0&&c.jsx(Kh,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},T=C.task_type||"unknown",P=C.subagent_type||null,M=C.description||"",H=C.status||"running",I=C.last_tool_name||null,W=C.token_count||null,Y=T==="local_agent",K=T==="local_bash",V=Y?yu:K?Mm:Am,ne=Y?`Subagent${P?`: ${P}`:""}`:K?"Monitor":"Background Task",ae=H==="running"?"running…":H==="completed"?"done":H==="failed"?"failed":H==="stopped"?"stopped":H,fe=n.status==="failed"||H==="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(V,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ne}),c.jsx("span",{className:"turn-header-meta",style:fe?{color:"var(--red)"}:void 0,children:ae})]}),M&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:M}),I&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",I,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=((w=n.data)==null?void 0:w.trigger)??"auto",T=((y=n.data)==null?void 0:y.pre_tokens)??0,P=((N=n.data)==null?void 0:N.post_tokens)??0,M=T>0?Math.round((1-P/T)*100):0,H=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(r0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:H})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",P.toLocaleString()," tokens (",M,"% reduction)"]})]})}case"error":{const C=((R=n.data)==null?void 0:R.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(Yu,{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 Cr=k.memo(Hk,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function Vk({turn:n,runtimeType:r,threads:s=[]}){en.trackRender("TurnContent");const[o,a]=k.useState(!1);k.useEffect(()=>{const T=n.items.some(P=>P.type==="background_task"&&P.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!T&&a(!1)},[n.status,n.items]);let u=-1;for(let T=n.items.length-1;T>=0;T--)if(n.items[T].type==="agent_message"){u=T;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,m=n.items.some(T=>T.type==="final_result"||T.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,w=h.filter(T=>{var P;return!(T.type==="reasoning"&&(!((P=T.data)!=null&&P.text)||T.data.text===""))}).filter(T=>!(T.type==="background_task"||T.type==="ask_user"||T.type==="final_result")),y=[];let N=null;for(const T of w)T.type==="agent_message"?(N&&y.push(N),N={agentMessage:T,toolItems:[],otherItems:[]}):(N||(N={agentMessage:null,toolItems:[],otherItems:[]}),Hh(T)?N.toolItems.push(T):N.otherItems.push(T));N&&y.push(N);const R=w.filter(T=>Hh(T)).length,C=R>0||w.length>0&&(n.status==="running"||n.status==="pending");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($k,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(T=>!T),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(Xx,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:R>0?`${R} tool call${R>1?"s":""}`:"thinking…"}),c.jsx(Ku,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:y.map((T,P)=>c.jsxs("div",{className:"intermediate-segment",children:[T.agentMessage&&c.jsx(Cr,{item:T.agentMessage,runtimeType:r,turn:n,threads:s}),T.otherItems.map(M=>c.jsx(Cr,{item:M,runtimeType:r,turn:n,threads:s},M.id)),T.toolItems.length>0&&c.jsx(jk,{items:T.toolItems,runtimeType:r,turn:n,threads:s})]},P))})]}),n.items.filter(T=>T.type==="background_task").map(T=>c.jsx(Cr,{item:T,runtimeType:r,turn:n,threads:s},`task-${T.id}`)),f&&c.jsx(Cr,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),g&&c.jsx(Cr,{item:g,runtimeType:r,turn:n,threads:s},g.id),f&&n.items.slice(u+1).filter(T=>T.type!=="ask_user"&&T.type!=="background_task"&&T.type!=="final_result").map(T=>c.jsx(Cr,{item:T,runtimeType:r,turn:n,threads:s},T.id)),n.items.filter(T=>T.type==="final_result").map(T=>c.jsx(Cr,{item:T,runtimeType:r,turn:n,threads:s},`final-${T.id}`)),n.items.filter(T=>T.type==="ask_user").map(T=>c.jsx(Cr,{item:T,runtimeType:r,turn:n,threads:s},`ask-${T.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&&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==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(li,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const Gk=k.memo(Vk);function Cg(n,r="session",s=0){const o=[];if(r==="session")n.forEach((u,f)=>Zh(u,f,o));else{const u=n[s];u&&Zh(u,s,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function Zh(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 qk=[],jl=50;function Kk(){en.trackRender("RenderArea");const n=L(P=>P.activeSessionId),r=L(P=>P.activeSessionId?P.sessionDetails[P.activeSessionId]:null),s=L(P=>P.activeTurnIndex),o=L(P=>P.activeRightTab),a=L(P=>P.changesScope),u=L(P=>P.submittingPrompt),f=L(P=>P.loading),h=L(P=>P.selectedChangePath),m=L(P=>P.setSelectedChangePath),g=(r==null?void 0:r.turns)??[],x=(r==null?void 0:r.threads)??qk,w=k.useRef(null),[y,N]=k.useState(jl);k.useEffect(()=>{N(jl)},[n]);const R=g.filter(P=>!P.thread_id),C=Math.max(0,R.length-y),T=R.slice(C);if(k.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[n,g.length]),k.useEffect(()=>{if(!h||o!=="changes")return;const P=setTimeout(()=>{const M=h.replace(/[^a-zA-Z0-9]/g,"-"),H=document.getElementById(`diff-${M}`);H&&(H.scrollIntoView({behavior:"smooth",block:"start"}),H.classList.add("diff-highlight"),setTimeout(()=>H.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(P)},[h,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 P=Cg(g,a,s);return P.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:w,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:[P.length," file",P.length>1?"s":""]})]}),P.map(M=>{const H=M.path.split("/").pop()||M.path,I=M.path.replace("/"+H,""),W=M.kind==="add"?"Added":M.kind==="delete"?"Deleted":"Modified",Y=M.kind==="add"?"fc-add":M.kind==="delete"?"fc-del":"fc-mod",K=M.kind==="add"?"A":M.kind==="delete"?"D":"M",V=M.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${V}`,children:[c.jsx("span",{className:`diff-file-status ${Y}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[I&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[I,"/"]}),H]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${Y}`,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)."})]},M.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:w,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:()=>N(P=>P+jl),children:["Show ",Math.min(jl,C)," earlier turns (",C," hidden)"]})}),T.map((P,M)=>c.jsx("div",{id:`turn-${C+M}`,className:"turn-block",children:c.jsx(Gk,{turn:P,runtimeType:r.runtime_type,threads:x})},P.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const Yk=k.memo(Kk),Xk=[{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 Qk(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function Zk(n,r,s=[]){const o=[...Xk,...Qk(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 Jk({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 du({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 eS(n){return En("/skills")}function tS({filter:n,onSelect:r,onClose:s}){const[o,a]=k.useState([]),[u,f]=k.useState(!0),[h,m]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{eS().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const x=o.filter(w=>w.name.toLowerCase().includes(n.toLowerCase())||w.description.toLowerCase().includes(n.toLowerCase()));return k.useEffect(()=>{m(0)},[n]),k.useEffect(()=>{function w(y){y.key==="ArrowDown"?(y.preventDefault(),m(N=>Math.min(N+1,x.length-1))):y.key==="ArrowUp"?(y.preventDefault(),m(N=>Math.max(N-1,0))):y.key==="Enter"?(y.preventDefault(),x[h]&&r(x[h])):y.key==="Escape"&&(y.preventDefault(),s())}return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[x,h,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&&x.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),x.map((w,y)=>c.jsxs("div",{className:`slash-popup-item ${y===h?"selected":""}`,onMouseEnter:()=>m(y),onClick:()=>r(w),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:w.name}),w.description&&c.jsx("span",{className:"slash-popup-hint",children:w.description})]}),!!w.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},w.id))]})}function nS(){return En("/providers")}function rS(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return En(`/providers/${n}/commands${s}`)}const sS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function iS(n){const[r,s]=k.useState([]),[o,a]=k.useState(!0);k.useEffect(()=>{nS().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)??sS,loading:o}}const Zs=32,fu=200;function Jh(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function em(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let tm=0;function oS(){return tm+=1,`att-${Date.now()}-${tm}`}function lS(){en.trackRender("CommandInputBar");const[n,r]=k.useState(""),s=k.useRef(null),o=k.useRef(Zs),a=k.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=L(),g=L(G=>G.activeSessionId),x=L(G=>G.activeSessionId?G.sessionDetails[G.activeSessionId]:null),w=L(G=>G.quotedText),y=Sm(x),N=!g,{capabilities:R}=iS(x==null?void 0:x.runtime_type),C=(x==null?void 0:x.runtime_type)??null,T=R.imageAttachments,[P,M]=k.useState([]),[H,I]=k.useState(!1),[W,Y]=k.useState(null),[K,V]=k.useState([]);k.useEffect(()=>{if(!C){V([]);return}let G=!1;return rS(C,(x==null?void 0:x.cwd)??void 0).then(he=>{G||V(he)}).catch(()=>{G||V([])}),()=>{G=!0}},[C,x==null?void 0:x.cwd]);const[ne,ae]=k.useState(!1),[fe,Le]=k.useState(""),[Re,Pe]=k.useState(0),[Z,te]=k.useState(void 0),[le,j]=k.useState(!1),[q,B]=k.useState(""),[E,D]=k.useState([]),ie=ne?Zk(fe,R,K):[];k.useEffect(()=>{w!==null&&(r(G=>G+w),setTimeout(()=>{if(s.current){at(),s.current.focus();const G=s.current.value.length;s.current.setSelectionRange(G,G)}},0),L.setState({quotedText:null}))},[w]),k.useEffect(()=>{if(!y)return;function G(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[y,f]),k.useEffect(()=>{ae(!1),te(void 0),j(!1),D([]),M(G=>{for(const he of G)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[g]),k.useEffect(()=>{if(!W)return;function G(he){he.key==="Escape"&&(he.preventDefault(),Y(null))}return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[W]);const oe=k.useCallback(G=>{if(!G)return;const he=Array.from(G);for(const Ue of he){const nt=new FileReader;nt.onload=()=>{const ft=nt.result.split(",")[1]??"",ot=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;M(Ot=>[...Ot,{id:oS(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:ft,previewUrl:ot,size:Ue.size}])},nt.readAsDataURL(Ue)}},[]),ve=k.useCallback(G=>{M(he=>{const Ue=he.find(nt=>nt.id===G);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(nt=>nt.id!==G)})},[]),pe=k.useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(!T||y)&&I(!0)},[T,y]),Ae=k.useCallback(G=>{G.preventDefault(),G.stopPropagation(),I(!1)},[]),Ce=k.useCallback(G=>{G.preventDefault(),G.stopPropagation(),I(!1),!(!T||y)&&oe(G.dataTransfer.files)},[T,y,oe]),be=k.useCallback(G=>{var nt;if(!T)return;const he=(nt=G.clipboardData)==null?void 0:nt.items;if(!he)return;const Ue=[];for(let wt=0;wt<he.length;wt++){const ft=he[wt];if(ft.type.startsWith("image/")){const ot=ft.getAsFile();ot&&Ue.push(ot)}}Ue.length>0&&(G.preventDefault(),oe(Ue))},[T,oe]);function we(G){const he=s.current;he&&(he.style.height=`${G}px`,o.current=G)}function at(){const G=s.current;if(G){if(G.scrollHeight>G.clientHeight){const he=Math.min(G.scrollHeight,fu);he!==o.current&&we(he);return}o.current>Zs&&(G.style.height="auto",we(Math.min(G.scrollHeight,fu)))}}function Ie(){const G=n.trim();if(!G||y)return;let he=G;E.length>0&&(he=`${E.map(wt=>`$${wt.name}`).join(" ")}
|
|
425
|
+
|
|
426
|
+
${G}`);const Ue=P.map(({id:nt,previewUrl:wt,size:ft,...ot})=>ot);r(""),D([]),we(Zs),ae(!1),te(void 0),j(!1);for(const nt of P)nt.previewUrl&&URL.revokeObjectURL(nt.previewUrl);M([]),u(he,Ue.length>0?Ue:void 0)}function xt(G){if(G.insertAsText){const he=`/${G.id} `;r(he),ae(!1),te(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Ue=he.length;s.current.setSelectionRange(Ue,Ue),at()}});return}G.subPopup?te(G.subPopup):G.id==="skills"?(j(!0),B(""),ae(!1),r("")):G.id==="model"?(m(!0),ae(!1),r("")):(ae(!1),r(""))}function ze(G){D(he=>[...he,G]),j(!1),r(""),we(Zs)}function dt(G){const he=Jh(x==null?void 0:x.runtime_config);Z==="sandbox"?he.sandboxMode=G:Z==="websearch"?he.webSearchMode=G:Z==="network"&&(he.networkAccessEnabled=G==="true"),h(he),te(void 0),ae(!1),r(""),we(Zs)}function Be(G){if(en.markKeystroke(),ne&&!Z){if(G.key==="ArrowDown"){G.preventDefault(),Pe(he=>Math.min(he+1,ie.length-1));return}if(G.key==="ArrowUp"){G.preventDefault(),Pe(he=>Math.max(he-1,0));return}if(G.key==="Enter"){G.preventDefault(),ie[Re]&&xt(ie[Re]);return}if(G.key==="Escape"){G.preventDefault(),ae(!1),r("");return}}if(Z&&G.key==="Escape"){G.preventDefault(),te(void 0);return}if(G.key==="Enter"&&(G.metaKey||G.ctrlKey)&&!y){G.preventDefault(),Ie();return}G.key==="Escape"&&y&&(G.preventDefault(),f())}function nn(G){en.markInputChange();const he=G.target.value;r(he),at(),he.startsWith("/")&&!he.includes(" ")&&!y?(ae(!0),Le(he.slice(1)),Pe(0)):(ae(!1),te(void 0)),he.startsWith("$")&&!y?(j(!0),B(he.slice(1))):he.startsWith("$")||j(!1)}const yn=Jh(x==null?void 0:x.runtime_config),Mt=[{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"}],Tt=[{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"}],Lt=[{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${H?" drag-over":""}`,onDragOver:pe,onDragLeave:Ae,onDrop:Ce,children:[ne&&!Z&&c.jsx(Jk,{commands:ie,selectedIndex:Re,onSelect:xt,onHover:Pe}),ne&&Z==="sandbox"&&c.jsx(du,{title:"Sandbox Mode",options:Mt,currentValue:yn.sandboxMode,onSelect:dt,onClose:()=>te(void 0)}),ne&&Z==="websearch"&&c.jsx(du,{title:"Web Search",options:Tt,currentValue:yn.webSearchMode,onSelect:dt,onClose:()=>te(void 0)}),ne&&Z==="network"&&c.jsx(du,{title:"Network Access",options:Lt,currentValue:yn.networkAccessEnabled===!0?"true":"false",onSelect:dt,onClose:()=>te(void 0)}),le&&c.jsx(tS,{filter:q,onSelect:ze,onClose:()=>{j(!1),r("")}}),E.length>0&&c.jsx("div",{className:"skill-badges",children:E.map(G=>c.jsxs("span",{className:"skill-badge",children:["$",G.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>D(he=>he.filter(Ue=>Ue.id!==G.id)),children:"×"})]},G.id))}),P.length>0&&c.jsx("div",{className:"attachment-preview-area",children:P.map(G=>c.jsxs("div",{className:"attachment-chip",title:G.name,children:[G.previewUrl?c.jsx("img",{src:G.previewUrl,alt:G.name,className:"attachment-thumb",onClick:()=>Y(G),style:{cursor:"pointer"}}):c.jsx(Im,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:G.name}),c.jsx("span",{className:"attachment-size",children:em(G.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>ve(G.id),title:"Remove attachment",children:c.jsx(Gn,{size:14})})]},G.id))}),T&&!y&&!N&&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:G=>{oe(G.target.files),G.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[T&&!y&&!N&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var G;return(G=a.current)==null?void 0:G.click()},title:"Attach files",disabled:y,children:c.jsx(i0,{size:16})}),c.jsx("textarea",{ref:s,className:"cmd-textarea",placeholder:N?"Select or create a session…":y?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:y||N,rows:1,style:{minHeight:Zs,maxHeight:fu},onChange:nn,onKeyDown:Be,onPaste:be}),y?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(li,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:Ie,disabled:!n.trim()||N,title:"Send (⌘↵)",children:c.jsx($x,{size:16})})]}),W&&c.jsx("div",{className:"image-preview-modal",onClick:()=>Y(null),children:c.jsxs("div",{className:"image-preview-content",onClick:G=>G.stopPropagation(),children:[c.jsx("img",{src:W.previewUrl,alt:W.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:W.name}),c.jsx("span",{children:em(W.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>Y(null),children:c.jsx(Gn,{size:20})})]})})]})}function aS(){const n=L(T=>T.activeSessionId),r=L(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),s=L(T=>T.activeTurnIndex),o=L(T=>T.setActiveTurnIndex),a=L(T=>T.rewindToTurn),u=L(T=>T.restoreSession),f=L(T=>T.branchFromTurn),h=(r==null?void 0:r.turns)??[],m=ta(r),g=!!(r!=null&&r.rewound_at_turn_id),x=(r==null?void 0:r.runtime_type)==="repoburg",w=x?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[y,N]=k.useState(null),R=k.useRef(null);if(na(R,()=>N(null),!!y),Gu(()=>N(null),!!y),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(T){o(T),requestAnimationFrame(()=>{var P;(P=document.getElementById(`turn-${T}`))==null||P.scrollIntoView({behavior:"smooth",block:"start"})})}return c.jsxs("div",{className:"right-section",children:[c.jsx("div",{className:"right-section-title",children:"Conversation"}),h.map((T,P)=>{const M=P===s,H=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,I=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${M?"active":""}`,onClick:()=>C(P),onContextMenu:W=>{W.preventDefault(),N({x:W.clientX,y:W.clientY,turnId:T.id,turnIndex:P,isLast:P===h.length-1,isSlashCommand:T.user_prompt.trimStart().startsWith("/")})},children:[c.jsx("span",{className:"turn-item-icon",style:{background:"var(--amber)",color:"#fff"},children:c.jsx(h0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:H}),I&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},T.id)}),y&&c.jsxs("div",{ref:R,className:"ctx-menu",style:{position:"fixed",left:y.x,top:y.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${y.isLast||m||y.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{y.isLast||m||y.isSlashCommand||(window.confirm(w)&&a(n,y.turnId),N(null))},children:[c.jsx(a0,{size:12})," Rewind to Here",y.isSlashCommand?" (slash command)":""]}),g&&!x&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),N(null)},children:[c.jsx(oo,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,y.turnId),N(null)},children:[c.jsx(Kx,{size:12})," Branch from Here"]})]})]})}function cS(){const n=L(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),r=L(h=>h.changesScope),s=L(h=>h.setChangesScope),o=L(h=>h.activeTurnIndex),a=L(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Cg(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(h=>{const m=h.kind==="add"?"fc-add":h.kind==="delete"?"fc-del":"fc-mod",g=h.kind==="add"?"A":h.kind==="delete"?"D":"M",x=h.path.split("/").pop()||h.path,w=h.path.replace("/"+x,"");return c.jsxs("div",{className:"file-change clickable",onClick:()=>a(h.path),children:[c.jsx("span",{className:`fc-status ${m}`,children:g}),c.jsxs("span",{className:"fc-name",children:[w&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[w,"/"]}),x]})]},h.path)})]})]})}const nm=2e4;function uS(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 dS({entry:n}){const{item:r,turnIndex:s,turnPrompt:o}=n,a=r.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",m=a.status||"running",g=a.summary||null,x=a.last_tool_name||null,w=a.token_count||null,y=a.output||"",N=r.status==="in_progress",R=u==="local_agent",C=u==="local_bash",T=R?yu:C?Mm:Am,P=R?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",M=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,H=r.status==="failed"||m==="failed",[I,W]=k.useState(N),[Y,K]=k.useState(!1),V=k.useRef(null);k.useEffect(()=>{N&&W(!0)},[N]),k.useEffect(()=>{I&&N&&V.current&&(V.current.scrollTop=V.current.scrollHeight)},[I,N,y]);const ne=y.length>nm,ae=ne&&!Y?y.slice(0,nm)+`
|
|
427
|
+
… (truncated, click to expand)`:y,fe=N?null:m==="completed"?c.jsx(Zr,{size:12}):H?c.jsx(Yu,{size:12}):c.jsx(li,{size:12});return c.jsxs("div",{className:`task-card ${N?"task-running":""} ${H?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(Le=>!Le),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:P}),c.jsxs("span",{className:`task-card-status ${H?"task-status-failed":N?"task-status-running":"task-status-done"}`,children:[fe," ",M]}),c.jsx(Ku,{size:14,className:"task-card-chevron",style:{transform:I?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),N&&x&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",x,w!=null&&` · ${w.toLocaleString()} tokens`]}),I&&c.jsxs("div",{className:"task-card-body",children:[y?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:V,children:c.jsx("code",{children:ae})}),ne&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(Le=>!Le),children:Y?"Show less":`Show full output (${(y.length/1024).toFixed(0)}KB)`})]}):g?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:g})}):N?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 fS=k.memo(dS);function pS(){var h,m;const n=L(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),r=(n==null?void 0:n.turns)??[],s=(n==null?void 0:n.backgroundTasks)??[],o=uS(r),a=[...o].sort((g,x)=>{const w=g.item.status==="in_progress",y=x.item.status==="in_progress";return w&&!y?-1:!w&&y?1:x.turnIndex-g.turnIndex}),u=new Map;for(const g of s)g.task_type==="local_bash"&&u.set(g.task_id,g.task_type);for(const g of o)if(g.item.status==="in_progress"){const x=((h=g.item.data)==null?void 0:h.task_id)??g.item.external_item_id,w=((m=g.item.data)==null?void 0:m.task_type)??"unknown";u.set(x,w)}const f=[...u.values()].filter(g=>g==="local_bash").length;return o.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 (",o.length,")",f>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",f," running"]})]}),a.map(g=>c.jsx(fS,{entry:g},g.item.id))]})}const hS=k.memo(pS);function mS({thread:n,onClose:r}){const{activeSessionId:s,resolveThread:o,shareThread:a}=L(),[u,f]=k.useState(""),[h,m]=k.useState(!1),[g,x]=k.useState(!1);async function w(){if(!s||h)return;m(!0),await a(s,n.id,u)?r():m(!1)}async function y(){!s||g||(x(!0),await o(s,n.id),r())}const N=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:N?void 0:r,children:c.jsxs("div",{className:"dialog",onClick:R=>R.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:N,children:c.jsx(Gn,{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:R=>f(R.target.value),rows:3,disabled:N,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:N,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:N,title:"Resolve without sharing",children:[g?c.jsx(nr,{size:13,className:"spin"}):c.jsx(Bl,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:w,disabled:N,children:[h?c.jsx(nr,{size:13,className:"spin"}):c.jsx(u0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const rm=[];Xe.setOptions({breaks:!0,gfm:!0});function gS(n){const r=Xe.parse(n);return fd.sanitize(r)}function vS(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(`
|
|
428
|
+
|
|
429
|
+
`):null}return null}function yS(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function xS({turn:n}){const r=yS(n.user_prompt),s=n.items.map(vS).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:gS(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 wS({thread:n,threadTurns:r,onStop:s,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Re,Pe,Z;const[m,g]=k.useState(""),[x,w]=k.useState(!0),y=k.useRef(null),N=k.useRef(null),[R,C]=k.useState(!1),[T,P]=k.useState({x:0,y:0}),[M,H]=k.useState(""),I=r.some(oi),W=28,Y=120,K=k.useRef(W);k.useEffect(()=>{const te=N.current;te&&(te.scrollTop=te.scrollHeight)},[r.length,x]);function V(te){const le=y.current;le&&(le.style.height=`${te}px`,K.current=te)}function ne(){const te=y.current;if(te){if(te.scrollHeight>te.clientHeight){const le=Math.min(te.scrollHeight,Y);le!==K.current&&V(le);return}K.current>W&&(te.style.height="auto",V(Math.min(te.scrollHeight,Y)))}}const ae=k.useCallback(()=>{C(!1)},[]),fe=k.useCallback(()=>{const te=N.current;if(!te)return;const le=window.getSelection();if(!le||le.rangeCount===0||le.isCollapsed){C(!1);return}const j=le.getRangeAt(0);if(!te.contains(j.commonAncestorContainer)){C(!1);return}const q=j.commonAncestorContainer.nodeType===Node.TEXT_NODE?j.commonAncestorContainer.parentElement:j.commonAncestorContainer;if(!(q!=null&&q.closest(".thread-card-ai-response"))){C(!1);return}const B=le.toString();if(!B.trim()){C(!1);return}const E=j.getBoundingClientRect(),D=28,ie=6,oe=170;let ve=!1;if(le.anchorNode&&le.focusNode)try{const Ce=document.createRange();Ce.setStart(le.focusNode,le.focusOffset),Ce.setEnd(le.focusNode,le.focusOffset);const be=document.createRange();be.setStart(le.anchorNode,le.anchorOffset),be.setEnd(le.anchorNode,le.anchorOffset),ve=be.compareBoundaryPoints(Range.START_TO_START,Ce)>0}catch{ve=!1}let pe=E.top-D-ie;pe<8&&(pe=E.bottom+ie);let Ae=ve?E.left-oe:E.right;Ae=Math.max(8,Math.min(Ae,window.innerWidth-oe-8)),P({x:Ae,y:pe}),H(B),C(!0)},[]);k.useEffect(()=>{function te(le){const j=le.target;j&&j.closest(".selection-actions")||fe()}return document.addEventListener("mouseup",te),()=>document.removeEventListener("mouseup",te)},[fe]);const Le=k.useCallback(()=>{var le;const te=`
|
|
430
|
+
\`\`\`QUOTE
|
|
431
|
+
${M}
|
|
432
|
+
\`\`\`
|
|
433
|
+
|
|
434
|
+
`;g(j=>j+te),C(!1),H(""),(le=window.getSelection())==null||le.removeAllRanges(),setTimeout(()=>{if(y.current){ne(),y.current.focus();const j=y.current.value.length;y.current.setSelectionRange(j,j)}},0)},[M]);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:()=>w(te=>!te),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Z=(Pe=(Re=n.turns)==null?void 0:Re[0])==null?void 0:Pe.user_prompt)==null?void 0:Z.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:te=>{te.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(s0,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),x&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:N,onMouseDown:ae,children:[r.map(te=>c.jsx(xS,{turn:te},te.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),R&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:Le,title:"Quote this text in your follow-up",children:[c.jsx(Dm,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:y,className:"thread-card-followup-input",placeholder:I?"Agent is running…":"Type a follow-up…",value:m,onChange:te=>{en.markInputChange(),g(te.target.value),ne()},disabled:I,rows:1,style:{minHeight:W,maxHeight:Y},onKeyDown:te=>{en.markKeystroke(),te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&!I&&m.trim()&&(te.preventDefault(),f(m.trim()),g(""),V(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:I||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(ra,{size:13})}),I&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(li,{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(Bl,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(oo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(fr,{size:13})," Delete"]})]})]})]})}function kS(){en.trackRender("ThreadsPanel");const n=L(M=>M.activeSessionId),r=L(M=>{var H;return M.activeSessionId?((H=M.sessionDetails[M.activeSessionId])==null?void 0:H.threads)??rm:rm}),s=L(M=>M.followupThread),o=L(M=>M.cancelThreadTurn),a=L(M=>M.reopenThread),u=L(M=>M.deleteThread),f=L(M=>M.activeRightTab),h=L(M=>M.switchRightTab),m=L(M=>M.deepLinkThreadId),g=L(M=>M.setDeepLinkThreadId),[x,w]=k.useState("open"),[y,N]=k.useState(null);k.useEffect(()=>{if(!m)return;const M=m;g(null),w(I=>r.some(W=>W.id===M&&W.status==="open")?I:"all");const H=setTimeout(()=>{const I=document.getElementById(`thread-${M}`);I&&(I.scrollIntoView({behavior:"smooth",block:"center"}),I.classList.add("thread-card-highlighted"),setTimeout(()=>I.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(H)},[m,g,r]);const R=r.filter(M=>x==="open"?M.status==="open":x==="resolved"?M.status==="resolved":!0),C=r.filter(M=>M.status==="open").length,T=r.filter(M=>M.status==="resolved").length;function P(M){f==="changes"&&h("turns"),setTimeout(()=>{const H=document.querySelector(`mark[data-thread-id="${M}"]`);H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("thread-mark-flash"),setTimeout(()=>H.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(n0,{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 ${x==="open"?"active":""}`,onClick:()=>w("open"),children:["Open (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="resolved"?"active":""}`,onClick:()=>w("resolved"),children:["Resolved (",T,")"]}),c.jsxs("button",{className:`thread-filter-tab ${x==="all"?"active":""}`,onClick:()=>w("all"),children:["All (",r.length,")"]})]}),R.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):R.map(M=>c.jsx(wS,{thread:M,threadTurns:M.turns??[],onStop:()=>o(n,M.id),onResolve:()=>N(M),onReopen:()=>a(n,M.id),onDelete:()=>u(n,M.id),onFollowup:H=>s(n,M.id,H),onLocate:()=>P(M.id)},M.id)),y&&c.jsx(mS,{thread:y,onClose:()=>N(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function SS(){const n=L(f=>f.apps),r=L(f=>f.activeAppTabId),s=L(f=>f.openAppTab),o=L(f=>f.startAppEdit),a=L(f=>f.toggleAppPin),u=L(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:h=>{h.stopPropagation(),o(f.id)},children:c.jsx(Dl,{size:12})}),c.jsx("button",{className:`apps-panel-action${f.pinned?" pinned":""}`,title:f.pinned?"Unpin app":"Pin app (sorts first)",onClick:h=>{h.stopPropagation(),a(f.id)},children:c.jsx(Wl,{size:12,fill:f.pinned?"currentColor":"none"})}),c.jsx("button",{className:"apps-panel-action apps-panel-danger",title:"Delete app",onClick:h=>{h.stopPropagation(),u(f.id)},children:c.jsx(fr,{size:12})})]},f.id))})}function TS(){var f,h;en.trackRender("RightPanel");const n=L(m=>m.activeRightTab),r=L(m=>m.switchRightTab),s=L(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=s==null?void 0:s.backgroundTasks)==null?void 0:f.length)??0,a=((h=s==null?void 0:s.threads)==null?void 0:h.filter(m=>m.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(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(aS,{}),n==="changes"&&c.jsx(cS,{}),n==="tasks"&&c.jsx(hS,{}),n==="threads"&&c.jsx(kS,{}),n==="apps"&&c.jsx(SS,{})]})]})}const Ne={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"}},Au=[{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:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.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:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]}]}];function bS(n){return Au.find(r=>r.id===n)}function pd(n){const r=bS(n);return(r==null?void 0:r.models)??[]}function Eg(n,r){return pd(n).find(s=>s.slug===r)}function Iu(n,r){var s;return((s=Eg(n,r))==null?void 0:s.reasoningLevels)??[]}function Du(n,r){var s;return(s=Eg(n,r))==null?void 0:s.defaultReasoning}function NS(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=L(),o=L(Z=>Z.showModelSelector),a=L(Z=>Z.setShowModelSelector),u=r.find(Z=>Z.id===n),f=L(Z=>Z.models),h=L(Z=>Z.modelsLoading),m=L(Z=>Z.loadModels),[g,x]=k.useState(!1),w=k.useRef(null);if(na(w,()=>x(!1),g),Gu(()=>x(!1),g),k.useEffect(()=>{o&&(x(!0),a(!1))},[o,a]),k.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 y=u.runtime_type,N=u.model??"",R=u.model_reasoning_effort??"",C=f.length>0?f:[],T=pd(y),M=[...C.length>0?C:T];if(N&&!M.some(Z=>Z.slug===N)){const Z=T[0];M.unshift({slug:N,displayName:N,description:"Custom model",defaultReasoning:(Z==null?void 0:Z.defaultReasoning)??"medium",reasoningLevels:(Z==null?void 0:Z.reasoningLevels)??[]})}function H(Z){return M.find(te=>te.slug===Z)}function I(Z){var te;return C.length>0?((te=H(Z))==null?void 0:te.reasoningLevels)??[]:Iu(y,Z)}function W(Z){var te;return C.length>0?(te=H(Z))==null?void 0:te.defaultReasoning:Du(y,Z)}const Y=Au.find(Z=>Z.id===y),K=H(N),V=N?I(N):[],ne=(Y==null?void 0:Y.label)??y,ae=(K==null?void 0:K.displayName)??(N||"Default"),fe=V.find(Z=>Z.effort===R),Le=(fe==null?void 0:fe.label)??(R||"Default");function Re(Z){var q;const te=I(Z),j=te.some(B=>B.effort===R)?R:W(Z)??((q=te[0])==null?void 0:q.effort)??"";s(Z,j),x(!1)}function Pe(Z){s(N,Z),x(!1)}return c.jsxs("div",{className:"model-selector",ref:w,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>x(!g),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ne}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ae}),Le!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:Le})]}),c.jsx(io,{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"}),Au.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.id===y?"selected":""} ${Z.available?"":"disabled"}`,onClick:()=>{if(Z.available){if(Z.id===y){x(!1);return}s("","",Z.id)}},children:[c.jsx("span",{children:Z.label}),!Z.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(e0,{size:10})," Soon"]}),Z.id===y&&c.jsx(Zr,{size:12})]},Z.id))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&c.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&M.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),M.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.slug===N?"selected":""}`,onClick:()=>Re(Z.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Z.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Z.description})]}),Z.slug===N&&c.jsx(Zr,{size:12})]},Z.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),V.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),V.map(Z=>c.jsxs("div",{className:`model-selector-item ${Z.effort===R?"selected":""}`,onClick:()=>Pe(Z.effort),children:[c.jsx("span",{children:Z.label}),Z.effort===R&&c.jsx(Zr,{size:12})]},Z.effort))]})]})]})}function CS(n,r){if(!n||n.turns.length===0)return"—";const s=n.turns[0],o=n.turns[n.turns.length-1],a=r?null:o.updated_at;return Dx(s.created_at,a)}function Rl(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function sm(){const n=L(s=>s.setShowRemoteModal),r=Pu(window.location.hostname);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(g0,{size:14})," Repoburg",r?` · ${r}`:""]})}function im(){const n=L(s=>s.vscodeViewOpen),r=L(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(Hx,{size:14})," VS Code"]})}function ES(){var y,N;en.trackRender("StatusBar");const n=L(R=>R.activeSessionId),r=L(R=>n?R.sessions.find(C=>C.id===n)??null:null),s=L(R=>n?R.sessionDetails[n]??null:null),o=L(R=>R.wsConnected),a=L(R=>R.switchRightTab),u=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(sm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(im,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:[c.jsx("span",{className:`status-dot ${o?"done":"error"}`}),o?"Live":"Offline"]}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(oh,{size:14})," K"]})]});const f=Vu(r),h=CS(s,f.isRunning),m=(s==null?void 0:s.backgroundTasks)??[],g=new Set,x=new Map;for(const R of m)g.add(R.task_id),x.set(R.task_id,R.task_type);for(const R of(s==null?void 0:s.turns)??[])for(const C of R.items)if(C.type==="background_task"&&C.status==="in_progress"){const T=((y=C.data)==null?void 0:y.task_id)??C.external_item_id,P=((N=C.data)==null?void 0:N.task_type)??"unknown";g.add(T),x.set(T,P)}const w=[...x.values()].filter(R=>R==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(sm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(im,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(NS,{}),w>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:`${w} Monitor task${w>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[c.jsx(Lm,{size:14})," ",w]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",title:o?"WebSocket connected":"WebSocket disconnected",children:[c.jsx("span",{className:`status-dot ${o?"done":"error"}`}),o?"Live":"Offline"]}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:r.status==="failed"?{color:"var(--red)"}:void 0,children:[c.jsx(qu,{status:f.dot})," ",f.label]}),u&&c.jsx(_S,{usage:u}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",children:h}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(oh,{size:14})," K"]})]})}function _S({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${Rl(n.totalTokens)} / ${Rl(n.contextWindow)} tokens`;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),"% / ",Rl(n.totalTokens)," / ",Rl(n.contextWindow)]})})]})}function om(n){return En(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function jS(n){return At("/vscode-web/start",{folder:n})}function RS(n){return At("/vscode-web/heartbeat",{id:n})}const AS=1e3,IS=5*6e4;function DS(){const n=L(w=>w.vscodeState),r=L(w=>w.vscodeId),s=L(w=>w.vscodeToken),o=L(w=>w.setVscodeView),a=L(w=>{var N;const y=w.activeSessionId?w.sessions.find(R=>R.id===w.activeSessionId):null;return y!=null&&y.cwd?y.cwd:((N=w.workspaces.find(R=>R.deleted===0))==null?void 0:N.path)??null}),[u,f]=k.useState(!1),[h,m]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{let w=!1;function y(){g.current&&(clearInterval(g.current),g.current=null)}async function N(){try{let C=await om(a);if((C.state==="stopped"||C.state==="error")&&(C=await jS(a)),w||(o(C.state,C.id,C.token),C.state==="running"||C.state==="error"))return;g.current=setInterval(async()=>{const T=await om(a);w||(o(T.state,T.id,T.token),(T.state==="running"||T.state==="error"||T.state==="stopped")&&y())},AS)}catch{w||o("error",null,null)}}N();const R=setInterval(()=>{const C=L.getState().vscodeId;C&&RS(C).catch(()=>{})},IS);return()=>{w=!0,y(),clearInterval(R)}},[h,a,o]);function x(){f(!1),o("starting",null,null),m(w=>w+1)}return n!=="running"||!s||!r?c.jsx("div",{className:"vscode-view vscode-view--loading",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:x,children:[c.jsx(oo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(nr,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(nr,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:`${pr()}/vscode/${r}/?tkn=${s}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]})}const MS=`(function () {
|
|
435
|
+
var nextId = 1;
|
|
436
|
+
var pending = new Map();
|
|
437
|
+
var listeners = [];
|
|
438
|
+
window.addEventListener('message', function (e) {
|
|
439
|
+
var msg = e.data;
|
|
440
|
+
if (!msg || msg.source !== 'agentpane-host') return;
|
|
441
|
+
if (msg.id != null && pending.has(msg.id)) {
|
|
442
|
+
var p = pending.get(msg.id);
|
|
443
|
+
pending.delete(msg.id);
|
|
444
|
+
if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
|
|
445
|
+
} else if (msg.event) {
|
|
446
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
447
|
+
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
function call(method, params) {
|
|
452
|
+
return new Promise(function (resolve, reject) {
|
|
453
|
+
var id = nextId++;
|
|
454
|
+
pending.set(id, { resolve: resolve, reject: reject });
|
|
455
|
+
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
window.AgentPane = {
|
|
459
|
+
getApp: function () { return call('getApp'); },
|
|
460
|
+
getState: function () { return call('getState'); },
|
|
461
|
+
setState: function (data) { return call('setState', { data: data }); },
|
|
462
|
+
createSession: function (opts) { return call('createSession', opts); },
|
|
463
|
+
submitTurn: function (sessionId, prompt) { return call('submitTurn', { sessionId: sessionId, prompt: prompt }); },
|
|
464
|
+
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
465
|
+
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
466
|
+
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
467
|
+
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
468
|
+
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); }
|
|
469
|
+
};
|
|
470
|
+
})();`;function lm(n){return n.replace(/<\/script/gi,"<\\/script")}function am(n,r,s){const o=n.toLowerCase().lastIndexOf(r.toLowerCase());return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function LS(n,r,s){let o=n;const a=`<script>${lm(r)}<\/script>`;if(/<\/head>/i.test(o)?o=am(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${lm(s)}<\/script>`;o=am(o,"</body>",u)}return o}function PS({appId:n,workspace:r=""}){const s=k.useRef(null),o=k.useRef({pinned:!1,data:null}),[a,u]=k.useState(null),[f,h]=k.useState(null);k.useEffect(()=>{let g=!0;qy(n,w=>{var y,N;return(N=(y=s.current)==null?void 0:y.contentWindow)==null?void 0:N.postMessage(w,"*")});const x=async w=>{var T,P,M,H,I,W,Y,K;if(w.source!==((T=s.current)==null?void 0:T.contentWindow))return;const y=w.data;if(!y||y.source!=="agentpane-app"||typeof y.method!="string")return;let N=!0,R,C;try{switch(y.method){case"getApp":R={id:n};break;case"getState":R=o.current;break;case"setState":{const V=((P=y.params)==null?void 0:P.data)??null,ne=await Tm(n,{data:V},r);o.current=ne,R=ne;break}case"createSession":{const V=y.params??{},ne=await zu({title:typeof V.title=="string"?V.title:void 0,runtime_type:typeof V.runtime_type=="string"?V.runtime_type:void 0,model:typeof V.model=="string"?V.model:void 0,cwd:typeof V.cwd=="string"?V.cwd:void 0,origin_app_id:n});Kc(ne.id,n),R=ne;break}case"submitTurn":{const V=String(((M=y.params)==null?void 0:M.sessionId)??""),ne=String(((H=y.params)==null?void 0:H.prompt)??""),ae=await xm(V,ne);Kc(V,n),R=ae;break}case"resolveToolCall":{const V=String(((I=y.params)==null?void 0:I.callId)??""),ne=(W=y.params)==null?void 0:W.result;await yx(V,ne),R={ok:!0};break}default:throw new Error(`Unknown bridge method: ${y.method}`)}}catch(V){N=!1,C=V instanceof Error?V.message:String(V)}(K=(Y=s.current)==null?void 0:Y.contentWindow)==null||K.postMessage({source:"agentpane-host",id:y.id,ok:N,result:R,error:C},"*")};return window.addEventListener("message",x),Jy(n,()=>{nh(n,r).then(w=>{g&&(o.current=w)}).catch(()=>{})}),Qy(n,()=>{th(n).then(w=>{g&&u(w)}).catch(()=>{})}),(async()=>{try{const[w,y,N]=await Promise.all([th(n),nh(n,r),px(n).catch(()=>[])]);if(!g)return;o.current=y,N.forEach(R=>Kc(R.id,n)),u(w)}catch(w){g&&h(w instanceof Error?w.message:String(w))}})(),()=>{g=!1,Ky(n),Zy(n),ex(n),window.removeEventListener("message",x)}},[n,r]);const m=k.useMemo(()=>a?LS(a.html,MS,a.js):"",[a]);return f?c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]}):m?c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:m}):c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"})}function zS(){const n=L(w=>w.activeAppTabId),r=L(w=>w.apps),s=L(w=>w.workspaces),o=L(w=>w.appWorkspaces),a=L(w=>w.setAppWorkspace),u=L(w=>w.setActiveAppTab),f=L(w=>w.startAppEdit);if(!n)return null;const h=r.find(w=>w.id===n),m=o[n]??"",g=s.filter(w=>w.deleted!==1),x=m!==""&&!g.some(w=>w.path===m)?m:null;return c.jsxs("div",{className:"miniapp-view",children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx("span",{className:"miniapp-header-icon",children:(h==null?void 0:h.icon)??"◧"}),c.jsx("span",{className:"miniapp-header-title",children:(h==null?void 0:h.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:m,onChange:w=>a(n,w.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),g.map(w=>c.jsx("option",{value:w.path,children:w.label||w.path.split("/").pop()||w.path},w.path)),x&&c.jsx("option",{value:x,children:`${x} (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 f(n),children:[c.jsx(o0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>u(null),children:c.jsx(Gn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(PS,{appId:n,workspace:m},`${n}:${m}`)})]})}function OS({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=k.useState(!1),h=k.useRef(0),m=k.useRef(0),g=k.useCallback(y=>{const N=y.clientX-h.current,R=n==="left"?m.current+N:m.current-N,C=Math.min(s,Math.max(r,R));a(C)},[n,r,s,a]),x=k.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",x),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:k.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h.current=y.clientX,m.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",x)},[o,g,x]),dragging:u}}function cm({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=OS({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 $S(){en.trackRender("IdeWorkspace");const n=L(h=>h.sidebarWidth),r=L(h=>h.rightPanelWidth),s=L(h=>h.setSidebarWidth),o=L(h=>h.setRightPanelWidth),a=L(h=>h.vscodeViewOpen),u=L(h=>h.activeAppTabId);k.useEffect(()=>{const h=()=>{const m=zl(),{rightPanelWidth:g,setRightPanelWidth:x}=L.getState();g>m&&x(m)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]);const f=`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a||u!=null?"ide-hidden":""}`,style:{gridTemplateColumns:f},children:[c.jsx(f1,{}),c.jsx(cm,{side:"left",minWidth:hu,maxWidth:mu,getWidth:()=>L.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(p1,{}),c.jsx("div",{className:"ide-render",children:c.jsx(Yk,{})}),c.jsx(lS,{})]}),c.jsx(cm,{side:"right",minWidth:Pl,maxWidth:zl(),getWidth:()=>L.getState().rightPanelWidth,setWidth:o}),c.jsx(TS,{})]}),a&&c.jsx(DS,{}),!a&&u!=null&&c.jsx(zS,{}),c.jsx(ES,{})]})}function FS(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=L(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,m]=k.useState(""),[g,x]=k.useState(u),[w,y]=k.useState(f),[N,R]=k.useState("");if(!n)return null;const C=pd(a),T=g?Iu(a,g):[];function P(){s({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:w||void 0,cwd:N.trim()||void 0,runtime_type:a}),m(""),R("")}function M(I){I.key==="Escape"&&r(!1)}function H(I){var K;x(I);const W=Iu(a,I);W.some(V=>V.effort===w)||y(Du(a,I)??((K=W[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:I=>I.stopPropagation(),onKeyDown:M,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(Gn,{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:h,onChange:I=>m(I.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:I=>H(I.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map(I=>c.jsxs("option",{value:I.slug,children:[I.displayName," — ",I.description]},I.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:w,onChange:I=>y(I.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Du(a,g),")"]}),T.map(I=>c.jsx("option",{value:I.effort,children:I.label},I.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:I=>R(I.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:P,children:"Create"})]})]})})}const US=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,BS=512*1024;function WS(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function HS(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=L(),[f,h]=k.useState("examples"),[m,g]=k.useState(null),[x,w]=k.useState(null),[y,N]=k.useState(!1),[R,C]=k.useState(""),[T,P]=k.useState(""),[M,H]=k.useState(""),[I,W]=k.useState(""),[Y,K]=k.useState(null),[V,ne]=k.useState(""),ae=k.useRef(null);if(k.useEffect(()=>{n&&(g(null),hx().then(g).catch(()=>g([])))},[n]),k.useEffect(()=>{ae.current&&(ae.current.webkitdirectory=!0)},[f]),!n)return null;const fe=new Set(s.map(j=>j.id));async function Le(j){w(j);try{await o(j)&&r()}finally{w(null)}}async function Re(){if(y)return;const j=R.trim(),q=T.trim();if(!(!j||!q)){N(!0);try{await a({id:j,title:q,description:M.trim()||void 0,icon:I.trim()||void 0})&&(C(""),P(""),H(""),W(""),r())}finally{N(!1)}}}async function Pe(j){const q=Array.from(j.target.files??[]),B={};let E="";for(const D of q){const oe=(D.webkitRelativePath??"").split("/");!E&&oe.length>1&&(E=oe[0]);const ve=oe[oe.length-1];if(!(!ve||!US.test(ve))&&!(D.size>BS))try{B[ve]=await D.text()}catch{}}K(Object.keys(B).length>0?B:null),ne(WS(E))}async function Z(){if(!(y||!Y||!V.trim())){N(!0);try{await u(V.trim(),Y)&&(K(null),ne(""),r())}finally{N(!1)}}}function te(j){j.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:j=>j.stopPropagation(),onKeyDown:te,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(j=>c.jsx("button",{className:`catalog-tab${f===j.key?" active":""}`,onClick:()=>h(j.key),children:j.label},j.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(j=>{const q=fe.has(j.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:j.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:j.title}),j.description&&c.jsx("span",{className:"example-desc",children:j.description})]}),c.jsx("button",{className:"example-install",disabled:q||x===j.id,onClick:()=>Le(j.id),title:q?"Already installed":"Install this example",children:q?"Installed":x===j.id?"Installing…":"Install"})]},j.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:R,onChange:j=>C(j.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:T,onChange:j=>P(j.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:M,onChange:j=>H(j.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:I,onChange:j=>W(j.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!R.trim()||!T.trim(),onClick:Re,children:[c.jsx(ys,{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.js, …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ae,type:"file",multiple:!0,onChange:Pe}),Y&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:V,onChange:j=>ne(j.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(Y).length," file(s):"," ",Object.keys(Y).slice(0,6).join(", "),Object.keys(Y).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!Y||!V.trim(),onClick:Z,children:[c.jsx(p0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function VS(){const n=L(w=>w.showCommandPalette),r=L(w=>w.setShowCommandPalette),s=L(),[o,a]=k.useState(""),[u,f]=k.useState(0),h=k.useRef(null),m=k.useMemo(()=>{const w=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,y=ta(w);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:ys,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:fr,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:ra,action:()=>{const N=document.querySelector(".cmd-input");N==null||N.focus()},available:!!s.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:li,action:()=>s.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:Jx,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:Gx,action:()=>s.switchRightTab("changes"),available:!!s.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Gn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),g=k.useMemo(()=>{const w=o.toLowerCase().trim(),y=m.filter(N=>N.available);return w?y.filter(N=>N.label.toLowerCase().includes(w)||N.hint.toLowerCase().includes(w)):y},[m,o]);k.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var w;return(w=h.current)==null?void 0:w.focus()},50))},[n]);function x(w){if(w.key==="ArrowDown")w.preventDefault(),f(y=>Math.min(y+1,g.length-1));else if(w.key==="ArrowUp")w.preventDefault(),f(y=>Math.max(y-1,0));else if(w.key==="Enter"){w.preventDefault();const y=g[u];y&&(y.action(),r(!1))}else w.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:w=>w.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:w=>{a(w.target.value),f(0)},onKeyDown:x}),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((w,y)=>{const N=w.icon;return c.jsxs("div",{className:`palette-item ${y===u?"selected":""}`,onClick:()=>{w.action(),r(!1)},onMouseEnter:()=>f(y),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(N,{size:16})}),c.jsx("span",{className:"palette-item-label",children:w.label}),c.jsx("span",{className:"palette-item-hint",children:w.hint}),y===u&&c.jsx(Vx,{size:12,className:"palette-item-enter"})]},w.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 um=/^[a-z][a-z0-9-]{1,30}$/,GS=2e3;function qS(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=L(),[o,a]=k.useState(null),[u,f]=k.useState(null),[h,m]=k.useState(!1),[g,x]=k.useState(!1),[w,y]=k.useState(!1),[N,R]=k.useState(!1),[C,T]=k.useState("main"),[P,M]=k.useState(""),[H,I]=k.useState(!1),[W,Y]=k.useState(null),K=k.useRef(null);na(K,()=>R(!1),N);const V=g||w,ne=k.useCallback(async()=>{m(!0),f(null);try{const j=await fetch(`${pr()}/remote/status`,{headers:{Accept:"application/json"}});if(!j.ok)throw new Error(`status ${j.status}`);a(await j.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);k.useEffect(()=>{n&&(T("main"),Y(null),ne())},[n,ne]);const ae=W!==null&&W.state==="running";if(k.useEffect(()=>{if(!ae)return;const j=setInterval(async()=>{try{const q=await fetch(`${pr()}/remote/enable`,{headers:{Accept:"application/json"}});q.ok&&Y(await q.json())}catch{}},GS);return()=>clearInterval(j)},[ae]),!n)return null;const fe=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function Le(j){j.key==="Escape"&&r(!1)}async function Re(j){if(um.test(j)){I(!0);try{const q=await fetch(`${pr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:j})});if(!q.ok)throw new Error(`enable ${q.status}`);Y(await q.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{I(!1)}}}function Pe(){W!=null&&W.troubleshootingSessionId&&(s(W.troubleshootingSessionId),r(!1))}async function Z(){x(!0);try{await fetch(`${pr()}/remote/disable`,{method:"POST"}),await ne()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function te(){if(R(!1),!!window.confirm(`Remove the tunnel completely?
|
|
471
|
+
|
|
472
|
+
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
473
|
+
|
|
474
|
+
This cannot be undone.`)){y(!0);try{const q=await fetch(`${pr()}/remote/uninstall`,{method:"DELETE"});if(!q.ok)throw new Error(`uninstall ${q.status}`);await ne()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!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:P,onChange:E=>M(E.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:()=>T("main"),children:"Back"}),c.jsxs("button",{className:"dialog-btn-create",disabled:!um.test(P)||H,onClick:()=>void Re(P),children:[H?c.jsx(nr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const j=["detect","provision","install","verify","ready"],q=j.indexOf(W.step),B=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(nr,{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(Zr,{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:j.map((E,D)=>{const ie=B||q>-1&&D<q,oe=!B&&D===q&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:ie||oe?1:.4,color:ie?"var(--green)":void 0},children:[ie?c.jsx(Zr,{size:13}):oe?c.jsx(nr,{size:13,className:"spin"}):c.jsx(Wx,{size:9,style:{marginLeft:2,marginRight:2}}),E]},E)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(E=>E.message).join(`
|
|
475
|
+
`)}),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:Pe,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 ne(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:j=>j.stopPropagation(),onKeyDown:Le,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(Gn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[h&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(nr,{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:[fe&&(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 Z(),disabled:V,children:[g?c.jsx(nr,{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:()=>R(j=>!j),disabled:V,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":N,children:w?c.jsx(nr,{size:14,className:"spin"}):c.jsx(io,{size:14})}),N&&c.jsx("div",{ref:K,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 te(),children:[c.jsx(fr,{size:12})," Remove tunnel"]})})]})]}),!fe&&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 Re(o.tunnel.mahlas),disabled:H,children:[H?c.jsx(nr,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(lh,{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:()=>T("setup"),children:[c.jsx(lh,{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 KS={success:Ux,error:Yu,info:Yx,warn:d0},YS=4e3;function XS({toast:n}){const r=L(f=>f.removeToast),s=KS[n.type],o=k.useRef(null);k.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),YS)}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(f0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Gn,{size:14})})]})}function QS(){const n=L(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(XS,{toast:r},r.id))})}let Hn=null,ii=null,no=1e3;const ZS=1e4;function JS(){const n=pr();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Mu(){Hn&&(Hn.readyState===WebSocket.OPEN||Hn.readyState===WebSocket.CONNECTING)||(Hn=new WebSocket(JS()),Hn.onopen=()=>{const n=no>1e3;if(no=1e3,L.getState().setWsConnected(!0),L.getState().addLogEntry("INFO","WebSocket connected"),n){const r=L.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Hn.onclose=()=>{L.getState().setWsConnected(!1),L.getState().addLogEntry("WARN","WebSocket disconnected"),L.getState().addToast("warn","WebSocket disconnected — reconnecting…"),tT()},Hn.onerror=()=>{},Hn.onmessage=n=>{try{const r=JSON.parse(n.data);en.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=nT[r.event];s&&s(r.data)}catch{}})}function eT(){ii&&(clearTimeout(ii),ii=null),Hn&&(Hn.onclose=null,Hn.close(),Hn=null),L.getState().setWsConnected(!1)}function tT(){ii||(ii=window.setTimeout(()=>{ii=null,Mu()},no),no=Math.min(no*2,ZS))}const nT={"turn:started":n=>{const r=n;en.note(`turn:started — ${r.turnId.slice(0,8)}`),L.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;L.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;L.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;L.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;L.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;en.note(`turn:completed — ${r.turnId.slice(0,8)}`),L.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;L.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage};L.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;L.getState().onTurnFailed(r.sessionId,r.turnId,r.error)},"turn:cancelled":n=>{const r=n;L.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;L.getState().onSessionTitle(r.sessionId,r.title)},background_tasks:n=>{const r=n;en.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),L.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"thread:created":n=>{const r=n;L.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;L.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;L.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;L.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Yy(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{nx(n.appId)},"app:state_changed":n=>{tx(n.appId)}};function rT(){const n=L(r=>r.init);return k.useEffect(()=>{Cy(),n(),L.getState().loadApps(),Mu();function r(){if(document.visibilityState!=="visible")return;const s=L.getState(),o=s.activeSessionId;if(!o)return;const a=s.sessionDetails[o];s.wsConnected||Mu(),a&&a.is_running===1&&(s.refreshActiveSession(),s.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",r),()=>{eT(),document.removeEventListener("visibilitychange",r)}},[n]),null}function sT(){const n=L(a=>a.loading),r=L(a=>a.error),s=L(a=>a.sessions),o=L(a=>a.setShowCommandPalette);return k.useEffect(()=>en.start(),[]),k.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(rT,{}),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($S,{}),c.jsx(FS,{}),c.jsx(HS,{}),c.jsx(qS,{}),c.jsx(VS,{}),c.jsx(QS,{})]})]})}gy.createRoot(document.getElementById("root")).render(c.jsx(lt.StrictMode,{children:c.jsx(sT,{})}));
|