repoburg 1.3.237 → 1.3.239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-pane/backend/dist/index.js +235 -80
- package/agent-pane/backend/dist/server.js +235 -80
- package/agent-pane/frontend/dist/assets/index-CBTsbWig.js +493 -0
- package/agent-pane/frontend/dist/assets/index-DNe6bagG.css +1 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/miniapp-typesafe-verified.png +0 -0
- package/package.json +1 -1
- package/agent-pane/frontend/dist/assets/index-CUR0-YML.js +0 -475
- package/agent-pane/frontend/dist/assets/index-DbznBcr3.css +0 -1
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
var dy=Object.defineProperty;var fy=(n,s,r)=>s in n?dy(n,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[s]=r;var ct=(n,s,r)=>fy(n,typeof s!="symbol"?s+"":s,r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.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 r(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=r(a);fetch(a.href,u)}})();function vm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var qc={exports:{}},Vi={},Kc={exports:{}},He={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Mp;function py(){if(Mp)return He;Mp=1;var n=Symbol.for("react.element"),s=Symbol.for("react.portal"),r=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(b){return b===null||typeof b!="object"?null:(b=w&&b[w]||b["@@iterator"],typeof b=="function"?b:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,E={};function T(b,R,te){this.props=b,this.context=R,this.refs=E,this.updater=te||N}T.prototype.isReactComponent={},T.prototype.setState=function(b,R){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,R,"setState")},T.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function L(){}L.prototype=T.prototype;function M(b,R,te){this.props=b,this.context=R,this.refs=E,this.updater=te||N}var W=M.prototype=new L;W.constructor=M,j(W,T.prototype),W.isPureReactComponent=!0;var D=Array.isArray,B=Object.prototype.hasOwnProperty,q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function G(b,R,te){var ce,ge={},ye=null,Oe=null;if(R!=null)for(ce in R.ref!==void 0&&(Oe=R.ref),R.key!==void 0&&(ye=""+R.key),R)B.call(R,ce)&&!K.hasOwnProperty(ce)&&(ge[ce]=R[ce]);var Re=arguments.length-2;if(Re===1)ge.children=te;else if(1<Re){for(var je=Array(Re),be=0;be<Re;be++)je[be]=arguments[be+2];ge.children=je}if(b&&b.defaultProps)for(ce in Re=b.defaultProps,Re)ge[ce]===void 0&&(ge[ce]=Re[ce]);return{$$typeof:n,type:b,key:ye,ref:Oe,props:ge,_owner:q.current}}function oe(b,R){return{$$typeof:n,type:b.type,key:R,ref:b.ref,props:b.props,_owner:b._owner}}function ue(b){return typeof b=="object"&&b!==null&&b.$$typeof===n}function ie(b){var R={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(te){return R[te]})}var Te=/\/+/g;function Ne(b,R){return typeof b=="object"&&b!==null&&b.key!=null?ie(""+b.key):R.toString(36)}function Fe(b,R,te,ce,ge){var ye=typeof b;(ye==="undefined"||ye==="boolean")&&(b=null);var Oe=!1;if(b===null)Oe=!0;else switch(ye){case"string":case"number":Oe=!0;break;case"object":switch(b.$$typeof){case n:case s:Oe=!0}}if(Oe)return Oe=b,ge=ge(Oe),b=ce===""?"."+Ne(Oe,0):ce,D(ge)?(te="",b!=null&&(te=b.replace(Te,"$&/")+"/"),Fe(ge,R,te,"",function(be){return be})):ge!=null&&(ue(ge)&&(ge=oe(ge,te+(!ge.key||Oe&&Oe.key===ge.key?"":(""+ge.key).replace(Te,"$&/")+"/")+b)),R.push(ge)),1;if(Oe=0,ce=ce===""?".":ce+":",D(b))for(var Re=0;Re<b.length;Re++){ye=b[Re];var je=ce+Ne(ye,Re);Oe+=Fe(ye,R,te,je,ge)}else if(je=y(b),typeof je=="function")for(b=je.call(b),Re=0;!(ye=b.next()).done;)ye=ye.value,je=ce+Ne(ye,Re++),Oe+=Fe(ye,R,te,je,ge);else if(ye==="object")throw R=String(b),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.");return Oe}function Q(b,R,te){if(b==null)return b;var ce=[],ge=0;return Fe(b,ce,"","",function(ye){return R.call(te,ye,ge++)}),ce}function ne(b){if(b._status===-1){var R=b._result;R=R(),R.then(function(te){(b._status===0||b._status===-1)&&(b._status=1,b._result=te)},function(te){(b._status===0||b._status===-1)&&(b._status=2,b._result=te)}),b._status===-1&&(b._status=0,b._result=R)}if(b._status===1)return b._result.default;throw b._result}var ae={current:null},O={transition:null},J={ReactCurrentDispatcher:ae,ReactCurrentBatchConfig:O,ReactCurrentOwner:q};function H(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:Q,forEach:function(b,R,te){Q(b,function(){R.apply(this,arguments)},te)},count:function(b){var R=0;return Q(b,function(){R++}),R},toArray:function(b){return Q(b,function(R){return R})||[]},only:function(b){if(!ue(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},He.Component=T,He.Fragment=r,He.Profiler=a,He.PureComponent=M,He.StrictMode=o,He.Suspense=m,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,He.act=H,He.cloneElement=function(b,R,te){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var ce=j({},b.props),ge=b.key,ye=b.ref,Oe=b._owner;if(R!=null){if(R.ref!==void 0&&(ye=R.ref,Oe=q.current),R.key!==void 0&&(ge=""+R.key),b.type&&b.type.defaultProps)var Re=b.type.defaultProps;for(je in R)B.call(R,je)&&!K.hasOwnProperty(je)&&(ce[je]=R[je]===void 0&&Re!==void 0?Re[je]:R[je])}var je=arguments.length-2;if(je===1)ce.children=te;else if(1<je){Re=Array(je);for(var be=0;be<je;be++)Re[be]=arguments[be+2];ce.children=Re}return{$$typeof:n,type:b.type,key:ge,ref:ye,props:ce,_owner:Oe}},He.createContext=function(b){return b={$$typeof:f,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:u,_context:b},b.Consumer=b},He.createElement=G,He.createFactory=function(b){var R=G.bind(null,b);return R.type=b,R},He.createRef=function(){return{current:null}},He.forwardRef=function(b){return{$$typeof:h,render:b}},He.isValidElement=ue,He.lazy=function(b){return{$$typeof:x,_payload:{_status:-1,_result:b},_init:ne}},He.memo=function(b,R){return{$$typeof:g,type:b,compare:R===void 0?null:R}},He.startTransition=function(b){var R=O.transition;O.transition={};try{b()}finally{O.transition=R}},He.unstable_act=H,He.useCallback=function(b,R){return ae.current.useCallback(b,R)},He.useContext=function(b){return ae.current.useContext(b)},He.useDebugValue=function(){},He.useDeferredValue=function(b){return ae.current.useDeferredValue(b)},He.useEffect=function(b,R){return ae.current.useEffect(b,R)},He.useId=function(){return ae.current.useId()},He.useImperativeHandle=function(b,R,te){return ae.current.useImperativeHandle(b,R,te)},He.useInsertionEffect=function(b,R){return ae.current.useInsertionEffect(b,R)},He.useLayoutEffect=function(b,R){return ae.current.useLayoutEffect(b,R)},He.useMemo=function(b,R){return ae.current.useMemo(b,R)},He.useReducer=function(b,R,te){return ae.current.useReducer(b,R,te)},He.useRef=function(b){return ae.current.useRef(b)},He.useState=function(b){return ae.current.useState(b)},He.useSyncExternalStore=function(b,R,te){return ae.current.useSyncExternalStore(b,R,te)},He.useTransition=function(){return ae.current.useTransition()},He.version="18.3.1",He}var Lp;function zu(){return Lp||(Lp=1,Kc.exports=py()),Kc.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 Pp;function hy(){if(Pp)return Vi;Pp=1;var n=zu(),s=Symbol.for("react.element"),r=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:s,type:h,key:y,ref:N,props:w,_owner:a.current}}return Vi.Fragment=r,Vi.jsx=f,Vi.jsxs=f,Vi}var Op;function my(){return Op||(Op=1,qc.exports=hy()),qc.exports}var c=my(),k=zu();const at=vm(k);var Sl={},Yc={exports:{}},bn={},Xc={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 zp;function gy(){return zp||(zp=1,(function(n){function s(O,J){var H=O.length;O.push(J);e:for(;0<H;){var b=H-1>>>1,R=O[b];if(0<a(R,J))O[b]=J,O[H]=R,H=b;else break e}}function r(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var J=O[0],H=O.pop();if(H!==J){O[0]=H;e:for(var b=0,R=O.length,te=R>>>1;b<te;){var ce=2*(b+1)-1,ge=O[ce],ye=ce+1,Oe=O[ye];if(0>a(ge,H))ye<R&&0>a(Oe,ge)?(O[b]=Oe,O[ye]=H,b=ye):(O[b]=ge,O[ce]=H,b=ce);else if(ye<R&&0>a(Oe,H))O[b]=Oe,O[ye]=H,b=ye;else break e}}return J}function a(O,J){var H=O.sortIndex-J.sortIndex;return H!==0?H:O.id-J.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,j=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,L=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 W(O){for(var J=r(g);J!==null;){if(J.callback===null)o(g);else if(J.startTime<=O)o(g),J.sortIndex=J.expirationTime,s(m,J);else break;J=r(g)}}function D(O){if(E=!1,W(O),!j)if(r(m)!==null)j=!0,ne(B);else{var J=r(g);J!==null&&ae(D,J.startTime-O)}}function B(O,J){j=!1,E&&(E=!1,L(G),G=-1),N=!0;var H=y;try{for(W(J),w=r(m);w!==null&&(!(w.expirationTime>J)||O&&!ie());){var b=w.callback;if(typeof b=="function"){w.callback=null,y=w.priorityLevel;var R=b(w.expirationTime<=J);J=n.unstable_now(),typeof R=="function"?w.callback=R:w===r(m)&&o(m),W(J)}else o(m);w=r(m)}if(w!==null)var te=!0;else{var ce=r(g);ce!==null&&ae(D,ce.startTime-J),te=!1}return te}finally{w=null,y=H,N=!1}}var q=!1,K=null,G=-1,oe=5,ue=-1;function ie(){return!(n.unstable_now()-ue<oe)}function Te(){if(K!==null){var O=n.unstable_now();ue=O;var J=!0;try{J=K(!0,O)}finally{J?Ne():(q=!1,K=null)}}else q=!1}var Ne;if(typeof M=="function")Ne=function(){M(Te)};else if(typeof MessageChannel<"u"){var Fe=new MessageChannel,Q=Fe.port2;Fe.port1.onmessage=Te,Ne=function(){Q.postMessage(null)}}else Ne=function(){T(Te,0)};function ne(O){K=O,q||(q=!0,Ne())}function ae(O,J){G=T(function(){O(n.unstable_now())},J)}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(O){O.callback=null},n.unstable_continueExecution=function(){j||N||(j=!0,ne(B))},n.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<O?Math.floor(1e3/O):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_getFirstCallbackNode=function(){return r(m)},n.unstable_next=function(O){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var H=y;y=J;try{return O()}finally{y=H}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(O,J){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var H=y;y=O;try{return J()}finally{y=H}},n.unstable_scheduleCallback=function(O,J,H){var b=n.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?b+H:b):H=b,O){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=H+R,O={id:x++,callback:J,priorityLevel:O,startTime:H,expirationTime:R,sortIndex:-1},H>b?(O.sortIndex=H,s(g,O),r(m)===null&&O===r(g)&&(E?(L(G),G=-1):E=!0,ae(D,H-b))):(O.sortIndex=R,s(m,O),j||N||(j=!0,ne(B))),O},n.unstable_shouldYield=ie,n.unstable_wrapCallback=function(O){var J=y;return function(){var H=y;y=J;try{return O.apply(this,arguments)}finally{y=H}}}})(Qc)),Qc}var $p;function vy(){return $p||($p=1,Xc.exports=gy()),Xc.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 Fp;function yy(){if(Fp)return bn;Fp=1;var n=zu(),s=vy();function r(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 j(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 E(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 E(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 E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new E(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var L=/[\-:]([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(L,M);T[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(L,M);T[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(L,M);T[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function W(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")&&(j(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 D=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),q=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),ue=Symbol.for("react.provider"),ie=Symbol.for("react.context"),Te=Symbol.for("react.forward_ref"),Ne=Symbol.for("react.suspense"),Fe=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),ae=Symbol.for("react.offscreen"),O=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=O&&e[O]||e["@@iterator"],typeof e=="function"?e:null)}var H=Object.assign,b;function R(e){if(b===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
|
|
34
|
+
`+b+e}var te=!1;function ce(e,t){if(!e||te)return"";te=!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,C=p.length-1;1<=v&&0<=C&&d[v]!==p[C];)C--;for(;1<=v&&0<=C;v--,C--)if(d[v]!==p[C]){if(v!==1||C!==1)do if(v--,C--,0>C||d[v]!==p[C]){var _=`
|
|
37
|
+
`+d[v].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),_}while(1<=v&&0<=C);break}}}finally{te=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?R(e):""}function ge(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function ye(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case q:return"Portal";case oe:return"Profiler";case G:return"StrictMode";case Ne:return"Suspense";case Fe:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ie:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case Te:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}function Oe(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 ye(t);case 8:return t===G?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Re(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function be(e){var t=je(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 mt(e){e._valueTracker||(e._valueTracker=be(e))}function Me(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=je(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function jt(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 H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function zt(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Re(t.value!=null?t.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function We(e,t){t=t.checked,t!=null&&W(e,"checked",t,!1)}function Wt(e,t){We(e,t);var i=Re(t.value),l=t.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gt(e,t.type,i):t.hasOwnProperty("defaultValue")&>(e,t.type,Re(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rt(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 gt(e,t,i){(t!=="number"||jt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var At=Array.isArray;function $t(e,t,i,l){if(e=e.options,t){t={};for(var d=0;d<i.length;d++)t["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=t.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+Re(i),t=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function V(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},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(r(92));if(At(i)){if(1<i.length)throw Error(r(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Re(i)}}function Ue(e,t){var i=Re(t.value),l=Re(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Ze(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function vt(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 yt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?vt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var dt,Xt=(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(dt=dt||document.createElement("div"),dt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=dt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var xt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},un=["Webkit","ms","Moz","O"];Object.keys(xt).forEach(function(e){un.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function yn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function Gn(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=yn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Mn=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ln(e,t){if(t){if(Mn[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!="object")throw Error(r(62))}}function Pn(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 I=null;function _e(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var le=null,xe=null,we=null;function Le(e){if(e=Ri(e)){if(typeof le!="function")throw Error(r(280));var t=e.stateNode;t&&(t=Oo(t),le(e.stateNode,e.type,t))}}function ke(e){xe?we?we.push(e):we=[e]:xe=e}function Ve(){if(xe){var e=xe,t=we;if(we=xe=null,Le(e),t)for(e=0;e<t.length;e++)Le(t[e])}}function ot(e,t){return e(t)}function tt(){}var nt=!1;function It(e,t,i){if(nt)return e(t,i);nt=!0;try{return ot(e,t,i)}finally{nt=!1,(xe!==null||we!==null)&&(tt(),Ve())}}function st(e,t){var i=e.stateNode;if(i===null)return null;var l=Oo(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(r(231,t,typeof i));return i}var wt=!1;if(h)try{var kt={};Object.defineProperty(kt,"passive",{get:function(){wt=!0}}),window.addEventListener("test",kt,kt),window.removeEventListener("test",kt,kt)}catch{wt=!1}function Be(e,t,i,l,d,p,v,C,_){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(Z){this.onError(Z)}}var Ke=!1,Lt=null,Qt=!1,qn=null,Kn={onError:function(e){Ke=!0,Lt=e}};function ma(e,t,i,l,d,p,v,C,_){Ke=!1,Lt=null,Be.apply(Kn,arguments)}function ga(e,t,i,l,d,p,v,C,_){if(ma.apply(this,arguments),Ke){if(Ke){var U=Lt;Ke=!1,Lt=null}else throw Error(r(198));Qt||(Qt=!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 ms(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(r(188))}function vo(e){var t=e.alternate;if(!t){if(t=rt(e),t===null)throw Error(r(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(r(188))}if(i.return!==l.return)i=d,l=p;else{for(var v=!1,C=d.child;C;){if(C===i){v=!0,i=d,l=p;break}if(C===l){v=!0,l=d,i=p;break}C=C.sibling}if(!v){for(C=p.child;C;){if(C===i){v=!0,i=p,l=d;break}if(C===l){v=!0,l=p,i=d;break}C=C.sibling}if(!v)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:t}function Sr(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=s.unstable_scheduleCallback,yo=s.unstable_cancelCallback,va=s.unstable_shouldYield,ya=s.unstable_requestPaint,St=s.unstable_now,is=s.unstable_getCurrentPriorityLevel,Rs=s.unstable_ImmediatePriority,os=s.unstable_UserBlockingPriority,Tr=s.unstable_NormalPriority,Js=s.unstable_LowPriority,xo=s.unstable_IdlePriority,er=null,Cn=null;function br(e){if(Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(er,e,void 0,(e.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:tr,Nr=Math.log,As=Math.LN2;function tr(e){return e>>>=0,e===0?32:31-(Nr(e)/As|0)|0}var fn=64,Cr=4194304;function nr(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 sr(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 C=v&~d;C!==0?l=nr(C):(p&=v,p!==0&&(l=nr(p)))}else v=i&~d,v!==0?l=nr(v):p!==0&&(l=nr(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-dn(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-dn(p),C=1<<v,_=d[v];_===-1?((C&i)===0||(C&l)!==0)&&(d[v]=wo(C,t)):_<=t&&(e.expiredLanes|=C),p&=~C}}function pi(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hi(){var e=fn;return fn<<=1,(fn&4194240)===0&&(fn=64),e}function mi(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(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-dn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Is(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-dn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ye=0;function se(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var S,z,Y,me,Ce,$e=!1,Xe=[],Je=null,Tt=null,bt=null,gs=new Map,Dt=new Map,Ds=[],Dg="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 gd(e,t){switch(e){case"focusin":case"focusout":Je=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":bt=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dt.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&&z(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function Mg(e,t,i,l,d){switch(t){case"focusin":return Je=gi(Je,e,t,i,l,d),!0;case"dragenter":return Tt=gi(Tt,e,t,i,l,d),!0;case"mouseover":return bt=gi(bt,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return gs.set(p,gi(gs.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Dt.set(p,gi(Dt.get(p)||null,e,t,i,l,d)),!0}return!1}function vd(e){var t=ir(e.target);if(t!==null){var i=rt(t);if(i!==null){if(t=i.tag,t===13){if(t=ms(i),t!==null){e.blockedOn=t,Ce(e.priority,function(){Y(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=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);I=l,i.target.dispatchEvent(l),I=null}else return t=Ri(i),t!==null&&z(t),e.blockedOn=i,!1;t.shift()}return!0}function yd(e,t,i){To(e)&&i.delete(t)}function Lg(){$e=!1,Je!==null&&To(Je)&&(Je=null),Tt!==null&&To(Tt)&&(Tt=null),bt!==null&&To(bt)&&(bt=null),gs.forEach(yd),Dt.forEach(yd)}function vi(e,t){e.blockedOn===t&&(e.blockedOn=null,$e||($e=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Lg)))}function yi(e){function t(d){return vi(d,e)}if(0<Xe.length){vi(Xe[0],e);for(var i=1;i<Xe.length;i++){var l=Xe[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Je!==null&&vi(Je,e),Tt!==null&&vi(Tt,e),bt!==null&&vi(bt,e),gs.forEach(t),Dt.forEach(t),i=0;i<Ds.length;i++)l=Ds[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ds.length&&(i=Ds[0],i.blockedOn===null);)vd(i),i.blockedOn===null&&Ds.shift()}var Er=D.ReactCurrentBatchConfig,bo=!0;function Pg(e,t,i,l){var d=Ye,p=Er.transition;Er.transition=null;try{Ye=1,xa(e,t,i,l)}finally{Ye=d,Er.transition=p}}function Og(e,t,i,l){var d=Ye,p=Er.transition;Er.transition=null;try{Ye=4,xa(e,t,i,l)}finally{Ye=d,Er.transition=p}}function xa(e,t,i,l){if(bo){var d=wa(e,t,i,l);if(d===null)Oa(e,t,l,No,i),gd(e,l);else if(Mg(d,e,t,i,l))l.stopPropagation();else if(gd(e,l),t&4&&-1<Dg.indexOf(e)){for(;d!==null;){var p=Ri(d);if(p!==null&&S(p),p=wa(e,t,i,l),p===null&&Oa(e,t,l,No,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Oa(e,t,l,null,i)}}var No=null;function wa(e,t,i,l){if(No=null,e=_e(l),e=ir(e),e!==null)if(t=rt(e),t===null)e=null;else if(i=t.tag,i===13){if(e=ms(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 xd(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(is()){case Rs:return 1;case os:return 4;case Tr:case Js:return 16;case xo:return 536870912;default:return 16}default:return 16}}var Ms=null,ka=null,Co=null;function wd(){if(Co)return Co;var e,t=ka,i=t.length,l,d="value"in Ms?Ms.value:Ms.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 kd(){return!1}function En(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 C in e)e.hasOwnProperty(C)&&(i=e[C],this[C]=i?i(p):p[C]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?_o:kd,this.isPropagationStopped=kd,this}return H(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=_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 _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sa=En(_r),xi=H({},_r,{view:0,detail:0}),zg=En(xi),Ta,ba,wi,jo=H({},xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ca,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"?(Ta=e.screenX-wi.screenX,ba=e.screenY-wi.screenY):ba=Ta=0,wi=e),Ta)},movementY:function(e){return"movementY"in e?e.movementY:ba}}),Sd=En(jo),$g=H({},jo,{dataTransfer:0}),Fg=En($g),Ug=H({},xi,{relatedTarget:0}),Na=En(Ug),Bg=H({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Wg=En(Bg),Hg=H({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vg=En(Hg),Gg=H({},_r,{data:0}),Td=En(Gg),qg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kg={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"},Yg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yg[e])?!!t[e]:!1}function Ca(){return Xg}var Qg=H({},xi,{key:function(e){if(e.key){var t=qg[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"?Kg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ca,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}}),Zg=En(Qg),Jg=H({},jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bd=En(Jg),ev=H({},xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ca}),tv=En(ev),nv=H({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),sv=En(nv),rv=H({},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}),iv=En(rv),ov=[9,13,27,32],Ea=h&&"CompositionEvent"in window,ki=null;h&&"documentMode"in document&&(ki=document.documentMode);var lv=h&&"TextEvent"in window&&!ki,Nd=h&&(!Ea||ki&&8<ki&&11>=ki),Cd=" ",Ed=!1;function _d(e,t){switch(e){case"keyup":return ov.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jr=!1;function av(e,t){switch(e){case"compositionend":return jd(t);case"keypress":return t.which!==32?null:(Ed=!0,Cd);case"textInput":return e=t.data,e===Cd&&Ed?null:e;default:return null}}function cv(e,t){if(jr)return e==="compositionend"||!Ea&&_d(e,t)?(e=wd(),Co=ka=Ms=null,jr=!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 Nd&&t.locale!=="ko"?null:t.data;default:return null}}var uv={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 Rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uv[e.type]:t==="textarea"}function Ad(e,t,i,l){ke(l),t=Mo(t,"onChange"),0<t.length&&(i=new Sa("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Si=null,Ti=null;function dv(e){Yd(e,0)}function Ro(e){var t=Mr(e);if(Me(t))return e}function fv(e,t){if(e==="change")return t}var Id=!1;if(h){var _a;if(h){var ja="oninput"in document;if(!ja){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),ja=typeof Dd.oninput=="function"}_a=ja}else _a=!1;Id=_a&&(!document.documentMode||9<document.documentMode)}function Md(){Si&&(Si.detachEvent("onpropertychange",Ld),Ti=Si=null)}function Ld(e){if(e.propertyName==="value"&&Ro(Ti)){var t=[];Ad(t,Ti,e,_e(e)),It(dv,t)}}function pv(e,t,i){e==="focusin"?(Md(),Si=t,Ti=i,Si.attachEvent("onpropertychange",Ld)):e==="focusout"&&Md()}function hv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ro(Ti)}function mv(e,t){if(e==="click")return Ro(t)}function gv(e,t){if(e==="input"||e==="change")return Ro(t)}function vv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:vv;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 Pd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Od(e,t){var i=Pd(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=Pd(i)}}function zd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $d(){for(var e=window,t=jt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=jt(e.document)}return t}function Ra(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 yv(e){var t=$d(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&zd(i.ownerDocument.documentElement,i)){if(l!==null&&Ra(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=Od(i,p);var v=Od(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 xv=h&&"documentMode"in document&&11>=document.documentMode,Rr=null,Aa=null,Ni=null,Ia=!1;function Fd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ia||Rr==null||Rr!==jt(l)||(l=Rr,"selectionStart"in l&&Ra(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(Aa,"onSelect"),0<l.length&&(t=new Sa("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Rr)))}function Ao(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ar={animationend:Ao("Animation","AnimationEnd"),animationiteration:Ao("Animation","AnimationIteration"),animationstart:Ao("Animation","AnimationStart"),transitionend:Ao("Transition","TransitionEnd")},Da={},Ud={};h&&(Ud=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function Io(e){if(Da[e])return Da[e];if(!Ar[e])return e;var t=Ar[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ud)return Da[e]=t[i];return e}var Bd=Io("animationend"),Wd=Io("animationiteration"),Hd=Io("animationstart"),Vd=Io("transitionend"),Gd=new Map,qd="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 Ls(e,t){Gd.set(e,t),u(t,[e])}for(var Ma=0;Ma<qd.length;Ma++){var La=qd[Ma],wv=La.toLowerCase(),kv=La[0].toUpperCase()+La.slice(1);Ls(wv,"on"+kv)}Ls(Bd,"onAnimationEnd"),Ls(Wd,"onAnimationIteration"),Ls(Hd,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(Vd,"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(" "),Sv=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Kd(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,ga(l,t,void 0,e),e.currentTarget=null}function Yd(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 C=l[v],_=C.instance,U=C.currentTarget;if(C=C.listener,_!==p&&d.isPropagationStopped())break e;Kd(d,C,U),p=_}else for(v=0;v<l.length;v++){if(C=l[v],_=C.instance,U=C.currentTarget,C=C.listener,_!==p&&d.isPropagationStopped())break e;Kd(d,C,U),p=_}}}if(Qt)throw e=qn,Qt=!1,qn=null,e}function ft(e,t){var i=t[Wa];i===void 0&&(i=t[Wa]=new Set);var l=e+"__bubble";i.has(l)||(Xd(t,e,2,!1),i.add(l))}function Pa(e,t,i){var l=0;t&&(l|=4),Xd(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"&&(Sv.has(i)||Pa(i,!1,e),Pa(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Do]||(t[Do]=!0,Pa("selectionchange",!1,t))}}function Xd(e,t,i,l){switch(xd(t)){case 1:var d=Pg;break;case 4:d=Og;break;default:d=xa}i=d.bind(null,t,i,e),d=void 0,!wt||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 Oa(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 C=l.stateNode.containerInfo;if(C===d||C.nodeType===8&&C.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(;C!==null;){if(v=ir(C),v===null)return;if(_=v.tag,_===5||_===6){l=p=v;continue e}C=C.parentNode}}l=l.return}It(function(){var U=p,Z=_e(i),ee=[];e:{var X=Gd.get(e);if(X!==void 0){var de=Sa,pe=e;switch(e){case"keypress":if(Eo(i)===0)break e;case"keydown":case"keyup":de=Zg;break;case"focusin":pe="focus",de=Na;break;case"focusout":pe="blur",de=Na;break;case"beforeblur":case"afterblur":de=Na;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":de=Sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Fg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=tv;break;case Bd:case Wd:case Hd:de=Wg;break;case Vd:de=sv;break;case"scroll":de=zg;break;case"wheel":de=iv;break;case"copy":case"cut":case"paste":de=Vg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=bd}var ve=(t&4)!==0,Mt=!ve&&e==="scroll",$=ve?X!==null?X+"Capture":null:X;ve=[];for(var A=U,F;A!==null;){F=A;var re=F.stateNode;if(F.tag===5&&re!==null&&(F=re,$!==null&&(re=st(A,$),re!=null&&ve.push(_i(A,re,F)))),Mt)break;A=A.return}0<ve.length&&(X=new de(X,pe,null,i,Z),ee.push({event:X,listeners:ve}))}}if((t&7)===0){e:{if(X=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",X&&i!==I&&(pe=i.relatedTarget||i.fromElement)&&(ir(pe)||pe[vs]))break e;if((de||X)&&(X=Z.window===Z?Z:(X=Z.ownerDocument)?X.defaultView||X.parentWindow:window,de?(pe=i.relatedTarget||i.toElement,de=U,pe=pe?ir(pe):null,pe!==null&&(Mt=rt(pe),pe!==Mt||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(de=null,pe=U),de!==pe)){if(ve=Sd,re="onMouseLeave",$="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ve=bd,re="onPointerLeave",$="onPointerEnter",A="pointer"),Mt=de==null?X:Mr(de),F=pe==null?X:Mr(pe),X=new ve(re,A+"leave",de,i,Z),X.target=Mt,X.relatedTarget=F,re=null,ir(Z)===U&&(ve=new ve($,A+"enter",pe,i,Z),ve.target=F,ve.relatedTarget=Mt,re=ve),Mt=re,de&&pe)t:{for(ve=de,$=pe,A=0,F=ve;F;F=Ir(F))A++;for(F=0,re=$;re;re=Ir(re))F++;for(;0<A-F;)ve=Ir(ve),A--;for(;0<F-A;)$=Ir($),F--;for(;A--;){if(ve===$||$!==null&&ve===$.alternate)break t;ve=Ir(ve),$=Ir($)}ve=null}else ve=null;de!==null&&Qd(ee,X,de,ve,!1),pe!==null&&Mt!==null&&Qd(ee,Mt,pe,ve,!0)}}e:{if(X=U?Mr(U):window,de=X.nodeName&&X.nodeName.toLowerCase(),de==="select"||de==="input"&&X.type==="file")var Se=fv;else if(Rd(X))if(Id)Se=gv;else{Se=hv;var Ie=pv}else(de=X.nodeName)&&de.toLowerCase()==="input"&&(X.type==="checkbox"||X.type==="radio")&&(Se=mv);if(Se&&(Se=Se(e,U))){Ad(ee,Se,i,Z);break e}Ie&&Ie(e,X,U),e==="focusout"&&(Ie=X._wrapperState)&&Ie.controlled&&X.type==="number"&>(X,"number",X.value)}switch(Ie=U?Mr(U):window,e){case"focusin":(Rd(Ie)||Ie.contentEditable==="true")&&(Rr=Ie,Aa=U,Ni=null);break;case"focusout":Ni=Aa=Rr=null;break;case"mousedown":Ia=!0;break;case"contextmenu":case"mouseup":case"dragend":Ia=!1,Fd(ee,i,Z);break;case"selectionchange":if(xv)break;case"keydown":case"keyup":Fd(ee,i,Z)}var De;if(Ea)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else jr?_d(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(Nd&&i.locale!=="ko"&&(jr||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&jr&&(De=wd()):(Ms=Z,ka="value"in Ms?Ms.value:Ms.textContent,jr=!0)),Ie=Mo(U,Pe),0<Ie.length&&(Pe=new Td(Pe,e,null,i,Z),ee.push({event:Pe,listeners:Ie}),De?Pe.data=De:(De=jd(i),De!==null&&(Pe.data=De)))),(De=lv?av(e,i):cv(e,i))&&(U=Mo(U,"onBeforeInput"),0<U.length&&(Z=new Td("onBeforeInput","beforeinput",null,i,Z),ee.push({event:Z,listeners:U}),Z.data=De))}Yd(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=st(e,i),p!=null&&l.unshift(_i(e,p,d)),p=st(e,t),p!=null&&l.push(_i(e,p,d))),e=e.return}return l}function Ir(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qd(e,t,i,l,d){for(var p=t._reactName,v=[];i!==null&&i!==l;){var C=i,_=C.alternate,U=C.stateNode;if(_!==null&&_===l)break;C.tag===5&&U!==null&&(C=U,d?(_=st(i,p),_!=null&&v.unshift(_i(i,_,C))):d||(_=st(i,p),_!=null&&v.push(_i(i,_,C)))),i=i.return}v.length!==0&&e.push({event:t,listeners:v})}var Tv=/\r\n?/g,bv=/\u0000|\uFFFD/g;function Zd(e){return(typeof e=="string"?e:""+e).replace(Tv,`
|
|
38
|
+
`).replace(bv,"")}function Lo(e,t,i){if(t=Zd(t),Zd(e)!==t&&i)throw Error(r(425))}function Po(){}var za=null,$a=null;function Fa(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 Ua=typeof setTimeout=="function"?setTimeout:void 0,Nv=typeof clearTimeout=="function"?clearTimeout:void 0,Jd=typeof Promise=="function"?Promise:void 0,Cv=typeof queueMicrotask=="function"?queueMicrotask:typeof Jd<"u"?function(e){return Jd.resolve(null).then(e).catch(Ev)}:Ua;function Ev(e){setTimeout(function(){throw e})}function Ba(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 Ps(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 ef(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 Dr=Math.random().toString(36).slice(2),ls="__reactFiber$"+Dr,ji="__reactProps$"+Dr,vs="__reactContainer$"+Dr,Wa="__reactEvents$"+Dr,_v="__reactListeners$"+Dr,jv="__reactHandles$"+Dr;function ir(e){var t=e[ls];if(t)return t;for(var i=e.parentNode;i;){if(t=i[vs]||i[ls]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=ef(e);e!==null;){if(i=e[ls])return i;e=ef(e)}return t}e=i,i=e.parentNode}return null}function Ri(e){return e=e[ls]||e[vs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Oo(e){return e[ji]||null}var Ha=[],Lr=-1;function Os(e){return{current:e}}function pt(e){0>Lr||(e.current=Ha[Lr],Ha[Lr]=null,Lr--)}function ut(e,t){Lr++,Ha[Lr]=e.current,e.current=t}var zs={},rn=Os(zs),xn=Os(!1),or=zs;function Pr(e,t){var i=e.type.contextTypes;if(!i)return zs;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 wn(e){return e=e.childContextTypes,e!=null}function zo(){pt(xn),pt(rn)}function tf(e,t,i){if(rn.current!==zs)throw Error(r(168));ut(rn,t),ut(xn,i)}function nf(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(r(108,Oe(e)||"Unknown",d));return H({},i,l)}function $o(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zs,or=rn.current,ut(rn,e),ut(xn,xn.current),!0}function sf(e,t,i){var l=e.stateNode;if(!l)throw Error(r(169));i?(e=nf(e,t,or),l.__reactInternalMemoizedMergedChildContext=e,pt(xn),pt(rn),ut(rn,e)):pt(xn),ut(xn,i)}var ys=null,Fo=!1,Va=!1;function rf(e){ys===null?ys=[e]:ys.push(e)}function Rv(e){Fo=!0,rf(e)}function $s(){if(!Va&&ys!==null){Va=!0;var e=0,t=Ye;try{var i=ys;for(Ye=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}ys=null,Fo=!1}catch(d){throw ys!==null&&(ys=ys.slice(e+1)),fi(Rs,$s),d}finally{Ye=t,Va=!1}}return null}var Or=[],zr=0,Uo=null,Bo=0,On=[],zn=0,lr=null,xs=1,ws="";function ar(e,t){Or[zr++]=Bo,Or[zr++]=Uo,Uo=e,Bo=t}function of(e,t,i){On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,lr=e;var l=xs;e=ws;var d=32-dn(l)-1;l&=~(1<<d),i+=1;var p=32-dn(t)+d;if(30<p){var v=d-d%5;p=(l&(1<<v)-1).toString(32),l>>=v,d-=v,xs=1<<32-dn(t)+d|i<<d|l,ws=p+e}else xs=1<<p|i<<d|l,ws=e}function Ga(e){e.return!==null&&(ar(e,1),of(e,1,0))}function qa(e){for(;e===Uo;)Uo=Or[--zr],Or[zr]=null,Bo=Or[--zr],Or[zr]=null;for(;e===lr;)lr=On[--zn],On[zn]=null,ws=On[--zn],On[zn]=null,xs=On[--zn],On[zn]=null}var _n=null,jn=null,ht=!1,Xn=null;function lf(e,t){var i=Bn(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 af(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,_n=e,jn=Ps(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_n=e,jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=lr!==null?{id:xs,overflow:ws}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Bn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,_n=e,jn=null,!0):!1;default:return!1}}function Ka(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ya(e){if(ht){var t=jn;if(t){var i=t;if(!af(e,t)){if(Ka(e))throw Error(r(418));t=Ps(i.nextSibling);var l=_n;t&&af(e,t)?lf(l,i):(e.flags=e.flags&-4097|2,ht=!1,_n=e)}}else{if(Ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,ht=!1,_n=e}}}function cf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function Wo(e){if(e!==_n)return!1;if(!ht)return cf(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fa(e.type,e.memoizedProps)),t&&(t=jn)){if(Ka(e))throw uf(),Error(r(418));for(;t;)lf(e,t),t=Ps(t.nextSibling)}if(cf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){jn=Ps(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}jn=null}}else jn=_n?Ps(e.stateNode.nextSibling):null;return!0}function uf(){for(var e=jn;e;)e=Ps(e.nextSibling)}function $r(){jn=_n=null,ht=!1}function Xa(e){Xn===null?Xn=[e]:Xn.push(e)}var Av=D.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(r(309));var l=i.stateNode}if(!l)throw Error(r(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 C=d.refs;v===null?delete C[p]:C[p]=v},t._stringRef=p,t)}if(typeof e!="string")throw Error(r(284));if(!i._owner)throw Error(r(290,e))}return e}function Ho(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function df(e){var t=e._init;return t(e._payload)}function ff(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 $=qs($,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 C($,A,F,re){return A===null||A.tag!==6?(A=Uc(F,$.mode,re),A.return=$,A):(A=d(A,F),A.return=$,A)}function _($,A,F,re){var Se=F.type;return Se===K?Z($,A,F.props.children,re,F.key):A!==null&&(A.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ne&&df(Se)===A.type)?(re=d(A,F.props),re.ref=Ai($,A,F),re.return=$,re):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,A,F),re.return=$,re)}function U($,A,F,re){return A===null||A.tag!==4||A.stateNode.containerInfo!==F.containerInfo||A.stateNode.implementation!==F.implementation?(A=Bc(F,$.mode,re),A.return=$,A):(A=d(A,F.children||[]),A.return=$,A)}function Z($,A,F,re,Se){return A===null||A.tag!==7?(A=gr(F,$.mode,re,Se),A.return=$,A):(A=d(A,F),A.return=$,A)}function ee($,A,F){if(typeof A=="string"&&A!==""||typeof A=="number")return A=Uc(""+A,$.mode,F),A.return=$,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case B:return F=hl(A.type,A.key,A.props,null,$.mode,F),F.ref=Ai($,null,A),F.return=$,F;case q:return A=Bc(A,$.mode,F),A.return=$,A;case ne:var re=A._init;return ee($,re(A._payload),F)}if(At(A)||J(A))return A=gr(A,$.mode,F,null),A.return=$,A;Ho($,A)}return null}function X($,A,F,re){var Se=A!==null?A.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:C($,A,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case B:return F.key===Se?_($,A,F,re):null;case q:return F.key===Se?U($,A,F,re):null;case ne:return Se=F._init,X($,A,Se(F._payload),re)}if(At(F)||J(F))return Se!==null?null:Z($,A,F,re,null);Ho($,F)}return null}function de($,A,F,re,Se){if(typeof re=="string"&&re!==""||typeof re=="number")return $=$.get(F)||null,C(A,$,""+re,Se);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case B:return $=$.get(re.key===null?F:re.key)||null,_(A,$,re,Se);case q:return $=$.get(re.key===null?F:re.key)||null,U(A,$,re,Se);case ne:var Ie=re._init;return de($,A,F,Ie(re._payload),Se)}if(At(re)||J(re))return $=$.get(F)||null,Z(A,$,re,Se,null);Ho(A,re)}return null}function pe($,A,F,re){for(var Se=null,Ie=null,De=A,Pe=A=0,Gt=null;De!==null&&Pe<F.length;Pe++){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var et=X($,De,F[Pe],re);if(et===null){De===null&&(De=Gt);break}e&&De&&et.alternate===null&&t($,De),A=p(et,A,Pe),Ie===null?Se=et:Ie.sibling=et,Ie=et,De=Gt}if(Pe===F.length)return i($,De),ht&&ar($,Pe),Se;if(De===null){for(;Pe<F.length;Pe++)De=ee($,F[Pe],re),De!==null&&(A=p(De,A,Pe),Ie===null?Se=De:Ie.sibling=De,Ie=De);return ht&&ar($,Pe),Se}for(De=l($,De);Pe<F.length;Pe++)Gt=de(De,$,Pe,F[Pe],re),Gt!==null&&(e&&Gt.alternate!==null&&De.delete(Gt.key===null?Pe:Gt.key),A=p(Gt,A,Pe),Ie===null?Se=Gt:Ie.sibling=Gt,Ie=Gt);return e&&De.forEach(function(Ks){return t($,Ks)}),ht&&ar($,Pe),Se}function ve($,A,F,re){var Se=J(F);if(typeof Se!="function")throw Error(r(150));if(F=Se.call(F),F==null)throw Error(r(151));for(var Ie=Se=null,De=A,Pe=A=0,Gt=null,et=F.next();De!==null&&!et.done;Pe++,et=F.next()){De.index>Pe?(Gt=De,De=null):Gt=De.sibling;var Ks=X($,De,et.value,re);if(Ks===null){De===null&&(De=Gt);break}e&&De&&Ks.alternate===null&&t($,De),A=p(Ks,A,Pe),Ie===null?Se=Ks:Ie.sibling=Ks,Ie=Ks,De=Gt}if(et.done)return i($,De),ht&&ar($,Pe),Se;if(De===null){for(;!et.done;Pe++,et=F.next())et=ee($,et.value,re),et!==null&&(A=p(et,A,Pe),Ie===null?Se=et:Ie.sibling=et,Ie=et);return ht&&ar($,Pe),Se}for(De=l($,De);!et.done;Pe++,et=F.next())et=de(De,$,Pe,et.value,re),et!==null&&(e&&et.alternate!==null&&De.delete(et.key===null?Pe:et.key),A=p(et,A,Pe),Ie===null?Se=et:Ie.sibling=et,Ie=et);return e&&De.forEach(function(uy){return t($,uy)}),ht&&ar($,Pe),Se}function Mt($,A,F,re){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 B:e:{for(var Se=F.key,Ie=A;Ie!==null;){if(Ie.key===Se){if(Se=F.type,Se===K){if(Ie.tag===7){i($,Ie.sibling),A=d(Ie,F.props.children),A.return=$,$=A;break e}}else if(Ie.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===ne&&df(Se)===Ie.type){i($,Ie.sibling),A=d(Ie,F.props),A.ref=Ai($,Ie,F),A.return=$,$=A;break e}i($,Ie);break}else t($,Ie);Ie=Ie.sibling}F.type===K?(A=gr(F.props.children,$.mode,re,F.key),A.return=$,$=A):(re=hl(F.type,F.key,F.props,null,$.mode,re),re.ref=Ai($,A,F),re.return=$,$=re)}return v($);case q:e:{for(Ie=F.key;A!==null;){if(A.key===Ie)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=Bc(F,$.mode,re),A.return=$,$=A}return v($);case ne:return Ie=F._init,Mt($,A,Ie(F._payload),re)}if(At(F))return pe($,A,F,re);if(J(F))return ve($,A,F,re);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=Uc(F,$.mode,re),A.return=$,$=A),v($)):i($,A)}return Mt}var Fr=ff(!0),pf=ff(!1),Vo=Os(null),Go=null,Ur=null,Qa=null;function Za(){Qa=Ur=Go=null}function Ja(e){var t=Vo.current;pt(Vo),e._currentValue=t}function ec(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 Br(e,t){Go=e,Qa=Ur=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(kn=!0),e.firstContext=null)}function $n(e){var t=e._currentValue;if(Qa!==e)if(e={context:e,memoizedValue:t,next:null},Ur===null){if(Go===null)throw Error(r(308));Ur=e,Go.dependencies={lanes:0,firstContext:e}}else Ur=Ur.next=e;return t}var cr=null;function tc(e){cr===null?cr=[e]:cr.push(e)}function hf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,tc(t)):(i.next=d.next,d.next=i),t.interleaved=i,ks(e,l)}function ks(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 Fs=!1;function nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mf(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 Ss(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Us(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Qe&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,ks(e,i)}return d=l.interleaved,d===null?(t.next=t,tc(l)):(t.next=d.next,d.next=t),l.interleaved=t,ks(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,Is(e,i)}}function gf(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;Fs=!1;var p=d.firstBaseUpdate,v=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var _=C,U=_.next;_.next=null,v===null?p=U:v.next=U,v=_;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,C=Z.lastBaseUpdate,C!==v&&(C===null?Z.firstBaseUpdate=U:C.next=U,Z.lastBaseUpdate=_))}if(p!==null){var ee=d.baseState;v=0,Z=U=_=null,C=p;do{var X=C.lane,de=C.eventTime;if((l&X)===X){Z!==null&&(Z=Z.next={eventTime:de,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var pe=e,ve=C;switch(X=t,de=i,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){ee=pe.call(de,ee,X);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,X=typeof pe=="function"?pe.call(de,ee,X):pe,X==null)break e;ee=H({},ee,X);break e;case 2:Fs=!0}}C.callback!==null&&C.lane!==0&&(e.flags|=64,X=d.effects,X===null?d.effects=[C]:X.push(C))}else de={eventTime:de,lane:X,tag:C.tag,payload:C.payload,callback:C.callback,next:null},Z===null?(U=Z=de,_=ee):Z=Z.next=de,v|=X;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;X=C,C=X.next,X.next=null,d.lastBaseUpdate=X,d.shared.pending=null}}while(!0);if(Z===null&&(_=ee),d.baseState=_,d.firstBaseUpdate=U,d.lastBaseUpdate=Z,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);fr|=v,e.lanes=v,e.memoizedState=ee}}function vf(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(r(191,d));d.call(l)}}}var Ii={},as=Os(Ii),Di=Os(Ii),Mi=Os(Ii);function ur(e){if(e===Ii)throw Error(r(174));return e}function sc(e,t){switch(ut(Mi,t),ut(Di,e),ut(as,Ii),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yt(t,e)}pt(as),ut(as,t)}function Wr(){pt(as),pt(Di),pt(Mi)}function yf(e){ur(Mi.current);var t=ur(as.current),i=yt(t,e.type);t!==i&&(ut(Di,e),ut(as,i))}function rc(e){Di.current===e&&(pt(as),pt(Di))}var Nt=Os(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 ic=[];function oc(){for(var e=0;e<ic.length;e++)ic[e]._workInProgressVersionPrimary=null;ic.length=0}var Xo=D.ReactCurrentDispatcher,lc=D.ReactCurrentBatchConfig,dr=0,Ct=null,Ft=null,Ht=null,Qo=!1,Li=!1,Pi=0,Iv=0;function on(){throw Error(r(321))}function ac(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 cc(e,t,i,l,d,p){if(dr=p,Ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xo.current=e===null||e.memoizedState===null?Pv:Ov,e=i(l,d),Li){p=0;do{if(Li=!1,Pi=0,25<=p)throw Error(r(301));p+=1,Ht=Ft=null,t.updateQueue=null,Xo.current=zv,e=i(l,d)}while(Li)}if(Xo.current=el,t=Ft!==null&&Ft.next!==null,dr=0,Ht=Ft=Ct=null,Qo=!1,t)throw Error(r(300));return e}function uc(){var e=Pi!==0;return Pi=0,e}function cs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Fn(){if(Ft===null){var e=Ct.alternate;e=e!==null?e.memoizedState:null}else e=Ft.next;var t=Ht===null?Ct.memoizedState:Ht.next;if(t!==null)Ht=t,Ft=e;else{if(e===null)throw Error(r(310));Ft=e,e={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Ht===null?Ct.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Oi(e,t){return typeof t=="function"?t(e):t}function dc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=e;var l=Ft,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 C=v=null,_=null,U=p;do{var Z=U.lane;if((dr&Z)===Z)_!==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:Z,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};_===null?(C=_=ee,v=l):_=_.next=ee,Ct.lanes|=Z,fr|=Z}U=U.next}while(U!==null&&U!==p);_===null?v=l:_.next=C,Yn(l,t.memoizedState)||(kn=!0),t.memoizedState=l,t.baseState=v,t.baseQueue=_,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,Ct.lanes|=p,fr|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function fc(e){var t=Fn(),i=t.queue;if(i===null)throw Error(r(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)||(kn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function xf(){}function wf(e,t){var i=Ct,l=Fn(),d=t(),p=!Yn(l.memoizedState,d);if(p&&(l.memoizedState=d,kn=!0),l=l.queue,pc(Tf.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Ht!==null&&Ht.memoizedState.tag&1){if(i.flags|=2048,zi(9,Sf.bind(null,i,l,d,t),void 0,null),Vt===null)throw Error(r(349));(dr&30)!==0||kf(i,t,d)}return d}function kf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Sf(e,t,i,l){t.value=i,t.getSnapshot=l,bf(t)&&Nf(e)}function Tf(e,t,i){return i(function(){bf(t)&&Nf(e)})}function bf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Yn(e,i)}catch{return!0}}function Nf(e){var t=ks(e,1);t!==null&&es(t,e,1,-1)}function Cf(e){var t=cs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oi,lastRenderedState:e},t.queue=e,e=e.dispatch=Lv.bind(null,Ct,e),[t.memoizedState,e]}function zi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=Ct.updateQueue,t===null?(t={lastEffect:null,stores:null},Ct.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e)),e}function Ef(){return Fn().memoizedState}function Zo(e,t,i,l){var d=cs();Ct.flags|=e,d.memoizedState=zi(1|t,i,void 0,l===void 0?null:l)}function Jo(e,t,i,l){var d=Fn();l=l===void 0?null:l;var p=void 0;if(Ft!==null){var v=Ft.memoizedState;if(p=v.destroy,l!==null&&ac(l,v.deps)){d.memoizedState=zi(t,i,p,l);return}}Ct.flags|=e,d.memoizedState=zi(1|t,i,p,l)}function _f(e,t){return Zo(8390656,8,e,t)}function pc(e,t){return Jo(2048,8,e,t)}function jf(e,t){return Jo(4,2,e,t)}function Rf(e,t){return Jo(4,4,e,t)}function Af(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 If(e,t,i){return i=i!=null?i.concat([e]):null,Jo(4,4,Af.bind(null,t,e),i)}function hc(){}function Df(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Mf(e,t){var i=Fn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&ac(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Lf(e,t,i){return(dr&21)===0?(e.baseState&&(e.baseState=!1,kn=!0),e.memoizedState=i):(Yn(i,t)||(i=hi(),Ct.lanes|=i,fr|=i,e.baseState=!0),t)}function Dv(e,t){var i=Ye;Ye=i!==0&&4>i?i:4,e(!0);var l=lc.transition;lc.transition={};try{e(!1),t()}finally{Ye=i,lc.transition=l}}function Pf(){return Fn().memoizedState}function Mv(e,t,i){var l=Vs(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Of(e))zf(t,i);else if(i=hf(e,t,i,l),i!==null){var d=hn();es(i,e,l,d),$f(i,t,l)}}function Lv(e,t,i){var l=Vs(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Of(e))zf(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,C=p(v,i);if(d.hasEagerState=!0,d.eagerState=C,Yn(C,v)){var _=t.interleaved;_===null?(d.next=d,tc(t)):(d.next=_.next,_.next=d),t.interleaved=d;return}}catch{}finally{}i=hf(e,t,d,l),i!==null&&(d=hn(),es(i,e,l,d),$f(i,t,l))}}function Of(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function zf(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 $f(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Is(e,i)}}var el={readContext:$n,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},Pv={readContext:$n,useCallback:function(e,t){return cs().memoizedState=[e,t===void 0?null:t],e},useContext:$n,useEffect:_f,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,Zo(4194308,4,Af.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=cs();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=cs();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=Mv.bind(null,Ct,e),[l.memoizedState,e]},useRef:function(e){var t=cs();return e={current:e},t.memoizedState=e},useState:Cf,useDebugValue:hc,useDeferredValue:function(e){return cs().memoizedState=e},useTransition:function(){var e=Cf(!1),t=e[0];return e=Dv.bind(null,e[1]),cs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=Ct,d=cs();if(ht){if(i===void 0)throw Error(r(407));i=i()}else{if(i=t(),Vt===null)throw Error(r(349));(dr&30)!==0||kf(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,_f(Tf.bind(null,l,p,e),[e]),l.flags|=2048,zi(9,Sf.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=cs(),t=Vt.identifierPrefix;if(ht){var i=ws,l=xs;i=(l&~(1<<32-dn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Pi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=Iv++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ov={readContext:$n,useCallback:Df,useContext:$n,useEffect:pc,useImperativeHandle:If,useInsertionEffect:jf,useLayoutEffect:Rf,useMemo:Mf,useReducer:dc,useRef:Ef,useState:function(){return dc(Oi)},useDebugValue:hc,useDeferredValue:function(e){var t=Fn();return Lf(t,Ft.memoizedState,e)},useTransition:function(){var e=dc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:xf,useSyncExternalStore:wf,useId:Pf,unstable_isNewReconciler:!1},zv={readContext:$n,useCallback:Df,useContext:$n,useEffect:pc,useImperativeHandle:If,useInsertionEffect:jf,useLayoutEffect:Rf,useMemo:Mf,useReducer:fc,useRef:Ef,useState:function(){return fc(Oi)},useDebugValue:hc,useDeferredValue:function(e){var t=Fn();return Ft===null?t.memoizedState=e:Lf(t,Ft.memoizedState,e)},useTransition:function(){var e=fc(Oi)[0],t=Fn().memoizedState;return[e,t]},useMutableSource:xf,useSyncExternalStore:wf,useId:Pf,unstable_isNewReconciler:!1};function Qn(e,t){if(e&&e.defaultProps){t=H({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function mc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:H({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tl={isMounted:function(e){return(e=e._reactInternals)?rt(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=hn(),d=Vs(e),p=Ss(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Us(e,p,d),t!==null&&(es(t,e,d,l),qo(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=hn(),l=Vs(e),d=Ss(i,l);d.tag=2,t!=null&&(d.callback=t),t=Us(e,d,l),t!==null&&(es(t,e,l,i),qo(t,e,l))}};function Ff(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 Uf(e,t,i){var l=!1,d=zs,p=t.contextType;return typeof p=="object"&&p!==null?p=$n(p):(d=wn(t)?or:rn.current,l=t.contextTypes,p=(l=l!=null)?Pr(e,d):zs),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 Bf(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 gc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},nc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=$n(p):(p=wn(t)?or:rn.current,d.context=Pr(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(mc(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 Hr(e,t){try{var i="",l=t;do i+=ge(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 vc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function yc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var $v=typeof WeakMap=="function"?WeakMap:Map;function Wf(e,t,i){i=Ss(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){al||(al=!0,Dc=l),yc(e,t)},i}function Hf(e,t,i){i=Ss(-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(){yc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){yc(e,t),typeof l!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),i}function Vf(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new $v;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=Jv.bind(null,e,t,i),t.then(e,e))}function Gf(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 qf(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=Ss(-1,1),t.tag=2,Us(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Fv=D.ReactCurrentOwner,kn=!1;function pn(e,t,i,l){t.child=e===null?pf(t,null,i,l):Fr(t,e.child,i,l)}function Kf(e,t,i,l,d){i=i.render;var p=t.ref;return Br(t,d),l=cc(e,t,i,l,p,d),i=uc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&i&&Ga(t),t.flags|=1,pn(e,t,l,d),t.child)}function Yf(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Fc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,Xf(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 Ts(e,t,d)}return t.flags|=1,e=qs(p,l),e.ref=t.ref,e.return=t,t.child=e}function Xf(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(bi(p,l)&&e.ref===t.ref)if(kn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(kn=!0);else return t.lanes=e.lanes,Ts(e,t,d)}return xc(e,t,i,l,d)}function Qf(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},ut(Gr,Rn),Rn|=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,ut(Gr,Rn),Rn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ut(Gr,Rn),Rn|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ut(Gr,Rn),Rn|=l;return pn(e,t,d,i),t.child}function Zf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function xc(e,t,i,l,d){var p=wn(i)?or:rn.current;return p=Pr(t,p),Br(t,d),i=cc(e,t,i,l,p,d),l=uc(),e!==null&&!kn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ts(e,t,d)):(ht&&l&&Ga(t),t.flags|=1,pn(e,t,i,d),t.child)}function Jf(e,t,i,l,d){if(wn(i)){var p=!0;$o(t)}else p=!1;if(Br(t,d),t.stateNode===null)sl(e,t),Uf(t,i,l),gc(t,i,l,d),l=!0;else if(e===null){var v=t.stateNode,C=t.memoizedProps;v.props=C;var _=v.context,U=i.contextType;typeof U=="object"&&U!==null?U=$n(U):(U=wn(i)?or:rn.current,U=Pr(t,U));var Z=i.getDerivedStateFromProps,ee=typeof Z=="function"||typeof v.getSnapshotBeforeUpdate=="function";ee||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==l||_!==U)&&Bf(t,v,l,U),Fs=!1;var X=t.memoizedState;v.state=X,Ko(t,l,v,d),_=t.memoizedState,C!==l||X!==_||xn.current||Fs?(typeof Z=="function"&&(mc(t,i,Z,l),_=t.memoizedState),(C=Fs||Ff(t,i,C,l,X,_,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=C):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{v=t.stateNode,mf(e,t),C=t.memoizedProps,U=t.type===t.elementType?C:Qn(t.type,C),v.props=U,ee=t.pendingProps,X=v.context,_=i.contextType,typeof _=="object"&&_!==null?_=$n(_):(_=wn(i)?or:rn.current,_=Pr(t,_));var de=i.getDerivedStateFromProps;(Z=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==ee||X!==_)&&Bf(t,v,l,_),Fs=!1,X=t.memoizedState,v.state=X,Ko(t,l,v,d);var pe=t.memoizedState;C!==ee||X!==pe||xn.current||Fs?(typeof de=="function"&&(mc(t,i,de,l),pe=t.memoizedState),(U=Fs||Ff(t,i,U,l,X,pe,_)||!1)?(Z||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(l,pe,_),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(l,pe,_)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=pe),v.props=l,v.state=pe,v.context=_,l=U):(typeof v.componentDidUpdate!="function"||C===e.memoizedProps&&X===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===e.memoizedProps&&X===e.memoizedState||(t.flags|=1024),l=!1)}return wc(e,t,i,l,p,d)}function wc(e,t,i,l,d,p){Zf(e,t);var v=(t.flags&128)!==0;if(!l&&!v)return d&&sf(t,i,!1),Ts(e,t,p);l=t.stateNode,Fv.current=t;var C=v&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&v?(t.child=Fr(t,e.child,null,p),t.child=Fr(t,null,C,p)):pn(e,t,C,p),t.memoizedState=l.state,d&&sf(t,i,!0),t.child}function ep(e){var t=e.stateNode;t.pendingContext?tf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tf(e,t.context,!1),sc(e,t.containerInfo)}function tp(e,t,i,l,d){return $r(),Xa(d),t.flags|=256,pn(e,t,i,l),t.child}var kc={dehydrated:null,treeContext:null,retryLane:0};function Sc(e){return{baseLanes:e,cachePool:null,transitions:null}}function np(e,t,i){var l=t.pendingProps,d=Nt.current,p=!1,v=(t.flags&128)!==0,C;if((C=v)||(C=e!==null&&e.memoizedState===null?!1:(d&2)!==0),C?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ut(Nt,d&1),e===null)return Ya(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=gr(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Sc(i),t.memoizedState=kc,e):Tc(t,v));if(d=e.memoizedState,d!==null&&(C=d.dehydrated,C!==null))return Uv(e,t,v,l,C,d,i);if(p){p=l.fallback,v=t.mode,d=e.child,C=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=qs(d,_),l.subtreeFlags=d.subtreeFlags&14680064),C!==null?p=qs(C,p):(p=gr(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?Sc(i):{baseLanes:v.baseLanes|i,cachePool:null,transitions:v.transitions},p.memoizedState=v,p.childLanes=e.childLanes&~i,t.memoizedState=kc,l}return p=e.child,e=p.sibling,l=qs(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 Tc(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&&Xa(l),Fr(t,e.child,null,i),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uv(e,t,i,l,d,p,v){if(i)return t.flags&256?(t.flags&=-257,l=vc(Error(r(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=gr(p,d,v,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Fr(t,e.child,null,v),t.child.memoizedState=Sc(v),t.memoizedState=kc,p);if((t.mode&1)===0)return nl(e,t,v,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var C=l.dgst;return l=C,p=Error(r(419)),l=vc(p,l,void 0),nl(e,t,v,l)}if(C=(v&e.childLanes)!==0,kn||C){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,ks(e,d),es(l,e,d,-1))}return $c(),l=vc(Error(r(421))),nl(e,t,v,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=ey.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,jn=Ps(d.nextSibling),_n=t,ht=!0,Xn=null,e!==null&&(On[zn++]=xs,On[zn++]=ws,On[zn++]=lr,xs=e.id,ws=e.overflow,lr=t),t=Tc(t,l.children),t.flags|=4096,t)}function sp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ec(e.return,t,i)}function bc(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 rp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(pn(e,t,l.children,i),l=Nt.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sp(e,i,t);else if(e.tag===19)sp(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(ut(Nt,l),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(i=t.child,d=null;i!==null;)e=i.alternate,e!==null&&Yo(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),bc(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}bc(t,!0,i,null,p);break;case"together":bc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function sl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ts(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),fr|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,i=qs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=qs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Bv(e,t,i){switch(t.tag){case 3:ep(t),$r();break;case 5:yf(t);break;case 1:wn(t.type)&&$o(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ut(Vo,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ut(Nt,Nt.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?np(e,t,i):(ut(Nt,Nt.current&1),e=Ts(e,t,i),e!==null?e.sibling:null);ut(Nt,Nt.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return rp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ut(Nt,Nt.current),l)break;return null;case 22:case 23:return t.lanes=0,Qf(e,t,i)}return Ts(e,t,i)}var ip,Nc,op,lp;ip=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}},Nc=function(){},op=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ur(as.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=H({},d,{value:void 0}),l=H({},l,{value:void 0}),p=[];break;case"textarea":d=V(e,d),l=V(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Po)}Ln(i,l);var v;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var C=d[U];for(v in C)C.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(C=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&_!==C&&(_!=null||C!=null))if(U==="style")if(C){for(v in C)!C.hasOwnProperty(v)||_&&_.hasOwnProperty(v)||(i||(i={}),i[v]="");for(v in _)_.hasOwnProperty(v)&&C[v]!==_[v]&&(i||(i={}),i[v]=_[v])}else i||(p||(p=[]),p.push(U,i)),i=_;else U==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,C=C?C.__html:void 0,_!=null&&C!==_&&(p=p||[]).push(U,_)):U==="children"?typeof _!="string"&&typeof _!="number"||(p=p||[]).push(U,""+_):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(_!=null&&U==="onScroll"&&ft("scroll",e),p||C===_||(p=[])):(p=p||[]).push(U,_))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},lp=function(e,t,i,l){i!==l&&(t.flags|=4)};function $i(e,t){if(!ht)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 ln(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 Wv(e,t,i){var l=t.pendingProps;switch(qa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(t),null;case 1:return wn(t.type)&&zo(),ln(t),null;case 3:return l=t.stateNode,Wr(),pt(xn),pt(rn),oc(),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&&(Pc(Xn),Xn=null))),Nc(e,t),ln(t),null;case 5:rc(t);var d=ur(Mi.current);if(i=t.type,e!==null&&t.stateNode!=null)op(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(r(166));return ln(t),null}if(e=ur(as.current),Wo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[ls]=t,l[ji]=p,e=(t.mode&1)!==0,i){case"dialog":ft("cancel",l),ft("close",l);break;case"iframe":case"object":case"embed":ft("load",l);break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],l);break;case"source":ft("error",l);break;case"img":case"image":case"link":ft("error",l),ft("load",l);break;case"details":ft("toggle",l);break;case"input":zt(l,p),ft("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},ft("invalid",l);break;case"textarea":he(l,p),ft("invalid",l)}Ln(i,p),d=null;for(var v in p)if(p.hasOwnProperty(v)){var C=p[v];v==="children"?typeof C=="string"?l.textContent!==C&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,C,e),d=["children",C]):typeof C=="number"&&l.textContent!==""+C&&(p.suppressHydrationWarning!==!0&&Lo(l.textContent,C,e),d=["children",""+C]):a.hasOwnProperty(v)&&C!=null&&v==="onScroll"&&ft("scroll",l)}switch(i){case"input":mt(l),Rt(l,p,!0);break;case"textarea":mt(l),Ze(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=vt(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[ls]=t,e[ji]=l,ip(e,t,!1,!1),t.stateNode=e;e:{switch(v=Pn(i,l),i){case"dialog":ft("cancel",e),ft("close",e),d=l;break;case"iframe":case"object":case"embed":ft("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ci.length;d++)ft(Ci[d],e);d=l;break;case"source":ft("error",e),d=l;break;case"img":case"image":case"link":ft("error",e),ft("load",e),d=l;break;case"details":ft("toggle",e),d=l;break;case"input":zt(e,l),d=ze(e,l),ft("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=H({},l,{value:void 0}),ft("invalid",e);break;case"textarea":he(e,l),d=V(e,l),ft("invalid",e);break;default:d=l}Ln(i,d),C=d;for(p in C)if(C.hasOwnProperty(p)){var _=C[p];p==="style"?Gn(e,_):p==="dangerouslySetInnerHTML"?(_=_?_.__html:void 0,_!=null&&Xt(e,_)):p==="children"?typeof _=="string"?(i!=="textarea"||_!=="")&&sn(e,_):typeof _=="number"&&sn(e,""+_):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?_!=null&&p==="onScroll"&&ft("scroll",e):_!=null&&W(e,p,_,v))}switch(i){case"input":mt(e),Rt(e,l,!1);break;case"textarea":mt(e),Ze(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Re(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?$t(e,!!l.multiple,p,!1):l.defaultValue!=null&&$t(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 ln(t),null;case 6:if(e&&t.stateNode!=null)lp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(i=ur(Mi.current),ur(as.current),Wo(t)){if(l=t.stateNode,i=t.memoizedProps,l[ls]=t,(p=l.nodeValue!==i)&&(e=_n,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[ls]=t,t.stateNode=l}return ln(t),null;case 13:if(pt(Nt),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&jn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)uf(),$r(),t.flags|=98560,p=!1;else if(p=Wo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(r(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[ls]=t}else $r(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else Xn!==null&&(Pc(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||(Nt.current&1)!==0?Ut===0&&(Ut=3):$c())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return Wr(),Nc(e,t),e===null&&Ei(t.stateNode.containerInfo),ln(t),null;case 10:return Ja(t.type._context),ln(t),null;case 17:return wn(t.type)&&zo(),ln(t),null;case 19:if(pt(Nt),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,v=p.rendering,v===null)if(l)$i(p,!1);else{if(Ut!==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 ut(Nt,Nt.current&1|2),t.child}e=e.sibling}p.tail!==null&&St()>qr&&(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&&!ht)return ln(t),null}else 2*St()-p.renderingStartTime>qr&&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=St(),t.sibling=null,i=Nt.current,ut(Nt,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return zc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Rn&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function Hv(e,t){switch(qa(t),t.tag){case 1:return wn(t.type)&&zo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wr(),pt(xn),pt(rn),oc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return rc(t),null;case 13:if(pt(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));$r()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(Nt),null;case 4:return Wr(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return zc(),null;case 24:return null;default:return null}}var rl=!1,an=!1,Vv=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Vr(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){Et(e,t,l)}else i.current=null}function Cc(e,t,i){try{i()}catch(l){Et(e,t,l)}}var ap=!1;function Gv(e,t){if(za=bo,e=$d(),Ra(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,C=-1,_=-1,U=0,Z=0,ee=e,X=null;t:for(;;){for(var de;ee!==i||d!==0&&ee.nodeType!==3||(C=v+d),ee!==p||l!==0&&ee.nodeType!==3||(_=v+l),ee.nodeType===3&&(v+=ee.nodeValue.length),(de=ee.firstChild)!==null;)X=ee,ee=de;for(;;){if(ee===e)break t;if(X===i&&++U===d&&(C=v),X===p&&++Z===l&&(_=v),(de=ee.nextSibling)!==null)break;ee=X,X=ee.parentNode}ee=de}i=C===-1||_===-1?null:{start:C,end:_}}else i=null}i=i||{start:0,end:0}}else i=null;for($a={focusedElem:e,selectionRange:i},bo=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,Mt=pe.memoizedState,$=t.stateNode,A=$.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Qn(t.type,ve),Mt);$.__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(r(163))}}catch(re){Et(t,t.return,re)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return pe=ap,ap=!1,pe}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&&Cc(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 Ec(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 cp(e){var t=e.alternate;t!==null&&(e.alternate=null,cp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ls],delete t[ji],delete t[Wa],delete t[_v],delete t[jv])),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 up(e){return e.tag===5||e.tag===3||e.tag===4}function dp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||up(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 _c(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(_c(e,t,i),e=e.sibling;e!==null;)_c(e,t,i),e=e.sibling}function jc(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(jc(e,t,i),e=e.sibling;e!==null;)jc(e,t,i),e=e.sibling}var Zt=null,Zn=!1;function Bs(e,t,i){for(i=i.child;i!==null;)fp(e,t,i),i=i.sibling}function fp(e,t,i){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(er,i)}catch{}switch(i.tag){case 5:an||Vr(i,t);case 6:var l=Zt,d=Zn;Zt=null,Bs(e,t,i),Zt=l,Zn=d,Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):Zt.removeChild(i.stateNode));break;case 18:Zt!==null&&(Zn?(e=Zt,i=i.stateNode,e.nodeType===8?Ba(e.parentNode,i):e.nodeType===1&&Ba(e,i),yi(e)):Ba(Zt,i.stateNode));break;case 4:l=Zt,d=Zn,Zt=i.stateNode.containerInfo,Zn=!0,Bs(e,t,i),Zt=l,Zn=d;break;case 0:case 11:case 14:case 15:if(!an&&(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)&&Cc(i,t,v),d=d.next}while(d!==l)}Bs(e,t,i);break;case 1:if(!an&&(Vr(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(C){Et(i,t,C)}Bs(e,t,i);break;case 21:Bs(e,t,i);break;case 22:i.mode&1?(an=(l=an)||i.memoizedState!==null,Bs(e,t,i),an=l):Bs(e,t,i);break;default:Bs(e,t,i)}}function pp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Vv),t.forEach(function(l){var d=ty.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,C=v;e:for(;C!==null;){switch(C.tag){case 5:Zt=C.stateNode,Zn=!1;break e;case 3:Zt=C.stateNode.containerInfo,Zn=!0;break e;case 4:Zt=C.stateNode.containerInfo,Zn=!0;break e}C=C.return}if(Zt===null)throw Error(r(160));fp(p,v,d),Zt=null,Zn=!1;var _=d.alternate;_!==null&&(_.return=null),d.return=null}catch(U){Et(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)hp(t,e),t=t.sibling}function hp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jn(t,e),us(e),l&4){try{Fi(3,e,e.return),il(3,e)}catch(ve){Et(e,e.return,ve)}try{Fi(5,e,e.return)}catch(ve){Et(e,e.return,ve)}}break;case 1:Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return);break;case 5:if(Jn(t,e),us(e),l&512&&i!==null&&Vr(i,i.return),e.flags&32){var d=e.stateNode;try{sn(d,"")}catch(ve){Et(e,e.return,ve)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,v=i!==null?i.memoizedProps:p,C=e.type,_=e.updateQueue;if(e.updateQueue=null,_!==null)try{C==="input"&&p.type==="radio"&&p.name!=null&&We(d,p),Pn(C,v);var U=Pn(C,p);for(v=0;v<_.length;v+=2){var Z=_[v],ee=_[v+1];Z==="style"?Gn(d,ee):Z==="dangerouslySetInnerHTML"?Xt(d,ee):Z==="children"?sn(d,ee):W(d,Z,ee,U)}switch(C){case"input":Wt(d,p);break;case"textarea":Ue(d,p);break;case"select":var X=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?$t(d,!!p.multiple,de,!1):X!==!!p.multiple&&(p.defaultValue!=null?$t(d,!!p.multiple,p.defaultValue,!0):$t(d,!!p.multiple,p.multiple?[]:"",!1))}d[ji]=p}catch(ve){Et(e,e.return,ve)}}break;case 6:if(Jn(t,e),us(e),l&4){if(e.stateNode===null)throw Error(r(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ve){Et(e,e.return,ve)}}break;case 3:if(Jn(t,e),us(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ve){Et(e,e.return,ve)}break;case 4:Jn(t,e),us(e);break;case 13:Jn(t,e),us(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ic=St())),l&4&&pp(e);break;case 22:if(Z=i!==null&&i.memoizedState!==null,e.mode&1?(an=(U=an)||Z,Jn(t,e),an=U):Jn(t,e),us(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!Z&&(e.mode&1)!==0)for(fe=e,Z=e.child;Z!==null;){for(ee=fe=Z;fe!==null;){switch(X=fe,de=X.child,X.tag){case 0:case 11:case 14:case 15:Fi(4,X,X.return);break;case 1:Vr(X,X.return);var pe=X.stateNode;if(typeof pe.componentWillUnmount=="function"){l=X,i=X.return;try{t=l,pe.props=t.memoizedProps,pe.state=t.memoizedState,pe.componentWillUnmount()}catch(ve){Et(l,i,ve)}}break;case 5:Vr(X,X.return);break;case 22:if(X.memoizedState!==null){vp(ee);continue}}de!==null?(de.return=X,fe=de):vp(ee)}Z=Z.sibling}e:for(Z=null,ee=e;;){if(ee.tag===5){if(Z===null){Z=ee;try{d=ee.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(C=ee.stateNode,_=ee.memoizedProps.style,v=_!=null&&_.hasOwnProperty("display")?_.display:null,C.style.display=yn("display",v))}catch(ve){Et(e,e.return,ve)}}}else if(ee.tag===6){if(Z===null)try{ee.stateNode.nodeValue=U?"":ee.memoizedProps}catch(ve){Et(e,e.return,ve)}}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;Z===ee&&(Z=null),ee=ee.return}Z===ee&&(Z=null),ee.sibling.return=ee.return,ee=ee.sibling}}break;case 19:Jn(t,e),us(e),l&4&&pp(e);break;case 21:break;default:Jn(t,e),us(e)}}function us(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(up(i)){var l=i;break e}i=i.return}throw Error(r(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(sn(d,""),l.flags&=-33);var p=dp(e);jc(e,p,d);break;case 3:case 4:var v=l.stateNode.containerInfo,C=dp(e);_c(e,C,v);break;default:throw Error(r(161))}}catch(_){Et(e,e.return,_)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qv(e,t,i){fe=e,mp(e)}function mp(e,t,i){for(var l=(e.mode&1)!==0;fe!==null;){var d=fe,p=d.child;if(d.tag===22&&l){var v=d.memoizedState!==null||rl;if(!v){var C=d.alternate,_=C!==null&&C.memoizedState!==null||an;C=rl;var U=an;if(rl=v,(an=_)&&!U)for(fe=d;fe!==null;)v=fe,_=v.child,v.tag===22&&v.memoizedState!==null?yp(d):_!==null?(_.return=v,fe=_):yp(d);for(;p!==null;)fe=p,mp(p),p=p.sibling;fe=d,rl=C,an=U}gp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,fe=p):gp(e)}}function gp(e){for(;fe!==null;){var t=fe;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:an||il(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!an)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&&vf(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}vf(t,v,i)}break;case 5:var C=t.stateNode;if(i===null&&t.flags&4){i=C;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 Z=U.memoizedState;if(Z!==null){var ee=Z.dehydrated;ee!==null&&yi(ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}an||t.flags&512&&Ec(t)}catch(X){Et(t,t.return,X)}}if(t===e){fe=null;break}if(i=t.sibling,i!==null){i.return=t.return,fe=i;break}fe=t.return}}function vp(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var i=t.sibling;if(i!==null){i.return=t.return,fe=i;break}fe=t.return}}function yp(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{il(4,t)}catch(_){Et(t,i,_)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(_){Et(t,d,_)}}var p=t.return;try{Ec(t)}catch(_){Et(t,p,_)}break;case 5:var v=t.return;try{Ec(t)}catch(_){Et(t,v,_)}}}catch(_){Et(t,t.return,_)}if(t===e){fe=null;break}var C=t.sibling;if(C!==null){C.return=t.return,fe=C;break}fe=t.return}}var Kv=Math.ceil,ol=D.ReactCurrentDispatcher,Rc=D.ReactCurrentOwner,Un=D.ReactCurrentBatchConfig,Qe=0,Vt=null,Pt=null,Jt=0,Rn=0,Gr=Os(0),Ut=0,Ui=null,fr=0,ll=0,Ac=0,Bi=null,Sn=null,Ic=0,qr=1/0,bs=null,al=!1,Dc=null,Ws=null,cl=!1,Hs=null,ul=0,Wi=0,Mc=null,dl=-1,fl=0;function hn(){return(Qe&6)!==0?St():dl!==-1?dl:dl=St()}function Vs(e){return(e.mode&1)===0?1:(Qe&2)!==0&&Jt!==0?Jt&-Jt:Av.transition!==null?(fl===0&&(fl=hi()),fl):(e=Ye,e!==0||(e=window.event,e=e===void 0?16:xd(e.type)),e)}function es(e,t,i,l){if(50<Wi)throw Wi=0,Mc=null,Error(r(185));rr(e,i,l),((Qe&2)===0||e!==Vt)&&(e===Vt&&((Qe&2)===0&&(ll|=i),Ut===4&&Gs(e,Jt)),Tn(e,l),i===1&&Qe===0&&(t.mode&1)===0&&(qr=St()+500,Fo&&$s()))}function Tn(e,t){var i=e.callbackNode;ko(e,t);var l=sr(e,e===Vt?Jt: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?Rv(wp.bind(null,e)):rf(wp.bind(null,e)),Cv(function(){(Qe&6)===0&&$s()}),i=null;else{switch(se(l)){case 1:i=Rs;break;case 4:i=os;break;case 16:i=Tr;break;case 536870912:i=xo;break;default:i=Tr}i=_p(i,xp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function xp(e,t){if(dl=-1,fl=0,(Qe&6)!==0)throw Error(r(327));var i=e.callbackNode;if(Kr()&&e.callbackNode!==i)return null;var l=sr(e,e===Vt?Jt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=pl(e,l);else{t=l;var d=Qe;Qe|=2;var p=Sp();(Vt!==e||Jt!==t)&&(bs=null,qr=St()+500,hr(e,t));do try{Qv();break}catch(C){kp(e,C)}while(!0);Za(),ol.current=p,Qe=d,Pt!==null?t=0:(Vt=null,Jt=0,t=Ut)}if(t!==0){if(t===2&&(d=pi(e),d!==0&&(l=d,t=Lc(e,d))),t===1)throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;if(t===6)Gs(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Yv(d)&&(t=pl(e,l),t===2&&(p=pi(e),p!==0&&(l=p,t=Lc(e,p))),t===1))throw i=Ui,hr(e,0),Gs(e,l),Tn(e,St()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(r(345));case 2:mr(e,Sn,bs);break;case 3:if(Gs(e,l),(l&130023424)===l&&(t=Ic+500-St(),10<t)){if(sr(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){hn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ua(mr.bind(null,e,Sn,bs),t);break}mr(e,Sn,bs);break;case 4:if(Gs(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var v=31-dn(l);p=1<<v,v=t[v],v>d&&(d=v),l&=~p}if(l=d,l=St()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Kv(l/1960))-l,10<l){e.timeoutHandle=Ua(mr.bind(null,e,Sn,bs),l);break}mr(e,Sn,bs);break;case 5:mr(e,Sn,bs);break;default:throw Error(r(329))}}}return Tn(e,St()),e.callbackNode===i?xp.bind(null,e):null}function Lc(e,t){var i=Bi;return e.current.memoizedState.isDehydrated&&(hr(e,t).flags|=256),e=pl(e,t),e!==2&&(t=Sn,Sn=i,t!==null&&Pc(t)),e}function Pc(e){Sn===null?Sn=e:Sn.push.apply(Sn,e)}function Yv(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 Gs(e,t){for(t&=~Ac,t&=~ll,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-dn(t),l=1<<i;e[i]=-1,t&=~l}}function wp(e){if((Qe&6)!==0)throw Error(r(327));Kr();var t=sr(e,0);if((t&1)===0)return Tn(e,St()),null;var i=pl(e,t);if(e.tag!==0&&i===2){var l=pi(e);l!==0&&(t=l,i=Lc(e,l))}if(i===1)throw i=Ui,hr(e,0),Gs(e,t),Tn(e,St()),i;if(i===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mr(e,Sn,bs),Tn(e,St()),null}function Oc(e,t){var i=Qe;Qe|=1;try{return e(t)}finally{Qe=i,Qe===0&&(qr=St()+500,Fo&&$s())}}function pr(e){Hs!==null&&Hs.tag===0&&(Qe&6)===0&&Kr();var t=Qe;Qe|=1;var i=Un.transition,l=Ye;try{if(Un.transition=null,Ye=1,e)return e()}finally{Ye=l,Un.transition=i,Qe=t,(Qe&6)===0&&$s()}}function zc(){Rn=Gr.current,pt(Gr)}function hr(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,Nv(i)),Pt!==null)for(i=Pt.return;i!==null;){var l=i;switch(qa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&zo();break;case 3:Wr(),pt(xn),pt(rn),oc();break;case 5:rc(l);break;case 4:Wr();break;case 13:pt(Nt);break;case 19:pt(Nt);break;case 10:Ja(l.type._context);break;case 22:case 23:zc()}i=i.return}if(Vt=e,Pt=e=qs(e.current,null),Jt=Rn=t,Ut=0,Ui=null,Ac=ll=fr=0,Sn=Bi=null,cr!==null){for(t=0;t<cr.length;t++)if(i=cr[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}cr=null}return e}function kp(e,t){do{var i=Pt;try{if(Za(),Xo.current=el,Qo){for(var l=Ct.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}Qo=!1}if(dr=0,Ht=Ft=Ct=null,Li=!1,Pi=0,Rc.current=null,i===null||i.return===null){Ut=1,Ui=t,Pt=null;break}e:{var p=e,v=i.return,C=i,_=t;if(t=Jt,C.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){var U=_,Z=C,ee=Z.tag;if((Z.mode&1)===0&&(ee===0||ee===11||ee===15)){var X=Z.alternate;X?(Z.updateQueue=X.updateQueue,Z.memoizedState=X.memoizedState,Z.lanes=X.lanes):(Z.updateQueue=null,Z.memoizedState=null)}var de=Gf(v);if(de!==null){de.flags&=-257,qf(de,v,C,p,t),de.mode&1&&Vf(p,U,t),t=de,_=U;var pe=t.updateQueue;if(pe===null){var ve=new Set;ve.add(_),t.updateQueue=ve}else pe.add(_);break e}else{if((t&1)===0){Vf(p,U,t),$c();break e}_=Error(r(426))}}else if(ht&&C.mode&1){var Mt=Gf(v);if(Mt!==null){(Mt.flags&65536)===0&&(Mt.flags|=256),qf(Mt,v,C,p,t),Xa(Hr(_,C));break e}}p=_=Hr(_,C),Ut!==4&&(Ut=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 $=Wf(p,_,t);gf(p,$);break e;case 1:C=_;var A=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Ws===null||!Ws.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var re=Hf(p,C,t);gf(p,re);break e}}p=p.return}while(p!==null)}bp(i)}catch(Se){t=Se,Pt===i&&i!==null&&(Pt=i=i.return);continue}break}while(!0)}function Sp(){var e=ol.current;return ol.current=el,e===null?el:e}function $c(){(Ut===0||Ut===3||Ut===2)&&(Ut=4),Vt===null||(fr&268435455)===0&&(ll&268435455)===0||Gs(Vt,Jt)}function pl(e,t){var i=Qe;Qe|=2;var l=Sp();(Vt!==e||Jt!==t)&&(bs=null,hr(e,t));do try{Xv();break}catch(d){kp(e,d)}while(!0);if(Za(),Qe=i,ol.current=l,Pt!==null)throw Error(r(261));return Vt=null,Jt=0,Ut}function Xv(){for(;Pt!==null;)Tp(Pt)}function Qv(){for(;Pt!==null&&!va();)Tp(Pt)}function Tp(e){var t=Ep(e.alternate,e,Rn);e.memoizedProps=e.pendingProps,t===null?bp(e):Pt=t,Rc.current=null}function bp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=Wv(i,t,Rn),i!==null){Pt=i;return}}else{if(i=Hv(i,t),i!==null){i.flags&=32767,Pt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ut=6,Pt=null;return}}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Ut===0&&(Ut=5)}function mr(e,t,i){var l=Ye,d=Un.transition;try{Un.transition=null,Ye=1,Zv(e,t,i,l)}finally{Un.transition=d,Ye=l}return null}function Zv(e,t,i,l){do Kr();while(Hs!==null);if((Qe&6)!==0)throw Error(r(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(r(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(So(e,p),e===Vt&&(Pt=Vt=null,Jt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||cl||(cl=!0,_p(Tr,function(){return Kr(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Un.transition,Un.transition=null;var v=Ye;Ye=1;var C=Qe;Qe|=4,Rc.current=null,Gv(e,i),hp(i,e),yv($a),bo=!!za,$a=za=null,e.current=i,qv(i),ya(),Qe=C,Ye=v,Un.transition=p}else e.current=i;if(cl&&(cl=!1,Hs=e,ul=d),p=e.pendingLanes,p===0&&(Ws=null),br(i.stateNode),Tn(e,St()),t!==null)for(l=e.onRecoverableError,i=0;i<t.length;i++)d=t[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(al)throw al=!1,e=Dc,Dc=null,e;return(ul&1)!==0&&e.tag!==0&&Kr(),p=e.pendingLanes,(p&1)!==0?e===Mc?Wi++:(Wi=0,Mc=e):Wi=0,$s(),null}function Kr(){if(Hs!==null){var e=se(ul),t=Un.transition,i=Ye;try{if(Un.transition=null,Ye=16>e?16:e,Hs===null)var l=!1;else{if(e=Hs,Hs=null,ul=0,(Qe&6)!==0)throw Error(r(331));var d=Qe;for(Qe|=4,fe=e.current;fe!==null;){var p=fe,v=p.child;if((fe.flags&16)!==0){var C=p.deletions;if(C!==null){for(var _=0;_<C.length;_++){var U=C[_];for(fe=U;fe!==null;){var Z=fe;switch(Z.tag){case 0:case 11:case 15:Fi(8,Z,p)}var ee=Z.child;if(ee!==null)ee.return=Z,fe=ee;else for(;fe!==null;){Z=fe;var X=Z.sibling,de=Z.return;if(cp(Z),Z===U){fe=null;break}if(X!==null){X.return=de,fe=X;break}fe=de}}}var pe=p.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var Mt=ve.sibling;ve.sibling=null,ve=Mt}while(ve!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&v!==null)v.return=p,fe=v;else e:for(;fe!==null;){if(p=fe,(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,fe=$;break e}fe=p.return}}var A=e.current;for(fe=A;fe!==null;){v=fe;var F=v.child;if((v.subtreeFlags&2064)!==0&&F!==null)F.return=v,fe=F;else e:for(v=A;fe!==null;){if(C=fe,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:il(9,C)}}catch(Se){Et(C,C.return,Se)}if(C===v){fe=null;break e}var re=C.sibling;if(re!==null){re.return=C.return,fe=re;break e}fe=C.return}}if(Qe=d,$s(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(er,e)}catch{}l=!0}return l}finally{Ye=i,Un.transition=t}}return!1}function Np(e,t,i){t=Hr(i,t),t=Wf(e,t,1),e=Us(e,t,1),t=hn(),e!==null&&(rr(e,1,t),Tn(e,t))}function Et(e,t,i){if(e.tag===3)Np(e,e,i);else for(;t!==null;){if(t.tag===3){Np(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ws===null||!Ws.has(l))){e=Hr(i,e),e=Hf(t,e,1),t=Us(t,e,1),e=hn(),t!==null&&(rr(t,1,e),Tn(t,e));break}}t=t.return}}function Jv(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=hn(),e.pingedLanes|=e.suspendedLanes&i,Vt===e&&(Jt&i)===i&&(Ut===4||Ut===3&&(Jt&130023424)===Jt&&500>St()-Ic?hr(e,0):Ac|=i),Tn(e,t)}function Cp(e,t){t===0&&((e.mode&1)===0?t=1:(t=Cr,Cr<<=1,(Cr&130023424)===0&&(Cr=4194304)));var i=hn();e=ks(e,t),e!==null&&(rr(e,t,i),Tn(e,i))}function ey(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Cp(e,i)}function ty(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(r(314))}l!==null&&l.delete(t),Cp(e,i)}var Ep;Ep=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)kn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return kn=!1,Bv(e,t,i);kn=(e.flags&131072)!==0}else kn=!1,ht&&(t.flags&1048576)!==0&&of(t,Bo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;sl(e,t),e=t.pendingProps;var d=Pr(t,rn.current);Br(t,i),d=cc(null,t,l,e,d,i);var p=uc();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,wn(l)?(p=!0,$o(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,nc(t),d.updater=tl,t.stateNode=d,d._reactInternals=t,gc(t,l,e,i),t=wc(null,t,l,!0,p,i)):(t.tag=0,ht&&p&&Ga(t),pn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(sl(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=sy(l),e=Qn(l,e),d){case 0:t=xc(null,t,l,e,i);break e;case 1:t=Jf(null,t,l,e,i);break e;case 11:t=Kf(null,t,l,e,i);break e;case 14:t=Yf(null,t,l,Qn(l.type,e),i);break e}throw Error(r(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),xc(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Jf(e,t,l,d,i);case 3:e:{if(ep(t),e===null)throw Error(r(387));l=t.pendingProps,p=t.memoizedState,d=p.element,mf(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=Hr(Error(r(423)),t),t=tp(e,t,l,i,d);break e}else if(l!==d){d=Hr(Error(r(424)),t),t=tp(e,t,l,i,d);break e}else for(jn=Ps(t.stateNode.containerInfo.firstChild),_n=t,ht=!0,Xn=null,i=pf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if($r(),l===d){t=Ts(e,t,i);break e}pn(e,t,l,i)}t=t.child}return t;case 5:return yf(t),e===null&&Ya(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,v=d.children,Fa(l,d)?v=null:p!==null&&Fa(l,p)&&(t.flags|=32),Zf(e,t),pn(e,t,v,i),t.child;case 6:return e===null&&Ya(t),null;case 13:return np(e,t,i);case 4:return sc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fr(t,null,l,i):pn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),Kf(e,t,l,d,i);case 7:return pn(e,t,t.pendingProps,i),t.child;case 8:return pn(e,t,t.pendingProps.children,i),t.child;case 12:return pn(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,ut(Vo,l._currentValue),l._currentValue=v,p!==null)if(Yn(p.value,v)){if(p.children===d.children&&!xn.current){t=Ts(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var C=p.dependencies;if(C!==null){v=p.child;for(var _=C.firstContext;_!==null;){if(_.context===l){if(p.tag===1){_=Ss(-1,i&-i),_.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var Z=U.pending;Z===null?_.next=_:(_.next=Z.next,Z.next=_),U.pending=_}}p.lanes|=i,_=p.alternate,_!==null&&(_.lanes|=i),ec(p.return,i,t),C.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(r(341));v.lanes|=i,C=v.alternate,C!==null&&(C.lanes|=i),ec(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}pn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,Br(t,i),d=$n(d),l=l(d),t.flags|=1,pn(e,t,l,i),t.child;case 14:return l=t.type,d=Qn(l,t.pendingProps),d=Qn(l.type,d),Yf(e,t,l,d,i);case 15:return Xf(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:Qn(l,d),sl(e,t),t.tag=1,wn(l)?(e=!0,$o(t)):e=!1,Br(t,i),Uf(t,l,d),gc(t,l,d,i),wc(null,t,l,!0,e,i);case 19:return rp(e,t,i);case 22:return Qf(e,t,i)}throw Error(r(156,t.tag))};function _p(e,t){return fi(e,t)}function ny(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 Bn(e,t,i,l){return new ny(e,t,i,l)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sy(e){if(typeof e=="function")return Fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Te)return 11;if(e===Q)return 14}return 2}function qs(e,t){var i=e.alternate;return i===null?(i=Bn(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")Fc(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case K:return gr(i.children,d,p,t);case G:v=8,d|=8;break;case oe:return e=Bn(12,i,t,d|2),e.elementType=oe,e.lanes=p,e;case Ne:return e=Bn(13,i,t,d),e.elementType=Ne,e.lanes=p,e;case Fe:return e=Bn(19,i,t,d),e.elementType=Fe,e.lanes=p,e;case ae:return ml(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:v=10;break e;case ie:v=9;break e;case Te:v=11;break e;case Q:v=14;break e;case ne:v=16,l=null;break e}throw Error(r(130,e==null?e:typeof e,""))}return t=Bn(v,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function gr(e,t,i,l){return e=Bn(7,e,l,t),e.lanes=i,e}function ml(e,t,i,l){return e=Bn(22,e,l,t),e.elementType=ae,e.lanes=i,e.stateNode={isHidden:!1},e}function Uc(e,t,i){return e=Bn(6,e,null,t),e.lanes=i,e}function Bc(e,t,i){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ry(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 Wc(e,t,i,l,d,p,v,C,_){return e=new ry(e,t,i,C,_),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Bn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},nc(p),e}function iy(e,t,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:l==null?null:""+l,children:e,containerInfo:t,implementation:i}}function jp(e){if(!e)return zs;e=e._reactInternals;e:{if(rt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(wn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var i=e.type;if(wn(i))return nf(e,i,t)}return t}function Rp(e,t,i,l,d,p,v,C,_){return e=Wc(i,l,!0,e,d,p,v,C,_),e.context=jp(null),i=e.current,l=hn(),d=Vs(i),p=Ss(l,d),p.callback=t??null,Us(i,p,d),e.current.lanes=d,rr(e,d,l),Tn(e,l),e}function gl(e,t,i,l){var d=t.current,p=hn(),v=Vs(d);return i=jp(i),t.context===null?t.context=i:t.pendingContext=i,t=Ss(p,v),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Us(d,t,v),e!==null&&(es(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 Ap(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Hc(e,t){Ap(e,t),(e=e.alternate)&&Ap(e,t)}function oy(){return null}var Ip=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vc(e){this._internalRoot=e}yl.prototype.render=Vc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));gl(e,t,null,null)},yl.prototype.unmount=Vc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pr(function(){gl(null,e,null,null)}),t[vs]=null}};function yl(e){this._internalRoot=e}yl.prototype.unstable_scheduleHydration=function(e){if(e){var t=me();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ds.length&&t!==0&&t<Ds[i].priority;i++);Ds.splice(i,0,e),i===0&&vd(e)}};function Gc(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 Dp(){}function ly(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=Rp(t,l,e,0,null,!1,!1,"",Dp);return e._reactRootContainer=v,e[vs]=v.current,Ei(e.nodeType===8?e.parentNode:e),pr(),v}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var C=l;l=function(){var U=vl(_);C.call(U)}}var _=Wc(e,0,!1,null,null,!1,!1,"",Dp);return e._reactRootContainer=_,e[vs]=_.current,Ei(e.nodeType===8?e.parentNode:e),pr(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 C=d;d=function(){var _=vl(v);C.call(_)}}gl(t,v,e,d)}else v=ly(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=nr(t.pendingLanes);i!==0&&(Is(t,i|1),Tn(t,St()),(Qe&6)===0&&(qr=St()+500,$s()))}break;case 13:pr(function(){var l=ks(e,1);if(l!==null){var d=hn();es(l,e,1,d)}}),Hc(e,1)}},z=function(e){if(e.tag===13){var t=ks(e,134217728);if(t!==null){var i=hn();es(t,e,134217728,i)}Hc(e,134217728)}},Y=function(e){if(e.tag===13){var t=Vs(e),i=ks(e,t);if(i!==null){var l=hn();es(i,e,t,l)}Hc(e,t)}},me=function(){return Ye},Ce=function(e,t){var i=Ye;try{return Ye=e,t()}finally{Ye=i}},le=function(e,t,i){switch(t){case"input":if(Wt(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=Oo(l);if(!d)throw Error(r(90));Me(l),Wt(l,d)}}}break;case"textarea":Ue(e,i);break;case"select":t=i.value,t!=null&&$t(e,!!i.multiple,t,!1)}},ot=Oc,tt=pr;var ay={usingClientEntryPoint:!1,Events:[Ri,Mr,Oo,ke,Ve,Oc]},Hi={findFiberByHostInstance:ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},cy={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:D.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Sr(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.findFiberByHostInstance||oy,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{er=kl.inject(cy),Cn=kl}catch{}}return bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ay,bn.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gc(t))throw Error(r(200));return iy(e,t,null,i)},bn.createRoot=function(e,t){if(!Gc(e))throw Error(r(299));var i=!1,l="",d=Ip;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Wc(e,1,!1,null,null,i,!1,l,d),e[vs]=t.current,Ei(e.nodeType===8?e.parentNode:e),new Vc(t)},bn.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(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=Sr(t),e=e===null?null:e.stateNode,e},bn.flushSync=function(e){return pr(e)},bn.hydrate=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!0,i)},bn.hydrateRoot=function(e,t,i){if(!Gc(e))throw Error(r(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",v=Ip;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),t=Rp(t,null,e,1,i??null,d,!1,p,v),e[vs]=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)},bn.render=function(e,t,i){if(!xl(t))throw Error(r(200));return wl(null,e,t,!1,i)},bn.unmountComponentAtNode=function(e){if(!xl(e))throw Error(r(40));return e._reactRootContainer?(pr(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[vs]=null})}),!0):!1},bn.unstable_batchedUpdates=Oc,bn.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!xl(i))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return wl(e,t,i,!1,l)},bn.version="18.3.1-next-f1338f8080-20240426",bn}var Up;function ym(){if(Up)return Yc.exports;Up=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(s){console.error(s)}}return n(),Yc.exports=yy(),Yc.exports}var Bp;function xy(){if(Bp)return Sl;Bp=1;var n=ym();return Sl.createRoot=n.createRoot,Sl.hydrateRoot=n.hydrateRoot,Sl}var wy=xy();const ky=vm(wy),Wp=n=>{let s;const r=new Set,o=(g,x)=>{const w=typeof g=="function"?g(s):g;if(!Object.is(w,s)){const y=s;s=x??(typeof w!="object"||w===null)?w:Object.assign({},s,w),r.forEach(N=>N(s,y))}},a=()=>s,h={setState:o,getState:a,getInitialState:()=>m,subscribe:g=>(r.add(g),()=>r.delete(g))},m=s=n(o,a,h);return h},Sy=(n=>n?Wp(n):Wp),Ty=n=>n;function by(n,s=Ty){const r=at.useSyncExternalStore(n.subscribe,at.useCallback(()=>s(n.getState()),[n,s]),at.useCallback(()=>s(n.getInitialState()),[n,s]));return at.useDebugValue(r),r}const Ny=n=>{const s=Sy(n),r=o=>by(s,o);return Object.assign(r,s),r},Cy=(n=>Ny),xm="agentpane:machines",wm="agentpane:active-machine";function Ey(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function km(n){return`${n}.repoburg.com`}function $u(n){const s=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return s?s[1]:null}function Sm(n,s){try{const r=localStorage.getItem(n);return r==null?s:JSON.parse(r)}catch{return s}}function Tm(n,s){try{localStorage.setItem(n,JSON.stringify(s))}catch{}}function bm(){return Sm(xm,[]).filter(s=>Ey(s.mahlas)&&s.hostname===km(s.mahlas))}function _y(n){const s={mahlas:n,hostname:km(n),lastConnectedAt:new Date().toISOString()},r=bm(),o=[s,...r.filter(a=>a.mahlas!==n)];return Tm(xm,o),s}function jy(){const n=Sm(wm,null);return n?bm().find(s=>s.mahlas===n)??null:null}function Ry(n){Tm(wm,n)}function Ay(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const s=$u(n);s&&(_y(s),Ry(s))}const Hp="http://localhost:9998",Iy=["agent.repoburg.com"];function ps(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),s=n.get("bport");if(s)return`http://localhost:${s}`;const r=n.get("host");if(r)return`https://${r}`;const o=window.location.hostname;if(Iy.includes(o))return Hp;if($u(o))return"";const a=jy();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":Hp}const Dy="/api";async function co(n,s,r){const o=await fetch(`${ps()}${Dy}${s}`,{method:n,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):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} ${s} failed: ${a}`)}return o.json()}function gn(n){return co("GET",n)}function _t(n,s){return co("POST",n,s)}function na(n){return co("DELETE",n)}function hs(n,s){return co("PATCH",n,s)}function My(n,s){return co("PUT",n,s)}function Ly(){return gn("/sessions")}function Tl(n){return gn(`/sessions/${n}`)}function Fu(n){return _t("/sessions",n)}function Vp(n){return na(`/sessions/${n}`)}function Nm(n,s,r){return _t(`/sessions/${n}/turns`,{user_prompt:s,...r!=null&&r.length?{attachments:r}:{}})}function Py(n){return _t(`/sessions/${n}/cancel`)}function Oy(n,s){return hs(`/sessions/${n}`,{title:s})}function Gp(n){return hs(`/sessions/${n}`,{lifecycle:"finished"})}function qp(n){return hs(`/sessions/${n}`,{lifecycle:"working"})}function zy(n,s){return hs(`/sessions/${n}`,{starred:s})}function Kp(n){return hs(`/sessions/${n}`,{has_unreviewed:0})}function $y(n,s,r,o){const a={model:s,model_reasoning_effort:r};return o!==void 0&&(a.runtime_type=o),hs(`/sessions/${n}`,a)}function Fy(n,s){return hs(`/sessions/${n}`,{runtime_config:s})}function Uy(n,s){return _t(`/sessions/${n}/rewind`,{turn_id:s})}function By(n){return _t(`/sessions/${n}/restore`,{})}function Wy(n,s,r){return _t(`/sessions/${n}/branch`,{turn_id:s,title:r})}function Cm(){return gn("/workspaces")}function Hy(n,s){return _t("/workspaces",{path:n,label:s})}function Vy(n){return _t("/workspaces/hide",{path:n})}async function Gy(){const n=await fetch(`${ps()}/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 Em(){return gn("/folders")}function qy(n,s){return _t("/folders",{workspace_path:n,name:s})}function Yp(n,s){return hs(`/folders/${n}`,s)}function Ky(n){return na(`/folders/${n}`)}function Yy(n){return _t("/sessions/reorder",{moves:n})}function oi(n){return n.status==="pending"||n.status==="running"}function _m(n){return!!(n!=null&&n.turns.some(oi))}function sa(n){return n?n.turns.some(oi)||(n.threads??[]).some(s=>(s.turns??[]).some(oi)):!1}async function Xy(n,s){const r=await Promise.allSettled(n.map(u=>s(u))),o=new Map;let a=null;return r.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}}function Xp(n,s){const r={...n.sessionDetails};s.forEach(f=>delete r[f]);const o=n.openTabs.filter(f=>!s.has(f));let a=n.activeSessionId,u=n.activeTurnIndex;if(a&&s.has(a)){a=o.length>0?o[o.length-1]:null;const f=a?r[a]:null;u=f&&f.turns.length>0?f.turns.length-1:0}return{sessions:n.sessions.filter(f=>!s.has(f.id)),sessionDetails:r,openTabs:o,activeSessionId:a,activeTurnIndex:u}}async function Qp(n,s,r,o,a){if(r.length===0)return;n({error:null});const{updated:u,firstError:f}=await Xy(r,o);u.size>0&&n(m=>({sessions:m.sessions.map(g=>u.get(g.id)??g)}));const h=r.length-u.size;if(h===0)s().addToast("info",`${r.length} session${r.length===1?"":"s"} ${a}`);else{n({error:f});const m=a[0].toUpperCase()+a.slice(1);s().addToast(h===r.length?"error":"warn",`${m} ${u.size} of ${r.length} — ${h} failed`)}}const Qy=(n,s)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{var r;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([Ly(),Cm(),Em()]);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:(r=o[0])==null?void 0:r.id;g&&!s().activeSessionId&&await s().selectSession(g),m&&n({activeRightTab:"threads",deepLinkThreadId:m})}catch(o){n({loading:!1,error:o.message})}},selectSession:async r=>{if(s().sessionDetails[r]){const o=s().sessionDetails[r];n({activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",openTabs:s().openTabs.includes(r)?s().openTabs:[...s().openTabs,r]}),o.has_unreviewed===1&&(Kp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeSessionId:r,activeTurnIndex:o.turns.length>0?o.turns.length-1:0,activeRightTab:"turns",loading:!1})),o.has_unreviewed===1&&(Kp(r).catch(()=>{}),n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,has_unreviewed:0}:u),sessionDetails:{...a.sessionDetails,[r]:{...o,has_unreviewed:0}}})))}catch(o){n({loading:!1,error:o.message})}},closeTab:r=>{n(o=>{const a=o.openTabs.filter(u=>u!==r);if(o.activeSessionId===r&&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===r?null:o.activeSessionId}})},updateModelConfig:async(r,o,a)=>{const u=s().activeSessionId;if(u){n({error:null});try{const f=await $y(u,r,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 s().refreshActiveSession()}catch(f){n({error:f.message}),s().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async r=>{n({error:null});try{const o=await Fu(r);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 s().selectSession(o.id),s().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),s().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},deleteSession:async r=>{var a;n({error:null});const o=(a=s().sessions.find(u=>u.id===r))==null?void 0:a.title;try{await Vp(r),n(u=>Xp(u,new Set([r]))),s().addLogEntry("INFO",`Session deleted — ${r.slice(0,8)}`),s().addToast("info",`Session "${o||r.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),s().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(r,o)=>{n({error:null});try{const a=await Oy(r,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async r=>{n({error:null});try{const o=await Gp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),s().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async r=>{await Qp(n,s,r,Gp,"marked as finished")},toggleStar:async r=>{const o=s().sessions.find(a=>a.id===r);if(o){n({error:null});try{const a=await zy(r,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===r?a:f),sessionDetails:u.sessionDetails[r]?{...u.sessionDetails,[r]:{...u.sessionDetails[r],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),s().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async r=>{n({error:null});try{const o=await qp(r);n(a=>({sessions:a.sessions.map(u=>u.id===r?o:u)})),s().addToast("info","Session reopened")}catch(o){n({error:o.message}),s().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async r=>{await Qp(n,s,r,qp,"reopened")},deleteSessionMany:async r=>{if(r.length===0)return;n({error:null});const o=await Promise.allSettled(r.map(f=>Vp(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(r[h])}),a.size===0){n({error:"Failed to delete sessions"}),s().addToast("error","Failed to delete sessions");return}n(f=>Xp(f,a)),s().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=r.length-a.size;u===0?s().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),s().addToast("warn",`Deleted ${a.size} of ${r.length} — ${u} failed`))},submitPrompt:async(r,o)=>{const a=s().activeSessionId;if(a){n({error:null,submittingPrompt:r}),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 Nm(a,r,o);s().addLogEntry("INFO",`Turn submitted — "${r.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}),s().addLogEntry("ERROR",`Turn failed — ${u.message}`),s().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const m=sa(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 r=s().activeSessionId;if(r)try{await Py(r)}catch(o){n({error:o.message})}},rewindToTurn:async(r,o)=>{n({error:null});try{const a=await Uy(r,o),u=await Tl(r);n(f=>({sessionDetails:{...f.sessionDetails,[r]:u},sessions:f.sessions.map(h=>h.id===r?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),s().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),s().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async r=>{n({error:null});try{const o=await By(r),a=await Tl(r);n(u=>({sessionDetails:{...u.sessionDetails,[r]:a},sessions:u.sessions.map(f=>f.id===r?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),s().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),s().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(r,o,a)=>{n({error:null});try{const u=await Wy(r,o,a);n(f=>({sessions:[u,...f.sessions]})),await s().selectSession(u.id),s().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),s().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async r=>{const o=s().activeSessionId;if(o){n({error:null});try{const a=await Fy(o,JSON.stringify(r));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}),s().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const r=s().activeSessionId;if(r)try{const o=await Tl(r);n(a=>({sessionDetails:{...a.sessionDetails,[r]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===r?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),Zy=(n,s)=>({workspaces:[],addWorkspace:async r=>{n({error:null});try{const o=await Hy(r.trim());n(a=>({workspaces:[...a.workspaces,o]})),s().addToast("success",`Workspace added — ${o.path}`)}catch(o){s().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async r=>{n({error:null});try{await Vy(r);const o=await Cm();n({workspaces:o}),s().addToast("info","Workspace hidden")}catch(o){s().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async r=>{n({error:null});try{const o=s().lastModelConfig,a=await Fu({cwd:r,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await s().selectSession(a.id),s().addLogEntry("INFO",`Session created in ${r} — ${a.id.slice(0,8)}`),s().addToast("success",`Session created in ${r.split("/").pop()||r}`)}catch(o){n({error:o.message}),s().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const r=await Gy();if(r.cancelled||!r.path)return;await s().addWorkspace(r.path)}catch(r){s().addToast("error",`Failed to pick directory — ${r.message}`)}}}),wr=new Map,Uu=new Map,Bu=new Map,Wu=new Map;function Jy(n,s){wr.set(n,s)}function ex(n){wr.delete(n)}function Zc(n,s){Uu.set(n,s)}function Zp(n,s,r){const o=Uu.get(n);if(!o)return;const a=wr.get(o);a&&a({source:"agentpane-host",event:s,payload:r})}function tx(n,s,r,o){const a=wr.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:s,tool:r,name:r,args:o}})}function nx(n,s,r,o){const a=Uu.get(n);if(!a)return;const u=wr.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:s,itemId:r,delta:o}})}function sx(n,s){Bu.set(n,s)}function rx(n){Bu.delete(n)}function ix(n,s){Wu.set(n,s)}function ox(n){Wu.delete(n)}function lx(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"state_changed",payload:{}}),(r=Wu.get(n))==null||r()}function ax(n){var r;const s=wr.get(n);s&&s({source:"agentpane-host",event:"source:updated",payload:{}}),(r=Bu.get(n))==null||r()}const cx=(n,s)=>({wsConnected:!1,setWsConnected:r=>n({wsConnected:r}),onTurnStarted:(r,o)=>{s().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=a.sessionDetails[r];if(!u)return{};const f=u.turns.findIndex(h=>h.id===o);return{sessionDetails:{...a.sessionDetails,[r]:{...Ns(u,o,h=>({...h,status:"running"})),is_running:1,status:"running"}},sessions:a.sessions.map(h=>h.id===r?{...h,is_running:1,status:"running"}:h),activeTurnIndex:a.activeSessionId===r&&f>=0?f:a.activeTurnIndex}})},onItemStarted:(r,o,a)=>{s().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>eu(h,a))}}:{}})},onItemUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>eu(h,a))}}:{}})},onItemCompleted:(r,o,a)=>{if(s().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"?s().addToast("success",`${g} completed: ${h}`):s().addToast("error",`${g} failed: ${h}`)}n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>{var g,x;let m=eu(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:(r,o,a,u)=>{nx(r,o,a,u),n(f=>{const h=f.sessionDetails[r];return h?{sessionDetails:{...f.sessionDetails,[r]:Ns(h,o,m=>ux(m,a,u))}}:{}})},onTurnCompleted:(r,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,m=(a==null?void 0:a.output_tokens)??0;s().addLogEntry("INFO",`turn:completed — ${h} in / ${m} out`),Zp(r,"turn:completed",{turnId:o,response:f??null}),s().refreshApps(),n(g=>{const x=g.sessionDetails[r];if(!x)return{};const w=Ns(x,o,N=>({...N,status:"completed",token_usage:a??N.token_usage??null,...f&&!N.agent_response?{agent_response:f}:{}})),y=Jc(w);return{sessionDetails:{...g.sessionDetails,[r]:{...w,is_running:y,status:y?"running":"active",has_unreviewed:u?1:x.has_unreviewed}},sessions:g.sessions.map(N=>N.id===r?{...N,is_running:y,status:y?"running":"active",has_unreviewed:u?1:N.has_unreviewed}:N)}})},onTokenUsageUpdated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:Ns(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(r,o,a)=>{s().addLogEntry("ERROR",`turn:failed — ${a}`),s().addToast("error",`Turn failed — ${a}`),Zp(r,"turn:failed",{turnId:o,error:a}),n(u=>{const f=u.sessionDetails[r];if(!f)return{};const h=a.includes("cancelled")||a.includes("aborted"),m=h?"aborted":"failed",g=Ns(f,o,y=>({...y,status:m,error:a,items:y.items.map(N=>N.status==="in_progress"?{...N,status:"failed"}:N)})),x=Jc(g),w=x?"running":h?"active":"failed";return{sessionDetails:{...u.sessionDetails,[r]:{...g,is_running:x,status:w}},sessions:u.sessions.map(y=>y.id===r?{...y,is_running:x,status:w}:y)}})},onTurnCancelled:(r,o)=>{n(a=>{const u=a.sessionDetails[r];if(!u)return{};const f=Ns(u,o,m=>({...m,status:"aborted",items:m.items.map(g=>g.status==="in_progress"?{...g,status:"completed"}:g)})),h=Jc(f);return{sessionDetails:{...a.sessionDetails,[r]:{...f,is_running:h,status:h?"running":"active"}},sessions:a.sessions.map(m=>m.id===r?{...m,is_running:h,status:h?"running":"active"}:m)}})},onSessionTitle:(r,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===r?{...u,title:o}:u),sessionDetails:a.sessionDetails[r]?{...a.sessionDetails,[r]:{...a.sessionDetails[r],title:o}}:a.sessionDetails}))},onBackgroundTasksChanged:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,backgroundTasks:o}}}:{}})}});function Jc(n){return n.turns.some(oi)||(n.threads??[]).some(r=>(r.turns??[]).some(oi))?1:0}function Ns(n,s,r){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===s)?{...a,turns:(a.turns??[]).map(u=>u.id===s?r(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===s?r(a):a),threads:o}}function eu(n,s){const r=n.items.findIndex(o=>o.external_item_id===s.external_item_id);if(r>=0){const o=[...n.items];return o[r]=s,{...n,items:o}}if(s.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,s]}}return{...n,items:[...n.items,s]}}function ux(n,s,r){var u;const o=n.items.findIndex(f=>f.external_item_id===s);if(o>=0){const f=n.items[o],m=(((u=f.data)==null?void 0:u.text)??"")+r,g=[...n.items];return g[o]={...f,data:{...f.data,text:m}},{...n,items:g,agent_response:m}}const a={id:`delta-${s}`,turn_id:n.id,external_item_id:s,type:"agent_message",data:{text:r},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:r}}function dx(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return gn(`/providers/${n}/models${r}`)}const vu=160,yu=480,fx=240,Ol=220,px=300,hx=600;function zl(){return typeof window>"u"?hx:Math.max(Ol,Math.round(window.innerWidth*.7))}const Jp="agentpane:sidebar-width",eh="agentpane:right-panel-width";function th(n,s,r,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(r,Math.max(s,u)):o}catch{return o}}const nh=200,mx=(n,s)=>({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:th(Jp,vu,yu,fx),rightPanelWidth:th(eh,Ol,zl(),px),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,setActiveTurnIndex:r=>n({activeTurnIndex:r}),switchRightTab:r=>n({activeRightTab:r}),setChangesScope:r=>n({changesScope:r}),setShowNewSessionDialog:r=>n({showNewSessionDialog:r}),setShowRemoteModal:r=>n({showRemoteModal:r}),setShowCommandPalette:r=>n({showCommandPalette:r}),setShowModelSelector:r=>n({showModelSelector:r}),setSelectedChangePath:r=>n({selectedChangePath:r}),setDeepLinkThreadId:r=>n({deepLinkThreadId:r}),setSidebarWidth:r=>{const o=Math.min(yu,Math.max(vu,Math.round(r)));n({sidebarWidth:o});try{localStorage.setItem(Jp,String(o))}catch{}},setRightPanelWidth:r=>{const o=Math.min(zl(),Math.max(Ol,Math.round(r)));n({rightPanelWidth:o});try{localStorage.setItem(eh,String(o))}catch{}},toggleVscodeView:()=>{if(s().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(r,o,a)=>n({vscodeState:r,vscodeId:o,vscodeToken:a}),addToast:(r,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:r,message:o,undoAction:a,undoLabel:u}]}))},removeToast:r=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==r)}))},addLogEntry:(r,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:r,message:o}];return f.length>nh&&f.splice(0,f.length-nh),{eventLog:f}})},loadModels:async(r,o)=>{if(!s().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await dx(r,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),gx=(n,s)=>({createThread:async(r,o)=>{try{await _t(`/sessions/${r}/threads`,o),s().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){s().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(r,o,a)=>{try{await _t(`/sessions/${r}/threads/${o}/followup`,{message:a}),s().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){s().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(r,o)=>{try{await _t(`/sessions/${r}/cancel?threadId=${encodeURIComponent(o)}`),s().addLogEntry("INFO","Thread turn cancelled")}catch(a){s().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(r,o)=>{try{await hs(`/sessions/${r}/threads/${o}`,{status:"resolved"})}catch(a){s().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(r,o)=>{try{await hs(`/sessions/${r}/threads/${o}`,{status:"open"})}catch(a){s().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(r,o,a)=>{try{const u=await _t(`/sessions/${r}/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}),s().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),s().addToast("success","Thread summary added to your input"),!0}catch(u){return s().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(r,o)=>{try{await na(`/sessions/${r}/threads/${o}`)}catch(a){s().addToast("error",`Failed to delete thread — ${a.message}`)}},onThreadCreated:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];return f?{sessionDetails:{...u.sessionDetails,[r]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(r,o,a)=>{n(u=>{const f=u.sessionDetails[r];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,[r]:{...f,threads:h}}}})},onThreadDeleted:(r,o)=>{n(a=>{const u=a.sessionDetails[r];return u?{sessionDetails:{...a.sessionDetails,[r]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),vx=(n,s)=>({folders:[],loadFolders:async()=>{const r=await Em();n({folders:r})},createSidebarFolder:async(r,o)=>{try{const a=await qy(r,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return s().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(r,o)=>{try{const a=await Yp(r,{name:o});n(u=>({folders:u.folders.map(f=>f.id===r?a:f)}))}catch(a){s().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async r=>{const o=s().folders,a=s().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==r),sessions:u.sessions.map(f=>f.folder_id===r?{...f,folder_id:null}:f)}));try{await Ky(r)}catch(u){n({folders:o,sessions:a}),s().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async r=>{if(r.length===0)return;const o=s().sessions,a=new Map(r.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 Yy(r)}catch(u){n({sessions:o}),s().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async r=>{const o=s().folders,a=new Map(r.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(r.map((u,f)=>Yp(u,{sort_order:f})))}catch(u){n({folders:o}),s().addToast("error",`Failed to save folder order — ${u.message}`)}}});function sh(){return gn("/apps")}function yx(){return gn("/apps/root")}function rh(n){return gn(`/apps/${n}/source`)}function ih(n,s=""){return gn(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`)}function jm(n,s,r=""){return My(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`,s)}function xx(n){return na(`/apps/${n}`)}function wx(n){return gn(`/apps/${n}/sessions`)}function kx(){return gn("/apps/examples")}function Sx(n){return _t(`/apps/examples/${n}/install`,{})}function Tx(n){return _t("/apps",n)}function bx(n,s){return _t("/apps/import",{id:n,files:s})}function Nx(n,s,r){return _t(`/apps/mcp/calls/${n}/result`,{result:s,error:null})}function Cx(n,s){return _t(`/apps/${n}/edit-session`,s)}const Il=new Set;async function tu(n,s){Il.add(s),await n().loadApps();const r=n().apps.find(o=>o.id===s);n().openAppTab(s),n().addToast("success",`Mini app added: ${(r==null?void 0:r.title)??s}`)}const xu="agentpane:app-workspaces";function Ex(){try{const n=JSON.parse(localStorage.getItem(xu)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const _x=(n,s)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:Ex(),loadApps:async()=>{try{const[r,o]=await Promise.all([sh(),yx().catch(()=>null)]);r.forEach(a=>Il.add(a.id)),n(o?{apps:r,appsRootPath:o.root}:{apps:r})}catch{}},refreshApps:async()=>{try{const r=await sh();for(const o of r)Il.has(o.id)||(Il.add(o.id),s().addToast("success",`New mini app discovered: ${o.title}`));n({apps:r})}catch{}},openAppTab:r=>{n(o=>({activeAppTabId:r,openAppTabs:o.openAppTabs.includes(r)?o.openAppTabs:[...o.openAppTabs,r]}))},closeAppTab:r=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==r);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===r?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:r=>n({activeAppTabId:r}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(r,o)=>{n(a=>{const u={...a.appWorkspaces,[r]:o};try{localStorage.setItem(xu,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async r=>{try{return await Sx(r),await tu(s,r),!0}catch(o){return s().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async r=>{try{return await Tx(r),await tu(s,r.id),!0}catch(o){return s().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(r,o)=>{try{return await bx(r,o),await tu(s,r),!0}catch(a){return s().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async r=>{try{const o=s().lastModelConfig,a=await Cx(r,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});s().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await s().selectSession(a.id),n(u=>({openTabs:u.openTabs.includes(a.id)?u.openTabs:[...u.openTabs,a.id]})),s().addLogEntry("INFO",`App edit session opened for ${r}`)}catch(o){s().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async r=>{const o=s().apps.find(a=>a.id===r);if(o)try{await jm(r,{pinned:!o.pinned}),await s().loadApps()}catch(a){s().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async r=>{try{await xx(r),n(o=>{const a={...o.appWorkspaces};delete a[r];try{localStorage.setItem(xu,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==r),openAppTabs:o.openAppTabs.filter(u=>u!==r),activeAppTabId:o.activeAppTabId===r?null:o.activeAppTabId,appWorkspaces:a}}),s().addToast("success",`Mini app deleted: ${r}`)}catch(o){s().addToast("error",`Failed to delete app — ${o.message}`)}}}),oh=3e3,In={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Dn=[];let $l=0,Hu=0,Fl=0,Vu=0,Ul=0,Gu=0,qu=0;const ro=new Map,io=new Map;let ti=new Map,Jr=0,ni=new Map,nu=!1;function Bl(n,s,r){if(Dn.push({t:Date.now(),cat:n,msg:s,ms:r}),Dn.length>oh){const o=Dn.length-oh;Dn.splice(0,o),Nn=Math.max(0,Nn-o)}}function ei(n,s,r){Bl(n,s,r),console.log(`[perf:${n}] ${s}`)}function Rm(n){ei("note",n)}function Am(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function jx(n,s){let r=ti.get(n);r||ti.set(n,r={n:0,bytes:0}),r.n++,r.bytes+=s;let o=ro.get(n);o||ro.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=s}function Rx(){Jr++,qu++}function Ax(n){ni.set(n,(ni.get(n)??0)+1),io.set(n,(io.get(n)??0)+1)}let Dl=0;function Ix(){Dl=performance.now()}function Dx(){const n=performance.now(),s=Dl?n-Dl:null;Dl=0,requestAnimationFrame(()=>{if(s===null)return;const r=performance.now()-n+s;r>In.keypressMs&&ei("input",`keystroke→paint ${Math.round(r)}ms (keydown→change ${Math.round(s)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const Mx=5e3,Im=500,lh=2e3;let Nn=0,su=!1;function Lx(n){return _t("/perf-log",{entries:n}).then(()=>{Nn+=n.length})}function Px(){if(su||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Im);n.length!==0&&(su=!0,Lx(n).catch(()=>{Dn.length-Nn>lh&&(Nn=Math.max(Nn,Dn.length-lh))}).finally(()=>{su=!1}))}function ah(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||Nn>=Dn.length)return;const n=Dn.slice(Nn,Nn+Im);if(n.length!==0)try{const s=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${ps()}/api/perf-log`,s),Nn+=n.length}catch{}}function Ox(){let n=0;for(const o of ti.values())n+=o.n;const s=[];if(n>0){const o=[...ti.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${Am(u.bytes)})`).join(", ");s.push(`ws ${n}/s [${o}]`)}Jr>0&&s.push(`store ${Jr}/s`);const r=[...ni.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(r.length>0&&s.push(`renders ${r.join(" ")}`),s.length>0){const o=s.join(" · ");Bl("stat",o);const a=[...ni.values()].some(u=>u>In.renderPerSecLog);(n>In.wsPerSecLog||Jr>In.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}ti=new Map,Jr=0,ni=new Map}function zx(n){if(n instanceof Element){const s=n.id?`#${n.id}`:"",r=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${s}${r}`}return n?"window":"unknown"}function $x(){if(nu||typeof window>"u")return()=>{};nu=!0,$l=Date.now();const n=[];let s=performance.now()+250;const r=window.setInterval(()=>{const u=performance.now(),f=u-s;s=u+250,f>In.lagMs&&(Hu++,Fl=Math.max(Fl,f),ei("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(r)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=m=>{const g=m-u;u=m,g>In.frameGapMs&&ei("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<In.longtaskBufferMs)continue;Vu++,Ul=Math.max(Ul,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>=In.longtaskLogMs?ei("longtask",y,g):Bl("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;Gu++;const x=`${h.name} ${Math.round(m)}ms (input delay ${Math.round(g)}ms) on ${zx(h.target)}`;m>=In.eventLogMs?ei("input",x,m):Bl("input",x,m)}});u.observe({type:"event",durationThreshold:In.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(Ox,1e3);n.push(()=>window.clearInterval(o)),Rm("perf logger session started");const a=window.setInterval(Px,Mx);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",ah),n.push(()=>window.removeEventListener("beforeunload",ah)),window.__agentPanePerf={dump:Dm,reset:Mm},()=>{n.forEach(u=>u()),nu=!1}}function Dm(){const n=[],s=$l?Math.round((Date.now()-$l)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${s}s · ${Dn.length} buffered entries`),n.push(`event-loop lag: ${Hu} blocks >${In.lagMs}ms (max ${Math.round(Fl)}ms)`),n.push(`long tasks: ${Vu} ≥${In.longtaskBufferMs}ms (max ${Math.round(Ul)}ms)`),n.push(`slow input events (≥${In.eventBufferMs}ms): ${Gu}`),n.push(`store updates: ${qu} total`),ro.size>0){n.push("ws messages by type (top 15):");for(const[r,o]of[...ro.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${r}: ${o.n} msgs, ${Am(o.bytes)}`)}if(io.size>0){n.push("render counts by component:");for(const[r,o]of[...io.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${r}: ${o}`)}n.push("--- last 200 entries ---");for(const r of Dn.slice(-200))n.push(`${new Date(r.t).toISOString().slice(11,23)} [${r.cat}] ${r.msg}`);return n.join(`
|
|
49
|
+
`)}function Mm(){Dn.length=0,Nn=0,$l=Date.now(),Hu=0,Fl=0,Vu=0,Ul=0,Gu=0,qu=0,ro.clear(),io.clear(),ti=new Map,Jr=0,ni=new Map}const tn={start:$x,note:Rm,trackWsEvent:jx,trackStoreUpdate:Rx,trackRender:Ax,markKeystroke:Ix,markInputChange:Dx,dump:Dm,reset:Mm},P=Cy()((...n)=>({...Qy(...n),...Zy(...n),...cx(...n),...mx(...n),...gx(...n),...vx(...n),..._x(...n)}));typeof window<"u"&&P.subscribe(()=>tn.trackStoreUpdate());function wu(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 Fx(n,s){const r=new Date(n).getTime(),o=s?new Date(s).getTime():Date.now(),a=Math.max(0,Math.floor((o-r)/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 Ux(n,s,r=!1,o="working"){if(o==="finished")return"";if(s)return"running";if(r&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function Bx(n,s,r=!1,o="working"){if(o==="finished")return"Finished";if(s)return"Running";if(r&&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 ra(n){const s=n.is_running===1,r=n.lifecycle==="finished",o=wu(n.runtime_type);return{dot:Ux(n.status,s,n.has_unreviewed===1,n.lifecycle),label:Bx(n.status,s,n.has_unreviewed===1,n.lifecycle),iconClass:o.iconClass,iconText:o.iconText,isRunning:s,isFinished:r}}function ia(n,s,r=!0){k.useEffect(()=>{if(!r)return;function o(a){n.current&&!n.current.contains(a.target)&&s()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,s,r])}function Ku(n,s=!0){k.useEffect(()=>{if(!s)return;function r(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n,s])}function oa({status:n,size:s=6}){return c.jsx("span",{className:`status-dot ${n}`,style:s!==6?{width:s,height:s}:void 0})}function Yu({iconClass:n,iconText:s,size:r=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:r!==20?{width:r,height:r,fontSize:r*.45}:void 0,children:s})}/**
|
|
50
|
+
* @license lucide-react v0.469.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const Wx=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Lm=(...n)=>n.filter((s,r,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===r).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v0.469.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var Hx={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 Vx=k.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},m)=>k.createElement("svg",{ref:m,...Hx,width:s,height:s,stroke:n,strokeWidth:o?Number(r)*24/Number(s):r,className:Lm("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 Ee=(n,s)=>{const r=k.forwardRef(({className:o,...a},u)=>k.createElement(Vx,{ref:u,iconNode:s,className:Lm(`lucide-${Wx(n)}`,o),...a}));return r.displayName=`${n}`,r};/**
|
|
70
|
+
* @license lucide-react v0.469.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const Gx=Ee("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 ku=Ee("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 qx=Ee("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 Zs=Ee("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 si=Ee("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 Xu=Ee("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 Qu=Ee("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 Kx=Ee("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 Wl=Ee("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 Yx=Ee("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 Xx=Ee("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 Qx=Ee("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 Pm=Ee("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 ch=Ee("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 Su=Ee("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 Zx=Ee("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 Jx=Ee("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 e0=Ee("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 Om=Ee("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 ru=Ee("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 Tu=Ee("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 t0=Ee("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 n0=Ee("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 s0=Ee("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 r0=Ee("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 i0=Ee("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 o0=Ee("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 ns=Ee("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 l0=Ee("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 a0=Ee("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 c0=Ee("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 u0=Ee("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 uh=Ee("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 d0=Ee("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 f0=Ee("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 Ml=Ee("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 p0=Ee("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 h0=Ee("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 yr=Ee("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 zm=Ee("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 m0=Ee("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=Ee("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 $m=Ee("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 g0=Ee("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 la=Ee("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 v0=Ee("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=Ee("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 Hl=Ee("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 Fm=Ee("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 fs=Ee("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 y0=Ee("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 x0=Ee("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 w0=Ee("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 k0=Ee("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 S0=Ee("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 Vn=Ee("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 T0=Ee("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=ym();function b0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return k.useMemo(()=>o=>{s.forEach(a=>a(o))},s)}const aa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ai(n){const s=Object.prototype.toString.call(n);return s==="[object Window]"||s==="[object global]"}function Zu(n){return"nodeType"in n}function vn(n){var s,r;return n?ai(n)?n:Zu(n)&&(s=(r=n.ownerDocument)==null?void 0:r.defaultView)!=null?s:window:window}function Ju(n){const{Document:s}=vn(n);return n instanceof s}function uo(n){return ai(n)?!1:n instanceof vn(n).HTMLElement}function Um(n){return n instanceof vn(n).SVGElement}function ci(n){return n?ai(n)?n.document:Zu(n)?Ju(n)?n:uo(n)||Um(n)?n.ownerDocument:document:document:document}const ss=aa?k.useLayoutEffect:k.useEffect;function ca(n){const s=k.useRef(n);return ss(()=>{s.current=n}),k.useCallback(function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return s.current==null?void 0:s.current(...o)},[])}function N0(){const n=k.useRef(null),s=k.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),r=k.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[s,r]}function lo(n,s){s===void 0&&(s=[n]);const r=k.useRef(n);return ss(()=>{r.current!==n&&(r.current=n)},s),r}function fo(n,s){const r=k.useRef();return k.useMemo(()=>{const o=n(r.current);return r.current=o,o},[...s])}function Vl(n){const s=ca(n),r=k.useRef(null),o=k.useCallback(a=>{a!==r.current&&(s==null||s(a,r.current)),r.current=a},[]);return[r,o]}function Gl(n){const s=k.useRef();return k.useEffect(()=>{s.current=n},[n]),s.current}let iu={};function po(n,s){return k.useMemo(()=>{if(s)return s;const r=iu[n]==null?0:iu[n]+1;return iu[n]=r,n+"-"+r},[n,s])}function Bm(n){return function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return o.reduce((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},{...s})}}const ri=Bm(1),ql=Bm(-1);function C0(n){return"clientX"in n&&"clientY"in n}function ua(n){if(!n)return!1;const{KeyboardEvent:s}=vn(n.target);return s&&n instanceof s}function E0(n){if(!n)return!1;const{TouchEvent:s}=vn(n.target);return s&&n instanceof s}function Kl(n){if(E0(n)){if(n.touches&&n.touches.length){const{clientX:s,clientY:r}=n.touches[0];return{x:s,y:r}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:s,clientY:r}=n.changedTouches[0];return{x:s,y:r}}}return C0(n)?{x:n.clientX,y:n.clientY}:null}const js=Object.freeze({Translate:{toString(n){if(!n)return;const{x:s,y:r}=n;return"translate3d("+(s?Math.round(s):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:s,scaleY:r}=n;return"scaleX("+s+") scaleY("+r+")"}},Transform:{toString(n){if(n)return[js.Translate.toString(n),js.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:s,duration:r,easing:o}=n;return s+" "+r+"ms "+o}}}),dh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function _0(n){return n.matches(dh)?n:n.querySelector(dh)}const j0={display:"none"};function R0(n){let{id:s,value:r}=n;return at.createElement("div",{id:s,style:j0},r)}function A0(n){let{id:s,announcement:r,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 at.createElement("div",{id:s,style:a,role:"status","aria-live":o,"aria-atomic":!0},r)}function I0(){const[n,s]=k.useState("");return{announce:k.useCallback(o=>{o!=null&&s(o)},[]),announcement:n}}const Wm=k.createContext(null);function D0(n){const s=k.useContext(Wm);k.useEffect(()=>{if(!s)throw new Error("useDndMonitor must be used within a children of <DndContext>");return s(n)},[n,s])}function M0(){const[n]=k.useState(()=>new Set),s=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]),s]}const L0={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
|
+
`},P0={onDragStart(n){let{active:s}=n;return"Picked up draggable item "+s.id+"."},onDragOver(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was moved over droppable area "+r.id+".":"Draggable item "+s.id+" is no longer over a droppable area."},onDragEnd(n){let{active:s,over:r}=n;return r?"Draggable item "+s.id+" was dropped over droppable area "+r.id:"Draggable item "+s.id+" was dropped."},onDragCancel(n){let{active:s}=n;return"Dragging was cancelled. Draggable item "+s.id+" was dropped."}};function O0(n){let{announcements:s=P0,container:r,hiddenTextDescribedById:o,screenReaderInstructions:a=L0}=n;const{announce:u,announcement:f}=I0(),h=po("DndLiveRegion"),[m,g]=k.useState(!1);if(k.useEffect(()=>{g(!0)},[]),D0(k.useMemo(()=>({onDragStart(w){let{active:y}=w;u(s.onDragStart({active:y}))},onDragMove(w){let{active:y,over:N}=w;s.onDragMove&&u(s.onDragMove({active:y,over:N}))},onDragOver(w){let{active:y,over:N}=w;u(s.onDragOver({active:y,over:N}))},onDragEnd(w){let{active:y,over:N}=w;u(s.onDragEnd({active:y,over:N}))},onDragCancel(w){let{active:y,over:N}=w;u(s.onDragCancel({active:y,over:N}))}}),[u,s])),!m)return null;const x=at.createElement(at.Fragment,null,at.createElement(R0,{id:o,value:a.draggable}),at.createElement(A0,{id:h,announcement:f}));return r?Xi.createPortal(x,r):x}var Bt;(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"})(Bt||(Bt={}));function Yl(){}function z0(n,s){return k.useMemo(()=>({sensor:n,options:s??{}}),[n,s])}function $0(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return k.useMemo(()=>[...s].filter(o=>o!=null),[...s])}const rs=Object.freeze({x:0,y:0});function F0(n,s){return Math.sqrt(Math.pow(n.x-s.x,2)+Math.pow(n.y-s.y,2))}function U0(n,s){const r=Kl(n);if(!r)return"0 0";const o={x:(r.x-s.left)/s.width*100,y:(r.y-s.top)/s.height*100};return o.x+"% "+o.y+"%"}function B0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return r-o}function W0(n,s){let{data:{value:r}}=n,{data:{value:o}}=s;return o-r}function H0(n,s){if(!n||n.length===0)return null;const[r]=n;return r[s]}function fh(n,s,r){return s===void 0&&(s=n.left),r===void 0&&(r=n.top),{x:s+n.width*.5,y:r+n.height*.5}}const V0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=fh(s,s.left,s.top),u=[];for(const f of o){const{id:h}=f,m=r.get(h);if(m){const g=F0(fh(m),a);u.push({id:h,data:{droppableContainer:f,value:g}})}}return u.sort(B0)};function G0(n,s){const r=Math.max(s.top,n.top),o=Math.max(s.left,n.left),a=Math.min(s.left+s.width,n.left+n.width),u=Math.min(s.top+s.height,n.top+n.height),f=a-o,h=u-r;if(o<a&&r<u){const m=s.width*s.height,g=n.width*n.height,x=f*h,w=x/(m+g-x);return Number(w.toFixed(4))}return 0}const q0=n=>{let{collisionRect:s,droppableRects:r,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=r.get(f);if(h){const m=G0(h,s);m>0&&a.push({id:f,data:{droppableContainer:u,value:m}})}}return a.sort(W0)};function K0(n,s,r){return{...n,scaleX:s&&r?s.width/r.width:1,scaleY:s&&r?s.height/r.height:1}}function Hm(n,s){return n&&s?{x:n.left-s.left,y:n.top-s.top}:rs}function Y0(n){return function(r){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}),{...r})}}const X0=Y0(1);function Vm(n){if(n.startsWith("matrix3d(")){const s=n.slice(9,-1).split(/, /);return{x:+s[12],y:+s[13],scaleX:+s[0],scaleY:+s[5]}}else if(n.startsWith("matrix(")){const s=n.slice(7,-1).split(/, /);return{x:+s[4],y:+s[5],scaleX:+s[0],scaleY:+s[3]}}return null}function Q0(n,s,r){const o=Vm(s);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,m=n.left-f-(1-a)*parseFloat(r),g=n.top-h-(1-u)*parseFloat(r.slice(r.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 Z0={ignoreTransform:!1};function ui(n,s){s===void 0&&(s=Z0);let r=n.getBoundingClientRect();if(s.ignoreTransform){const{transform:g,transformOrigin:x}=vn(n).getComputedStyle(n);g&&(r=Q0(r,g,x))}const{top:o,left:a,width:u,height:f,bottom:h,right:m}=r;return{top:o,left:a,width:u,height:f,bottom:h,right:m}}function ph(n){return ui(n,{ignoreTransform:!0})}function J0(n){const s=n.innerWidth,r=n.innerHeight;return{top:0,left:0,right:s,bottom:r,width:s,height:r}}function ew(n,s){return s===void 0&&(s=vn(n).getComputedStyle(n)),s.position==="fixed"}function tw(n,s){s===void 0&&(s=vn(n).getComputedStyle(n));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=s[a];return typeof u=="string"?r.test(u):!1})}function ed(n,s){const r=[];function o(a){if(s!=null&&r.length>=s||!a)return r;if(Ju(a)&&a.scrollingElement!=null&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!uo(a)||Um(a)||r.includes(a))return r;const u=vn(n).getComputedStyle(a);return a!==n&&tw(a,u)&&r.push(a),ew(a,u)?r:o(a.parentNode)}return n?o(n):r}function Gm(n){const[s]=ed(n,1);return s??null}function ou(n){return!aa||!n?null:ai(n)?n:Zu(n)?Ju(n)||n===ci(n).scrollingElement?window:uo(n)?n:null:null}function qm(n){return ai(n)?n.scrollX:n.scrollLeft}function Km(n){return ai(n)?n.scrollY:n.scrollTop}function bu(n){return{x:qm(n),y:Km(n)}}var Yt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Yt||(Yt={}));function Ym(n){return!aa||!n?!1:n===document.scrollingElement}function Xm(n){const s={x:0,y:0},r=Ym(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-r.width,y:n.scrollHeight-r.height},a=n.scrollTop<=s.y,u=n.scrollLeft<=s.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:s}}const nw={x:.2,y:.2};function sw(n,s,r,o,a){let{top:u,left:f,right:h,bottom:m}=r;o===void 0&&(o=10),a===void 0&&(a=nw);const{isTop:g,isBottom:x,isLeft:w,isRight:y}=Xm(n),N={x:0,y:0},j={x:0,y:0},E={height:s.height*a.y,width:s.width*a.x};return!g&&u<=s.top+E.height?(N.y=Yt.Backward,j.y=o*Math.abs((s.top+E.height-u)/E.height)):!x&&m>=s.bottom-E.height&&(N.y=Yt.Forward,j.y=o*Math.abs((s.bottom-E.height-m)/E.height)),!y&&h>=s.right-E.width?(N.x=Yt.Forward,j.x=o*Math.abs((s.right-E.width-h)/E.width)):!w&&f<=s.left+E.width&&(N.x=Yt.Backward,j.x=o*Math.abs((s.left+E.width-f)/E.width)),{direction:N,speed:j}}function rw(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:s,left:r,right:o,bottom:a}=n.getBoundingClientRect();return{top:s,left:r,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Qm(n){return n.reduce((s,r)=>ri(s,bu(r)),rs)}function iw(n){return n.reduce((s,r)=>s+qm(r),0)}function ow(n){return n.reduce((s,r)=>s+Km(r),0)}function Zm(n,s){if(s===void 0&&(s=ui),!n)return;const{top:r,left:o,bottom:a,right:u}=s(n);Gm(n)&&(a<=0||u<=0||r>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const lw=[["x",["left","right"],iw],["y",["top","bottom"],ow]];class td{constructor(s,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ed(r),a=Qm(o);this.rect={...s},this.width=s.width,this.height=s.height;for(const[u,f,h]of lw)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(s){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=s}add(s,r,o){var a;(a=this.target)==null||a.addEventListener(s,r,o),this.listeners.push([s,r,o])}}function aw(n){const{EventTarget:s}=vn(n);return n instanceof s?n:ci(n)}function lu(n,s){const r=Math.abs(n.x),o=Math.abs(n.y);return typeof s=="number"?Math.sqrt(r**2+o**2)>s:"x"in s&&"y"in s?r>s.x&&o>s.y:"x"in s?r>s.x:"y"in s?o>s.y:!1}var Hn;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(Hn||(Hn={}));function hh(n){n.preventDefault()}function cw(n){n.stopPropagation()}var it;(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"})(it||(it={}));const Jm={start:[it.Space,it.Enter],cancel:[it.Esc],end:[it.Space,it.Enter,it.Tab]},uw=(n,s)=>{let{currentCoordinates:r}=s;switch(n.code){case it.Right:return{...r,x:r.x+25};case it.Left:return{...r,x:r.x-25};case it.Down:return{...r,y:r.y+25};case it.Up:return{...r,y:r.y-25}}};class eg{constructor(s){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=s;const{event:{target:r}}=s;this.props=s,this.listeners=new Zi(ci(r)),this.windowListeners=new Zi(vn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Hn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:s,onStart:r}=this.props,o=s.node.current;o&&Zm(o),r(rs)}handleKeyDown(s){if(ua(s)){const{active:r,context:o,options:a}=this.props,{keyboardCodes:u=Jm,coordinateGetter:f=uw,scrollBehavior:h="smooth"}=a,{code:m}=s;if(u.end.includes(m)){this.handleEnd(s);return}if(u.cancel.includes(m)){this.handleCancel(s);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:rs;this.referenceCoordinates||(this.referenceCoordinates=x);const w=f(s,{active:r,context:o.current,currentCoordinates:x});if(w){const y=ql(w,x),N={x:0,y:0},{scrollableAncestors:j}=o.current;for(const E of j){const T=s.code,{isTop:L,isRight:M,isLeft:W,isBottom:D,maxScroll:B,minScroll:q}=Xm(E),K=rw(E),G={x:Math.min(T===it.Right?K.right-K.width/2:K.right,Math.max(T===it.Right?K.left:K.left+K.width/2,w.x)),y:Math.min(T===it.Down?K.bottom-K.height/2:K.bottom,Math.max(T===it.Down?K.top:K.top+K.height/2,w.y))},oe=T===it.Right&&!M||T===it.Left&&!W,ue=T===it.Down&&!D||T===it.Up&&!L;if(oe&&G.x!==w.x){const ie=E.scrollLeft+y.x,Te=T===it.Right&&ie<=B.x||T===it.Left&&ie>=q.x;if(Te&&!y.y){E.scrollTo({left:ie,behavior:h});return}Te?N.x=E.scrollLeft-ie:N.x=T===it.Right?E.scrollLeft-B.x:E.scrollLeft-q.x,N.x&&E.scrollBy({left:-N.x,behavior:h});break}else if(ue&&G.y!==w.y){const ie=E.scrollTop+y.y,Te=T===it.Down&&ie<=B.y||T===it.Up&&ie>=q.y;if(Te&&!y.x){E.scrollTo({top:ie,behavior:h});return}Te?N.y=E.scrollTop-ie:N.y=T===it.Down?E.scrollTop-B.y:E.scrollTop-q.y,N.y&&E.scrollBy({top:-N.y,behavior:h});break}}this.handleMove(s,ri(ql(w,this.referenceCoordinates),N))}}}handleMove(s,r){const{onMove:o}=this.props;s.preventDefault(),o(r)}handleEnd(s){const{onEnd:r}=this.props;s.preventDefault(),this.detach(),r()}handleCancel(s){const{onCancel:r}=this.props;s.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}eg.activators=[{eventName:"onKeyDown",handler:(n,s,r)=>{let{keyboardCodes:o=Jm,onActivation:a}=s,{active:u}=r;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 mh(n){return!!(n&&"distance"in n)}function gh(n){return!!(n&&"delay"in n)}class nd{constructor(s,r,o){var a;o===void 0&&(o=aw(s.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=s,this.events=r;const{event:u}=s,{target:f}=u;this.props=s,this.events=r,this.document=ci(f),this.documentListeners=new Zi(this.document),this.listeners=new Zi(o),this.windowListeners=new Zi(vn(f)),this.initialCoordinates=(a=Kl(u))!=null?a:rs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:s,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(s.move.name,this.handleMove,{passive:!1}),this.listeners.add(s.end.name,this.handleEnd),s.cancel&&this.listeners.add(s.cancel.name,this.handleCancel),this.windowListeners.add(Hn.Resize,this.handleCancel),this.windowListeners.add(Hn.DragStart,hh),this.windowListeners.add(Hn.VisibilityChange,this.handleCancel),this.windowListeners.add(Hn.ContextMenu,hh),this.documentListeners.add(Hn.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gh(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(mh(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(s,r){const{active:o,onPending:a}=this.props;a(o,s,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:s}=this,{onStart:r}=this.props;s&&(this.activated=!0,this.documentListeners.add(Hn.Click,cw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Hn.SelectionChange,this.removeTextSelection),r(s))}handleMove(s){var r;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const m=(r=Kl(s))!=null?r:rs,g=ql(a,m);if(!o&&h){if(mh(h)){if(h.tolerance!=null&&lu(g,h.tolerance))return this.handleCancel();if(lu(g,h.distance))return this.handleStart()}if(gh(h)&&lu(g,h.tolerance))return this.handleCancel();this.handlePending(h,g);return}s.cancelable&&s.preventDefault(),f(m)}handleEnd(){const{onAbort:s,onEnd:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleCancel(){const{onAbort:s,onCancel:r}=this.props;this.detach(),this.activated||s(this.props.active),r()}handleKeydown(s){s.code===it.Esc&&this.handleCancel()}removeTextSelection(){var s;(s=this.document.getSelection())==null||s.removeAllRanges()}}const dw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sd extends nd{constructor(s){const{event:r}=s,o=ci(r.target);super(s,dw,o)}}sd.activators=[{eventName:"onPointerDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const fw={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(n){n[n.RightClick=2]="RightClick"})(Nu||(Nu={}));class pw extends nd{constructor(s){super(s,fw,ci(s.event.target))}}pw.activators=[{eventName:"onMouseDown",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;return r.button===Nu.RightClick?!1:(o==null||o({event:r}),!0)}}];const au={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hw extends nd{constructor(s){super(s,au)}static setup(){return window.addEventListener(au.move.name,s,{capture:!1,passive:!1}),function(){window.removeEventListener(au.move.name,s)};function s(){}}}hw.activators=[{eventName:"onTouchStart",handler:(n,s)=>{let{nativeEvent:r}=n,{onActivation:o}=s;const{touches:a}=r;return a.length>1?!1:(o==null||o({event:r}),!0)}}];var Ji;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Ji||(Ji={}));var Xl;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xl||(Xl={}));function mw(n){let{acceleration:s,activator:r=Ji.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=Xl.TreeOrder,pointerCoordinates:m,scrollableAncestors:g,scrollableAncestorRects:x,delta:w,threshold:y}=n;const N=vw({delta:w,disabled:!u}),[j,E]=N0(),T=k.useRef({x:0,y:0}),L=k.useRef({x:0,y:0}),M=k.useMemo(()=>{switch(r){case Ji.Pointer:return m?{top:m.y,bottom:m.y,left:m.x,right:m.x}:null;case Ji.DraggableRect:return a}},[r,a,m]),W=k.useRef(null),D=k.useCallback(()=>{const q=W.current;if(!q)return;const K=T.current.x*L.current.x,G=T.current.y*L.current.y;q.scrollBy(K,G)},[]),B=k.useMemo(()=>h===Xl.TreeOrder?[...g].reverse():g,[h,g]);k.useEffect(()=>{if(!u||!g.length||!M){E();return}for(const q of B){if((o==null?void 0:o(q))===!1)continue;const K=g.indexOf(q),G=x[K];if(!G)continue;const{direction:oe,speed:ue}=sw(q,G,M,s,y);for(const ie of["x","y"])N[ie][oe[ie]]||(ue[ie]=0,oe[ie]=0);if(ue.x>0||ue.y>0){E(),W.current=q,j(D,f),T.current=ue,L.current=oe;return}}T.current={x:0,y:0},L.current={x:0,y:0},E()},[s,D,o,E,u,f,JSON.stringify(M),JSON.stringify(N),j,g,B,x,JSON.stringify(y)])}const gw={x:{[Yt.Backward]:!1,[Yt.Forward]:!1},y:{[Yt.Backward]:!1,[Yt.Forward]:!1}};function vw(n){let{delta:s,disabled:r}=n;const o=Gl(s);return fo(a=>{if(r||!o||!a)return gw;const u={x:Math.sign(s.x-o.x),y:Math.sign(s.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}}},[r,s,o])}function yw(n,s){const r=s!=null?n.get(s):void 0,o=r?r.node.current:null;return fo(a=>{var u;return s==null?null:(u=o??a)!=null?u:null},[o,s])}function xw(n,s){return k.useMemo(()=>n.reduce((r,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:s(f.handler,o)}));return[...r,...u]},[]),[n,s])}var ao;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ao||(ao={}));var Cu;(function(n){n.Optimized="optimized"})(Cu||(Cu={}));const vh=new Map;function ww(n,s){let{dragging:r,dependencies:o,config:a}=s;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(L){L===void 0&&(L=[]),!y.current&&f(M=>M===null?L:M.concat(L.filter(W=>!M.includes(W))))},[y]),j=k.useRef(null),E=fo(L=>{if(w&&!r)return vh;if(!L||L===vh||x.current!==n||u!=null){const M=new Map;for(let W of n){if(!W)continue;if(u&&u.length>0&&!u.includes(W.id)&&W.rect.current){M.set(W.id,W.rect.current);continue}const D=W.node.current,B=D?new td(m(D),D):null;W.rect.current=B,B&&M.set(W.id,B)}return M}return L},[n,u,r,w,m]);return k.useEffect(()=>{x.current=n},[n]),k.useEffect(()=>{w||N()},[r,w]),k.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),k.useEffect(()=>{w||typeof h!="number"||j.current!==null||(j.current=setTimeout(()=>{N(),j.current=null},h))},[h,w,N,...o]),{droppableRects:E,measureDroppableContainers:N,measuringScheduled:u!=null};function T(){switch(g){case ao.Always:return!1;case ao.BeforeDragging:return r;default:return!r}}}function rd(n,s){return fo(r=>n?r||(typeof s=="function"?s(n):n):null,[s,n])}function kw(n,s){return rd(n,s)}function Sw(n){let{callback:s,disabled:r}=n;const o=ca(s),a=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,r]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function da(n){let{callback:s,disabled:r}=n;const o=ca(s),a=k.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[r]);return k.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Tw(n){return new td(ui(n),n)}function yh(n,s,r){s===void 0&&(s=Tw);const[o,a]=k.useState(null);function u(){a(m=>{if(!n)return null;if(n.isConnected===!1){var g;return(g=m??r)!=null?g:null}const x=s(n);return JSON.stringify(m)===JSON.stringify(x)?m:x})}const f=Sw({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=da({callback:u});return ss(()=>{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 bw(n){const s=rd(n);return Hm(n,s)}const xh=[];function Nw(n){const s=k.useRef(n),r=fo(o=>n?o&&o!==xh&&n&&s.current&&n.parentNode===s.current.parentNode?o:ed(n):xh,[n]);return k.useEffect(()=>{s.current=n},[n]),r}function Cw(n){const[s,r]=k.useState(null),o=k.useRef(n),a=k.useCallback(u=>{const f=ou(u.target);f&&r(h=>h?(h.set(f,bu(f)),new Map(h)):null)},[]);return k.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(m=>{const g=ou(m);return g?(g.addEventListener("scroll",a,{passive:!0}),[g,bu(g)]):null}).filter(m=>m!=null);r(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(m=>{const g=ou(m);g==null||g.removeEventListener("scroll",a)})}},[a,n]),k.useMemo(()=>n.length?s?Array.from(s.values()).reduce((u,f)=>ri(u,f),rs):Qm(n):rs,[n,s])}function wh(n,s){s===void 0&&(s=[]);const r=k.useRef(null);return k.useEffect(()=>{r.current=null},s),k.useEffect(()=>{const o=n!==rs;o&&!r.current&&(r.current=n),!o&&r.current&&(r.current=null)},[n]),r.current?ql(n,r.current):rs}function Ew(n){k.useEffect(()=>{if(!aa)return;const s=n.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of s)r==null||r()}},n.map(s=>{let{sensor:r}=s;return r}))}function _w(n,s){return k.useMemo(()=>n.reduce((r,o)=>{let{eventName:a,handler:u}=o;return r[a]=f=>{u(f,s)},r},{}),[n,s])}function tg(n){return k.useMemo(()=>n?J0(n):null,[n])}const kh=[];function jw(n,s){s===void 0&&(s=ui);const[r]=n,o=tg(r?vn(r):null),[a,u]=k.useState(kh);function f(){u(()=>n.length?n.map(m=>Ym(m)?o:new td(s(m),m)):kh)}const h=da({callback:f});return ss(()=>{h==null||h.disconnect(),f(),n.forEach(m=>h==null?void 0:h.observe(m))},[n]),a}function ng(n){if(!n)return null;if(n.children.length>1)return n;const s=n.children[0];return uo(s)?s:n}function Rw(n){let{measure:s}=n;const[r,o]=k.useState(null),a=k.useCallback(g=>{for(const{target:x}of g)if(uo(x)){o(w=>{const y=s(x);return w?{...w,width:y.width,height:y.height}:y});break}},[s]),u=da({callback:a}),f=k.useCallback(g=>{const x=ng(g);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?s(x):null)},[s,u]),[h,m]=Vl(f);return k.useMemo(()=>({nodeRef:h,rect:r,setRef:m}),[r,h,m])}const Aw=[{sensor:sd,options:{}},{sensor:eg,options:{}}],Iw={current:{}},Ll={draggable:{measure:ph},droppable:{measure:ph,strategy:ao.WhileDragging,frequency:Cu.Optimized},dragOverlay:{measure:ui}};class eo extends Map{get(s){var r;return s!=null&&(r=super.get(s))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(s=>{let{disabled:r}=s;return!r})}getNodeFor(s){var r,o;return(r=(o=this.get(s))==null?void 0:o.node.current)!=null?r:void 0}}const Dw={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:Yl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ll,measureDroppableContainers:Yl,windowRect:null,measuringScheduled:!1},sg={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yl,draggableNodes:new Map,over:null,measureDroppableContainers:Yl},ho=k.createContext(sg),rg=k.createContext(Dw);function Mw(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eo}}}function Lw(n,s){switch(s.type){case Bt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:s.initialCoordinates,active:s.active}};case Bt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:s.coordinates.x-n.draggable.initialCoordinates.x,y:s.coordinates.y-n.draggable.initialCoordinates.y}}};case Bt.DragEnd:case Bt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Bt.RegisterDroppable:{const{element:r}=s,{id:o}=r,a=new eo(n.droppable.containers);return a.set(o,r),{...n,droppable:{...n.droppable,containers:a}}}case Bt.SetDroppableDisabled:{const{id:r,key:o,disabled:a}=s,u=n.droppable.containers.get(r);if(!u||o!==u.key)return n;const f=new eo(n.droppable.containers);return f.set(r,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Bt.UnregisterDroppable:{const{id:r,key:o}=s,a=n.droppable.containers.get(r);if(!a||o!==a.key)return n;const u=new eo(n.droppable.containers);return u.delete(r),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function Pw(n){let{disabled:s}=n;const{active:r,activatorEvent:o,draggableNodes:a}=k.useContext(ho),u=Gl(o),f=Gl(r==null?void 0:r.id);return k.useEffect(()=>{if(!s&&!o&&u&&f!=null){if(!ua(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=_0(x);if(w){w.focus();break}}})}},[o,s,a,f,u]),null}function ig(n,s){let{transform:r,...o}=s;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),r):r}function Ow(n){return k.useMemo(()=>({draggable:{...Ll.draggable,...n==null?void 0:n.draggable},droppable:{...Ll.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Ll.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 zw(n){let{activeNode:s,measure:r,initialRect:o,config:a=!0}=n;const u=k.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;ss(()=>{if(!f&&!h||!s){u.current=!1;return}if(u.current||!o)return;const g=s==null?void 0:s.node.current;if(!g||g.isConnected===!1)return;const x=r(g),w=Hm(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=Gm(g);y&&y.scrollBy({top:w.y,left:w.x})}},[s,f,h,o,r])}const fa=k.createContext({...rs,scaleX:1,scaleY:1});var Xs;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(Xs||(Xs={}));const $w=k.memo(function(s){var r,o,a,u;let{id:f,accessibility:h,autoScroll:m=!0,children:g,sensors:x=Aw,collisionDetection:w=q0,measuring:y,modifiers:N,...j}=s;const E=k.useReducer(Lw,void 0,Mw),[T,L]=E,[M,W]=M0(),[D,B]=k.useState(Xs.Uninitialized),q=D===Xs.Initialized,{draggable:{active:K,nodes:G,translate:oe},droppable:{containers:ue}}=T,ie=K!=null?G.get(K):null,Te=k.useRef({initial:null,translated:null}),Ne=k.useMemo(()=>{var we;return K!=null?{id:K,data:(we=ie==null?void 0:ie.data)!=null?we:Iw,rect:Te}:null},[K,ie]),Fe=k.useRef(null),[Q,ne]=k.useState(null),[ae,O]=k.useState(null),J=lo(j,Object.values(j)),H=po("DndDescribedBy",f),b=k.useMemo(()=>ue.getEnabled(),[ue]),R=Ow(y),{droppableRects:te,measureDroppableContainers:ce,measuringScheduled:ge}=ww(b,{dragging:q,dependencies:[oe.x,oe.y],config:R.droppable}),ye=yw(G,K),Oe=k.useMemo(()=>ae?Kl(ae):null,[ae]),Re=xe(),je=kw(ye,R.draggable.measure);zw({activeNode:K!=null?G.get(K):null,config:Re.layoutShiftCompensation,initialRect:je,measure:R.draggable.measure});const be=yh(ye,R.draggable.measure,je),mt=yh(ye?ye.parentElement:null),Me=k.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:G,draggingNode:null,draggingNodeRect:null,droppableContainers:ue,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),jt=ue.getNodeFor((r=Me.current.over)==null?void 0:r.id),ze=Rw({measure:R.dragOverlay.measure}),zt=(o=ze.nodeRef.current)!=null?o:ye,We=q?(a=ze.rect)!=null?a:be:null,Wt=!!(ze.nodeRef.current&&ze.rect),Rt=bw(Wt?null:be),gt=tg(zt?vn(zt):null),At=Nw(q?jt??ye:null),$t=jw(At),V=ig(N,{transform:{x:oe.x-Rt.x,y:oe.y-Rt.y,scaleX:1,scaleY:1},activatorEvent:ae,active:Ne,activeNodeRect:be,containerNodeRect:mt,draggingNodeRect:We,over:Me.current.over,overlayNodeRect:ze.rect,scrollableAncestors:At,scrollableAncestorRects:$t,windowRect:gt}),he=Oe?ri(Oe,oe):null,Ue=Cw(At),Ze=wh(Ue),vt=wh(Ue,[be]),yt=ri(V,Ze),dt=We?X0(We,V):null,Xt=Ne&&dt?w({active:Ne,collisionRect:dt,droppableRects:te,droppableContainers:b,pointerCoordinates:he}):null,sn=H0(Xt,"id"),[xt,un]=k.useState(null),yn=Wt?V:ri(V,vt),Gn=K0(yn,(u=xt==null?void 0:xt.rect)!=null?u:null,be),Mn=k.useRef(null),Ln=k.useCallback((we,Le)=>{let{sensor:ke,options:Ve}=Le;if(Fe.current==null)return;const ot=G.get(Fe.current);if(!ot)return;const tt=we.nativeEvent,nt=new ke({active:Fe.current,activeNode:ot,event:tt,options:Ve,context:Me,onAbort(st){if(!G.get(st))return;const{onDragAbort:kt}=J.current,Be={id:st};kt==null||kt(Be),M({type:"onDragAbort",event:Be})},onPending(st,wt,kt,Be){if(!G.get(st))return;const{onDragPending:Lt}=J.current,Qt={id:st,constraint:wt,initialCoordinates:kt,offset:Be};Lt==null||Lt(Qt),M({type:"onDragPending",event:Qt})},onStart(st){const wt=Fe.current;if(wt==null)return;const kt=G.get(wt);if(!kt)return;const{onDragStart:Be}=J.current,Ke={activatorEvent:tt,active:{id:wt,data:kt.data,rect:Te}};Xi.unstable_batchedUpdates(()=>{Be==null||Be(Ke),B(Xs.Initializing),L({type:Bt.DragStart,initialCoordinates:st,active:wt}),M({type:"onDragStart",event:Ke}),ne(Mn.current),O(tt)})},onMove(st){L({type:Bt.DragMove,coordinates:st})},onEnd:It(Bt.DragEnd),onCancel:It(Bt.DragCancel)});Mn.current=nt;function It(st){return async function(){const{active:kt,collisions:Be,over:Ke,scrollAdjustedTranslate:Lt}=Me.current;let Qt=null;if(kt&&Lt){const{cancelDrop:qn}=J.current;Qt={activatorEvent:tt,active:kt,collisions:Be,delta:Lt,over:Ke},st===Bt.DragEnd&&typeof qn=="function"&&await Promise.resolve(qn(Qt))&&(st=Bt.DragCancel)}Fe.current=null,Xi.unstable_batchedUpdates(()=>{L({type:st}),B(Xs.Uninitialized),un(null),ne(null),O(null),Mn.current=null;const qn=st===Bt.DragEnd?"onDragEnd":"onDragCancel";if(Qt){const Kn=J.current[qn];Kn==null||Kn(Qt),M({type:qn,event:Qt})}})}}},[G]),Pn=k.useCallback((we,Le)=>(ke,Ve)=>{const ot=ke.nativeEvent,tt=G.get(Ve);if(Fe.current!==null||!tt||ot.dndKit||ot.defaultPrevented)return;const nt={active:tt};we(ke,Le.options,nt)===!0&&(ot.dndKit={capturedBy:Le.sensor},Fe.current=Ve,Ln(ke,Le))},[G,Ln]),I=xw(x,Pn);Ew(x),ss(()=>{be&&D===Xs.Initializing&&B(Xs.Initialized)},[be,D]),k.useEffect(()=>{const{onDragMove:we}=J.current,{active:Le,activatorEvent:ke,collisions:Ve,over:ot}=Me.current;if(!Le||!ke)return;const tt={active:Le,activatorEvent:ke,collisions:Ve,delta:{x:yt.x,y:yt.y},over:ot};Xi.unstable_batchedUpdates(()=>{we==null||we(tt),M({type:"onDragMove",event:tt})})},[yt.x,yt.y]),k.useEffect(()=>{const{active:we,activatorEvent:Le,collisions:ke,droppableContainers:Ve,scrollAdjustedTranslate:ot}=Me.current;if(!we||Fe.current==null||!Le||!ot)return;const{onDragOver:tt}=J.current,nt=Ve.get(sn),It=nt&&nt.rect.current?{id:nt.id,rect:nt.rect.current,data:nt.data,disabled:nt.disabled}:null,st={active:we,activatorEvent:Le,collisions:ke,delta:{x:ot.x,y:ot.y},over:It};Xi.unstable_batchedUpdates(()=>{un(It),tt==null||tt(st),M({type:"onDragOver",event:st})})},[sn]),ss(()=>{Me.current={activatorEvent:ae,active:Ne,activeNode:ye,collisionRect:dt,collisions:Xt,droppableRects:te,draggableNodes:G,draggingNode:zt,draggingNodeRect:We,droppableContainers:ue,over:xt,scrollableAncestors:At,scrollAdjustedTranslate:yt},Te.current={initial:We,translated:dt}},[Ne,ye,Xt,dt,G,zt,We,te,ue,xt,At,yt]),mw({...Re,delta:oe,draggingRect:dt,pointerCoordinates:he,scrollableAncestors:At,scrollableAncestorRects:$t});const _e=k.useMemo(()=>({active:Ne,activeNode:ye,activeNodeRect:be,activatorEvent:ae,collisions:Xt,containerNodeRect:mt,dragOverlay:ze,draggableNodes:G,droppableContainers:ue,droppableRects:te,over:xt,measureDroppableContainers:ce,scrollableAncestors:At,scrollableAncestorRects:$t,measuringConfiguration:R,measuringScheduled:ge,windowRect:gt}),[Ne,ye,be,ae,Xt,mt,ze,G,ue,te,xt,ce,At,$t,R,ge,gt]),le=k.useMemo(()=>({activatorEvent:ae,activators:I,active:Ne,activeNodeRect:be,ariaDescribedById:{draggable:H},dispatch:L,draggableNodes:G,over:xt,measureDroppableContainers:ce}),[ae,I,Ne,be,L,H,G,xt,ce]);return at.createElement(Wm.Provider,{value:W},at.createElement(ho.Provider,{value:le},at.createElement(rg.Provider,{value:_e},at.createElement(fa.Provider,{value:Gn},g)),at.createElement(Pw,{disabled:(h==null?void 0:h.restoreFocus)===!1})),at.createElement(O0,{...h,hiddenTextDescribedById:H}));function xe(){const we=(Q==null?void 0:Q.autoScrollEnabled)===!1,Le=typeof m=="object"?m.enabled===!1:m===!1,ke=q&&!we&&!Le;return typeof m=="object"?{...m,enabled:ke}:{enabled:ke}}}),Fw=k.createContext(null),Sh="button",Uw="Draggable";function Bw(n){let{id:s,data:r,disabled:o=!1,attributes:a}=n;const u=po(Uw),{activators:f,activatorEvent:h,active:m,activeNodeRect:g,ariaDescribedById:x,draggableNodes:w,over:y}=k.useContext(ho),{role:N=Sh,roleDescription:j="draggable",tabIndex:E=0}=a??{},T=(m==null?void 0:m.id)===s,L=k.useContext(T?fa:Fw),[M,W]=Vl(),[D,B]=Vl(),q=_w(f,s),K=lo(r);ss(()=>(w.set(s,{id:s,key:u,node:M,activatorNode:D,data:K}),()=>{const oe=w.get(s);oe&&oe.key===u&&w.delete(s)}),[w,s]);const G=k.useMemo(()=>({role:N,tabIndex:E,"aria-disabled":o,"aria-pressed":T&&N===Sh?!0:void 0,"aria-roledescription":j,"aria-describedby":x.draggable}),[o,N,E,T,j,x.draggable]);return{active:m,activatorEvent:h,activeNodeRect:g,attributes:G,isDragging:T,listeners:o?void 0:q,node:M,over:y,setNodeRef:W,setActivatorNodeRef:B,transform:L}}function og(){return k.useContext(rg)}const Ww="Droppable",Hw={timeout:25};function lg(n){let{data:s,disabled:r=!1,id:o,resizeObserverConfig:a}=n;const u=po(Ww),{active:f,dispatch:h,over:m,measureDroppableContainers:g}=k.useContext(ho),x=k.useRef({disabled:r}),w=k.useRef(!1),y=k.useRef(null),N=k.useRef(null),{disabled:j,updateMeasurementsFor:E,timeout:T}={...Hw,...a},L=lo(E??o),M=k.useCallback(()=>{if(!w.current){w.current=!0;return}N.current!=null&&clearTimeout(N.current),N.current=setTimeout(()=>{g(Array.isArray(L.current)?L.current:[L.current]),N.current=null},T)},[T]),W=da({callback:M,disabled:j||!f}),D=k.useCallback((G,oe)=>{W&&(oe&&(W.unobserve(oe),w.current=!1),G&&W.observe(G))},[W]),[B,q]=Vl(D),K=lo(s);return k.useEffect(()=>{!W||!B.current||(W.disconnect(),w.current=!1,W.observe(B.current))},[B,W]),k.useEffect(()=>(h({type:Bt.RegisterDroppable,element:{id:o,key:u,disabled:r,node:B,rect:y,data:K}}),()=>h({type:Bt.UnregisterDroppable,key:u,id:o})),[o]),k.useEffect(()=>{r!==x.current.disabled&&(h({type:Bt.SetDroppableDisabled,id:o,key:u,disabled:r}),x.current.disabled=r)},[o,u,r,h]),{active:f,rect:y,isOver:(m==null?void 0:m.id)===o,node:B,over:m,setNodeRef:q}}function Vw(n){let{animation:s,children:r}=n;const[o,a]=k.useState(null),[u,f]=k.useState(null),h=Gl(r);return!r&&!o&&h&&a(h),ss(()=>{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(s(g,u)).then(()=>{a(null)})},[s,o,u]),at.createElement(at.Fragment,null,r,o?k.cloneElement(o,{ref:f}):null)}const Gw={x:0,y:0,scaleX:1,scaleY:1};function qw(n){let{children:s}=n;return at.createElement(ho.Provider,{value:sg},at.createElement(fa.Provider,{value:Gw},s))}const Kw={position:"fixed",touchAction:"none"},Yw=n=>ua(n)?"transform 250ms ease":void 0,Xw=k.forwardRef((n,s)=>{let{as:r,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:m,transform:g,transition:x=Yw}=n;if(!h)return null;const w=a?g:{...g,scaleX:1,scaleY:1},y={...Kw,width:h.width,height:h.height,top:h.top,left:h.left,transform:js.Transform.toString(w),transformOrigin:a&&o?U0(o,h):void 0,transition:typeof x=="function"?x(o):x,...m};return at.createElement(r,{className:f,style:y,ref:s},u)}),Qw=n=>s=>{let{active:r,dragOverlay:o}=s;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]=r.node.style.getPropertyValue(h),r.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&&r.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[m,g]of Object.entries(a))r.node.style.setProperty(m,g);f!=null&&f.active&&r.node.classList.remove(f.active)}},Zw=n=>{let{transform:{initial:s,final:r}}=n;return[{transform:js.Transform.toString(s)},{transform:js.Transform.toString(r)}]},Jw={duration:250,easing:"ease",keyframes:Zw,sideEffects:Qw({styles:{active:{opacity:"0"}}})};function e1(n){let{config:s,draggableNodes:r,droppableContainers:o,measuringConfiguration:a}=n;return ca((u,f)=>{if(s===null)return;const h=r.get(u);if(!h)return;const m=h.node.current;if(!m)return;const g=ng(f);if(!g)return;const{transform:x}=vn(f).getComputedStyle(f),w=Vm(x);if(!w)return;const y=typeof s=="function"?s:t1(s);return Zm(m,a.draggable.measure),y({active:{id:u,data:h.data,node:m,rect:a.draggable.measure(m)},draggableNodes:r,dragOverlay:{node:f,rect:a.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:a,transform:w})})}function t1(n){const{duration:s,easing:r,sideEffects:o,keyframes:a}={...Jw,...n};return u=>{let{active:f,dragOverlay:h,transform:m,...g}=u;if(!s)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}}),[j]=N,E=N[N.length-1];if(JSON.stringify(j)===JSON.stringify(E))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...g}),L=h.node.animate(N,{duration:s,easing:r,fill:"forwards"});return new Promise(M=>{L.onfinish=()=>{T==null||T(),M()}})}}let Th=0;function n1(n){return k.useMemo(()=>{if(n!=null)return Th++,Th},[n])}const s1=at.memo(n=>{let{adjustScale:s=!1,children:r,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:j,droppableContainers:E,dragOverlay:T,over:L,measuringConfiguration:M,scrollableAncestors:W,scrollableAncestorRects:D,windowRect:B}=og(),q=k.useContext(fa),K=n1(w==null?void 0:w.id),G=ig(f,{activatorEvent:x,active:w,activeNodeRect:y,containerNodeRect:N,draggingNodeRect:T.rect,over:L,overlayNodeRect:T.rect,scrollableAncestors:W,scrollableAncestorRects:D,transform:q,windowRect:B}),oe=rd(y),ue=e1({config:o,draggableNodes:j,droppableContainers:E,measuringConfiguration:M}),ie=oe?T.setRef:void 0;return at.createElement(qw,null,at.createElement(Vw,{animation:ue},w&&K?at.createElement(Xw,{key:K,id:w.id,ref:ie,as:h,activatorEvent:x,adjustScale:s,className:m,transition:u,rect:oe,style:{zIndex:g,...a},transform:G},r):null))});function ag(n,s,r){const o=n.slice();return o.splice(r<0?o.length+r:r,0,o.splice(s,1)[0]),o}function r1(n,s){return n.reduce((r,o,a)=>{const u=s.get(o);return u&&(r[a]=u),r},Array(n.length))}function bl(n){return n!==null&&n>=0}function i1(n,s){if(n===s)return!0;if(n.length!==s.length)return!1;for(let r=0;r<n.length;r++)if(n[r]!==s[r])return!1;return!0}function o1(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const cg=n=>{let{rects:s,activeIndex:r,overIndex:o,index:a}=n;const u=ag(s,o,r),f=s[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},bh=n=>{var s;let{activeIndex:r,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(s=u[r])!=null?s:o;if(!h)return null;if(a===r){const g=u[f];return g?{x:0,y:r<f?g.top+g.height-(h.top+h.height):g.top-h.top,...Nl}:null}const m=l1(u,a,r);return a>r&&a<=f?{x:0,y:-h.height-m,...Nl}:a<r&&a>=f?{x:0,y:h.height+m,...Nl}:{x:0,y:0,...Nl}};function l1(n,s,r){const o=n[s],a=n[s-1],u=n[s+1];return o?r<s?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 ug="Sortable",dg=at.createContext({activeIndex:-1,containerId:ug,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cg,disabled:{draggable:!1,droppable:!1}});function Nh(n){let{children:s,id:r,items:o,strategy:a=cg,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:m,over:g,measureDroppableContainers:x}=og(),w=po(ug,r),y=h.rect!==null,N=k.useMemo(()=>o.map(q=>typeof q=="object"&&"id"in q?q.id:q),[o]),j=f!=null,E=f?N.indexOf(f.id):-1,T=g?N.indexOf(g.id):-1,L=k.useRef(N),M=!i1(N,L.current),W=T!==-1&&E===-1||M,D=o1(u);ss(()=>{M&&j&&x(N)},[M,N,j,x]),k.useEffect(()=>{L.current=N},[N]);const B=k.useMemo(()=>({activeIndex:E,containerId:w,disabled:D,disableTransforms:W,items:N,overIndex:T,useDragOverlay:y,sortedRects:r1(N,m),strategy:a}),[E,w,D.draggable,D.droppable,W,N,T,m,y,a]);return at.createElement(dg.Provider,{value:B},s)}const a1=n=>{let{id:s,items:r,activeIndex:o,overIndex:a}=n;return ag(r,o,a).indexOf(s)},c1=n=>{let{containerId:s,isSorting:r,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:m,transition:g}=n;return!g||!o||h!==u&&a===f?!1:r?!0:f!==a&&s===m},u1={duration:200,easing:"ease"},fg="transform",d1=js.Transition.toString({property:fg,duration:0,easing:"linear"}),f1={roleDescription:"sortable"};function p1(n){let{disabled:s,index:r,node:o,rect:a}=n;const[u,f]=k.useState(null),h=k.useRef(r);return ss(()=>{if(!s&&r!==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)}}r!==h.current&&(h.current=r)},[s,r,o,a]),k.useEffect(()=>{u&&f(null)},[u]),u}function pg(n){let{animateLayoutChanges:s=c1,attributes:r,disabled:o,data:a,getNewIndex:u=a1,id:f,strategy:h,resizeObserverConfig:m,transition:g=u1}=n;const{items:x,containerId:w,activeIndex:y,disabled:N,disableTransforms:j,sortedRects:E,overIndex:T,useDragOverlay:L,strategy:M}=k.useContext(dg),W=h1(o,N),D=x.indexOf(f),B=k.useMemo(()=>({sortable:{containerId:w,index:D,items:x},...a}),[w,a,D,x]),q=k.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:K,node:G,isOver:oe,setNodeRef:ue}=lg({id:f,data:B,disabled:W.droppable,resizeObserverConfig:{updateMeasurementsFor:q,...m}}),{active:ie,activatorEvent:Te,activeNodeRect:Ne,attributes:Fe,setNodeRef:Q,listeners:ne,isDragging:ae,over:O,setActivatorNodeRef:J,transform:H}=Bw({id:f,data:B,attributes:{...f1,...r},disabled:W.draggable}),b=b0(ue,Q),R=!!ie,te=R&&!j&&bl(y)&&bl(T),ce=!L&&ae,ge=ce&&te?H:null,Oe=te?ge??(h??M)({rects:E,activeNodeRect:Ne,activeIndex:y,overIndex:T,index:D}):null,Re=bl(y)&&bl(T)?u({id:f,items:x,activeIndex:y,overIndex:T}):D,je=ie==null?void 0:ie.id,be=k.useRef({activeId:je,items:x,newIndex:Re,containerId:w}),mt=x!==be.current.items,Me=s({active:ie,containerId:w,isDragging:ae,isSorting:R,id:f,index:D,items:x,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:g,wasDragging:be.current.activeId!=null}),jt=p1({disabled:!Me,index:D,node:G,rect:K});return k.useEffect(()=>{R&&be.current.newIndex!==Re&&(be.current.newIndex=Re),w!==be.current.containerId&&(be.current.containerId=w),x!==be.current.items&&(be.current.items=x)},[R,Re,w,x]),k.useEffect(()=>{if(je===be.current.activeId)return;if(je!=null&&be.current.activeId==null){be.current.activeId=je;return}const zt=setTimeout(()=>{be.current.activeId=je},50);return()=>clearTimeout(zt)},[je]),{active:ie,activeIndex:y,attributes:Fe,data:B,rect:K,index:D,newIndex:Re,items:x,isOver:oe,isSorting:R,isDragging:ae,listeners:ne,node:G,overIndex:T,over:O,setNodeRef:b,setActivatorNodeRef:J,setDroppableNodeRef:ue,setDraggableNodeRef:Q,transform:jt??Oe,transition:ze()};function ze(){if(jt||mt&&be.current.newIndex===D)return d1;if(!(ce&&!ua(Te)||!g)&&(R||Me))return js.Transition.toString({...g,property:fg})}}function h1(n,s){var r,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(r=n==null?void 0:n.draggable)!=null?r:s.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:s.droppable}}it.Down,it.Right,it.Up,it.Left;function Cl(n){const[s,r]=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=>{r(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[s,o]}async function Eu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.select();const r=document.execCommand("copy");return document.body.removeChild(s),r}catch{return!1}}}function Ql(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Ch(n,s){if(!s||!n.cwd)return!1;const r=Ql(n.cwd),o=Ql(s);return r.startsWith(`${o}/`)}function m1(n,s){const r=new Map;for(const f of s){const h=f.cwd||"(no directory)",m=r.get(h)??[];m.push(f),r.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:r.get(f.path)??[],workspace:f})}for(const[f,h]of r)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 to(n){return[...n].sort((s,r)=>r.sort_order-s.sort_order||(s.created_at<r.created_at?1:-1))}function Eh(n,s,r,o){const a=s.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&r.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function _h(n,s){return{working:to(n.sessions.filter(r=>r.lifecycle!=="finished")),finished:to(n.sessions.filter(r=>r.lifecycle==="finished")),finishedCollapsed:s.has(n.finishedKey)}}function El(n,s){return n.folder_id&&s.has(n.folder_id)?n.folder_id:null}function g1(n){const s=new Set(n.map(o=>o.name));if(!s.has("New Folder"))return"New Folder";let r=2;for(;s.has(`New Folder ${r}`);)r++;return`New Folder ${r}`}function jh({id:n,children:s,className:r}){const{setNodeRef:o,isOver:a}=lg({id:n});return c.jsx("div",{ref:o,className:`${r??""}${a?" drop-over":""}`,children:s})}function v1({s:n,isActive:s,isSelected:r,appIcon:o,renaming:a,renameValue:u,renameRef:f,onRenameValue:h,onRenameConfirm:m,onRenameCancel:g,onSelect:x,onCtxMenu:w,onToggleStar:y}){const{attributes:N,listeners:j,setNodeRef:E,transform:T,transition:L,isDragging:M}=pg({id:`s:${n.id}`}),W=ra(n);return c.jsxs("div",{ref:E,style:{transform:js.Transform.toString(T),transition:L},className:`tree-item ${s?"active":""}${r?" selected":""} ${W.isFinished?"tree-item-finished":""}${M?" dragging":""}${n.starred?" tree-item-starred":""}`,...N,...j,onClick:x,onContextMenu:w,children:[c.jsx(Yu,{iconClass:W.iconClass,iconText:W.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:D=>h(D.target.value),onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation(),onKeyDown:D=>{D.key==="Enter"&&m(),D.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:D=>{D.stopPropagation(),y()},onPointerDown:D=>D.stopPropagation(),children:c.jsx(Hl,{size:10,fill:n.starred?"currentColor":"none"})}),W.dot&&c.jsx(oa,{status:W.dot})]})}function y1({folder:n,count:s,collapsed:r,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:m,onToggle:g,onCtxMenu:x,children:w}){const{attributes:y,listeners:N,setNodeRef:j,transform:E,transition:T,isDragging:L,over:M}=pg({id:`f:${n.id}`}),W=M!=null&&String(M.id).startsWith("s:");return c.jsxs("div",{ref:j,style:{transform:js.Transform.toString(E),transition:T},className:`tree-folder ${r?"collapsed":""}${L?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${W?" drop-over":""}`,...y,...N,onClick:()=>{o||g()},onContextMenu:x,children:o?c.jsx("input",{ref:u,className:"tree-rename-input",value:a,onChange:D=>f(D.target.value),onClick:D=>D.stopPropagation(),onPointerDown:D=>D.stopPropagation(),onKeyDown:D=>{D.key==="Enter"&&h(),D.key==="Escape"&&m()},onBlur:h}):c.jsxs(c.Fragment,{children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx(Tu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:s})]})}),!r&&c.jsx("div",{className:"tree-folder-children",children:w})]})}function x1(){const n=P(I=>I.sessions),s=P(I=>I.workspaces),r=P(I=>I.folders),o=P(I=>I.activeSessionId),a=P(I=>I.selectSession),u=P(I=>I.deleteSession),f=P(I=>I.removeWorkspace),h=P(I=>I.createSessionInWorkspace),m=P(I=>I.pickAndAddWorkspace),g=P(I=>I.renameSession),x=P(I=>I.markFinished),w=P(I=>I.markFinishedMany),y=P(I=>I.toggleStar),N=P(I=>I.reopenSession),j=P(I=>I.reopenSessionMany),E=P(I=>I.deleteSessionMany),T=P(I=>I.createSidebarFolder),L=P(I=>I.renameFolder),M=P(I=>I.deleteFolder),W=P(I=>I.applyMoves),D=P(I=>I.reorderFolders),B=P(I=>I.apps),q=P(I=>I.appsRootPath),K=P(I=>I.activeAppTabId),G=P(I=>I.openAppTab),oe=P(I=>I.startAppEdit),ue=P(I=>I.toggleAppPin),ie=P(I=>I.deleteApp),Te=P(I=>I.openAppCatalog),[Ne,Fe]=Cl("agentpane:sidebar-ws-collapsed"),[Q,ne]=Cl("agentpane:sidebar-sub-collapsed"),[ae,O]=Cl("agentpane:sidebar-folders-collapsed"),[J,H]=Cl("agentpane:sidebar-app-edits-collapsed"),[b,R]=k.useState(null),[te,ce]=k.useState(null),[ge,ye]=k.useState(""),[Oe,Re]=k.useState(null),[je,be]=k.useState(new Set),[mt,Me]=k.useState(null),jt=k.useRef(null),ze=k.useRef(null),zt=$0(z0(sd,{activationConstraint:{distance:5}}));function We(){be(new Set),Me(null)}ia(jt,()=>R(null),!!b),Ku(()=>{R(null),We()},!!b||je.size>0);const Wt=k.useMemo(()=>new Map(n.map(I=>[I.id,I])),[n]),Rt=k.useMemo(()=>new Map(r.map(I=>[I.id,I])),[r]),gt=k.useMemo(()=>{const I=new Map;for(const _e of[...r].sort((le,xe)=>le.sort_order-xe.sort_order)){const le=I.get(_e.workspace_path)??[];le.push(_e),I.set(_e.workspace_path,le)}return I},[r]);function At(I){Fe(_e=>{const le=new Set(_e);return le.has(I)?le.delete(I):le.add(I),le})}function $t(I){ne(_e=>{const le=new Set(_e);return le.has(I)?le.delete(I):le.add(I),le})}function V(I){O(_e=>{const le=new Set(_e);return le.has(I)?le.delete(I):le.add(I),le})}function he(I){H(_e=>{const le=new Set(_e);return le.has(I)?le.delete(I):le.add(I),le})}k.useEffect(()=>{te&&ze.current&&(ze.current.focus(),ze.current.select())},[te]);function Ue(I,_e,le,xe=""){ce({kind:I,id:_e}),ye(le||xe)}function Ze(){if(te){const I=ge.trim();I&&(te.kind==="session"?g(te.id,I):L(te.id,I))}ce(null)}function vt(){ce(null),ye("")}async function yt(I){const _e=g1(gt.get(I)??[]),le=await T(I,_e);le&&Ue("folder",le.id,le.name)}function dt(I){const _e=String(I.active.id);if(_e.startsWith("s:")){const le=Wt.get(_e.slice(2));le&&Re({kind:"session",label:le.title||le.id.slice(0,8)})}else if(_e.startsWith("f:")){const le=Rt.get(_e.slice(2));le&&Re({kind:"folder",label:le.name})}}function Xt(I){Re(null);const{active:_e,over:le}=I;if(!le)return;const xe=String(_e.id),we=String(le.id);if(xe.startsWith("s:")){const Le=Wt.get(xe.slice(2));if(!Le)return;const ke=Le.cwd||"(no directory)",Ve=El(Le,Rt);let ot,tt;if(we.startsWith("f:")){const Be=Rt.get(we.slice(2));if(!Be)return;ot=Be.workspace_path,tt=Be.id}else if(we.startsWith("s:")){const Be=Wt.get(we.slice(2));if(!Be)return;ot=Be.cwd||"(no directory)",tt=El(Be,Rt)}else if(we.startsWith("c:")){const Be=we.slice(2),Ke=Be.lastIndexOf("|");ot=Be.slice(0,Ke);const Lt=Be.slice(Ke+1);tt=Lt==="root"?null:Lt}else return;if(ot!==ke)return;const nt=to(n.filter(Be=>(Be.cwd||"(no directory)")===ot&&El(Be,Rt)===tt)),It=nt.filter(Be=>Be.id!==Le.id);let st=It.length;if(we.startsWith("s:")){const Be=It.findIndex(Ke=>Ke.id===we.slice(2));Be>=0&&(st=Be)}const wt=[...It.slice(0,st),Le,...It.slice(st)],kt=[];if(tt===Ve){if(wt.length===nt.length&&wt.every((Be,Ke)=>Be.id===nt[Ke].id))return;wt.forEach((Be,Ke)=>kt.push({id:Be.id,folder_id:tt,sort_order:wt.length-1-Ke}))}else{const Be=to(n.filter(Ke=>(Ke.cwd||"(no directory)")===ke&&El(Ke,Rt)===Ve)).filter(Ke=>Ke.id!==Le.id);Be.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:Ve,sort_order:Be.length-1-Lt})),wt.forEach((Ke,Lt)=>kt.push({id:Ke.id,folder_id:tt,sort_order:wt.length-1-Lt}))}W(kt);return}if(xe.startsWith("f:")){if(!we.startsWith("f:"))return;const Le=Rt.get(xe.slice(2)),ke=Rt.get(we.slice(2));if(!Le||!ke||Le.id===ke.id||Le.workspace_path!==ke.workspace_path)return;const Ve=(gt.get(Le.workspace_path)??[]).map(nt=>nt.id),ot=Ve.indexOf(Le.id),tt=Ve.indexOf(ke.id);Ve.splice(tt,0,...Ve.splice(ot,1)),D(Ve)}}const sn=m1(s,q?n.filter(I=>!Ch(I,q)):n),xt=k.useMemo(()=>{const I=new Map;if(!q)return I;const _e=Ql(q);for(const le of n){if(!Ch(le,q))continue;const xe=Ql(le.cwd).slice(_e.length+1).split("/")[0],we=I.get(xe)??[];we.push(le),I.set(xe,we)}for(const[le,xe]of I)I.set(le,to(xe));return I},[n,q]),un=[];for(const I of sn){if(Ne.has(I.path))continue;const _e=gt.get(I.path)??[],le=new Set(_e.map(xe=>xe.id));for(const xe of Eh(I,_e,le,ae)){if(xe.hidden)continue;const{working:we,finished:Le,finishedCollapsed:ke}=_h(xe,Q);un.push(...we.map(Ve=>Ve.id)),ke||un.push(...Le.map(Ve=>Ve.id))}}const yn=n.filter(I=>je.has(I.id)),Gn=yn.filter(I=>I.lifecycle!=="finished").map(I=>I.id),Mn=yn.filter(I=>I.lifecycle==="finished").map(I=>I.id);function Ln(I){const _e=I.origin_app_id?B.find(xe=>xe.id===I.origin_app_id):null,le=xe=>{if(xe.metaKey||xe.ctrlKey){xe.preventDefault(),Me(I.id),be(we=>{const Le=new Set(we);return Le.has(I.id)?Le.delete(I.id):Le.add(I.id),Le});return}if(xe.shiftKey){xe.preventDefault();const we=mt??I.id;Me(we);const Le=un.indexOf(we),ke=un.indexOf(I.id);if(Le>=0&&ke>=0){const[Ve,ot]=Le<ke?[Le,ke]:[ke,Le];be(new Set(un.slice(Ve,ot+1)))}return}We(),Me(I.id),a(I.id)};return c.jsx(v1,{s:I,isActive:o===I.id,isSelected:je.has(I.id),appIcon:_e?_e.icon??"◧":null,renaming:(te==null?void 0:te.kind)==="session"&&te.id===I.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onSelect:le,onToggleStar:()=>y(I.id),onCtxMenu:xe=>{xe.preventDefault();const we=je.has(I.id)&&je.size>1;je.has(I.id)||(be(new Set),Me(I.id)),R({x:xe.clientX,y:xe.clientY,type:"session",sessionId:I.id,sessionTitle:I.title,sessionLifecycle:I.lifecycle,sessionExternalId:I.external_thread_id,multi:we})}},I.id)}function Pn(I){const{working:_e,finished:le,finishedCollapsed:xe}=_h(I,Q),we=[..._e,...le].map(Le=>`s:${Le.id}`);return c.jsxs(Nh,{items:we,strategy:bh,children:[_e.length===0&&le.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):_e.map(Ln),le.length>0&&c.jsxs("div",{className:`tree-subgroup ${xe?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>$t(I.finishedKey),children:[c.jsx(si,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:le.length})]}),!xe&&c.jsx("div",{className:"tree-subgroup-items",children:le.map(Ln)})]})]})}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(yr,{size:14})})]}),c.jsxs($w,{sensors:zt,collisionDetection:V0,onDragStart:dt,onDragEnd:Xt,children:[sn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):sn.map(I=>{const _e=Ne.has(I.path),le=gt.get(I.path)??[],xe=new Set(le.map(ke=>ke.id)),we=Eh(I,le,xe,ae),Le=we[we.length-1];return c.jsxs("div",{className:`tree-section ${_e?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>At(I.path),onContextMenu:ke=>{ke.preventDefault(),R({x:ke.clientX,y:ke.clientY,type:"workspace",path:I.path})},children:[c.jsx(si,{size:9,className:"tree-chevron"}),c.jsx(Tu,{size:14}),c.jsx("span",{className:"tree-section-label",children:I.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:ke=>{ke.stopPropagation(),h(I.path)},children:c.jsx(yr,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:ke=>{ke.stopPropagation(),yt(I.path)},children:c.jsx(ru,{size:11})}),c.jsx("span",{className:"tree-count",children:I.sessions.length})]}),!_e&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Nh,{items:le.map(ke=>`f:${ke.id}`),strategy:bh,children:we.filter(ke=>ke.folder).map(ke=>c.jsx(y1,{folder:ke.folder,count:ke.sessions.length,collapsed:ke.hidden,renaming:(te==null?void 0:te.kind)==="folder"&&te.id===ke.folder.id,renameValue:ge,renameRef:ze,onRenameValue:ye,onRenameConfirm:Ze,onRenameCancel:vt,onToggle:()=>V(ke.folder.id),onCtxMenu:Ve=>{Ve.preventDefault(),R({x:Ve.clientX,y:Ve.clientY,type:"folder",folderId:ke.folder.id,folderName:ke.folder.name})},children:c.jsx(jh,{id:`c:${I.path}|${ke.folder.id}`,children:Pn(ke)})},ke.folder.id))}),c.jsx(jh,{id:`c:${I.path}|root`,children:Pn(Le)})]})]},I.path)}),c.jsx(s1,{children:Oe&&c.jsxs("div",{className:"drag-overlay",children:[Oe.kind==="folder"&&c.jsx(Tu,{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:()=>Te(),children:c.jsx(yr,{size:14})})]}),B.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),B.map(I=>{const _e=xt.get(I.id)??[],le=_e.length>0&&!J.has(I.id);return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${K===I.id?" active":""}`,title:I.description??void 0,onClick:()=>G(I.id),onContextMenu:xe=>{xe.preventDefault(),R({x:xe.clientX,y:xe.clientY,type:"app",appId:I.id,appPinned:I.pinned})},children:[_e.length>0&&c.jsx("button",{className:`sidebar-app-chevron${le?"":" closed"}`,title:"Edit sessions of this app",onClick:xe=>{xe.stopPropagation(),he(I.id)},children:c.jsx(si,{size:10,className:"tree-chevron"})}),c.jsx("span",{className:"sidebar-app-icon",children:I.icon??"◧"}),c.jsx("span",{className:"tree-label",children:I.title}),_e.length>0&&c.jsx("span",{className:"sidebar-app-count",children:_e.length}),I.pinned&&c.jsx(Hl,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),le&&c.jsx("div",{className:"sidebar-app-edits",children:_e.map(xe=>{const we=ra(xe);return c.jsxs("div",{className:`sidebar-app-edit-row${o===xe.id?" active":""}`,title:"App edit session — click to open",onClick:()=>a(xe.id),children:[c.jsx(Yu,{iconClass:we.iconClass,iconText:we.iconText,size:14}),c.jsx("span",{className:"tree-label",children:xe.title||xe.id.slice(0,8)}),we.dot&&c.jsx(oa,{status:we.dot})]},xe.id)})})]},I.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(ru,{size:14}),c.jsx("span",{children:"Add workspace"})]}),b&&c.jsxs("div",{ref:jt,className:"ctx-menu",style:{position:"fixed",left:b.x,top:b.y,zIndex:500},children:[b.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{h(b.path),R(null)},children:[c.jsx(yr,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{yt(b.path),R(null)},children:[c.jsx(ru,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(b.path),R(null)},children:[c.jsx(fs,{size:12})," Hide Workspace"]})]}),b.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("folder",b.folderId,b.folderName??""),R(null)},children:[c.jsx(Ml,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{M(b.folderId),R(null)},children:[c.jsx(fs,{size:12})," Delete Folder"]})]}),b.type==="session"&&!b.multi&&c.jsx(c.Fragment,{children:b.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ue("session",b.sessionId,b.sessionTitle??""),R(null)},children:[c.jsx(Ml,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(b.sessionId),R(null)},children:[c.jsx(Wl,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),R(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{N(b.sessionId),R(null)},children:[c.jsx(oo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${b.sessionExternalId?"":" ctx-disabled"}`,title:b.sessionExternalId?void 0:"Session not started",onClick:()=>{b.sessionExternalId&&(Eu(b.sessionExternalId),R(null))},children:[c.jsx(Su,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{u(b.sessionId),R(null)},children:[c.jsx(fs,{size:12})," Delete Session"]})]})}),b.type==="session"&&b.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[yn.length," sessions selected"]}),Gn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{w(Gn),R(null),We()},children:[c.jsx(Wl,{size:12})," Mark ",Gn.length," as Finished"]}),Mn.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{j(Mn),R(null),We()},children:[c.jsx(oo,{size:12})," Reopen ",Mn.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{E([...je]),R(null),We()},children:[c.jsx(fs,{size:12})," Delete ",yn.length," Sessions"]})]}),b.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{oe(b.appId),R(null)},children:[c.jsx(Ml,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{ue(b.appId),R(null)},children:[c.jsx(Hl,{size:12})," ",b.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{ie(b.appId),R(null)},children:[c.jsx(fs,{size:12})," Delete App"]})]})]})]})}function w1(){const n=P(y=>y.openTabs),s=P(y=>y.activeSessionId),r=P(y=>y.sessions),o=P(y=>y.selectSession),a=P(y=>y.closeTab),u=P(y=>y.setShowNewSessionDialog),f=P(y=>y.apps),h=P(y=>y.openAppTabs),m=P(y=>y.activeAppTabId),g=P(y=>y.openAppTab),x=P(y=>y.closeAppTab),w=P(y=>y.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(y=>{const N=r.find(T=>T.id===y);if(!N)return null;const j=ra(N),E=s===y&&m==null;return c.jsxs("div",{className:`ide-tab ${E?"active":""}`,onClick:()=>{m!=null&&w(null),o(y)},children:[c.jsx(Yu,{iconClass:j.iconClass,iconText:j.iconText,size:14}),N.title||y.slice(0,8),j.dot&&c.jsx(oa,{status:j.dot}),c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),a(y)},children:c.jsx(Vn,{size:12})})]},y)}),h.map(y=>{const N=f.find(E=>E.id===y),j=m===y;return c.jsxs("div",{className:`ide-tab ${j?"active":""}`,onClick:()=>g(y),children:[N!=null&&N.icon?c.jsx("span",{className:"miniapp-tab-icon",children:N.icon}):c.jsx(r0,{size:12}),(N==null?void 0:N.title)??y,c.jsx("span",{className:"ide-tab-close",onClick:E=>{E.stopPropagation(),x(y)},children:c.jsx(Vn,{size:12})})]},y)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>u(!0),children:c.jsx(yr,{size:14})})]})}function id(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kr=id();function hg(n){kr=n}var no={exec:()=>null};function lt(n,s=""){let r=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(mn.caret,"$1"),r=r.replace(a,f),o},getRegex:()=>new RegExp(r,s)};return o}var mn={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")},k1=/^(?:[ \t]*(?:\n|$))+/,S1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,T1=/^ {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+|$)/,b1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,od=/(?:[*+-]|\d{1,9}[.)])/,mg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gg=lt(mg).replace(/bull/g,od).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(),N1=lt(mg).replace(/bull/g,od).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(),ld=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,C1=/^[^\n]+/,ad=/(?!\s*\])(?:\\.|[^\[\]\\])+/,E1=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ad).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_1=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,od).getRegex(),pa="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",cd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,j1=lt("^ {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",cd).replace("tag",pa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vg=lt(ld).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",pa).getRegex(),R1=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vg).getRegex(),ud={blockquote:R1,code:S1,def:E1,fences:T1,heading:b1,hr:mo,html:j1,lheading:gg,list:_1,newline:k1,paragraph:vg,table:no,text:C1},Rh=lt("^ *([^\\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",pa).getRegex(),A1={...ud,lheading:N1,table:Rh,paragraph:lt(ld).replace("hr",mo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Rh).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",pa).getRegex()},I1={...ud,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",cd).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:no,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(ld).replace("hr",mo).replace("heading",` *#{1,6} *[^
|
|
359
|
+
]`).replace("lheading",gg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},D1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,M1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yg=/^( {2,}|\\)\n(?!\s*$)/,L1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ha=/[\p{P}\p{S}]/u,dd=/[\s\p{P}\p{S}]/u,xg=/[^\s\p{P}\p{S}]/u,P1=lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,dd).getRegex(),wg=/(?!~)[\p{P}\p{S}]/u,O1=/(?!~)[\s\p{P}\p{S}]/u,z1=/(?:[^\s\p{P}\p{S}]|~)/u,$1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,kg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F1=lt(kg,"u").replace(/punct/g,ha).getRegex(),U1=lt(kg,"u").replace(/punct/g,wg).getRegex(),Sg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",B1=lt(Sg,"gu").replace(/notPunctSpace/g,xg).replace(/punctSpace/g,dd).replace(/punct/g,ha).getRegex(),W1=lt(Sg,"gu").replace(/notPunctSpace/g,z1).replace(/punctSpace/g,O1).replace(/punct/g,wg).getRegex(),H1=lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xg).replace(/punctSpace/g,dd).replace(/punct/g,ha).getRegex(),V1=lt(/\\(punct)/,"gu").replace(/punct/g,ha).getRegex(),G1=lt(/^<(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(),q1=lt(cd).replace("(?:-->|$)","-->").getRegex(),K1=lt("^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",q1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Y1=lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Zl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tg=lt(/^!?\[(label)\]\[(ref)\]/).replace("label",Zl).replace("ref",ad).getRegex(),bg=lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",ad).getRegex(),X1=lt("reflink|nolink(?!\\()","g").replace("reflink",Tg).replace("nolink",bg).getRegex(),fd={_backpedal:no,anyPunctuation:V1,autolink:G1,blockSkip:$1,br:yg,code:M1,del:no,emStrongLDelim:F1,emStrongRDelimAst:B1,emStrongRDelimUnd:H1,escape:D1,link:Y1,nolink:bg,punctuation:P1,reflink:Tg,reflinkSearch:X1,tag:K1,text:L1,url:no},Q1={...fd,link:lt(/^!?\[(label)\]\((.*?)\)/).replace("label",Zl).getRegex(),reflink:lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zl).getRegex()},_u={...fd,emStrongRDelimAst:W1,emStrongLDelim:U1,url:lt(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Z1={..._u,br:lt(yg).replace("{2,}","*").getRegex(),text:lt(_u.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_l={normal:ud,gfm:A1,pedantic:I1},Gi={normal:fd,gfm:_u,breaks:Z1,pedantic:Q1},J1={"&":"&","<":"<",">":">",'"':""","'":"'"},Ah=n=>J1[n];function ds(n,s){if(s){if(mn.escapeTest.test(n))return n.replace(mn.escapeReplace,Ah)}else if(mn.escapeTestNoEncode.test(n))return n.replace(mn.escapeReplaceNoEncode,Ah);return n}function Ih(n){try{n=encodeURI(n).replace(mn.percentDecode,"%")}catch{return null}return n}function Dh(n,s){var u;const r=n.replace(mn.findPipe,(f,h,m)=>{let g=!1,x=h;for(;--x>=0&&m[x]==="\\";)g=!g;return g?"|":" |"}),o=r.split(mn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),s)if(o.length>s)o.splice(s);else for(;o.length<s;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(mn.slashPipe,"|");return o}function qi(n,s,r){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===s;)a++;return n.slice(0,o-a)}function ek(n,s){if(n.indexOf(s[1])===-1)return-1;let r=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===s[0])r++;else if(n[o]===s[1]&&(r--,r<0))return o;return r>0?-2:-1}function Mh(n,s,r,o,a){const u=s.href,f=s.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const m={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,m}function tk(n,s,r){const o=n.match(r.other.indentCodeCompensation);if(o===null)return s;const a=o[1];return s.split(`
|
|
360
|
+
`).map(u=>{const f=u.match(r.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
361
|
+
`)}var Jl=class{constructor(n){ct(this,"options");ct(this,"rules");ct(this,"lexer");this.options=n||kr}space(n){const s=this.rules.block.newline.exec(n);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(n){const s=this.rules.block.code.exec(n);if(s){const r=s[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?r:qi(r,`
|
|
362
|
+
`)}}}fences(n){const s=this.rules.block.fences.exec(n);if(s){const r=s[0],o=tk(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:o}}}heading(n){const s=this.rules.block.heading.exec(n);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){const o=qi(r,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(r=o.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){const s=this.rules.block.hr.exec(n);if(s)return{type:"hr",raw:qi(s[0],`
|
|
363
|
+
`)}}blockquote(n){const s=this.rules.block.blockquote.exec(n);if(s){let r=qi(s[0],`
|
|
364
|
+
`).split(`
|
|
365
|
+
`),o="",a="";const u=[];for(;r.length>0;){let f=!1;const h=[];let m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))h.push(r[m]),f=!0;else if(!f)h.push(r[m]);else break;r=r.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,r.length===0)break;const y=u.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){const N=y,j=N.raw+`
|
|
370
|
+
`+r.join(`
|
|
371
|
+
`),E=this.blockquote(j);u[u.length-1]=E,o=o.substring(0,o.length-N.raw.length)+E.raw,a=a.substring(0,a.length-N.text.length)+E.text;break}else if((y==null?void 0:y.type)==="list"){const N=y,j=N.raw+`
|
|
372
|
+
`+r.join(`
|
|
373
|
+
`),E=this.list(j);u[u.length-1]=E,o=o.substring(0,o.length-y.raw.length)+E.raw,a=a.substring(0,a.length-N.raw.length)+E.raw,r=j.substring(u.at(-1).raw.length).split(`
|
|
374
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let s=this.rules.block.list.exec(n);if(s){let r=s[1].trim();const o=r.length>1,a={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const u=this.rules.other.listItemRegex(r);let f=!1;for(;n;){let m=!1,g="",x="";if(!(s=u.exec(n))||this.rules.block.hr.test(n))break;g=s[0],n=n.substring(g.length);let w=s[2].split(`
|
|
375
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,L=>" ".repeat(3*L.length)),y=n.split(`
|
|
376
|
+
`,1)[0],N=!w.trim(),j=0;if(this.options.pedantic?(j=2,x=w.trimStart()):N?j=s[1].length+1:(j=s[2].search(this.rules.other.nonSpaceChar),j=j>4?1:j,x=w.slice(j),j+=s[1].length),N&&this.rules.other.blankLine.test(y)&&(g+=y+`
|
|
377
|
+
`,n=n.substring(y.length+1),m=!0),!m){const L=this.rules.other.nextBulletRegex(j),M=this.rules.other.hrRegex(j),W=this.rules.other.fencesBeginRegex(j),D=this.rules.other.headingBeginRegex(j),B=this.rules.other.htmlBeginRegex(j);for(;n;){const q=n.split(`
|
|
378
|
+
`,1)[0];let K;if(y=q,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),K=y):K=y.replace(this.rules.other.tabCharGlobal," "),W.test(y)||D.test(y)||B.test(y)||L.test(y)||M.test(y))break;if(K.search(this.rules.other.nonSpaceChar)>=j||!y.trim())x+=`
|
|
379
|
+
`+K.slice(j);else{if(N||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||W.test(w)||D.test(w)||M.test(w))break;x+=`
|
|
380
|
+
`+y}!N&&!y.trim()&&(N=!0),g+=q+`
|
|
381
|
+
`,n=n.substring(q.length+1),w=K.slice(j)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(f=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(x),E&&(T=E[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:g,task:!!E,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 s=this.rules.block.html.exec(n);if(s)return{type:"html",block:!0,raw:s[0],pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:s[0]}}def(n){const s=this.rules.block.def.exec(n);if(s){const r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:s[0],href:o,title:a}}}table(n){var f;const s=this.rules.block.table.exec(n);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;const r=Dh(s[1]),o=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=s[3])!=null&&f.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
382
|
+
`):[],u={type:"table",raw:s[0],header:[],align:[],rows:[]};if(r.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<r.length;h++)u.header.push({text:r[h],tokens:this.lexer.inline(r[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Dh(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 s=this.rules.block.lheading.exec(n);if(s)return{type:"heading",raw:s[0],depth:s[2].charAt(0)==="="?1:2,text:s[1],tokens:this.lexer.inline(s[1])}}paragraph(n){const s=this.rules.block.paragraph.exec(n);if(s){const r=s[1].charAt(s[1].length-1)===`
|
|
383
|
+
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(n){const s=this.rules.block.text.exec(n);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(n){const s=this.rules.inline.escape.exec(n);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(n){const s=this.rules.inline.tag.exec(n);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(n){const s=this.rules.inline.link.exec(n);if(s){const r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const u=qi(r.slice(0,-1),"\\");if((r.length-u.length)%2===0)return}else{const u=ek(s[2],"()");if(u===-2)return;if(u>-1){const h=(s[0].indexOf("!")===0?5:4)+s[1].length+u;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let o=s[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=s[3]?s[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?o=o.slice(1):o=o.slice(1,-1)),Mh(s,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(n,s){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){const o=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=s[o.toLowerCase()];if(!a){const u=r[0].charAt(0);return{type:"text",raw:u,text:u}}return Mh(r,a,r[0],this.lexer,this.rules)}}emStrong(n,s,r=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const u=[...o[0]].length-1;let f,h,m=u,g=0;const x=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*n.length+u);(o=x.exec(s))!=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 j=y.slice(1,-1);return{type:"em",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}const N=y.slice(2,-2);return{type:"strong",raw:y,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(n){const s=this.rules.inline.code.exec(n);if(s){let r=s[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(r),a=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return o&&a&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:s[0],text:r}}}br(n){const s=this.rules.inline.br.exec(n);if(s)return{type:"br",raw:s[0]}}del(n){const s=this.rules.inline.del.exec(n);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}}autolink(n){const s=this.rules.inline.autolink.exec(n);if(s){let r,o;return s[2]==="@"?(r=s[1],o="mailto:"+r):(r=s[1],o=r),{type:"link",raw:s[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let s;if(s=this.rules.inline.url.exec(n)){let o,a;if(s[2]==="@")o=s[0],a="mailto:"+o;else{let u;do u=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(u!==s[0]);o=s[0],s[1]==="www."?a="http://"+s[0]:a=s[0]}return{type:"link",raw:s[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const s=this.rules.inline.text.exec(n);if(s){const r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Es=class ju{constructor(s){ct(this,"tokens");ct(this,"options");ct(this,"state");ct(this,"tokenizer");ct(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||kr,this.options.tokenizer=this.options.tokenizer||new Jl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const r={other:mn,block:_l.normal,inline:Gi.normal};this.options.pedantic?(r.block=_l.pedantic,r.inline=Gi.pedantic):this.options.gfm&&(r.block=_l.gfm,this.options.breaks?r.inline=Gi.breaks:r.inline=Gi.gfm),this.tokenizer.rules=r}static get rules(){return{block:_l,inline:Gi}}static lex(s,r){return new ju(r).lex(s)}static lexInline(s,r){return new ju(r).inlineTokens(s)}lex(s){s=s.replace(mn.carriageReturn,`
|
|
384
|
+
`),this.blockTokens(s,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const o=this.inlineQueue[r];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(s,r=[],o=!1){var a,u,f;for(this.options.pedantic&&(s=s.replace(mn.tabCharGlobal," ").replace(mn.spaceLine,""));s;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(g=>(h=g.call({lexer:this},s,r))?(s=s.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.space(s)){s=s.substring(h.raw.length);const g=r.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
385
|
+
`:r.push(h);continue}if(h=this.tokenizer.code(s)){s=s.substring(h.raw.length);const g=r.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):r.push(h);continue}if(h=this.tokenizer.fences(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.heading(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.hr(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.blockquote(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.list(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.html(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.def(s)){s=s.substring(h.raw.length);const g=r.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(s)){s=s.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.lheading(s)){s=s.substring(h.raw.length),r.push(h);continue}let m=s;if((f=this.options.extensions)!=null&&f.startBlock){let g=1/0;const x=s.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=s.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){const g=r.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):r.push(h),o=m.length!==s.length,s=s.substring(h.raw.length);continue}if(h=this.tokenizer.text(s)){s=s.substring(h.raw.length);const g=r.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):r.push(h);continue}if(s){const g="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var h,m,g;let o=s,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(;s;){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},s,r))?(s=s.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(x.raw.length);const y=r.at(-1);x.type==="text"&&(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(s,o,f)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(s)){s=s.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(s)){s=s.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(s))){s=s.substring(x.raw.length),r.push(x);continue}let w=s;if((g=this.options.extensions)!=null&&g.startInline){let y=1/0;const N=s.slice(1);let j;this.options.extensions.startInline.forEach(E=>{j=E.call({lexer:this},N),typeof j=="number"&&j>=0&&(y=Math.min(y,j))}),y<1/0&&y>=0&&(w=s.substring(0,y+1))}if(x=this.tokenizer.inlineText(w)){s=s.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(f=x.raw.slice(-1)),u=!0;const y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=x.raw,y.text+=x.text):r.push(x);continue}if(s){const y="Infinite loop on byte: "+s.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},ea=class{constructor(n){ct(this,"options");ct(this,"parser");this.options=n||kr}space(n){return""}code({text:n,lang:s,escaped:r}){var u;const o=(u=(s||"").match(mn.notSpaceStart))==null?void 0:u[0],a=n.replace(mn.endingNewline,"")+`
|
|
394
|
+
`;return o?'<pre><code class="language-'+ds(o)+'">'+(r?a:ds(a,!0))+`</code></pre>
|
|
395
|
+
`:"<pre><code>"+(r?a:ds(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:s}){return`<h${s}>${this.parser.parseInline(n)}</h${s}>
|
|
399
|
+
`}hr(n){return`<hr>
|
|
400
|
+
`}list(n){const s=n.ordered,r=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=s?"ol":"ul",u=s&&r!==1?' start="'+r+'"':"";return"<"+a+u+`>
|
|
401
|
+
`+o+"</"+a+`>
|
|
402
|
+
`}listitem(n){var r;let s="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((r=n.tokens[0])==null?void 0:r.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+" "+ds(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):s+=o+" "}return s+=this.parser.parse(n.tokens,!!n.loose),`<li>${s}</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 s="",r="";for(let a=0;a<n.header.length;a++)r+=this.tablecell(n.header[a]);s+=this.tablerow({text:r});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];r="";for(let f=0;f<u.length;f++)r+=this.tablecell(u[f]);o+=this.tablerow({text:r})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
405
|
+
<thead>
|
|
406
|
+
`+s+`</thead>
|
|
407
|
+
`+o+`</table>
|
|
408
|
+
`}tablerow({text:n}){return`<tr>
|
|
409
|
+
${n}</tr>
|
|
410
|
+
`}tablecell(n){const s=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+s+`</${r}>
|
|
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>${ds(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:s,tokens:r}){const o=this.parser.parseInline(r),a=Ih(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return s&&(u+=' title="'+ds(s)+'"'),u+=">"+o+"</a>",u}image({href:n,title:s,text:r,tokens:o}){o&&(r=this.parser.parseInline(o,this.parser.textRenderer));const a=Ih(n);if(a===null)return ds(r);n=a;let u=`<img src="${n}" alt="${r}"`;return s&&(u+=` title="${ds(s)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ds(n.text)}},pd=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""}},_s=class Ru{constructor(s){ct(this,"options");ct(this,"renderer");ct(this,"textRenderer");this.options=s||kr,this.options.renderer=this.options.renderer||new ea,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new pd}static parse(s,r){return new Ru(r).parse(s)}static parseInline(s,r){return new Ru(r).parseInline(s)}parse(s,r=!0){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[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<s.length&&s[f+1].type==="text";)g=s[++f],x+=`
|
|
412
|
+
`+this.renderer.text(g);r?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(s,r=this.renderer){var a,u;let o="";for(let f=0;f<s.length;f++){const h=s[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+=r.text(m);break}case"html":{o+=r.html(m);break}case"link":{o+=r.link(m);break}case"image":{o+=r.image(m);break}case"strong":{o+=r.strong(m);break}case"em":{o+=r.em(m);break}case"codespan":{o+=r.codespan(m);break}case"br":{o+=r.br(m);break}case"del":{o+=r.del(m);break}case"text":{o+=r.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}},gu,Pl=(gu=class{constructor(n){ct(this,"options");ct(this,"block");this.options=n||kr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Es.lex:Es.lexInline}provideParser(){return this.block?_s.parse:_s.parseInline}},ct(gu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),gu),nk=class{constructor(...n){ct(this,"defaults",id());ct(this,"options",this.setOptions);ct(this,"parse",this.parseMarkdown(!0));ct(this,"parseInline",this.parseMarkdown(!1));ct(this,"Parser",_s);ct(this,"Renderer",ea);ct(this,"TextRenderer",pd);ct(this,"Lexer",Es);ct(this,"Tokenizer",Jl);ct(this,"Hooks",Pl);this.use(...n)}walkTokens(n,s){var o,a;let r=[];for(const u of n)switch(r=r.concat(s.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)r=r.concat(this.walkTokens(h.tokens,s));for(const h of f.rows)for(const m of h)r=r.concat(this.walkTokens(m.tokens,s));break}case"list":{const f=u;r=r.concat(this.walkTokens(f.items,s));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);r=r.concat(this.walkTokens(m,s))}):f.tokens&&(r=r.concat(this.walkTokens(f.tokens,s)))}}return r}use(...n){const s=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=s.renderers[a.name];u?s.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:s.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=s[a.level];u?u.unshift(a.tokenizer):s[a.level]=[a.tokenizer],a.start&&(a.level==="block"?s.startBlock?s.startBlock.push(a.start):s.startBlock=[a.start]:a.level==="inline"&&(s.startInline?s.startInline.push(a.start):s.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(s.childTokens[a.name]=a.childTokens)}),o.extensions=s),r.renderer){const a=this.defaults.renderer||new ea(this.defaults);for(const u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=r.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(r.tokenizer){const a=this.defaults.tokenizer||new Jl(this.defaults);for(const u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=r.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(r.hooks){const a=this.defaults.hooks||new Pl;for(const u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=r.hooks[f],m=a[f];Pl.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(r.walkTokens){const a=this.defaults.walkTokens,u=r.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,s){return Es.lex(n,s??this.defaults)}parser(n,s){return _s.parse(n,s??this.defaults)}parseMarkdown(n){return(r,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 r>"u"||r===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?Es.lex:Es.lexInline,m=u.hooks?u.hooks.provideParser():n?_s.parse:_s.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(r):r).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&&(r=u.hooks.preprocess(r));let g=h(r,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,s){return r=>{if(r.message+=`
|
|
413
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+ds(r.message+"",!0)+"</pre>";return s?Promise.resolve(o):o}if(s)return Promise.reject(r);throw r}}},xr=new nk;function qe(n,s){return xr.parse(n,s)}qe.options=qe.setOptions=function(n){return xr.setOptions(n),qe.defaults=xr.defaults,hg(qe.defaults),qe};qe.getDefaults=id;qe.defaults=kr;qe.use=function(...n){return xr.use(...n),qe.defaults=xr.defaults,hg(qe.defaults),qe};qe.walkTokens=function(n,s){return xr.walkTokens(n,s)};qe.parseInline=xr.parseInline;qe.Parser=_s;qe.parser=_s.parse;qe.Renderer=ea;qe.TextRenderer=pd;qe.Lexer=Es;qe.lexer=Es.lex;qe.Tokenizer=Jl;qe.Hooks=Pl;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;_s.parse;Es.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 Lh(n,s){(s==null||s>n.length)&&(s=n.length);for(var r=0,o=Array(s);r<s;r++)o[r]=n[r];return o}function sk(n){if(Array.isArray(n))return n}function rk(n,s){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var o,a,u,f,h=[],m=!0,g=!1;try{if(u=(r=r.call(n)).next,s!==0)for(;!(m=(o=u.call(r)).done)&&(h.push(o.value),h.length!==s);m=!0);}catch(x){g=!0,a=x}finally{try{if(!m&&r.return!=null&&(f=r.return(),Object(f)!==f))return}finally{if(g)throw a}}return h}}function ik(){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 ok(n,s){return sk(n)||rk(n,s)||lk(n,s)||ik()}function lk(n,s){if(n){if(typeof n=="string")return Lh(n,s);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lh(n,s):void 0}}const Ng=Object.entries,Ph=Object.setPrototypeOf,ak=Object.isFrozen,ck=Object.getPrototypeOf,uk=Object.getOwnPropertyDescriptor;let en=Object.freeze,nn=Object.seal,Zr=Object.create,Cg=typeof Reflect<"u"&&Reflect,Au=Cg.apply,Iu=Cg.construct;en||(en=function(s){return s});nn||(nn=function(s){return s});Au||(Au=function(s,r){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return s.apply(r,a)});Iu||(Iu=function(s){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return new s(...o)});const Yr=Ot(Array.prototype.forEach),dk=Ot(Array.prototype.lastIndexOf),Oh=Ot(Array.prototype.pop),Xr=Ot(Array.prototype.push),fk=Ot(Array.prototype.splice),Qs=Array.isArray,Qi=Ot(String.prototype.toLowerCase),cu=Ot(String.prototype.toString),zh=Ot(String.prototype.match),Ki=Ot(String.prototype.replace),$h=Ot(String.prototype.indexOf),pk=Ot(String.prototype.trim),hk=Ot(Number.prototype.toString),mk=Ot(Boolean.prototype.toString),Fh=typeof BigInt>"u"?null:Ot(BigInt.prototype.toString),Uh=typeof Symbol>"u"?null:Ot(Symbol.prototype.toString),Kt=Ot(Object.prototype.hasOwnProperty),Yi=Ot(Object.prototype.toString),qt=Ot(RegExp.prototype.test),vr=gk(TypeError);function Ot(n){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return Au(n,s,o)}}function gk(n){return function(){for(var s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return Iu(n,r)}}function Ge(n,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qi;if(Ph&&Ph(n,null),!Qs(s))return n;let o=s.length;for(;o--;){let a=s[o];if(typeof a=="string"){const u=r(a);u!==a&&(ak(s)||(s[o]=u),a=u)}n[a]=!0}return n}function vk(n){for(let s=0;s<n.length;s++)Kt(n,s)||(n[s]=null);return n}function cn(n){const s=Zr(null);for(const o of Ng(n)){var r=ok(o,2);const a=r[0],u=r[1];Kt(n,a)&&(Qs(u)?s[a]=vk(u):u&&typeof u=="object"&&u.constructor===Object?s[a]=cn(u):s[a]=u)}return s}function yk(n){switch(typeof n){case"string":return n;case"number":return hk(n);case"boolean":return mk(n);case"bigint":return Fh?Fh(n):"0";case"symbol":return Uh?Uh(n):"Symbol()";case"undefined":return Yi(n);case"function":case"object":{if(n===null)return Yi(n);const s=n,r=ts(s,"toString");if(typeof r=="function"){const o=r(s);return typeof o=="string"?o:Yi(o)}return Yi(n)}default:return Yi(n)}}function ts(n,s){for(;n!==null;){const o=uk(n,s);if(o){if(o.get)return Ot(o.get);if(typeof o.value=="function")return Ot(o.value)}n=ck(n)}function r(){return null}return r}function xk(n){try{return qt(n,""),!0}catch{return!1}}const Bh=en(["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"]),uu=en(["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"]),du=en(["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"]),wk=en(["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"]),fu=en(["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"]),kk=en(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Wh=en(["#text"]),Hh=en(["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"]),pu=en(["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"]),Vh=en(["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"]),jl=en(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sk=nn(/{{[\w\W]*|^[\w\W]*}}/g),Tk=nn(/<%[\w\W]*|^[\w\W]*%>/g),bk=nn(/\${[\w\W]*/g),Nk=nn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ck=nn(/^aria-[\-\w]+$/),Gh=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ek=nn(/^(?:\w+script|data):/i),_k=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jk=nn(/^html$/i),Rk=nn(/^[a-z][.\w]*(-[.\w]+)+$/i),qh=nn(/<[/\w!]/g),Kh=nn(/<[/\w]/g),Ak=nn(/<\/no(script|embed|frames)/i),Ik=nn(/\/>/i),An={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Dk=function(){return typeof window>"u"?null:window},Mk=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";r&&r.hasAttribute(a)&&(o=r.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return s.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Yh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ys=function(s,r,o,a){return Kt(s,r)&&Qs(s[r])?Ge(a.base?cn(a.base):{},s[r],a.transform):o};function Eg(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dk();const s=se=>Eg(se);if(s.version="3.4.13",s.removed=[],!n||!n.document||n.document.nodeType!==An.document||!n.Element)return s.isSupported=!1,s;let r=n.document;const o=r,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=ts(y,"cloneNode"),j=ts(y,"remove"),E=ts(y,"nextSibling"),T=ts(y,"childNodes"),L=ts(y,"parentNode"),M=ts(y,"shadowRoot"),W=ts(y,"attributes"),D=f&&f.prototype?ts(f.prototype,"nodeType"):null,B=f&&f.prototype?ts(f.prototype,"nodeName"):null,q=f&&f.prototype?ts(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const se=r.createElement("template");se.content&&se.content.ownerDocument&&(r=se.content.ownerDocument)}let K,G="",oe,ue=!1,ie=0;const Te=function(){if(ie>0)throw vr('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.')},Ne=function(S){Te(),ie++;try{return K.createHTML(S)}finally{ie--}},Fe=function(S){Te(),ie++;try{return K.createScriptURL(S)}finally{ie--}},Q=function(){return ue||(oe=Mk(w,a),ue=!0),oe},ne=r,ae=ne.implementation,O=ne.createNodeIterator,J=ne.createDocumentFragment,H=ne.getElementsByTagName,b=o.importNode;let R=Yh();s.isSupported=typeof Ng=="function"&&typeof L=="function"&&ae&&ae.createHTMLDocument!==void 0;const te=Sk,ce=Tk,ge=bk,ye=Nk,Oe=Ck,Re=Ek,je=_k,be=Rk;let mt=Gh,Me=null;const jt=Ge({},[...Bh,...uu,...du,...fu,...Wh]);let ze=null;const zt=Ge({},[...Hh,...pu,...Vh,...jl]);let We=Object.seal(Zr(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}})),Wt=null,Rt=null;const gt=Object.seal(Zr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let At=!0,$t=!0,V=!1,he=!0,Ue=!1,Ze=!0,vt=!1,yt=!1,dt=null,Xt=null,sn=!1,xt=!1,un=!1,yn=!1,Gn=!0,Mn=!1;const Ln="user-content-";let Pn=!0,I=!1,_e={},le=null;const xe=Ge({},["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 we=null;const Le=Ge({},["audio","video","img","source","image","track"]);let ke=null;const Ve=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let It=nt,st=!1,wt=null;const kt=Ge({},[ot,tt,nt],cu),Be=en(["mi","mo","mn","ms","mtext"]);let Ke=Ge({},Be);const Lt=en(["annotation-xml"]);let Qt=Ge({},Lt);const qn=Ge({},["title","style","font","a","script"]);let Kn=null;const ma=["application/xhtml+xml","text/html"],ga="text/html";let rt=null,ms=null;const go=r.createElement("form"),vo=function(S){return S instanceof RegExp||S instanceof Function},Sr=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ms&&ms===S)return;(!S||typeof S!="object")&&(S={}),S=cn(S),Kn=ma.indexOf(S.PARSER_MEDIA_TYPE)===-1?ga:S.PARSER_MEDIA_TYPE,rt=Kn==="application/xhtml+xml"?cu:Qi,Me=Ys(S,"ALLOWED_TAGS",jt,{transform:rt}),ze=Ys(S,"ALLOWED_ATTR",zt,{transform:rt}),wt=Ys(S,"ALLOWED_NAMESPACES",kt,{transform:cu}),ke=Ys(S,"ADD_URI_SAFE_ATTR",Ve,{transform:rt,base:Ve}),we=Ys(S,"ADD_DATA_URI_TAGS",Le,{transform:rt,base:Le}),le=Ys(S,"FORBID_CONTENTS",xe,{transform:rt}),Wt=Ys(S,"FORBID_TAGS",cn({}),{transform:rt}),Rt=Ys(S,"FORBID_ATTR",cn({}),{transform:rt}),_e=Kt(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?cn(S.USE_PROFILES):S.USE_PROFILES:!1,At=S.ALLOW_ARIA_ATTR!==!1,$t=S.ALLOW_DATA_ATTR!==!1,V=S.ALLOW_UNKNOWN_PROTOCOLS||!1,he=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=S.SAFE_FOR_TEMPLATES||!1,Ze=S.SAFE_FOR_XML!==!1,vt=S.WHOLE_DOCUMENT||!1,xt=S.RETURN_DOM||!1,un=S.RETURN_DOM_FRAGMENT||!1,yn=S.RETURN_TRUSTED_TYPE||!1,sn=S.FORCE_BODY||!1,Gn=S.SANITIZE_DOM!==!1,Mn=S.SANITIZE_NAMED_PROPS||!1,Pn=S.KEEP_CONTENT!==!1,I=S.IN_PLACE||!1,mt=xk(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:Gh,It=typeof S.NAMESPACE=="string"?S.NAMESPACE:nt,Ke=Kt(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?cn(S.MATHML_TEXT_INTEGRATION_POINTS):Ge({},Be),Qt=Kt(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?cn(S.HTML_INTEGRATION_POINTS):Ge({},Lt);const z=Kt(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?cn(S.CUSTOM_ELEMENT_HANDLING):Zr(null);if(We=Zr(null),Kt(z,"tagNameCheck")&&vo(z.tagNameCheck)&&(We.tagNameCheck=z.tagNameCheck),Kt(z,"attributeNameCheck")&&vo(z.attributeNameCheck)&&(We.attributeNameCheck=z.attributeNameCheck),Kt(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(We.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),nn(We),Ue&&($t=!1),un&&(xt=!0),_e&&(Me=Ge({},Wh),ze=Zr(null),_e.html===!0&&(Ge(Me,Bh),Ge(ze,Hh)),_e.svg===!0&&(Ge(Me,uu),Ge(ze,pu),Ge(ze,jl)),_e.svgFilters===!0&&(Ge(Me,du),Ge(ze,pu),Ge(ze,jl)),_e.mathMl===!0&&(Ge(Me,fu),Ge(ze,Vh),Ge(ze,jl))),gt.tagCheck=null,gt.attributeCheck=null,Kt(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?gt.tagCheck=S.ADD_TAGS:Qs(S.ADD_TAGS)&&(Me===jt&&(Me=cn(Me)),Ge(Me,S.ADD_TAGS,rt))),Kt(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?gt.attributeCheck=S.ADD_ATTR:Qs(S.ADD_ATTR)&&(ze===zt&&(ze=cn(ze)),Ge(ze,S.ADD_ATTR,rt))),Kt(S,"ADD_URI_SAFE_ATTR")&&Qs(S.ADD_URI_SAFE_ATTR)&&Ge(ke,S.ADD_URI_SAFE_ATTR,rt),Kt(S,"FORBID_CONTENTS")&&Qs(S.FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.FORBID_CONTENTS,rt)),Kt(S,"ADD_FORBID_CONTENTS")&&Qs(S.ADD_FORBID_CONTENTS)&&(le===xe&&(le=cn(le)),Ge(le,S.ADD_FORBID_CONTENTS,rt)),Pn&&(Me["#text"]=!0),vt&&Ge(Me,["html","head","body"]),Me.table&&(Ge(Me,["tbody"]),delete Wt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Y=K;K=S.TRUSTED_TYPES_POLICY;try{G=Ne("")}catch(me){throw K=Y,me}}else S.TRUSTED_TYPES_POLICY===null?(K=void 0,G=""):(K===void 0&&(K=Q()),K&&typeof G=="string"&&(G=Ne("")));en&&en(S),ms=S},di=Ge({},[...uu,...du,...wk]),fi=Ge({},[...fu,...kk]),yo=function(S,z,Y){return z.namespaceURI===nt?S==="svg":z.namespaceURI===ot?S==="svg"&&(Y==="annotation-xml"||Ke[Y]):!!di[S]},va=function(S,z,Y){return z.namespaceURI===nt?S==="math":z.namespaceURI===tt?S==="math"&&Qt[Y]:!!fi[S]},ya=function(S,z,Y){return z.namespaceURI===tt&&!Qt[Y]||z.namespaceURI===ot&&!Ke[Y]?!1:!fi[S]&&(qn[S]||!di[S])},St=function(S){let z=L(S);(!z||!z.tagName)&&(z={namespaceURI:It,tagName:"template"});const Y=Qi(S.tagName),me=Qi(z.tagName);return wt[S.namespaceURI]?S.namespaceURI===tt?yo(Y,z,me):S.namespaceURI===ot?va(Y,z,me):S.namespaceURI===nt?ya(Y,z,me):!!(Kn==="application/xhtml+xml"&&wt[S.namespaceURI]):!1},is=function(S){Xr(s.removed,{element:S});try{L(S).removeChild(S)}catch{if(j(S),!L(S))throw vr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rs=function(S){Js(S);const z=T(S);if(z){const me=[];Yr(z,Ce=>{Xr(me,Ce)}),Yr(me,Ce=>{try{j(Ce)}catch{}})}const Y=W(S);if(Y)for(let me=Y.length-1;me>=0;--me){const Ce=Y[me],$e=Ce&&Ce.name;if(typeof $e=="string")try{S.removeAttribute($e)}catch{}}},os=function(S,z){try{Xr(s.removed,{attribute:z.getAttributeNode(S),from:z})}catch{Xr(s.removed,{attribute:null,from:z})}if(z.removeAttribute(S),S==="is")if(xt||un)try{is(z)}catch{}else try{z.setAttribute(S,"")}catch{}},Tr=function(S){const z=W(S);if(z)for(let Y=z.length-1;Y>=0;--Y){const me=z[Y],Ce=me&&me.name;if(!(typeof Ce!="string"||ze[rt(Ce)]))try{S.removeAttribute(Ce)}catch{}}},Js=function(S){const z=[S];for(;z.length>0;){const Y=z.pop();(D?D(Y):Y.nodeType)===An.element&&Tr(Y);const Ce=T(Y);if(Ce)for(let $e=Ce.length-1;$e>=0;--$e)z.push(Ce[$e])}},xo=function(S){if(!Ze)return;const z=[S];for(;z.length>0;){const Y=z.pop(),me=D?D(Y):Y.nodeType;if(me===An.processingInstruction||me===An.comment&&qt(Kh,Y.data)){try{j(Y)}catch{}continue}if(me===An.element){const $e=Y,Xe=rt(B?B(Y):Y.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Xe!=="label"&&Xe!=="output"&&$e.removeAttribute("for")}catch{}}const Ce=T(Y);if(Ce)for(let $e=Ce.length-1;$e>=0;--$e)z.push(Ce[$e])}},er=function(S){let z=null,Y=null;if(sn)S="<remove></remove>"+S;else{const $e=zh(S,/^[\r\n\t ]+/);Y=$e&&$e[0]}Kn==="application/xhtml+xml"&&It===nt&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const me=K?Ne(S):S;if(It===nt)try{z=new x().parseFromString(me,Kn)}catch{}if(!z||!z.documentElement){z=ae.createDocument(It,"template",null);try{z.documentElement.innerHTML=st?G:me}catch{}}const Ce=z.body||z.documentElement;return S&&Y&&Ce.insertBefore(r.createTextNode(Y),Ce.childNodes[0]||null),It===nt?H.call(z,vt?"html":"body")[0]:vt?z.documentElement:Ce},Cn=function(S){const z=q?q(S):S.ownerDocument;return O.call(z||S,S,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},br=function(S){return S=Ki(S,te," "),S=Ki(S,ce," "),S=Ki(S,ge," "),S},dn=function(S){var z;S.normalize();const Y=q?q(S):S.ownerDocument,me=O.call(Y||S,S,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ce=me.nextNode();for(;Ce;)Ce.data=br(Ce.data),Ce=me.nextNode();const $e=(z=S.querySelectorAll)===null||z===void 0?void 0:z.call(S,"template");$e&&Yr($e,Xe=>{As(Xe.content)&&dn(Xe.content)})},Nr=function(S){const z=B?B(S):null;return typeof z!="string"||rt(z)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==W(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==D(S)||S.childNodes!==T(S)},As=function(S){if(!D||typeof S!="object"||S===null)return!1;try{return D(S)===An.documentFragment}catch{return!1}},tr=function(S){if(!D||typeof S!="object"||S===null)return!1;try{return typeof D(S)=="number"}catch{return!1}};function fn(se,S,z){se.length!==0&&Yr(se,Y=>{Y.call(s,S,z,ms)})}const Cr=function(S,z){return!!(Ze&&S.hasChildNodes()&&!tr(S.firstElementChild)&&qt(qh,S.textContent)&&qt(qh,S.innerHTML)||Ze&&S.namespaceURI===nt&&z==="style"&&tr(S.firstElementChild)||S.nodeType===An.processingInstruction||Ze&&S.nodeType===An.comment&&qt(Kh,S.data))},nr=function(S,z,Y){if(!Wt[z]&&hi(z)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,z)||We.tagNameCheck instanceof Function&&We.tagNameCheck(z)))return!1;if(Pn&&!le[z]){const me=L(S),Ce=T(S);if(Ce&&me){const $e=Ce.length;for(let Xe=$e-1;Xe>=0;--Xe){const Je=S===Y?N(Ce[Xe],!0):Ce[Xe];me.insertBefore(Je,E(S))}}}return is(S),!0},sr=function(S,z,Y,me){return S.length===0?z:z===Y||z===me?cn(z):z},wo=function(S,z){if(fn(R.beforeSanitizeElements,S,null),S!==z&&L(S)===null)return I&&Js(S),!0;if(Nr(S))return is(S),!0;const Y=rt(B?B(S):S.nodeName);if(Me=sr(R.uponSanitizeElement,Me,jt,dt),fn(R.uponSanitizeElement,S,{tagName:Y,allowedTags:Me}),S!==z&&L(S)===null)return I&&Js(S),!0;if(Cr(S,Y))return is(S),!0;if(Wt[Y]||!(gt.tagCheck instanceof Function&>.tagCheck(Y))&&!Me[Y]){const Ce=nr(S,Y,z);return Ce===!1&&fn(R.afterSanitizeElements,S,null),Ce}if((D?D(S):S.nodeType)===An.element&&!St(S)||(Y==="noscript"||Y==="noembed"||Y==="noframes")&&qt(Ak,S.innerHTML))return is(S),!0;if(Ue&&S.nodeType===An.text){const Ce=br(S.textContent);S.textContent!==Ce&&(Xr(s.removed,{element:S.cloneNode()}),S.textContent=Ce)}return fn(R.afterSanitizeElements,S,null),!1},ko=function(S,z,Y){if(Rt[z]||Ze&&z==="patchsrc"||Ze&&z==="for"&&S!=="label"&&S!=="output"||Gn&&(z==="id"||z==="name")&&(Y in r||Y in go))return!1;const me=ze[z]||gt.attributeCheck instanceof Function&>.attributeCheck(z,S);if(!($t&&qt(ye,z))){if(!(At&&qt(Oe,z))){if(me){if(!ke[z]){if(!qt(mt,Ki(Y,je,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&S!=="script"&&$h(Y,"data:")===0&&we[S])){if(!(V&&!qt(Re,Ki(Y,je,"")))){if(Y)return!1}}}}}else if(!(hi(S)&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,S)||We.tagNameCheck instanceof Function&&We.tagNameCheck(S))&&(We.attributeNameCheck instanceof RegExp&&qt(We.attributeNameCheck,z)||We.attributeNameCheck instanceof Function&&We.attributeNameCheck(z,S))||z==="is"&&We.allowCustomizedBuiltInElements&&(We.tagNameCheck instanceof RegExp&&qt(We.tagNameCheck,Y)||We.tagNameCheck instanceof Function&&We.tagNameCheck(Y))))return!1}}return!0},pi=Ge({},["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(be,S)},mi=function(S,z,Y,me){if(K&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Y)switch(w.getAttributeType(S,z)){case"TrustedHTML":return Ne(me);case"TrustedScriptURL":return Fe(me)}return me},rr=function(S,z,Y,me){try{Y?S.setAttributeNS(Y,z,me):S.setAttribute(z,me),Nr(S)?is(S):Oh(s.removed)}catch{os(z,S)}},So=function(S){fn(R.beforeSanitizeAttributes,S,null);const z=S.attributes;if(!z||Nr(S))return;ze=sr(R.uponSanitizeAttribute,ze,zt,Xt);const Y={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let me=z.length;const Ce=rt(S.nodeName);for(;me--;){const $e=z[me],Xe=$e.name,Je=$e.namespaceURI,Tt=$e.value,bt=rt(Xe),gs=Tt;let Dt=Xe==="value"?gs:pk(gs);if(Y.attrName=bt,Y.attrValue=Dt,Y.keepAttr=!0,Y.forceKeepAttr=void 0,fn(R.uponSanitizeAttribute,S,Y),Dt=Y.attrValue,Mn&&(bt==="id"||bt==="name")&&$h(Dt,Ln)!==0&&(os(Xe,S),Dt=Ln+Dt),Ze&&qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Dt)){os(Xe,S);continue}if(bt==="attributename"&&zh(Dt,"href")){os(Xe,S);continue}if(!Y.forceKeepAttr){if(!Y.keepAttr){os(Xe,S);continue}if(!he&&qt(Ik,Dt)){os(Xe,S);continue}if(Ue&&(Dt=br(Dt)),!ko(Ce,bt,Dt)){os(Xe,S);continue}Dt=mi(Ce,bt,Je,Dt),Dt!==gs&&rr(S,Xe,Je,Dt)}}fn(R.afterSanitizeAttributes,S,null)},Is=function(S){let z=null;const Y=Cn(S);for(fn(R.beforeSanitizeShadowDOM,S,null);z=Y.nextNode();)if(fn(R.uponSanitizeShadowNode,z,null),wo(z,S),So(z),As(z.content)&&Is(z.content),(D?D(z):z.nodeType)===An.element){const Ce=M(z);As(Ce)&&(Ye(Ce),Is(Ce))}fn(R.afterSanitizeShadowDOM,S,null)},Ye=function(S){const z=[{node:S,shadow:null}];for(;z.length>0;){const Y=z.pop();if(Y.shadow){Is(Y.shadow);continue}const me=Y.node,$e=(D?D(me):me.nodeType)===An.element,Xe=T(me);if(Xe)for(let Je=Xe.length-1;Je>=0;--Je)z.push({node:Xe[Je],shadow:null});if($e){const Je=B?B(me):null;if(typeof Je=="string"&&rt(Je)==="template"){const Tt=me.content;As(Tt)&&z.push({node:Tt,shadow:null})}}if($e){const Je=M(me);As(Je)&&z.push({node:null,shadow:Je},{node:Je,shadow:null})}}};return s.sanitize=function(se){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,Y=null,me=null,Ce=null;if(st=!se,st&&(se="<!-->"),typeof se!="string"&&!tr(se)&&(se=yk(se),typeof se!="string"))throw vr("dirty is not a string, aborting");if(!s.isSupported)return se;yt?(Me=dt,ze=Xt):Sr(S),(R.uponSanitizeElement.length>0||R.uponSanitizeAttribute.length>0)&&(Me=cn(Me)),R.uponSanitizeAttribute.length>0&&(ze=cn(ze)),s.removed=[];const $e=I&&typeof se!="string"&&tr(se);if($e){xo(se);const Tt=B?B(se):se.nodeName;if(typeof Tt=="string"){const bt=rt(Tt);if(!Me[bt]||Wt[bt])throw Rs(se),vr("root node is forbidden and cannot be sanitized in-place")}if(Nr(se))throw Rs(se),vr("root node is clobbered and cannot be sanitized in-place");try{Ye(se)}catch(bt){throw Rs(se),bt}}else if(tr(se))z=er("<!---->"),Y=z.ownerDocument.importNode(se,!0),Y.nodeType===An.element&&Y.nodeName==="BODY"||Y.nodeName==="HTML"?z=Y:z.appendChild(Y),Ye(Y);else{if(!xt&&!Ue&&!vt&&se.indexOf("<")===-1)return K&&yn?Ne(se):se;if(z=er(se),!z)return xt?null:yn?G:""}z&&sn&&is(z.firstChild);const Xe=$e?se:z;try{const Tt=Cn(Xe);for(;me=Tt.nextNode();)wo(me,Xe),So(me),As(me.content)&&Is(me.content)}catch(Tt){throw $e&&(Rs(se),Yr(s.removed,bt=>{bt.element&&Js(bt.element)})),Tt}if($e)return Yr(s.removed,Tt=>{Tt.element&&Js(Tt.element)}),Ue&&dn(se),se;if(xt){if(Ue&&dn(z),un)for(Ce=J.call(z.ownerDocument);z.firstChild;)Ce.appendChild(z.firstChild);else Ce=z;return(ze.shadowroot||ze.shadowrootmode)&&(Ce=b.call(o,Ce,!0)),Ce}let Je=vt?z.outerHTML:z.innerHTML;return vt&&Me["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&qt(jk,z.ownerDocument.doctype.name)&&(Je="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
415
|
+
`+Je),Ue&&(Je=br(Je)),K&&yn?Ne(Je):Je},s.setConfig=function(){let se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(se),yt=!0,dt=Me,Xt=ze},s.clearConfig=function(){ms=null,yt=!1,dt=null,Xt=null,K=oe,G=""},s.isValidAttribute=function(se,S,z){ms||Sr({});const Y=rt(se),me=rt(S);return ko(Y,me,z)},s.addHook=function(se,S){typeof S=="function"&&Kt(R,se)&&Xr(R[se],S)},s.removeHook=function(se,S){if(Kt(R,se)){if(S!==void 0){const z=dk(R[se],S);return z===-1?void 0:fk(R[se],z,1)[0]}return Oh(R[se])}},s.removeHooks=function(se){Kt(R,se)&&(R[se]=[])},s.removeAllHooks=function(){R=Yh()},s}var hd=Eg();const Lk=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function Xh(n){return Lk.has(n.type)}function Pk({items:n,runtimeType:s,turn:r,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(S0,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(Xu,{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(Cs,{item:h,runtimeType:s,turn:r,threads:o},h.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function Ok(n){const s=qe.parse(n);return hd.sanitize(s)}function Qh(n,s){var a;const r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;r.nextNode();){const u=r.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>s)return{node:u,offset:s-o};o+=f}return null}function zk(n,s){n.querySelectorAll("mark[data-thread-id]").forEach(r=>{const o=r.parentNode;if(!o)return;const a=document.createTextNode(r.textContent||"");o.replaceChild(a,r),o.normalize()});for(const r of s){if(r.start_offset===null||r.end_offset===null)continue;const o=Qh(n,r.start_offset),a=Qh(n,r.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",r.id),r.status==="resolved"&&f.classList.add("thread-mark-resolved");try{u.surroundContents(f)}catch{const h=u.extractContents();f.appendChild(h),u.insertNode(f)}}}function $k(n){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const r=s.getRangeAt(0);if(r.collapsed||!n.contains(r.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(r.startContainer,r.startOffset);const a=o.toString().length,u=r.toString();return{start:a,end:a+u.length,text:u}}function Fk({itemId:n,turnId:s,sessionId:r,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}),[j,E]=k.useState(!1),[T,L]=k.useState({x:0,y:0}),[M,W]=k.useState(""),[D,B]=k.useState(null),[q,K]=k.useState(!1),G=P(H=>H.createThread),oe=P(H=>H.switchRightTab),ue=P(H=>sa(H.sessionDetails[r])),ie=k.useCallback(async()=>{await Eu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),Te=k.useCallback(()=>{var b;if(!D)return;const H=`
|
|
416
|
+
\`\`\`QUOTE
|
|
417
|
+
${D.text}
|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
`;P.setState({quotedText:H}),w(!1),B(null),(b=window.getSelection())==null||b.removeAllRanges()},[D]),Ne=k.useMemo(()=>Ok(o||"…"),[o]),Fe=k.useMemo(()=>a.filter(H=>H.item_id===n),[a,n]);k.useEffect(()=>{u.current&&zk(u.current,Fe)},[Ne,Fe]),k.useEffect(()=>{m.current=M},[M]),k.useEffect(()=>{function H(b){f.current&&!f.current.contains(b.target)&&(w(!1),m.current.trim()||E(!1))}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]);const Q=k.useCallback(()=>{w(!1),m.current.trim()||E(!1)},[]),ne=k.useCallback(()=>{const H=u.current;if(!H)return;const b=$k(H);if(b&&b.text.trim().length>0){const R=window.getSelection();if(R&&R.rangeCount>0&&R.anchorNode&&R.focusNode){const ce=R.getRangeAt(0).getBoundingClientRect(),ge=28,ye=6,Oe=170;let Re=!1;try{const mt=document.createRange();mt.setStart(R.focusNode,R.focusOffset),mt.setEnd(R.focusNode,R.focusOffset);const Me=document.createRange();Me.setStart(R.anchorNode,R.anchorOffset),Me.setEnd(R.anchorNode,R.anchorOffset),Re=Me.compareBoundaryPoints(Range.START_TO_START,mt)>0}catch{Re=!1}let je=ce.top-ge-ye;je<8&&(je=ce.bottom+ye);let be=Re?ce.left-Oe:ce.right;be=Math.max(8,Math.min(be,window.innerWidth-Oe-8)),N({x:be,y:je}),w(!0),B(b)}}else w(!1)},[]);k.useEffect(()=>{function H(b){const R=b.target;R&&(R.closest(".selection-actions")||R.closest(".thread-create-popover"))||ne()}return document.addEventListener("mouseup",H),()=>document.removeEventListener("mouseup",H)},[ne]);const ae=k.useCallback(()=>{w(!1),E(!0),L({x:y.x,y:y.y})},[y]);k.useLayoutEffect(()=>{if(!j)return;const H=h.current;if(!H)return;const b=H.offsetWidth,R=H.offsetHeight,te=8;let ce=y.x,ge=y.y;ce-b<te&&(ce=b+te),ce>window.innerWidth-te&&(ce=window.innerWidth-te),ge<te&&(ge=te),ge+R>window.innerHeight-te&&(ge=window.innerHeight-R-te),L({x:ce,y:ge})},[j,y]);const O=k.useCallback(async()=>{var H;ue||!D||!M.trim()||(await G(r,{itemId:n,turnId:s,startOffset:D.start,endOffset:D.end,selectedText:D.text,message:M.trim()}),W(""),E(!1),B(null),(H=window.getSelection())==null||H.removeAllRanges(),oe("threads"))},[D,M,G,r,n,s,oe,ue]),J=k.useCallback(H=>{const b=H.target;if(b.tagName==="MARK"&&b.hasAttribute("data-thread-id")){H.preventDefault(),oe("threads");const R=b.getAttribute("data-thread-id");setTimeout(()=>{const te=document.getElementById(`thread-${R}`);te&&(te.scrollIntoView({behavior:"smooth",block:"center"}),te.classList.add("thread-card-highlighted"),setTimeout(()=>te.classList.remove("thread-card-highlighted"),1500))},100)}},[oe]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:Ne},onMouseDown:Q,onClick:J}),c.jsx("button",{className:`copy-text-btn${q?" copied":""}`,onClick:ie,title:q?"Copied":"Copy message","aria-label":"Copy message text",children:q?c.jsx(Zs,{size:14}):c.jsx(Su,{size:14})}),x&&!j&&c.jsxs("div",{className:"selection-actions",style:{left:y.x,top:y.y},children:[!ue&&c.jsxs("button",{className:"discuss-button",onClick:ae,title:"Start a discussion about this text",children:[c.jsx(a0,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:Te,title:"Quote this text in your message",children:[c.jsx(zm,{size:14}),c.jsx("span",{children:"Quote"})]})]}),j&&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:['"',D==null?void 0:D.text.slice(0,80),D&&D.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{E(!1),B(null)},children:c.jsx(Vn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:M,onChange:H=>W(H.target.value),autoFocus:!0,rows:2,onKeyDown:H=>{if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),O()),H.key==="Escape")if(m.current.trim()){const b=Date.now();g.current&&b-g.current<400?(g.current=0,E(!1),B(null)):g.current=b}else E(!1),B(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:O,disabled:!M.trim()||ue,title:ue?"Wait for the running turn to finish first":void 0,children:[c.jsx(la,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const Zh=k.memo(Fk),ta=new Map,_g=new Set,Du=new Set,Jh=new Map;function jg(){Du.forEach(n=>n())}function Rg(n,s){return`${n}:${s}`}function Uk(n,s,r,o,a){var m;const u=Rg(s,r),f=ta.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:s,groupIndex:r,question:o,answer:a}),ta.set(n,h),jg()}function Bk(n){ta.delete(n),jg()}function Wk(n){_g.add(n),Bk(n)}function Hk(n){const s=k.useCallback(r=>(Du.add(r),()=>{Du.delete(r)}),[]);return k.useSyncExternalStore(s,()=>ta.get(n)??Jh,()=>Jh)}function Vk(n){return[...n].sort((s,r)=>s.itemIndex-r.itemIndex||s.groupIndex-r.groupIndex).map(s=>`> ${s.question}
|
|
421
|
+
${s.answer}`).join(`
|
|
422
|
+
|
|
423
|
+
`)}function em({item:n,turn:s}){var N;const r=n.data??{},o=k.useMemo(()=>Array.isArray(r.groups)?r.groups.filter(j=>!!j&&Array.isArray(j.selections)&&j.selections.length>0):[],[r.groups]),a=Hk(s.id),u=P(j=>s.session_id?j.sessionDetails[s.session_id]:null),f=P(j=>j.activeSessionId),h=s.items.findIndex(j=>j.id===n.id),m=u?((N=u.turns[u.turns.length-1])==null?void 0:N.id)===s.id:!0,g=_g.has(s.id),x=g||_m(u)||!m||s.session_id!==f,w=(j,E,T)=>{x||Uk(s.id,h,j,E,T)},y=()=>{const j=[...a.values()];if(j.length===0)return;const E=Vk(j);Wk(s.id),P.getState().submitPrompt(E)};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(Yx,{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((j,E)=>c.jsxs("div",{className:"ask-user-group",children:[j.question&&c.jsx("div",{className:"ask-user-question",children:j.question}),c.jsx("div",{className:"ask-user-options",children:j.selections.map(T=>{var M;const L=((M=a.get(Rg(h,E)))==null?void 0:M.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${L?"selected":""}`,disabled:x,onClick:()=>w(E,j.question,T),children:T},T)})})]},E)),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(la,{size:12}),"Send"]})]}):r.question?c.jsx("p",{className:"user-message",children:r.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}qe.setOptions({breaks:!0,gfm:!0});function Gk({attachments:n}){const[s,r]=k.useState(null);return k.useEffect(()=>{if(!s)return;function o(a){a.key==="Escape"&&r(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[s]),!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?()=>r(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(Om,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),s&&c.jsx("div",{className:"image-preview-modal",onClick:()=>r(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:s,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>r(null),children:c.jsx(Vn,{size:20})})]})})]})}function qk(n){const s=qe.parse(n);return hd.sanitize(s)}function tm(n){var s;return(s=n.data)!=null&&s.text?n.data.text:""}function Kk(n){const s=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return s?s[1]:n}const nm='<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 Yk(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${nm}</body>`):n+nm}function Xk({html:n}){const[s,r]=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&&r(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:Yk(n),title:"HTML content",style:{width:"100%",height:`${s}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const sm=1e4;function Qk({item:n,runtimeType:s,turn:r,threads:o}){var h,m,g,x,w,y,N,j;const a=n.status==="in_progress",[u,f]=k.useState(!1);switch(n.type){case"agent_message":{const{iconClass:E,iconText:T}=wu(s??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${E}`,children:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(Zh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:tm(n)||"…",threads:o,runtimeType:s})]})}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(qx,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:qk(tm(n))}})]});case"command_execution":{const E=n.data||{},T=Kk(E.command||""),L=E.aggregated_output||"",M=E.exit_code,W=a?"running…":M!==null?`exit ${M}`:"",D=L.length>sm,B=D&&!u?L.slice(0,sm)+`
|
|
424
|
+
… (truncated, click to expand)`:L;return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(Fm,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),W&&c.jsx("span",{className:"turn-header-meta",children:W})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),L&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:B})}),D&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(q=>!q),children:u?"Show less":`Show full output (${(L.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const E=(h=n.data)==null?void 0:h.changes,T=Array.isArray(E)?E:[],L=`${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(e0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:L})]}),c.jsx("div",{className:"file-change-list",children:T.map((M,W)=>{const D=M.kind==="add"?"A":M.kind==="delete"?"D":"M",B=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 ${B}`,children:D}),c.jsx("span",{className:"fc-name",children:M.path})]},W)})})]})}case"mcp_tool_call":{const E=n.data||{},T=E.tool||"mcp";if(T==="Agent"){const G=E.arguments,oe=(G==null?void 0:G.description)||(G==null?void 0:G.prompt)||"Subagent",ue=n.status==="failed",ie=a?"running…":ue?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ku,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:oe}),c.jsx("span",{className:`agent-call-status ${a?"running":ue?"failed":"done"}`,children:ie})]})}const L=E.server||"",M=E.arguments,W=E.result,D=E.error,B=n.status==="failed"||!!D,q=a?"running…":B?"failed":"done",K=((m=W==null?void 0:W.content)==null?void 0:m.filter(G=>G.type==="text").map(G=>G.text))??[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(h0,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),L&&c.jsx("span",{className:"turn-header-meta",children:L}),c.jsx("span",{className:"turn-header-meta",style:B?{color:"var(--red)"}:void 0,children:q})]}),M&&Object.keys(M).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(M).map(([G,oe])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:G}),G==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(oe)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof oe=="string"?oe:JSON.stringify(oe,null,2)})]},G))}),K.length>0&&K.map((G,oe)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:G})},oe)),D&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:D})})]})}case"web_search":{const E=((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(g0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:E})]})}case"todo_list":{const E=((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(i0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:E.map((T,L)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(Zs,{size:14}):c.jsx(li,{size:14})," ",T.text]},L))})]})}case"ask_user":return c.jsx(em,{item:n,turn:r});case"final_result":{const E=n.data??{},T=E.text||"",L=E.html||null,M=Array.isArray(E.groups)?E.groups.filter(B=>!!B&&Array.isArray(B.selections)&&B.selections.length>0):[],{iconClass:W,iconText:D}=wu(s??"codex");return c.jsxs(c.Fragment,{children:[(T||L)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${W}`,children:D}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(Zh,{itemId:n.id,turnId:r.id,sessionId:r.session_id,content:T,threads:o,runtimeType:s}),L&&c.jsx(Xk,{html:L})]}),M.length>0&&c.jsx(em,{item:n,turn:r})]})}case"background_task":{const E=n.data||{},T=E.task_type||"unknown",L=E.subagent_type||null,M=E.description||"",W=E.status||"running",D=E.last_tool_name||null,B=E.token_count||null,q=T==="local_agent",K=T==="local_bash",G=q?ku:K?$m:Pm,oe=q?`Subagent${L?`: ${L}`:""}`:K?"Monitor":"Background Task",ue=W==="running"?"running…":W==="completed"?"done":W==="failed"?"failed":W==="stopped"?"stopped":W,ie=n.status==="failed"||W==="failed";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(G,{size:14})}),c.jsx("span",{className:"turn-header-title",children:oe}),c.jsx("span",{className:"turn-header-meta",style:ie?{color:"var(--red)"}:void 0,children:ue})]}),M&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:M}),D&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",D,B!=null&&` · ${B.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 E=((w=n.data)==null?void 0:w.trigger)??"auto",T=((y=n.data)==null?void 0:y.pre_tokens)??0,L=((N=n.data)==null?void 0:N.post_tokens)??0,M=T>0?Math.round((1-L/T)*100):0,W=E==="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(u0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:W})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",L.toLocaleString()," tokens (",M,"% reduction)"]})]})}case"error":{const E=((j=n.data)==null?void 0:j.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(Qu,{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:E})})]})}default:return null}}const Cs=k.memo(Qk,(n,s)=>n.item===s.item&&n.runtimeType===s.runtimeType&&n.threads===s.threads&&n.turn.id===s.turn.id);function Zk({turn:n,runtimeType:s,threads:r=[]}){tn.trackRender("TurnContent");const[o,a]=k.useState(!1);k.useEffect(()=>{const T=n.items.some(L=>L.type==="background_task"&&L.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 L;return!(T.type==="reasoning"&&(!((L=T.data)!=null&&L.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:[]}),Xh(T)?N.toolItems.push(T):N.otherItems.push(T));N&&y.push(N);const j=w.filter(T=>Xh(T)).length,E=j>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(Gk,{attachments:n.attachments})]}),E&&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(s0,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:j>0?`${j} tool call${j>1?"s":""}`:"thinking…"}),c.jsx(Xu,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:y.map((T,L)=>c.jsxs("div",{className:"intermediate-segment",children:[T.agentMessage&&c.jsx(Cs,{item:T.agentMessage,runtimeType:s,turn:n,threads:r}),T.otherItems.map(M=>c.jsx(Cs,{item:M,runtimeType:s,turn:n,threads:r},M.id)),T.toolItems.length>0&&c.jsx(Pk,{items:T.toolItems,runtimeType:s,turn:n,threads:r})]},L))})]}),n.items.filter(T=>T.type==="background_task").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`task-${T.id}`)),f&&c.jsx(Cs,{item:n.items[u],runtimeType:s,turn:n,threads:r},n.items[u].id),g&&c.jsx(Cs,{item:g,runtimeType:s,turn:n,threads:r},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(Cs,{item:T,runtimeType:s,turn:n,threads:r},T.id)),n.items.filter(T=>T.type==="final_result").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`final-${T.id}`)),n.items.filter(T=>T.type==="ask_user").map(T=>c.jsx(Cs,{item:T,runtimeType:s,turn:n,threads:r},`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 Jk=k.memo(Zk);function Ag(n,s="session",r=0){const o=[];if(s==="session")n.forEach((u,f)=>rm(u,f,o));else{const u=n[r];u&&rm(u,r,o)}const a=new Map;for(const u of o)a.set(u.path,u);return Array.from(a.values())}function rm(n,s,r){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)r.push({path:f.path,kind:f.kind,turnIdx:s})}}const eS=[],Rl=50;function tS(){tn.trackRender("RenderArea");const n=P(L=>L.activeSessionId),s=P(L=>L.activeSessionId?L.sessionDetails[L.activeSessionId]:null),r=P(L=>L.activeTurnIndex),o=P(L=>L.activeRightTab),a=P(L=>L.changesScope),u=P(L=>L.submittingPrompt),f=P(L=>L.loading),h=P(L=>L.selectedChangePath),m=P(L=>L.setSelectedChangePath),g=(s==null?void 0:s.turns)??[],x=(s==null?void 0:s.threads)??eS,w=k.useRef(null),[y,N]=k.useState(Rl);k.useEffect(()=>{N(Rl)},[n]);const j=g.filter(L=>!L.thread_id),E=Math.max(0,j.length-y),T=j.slice(E);if(k.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[n,g.length]),k.useEffect(()=>{if(!h||o!=="changes")return;const L=setTimeout(()=>{const M=h.replace(/[^a-zA-Z0-9]/g,"-"),W=document.getElementById(`diff-${M}`);W&&(W.scrollIntoView({behavior:"smooth",block:"start"}),W.classList.add("diff-highlight"),setTimeout(()=>W.classList.remove("diff-highlight"),1500)),m(null)},50);return()=>clearTimeout(L)},[h,o,m]),o==="changes"){if(!s)return c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})});const L=Ag(g,a,r);return L.length===0?c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"No file changes in this scope."})})}):c.jsx("div",{className:"render-scroll",ref: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:[L.length," file",L.length>1?"s":""]})]}),L.map(M=>{const W=M.path.split("/").pop()||M.path,D=M.path.replace("/"+W,""),B=M.kind==="add"?"Added":M.kind==="delete"?"Deleted":"Modified",q=M.kind==="add"?"fc-add":M.kind==="delete"?"fc-del":"fc-mod",K=M.kind==="add"?"A":M.kind==="delete"?"D":"M",G=M.path.replace(/[^a-zA-Z0-9]/g,"-");return c.jsxs("div",{children:[c.jsxs("div",{className:"diff-file-header",id:`diff-${G}`,children:[c.jsx("span",{className:`diff-file-status ${q}`,children:K}),c.jsxs("span",{className:"diff-file-name",children:[D&&c.jsxs("span",{style:{color:"var(--text-muted)"},children:[D,"/"]}),W]}),c.jsx("span",{className:"diff-file-stats",children:c.jsx("span",{className:`diff-file-badge ${q}`,children:B})})]}),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&&!s?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"})]})}):s?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."}),E>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>N(L=>L+Rl),children:["Show ",Math.min(Rl,E)," earlier turns (",E," hidden)"]})}),T.map((L,M)=>c.jsx("div",{id:`turn-${E+M}`,className:"turn-block",children:c.jsx(Jk,{turn:L,runtimeType:s.runtime_type,threads:x})},L.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const nS=k.memo(tS),sS=[{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 rS(n){return n.map(s=>({id:s.name,label:`/${s.name}`,hint:s.description,capability:null,insertAsText:!0}))}function iS(n,s,r=[]){const o=[...sS,...rS(r)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!s[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function oS({commands:n,selectedIndex:s,onSelect:r,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===s?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>r(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 hu({title:n,options:s,currentValue:r,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})]}),s.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===r?"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===r&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function lS(n){return gn("/skills")}function aS({filter:n,onSelect:s,onClose:r}){const[o,a]=k.useState([]),[u,f]=k.useState(!0),[h,m]=k.useState(0),g=k.useRef(null);k.useEffect(()=>{lS().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]&&s(x[h])):y.key==="Escape"&&(y.preventDefault(),r())}return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[x,h,s,r]),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:r,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:()=>s(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 cS(){return gn("/providers")}function uS(n,s){const r=s?`?cwd=${encodeURIComponent(s)}`:"";return gn(`/providers/${n}/commands${r}`)}const dS={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function fS(n){const[s,r]=k.useState([]),[o,a]=k.useState(!0);k.useEffect(()=>{cS().then(r).catch(()=>r([])).finally(()=>a(!1))},[]);const u=s.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??dS,loading:o}}const Qr=32,mu=200;function im(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function om(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let lm=0;function pS(){return lm+=1,`att-${Date.now()}-${lm}`}function hS(){tn.trackRender("CommandInputBar");const[n,s]=k.useState(""),r=k.useRef(null),o=k.useRef(Qr),a=k.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:m}=P(),g=P(V=>V.activeSessionId),x=P(V=>V.activeSessionId?V.sessionDetails[V.activeSessionId]:null),w=P(V=>V.quotedText),y=_m(x),N=!g,{capabilities:j}=fS(x==null?void 0:x.runtime_type),E=(x==null?void 0:x.runtime_type)??null,T=j.imageAttachments,[L,M]=k.useState([]),[W,D]=k.useState(!1),[B,q]=k.useState(null),[K,G]=k.useState([]);k.useEffect(()=>{if(!E){G([]);return}let V=!1;return uS(E,(x==null?void 0:x.cwd)??void 0).then(he=>{V||G(he)}).catch(()=>{V||G([])}),()=>{V=!0}},[E,x==null?void 0:x.cwd]);const[oe,ue]=k.useState(!1),[ie,Te]=k.useState(""),[Ne,Fe]=k.useState(0),[Q,ne]=k.useState(void 0),[ae,O]=k.useState(!1),[J,H]=k.useState(""),[b,R]=k.useState([]),te=oe?iS(ie,j,K):[];k.useEffect(()=>{w!==null&&(s(V=>V+w),setTimeout(()=>{if(r.current){mt(),r.current.focus();const V=r.current.value.length;r.current.setSelectionRange(V,V)}},0),P.setState({quotedText:null}))},[w]),k.useEffect(()=>{if(!y)return;function V(he){he.key==="Escape"&&(he.preventDefault(),f())}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[y,f]),k.useEffect(()=>{ue(!1),ne(void 0),O(!1),R([]),M(V=>{for(const he of V)he.previewUrl&&URL.revokeObjectURL(he.previewUrl);return[]})},[g]),k.useEffect(()=>{if(!B)return;function V(he){he.key==="Escape"&&(he.preventDefault(),q(null))}return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[B]);const ce=k.useCallback(V=>{if(!V)return;const he=Array.from(V);for(const Ue of he){const Ze=new FileReader;Ze.onload=()=>{const yt=Ze.result.split(",")[1]??"",dt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;M(Xt=>[...Xt,{id:pS(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:yt,previewUrl:dt,size:Ue.size}])},Ze.readAsDataURL(Ue)}},[]),ge=k.useCallback(V=>{M(he=>{const Ue=he.find(Ze=>Ze.id===V);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),he.filter(Ze=>Ze.id!==V)})},[]),ye=k.useCallback(V=>{V.preventDefault(),V.stopPropagation(),!(!T||y)&&D(!0)},[T,y]),Oe=k.useCallback(V=>{V.preventDefault(),V.stopPropagation(),D(!1)},[]),Re=k.useCallback(V=>{V.preventDefault(),V.stopPropagation(),D(!1),!(!T||y)&&ce(V.dataTransfer.files)},[T,y,ce]),je=k.useCallback(V=>{var Ze;if(!T)return;const he=(Ze=V.clipboardData)==null?void 0:Ze.items;if(!he)return;const Ue=[];for(let vt=0;vt<he.length;vt++){const yt=he[vt];if(yt.type.startsWith("image/")){const dt=yt.getAsFile();dt&&Ue.push(dt)}}Ue.length>0&&(V.preventDefault(),ce(Ue))},[T,ce]);function be(V){const he=r.current;he&&(he.style.height=`${V}px`,o.current=V)}function mt(){const V=r.current;if(V){if(V.scrollHeight>V.clientHeight){const he=Math.min(V.scrollHeight,mu);he!==o.current&&be(he);return}o.current>Qr&&(V.style.height="auto",be(Math.min(V.scrollHeight,mu)))}}function Me(){const V=n.trim();if(!V||y)return;let he=V;b.length>0&&(he=`${b.map(vt=>`$${vt.name}`).join(" ")}
|
|
425
|
+
|
|
426
|
+
${V}`);const Ue=L.map(({id:Ze,previewUrl:vt,size:yt,...dt})=>dt);s(""),R([]),be(Qr),ue(!1),ne(void 0),O(!1);for(const Ze of L)Ze.previewUrl&&URL.revokeObjectURL(Ze.previewUrl);M([]),u(he,Ue.length>0?Ue:void 0)}function jt(V){if(V.insertAsText){const he=`/${V.id} `;s(he),ue(!1),ne(void 0),requestAnimationFrame(()=>{if(r.current){r.current.focus();const Ue=he.length;r.current.setSelectionRange(Ue,Ue),mt()}});return}V.subPopup?ne(V.subPopup):V.id==="skills"?(O(!0),H(""),ue(!1),s("")):V.id==="model"?(m(!0),ue(!1),s("")):(ue(!1),s(""))}function ze(V){R(he=>[...he,V]),O(!1),s(""),be(Qr)}function zt(V){const he=im(x==null?void 0:x.runtime_config);Q==="sandbox"?he.sandboxMode=V:Q==="websearch"?he.webSearchMode=V:Q==="network"&&(he.networkAccessEnabled=V==="true"),h(he),ne(void 0),ue(!1),s(""),be(Qr)}function We(V){if(tn.markKeystroke(),oe&&!Q){if(V.key==="ArrowDown"){V.preventDefault(),Fe(he=>Math.min(he+1,te.length-1));return}if(V.key==="ArrowUp"){V.preventDefault(),Fe(he=>Math.max(he-1,0));return}if(V.key==="Enter"){V.preventDefault(),te[Ne]&&jt(te[Ne]);return}if(V.key==="Escape"){V.preventDefault(),ue(!1),s("");return}}if(Q&&V.key==="Escape"){V.preventDefault(),ne(void 0);return}if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&!y){V.preventDefault(),Me();return}V.key==="Escape"&&y&&(V.preventDefault(),f())}function Wt(V){tn.markInputChange();const he=V.target.value;s(he),mt(),he.startsWith("/")&&!he.includes(" ")&&!y?(ue(!0),Te(he.slice(1)),Fe(0)):(ue(!1),ne(void 0)),he.startsWith("$")&&!y?(O(!0),H(he.slice(1))):he.startsWith("$")||O(!1)}const Rt=im(x==null?void 0:x.runtime_config),gt=[{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"}],At=[{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"}],$t=[{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${W?" drag-over":""}`,onDragOver:ye,onDragLeave:Oe,onDrop:Re,children:[oe&&!Q&&c.jsx(oS,{commands:te,selectedIndex:Ne,onSelect:jt,onHover:Fe}),oe&&Q==="sandbox"&&c.jsx(hu,{title:"Sandbox Mode",options:gt,currentValue:Rt.sandboxMode,onSelect:zt,onClose:()=>ne(void 0)}),oe&&Q==="websearch"&&c.jsx(hu,{title:"Web Search",options:At,currentValue:Rt.webSearchMode,onSelect:zt,onClose:()=>ne(void 0)}),oe&&Q==="network"&&c.jsx(hu,{title:"Network Access",options:$t,currentValue:Rt.networkAccessEnabled===!0?"true":"false",onSelect:zt,onClose:()=>ne(void 0)}),ae&&c.jsx(aS,{filter:J,onSelect:ze,onClose:()=>{O(!1),s("")}}),b.length>0&&c.jsx("div",{className:"skill-badges",children:b.map(V=>c.jsxs("span",{className:"skill-badge",children:["$",V.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>R(he=>he.filter(Ue=>Ue.id!==V.id)),children:"×"})]},V.id))}),L.length>0&&c.jsx("div",{className:"attachment-preview-area",children:L.map(V=>c.jsxs("div",{className:"attachment-chip",title:V.name,children:[V.previewUrl?c.jsx("img",{src:V.previewUrl,alt:V.name,className:"attachment-thumb",onClick:()=>q(V),style:{cursor:"pointer"}}):c.jsx(Om,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:V.name}),c.jsx("span",{className:"attachment-size",children:om(V.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>ge(V.id),title:"Remove attachment",children:c.jsx(Vn,{size:14})})]},V.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:V=>{ce(V.target.files),V.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[T&&!y&&!N&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var V;return(V=a.current)==null?void 0:V.click()},title:"Attach files",disabled:y,children:c.jsx(f0,{size:16})}),c.jsx("textarea",{ref:r,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:Qr,maxHeight:mu},onChange:Wt,onKeyDown:We,onPaste:je}),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:Me,disabled:!n.trim()||N,title:"Send (⌘↵)",children:c.jsx(Gx,{size:16})})]}),B&&c.jsx("div",{className:"image-preview-modal",onClick:()=>q(null),children:c.jsxs("div",{className:"image-preview-content",onClick:V=>V.stopPropagation(),children:[c.jsx("img",{src:B.previewUrl,alt:B.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:B.name}),c.jsx("span",{children:om(B.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>q(null),children:c.jsx(Vn,{size:20})})]})})]})}function mS(){const n=P(T=>T.activeSessionId),s=P(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),r=P(T=>T.activeTurnIndex),o=P(T=>T.setActiveTurnIndex),a=P(T=>T.rewindToTurn),u=P(T=>T.restoreSession),f=P(T=>T.branchFromTurn),h=(s==null?void 0:s.turns)??[],m=sa(s),g=!!(s!=null&&s.rewound_at_turn_id),x=(s==null?void 0:s.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),j=k.useRef(null);if(ia(j,()=>N(null),!!y),Ku(()=>N(null),!!y),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function E(T){o(T),requestAnimationFrame(()=>{var L;(L=document.getElementById(`turn-${T}`))==null||L.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,L)=>{const M=L===r,W=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,D=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${M?"active":""}`,onClick:()=>E(L),onContextMenu:B=>{B.preventDefault(),N({x:B.clientX,y:B.clientY,turnId:T.id,turnIndex:L,isLast:L===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(k0,{size:12})}),c.jsx("span",{className:"turn-item-label",children:W}),D&&c.jsx("span",{className:"turn-item-status",children:"running…"})]})},T.id)}),y&&c.jsxs("div",{ref:j,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(m0,{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(t0,{size:12})," Branch from Here"]})]})]})}function gS(){const n=P(h=>h.activeSessionId?h.sessionDetails[h.activeSessionId]:null),s=P(h=>h.changesScope),r=P(h=>h.setChangesScope),o=P(h=>h.activeTurnIndex),a=P(h=>h.setSelectedChangePath),u=(n==null?void 0:n.turns)??[],f=Ag(u,s,o);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"changes-scope-toggle",children:[c.jsx("button",{className:`scope-btn ${s==="session"?"active":""}`,onClick:()=>r("session"),children:"Session"}),c.jsx("button",{className:`scope-btn ${s==="turngroup"?"active":""}`,onClick:()=>r("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 am=2e4;function vS(n){const s=[];return n.forEach((r,o)=>{var a;for(const u of r.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;s.push({item:u,turnIndex:o,turnPrompt:r.user_prompt})}}),s}function yS({entry:n}){const{item:s,turnIndex:r,turnPrompt:o}=n,a=s.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=s.status==="in_progress",j=u==="local_agent",E=u==="local_bash",T=j?ku:E?$m:Pm,L=j?`Subagent${f?`: ${f}`:""}`:E?"Monitor":"Background Task",M=m==="running"?"running…":m==="completed"?"done":m==="failed"?"failed":m==="stopped"?"stopped":m,W=s.status==="failed"||m==="failed",[D,B]=k.useState(N),[q,K]=k.useState(!1),G=k.useRef(null);k.useEffect(()=>{N&&B(!0)},[N]),k.useEffect(()=>{D&&N&&G.current&&(G.current.scrollTop=G.current.scrollHeight)},[D,N,y]);const oe=y.length>am,ue=oe&&!q?y.slice(0,am)+`
|
|
427
|
+
… (truncated, click to expand)`:y,ie=N?null:m==="completed"?c.jsx(Zs,{size:12}):W?c.jsx(Qu,{size:12}):c.jsx(li,{size:12});return c.jsxs("div",{className:`task-card ${N?"task-running":""} ${W?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>B(Te=>!Te),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:L}),c.jsxs("span",{className:`task-card-status ${W?"task-status-failed":N?"task-status-running":"task-status-done"}`,children:[ie," ",M]}),c.jsx(Xu,{size:14,className:"task-card-chevron",style:{transform:D?"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`]}),D&&c.jsxs("div",{className:"task-card-body",children:[y?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:G,children:c.jsx("code",{children:ue})}),oe&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(Te=>!Te),children:q?"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 ",r+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const xS=k.memo(yS);function wS(){var h,m;const n=P(g=>g.activeSessionId?g.sessionDetails[g.activeSessionId]:null),s=(n==null?void 0:n.turns)??[],r=(n==null?void 0:n.backgroundTasks)??[],o=vS(s),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 r)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(xS,{entry:g},g.item.id))]})}const kS=k.memo(wS);function SS({thread:n,onClose:s}){const{activeSessionId:r,resolveThread:o,shareThread:a}=P(),[u,f]=k.useState(""),[h,m]=k.useState(!1),[g,x]=k.useState(!1);async function w(){if(!r||h)return;m(!0),await a(r,n.id,u)?s():m(!1)}async function y(){!r||g||(x(!0),await o(r,n.id),s())}const N=h||g;return c.jsx("div",{className:"dialog-overlay",onClick:N?void 0:s,children:c.jsxs("div",{className:"dialog",onClick:j=>j.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:s,disabled:N,children:c.jsx(Vn,{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:j=>f(j.target.value),rows:3,disabled:N,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:s,disabled:N,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:y,disabled:N,title:"Resolve without sharing",children:[g?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Wl,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:w,disabled:N,children:[h?c.jsx(ns,{size:13,className:"spin"}):c.jsx(v0,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const cm=[];qe.setOptions({breaks:!0,gfm:!0});function TS(n){const s=qe.parse(n);return hd.sanitize(s)}function bS(n){var s,r,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(s=n.data)==null?void 0:s.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((r=n.data)==null?void 0:r.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 NS(n){const s=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return s?s[1]:n}function CS({turn:n}){const s=NS(n.user_prompt),r=n.items.map(bS).filter(o=>o!==null);return r.length===0&&n.status==="completed"&&n.agent_response&&r.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:s}),r.map((o,a)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:TS(o)}},a)),r.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 ES({thread:n,threadTurns:s,onStop:r,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var Ne,Fe,Q;const[m,g]=k.useState(""),[x,w]=k.useState(!0),y=k.useRef(null),N=k.useRef(null),[j,E]=k.useState(!1),[T,L]=k.useState({x:0,y:0}),[M,W]=k.useState(""),D=s.some(oi),B=28,q=120,K=k.useRef(B);k.useEffect(()=>{const ne=N.current;ne&&(ne.scrollTop=ne.scrollHeight)},[s.length,x]);function G(ne){const ae=y.current;ae&&(ae.style.height=`${ne}px`,K.current=ne)}function oe(){const ne=y.current;if(ne){if(ne.scrollHeight>ne.clientHeight){const ae=Math.min(ne.scrollHeight,q);ae!==K.current&&G(ae);return}K.current>B&&(ne.style.height="auto",G(Math.min(ne.scrollHeight,q)))}}const ue=k.useCallback(()=>{E(!1)},[]),ie=k.useCallback(()=>{const ne=N.current;if(!ne)return;const ae=window.getSelection();if(!ae||ae.rangeCount===0||ae.isCollapsed){E(!1);return}const O=ae.getRangeAt(0);if(!ne.contains(O.commonAncestorContainer)){E(!1);return}const J=O.commonAncestorContainer.nodeType===Node.TEXT_NODE?O.commonAncestorContainer.parentElement:O.commonAncestorContainer;if(!(J!=null&&J.closest(".thread-card-ai-response"))){E(!1);return}const H=ae.toString();if(!H.trim()){E(!1);return}const b=O.getBoundingClientRect(),R=28,te=6,ce=170;let ge=!1;if(ae.anchorNode&&ae.focusNode)try{const Re=document.createRange();Re.setStart(ae.focusNode,ae.focusOffset),Re.setEnd(ae.focusNode,ae.focusOffset);const je=document.createRange();je.setStart(ae.anchorNode,ae.anchorOffset),je.setEnd(ae.anchorNode,ae.anchorOffset),ge=je.compareBoundaryPoints(Range.START_TO_START,Re)>0}catch{ge=!1}let ye=b.top-R-te;ye<8&&(ye=b.bottom+te);let Oe=ge?b.left-ce:b.right;Oe=Math.max(8,Math.min(Oe,window.innerWidth-ce-8)),L({x:Oe,y:ye}),W(H),E(!0)},[]);k.useEffect(()=>{function ne(ae){const O=ae.target;O&&O.closest(".selection-actions")||ie()}return document.addEventListener("mouseup",ne),()=>document.removeEventListener("mouseup",ne)},[ie]);const Te=k.useCallback(()=>{var ae;const ne=`
|
|
430
|
+
\`\`\`QUOTE
|
|
431
|
+
${M}
|
|
432
|
+
\`\`\`
|
|
433
|
+
|
|
434
|
+
`;g(O=>O+ne),E(!1),W(""),(ae=window.getSelection())==null||ae.removeAllRanges(),setTimeout(()=>{if(y.current){oe(),y.current.focus();const O=y.current.value.length;y.current.setSelectionRange(O,O)}},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(ne=>!ne),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Fe=(Ne=n.turns)==null?void 0:Ne[0])==null?void 0:Fe.user_prompt)==null?void 0:Q.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:ne=>{ne.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(d0,{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:ue,children:[s.map(ne=>c.jsx(CS,{turn:ne},ne.id)),s.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),j&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:Te,title:"Quote this text in your follow-up",children:[c.jsx(zm,{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:D?"Agent is running…":"Type a follow-up…",value:m,onChange:ne=>{tn.markInputChange(),g(ne.target.value),oe()},disabled:D,rows:1,style:{minHeight:B,maxHeight:q},onKeyDown:ne=>{tn.markKeystroke(),ne.key==="Enter"&&(ne.metaKey||ne.ctrlKey)&&!D&&m.trim()&&(ne.preventDefault(),f(m.trim()),g(""),G(B))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:D||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:c.jsx(la,{size:13})}),D&&c.jsx("button",{className:"thread-card-followup-stop",onClick:r,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(Wl,{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(fs,{size:13})," Delete"]})]})]})]})}function _S(){tn.trackRender("ThreadsPanel");const n=P(M=>M.activeSessionId),s=P(M=>{var W;return M.activeSessionId?((W=M.sessionDetails[M.activeSessionId])==null?void 0:W.threads)??cm:cm}),r=P(M=>M.followupThread),o=P(M=>M.cancelThreadTurn),a=P(M=>M.reopenThread),u=P(M=>M.deleteThread),f=P(M=>M.activeRightTab),h=P(M=>M.switchRightTab),m=P(M=>M.deepLinkThreadId),g=P(M=>M.setDeepLinkThreadId),[x,w]=k.useState("open"),[y,N]=k.useState(null);k.useEffect(()=>{if(!m)return;const M=m;g(null),w(D=>s.some(B=>B.id===M&&B.status==="open")?D:"all");const W=setTimeout(()=>{const D=document.getElementById(`thread-${M}`);D&&(D.scrollIntoView({behavior:"smooth",block:"center"}),D.classList.add("thread-card-highlighted"),setTimeout(()=>D.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(W)},[m,g,s]);const j=s.filter(M=>x==="open"?M.status==="open":x==="resolved"?M.status==="resolved":!0),E=s.filter(M=>M.status==="open").length,T=s.filter(M=>M.status==="resolved").length;function L(M){f==="changes"&&h("turns"),setTimeout(()=>{const W=document.querySelector(`mark[data-thread-id="${M}"]`);W&&(W.scrollIntoView({behavior:"smooth",block:"center"}),W.classList.add("thread-mark-flash"),setTimeout(()=>W.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(c0,{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 (",E,")"]}),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 (",s.length,")"]})]}),j.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",x," threads."]}):j.map(M=>c.jsx(ES,{thread:M,threadTurns:M.turns??[],onStop:()=>o(n,M.id),onResolve:()=>N(M),onReopen:()=>a(n,M.id),onDelete:()=>u(n,M.id),onFollowup:W=>r(n,M.id,W),onLocate:()=>L(M.id)},M.id)),y&&c.jsx(SS,{thread:y,onClose:()=>N(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function jS(){const n=P(f=>f.apps),s=P(f=>f.activeAppTabId),r=P(f=>f.openAppTab),o=P(f=>f.startAppEdit),a=P(f=>f.toggleAppPin),u=P(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${s===f.id?" active":""}`,onClick:()=>r(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(Ml,{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(Hl,{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(fs,{size:12})})]},f.id))})}function RS(){var f,h;tn.trackRender("RightPanel");const n=P(m=>m.activeRightTab),s=P(m=>m.switchRightTab),r=P(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),o=((f=r==null?void 0:r.backgroundTasks)==null?void 0:f.length)??0,a=((h=r==null?void 0:r.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:()=>s(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(mS,{}),n==="changes"&&c.jsx(gS,{}),n==="tasks"&&c.jsx(kS,{}),n==="threads"&&c.jsx(_S,{}),n==="apps"&&c.jsx(jS,{})]})]})}const Ae={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Mu=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max,Ae.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high,Ae.xhigh,Ae.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ae.low,Ae.medium,Ae.high]}]}];function AS(n){return Mu.find(s=>s.id===n)}function md(n){const s=AS(n);return(s==null?void 0:s.models)??[]}function Ig(n,s){return md(n).find(r=>r.slug===s)}function Lu(n,s){var r;return((r=Ig(n,s))==null?void 0:r.reasoningLevels)??[]}function Pu(n,s){var r;return(r=Ig(n,s))==null?void 0:r.defaultReasoning}function IS(){const{activeSessionId:n,sessions:s,updateModelConfig:r}=P(),o=P(Q=>Q.showModelSelector),a=P(Q=>Q.setShowModelSelector),u=s.find(Q=>Q.id===n),f=P(Q=>Q.models),h=P(Q=>Q.modelsLoading),m=P(Q=>Q.loadModels),[g,x]=k.useState(!1),w=k.useRef(null);if(ia(w,()=>x(!1),g),Ku(()=>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??"",j=u.model_reasoning_effort??"",E=f.length>0?f:[],T=md(y),M=[...E.length>0?E:T];if(N&&!M.some(Q=>Q.slug===N)){const Q=T[0];M.unshift({slug:N,displayName:N,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function W(Q){return M.find(ne=>ne.slug===Q)}function D(Q){var ne;return E.length>0?((ne=W(Q))==null?void 0:ne.reasoningLevels)??[]:Lu(y,Q)}function B(Q){var ne;return E.length>0?(ne=W(Q))==null?void 0:ne.defaultReasoning:Pu(y,Q)}const q=Mu.find(Q=>Q.id===y),K=W(N),G=N?D(N):[],oe=(q==null?void 0:q.label)??y,ue=(K==null?void 0:K.displayName)??(N||"Default"),ie=G.find(Q=>Q.effort===j),Te=(ie==null?void 0:ie.label)??(j||"Default");function Ne(Q){var J;const ne=D(Q),O=ne.some(H=>H.effort===j)?j:B(Q)??((J=ne[0])==null?void 0:J.effort)??"";r(Q,O),x(!1)}function Fe(Q){r(N,Q),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:oe}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:ue}),Te!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:Te})]}),c.jsx(si,{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"}),Mu.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.id===y?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===y){x(!1);return}r("","",Q.id)}},children:[c.jsx("span",{children:Q.label}),!Q.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(l0,{size:10})," Soon"]}),Q.id===y&&c.jsx(Zs,{size:12})]},Q.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(Q=>c.jsxs("div",{className:`model-selector-item ${Q.slug===N?"selected":""}`,onClick:()=>Ne(Q.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===N&&c.jsx(Zs,{size:12})]},Q.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),G.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),G.map(Q=>c.jsxs("div",{className:`model-selector-item ${Q.effort===j?"selected":""}`,onClick:()=>Fe(Q.effort),children:[c.jsx("span",{children:Q.label}),Q.effort===j&&c.jsx(Zs,{size:12})]},Q.effort))]})]})]})}function DS(n,s){if(!n||n.turns.length===0)return"—";const r=n.turns[0],o=n.turns[n.turns.length-1],a=s?null:o.updated_at;return Fx(r.created_at,a)}function Al(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function um(){const n=P(r=>r.setShowRemoteModal),s=$u(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(T0,{size:14})," Repoburg",s?` · ${s}`:""]})}function dm(){const n=P(r=>r.vscodeViewOpen),s=P(r=>r.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:s,children:[c.jsx(Qx,{size:14})," VS Code"]})}function MS(){var y,N;tn.trackRender("StatusBar");const n=P(j=>j.activeSessionId),s=P(j=>n?j.sessions.find(E=>E.id===n)??null:null),r=P(j=>n?j.sessionDetails[n]??null:null),o=P(j=>j.wsConnected),a=P(j=>j.switchRightTab),u=(r==null?void 0:r.contextUsage)??null;if(!s)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(um,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(dm,{}),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(ch,{size:14})," K"]})]});const f=ra(s),h=DS(r,f.isRunning),m=(r==null?void 0:r.backgroundTasks)??[],g=new Set,x=new Map;for(const j of m)g.add(j.task_id),x.set(j.task_id,j.task_type);for(const j of(r==null?void 0:r.turns)??[])for(const E of j.items)if(E.type==="background_task"&&E.status==="in_progress"){const T=((y=E.data)==null?void 0:y.task_id)??E.external_item_id,L=((N=E.data)==null?void 0:N.task_type)??"unknown";g.add(T),x.set(T,L)}const w=[...x.values()].filter(j=>j==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(um,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(dm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(IS,{}),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(Fm,{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:s.status==="failed"?{color:"var(--red)"}:void 0,children:[c.jsx(oa,{status:f.dot})," ",f.label]}),u&&c.jsx(LS,{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(ch,{size:14})," K"]})]})}function LS({usage:n}){const s=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",r=`${Al(n.totalTokens)} / ${Al(n.contextWindow)} tokens`;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:r,children:c.jsxs("span",{className:"sb-context-text",style:{color:s},children:[Math.round(n.percentage),"% / ",Al(n.totalTokens)," / ",Al(n.contextWindow)]})})]})}function fm(n){return gn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function PS(n){return _t("/vscode-web/start",{folder:n})}function OS(n){return _t("/vscode-web/heartbeat",{id:n})}const zS=1e3,$S=5*6e4;function FS(){const n=P(w=>w.vscodeState),s=P(w=>w.vscodeId),r=P(w=>w.vscodeToken),o=P(w=>w.setVscodeView),a=P(w=>{var N;const y=w.activeSessionId?w.sessions.find(j=>j.id===w.activeSessionId):null;return y!=null&&y.cwd?y.cwd:((N=w.workspaces.find(j=>j.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 E=await fm(a);if((E.state==="stopped"||E.state==="error")&&(E=await PS(a)),w||(o(E.state,E.id,E.token),E.state==="running"||E.state==="error"))return;g.current=setInterval(async()=>{const T=await fm(a);w||(o(T.state,T.id,T.token),(T.state==="running"||T.state==="error"||T.state==="stopped")&&y())},zS)}catch{w||o("error",null,null)}}N();const j=setInterval(()=>{const E=P.getState().vscodeId;E&&OS(E).catch(()=>{})},$S);return()=>{w=!0,y(),clearInterval(j)}},[h,a,o]);function x(){f(!1),o("starting",null,null),m(w=>w+1)}return n!=="running"||!r||!s?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(ns,{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(ns,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:`${ps()}/vscode/${s}/?tkn=${r}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},s)]})}const US=`(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
|
+
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
471
|
+
window.addEventListener('error', function (e) {
|
|
472
|
+
parent.postMessage({
|
|
473
|
+
source: 'agentpane-app', report: 'error',
|
|
474
|
+
message: e.message || 'Unknown error',
|
|
475
|
+
stack: (e.error && e.error.stack) || '',
|
|
476
|
+
line: e.lineno || 0, col: e.colno || 0
|
|
477
|
+
}, '*');
|
|
478
|
+
});
|
|
479
|
+
window.addEventListener('unhandledrejection', function (e) {
|
|
480
|
+
var r = e.reason;
|
|
481
|
+
var msg = r && (r.message || String(r)) || 'unknown';
|
|
482
|
+
parent.postMessage({
|
|
483
|
+
source: 'agentpane-app', report: 'error',
|
|
484
|
+
message: 'Unhandled promise rejection: ' + msg,
|
|
485
|
+
stack: (r && r.stack) || '', line: 0, col: 0
|
|
486
|
+
}, '*');
|
|
487
|
+
});
|
|
488
|
+
})();`;function pm(n){return n.replace(/<\/script/gi,"<\\/script")}function BS(n,s){const r=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(r,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function hm(n,s,r){const o=BS(n,s);return o===-1?n+r:n.slice(0,o)+r+n.slice(o)}function WS(n,s,r){let o=n;const a=`<script>${pm(s)}<\/script>`;if(/<\/head>/i.test(o)?o=hm(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,r){const u=`<script>${pm(r)}<\/script>`;o=hm(o,"</body>",u)}return o}function HS({appId:n,workspace:s=""}){const r=k.useRef(null),o=k.useRef({pinned:!1,data:null}),[a,u]=k.useState(null),[f,h]=k.useState(null),[m,g]=k.useState([]);k.useEffect(()=>{let y=!0;Jy(n,j=>{var E,T;return(T=(E=r.current)==null?void 0:E.contentWindow)==null?void 0:T.postMessage(j,"*")});const N=async j=>{var W,D,B,q,K,G,oe,ue;if(j.source!==((W=r.current)==null?void 0:W.contentWindow))return;const E=j.data;if(!E||E.source!=="agentpane-app")return;if(E.report==="error"){const ie={message:String(E.message??"Unknown error"),stack:String(E.stack??"")};g(Te=>{const Ne=Te[Te.length-1];return Ne&&Ne.message===ie.message?Te:[...Te,ie].slice(-20)});return}if(typeof E.method!="string")return;let T=!0,L,M;try{switch(E.method){case"getApp":L={id:n};break;case"getState":L=o.current;break;case"setState":{const ie=((D=E.params)==null?void 0:D.data)??null,Te=await jm(n,{data:ie},s);o.current=Te,L=Te;break}case"createSession":{const ie=E.params??{},Te=await Fu({title:typeof ie.title=="string"?ie.title:void 0,runtime_type:typeof ie.runtime_type=="string"?ie.runtime_type:void 0,model:typeof ie.model=="string"?ie.model:void 0,cwd:typeof ie.cwd=="string"?ie.cwd:void 0,origin_app_id:n});Zc(Te.id,n),L=Te;break}case"submitTurn":{const ie=String(((B=E.params)==null?void 0:B.sessionId)??""),Te=String(((q=E.params)==null?void 0:q.prompt)??""),Ne=await Nm(ie,Te);Zc(ie,n),L=Ne;break}case"resolveToolCall":{const ie=String(((K=E.params)==null?void 0:K.callId)??""),Te=(G=E.params)==null?void 0:G.result;await Nx(ie,Te),L={ok:!0};break}default:throw new Error(`Unknown bridge method: ${E.method}`)}}catch(ie){T=!1,M=ie instanceof Error?ie.message:String(ie)}(ue=(oe=r.current)==null?void 0:oe.contentWindow)==null||ue.postMessage({source:"agentpane-host",id:E.id,ok:T,result:L,error:M},"*")};return window.addEventListener("message",N),ix(n,()=>{ih(n,s).then(j=>{y&&(o.current=j)}).catch(()=>{})}),sx(n,()=>{rh(n).then(j=>{y&&(u(j),g([]))}).catch(()=>{})}),(async()=>{try{const[j,E,T]=await Promise.all([rh(n),ih(n,s),wx(n).catch(()=>[])]);if(!y)return;o.current=E,T.forEach(L=>Zc(L.id,n)),u(j)}catch(j){y&&h(j instanceof Error?j.message:String(j))}})(),()=>{y=!1,ex(n),rx(n),ox(n),window.removeEventListener("message",N)}},[n,s]);const x=k.useMemo(()=>a?WS(a.html,US,a.js):"",[a]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!x)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const w=(a==null?void 0:a.diagnostics)??[];return c.jsxs("div",{className:"miniapp-runtime",children:[w.length>0&&c.jsxs("div",{className:"miniapp-diagnostics","data-testid":"miniapp-diagnostics",children:[c.jsxs("div",{className:"miniapp-diagnostics-title",children:["Compile errors in ",(a==null?void 0:a.sourceFile)??"the app logic"," — the pane serves the last code that parsed:"]}),w.map((y,N)=>c.jsxs("div",{className:"miniapp-diag",children:[y.file,":",y.line,":",y.column," — ",y.message]},N))]}),c.jsx("iframe",{ref:r,className:"miniapp-frame",sandbox:"allow-scripts",title:`Mini app: ${n}`,srcDoc:x}),m.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:m.map((y,N)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:y.message}),y.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:y.stack})]},N))})]})}function VS(){const n=P(w=>w.activeAppTabId),s=P(w=>w.apps),r=P(w=>w.workspaces),o=P(w=>w.appWorkspaces),a=P(w=>w.setAppWorkspace),u=P(w=>w.setActiveAppTab),f=P(w=>w.startAppEdit);if(!n)return null;const h=s.find(w=>w.id===n),m=o[n]??"",g=r.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(p0,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>u(null),children:c.jsx(Vn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(HS,{appId:n,workspace:m},`${n}:${m}`)})]})}function GS({side:n,minWidth:s,maxWidth:r,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,j=n==="left"?m.current+N:m.current-N,E=Math.min(r,Math.max(s,j));a(E)},[n,s,r,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=>{var N,j;y.preventDefault(),y.stopPropagation();try{(j=(N=y.currentTarget)==null?void 0:N.setPointerCapture)==null||j.call(N,y.pointerId)}catch{}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 mm({side:n,minWidth:s,maxWidth:r,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=GS({side:n,minWidth:s,maxWidth:r,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 qS(){tn.trackRender("IdeWorkspace");const n=P(h=>h.sidebarWidth),s=P(h=>h.rightPanelWidth),r=P(h=>h.setSidebarWidth),o=P(h=>h.setRightPanelWidth),a=P(h=>h.vscodeViewOpen),u=P(h=>h.activeAppTabId);k.useEffect(()=>{const h=()=>{const m=zl(),{rightPanelWidth:g,setRightPanelWidth:x}=P.getState();g>m&&x(m)};return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]);const f=`${n}px 6px 1fr 6px ${s}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:f},children:[c.jsx(x1,{}),c.jsx(mm,{side:"left",minWidth:vu,maxWidth:yu,getWidth:()=>P.getState().sidebarWidth,setWidth:r}),c.jsxs("div",{className:"ide-center",children:[c.jsx(w1,{}),c.jsx("div",{className:"ide-render",children:u!=null?c.jsx(VS,{}):c.jsx(nS,{})}),c.jsx(hS,{})]}),c.jsx(mm,{side:"right",minWidth:Ol,maxWidth:zl(),getWidth:()=>P.getState().rightPanelWidth,setWidth:o}),c.jsx(RS,{})]}),a&&c.jsx(FS,{}),c.jsx(MS,{})]})}function KS(){const{showNewSessionDialog:n,setShowNewSessionDialog:s,createSession:r,lastModelConfig:o}=P(),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,j]=k.useState("");if(!n)return null;const E=md(a),T=g?Lu(a,g):[];function L(){r({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:w||void 0,cwd:N.trim()||void 0,runtime_type:a}),m(""),j("")}function M(D){D.key==="Escape"&&s(!1)}function W(D){var K;x(D);const B=Lu(a,D);B.some(G=>G.effort===w)||y(Pu(a,D)??((K=B[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:D=>D.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:()=>s(!1),children:c.jsx(Vn,{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:D=>m(D.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:D=>W(D.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(D=>c.jsxs("option",{value:D.slug,children:[D.displayName," — ",D.description]},D.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:w,onChange:D=>y(D.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Pu(a,g),")"]}),T.map(D=>c.jsx("option",{value:D.effort,children:D.label},D.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:N,onChange:D=>j(D.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:()=>s(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:L,children:"Create"})]})]})})}const YS=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,XS=512*1024;function QS(n){const s=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(s)?s:""}function ZS(){const{appCatalogOpen:n,closeAppCatalog:s,apps:r,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=P(),[f,h]=k.useState("examples"),[m,g]=k.useState(null),[x,w]=k.useState(null),[y,N]=k.useState(!1),[j,E]=k.useState(""),[T,L]=k.useState(""),[M,W]=k.useState(""),[D,B]=k.useState(""),[q,K]=k.useState(null),[G,oe]=k.useState(""),ue=k.useRef(null);if(k.useEffect(()=>{n&&(g(null),kx().then(g).catch(()=>g([])))},[n]),k.useEffect(()=>{ue.current&&(ue.current.webkitdirectory=!0)},[f]),!n)return null;const ie=new Set(r.map(O=>O.id));async function Te(O){w(O);try{await o(O)&&s()}finally{w(null)}}async function Ne(){if(y)return;const O=j.trim(),J=T.trim();if(!(!O||!J)){N(!0);try{await a({id:O,title:J,description:M.trim()||void 0,icon:D.trim()||void 0})&&(E(""),L(""),W(""),B(""),s())}finally{N(!1)}}}async function Fe(O){const J=Array.from(O.target.files??[]),H={};let b="";for(const R of J){const ce=(R.webkitRelativePath??"").split("/");!b&&ce.length>1&&(b=ce[0]);const ge=ce[ce.length-1];if(!(!ge||!YS.test(ge))&&!(R.size>XS))try{H[ge]=await R.text()}catch{}}K(Object.keys(H).length>0?H:null),oe(QS(b))}async function Q(){if(!(y||!q||!G.trim())){N(!0);try{await u(G.trim(),q)&&(K(null),oe(""),s())}finally{N(!1)}}}function ne(O){O.key==="Escape"&&s()}const ae=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:s,children:c.jsxs("div",{className:"dialog app-catalog",onClick:O=>O.stopPropagation(),onKeyDown:ne,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:s,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:ae.map(O=>c.jsx("button",{className:`catalog-tab${f===O.key?" active":""}`,onClick:()=>h(O.key),children:O.label},O.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(O=>{const J=ie.has(O.id);return c.jsxs("div",{className:"example-row",children:[c.jsx("span",{className:"sidebar-app-icon",children:O.icon??"◧"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:O.title}),O.description&&c.jsx("span",{className:"example-desc",children:O.description})]}),c.jsx("button",{className:"example-install",disabled:J||x===O.id,onClick:()=>Te(O.id),title:J?"Already installed":"Install this example",children:J?"Installed":x===O.id?"Installing…":"Install"})]},O.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:j,onChange:O=>E(O.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:O=>L(O.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:O=>W(O.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:D,onChange:O=>B(O.target.value),placeholder:"e.g. 📝"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!j.trim()||!T.trim(),onClick:Ne,children:[c.jsx(yr,{size:13})," Create App"]})]}),f==="upload"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"catalog-upload-hint",children:"Select an app folder from disk. Text files only (manifest.json, index.html, app.ts (or legacy app.js), …). A missing manifest.json is generated from the folder name."}),c.jsx("input",{ref:ue,type:"file",multiple:!0,onChange:Fe}),q&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:G,onChange:O=>oe(O.target.value)})]}),c.jsxs("div",{className:"catalog-upload-summary",children:[Object.keys(q).length," file(s):"," ",Object.keys(q).slice(0,6).join(", "),Object.keys(q).length>6?", …":""]})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:y||!q||!G.trim(),onClick:Q,children:[c.jsx(w0,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:s,children:"Close"})})]})})}function JS(){const n=P(w=>w.showCommandPalette),s=P(w=>w.setShowCommandPalette),r=P(),[o,a]=k.useState(""),[u,f]=k.useState(0),h=k.useRef(null),m=k.useMemo(()=>{const w=r.activeSessionId?r.sessionDetails[r.activeSessionId]:null,y=sa(w);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:yr,action:()=>r.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:fs,action:()=>{r.activeSessionId&&r.deleteSession(r.activeSessionId)},available:!!r.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:la,action:()=>{const N=document.querySelector(".cmd-input");N==null||N.focus()},available:!!r.activeSessionId&&!y},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:li,action:()=>r.cancelTurn(),available:y},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:o0,action:()=>r.switchRightTab("turns"),available:!!r.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:Jx,action:()=>r.switchRightTab("changes"),available:!!r.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Vn,action:()=>{r.activeSessionId&&r.closeTab(r.activeSessionId)},available:!!r.activeSessionId}]},[r]),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(),s(!1))}else w.key==="Escape"&&s(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>s(!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(),s(!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(Zx,{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 gm=/^[a-z][a-z0-9-]{1,30}$/,eT=2e3;function tT(){const{showRemoteModal:n,setShowRemoteModal:s,selectSession:r}=P(),[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,j]=k.useState(!1),[E,T]=k.useState("main"),[L,M]=k.useState(""),[W,D]=k.useState(!1),[B,q]=k.useState(null),K=k.useRef(null);ia(K,()=>j(!1),N);const G=g||w,oe=k.useCallback(async()=>{m(!0),f(null);try{const O=await fetch(`${ps()}/remote/status`,{headers:{Accept:"application/json"}});if(!O.ok)throw new Error(`status ${O.status}`);a(await O.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);k.useEffect(()=>{n&&(T("main"),q(null),oe())},[n,oe]);const ue=B!==null&&B.state==="running";if(k.useEffect(()=>{if(!ue)return;const O=setInterval(async()=>{try{const J=await fetch(`${ps()}/remote/enable`,{headers:{Accept:"application/json"}});J.ok&&q(await J.json())}catch{}},eT);return()=>clearInterval(O)},[ue]),!n)return null;const ie=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function Te(O){O.key==="Escape"&&s(!1)}async function Ne(O){if(gm.test(O)){D(!0);try{const J=await fetch(`${ps()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:O})});if(!J.ok)throw new Error(`enable ${J.status}`);q(await J.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{D(!1)}}}function Fe(){B!=null&&B.troubleshootingSessionId&&(r(B.troubleshootingSessionId),s(!1))}async function Q(){x(!0);try{await fetch(`${ps()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{x(!1)}}async function ne(){if(j(!1),!!window.confirm(`Remove the tunnel completely?
|
|
489
|
+
|
|
490
|
+
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
491
|
+
|
|
492
|
+
This cannot be undone.`)){y(!0);try{const J=await fetch(`${ps()}/remote/uninstall`,{method:"DELETE"});if(!J.ok)throw new Error(`uninstall ${J.status}`);await oe()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{y(!1)}}}function ae(){if(!B)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:L,onChange:b=>M(b.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:!gm.test(L)||W,onClick:()=>void Ne(L),children:[W?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const O=["detect","provision","install","verify","ready"],J=O.indexOf(B.step),H=B.state==="ready";return c.jsxs(c.Fragment,{children:[B.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(ns,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),B.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(Zs,{size:14})," Setup complete — you can close this window."]}),B.state==="ready"&&B.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${B.hostname}`,target:"_blank",rel:"noreferrer",children:B.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:O.map((b,R)=>{const te=H||J>-1&&R<J,ce=!H&&R===J&&B.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:te||ce?1:.4,color:te?"var(--green)":void 0},children:[te?c.jsx(Zs,{size:13}):ce?c.jsx(ns,{size:13,className:"spin"}):c.jsx(Xx,{size:9,style:{marginLeft:2,marginRight:2}}),b]},b)})}),B.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:B.logs.slice(-3).map(b=>b.message).join(`
|
|
493
|
+
`)}),B.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:Fe,children:"Open troubleshooting session"})})]}),B.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",B.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void oe(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>s(!1),children:c.jsxs("div",{className:"dialog",onClick:O=>O.stopPropagation(),onKeyDown:Te,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>s(!1),children:c.jsx(Vn,{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(ns,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),E==="setup"?ae():c.jsxs(c.Fragment,{children:[ie&&(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 Q(),disabled:G,children:[g?c.jsx(ns,{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:()=>j(O=>!O),disabled:G,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":N,children:w?c.jsx(ns,{size:14,className:"spin"}):c.jsx(si,{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 ne(),children:[c.jsx(fs,{size:12})," Remove tunnel"]})})]})]}),!ie&&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 Ne(o.tunnel.mahlas),disabled:W,children:[W?c.jsx(ns,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(uh,{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(uh,{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 nT={success:Kx,error:Qu,info:n0,warn:y0},sT=4e3;function rT({toast:n}){const s=P(f=>f.removeToast),r=nT[n.type],o=k.useRef(null);k.useEffect(()=>{function f(){o.current=setTimeout(()=>s(n.id),sT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,s]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>s(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(r,{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),s(n.id)},children:[c.jsx(x0,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>s(n.id),children:c.jsx(Vn,{size:14})})]})}function iT(){const n=P(s=>s.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(s=>c.jsx(rT,{toast:s},s.id))})}let Wn=null,ii=null,so=1e3;const oT=1e4;function lT(){const n=ps();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Ou(){Wn&&(Wn.readyState===WebSocket.OPEN||Wn.readyState===WebSocket.CONNECTING)||(Wn=new WebSocket(lT()),Wn.onopen=()=>{const n=so>1e3;if(so=1e3,P.getState().setWsConnected(!0),P.getState().addLogEntry("INFO","WebSocket connected"),n){const s=P.getState();s.activeSessionId&&(s.refreshActiveSession(),s.addToast("info","WebSocket reconnected — session state reconciled"))}},Wn.onclose=()=>{P.getState().setWsConnected(!1),P.getState().addLogEntry("WARN","WebSocket disconnected"),P.getState().addToast("warn","WebSocket disconnected — reconnecting…"),cT()},Wn.onerror=()=>{},Wn.onmessage=n=>{try{const s=JSON.parse(n.data);tn.trackWsEvent(typeof s.event=="string"?s.event:"unknown",typeof n.data=="string"?n.data.length:0);const r=uT[s.event];r&&r(s.data)}catch{}})}function aT(){ii&&(clearTimeout(ii),ii=null),Wn&&(Wn.onclose=null,Wn.close(),Wn=null),P.getState().setWsConnected(!1)}function cT(){ii||(ii=window.setTimeout(()=>{ii=null,Ou()},so),so=Math.min(so*2,oT))}const uT={"turn:started":n=>{const s=n;tn.note(`turn:started — ${s.turnId.slice(0,8)}`),P.getState().onTurnStarted(s.sessionId,s.turnId)},"item:started":n=>{const s=n;P.getState().onItemStarted(s.sessionId,s.turnId,s.item)},"item:updated":n=>{const s=n;P.getState().onItemUpdated(s.sessionId,s.turnId,s.item)},"item:completed":n=>{const s=n;P.getState().onItemCompleted(s.sessionId,s.turnId,s.item)},"item:delta":n=>{const s=n;P.getState().onItemDelta(s.sessionId,s.turnId,s.itemId,s.delta)},"turn:completed":n=>{const s=n;tn.note(`turn:completed — ${s.turnId.slice(0,8)}`),P.getState().onTurnCompleted(s.sessionId,s.turnId,s.usage,s.hasUnreviewed,s.response??void 0)},"turn:tokenUsage":n=>{const s=n;P.getState().onTokenUsageUpdated(s.sessionId,s.turnId,s.usage)},"turn:contextUsage":n=>{const s=n,r={totalTokens:s.totalTokens,contextWindow:s.contextWindow,percentage:s.percentage};P.getState().onContextUsageUpdated(s.sessionId,r)},"turn:failed":n=>{const s=n;P.getState().onTurnFailed(s.sessionId,s.turnId,s.error)},"turn:cancelled":n=>{const s=n;P.getState().onTurnCancelled(s.sessionId,s.turnId)},"session:title":n=>{const s=n;P.getState().onSessionTitle(s.sessionId,s.title)},background_tasks:n=>{const s=n;tn.note(`background_tasks — ${s.tasks.length} live (${s.tasks.map(r=>r.task_type).join(", ")||"none"})`),P.getState().onBackgroundTasksChanged(s.sessionId,s.tasks)},"thread:created":n=>{const s=n;P.getState().onThreadCreated(s.sessionId,s.thread,s.turn)},"thread:followup":n=>{const s=n;P.getState().onThreadFollowup(s.sessionId,s.threadId,s.turn)},"thread:resolved":n=>{const s=n;P.getState().onThreadResolved(s.sessionId,s.threadId,s.status)},"thread:deleted":n=>{const s=n;P.getState().onThreadDeleted(s.sessionId,s.threadId)},"app:tool_call":n=>{const s=n;tx(s.appId,s.callId,s.tool,s.args??{})},"app:source:updated":n=>{ax(n.appId)},"app:state_changed":n=>{lx(n.appId)}};function dT(){const n=P(s=>s.init);return k.useEffect(()=>{Ay(),n(),P.getState().loadApps(),Ou();function s(){if(document.visibilityState!=="visible")return;const r=P.getState(),o=r.activeSessionId;if(!o)return;const a=r.sessionDetails[o];r.wsConnected||Ou(),a&&a.is_running===1&&(r.refreshActiveSession(),r.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",s),()=>{aT(),document.removeEventListener("visibilitychange",s)}},[n]),null}function fT(){const n=P(a=>a.loading),s=P(a=>a.error),r=P(a=>a.sessions),o=P(a=>a.setShowCommandPalette);return k.useEffect(()=>tn.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(dT,{}),n&&r.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):s&&r.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",s]}):c.jsxs(c.Fragment,{children:[c.jsx(qS,{}),c.jsx(KS,{}),c.jsx(ZS,{}),c.jsx(tT,{}),c.jsx(JS,{}),c.jsx(iT,{})]})]})}ky.createRoot(document.getElementById("root")).render(c.jsx(at.StrictMode,{children:c.jsx(fT,{})}));
|