repoburg 1.3.269 → 1.3.271
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 +54904 -277
- package/agent-pane/backend/dist/server.js +54904 -277
- package/agent-pane/examples/pr-review/manifest.json +1 -1
- package/agent-pane/frontend/dist/assets/index-DSVgGDLh.css +1 -0
- package/agent-pane/frontend/dist/assets/index-h9tBvm8B.js +606 -0
- package/agent-pane/frontend/dist/index.html +2 -2
- package/daemon/dist/tabtape/config.js +1 -1
- package/daemon/dist/tabtape/mcp/definitions.js +2 -2
- package/daemon/dist/tabtape/mcp/server.js +2 -2
- package/daemon/dist/tabtape/mcp/server.spec.js +18 -0
- package/daemon/dist/tabtape/mcp/tools.js +10 -0
- package/daemon/dist/tabtape/query/perf.js +53 -1
- package/daemon/dist/tabtape/query/query.spec.js +13 -1
- package/daemon/dist/tabtape/query/types.js +4 -0
- package/daemon/dist/tabtape/testing/querytest.js +8 -1
- package/package.json +4 -1
- package/tabtape/extension/dist/build-info.json +4 -4
- package/tabtape/extension/dist/manifest.json +2 -2
- package/tabtape/extension/dist/recorder.js +21 -21
- package/tabtape/extension/dist/recorder.js.map +1 -1
- package/tabtape/ui/dist/app/assets/{index-iWNSSrAE.js → index-B7yWGVQ_.js} +10 -9
- package/tabtape/ui/dist/app/assets/{index-Canv3Ljk.css → index-BE22UToa.css} +1 -1
- package/tabtape/ui/dist/app/index.html +2 -2
- package/tabtape/ui/dist/build-info.json +4 -4
- package/tabtape/ui/dist/export/viewer.css +1 -1
- package/tabtape/ui/dist/export/viewer.js +6 -5
- package/agent-pane/frontend/dist/assets/index-BaBO6I13.js +0 -567
- package/agent-pane/frontend/dist/assets/index-K4hE7q_n.css +0 -1
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
var Wy=Object.defineProperty;var Hy=(n,r,s)=>r in n?Wy(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var lt=(n,r,s)=>Hy(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function Lm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var tu={exports:{}},eo={},nu={exports:{}},We={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Hp;function Vy(){if(Hp)return We;Hp=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),k=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=k&&j[k]||j["@@iterator"],typeof j=="function"?j:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function T(j,L,ce){this.props=j,this.context=L,this.refs=C,this.updater=ce||S}T.prototype.isReactComponent={},T.prototype.setState=function(j,L){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,L,"setState")},T.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function I(){}I.prototype=T.prototype;function R(j,L,ce){this.props=j,this.context=L,this.refs=C,this.updater=ce||S}var B=R.prototype=new I;B.constructor=R,E(B,T.prototype),B.isPureReactComponent=!0;var $=Array.isArray,W=Object.prototype.hasOwnProperty,Q={current:null},K={key:!0,ref:!0,__self:!0,__source:!0};function X(j,L,ce){var G,le={},fe=null,Pe=null;if(L!=null)for(G in L.ref!==void 0&&(Pe=L.ref),L.key!==void 0&&(fe=""+L.key),L)W.call(L,G)&&!K.hasOwnProperty(G)&&(le[G]=L[G]);var Te=arguments.length-2;if(Te===1)le.children=ce;else if(1<Te){for(var Ee=Array(Te),Ce=0;Ce<Te;Ce++)Ee[Ce]=arguments[Ce+2];le.children=Ee}if(j&&j.defaultProps)for(G in Te=j.defaultProps,Te)le[G]===void 0&&(le[G]=Te[G]);return{$$typeof:n,type:j,key:fe,ref:Pe,props:le,_owner:Q.current}}function ue(j,L){return{$$typeof:n,type:j.type,key:L,ref:j.ref,props:j.props,_owner:j._owner}}function me(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function de(j){var L={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ce){return L[ce]})}var De=/\/+/g;function je(j,L){return typeof j=="object"&&j!==null&&j.key!=null?de(""+j.key):L.toString(36)}function Le(j,L,ce,G,le){var fe=typeof j;(fe==="undefined"||fe==="boolean")&&(j=null);var Pe=!1;if(j===null)Pe=!0;else switch(fe){case"string":case"number":Pe=!0;break;case"object":switch(j.$$typeof){case n:case r:Pe=!0}}if(Pe)return Pe=j,le=le(Pe),j=G===""?"."+je(Pe,0):G,$(le)?(ce="",j!=null&&(ce=j.replace(De,"$&/")+"/"),Le(le,L,ce,"",function(Ce){return Ce})):le!=null&&(me(le)&&(le=ue(le,ce+(!le.key||Pe&&Pe.key===le.key?"":(""+le.key).replace(De,"$&/")+"/")+j)),L.push(le)),1;if(Pe=0,G=G===""?".":G+":",$(j))for(var Te=0;Te<j.length;Te++){fe=j[Te];var Ee=G+je(fe,Te);Pe+=Le(fe,L,ce,Ee,le)}else if(Ee=x(j),typeof Ee=="function")for(j=Ee.call(j),Te=0;!(fe=j.next()).done;)fe=fe.value,Ee=G+je(fe,Te++),Pe+=Le(fe,L,ce,Ee,le);else if(fe==="object")throw L=String(j),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return Pe}function ne(j,L,ce){if(j==null)return j;var G=[],le=0;return Le(j,G,"","",function(fe){return L.call(ce,fe,le++)}),G}function q(j){if(j._status===-1){var L=j._result;L=L(),L.then(function(ce){(j._status===0||j._status===-1)&&(j._status=1,j._result=ce)},function(ce){(j._status===0||j._status===-1)&&(j._status=2,j._result=ce)}),j._status===-1&&(j._status=0,j._result=L)}if(j._status===1)return j._result.default;throw j._result}var Y={current:null},P={transition:null},Z={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:P,ReactCurrentOwner:Q};function V(){throw Error("act(...) is not supported in production builds of React.")}return We.Children={map:ne,forEach:function(j,L,ce){ne(j,function(){L.apply(this,arguments)},ce)},count:function(j){var L=0;return ne(j,function(){L++}),L},toArray:function(j){return ne(j,function(L){return L})||[]},only:function(j){if(!me(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},We.Component=T,We.Fragment=s,We.Profiler=a,We.PureComponent=R,We.StrictMode=o,We.Suspense=g,We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Z,We.act=V,We.cloneElement=function(j,L,ce){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var G=E({},j.props),le=j.key,fe=j.ref,Pe=j._owner;if(L!=null){if(L.ref!==void 0&&(fe=L.ref,Pe=Q.current),L.key!==void 0&&(le=""+L.key),j.type&&j.type.defaultProps)var Te=j.type.defaultProps;for(Ee in L)W.call(L,Ee)&&!K.hasOwnProperty(Ee)&&(G[Ee]=L[Ee]===void 0&&Te!==void 0?Te[Ee]:L[Ee])}var Ee=arguments.length-2;if(Ee===1)G.children=ce;else if(1<Ee){Te=Array(Ee);for(var Ce=0;Ce<Ee;Ce++)Te[Ce]=arguments[Ce+2];G.children=Te}return{$$typeof:n,type:j.type,key:le,ref:fe,props:G,_owner:Pe}},We.createContext=function(j){return j={$$typeof:f,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:u,_context:j},j.Consumer=j},We.createElement=X,We.createFactory=function(j){var L=X.bind(null,j);return L.type=j,L},We.createRef=function(){return{current:null}},We.forwardRef=function(j){return{$$typeof:h,render:j}},We.isValidElement=me,We.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:q}},We.memo=function(j,L){return{$$typeof:m,type:j,compare:L===void 0?null:L}},We.startTransition=function(j){var L=P.transition;P.transition={};try{j()}finally{P.transition=L}},We.unstable_act=V,We.useCallback=function(j,L){return Y.current.useCallback(j,L)},We.useContext=function(j){return Y.current.useContext(j)},We.useDebugValue=function(){},We.useDeferredValue=function(j){return Y.current.useDeferredValue(j)},We.useEffect=function(j,L){return Y.current.useEffect(j,L)},We.useId=function(){return Y.current.useId()},We.useImperativeHandle=function(j,L,ce){return Y.current.useImperativeHandle(j,L,ce)},We.useInsertionEffect=function(j,L){return Y.current.useInsertionEffect(j,L)},We.useLayoutEffect=function(j,L){return Y.current.useLayoutEffect(j,L)},We.useMemo=function(j,L){return Y.current.useMemo(j,L)},We.useReducer=function(j,L,ce){return Y.current.useReducer(j,L,ce)},We.useRef=function(j){return Y.current.useRef(j)},We.useState=function(j){return Y.current.useState(j)},We.useSyncExternalStore=function(j,L,ce){return Y.current.useSyncExternalStore(j,L,ce)},We.useTransition=function(){return Y.current.useTransition()},We.version="18.3.1",We}var Vp;function Gu(){return Vp||(Vp=1,nu.exports=Vy()),nu.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 qp;function qy(){if(qp)return eo;qp=1;var n=Gu(),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,g,m){var v,k={},x=null,S=null;m!==void 0&&(x=""+m),g.key!==void 0&&(x=""+g.key),g.ref!==void 0&&(S=g.ref);for(v in g)o.call(g,v)&&!u.hasOwnProperty(v)&&(k[v]=g[v]);if(h&&h.defaultProps)for(v in g=h.defaultProps,g)k[v]===void 0&&(k[v]=g[v]);return{$$typeof:r,type:h,key:x,ref:S,props:k,_owner:a.current}}return eo.Fragment=s,eo.jsx=f,eo.jsxs=f,eo}var Gp;function Gy(){return Gp||(Gp=1,tu.exports=qy()),tu.exports}var c=Gy(),w=Gu();const st=Lm(w);var Aa={},ru={exports:{}},En={},su={exports:{}},iu={};/**
|
|
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 Kp;function Ky(){return Kp||(Kp=1,(function(n){function r(P,Z){var V=P.length;P.push(Z);e:for(;0<V;){var j=V-1>>>1,L=P[j];if(0<a(L,Z))P[j]=Z,P[V]=L,V=j;else break e}}function s(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var Z=P[0],V=P.pop();if(V!==Z){P[0]=V;e:for(var j=0,L=P.length,ce=L>>>1;j<ce;){var G=2*(j+1)-1,le=P[G],fe=G+1,Pe=P[fe];if(0>a(le,V))fe<L&&0>a(Pe,le)?(P[j]=Pe,P[fe]=V,j=fe):(P[j]=le,P[G]=V,j=G);else if(fe<L&&0>a(Pe,V))P[j]=Pe,P[fe]=V,j=fe;else break e}}return Z}function a(P,Z){var V=P.sortIndex-Z.sortIndex;return V!==0?V:P.id-Z.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 g=[],m=[],v=1,k=null,x=3,S=!1,E=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function B(P){for(var Z=s(m);Z!==null;){if(Z.callback===null)o(m);else if(Z.startTime<=P)o(m),Z.sortIndex=Z.expirationTime,r(g,Z);else break;Z=s(m)}}function $(P){if(C=!1,B(P),!E)if(s(g)!==null)E=!0,q(W);else{var Z=s(m);Z!==null&&Y($,Z.startTime-P)}}function W(P,Z){E=!1,C&&(C=!1,I(X),X=-1),S=!0;var V=x;try{for(B(Z),k=s(g);k!==null&&(!(k.expirationTime>Z)||P&&!de());){var j=k.callback;if(typeof j=="function"){k.callback=null,x=k.priorityLevel;var L=j(k.expirationTime<=Z);Z=n.unstable_now(),typeof L=="function"?k.callback=L:k===s(g)&&o(g),B(Z)}else o(g);k=s(g)}if(k!==null)var ce=!0;else{var G=s(m);G!==null&&Y($,G.startTime-Z),ce=!1}return ce}finally{k=null,x=V,S=!1}}var Q=!1,K=null,X=-1,ue=5,me=-1;function de(){return!(n.unstable_now()-me<ue)}function De(){if(K!==null){var P=n.unstable_now();me=P;var Z=!0;try{Z=K(!0,P)}finally{Z?je():(Q=!1,K=null)}}else Q=!1}var je;if(typeof R=="function")je=function(){R(De)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,ne=Le.port2;Le.port1.onmessage=De,je=function(){ne.postMessage(null)}}else je=function(){T(De,0)};function q(P){K=P,Q||(Q=!0,je())}function Y(P,Z){X=T(function(){P(n.unstable_now())},Z)}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(P){P.callback=null},n.unstable_continueExecution=function(){E||S||(E=!0,q(W))},n.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<P?Math.floor(1e3/P):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return s(g)},n.unstable_next=function(P){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var V=x;x=Z;try{return P()}finally{x=V}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(P,Z){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var V=x;x=P;try{return Z()}finally{x=V}},n.unstable_scheduleCallback=function(P,Z,V){var j=n.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?j+V:j):V=j,P){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=V+L,P={id:v++,callback:Z,priorityLevel:P,startTime:V,expirationTime:L,sortIndex:-1},V>j?(P.sortIndex=V,r(m,P),s(g)===null&&P===s(m)&&(C?(I(X),X=-1):C=!0,Y($,V-j))):(P.sortIndex=L,r(g,P),E||S||(E=!0,q(W))),P},n.unstable_shouldYield=de,n.unstable_wrapCallback=function(P){var Z=x;return function(){var V=x;x=Z;try{return P.apply(this,arguments)}finally{x=V}}}})(iu)),iu}var Yp;function Yy(){return Yp||(Yp=1,su.exports=Ky()),su.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Xp;function Xy(){if(Xp)return En;Xp=1;var n=Gu(),r=Yy();function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,a={};function u(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(a[e]=t,e=0;e<t.length;e++)o.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},k={};function x(e){return g.call(k,e)?!0:g.call(v,e)?!1:m.test(e)?k[e]=!0:(v[e]=!0,!1)}function S(e,t,i,l){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,t,i,l){if(t===null||typeof t>"u"||S(e,t,i,l))return!0;if(l)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function C(e,t,i,l,d,p,y){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=y}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new C(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function R(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(I,R);T[t]=new C(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(I,R);T[t]=new C(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(I,R);T[t]=new C(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function B(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")&&(E(t,i,d,l)&&(i=null),l||d===null?x(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(t=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(t):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,t,i):e.setAttribute(t,i))))}var $=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,W=Symbol.for("react.element"),Q=Symbol.for("react.portal"),K=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),ue=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),de=Symbol.for("react.context"),De=Symbol.for("react.forward_ref"),je=Symbol.for("react.suspense"),Le=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),P=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var V=Object.assign,j;function L(e){if(j===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return`
|
|
34
|
+
`+j+e}var ce=!1;function G(e,t){if(!e||ce)return"";ce=!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
|
+
`),y=d.length-1,N=p.length-1;1<=y&&0<=N&&d[y]!==p[N];)N--;for(;1<=y&&0<=N;y--,N--)if(d[y]!==p[N]){if(y!==1||N!==1)do if(y--,N--,0>N||d[y]!==p[N]){var A=`
|
|
37
|
+
`+d[y].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),A}while(1<=y&&0<=N);break}}}finally{ce=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?L(e):""}function le(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=G(e.type,!1),e;case 11:return e=G(e.type.render,!1),e;case 1:return e=G(e.type,!0),e;default:return""}}function fe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case K:return"Fragment";case Q:return"Portal";case ue:return"Profiler";case X:return"StrictMode";case je:return"Suspense";case Le:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case De:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return t=e.displayName||null,t!==null?t:fe(e.type)||"Memo";case q:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}function Pe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(t);case 8:return t===X?"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 Te(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ce(e){var t=Ee(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(y){l=""+y,p.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(y){l=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function it(e){e._valueTracker||(e._valueTracker=Ce(e))}function Ne(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Ee(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function kt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $e(e,t){var i=t.checked;return V({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function It(e,t){var i=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;i=Te(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 Fe(e,t){t=t.checked,t!=null&&B(e,"checked",t,!1)}function Dt(e,t){Fe(e,t);var i=Te(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")?St(e,t.type,i):t.hasOwnProperty("defaultValue")&&St(e,t.type,Te(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jn(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 St(e,t,i){(t!=="number"||kt(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var Mt=Array.isArray;function ht(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=""+Te(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 en(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(s(91));return V({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function H(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(s(92));if(Mt(i)){if(1<i.length)throw Error(s(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Te(i)}}function pe(e,t){var i=Te(t.value),l=Te(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 Ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tt(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gt,Rt=(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(gt=gt||document.createElement("div"),gt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ht(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ut={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},Rn=["Webkit","ms","Moz","O"];Object.keys(ut).forEach(function(e){Rn.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ut[t]=ut[e]})});function Hn(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||ut.hasOwnProperty(e)&&ut[e]?(""+t).trim():t+"px"}function br(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=Hn(i,t[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var hr=V({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 An(e,t){if(t){if(hr[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(s(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(s(61))}if(t.style!=null&&typeof t.style!="object")throw Error(s(62))}}function In(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 fn=null;function wn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ft=null,Vt=null,rt=null;function vt(e){if(e=$i(e)){if(typeof Ft!="function")throw Error(s(280));var t=e.stateNode;t&&(t=qo(t),Ft(e.stateNode,e.type,t))}}function yt(e){Vt?rt?rt.push(e):rt=[e]:Vt=e}function qt(){if(Vt){var e=Vt,t=rt;if(rt=Vt=null,vt(e),t)for(e=0;e<t.length;e++)vt(t[e])}}function bt(e,t){return e(t)}function xt(){}var ot=!1;function Gt(e,t,i){if(ot)return e(t,i);ot=!0;try{return bt(e,t,i)}finally{ot=!1,(Vt!==null||rt!==null)&&(xt(),qt())}}function Je(e,t){var i=e.stateNode;if(i===null)return null;var l=qo(i);if(l===null)return null;i=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var _=!1;if(h)try{var ie={};Object.defineProperty(ie,"passive",{get:function(){_=!0}}),window.addEventListener("test",ie,ie),window.removeEventListener("test",ie,ie)}catch{_=!1}function se(e,t,i,l,d,p,y,N,A){var U=Array.prototype.slice.call(arguments,3);try{t.apply(i,U)}catch(te){this.onError(te)}}var ge=!1,ze=null,Be=!1,Ie=null,at={onError:function(e){ge=!0,ze=e}};function Dn(e,t,i,l,d,p,y,N,A){ge=!1,ze=null,se.apply(at,arguments)}function Mn(e,t,i,l,d,p,y,N,A){if(Dn.apply(this,arguments),ge){if(ge){var U=ze;ge=!1,ze=null}else throw Error(s(198));Be||(Be=!0,Ie=U)}}function He(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 kn(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 Or(e){if(He(e)!==e)throw Error(s(188))}function tr(e){var t=e.alternate;if(!t){if(t=He(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,l=t;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return Or(d),e;if(p===l)return Or(d),t;p=p.sibling}throw Error(s(188))}if(i.return!==l.return)i=d,l=p;else{for(var y=!1,N=d.child;N;){if(N===i){y=!0,i=d,l=p;break}if(N===l){y=!0,l=d,i=p;break}N=N.sibling}if(!y){for(N=p.child;N;){if(N===i){y=!0,i=p,l=d;break}if(N===l){y=!0,l=p,i=d;break}N=N.sibling}if(!y)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function nr(e){return e=tr(e),e!==null?Xe(e):null}function Xe(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Xe(e);if(t!==null)return t;e=e.sibling}return null}var Tt=r.unstable_scheduleCallback,rr=r.unstable_cancelCallback,Nl=r.unstable_shouldYield,Cl=r.unstable_requestPaint,Nt=r.unstable_now,mr=r.unstable_getCurrentPriorityLevel,zr=r.unstable_ImmediatePriority,gr=r.unstable_UserBlockingPriority,Ls=r.unstable_NormalPriority,cs=r.unstable_LowPriority,_o=r.unstable_IdlePriority,us=null,Ln=null;function Ps(e){if(Ln&&typeof Ln.onCommitFiberRoot=="function")try{Ln.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:ds,Os=Math.log,$r=Math.LN2;function ds(e){return e>>>=0,e===0?32:31-(Os(e)/$r|0)|0}var hn=64,zs=4194304;function fs(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 ps(e,t){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,y=i&268435455;if(y!==0){var N=y&~d;N!==0?l=fs(N):(p&=y,p!==0&&(l=fs(p)))}else y=i&~d,y!==0?l=fs(y):p!==0&&(l=fs(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-pn(t),d=1<<i,l|=e[i],t&=~d;return l}function jo(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 Ro(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var y=31-pn(p),N=1<<y,A=d[y];A===-1?((N&i)===0||(N&l)!==0)&&(d[y]=jo(N,t)):A<=t&&(e.expiredLanes|=N),p&=~N}}function Si(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bi(){var e=hn;return hn<<=1,(hn&4194240)===0&&(hn=64),e}function Ti(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function hs(e,t,i){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pn(t),e[t]=i}function Ao(e,t){var i=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<i;){var d=31-pn(i),p=1<<d;t[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function Fr(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-pn(i),d=1<<l;d&t|e[l]&t&&(e[l]|=t),i&=~d}}var Ge=0;function oe(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var b,O,J,we,be,Oe=!1,Ke=[],Qe=null,Ct=null,Et=null,Tr=new Map,Lt=new Map,Ur=[],dv="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 Cd(e,t){switch(e){case"focusin":case"focusout":Qe=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":Et=null;break;case"pointerover":case"pointerout":Tr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lt.delete(t.pointerId)}}function Ni(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=$i(t),t!==null&&O(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function fv(e,t,i,l,d){switch(t){case"focusin":return Qe=Ni(Qe,e,t,i,l,d),!0;case"dragenter":return Ct=Ni(Ct,e,t,i,l,d),!0;case"mouseover":return Et=Ni(Et,e,t,i,l,d),!0;case"pointerover":var p=d.pointerId;return Tr.set(p,Ni(Tr.get(p)||null,e,t,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Lt.set(p,Ni(Lt.get(p)||null,e,t,i,l,d)),!0}return!1}function Ed(e){var t=ms(e.target);if(t!==null){var i=He(t);if(i!==null){if(t=i.tag,t===13){if(t=kn(i),t!==null){e.blockedOn=t,be(e.priority,function(){J(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 Io(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=_l(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);fn=l,i.target.dispatchEvent(l),fn=null}else return t=$i(i),t!==null&&O(t),e.blockedOn=i,!1;t.shift()}return!0}function _d(e,t,i){Io(e)&&i.delete(t)}function pv(){Oe=!1,Qe!==null&&Io(Qe)&&(Qe=null),Ct!==null&&Io(Ct)&&(Ct=null),Et!==null&&Io(Et)&&(Et=null),Tr.forEach(_d),Lt.forEach(_d)}function Ci(e,t){e.blockedOn===t&&(e.blockedOn=null,Oe||(Oe=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,pv)))}function Ei(e){function t(d){return Ci(d,e)}if(0<Ke.length){Ci(Ke[0],e);for(var i=1;i<Ke.length;i++){var l=Ke[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Qe!==null&&Ci(Qe,e),Ct!==null&&Ci(Ct,e),Et!==null&&Ci(Et,e),Tr.forEach(t),Lt.forEach(t),i=0;i<Ur.length;i++)l=Ur[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<Ur.length&&(i=Ur[0],i.blockedOn===null);)Ed(i),i.blockedOn===null&&Ur.shift()}var $s=$.ReactCurrentBatchConfig,Do=!0;function hv(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=1,El(e,t,i,l)}finally{Ge=d,$s.transition=p}}function mv(e,t,i,l){var d=Ge,p=$s.transition;$s.transition=null;try{Ge=4,El(e,t,i,l)}finally{Ge=d,$s.transition=p}}function El(e,t,i,l){if(Do){var d=_l(e,t,i,l);if(d===null)Vl(e,t,l,Mo,i),Cd(e,l);else if(fv(d,e,t,i,l))l.stopPropagation();else if(Cd(e,l),t&4&&-1<dv.indexOf(e)){for(;d!==null;){var p=$i(d);if(p!==null&&b(p),p=_l(e,t,i,l),p===null&&Vl(e,t,l,Mo,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else Vl(e,t,l,null,i)}}var Mo=null;function _l(e,t,i,l){if(Mo=null,e=wn(l),e=ms(e),e!==null)if(t=He(e),t===null)e=null;else if(i=t.tag,i===13){if(e=kn(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 Mo=e,null}function jd(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(mr()){case zr:return 1;case gr:return 4;case Ls:case cs:return 16;case _o:return 536870912;default:return 16}default:return 16}}var Br=null,jl=null,Lo=null;function Rd(){if(Lo)return Lo;var e,t=jl,i=t.length,l,d="value"in Br?Br.value:Br.textContent,p=d.length;for(e=0;e<i&&t[e]===d[e];e++);var y=i-e;for(l=1;l<=y&&t[i-l]===d[p-l];l++);return Lo=d.slice(e,1<l?1-l:void 0)}function Po(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 Oo(){return!0}function Ad(){return!1}function Pn(e){function t(i,l,d,p,y){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=y,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Oo:Ad,this.isPropagationStopped=Ad,this}return V(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=Oo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Oo)},persist:function(){},isPersistent:Oo}),t}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rl=Pn(Fs),_i=V({},Fs,{view:0,detail:0}),gv=Pn(_i),Al,Il,ji,zo=V({},_i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ml,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!==ji&&(ji&&e.type==="mousemove"?(Al=e.screenX-ji.screenX,Il=e.screenY-ji.screenY):Il=Al=0,ji=e),Al)},movementY:function(e){return"movementY"in e?e.movementY:Il}}),Id=Pn(zo),vv=V({},zo,{dataTransfer:0}),yv=Pn(vv),xv=V({},_i,{relatedTarget:0}),Dl=Pn(xv),wv=V({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),kv=Pn(wv),Sv=V({},Fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bv=Pn(Sv),Tv=V({},Fs,{data:0}),Dd=Pn(Tv),Nv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cv={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"},Ev={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _v(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ev[e])?!!t[e]:!1}function Ml(){return _v}var jv=V({},_i,{key:function(e){if(e.key){var t=Nv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Po(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ml,charCode:function(e){return e.type==="keypress"?Po(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Po(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rv=Pn(jv),Av=V({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Md=Pn(Av),Iv=V({},_i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ml}),Dv=Pn(Iv),Mv=V({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lv=Pn(Mv),Pv=V({},zo,{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}),Ov=Pn(Pv),zv=[9,13,27,32],Ll=h&&"CompositionEvent"in window,Ri=null;h&&"documentMode"in document&&(Ri=document.documentMode);var $v=h&&"TextEvent"in window&&!Ri,Ld=h&&(!Ll||Ri&&8<Ri&&11>=Ri),Pd=" ",Od=!1;function zd(e,t){switch(e){case"keyup":return zv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $d(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Us=!1;function Fv(e,t){switch(e){case"compositionend":return $d(t);case"keypress":return t.which!==32?null:(Od=!0,Pd);case"textInput":return e=t.data,e===Pd&&Od?null:e;default:return null}}function Uv(e,t){if(Us)return e==="compositionend"||!Ll&&zd(e,t)?(e=Rd(),Lo=jl=Br=null,Us=!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 Ld&&t.locale!=="ko"?null:t.data;default:return null}}var Bv={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 Fd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Bv[e.type]:t==="textarea"}function Ud(e,t,i,l){yt(l),t=Wo(t,"onChange"),0<t.length&&(i=new Rl("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var Ai=null,Ii=null;function Wv(e){of(e,0)}function $o(e){var t=qs(e);if(Ne(t))return e}function Hv(e,t){if(e==="change")return t}var Bd=!1;if(h){var Pl;if(h){var Ol="oninput"in document;if(!Ol){var Wd=document.createElement("div");Wd.setAttribute("oninput","return;"),Ol=typeof Wd.oninput=="function"}Pl=Ol}else Pl=!1;Bd=Pl&&(!document.documentMode||9<document.documentMode)}function Hd(){Ai&&(Ai.detachEvent("onpropertychange",Vd),Ii=Ai=null)}function Vd(e){if(e.propertyName==="value"&&$o(Ii)){var t=[];Ud(t,Ii,e,wn(e)),Gt(Wv,t)}}function Vv(e,t,i){e==="focusin"?(Hd(),Ai=t,Ii=i,Ai.attachEvent("onpropertychange",Vd)):e==="focusout"&&Hd()}function qv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $o(Ii)}function Gv(e,t){if(e==="click")return $o(t)}function Kv(e,t){if(e==="input"||e==="change")return $o(t)}function Yv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var sr=typeof Object.is=="function"?Object.is:Yv;function Di(e,t){if(sr(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(!g.call(t,d)||!sr(e[d],t[d]))return!1}return!0}function qd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gd(e,t){var i=qd(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=qd(i)}}function Kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yd(){for(var e=window,t=kt();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=kt(e.document)}return t}function zl(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 Xv(e){var t=Yd(),i=e.focusedElem,l=e.selectionRange;if(t!==i&&i&&i.ownerDocument&&Kd(i.ownerDocument.documentElement,i)){if(l!==null&&zl(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=Gd(i,p);var y=Gd(i,l);d&&y&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==y.node||e.focusOffset!==y.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>l?(e.addRange(t),e.extend(y.node,y.offset)):(t.setEnd(y.node,y.offset),e.addRange(t)))}}for(t=[],e=i;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)e=t[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Qv=h&&"documentMode"in document&&11>=document.documentMode,Bs=null,$l=null,Mi=null,Fl=!1;function Xd(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Fl||Bs==null||Bs!==kt(l)||(l=Bs,"selectionStart"in l&&zl(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}),Mi&&Di(Mi,l)||(Mi=l,l=Wo($l,"onSelect"),0<l.length&&(t=new Rl("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Bs)))}function Fo(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ws={animationend:Fo("Animation","AnimationEnd"),animationiteration:Fo("Animation","AnimationIteration"),animationstart:Fo("Animation","AnimationStart"),transitionend:Fo("Transition","TransitionEnd")},Ul={},Qd={};h&&(Qd=document.createElement("div").style,"AnimationEvent"in window||(delete Ws.animationend.animation,delete Ws.animationiteration.animation,delete Ws.animationstart.animation),"TransitionEvent"in window||delete Ws.transitionend.transition);function Uo(e){if(Ul[e])return Ul[e];if(!Ws[e])return e;var t=Ws[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Qd)return Ul[e]=t[i];return e}var Zd=Uo("animationend"),Jd=Uo("animationiteration"),ef=Uo("animationstart"),tf=Uo("transitionend"),nf=new Map,rf="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 Wr(e,t){nf.set(e,t),u(t,[e])}for(var Bl=0;Bl<rf.length;Bl++){var Wl=rf[Bl],Zv=Wl.toLowerCase(),Jv=Wl[0].toUpperCase()+Wl.slice(1);Wr(Zv,"on"+Jv)}Wr(Zd,"onAnimationEnd"),Wr(Jd,"onAnimationIteration"),Wr(ef,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(tf,"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 Li="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(" "),ey=new Set("cancel close invalid load scroll toggle".split(" ").concat(Li));function sf(e,t,i){var l=e.type||"unknown-event";e.currentTarget=i,Mn(l,t,void 0,e),e.currentTarget=null}function of(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 y=l.length-1;0<=y;y--){var N=l[y],A=N.instance,U=N.currentTarget;if(N=N.listener,A!==p&&d.isPropagationStopped())break e;sf(d,N,U),p=A}else for(y=0;y<l.length;y++){if(N=l[y],A=N.instance,U=N.currentTarget,N=N.listener,A!==p&&d.isPropagationStopped())break e;sf(d,N,U),p=A}}}if(Be)throw e=Ie,Be=!1,Ie=null,e}function dt(e,t){var i=t[Ql];i===void 0&&(i=t[Ql]=new Set);var l=e+"__bubble";i.has(l)||(af(t,e,2,!1),i.add(l))}function Hl(e,t,i){var l=0;t&&(l|=4),af(i,e,l,t)}var Bo="_reactListening"+Math.random().toString(36).slice(2);function Pi(e){if(!e[Bo]){e[Bo]=!0,o.forEach(function(i){i!=="selectionchange"&&(ey.has(i)||Hl(i,!1,e),Hl(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bo]||(t[Bo]=!0,Hl("selectionchange",!1,t))}}function af(e,t,i,l){switch(jd(t)){case 1:var d=hv;break;case 4:d=mv;break;default:d=El}i=d.bind(null,t,i,e),d=void 0,!_||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 Vl(e,t,i,l,d){var p=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var y=l.tag;if(y===3||y===4){var N=l.stateNode.containerInfo;if(N===d||N.nodeType===8&&N.parentNode===d)break;if(y===4)for(y=l.return;y!==null;){var A=y.tag;if((A===3||A===4)&&(A=y.stateNode.containerInfo,A===d||A.nodeType===8&&A.parentNode===d))return;y=y.return}for(;N!==null;){if(y=ms(N),y===null)return;if(A=y.tag,A===5||A===6){l=p=y;continue e}N=N.parentNode}}l=l.return}Gt(function(){var U=p,te=wn(i),re=[];e:{var ee=nf.get(e);if(ee!==void 0){var he=Rl,xe=e;switch(e){case"keypress":if(Po(i)===0)break e;case"keydown":case"keyup":he=Rv;break;case"focusin":xe="focus",he=Dl;break;case"focusout":xe="blur",he=Dl;break;case"beforeblur":case"afterblur":he=Dl;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":he=Id;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=yv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=Dv;break;case Zd:case Jd:case ef:he=kv;break;case tf:he=Lv;break;case"scroll":he=gv;break;case"wheel":he=Ov;break;case"copy":case"cut":case"paste":he=bv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Md}var ke=(t&4)!==0,Pt=!ke&&e==="scroll",z=ke?ee!==null?ee+"Capture":null:ee;ke=[];for(var D=U,F;D!==null;){F=D;var ae=F.stateNode;if(F.tag===5&&ae!==null&&(F=ae,z!==null&&(ae=Je(D,z),ae!=null&&ke.push(Oi(D,ae,F)))),Pt)break;D=D.return}0<ke.length&&(ee=new he(ee,xe,null,i,te),re.push({event:ee,listeners:ke}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",ee&&i!==fn&&(xe=i.relatedTarget||i.fromElement)&&(ms(xe)||xe[Nr]))break e;if((he||ee)&&(ee=te.window===te?te:(ee=te.ownerDocument)?ee.defaultView||ee.parentWindow:window,he?(xe=i.relatedTarget||i.toElement,he=U,xe=xe?ms(xe):null,xe!==null&&(Pt=He(xe),xe!==Pt||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(he=null,xe=U),he!==xe)){if(ke=Id,ae="onMouseLeave",z="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(ke=Md,ae="onPointerLeave",z="onPointerEnter",D="pointer"),Pt=he==null?ee:qs(he),F=xe==null?ee:qs(xe),ee=new ke(ae,D+"leave",he,i,te),ee.target=Pt,ee.relatedTarget=F,ae=null,ms(te)===U&&(ke=new ke(z,D+"enter",xe,i,te),ke.target=F,ke.relatedTarget=Pt,ae=ke),Pt=ae,he&&xe)t:{for(ke=he,z=xe,D=0,F=ke;F;F=Hs(F))D++;for(F=0,ae=z;ae;ae=Hs(ae))F++;for(;0<D-F;)ke=Hs(ke),D--;for(;0<F-D;)z=Hs(z),F--;for(;D--;){if(ke===z||z!==null&&ke===z.alternate)break t;ke=Hs(ke),z=Hs(z)}ke=null}else ke=null;he!==null&&lf(re,ee,he,ke,!1),xe!==null&&Pt!==null&&lf(re,Pt,xe,ke,!0)}}e:{if(ee=U?qs(U):window,he=ee.nodeName&&ee.nodeName.toLowerCase(),he==="select"||he==="input"&&ee.type==="file")var Se=Hv;else if(Fd(ee))if(Bd)Se=Kv;else{Se=qv;var Re=Vv}else(he=ee.nodeName)&&he.toLowerCase()==="input"&&(ee.type==="checkbox"||ee.type==="radio")&&(Se=Gv);if(Se&&(Se=Se(e,U))){Ud(re,Se,i,te);break e}Re&&Re(e,ee,U),e==="focusout"&&(Re=ee._wrapperState)&&Re.controlled&&ee.type==="number"&&St(ee,"number",ee.value)}switch(Re=U?qs(U):window,e){case"focusin":(Fd(Re)||Re.contentEditable==="true")&&(Bs=Re,$l=U,Mi=null);break;case"focusout":Mi=$l=Bs=null;break;case"mousedown":Fl=!0;break;case"contextmenu":case"mouseup":case"dragend":Fl=!1,Xd(re,i,te);break;case"selectionchange":if(Qv)break;case"keydown":case"keyup":Xd(re,i,te)}var Ae;if(Ll)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Us?zd(e,i)&&(Me="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Me="onCompositionStart");Me&&(Ld&&i.locale!=="ko"&&(Us||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Us&&(Ae=Rd()):(Br=te,jl="value"in Br?Br.value:Br.textContent,Us=!0)),Re=Wo(U,Me),0<Re.length&&(Me=new Dd(Me,e,null,i,te),re.push({event:Me,listeners:Re}),Ae?Me.data=Ae:(Ae=$d(i),Ae!==null&&(Me.data=Ae)))),(Ae=$v?Fv(e,i):Uv(e,i))&&(U=Wo(U,"onBeforeInput"),0<U.length&&(te=new Dd("onBeforeInput","beforeinput",null,i,te),re.push({event:te,listeners:U}),te.data=Ae))}of(re,t)})}function Oi(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Wo(e,t){for(var i=t+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=Je(e,i),p!=null&&l.unshift(Oi(e,p,d)),p=Je(e,t),p!=null&&l.push(Oi(e,p,d))),e=e.return}return l}function Hs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function lf(e,t,i,l,d){for(var p=t._reactName,y=[];i!==null&&i!==l;){var N=i,A=N.alternate,U=N.stateNode;if(A!==null&&A===l)break;N.tag===5&&U!==null&&(N=U,d?(A=Je(i,p),A!=null&&y.unshift(Oi(i,A,N))):d||(A=Je(i,p),A!=null&&y.push(Oi(i,A,N)))),i=i.return}y.length!==0&&e.push({event:t,listeners:y})}var ty=/\r\n?/g,ny=/\u0000|\uFFFD/g;function cf(e){return(typeof e=="string"?e:""+e).replace(ty,`
|
|
38
|
+
`).replace(ny,"")}function Ho(e,t,i){if(t=cf(t),cf(e)!==t&&i)throw Error(s(425))}function Vo(){}var ql=null,Gl=null;function Kl(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 Yl=typeof setTimeout=="function"?setTimeout:void 0,ry=typeof clearTimeout=="function"?clearTimeout:void 0,uf=typeof Promise=="function"?Promise:void 0,sy=typeof queueMicrotask=="function"?queueMicrotask:typeof uf<"u"?function(e){return uf.resolve(null).then(e).catch(iy)}:Yl;function iy(e){setTimeout(function(){throw e})}function Xl(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),Ei(t);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ei(t)}function Hr(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 df(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 Vs=Math.random().toString(36).slice(2),vr="__reactFiber$"+Vs,zi="__reactProps$"+Vs,Nr="__reactContainer$"+Vs,Ql="__reactEvents$"+Vs,oy="__reactListeners$"+Vs,ay="__reactHandles$"+Vs;function ms(e){var t=e[vr];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Nr]||i[vr]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=df(e);e!==null;){if(i=e[vr])return i;e=df(e)}return t}e=i,i=e.parentNode}return null}function $i(e){return e=e[vr]||e[Nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function qo(e){return e[zi]||null}var Zl=[],Gs=-1;function Vr(e){return{current:e}}function ft(e){0>Gs||(e.current=Zl[Gs],Zl[Gs]=null,Gs--)}function ct(e,t){Gs++,Zl[Gs]=e.current,e.current=t}var qr={},on=Vr(qr),Sn=Vr(!1),gs=qr;function Ks(e,t){var i=e.type.contextTypes;if(!i)return qr;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 bn(e){return e=e.childContextTypes,e!=null}function Go(){ft(Sn),ft(on)}function ff(e,t,i){if(on.current!==qr)throw Error(s(168));ct(on,t),ct(Sn,i)}function pf(e,t,i){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in t))throw Error(s(108,Pe(e)||"Unknown",d));return V({},i,l)}function Ko(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qr,gs=on.current,ct(on,e),ct(Sn,Sn.current),!0}function hf(e,t,i){var l=e.stateNode;if(!l)throw Error(s(169));i?(e=pf(e,t,gs),l.__reactInternalMemoizedMergedChildContext=e,ft(Sn),ft(on),ct(on,e)):ft(Sn),ct(Sn,i)}var Cr=null,Yo=!1,Jl=!1;function mf(e){Cr===null?Cr=[e]:Cr.push(e)}function ly(e){Yo=!0,mf(e)}function Gr(){if(!Jl&&Cr!==null){Jl=!0;var e=0,t=Ge;try{var i=Cr;for(Ge=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}Cr=null,Yo=!1}catch(d){throw Cr!==null&&(Cr=Cr.slice(e+1)),Tt(zr,Gr),d}finally{Ge=t,Jl=!1}}return null}var Ys=[],Xs=0,Xo=null,Qo=0,Vn=[],qn=0,vs=null,Er=1,_r="";function ys(e,t){Ys[Xs++]=Qo,Ys[Xs++]=Xo,Xo=e,Qo=t}function gf(e,t,i){Vn[qn++]=Er,Vn[qn++]=_r,Vn[qn++]=vs,vs=e;var l=Er;e=_r;var d=32-pn(l)-1;l&=~(1<<d),i+=1;var p=32-pn(t)+d;if(30<p){var y=d-d%5;p=(l&(1<<y)-1).toString(32),l>>=y,d-=y,Er=1<<32-pn(t)+d|i<<d|l,_r=p+e}else Er=1<<p|i<<d|l,_r=e}function ec(e){e.return!==null&&(ys(e,1),gf(e,1,0))}function tc(e){for(;e===Xo;)Xo=Ys[--Xs],Ys[Xs]=null,Qo=Ys[--Xs],Ys[Xs]=null;for(;e===vs;)vs=Vn[--qn],Vn[qn]=null,_r=Vn[--qn],Vn[qn]=null,Er=Vn[--qn],Vn[qn]=null}var On=null,zn=null,wt=!1,ir=null;function vf(e,t){var i=Xn(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 yf(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,On=e,zn=Hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,On=e,zn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=vs!==null?{id:Er,overflow:_r}:null,e.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=Xn(18,null,null,0),i.stateNode=t,i.return=e,e.child=i,On=e,zn=null,!0):!1;default:return!1}}function nc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function rc(e){if(wt){var t=zn;if(t){var i=t;if(!yf(e,t)){if(nc(e))throw Error(s(418));t=Hr(i.nextSibling);var l=On;t&&yf(e,t)?vf(l,i):(e.flags=e.flags&-4097|2,wt=!1,On=e)}}else{if(nc(e))throw Error(s(418));e.flags=e.flags&-4097|2,wt=!1,On=e}}}function xf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;On=e}function Zo(e){if(e!==On)return!1;if(!wt)return xf(e),wt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kl(e.type,e.memoizedProps)),t&&(t=zn)){if(nc(e))throw wf(),Error(s(418));for(;t;)vf(e,t),t=Hr(t.nextSibling)}if(xf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(t===0){zn=Hr(e.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}e=e.nextSibling}zn=null}}else zn=On?Hr(e.stateNode.nextSibling):null;return!0}function wf(){for(var e=zn;e;)e=Hr(e.nextSibling)}function Qs(){zn=On=null,wt=!1}function sc(e){ir===null?ir=[e]:ir.push(e)}var cy=$.ReactCurrentBatchConfig;function Fi(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var l=i.stateNode}if(!l)throw Error(s(147,e));var d=l,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(y){var N=d.refs;y===null?delete N[p]:N[p]=y},t._stringRef=p,t)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Jo(e,t){throw e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kf(e){var t=e._init;return t(e._payload)}function Sf(e){function t(z,D){if(e){var F=z.deletions;F===null?(z.deletions=[D],z.flags|=16):F.push(D)}}function i(z,D){if(!e)return null;for(;D!==null;)t(z,D),D=D.sibling;return null}function l(z,D){for(z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function d(z,D){return z=ts(z,D),z.index=0,z.sibling=null,z}function p(z,D,F){return z.index=F,e?(F=z.alternate,F!==null?(F=F.index,F<D?(z.flags|=2,D):F):(z.flags|=2,D)):(z.flags|=1048576,D)}function y(z){return e&&z.alternate===null&&(z.flags|=2),z}function N(z,D,F,ae){return D===null||D.tag!==6?(D=Yc(F,z.mode,ae),D.return=z,D):(D=d(D,F),D.return=z,D)}function A(z,D,F,ae){var Se=F.type;return Se===K?te(z,D,F.props.children,ae,F.key):D!==null&&(D.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===q&&kf(Se)===D.type)?(ae=d(D,F.props),ae.ref=Fi(z,D,F),ae.return=z,ae):(ae=ba(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Fi(z,D,F),ae.return=z,ae)}function U(z,D,F,ae){return D===null||D.tag!==4||D.stateNode.containerInfo!==F.containerInfo||D.stateNode.implementation!==F.implementation?(D=Xc(F,z.mode,ae),D.return=z,D):(D=d(D,F.children||[]),D.return=z,D)}function te(z,D,F,ae,Se){return D===null||D.tag!==7?(D=Cs(F,z.mode,ae,Se),D.return=z,D):(D=d(D,F),D.return=z,D)}function re(z,D,F){if(typeof D=="string"&&D!==""||typeof D=="number")return D=Yc(""+D,z.mode,F),D.return=z,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case W:return F=ba(D.type,D.key,D.props,null,z.mode,F),F.ref=Fi(z,null,D),F.return=z,F;case Q:return D=Xc(D,z.mode,F),D.return=z,D;case q:var ae=D._init;return re(z,ae(D._payload),F)}if(Mt(D)||Z(D))return D=Cs(D,z.mode,F,null),D.return=z,D;Jo(z,D)}return null}function ee(z,D,F,ae){var Se=D!==null?D.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return Se!==null?null:N(z,D,""+F,ae);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case W:return F.key===Se?A(z,D,F,ae):null;case Q:return F.key===Se?U(z,D,F,ae):null;case q:return Se=F._init,ee(z,D,Se(F._payload),ae)}if(Mt(F)||Z(F))return Se!==null?null:te(z,D,F,ae,null);Jo(z,F)}return null}function he(z,D,F,ae,Se){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return z=z.get(F)||null,N(D,z,""+ae,Se);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case W:return z=z.get(ae.key===null?F:ae.key)||null,A(D,z,ae,Se);case Q:return z=z.get(ae.key===null?F:ae.key)||null,U(D,z,ae,Se);case q:var Re=ae._init;return he(z,D,F,Re(ae._payload),Se)}if(Mt(ae)||Z(ae))return z=z.get(F)||null,te(D,z,ae,Se,null);Jo(D,ae)}return null}function xe(z,D,F,ae){for(var Se=null,Re=null,Ae=D,Me=D=0,Xt=null;Ae!==null&&Me<F.length;Me++){Ae.index>Me?(Xt=Ae,Ae=null):Xt=Ae.sibling;var Ze=ee(z,Ae,F[Me],ae);if(Ze===null){Ae===null&&(Ae=Xt);break}e&&Ae&&Ze.alternate===null&&t(z,Ae),D=p(Ze,D,Me),Re===null?Se=Ze:Re.sibling=Ze,Re=Ze,Ae=Xt}if(Me===F.length)return i(z,Ae),wt&&ys(z,Me),Se;if(Ae===null){for(;Me<F.length;Me++)Ae=re(z,F[Me],ae),Ae!==null&&(D=p(Ae,D,Me),Re===null?Se=Ae:Re.sibling=Ae,Re=Ae);return wt&&ys(z,Me),Se}for(Ae=l(z,Ae);Me<F.length;Me++)Xt=he(Ae,z,Me,F[Me],ae),Xt!==null&&(e&&Xt.alternate!==null&&Ae.delete(Xt.key===null?Me:Xt.key),D=p(Xt,D,Me),Re===null?Se=Xt:Re.sibling=Xt,Re=Xt);return e&&Ae.forEach(function(ns){return t(z,ns)}),wt&&ys(z,Me),Se}function ke(z,D,F,ae){var Se=Z(F);if(typeof Se!="function")throw Error(s(150));if(F=Se.call(F),F==null)throw Error(s(151));for(var Re=Se=null,Ae=D,Me=D=0,Xt=null,Ze=F.next();Ae!==null&&!Ze.done;Me++,Ze=F.next()){Ae.index>Me?(Xt=Ae,Ae=null):Xt=Ae.sibling;var ns=ee(z,Ae,Ze.value,ae);if(ns===null){Ae===null&&(Ae=Xt);break}e&&Ae&&ns.alternate===null&&t(z,Ae),D=p(ns,D,Me),Re===null?Se=ns:Re.sibling=ns,Re=ns,Ae=Xt}if(Ze.done)return i(z,Ae),wt&&ys(z,Me),Se;if(Ae===null){for(;!Ze.done;Me++,Ze=F.next())Ze=re(z,Ze.value,ae),Ze!==null&&(D=p(Ze,D,Me),Re===null?Se=Ze:Re.sibling=Ze,Re=Ze);return wt&&ys(z,Me),Se}for(Ae=l(z,Ae);!Ze.done;Me++,Ze=F.next())Ze=he(Ae,z,Me,Ze.value,ae),Ze!==null&&(e&&Ze.alternate!==null&&Ae.delete(Ze.key===null?Me:Ze.key),D=p(Ze,D,Me),Re===null?Se=Ze:Re.sibling=Ze,Re=Ze);return e&&Ae.forEach(function(By){return t(z,By)}),wt&&ys(z,Me),Se}function Pt(z,D,F,ae){if(typeof F=="object"&&F!==null&&F.type===K&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case W:e:{for(var Se=F.key,Re=D;Re!==null;){if(Re.key===Se){if(Se=F.type,Se===K){if(Re.tag===7){i(z,Re.sibling),D=d(Re,F.props.children),D.return=z,z=D;break e}}else if(Re.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===q&&kf(Se)===Re.type){i(z,Re.sibling),D=d(Re,F.props),D.ref=Fi(z,Re,F),D.return=z,z=D;break e}i(z,Re);break}else t(z,Re);Re=Re.sibling}F.type===K?(D=Cs(F.props.children,z.mode,ae,F.key),D.return=z,z=D):(ae=ba(F.type,F.key,F.props,null,z.mode,ae),ae.ref=Fi(z,D,F),ae.return=z,z=ae)}return y(z);case Q:e:{for(Re=F.key;D!==null;){if(D.key===Re)if(D.tag===4&&D.stateNode.containerInfo===F.containerInfo&&D.stateNode.implementation===F.implementation){i(z,D.sibling),D=d(D,F.children||[]),D.return=z,z=D;break e}else{i(z,D);break}else t(z,D);D=D.sibling}D=Xc(F,z.mode,ae),D.return=z,z=D}return y(z);case q:return Re=F._init,Pt(z,D,Re(F._payload),ae)}if(Mt(F))return xe(z,D,F,ae);if(Z(F))return ke(z,D,F,ae);Jo(z,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,D!==null&&D.tag===6?(i(z,D.sibling),D=d(D,F),D.return=z,z=D):(i(z,D),D=Yc(F,z.mode,ae),D.return=z,z=D),y(z)):i(z,D)}return Pt}var Zs=Sf(!0),bf=Sf(!1),ea=Vr(null),ta=null,Js=null,ic=null;function oc(){ic=Js=ta=null}function ac(e){var t=ea.current;ft(ea),e._currentValue=t}function lc(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 ei(e,t){ta=e,ic=Js=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Tn=!0),e.firstContext=null)}function Gn(e){var t=e._currentValue;if(ic!==e)if(e={context:e,memoizedValue:t,next:null},Js===null){if(ta===null)throw Error(s(308));Js=e,ta.dependencies={lanes:0,firstContext:e}}else Js=Js.next=e;return t}var xs=null;function cc(e){xs===null?xs=[e]:xs.push(e)}function Tf(e,t,i,l){var d=t.interleaved;return d===null?(i.next=i,cc(t)):(i.next=d.next,d.next=i),t.interleaved=i,jr(e,l)}function jr(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 Kr=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nf(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 Rr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ye&2)!==0){var d=l.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),l.pending=t,jr(e,i)}return d=l.interleaved,d===null?(t.next=t,cc(l)):(t.next=d.next,d.next=t),l.interleaved=t,jr(e,i)}function na(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,Fr(e,i)}}function Cf(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 y={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=y:p=p.next=y,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 ra(e,t,i,l){var d=e.updateQueue;Kr=!1;var p=d.firstBaseUpdate,y=d.lastBaseUpdate,N=d.shared.pending;if(N!==null){d.shared.pending=null;var A=N,U=A.next;A.next=null,y===null?p=U:y.next=U,y=A;var te=e.alternate;te!==null&&(te=te.updateQueue,N=te.lastBaseUpdate,N!==y&&(N===null?te.firstBaseUpdate=U:N.next=U,te.lastBaseUpdate=A))}if(p!==null){var re=d.baseState;y=0,te=U=A=null,N=p;do{var ee=N.lane,he=N.eventTime;if((l&ee)===ee){te!==null&&(te=te.next={eventTime:he,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var xe=e,ke=N;switch(ee=t,he=i,ke.tag){case 1:if(xe=ke.payload,typeof xe=="function"){re=xe.call(he,re,ee);break e}re=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=ke.payload,ee=typeof xe=="function"?xe.call(he,re,ee):xe,ee==null)break e;re=V({},re,ee);break e;case 2:Kr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,ee=d.effects,ee===null?d.effects=[N]:ee.push(N))}else he={eventTime:he,lane:ee,tag:N.tag,payload:N.payload,callback:N.callback,next:null},te===null?(U=te=he,A=re):te=te.next=he,y|=ee;if(N=N.next,N===null){if(N=d.shared.pending,N===null)break;ee=N,N=ee.next,ee.next=null,d.lastBaseUpdate=ee,d.shared.pending=null}}while(!0);if(te===null&&(A=re),d.baseState=A,d.firstBaseUpdate=U,d.lastBaseUpdate=te,t=d.shared.interleaved,t!==null){d=t;do y|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);Ss|=y,e.lanes=y,e.memoizedState=re}}function Ef(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(s(191,d));d.call(l)}}}var Ui={},yr=Vr(Ui),Bi=Vr(Ui),Wi=Vr(Ui);function ws(e){if(e===Ui)throw Error(s(174));return e}function dc(e,t){switch(ct(Wi,t),ct(Bi,e),ct(yr,Ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mt(t,e)}ft(yr),ct(yr,t)}function ti(){ft(yr),ft(Bi),ft(Wi)}function _f(e){ws(Wi.current);var t=ws(yr.current),i=mt(t,e.type);t!==i&&(ct(Bi,e),ct(yr,i))}function fc(e){Bi.current===e&&(ft(yr),ft(Bi))}var _t=Vr(0);function sa(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 pc=[];function hc(){for(var e=0;e<pc.length;e++)pc[e]._workInProgressVersionPrimary=null;pc.length=0}var ia=$.ReactCurrentDispatcher,mc=$.ReactCurrentBatchConfig,ks=0,jt=null,Ut=null,Kt=null,oa=!1,Hi=!1,Vi=0,uy=0;function an(){throw Error(s(321))}function gc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!sr(e[i],t[i]))return!1;return!0}function vc(e,t,i,l,d,p){if(ks=p,jt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ia.current=e===null||e.memoizedState===null?hy:my,e=i(l,d),Hi){p=0;do{if(Hi=!1,Vi=0,25<=p)throw Error(s(301));p+=1,Kt=Ut=null,t.updateQueue=null,ia.current=gy,e=i(l,d)}while(Hi)}if(ia.current=ca,t=Ut!==null&&Ut.next!==null,ks=0,Kt=Ut=jt=null,oa=!1,t)throw Error(s(300));return e}function yc(){var e=Vi!==0;return Vi=0,e}function xr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Kn(){if(Ut===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Ut.next;var t=Kt===null?jt.memoizedState:Kt.next;if(t!==null)Kt=t,Ut=e;else{if(e===null)throw Error(s(310));Ut=e,e={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Kt===null?jt.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function qi(e,t){return typeof t=="function"?t(e):t}function xc(e){var t=Kn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=Ut,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var y=d.next;d.next=p.next,p.next=y}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var N=y=null,A=null,U=p;do{var te=U.lane;if((ks&te)===te)A!==null&&(A=A.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 re={lane:te,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};A===null?(N=A=re,y=l):A=A.next=re,jt.lanes|=te,Ss|=te}U=U.next}while(U!==null&&U!==p);A===null?y=l:A.next=N,sr(l,t.memoizedState)||(Tn=!0),t.memoizedState=l,t.baseState=y,t.baseQueue=A,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,jt.lanes|=p,Ss|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function wc(e){var t=Kn(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=t.memoizedState;if(d!==null){i.pending=null;var y=d=d.next;do p=e(p,y.action),y=y.next;while(y!==d);sr(p,t.memoizedState)||(Tn=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,l]}function jf(){}function Rf(e,t){var i=jt,l=Kn(),d=t(),p=!sr(l.memoizedState,d);if(p&&(l.memoizedState=d,Tn=!0),l=l.queue,kc(Df.bind(null,i,l,e),[e]),l.getSnapshot!==t||p||Kt!==null&&Kt.memoizedState.tag&1){if(i.flags|=2048,Gi(9,If.bind(null,i,l,d,t),void 0,null),Yt===null)throw Error(s(349));(ks&30)!==0||Af(i,t,d)}return d}function Af(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function If(e,t,i,l){t.value=i,t.getSnapshot=l,Mf(t)&&Lf(e)}function Df(e,t,i){return i(function(){Mf(t)&&Lf(e)})}function Mf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!sr(e,i)}catch{return!0}}function Lf(e){var t=jr(e,1);t!==null&&cr(t,e,1,-1)}function Pf(e){var t=xr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qi,lastRenderedState:e},t.queue=e,e=e.dispatch=py.bind(null,jt,e),[t.memoizedState,e]}function Gi(e,t,i,l){return e={tag:e,create:t,destroy:i,deps:l,next:null},t=jt.updateQueue,t===null?(t={lastEffect:null,stores:null},jt.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 Of(){return Kn().memoizedState}function aa(e,t,i,l){var d=xr();jt.flags|=e,d.memoizedState=Gi(1|t,i,void 0,l===void 0?null:l)}function la(e,t,i,l){var d=Kn();l=l===void 0?null:l;var p=void 0;if(Ut!==null){var y=Ut.memoizedState;if(p=y.destroy,l!==null&&gc(l,y.deps)){d.memoizedState=Gi(t,i,p,l);return}}jt.flags|=e,d.memoizedState=Gi(1|t,i,p,l)}function zf(e,t){return aa(8390656,8,e,t)}function kc(e,t){return la(2048,8,e,t)}function $f(e,t){return la(4,2,e,t)}function Ff(e,t){return la(4,4,e,t)}function Uf(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 Bf(e,t,i){return i=i!=null?i.concat([e]):null,la(4,4,Uf.bind(null,t,e),i)}function Sc(){}function Wf(e,t){var i=Kn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&gc(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Hf(e,t){var i=Kn();t=t===void 0?null:t;var l=i.memoizedState;return l!==null&&t!==null&&gc(t,l[1])?l[0]:(e=e(),i.memoizedState=[e,t],e)}function Vf(e,t,i){return(ks&21)===0?(e.baseState&&(e.baseState=!1,Tn=!0),e.memoizedState=i):(sr(i,t)||(i=bi(),jt.lanes|=i,Ss|=i,e.baseState=!0),t)}function dy(e,t){var i=Ge;Ge=i!==0&&4>i?i:4,e(!0);var l=mc.transition;mc.transition={};try{e(!1),t()}finally{Ge=i,mc.transition=l}}function qf(){return Kn().memoizedState}function fy(e,t,i){var l=Jr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},Gf(e))Kf(t,i);else if(i=Tf(e,t,i,l),i!==null){var d=gn();cr(i,e,l,d),Yf(i,t,l)}}function py(e,t,i){var l=Jr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(Gf(e))Kf(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var y=t.lastRenderedState,N=p(y,i);if(d.hasEagerState=!0,d.eagerState=N,sr(N,y)){var A=t.interleaved;A===null?(d.next=d,cc(t)):(d.next=A.next,A.next=d),t.interleaved=d;return}}catch{}finally{}i=Tf(e,t,d,l),i!==null&&(d=gn(),cr(i,e,l,d),Yf(i,t,l))}}function Gf(e){var t=e.alternate;return e===jt||t!==null&&t===jt}function Kf(e,t){Hi=oa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Yf(e,t,i){if((i&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,Fr(e,i)}}var ca={readContext:Gn,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useInsertionEffect:an,useLayoutEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useMutableSource:an,useSyncExternalStore:an,useId:an,unstable_isNewReconciler:!1},hy={readContext:Gn,useCallback:function(e,t){return xr().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:zf,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,aa(4194308,4,Uf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return aa(4194308,4,e,t)},useInsertionEffect:function(e,t){return aa(4,2,e,t)},useMemo:function(e,t){var i=xr();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var l=xr();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=fy.bind(null,jt,e),[l.memoizedState,e]},useRef:function(e){var t=xr();return e={current:e},t.memoizedState=e},useState:Pf,useDebugValue:Sc,useDeferredValue:function(e){return xr().memoizedState=e},useTransition:function(){var e=Pf(!1),t=e[0];return e=dy.bind(null,e[1]),xr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,i){var l=jt,d=xr();if(wt){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),Yt===null)throw Error(s(349));(ks&30)!==0||Af(l,t,i)}d.memoizedState=i;var p={value:i,getSnapshot:t};return d.queue=p,zf(Df.bind(null,l,p,e),[e]),l.flags|=2048,Gi(9,If.bind(null,l,p,i,t),void 0,null),i},useId:function(){var e=xr(),t=Yt.identifierPrefix;if(wt){var i=_r,l=Er;i=(l&~(1<<32-pn(l)-1)).toString(32)+i,t=":"+t+"R"+i,i=Vi++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=uy++,t=":"+t+"r"+i.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},my={readContext:Gn,useCallback:Wf,useContext:Gn,useEffect:kc,useImperativeHandle:Bf,useInsertionEffect:$f,useLayoutEffect:Ff,useMemo:Hf,useReducer:xc,useRef:Of,useState:function(){return xc(qi)},useDebugValue:Sc,useDeferredValue:function(e){var t=Kn();return Vf(t,Ut.memoizedState,e)},useTransition:function(){var e=xc(qi)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:jf,useSyncExternalStore:Rf,useId:qf,unstable_isNewReconciler:!1},gy={readContext:Gn,useCallback:Wf,useContext:Gn,useEffect:kc,useImperativeHandle:Bf,useInsertionEffect:$f,useLayoutEffect:Ff,useMemo:Hf,useReducer:wc,useRef:Of,useState:function(){return wc(qi)},useDebugValue:Sc,useDeferredValue:function(e){var t=Kn();return Ut===null?t.memoizedState=e:Vf(t,Ut.memoizedState,e)},useTransition:function(){var e=wc(qi)[0],t=Kn().memoizedState;return[e,t]},useMutableSource:jf,useSyncExternalStore:Rf,useId:qf,unstable_isNewReconciler:!1};function or(e,t){if(e&&e.defaultProps){t=V({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i]);return t}return t}function bc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:V({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var ua={isMounted:function(e){return(e=e._reactInternals)?He(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Jr(e),p=Rr(l,d);p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(cr(t,e,d,l),na(t,e,d))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=gn(),d=Jr(e),p=Rr(l,d);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Yr(e,p,d),t!==null&&(cr(t,e,d,l),na(t,e,d))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=gn(),l=Jr(e),d=Rr(i,l);d.tag=2,t!=null&&(d.callback=t),t=Yr(e,d,l),t!==null&&(cr(t,e,l,i),na(t,e,l))}};function Xf(e,t,i,l,d,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,y):t.prototype&&t.prototype.isPureReactComponent?!Di(i,l)||!Di(d,p):!0}function Qf(e,t,i){var l=!1,d=qr,p=t.contextType;return typeof p=="object"&&p!==null?p=Gn(p):(d=bn(t)?gs:on.current,l=t.contextTypes,p=(l=l!=null)?Ks(e,d):qr),t=new t(i,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ua,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=d,e.__reactInternalMemoizedMaskedChildContext=p),t}function Zf(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&&ua.enqueueReplaceState(t,t.state,null)}function Tc(e,t,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},uc(e);var p=t.contextType;typeof p=="object"&&p!==null?d.context=Gn(p):(p=bn(t)?gs:on.current,d.context=Ks(e,p)),d.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(bc(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&&ua.enqueueReplaceState(d,d.state,null),ra(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function ni(e,t){try{var i="",l=t;do i+=le(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 Nc(e,t,i){return{value:e,source:null,stack:i??null,digest:t??null}}function Cc(e,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var vy=typeof WeakMap=="function"?WeakMap:Map;function Jf(e,t,i){i=Rr(-1,i),i.tag=3,i.payload={element:null};var l=t.value;return i.callback=function(){va||(va=!0,Uc=l),Cc(e,t)},i}function ep(e,t,i){i=Rr(-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(){Cc(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Cc(e,t),typeof l!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var y=t.stack;this.componentDidCatch(t.value,{componentStack:y!==null?y:""})}),i}function tp(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new vy;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=Ay.bind(null,e,t,i),t.then(e,e))}function np(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 rp(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=Rr(-1,1),t.tag=2,Yr(i,t,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var yy=$.ReactCurrentOwner,Tn=!1;function mn(e,t,i,l){t.child=e===null?bf(t,null,i,l):Zs(t,e.child,i,l)}function sp(e,t,i,l,d){i=i.render;var p=t.ref;return ei(t,d),l=vc(e,t,i,l,p,d),i=yc(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(wt&&i&&ec(t),t.flags|=1,mn(e,t,l,d),t.child)}function ip(e,t,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Kc(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=p,op(e,t,p,l,d)):(e=ba(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 y=p.memoizedProps;if(i=i.compare,i=i!==null?i:Di,i(y,l)&&e.ref===t.ref)return Ar(e,t,d)}return t.flags|=1,e=ts(p,l),e.ref=t.ref,e.return=t,t.child=e}function op(e,t,i,l,d){if(e!==null){var p=e.memoizedProps;if(Di(p,l)&&e.ref===t.ref)if(Tn=!1,t.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Tn=!0);else return t.lanes=e.lanes,Ar(e,t,d)}return Ec(e,t,i,l,d)}function ap(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},ct(si,$n),$n|=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,ct(si,$n),$n|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,ct(si,$n),$n|=l}else p!==null?(l=p.baseLanes|i,t.memoizedState=null):l=i,ct(si,$n),$n|=l;return mn(e,t,d,i),t.child}function lp(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function Ec(e,t,i,l,d){var p=bn(i)?gs:on.current;return p=Ks(t,p),ei(t,d),i=vc(e,t,i,l,p,d),l=yc(),e!==null&&!Tn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Ar(e,t,d)):(wt&&l&&ec(t),t.flags|=1,mn(e,t,i,d),t.child)}function cp(e,t,i,l,d){if(bn(i)){var p=!0;Ko(t)}else p=!1;if(ei(t,d),t.stateNode===null)fa(e,t),Qf(t,i,l),Tc(t,i,l,d),l=!0;else if(e===null){var y=t.stateNode,N=t.memoizedProps;y.props=N;var A=y.context,U=i.contextType;typeof U=="object"&&U!==null?U=Gn(U):(U=bn(i)?gs:on.current,U=Ks(t,U));var te=i.getDerivedStateFromProps,re=typeof te=="function"||typeof y.getSnapshotBeforeUpdate=="function";re||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==l||A!==U)&&Zf(t,y,l,U),Kr=!1;var ee=t.memoizedState;y.state=ee,ra(t,l,y,d),A=t.memoizedState,N!==l||ee!==A||Sn.current||Kr?(typeof te=="function"&&(bc(t,i,te,l),A=t.memoizedState),(N=Kr||Xf(t,i,N,l,ee,A,U))?(re||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(t.flags|=4194308)):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=A),y.props=l,y.state=A,y.context=U,l=N):(typeof y.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{y=t.stateNode,Nf(e,t),N=t.memoizedProps,U=t.type===t.elementType?N:or(t.type,N),y.props=U,re=t.pendingProps,ee=y.context,A=i.contextType,typeof A=="object"&&A!==null?A=Gn(A):(A=bn(i)?gs:on.current,A=Ks(t,A));var he=i.getDerivedStateFromProps;(te=typeof he=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N!==re||ee!==A)&&Zf(t,y,l,A),Kr=!1,ee=t.memoizedState,y.state=ee,ra(t,l,y,d);var xe=t.memoizedState;N!==re||ee!==xe||Sn.current||Kr?(typeof he=="function"&&(bc(t,i,he,l),xe=t.memoizedState),(U=Kr||Xf(t,i,U,l,ee,xe,A)||!1)?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(l,xe,A),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(l,xe,A)),typeof y.componentDidUpdate=="function"&&(t.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=xe),y.props=l,y.state=xe,y.context=A,l=U):(typeof y.componentDidUpdate!="function"||N===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),l=!1)}return _c(e,t,i,l,p,d)}function _c(e,t,i,l,d,p){lp(e,t);var y=(t.flags&128)!==0;if(!l&&!y)return d&&hf(t,i,!1),Ar(e,t,p);l=t.stateNode,yy.current=t;var N=y&&typeof i.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&y?(t.child=Zs(t,e.child,null,p),t.child=Zs(t,null,N,p)):mn(e,t,N,p),t.memoizedState=l.state,d&&hf(t,i,!0),t.child}function up(e){var t=e.stateNode;t.pendingContext?ff(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ff(e,t.context,!1),dc(e,t.containerInfo)}function dp(e,t,i,l,d){return Qs(),sc(d),t.flags|=256,mn(e,t,i,l),t.child}var jc={dehydrated:null,treeContext:null,retryLane:0};function Rc(e){return{baseLanes:e,cachePool:null,transitions:null}}function fp(e,t,i){var l=t.pendingProps,d=_t.current,p=!1,y=(t.flags&128)!==0,N;if((N=y)||(N=e!==null&&e.memoizedState===null?!1:(d&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),ct(_t,d&1),e===null)return rc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(y=l.children,e=l.fallback,p?(l=t.mode,p=t.child,y={mode:"hidden",children:y},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=y):p=Ta(y,l,0,null),e=Cs(e,l,i,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Rc(i),t.memoizedState=jc,e):Ac(t,y));if(d=e.memoizedState,d!==null&&(N=d.dehydrated,N!==null))return xy(e,t,y,l,N,d,i);if(p){p=l.fallback,y=t.mode,d=e.child,N=d.sibling;var A={mode:"hidden",children:l.children};return(y&1)===0&&t.child!==d?(l=t.child,l.childLanes=0,l.pendingProps=A,t.deletions=null):(l=ts(d,A),l.subtreeFlags=d.subtreeFlags&14680064),N!==null?p=ts(N,p):(p=Cs(p,y,i,null),p.flags|=2),p.return=t,l.return=t,l.sibling=p,t.child=l,l=p,p=t.child,y=e.child.memoizedState,y=y===null?Rc(i):{baseLanes:y.baseLanes|i,cachePool:null,transitions:y.transitions},p.memoizedState=y,p.childLanes=e.childLanes&~i,t.memoizedState=jc,l}return p=e.child,e=p.sibling,l=ts(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 Ac(e,t){return t=Ta({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function da(e,t,i,l){return l!==null&&sc(l),Zs(t,e.child,null,i),e=Ac(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xy(e,t,i,l,d,p,y){if(i)return t.flags&256?(t.flags&=-257,l=Nc(Error(s(422))),da(e,t,y,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=l.fallback,d=t.mode,l=Ta({mode:"visible",children:l.children},d,0,null),p=Cs(p,d,y,null),p.flags|=2,l.return=t,p.return=t,l.sibling=p,t.child=l,(t.mode&1)!==0&&Zs(t,e.child,null,y),t.child.memoizedState=Rc(y),t.memoizedState=jc,p);if((t.mode&1)===0)return da(e,t,y,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var N=l.dgst;return l=N,p=Error(s(419)),l=Nc(p,l,void 0),da(e,t,y,l)}if(N=(y&e.childLanes)!==0,Tn||N){if(l=Yt,l!==null){switch(y&-y){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|y))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,jr(e,d),cr(l,e,d,-1))}return Gc(),l=Nc(Error(s(421))),da(e,t,y,l)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=Iy.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,zn=Hr(d.nextSibling),On=t,wt=!0,ir=null,e!==null&&(Vn[qn++]=Er,Vn[qn++]=_r,Vn[qn++]=vs,Er=e.id,_r=e.overflow,vs=t),t=Ac(t,l.children),t.flags|=4096,t)}function pp(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),lc(e.return,t,i)}function Ic(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 hp(e,t,i){var l=t.pendingProps,d=l.revealOrder,p=l.tail;if(mn(e,t,l.children,i),l=_t.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&&pp(e,i,t);else if(e.tag===19)pp(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(ct(_t,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&&sa(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=t.child,t.child=null):(d=i.sibling,i.sibling=null),Ic(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&&sa(e)===null){t.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}Ic(t,!0,i,null,p);break;case"together":Ic(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fa(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ar(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,(i&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=ts(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ts(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function wy(e,t,i){switch(t.tag){case 3:up(t),Qs();break;case 5:_f(t);break;case 1:bn(t.type)&&Ko(t);break;case 4:dc(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,d=t.memoizedProps.value;ct(ea,l._currentValue),l._currentValue=d;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(ct(_t,_t.current&1),t.flags|=128,null):(i&t.child.childLanes)!==0?fp(e,t,i):(ct(_t,_t.current&1),e=Ar(e,t,i),e!==null?e.sibling:null);ct(_t,_t.current&1);break;case 19:if(l=(i&t.childLanes)!==0,(e.flags&128)!==0){if(l)return hp(e,t,i);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),ct(_t,_t.current),l)break;return null;case 22:case 23:return t.lanes=0,ap(e,t,i)}return Ar(e,t,i)}var mp,Dc,gp,vp;mp=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}},Dc=function(){},gp=function(e,t,i,l){var d=e.memoizedProps;if(d!==l){e=t.stateNode,ws(yr.current);var p=null;switch(i){case"input":d=$e(e,d),l=$e(e,l),p=[];break;case"select":d=V({},d,{value:void 0}),l=V({},l,{value:void 0}),p=[];break;case"textarea":d=en(e,d),l=en(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Vo)}An(i,l);var y;i=null;for(U in d)if(!l.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var N=d[U];for(y in N)N.hasOwnProperty(y)&&(i||(i={}),i[y]="")}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 A=l[U];if(N=d!=null?d[U]:void 0,l.hasOwnProperty(U)&&A!==N&&(A!=null||N!=null))if(U==="style")if(N){for(y in N)!N.hasOwnProperty(y)||A&&A.hasOwnProperty(y)||(i||(i={}),i[y]="");for(y in A)A.hasOwnProperty(y)&&N[y]!==A[y]&&(i||(i={}),i[y]=A[y])}else i||(p||(p=[]),p.push(U,i)),i=A;else U==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,N=N?N.__html:void 0,A!=null&&N!==A&&(p=p||[]).push(U,A)):U==="children"?typeof A!="string"&&typeof A!="number"||(p=p||[]).push(U,""+A):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(a.hasOwnProperty(U)?(A!=null&&U==="onScroll"&&dt("scroll",e),p||N===A||(p=[])):(p=p||[]).push(U,A))}i&&(p=p||[]).push("style",i);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},vp=function(e,t,i,l){i!==l&&(t.flags|=4)};function Ki(e,t){if(!wt)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 ky(e,t,i){var l=t.pendingProps;switch(tc(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 bn(t.type)&&Go(),ln(t),null;case 3:return l=t.stateNode,ti(),ft(Sn),ft(on),hc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Zo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ir!==null&&(Hc(ir),ir=null))),Dc(e,t),ln(t),null;case 5:fc(t);var d=ws(Wi.current);if(i=t.type,e!==null&&t.stateNode!=null)gp(e,t,i,l,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(s(166));return ln(t),null}if(e=ws(yr.current),Zo(t)){l=t.stateNode,i=t.type;var p=t.memoizedProps;switch(l[vr]=t,l[zi]=p,e=(t.mode&1)!==0,i){case"dialog":dt("cancel",l),dt("close",l);break;case"iframe":case"object":case"embed":dt("load",l);break;case"video":case"audio":for(d=0;d<Li.length;d++)dt(Li[d],l);break;case"source":dt("error",l);break;case"img":case"image":case"link":dt("error",l),dt("load",l);break;case"details":dt("toggle",l);break;case"input":It(l,p),dt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},dt("invalid",l);break;case"textarea":H(l,p),dt("invalid",l)}An(i,p),d=null;for(var y in p)if(p.hasOwnProperty(y)){var N=p[y];y==="children"?typeof N=="string"?l.textContent!==N&&(p.suppressHydrationWarning!==!0&&Ho(l.textContent,N,e),d=["children",N]):typeof N=="number"&&l.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&Ho(l.textContent,N,e),d=["children",""+N]):a.hasOwnProperty(y)&&N!=null&&y==="onScroll"&&dt("scroll",l)}switch(i){case"input":it(l),jn(l,p,!0);break;case"textarea":it(l),Ue(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Vo)}l=d,t.updateQueue=l,l!==null&&(t.flags|=4)}else{y=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tt(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=y.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=y.createElement(i,{is:l.is}):(e=y.createElement(i),i==="select"&&(y=e,l.multiple?y.multiple=!0:l.size&&(y.size=l.size))):e=y.createElementNS(e,i),e[vr]=t,e[zi]=l,mp(e,t,!1,!1),t.stateNode=e;e:{switch(y=In(i,l),i){case"dialog":dt("cancel",e),dt("close",e),d=l;break;case"iframe":case"object":case"embed":dt("load",e),d=l;break;case"video":case"audio":for(d=0;d<Li.length;d++)dt(Li[d],e);d=l;break;case"source":dt("error",e),d=l;break;case"img":case"image":case"link":dt("error",e),dt("load",e),d=l;break;case"details":dt("toggle",e),d=l;break;case"input":It(e,l),d=$e(e,l),dt("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=V({},l,{value:void 0}),dt("invalid",e);break;case"textarea":H(e,l),d=en(e,l),dt("invalid",e);break;default:d=l}An(i,d),N=d;for(p in N)if(N.hasOwnProperty(p)){var A=N[p];p==="style"?br(e,A):p==="dangerouslySetInnerHTML"?(A=A?A.__html:void 0,A!=null&&Rt(e,A)):p==="children"?typeof A=="string"?(i!=="textarea"||A!=="")&&Ht(e,A):typeof A=="number"&&Ht(e,""+A):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?A!=null&&p==="onScroll"&&dt("scroll",e):A!=null&&B(e,p,A,y))}switch(i){case"input":it(e),jn(e,l,!1);break;case"textarea":it(e),Ue(e);break;case"option":l.value!=null&&e.setAttribute("value",""+Te(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?ht(e,!!l.multiple,p,!1):l.defaultValue!=null&&ht(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Vo)}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)vp(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(i=ws(Wi.current),ws(yr.current),Zo(t)){if(l=t.stateNode,i=t.memoizedProps,l[vr]=t,(p=l.nodeValue!==i)&&(e=On,e!==null))switch(e.tag){case 3:Ho(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ho(l.nodeValue,i,(e.mode&1)!==0)}p&&(t.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[vr]=t,t.stateNode=l}return ln(t),null;case 13:if(ft(_t),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wt&&zn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)wf(),Qs(),t.flags|=98560,p=!1;else if(p=Zo(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[vr]=t}else Qs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ln(t),p=!1}else ir!==null&&(Hc(ir),ir=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||(_t.current&1)!==0?Bt===0&&(Bt=3):Gc())),t.updateQueue!==null&&(t.flags|=4),ln(t),null);case 4:return ti(),Dc(e,t),e===null&&Pi(t.stateNode.containerInfo),ln(t),null;case 10:return ac(t.type._context),ln(t),null;case 17:return bn(t.type)&&Go(),ln(t),null;case 19:if(ft(_t),p=t.memoizedState,p===null)return ln(t),null;if(l=(t.flags&128)!==0,y=p.rendering,y===null)if(l)Ki(p,!1);else{if(Bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(y=sa(e),y!==null){for(t.flags|=128,Ki(p,!1),l=y.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,y=p.alternate,y===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=y.childLanes,p.lanes=y.lanes,p.child=y.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=y.memoizedProps,p.memoizedState=y.memoizedState,p.updateQueue=y.updateQueue,p.type=y.type,e=y.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(_t,_t.current&1|2),t.child}e=e.sibling}p.tail!==null&&Nt()>ii&&(t.flags|=128,l=!0,Ki(p,!1),t.lanes=4194304)}else{if(!l)if(e=sa(y),e!==null){if(t.flags|=128,l=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),Ki(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!wt)return ln(t),null}else 2*Nt()-p.renderingStartTime>ii&&i!==1073741824&&(t.flags|=128,l=!0,Ki(p,!1),t.lanes=4194304);p.isBackwards?(y.sibling=t.child,t.child=y):(i=p.last,i!==null?i.sibling=y:t.child=y,p.last=y)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Nt(),t.sibling=null,i=_t.current,ct(_t,l?i&1|2:i&1),t):(ln(t),null);case 22:case 23:return qc(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?($n&1073741824)!==0&&(ln(t),t.subtreeFlags&6&&(t.flags|=8192)):ln(t),null;case 24:return null;case 25:return null}throw Error(s(156,t.tag))}function Sy(e,t){switch(tc(t),t.tag){case 1:return bn(t.type)&&Go(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),ft(Sn),ft(on),hc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return fc(t),null;case 13:if(ft(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(_t),null;case 4:return ti(),null;case 10:return ac(t.type._context),null;case 22:case 23:return qc(),null;case 24:return null;default:return null}}var pa=!1,cn=!1,by=typeof WeakSet=="function"?WeakSet:Set,ve=null;function ri(e,t){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){At(e,t,l)}else i.current=null}function Mc(e,t,i){try{i()}catch(l){At(e,t,l)}}var yp=!1;function Ty(e,t){if(ql=Do,e=Yd(),zl(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 y=0,N=-1,A=-1,U=0,te=0,re=e,ee=null;t:for(;;){for(var he;re!==i||d!==0&&re.nodeType!==3||(N=y+d),re!==p||l!==0&&re.nodeType!==3||(A=y+l),re.nodeType===3&&(y+=re.nodeValue.length),(he=re.firstChild)!==null;)ee=re,re=he;for(;;){if(re===e)break t;if(ee===i&&++U===d&&(N=y),ee===p&&++te===l&&(A=y),(he=re.nextSibling)!==null)break;re=ee,ee=re.parentNode}re=he}i=N===-1||A===-1?null:{start:N,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(Gl={focusedElem:e,selectionRange:i},Do=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var xe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var ke=xe.memoizedProps,Pt=xe.memoizedState,z=t.stateNode,D=z.getSnapshotBeforeUpdate(t.elementType===t.type?ke:or(t.type,ke),Pt);z.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ae){At(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return xe=yp,yp=!1,xe}function Yi(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&&Mc(t,i,p)}d=d.next}while(d!==l)}}function ha(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 Lc(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 xp(e){var t=e.alternate;t!==null&&(e.alternate=null,xp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vr],delete t[zi],delete t[Ql],delete t[oy],delete t[ay])),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 wp(e){return e.tag===5||e.tag===3||e.tag===4}function kp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wp(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 Pc(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=Vo));else if(l!==4&&(e=e.child,e!==null))for(Pc(e,t,i),e=e.sibling;e!==null;)Pc(e,t,i),e=e.sibling}function Oc(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(Oc(e,t,i),e=e.sibling;e!==null;)Oc(e,t,i),e=e.sibling}var tn=null,ar=!1;function Xr(e,t,i){for(i=i.child;i!==null;)Sp(e,t,i),i=i.sibling}function Sp(e,t,i){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(us,i)}catch{}switch(i.tag){case 5:cn||ri(i,t);case 6:var l=tn,d=ar;tn=null,Xr(e,t,i),tn=l,ar=d,tn!==null&&(ar?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(ar?(e=tn,i=i.stateNode,e.nodeType===8?Xl(e.parentNode,i):e.nodeType===1&&Xl(e,i),Ei(e)):Xl(tn,i.stateNode));break;case 4:l=tn,d=ar,tn=i.stateNode.containerInfo,ar=!0,Xr(e,t,i),tn=l,ar=d;break;case 0:case 11:case 14:case 15:if(!cn&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,y=p.destroy;p=p.tag,y!==void 0&&((p&2)!==0||(p&4)!==0)&&Mc(i,t,y),d=d.next}while(d!==l)}Xr(e,t,i);break;case 1:if(!cn&&(ri(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(N){At(i,t,N)}Xr(e,t,i);break;case 21:Xr(e,t,i);break;case 22:i.mode&1?(cn=(l=cn)||i.memoizedState!==null,Xr(e,t,i),cn=l):Xr(e,t,i);break;default:Xr(e,t,i)}}function bp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new by),t.forEach(function(l){var d=Dy.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function lr(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,y=t,N=y;e:for(;N!==null;){switch(N.tag){case 5:tn=N.stateNode,ar=!1;break e;case 3:tn=N.stateNode.containerInfo,ar=!0;break e;case 4:tn=N.stateNode.containerInfo,ar=!0;break e}N=N.return}if(tn===null)throw Error(s(160));Sp(p,y,d),tn=null,ar=!1;var A=d.alternate;A!==null&&(A.return=null),d.return=null}catch(U){At(d,t,U)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Tp(t,e),t=t.sibling}function Tp(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lr(t,e),wr(e),l&4){try{Yi(3,e,e.return),ha(3,e)}catch(ke){At(e,e.return,ke)}try{Yi(5,e,e.return)}catch(ke){At(e,e.return,ke)}}break;case 1:lr(t,e),wr(e),l&512&&i!==null&&ri(i,i.return);break;case 5:if(lr(t,e),wr(e),l&512&&i!==null&&ri(i,i.return),e.flags&32){var d=e.stateNode;try{Ht(d,"")}catch(ke){At(e,e.return,ke)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,y=i!==null?i.memoizedProps:p,N=e.type,A=e.updateQueue;if(e.updateQueue=null,A!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Fe(d,p),In(N,y);var U=In(N,p);for(y=0;y<A.length;y+=2){var te=A[y],re=A[y+1];te==="style"?br(d,re):te==="dangerouslySetInnerHTML"?Rt(d,re):te==="children"?Ht(d,re):B(d,te,re,U)}switch(N){case"input":Dt(d,p);break;case"textarea":pe(d,p);break;case"select":var ee=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var he=p.value;he!=null?ht(d,!!p.multiple,he,!1):ee!==!!p.multiple&&(p.defaultValue!=null?ht(d,!!p.multiple,p.defaultValue,!0):ht(d,!!p.multiple,p.multiple?[]:"",!1))}d[zi]=p}catch(ke){At(e,e.return,ke)}}break;case 6:if(lr(t,e),wr(e),l&4){if(e.stateNode===null)throw Error(s(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(ke){At(e,e.return,ke)}}break;case 3:if(lr(t,e),wr(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ei(t.containerInfo)}catch(ke){At(e,e.return,ke)}break;case 4:lr(t,e),wr(e);break;case 13:lr(t,e),wr(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Fc=Nt())),l&4&&bp(e);break;case 22:if(te=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(U=cn)||te,lr(t,e),cn=U):lr(t,e),wr(e),l&8192){if(U=e.memoizedState!==null,(e.stateNode.isHidden=U)&&!te&&(e.mode&1)!==0)for(ve=e,te=e.child;te!==null;){for(re=ve=te;ve!==null;){switch(ee=ve,he=ee.child,ee.tag){case 0:case 11:case 14:case 15:Yi(4,ee,ee.return);break;case 1:ri(ee,ee.return);var xe=ee.stateNode;if(typeof xe.componentWillUnmount=="function"){l=ee,i=ee.return;try{t=l,xe.props=t.memoizedProps,xe.state=t.memoizedState,xe.componentWillUnmount()}catch(ke){At(l,i,ke)}}break;case 5:ri(ee,ee.return);break;case 22:if(ee.memoizedState!==null){Ep(re);continue}}he!==null?(he.return=ee,ve=he):Ep(re)}te=te.sibling}e:for(te=null,re=e;;){if(re.tag===5){if(te===null){te=re;try{d=re.stateNode,U?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=re.stateNode,A=re.memoizedProps.style,y=A!=null&&A.hasOwnProperty("display")?A.display:null,N.style.display=Hn("display",y))}catch(ke){At(e,e.return,ke)}}}else if(re.tag===6){if(te===null)try{re.stateNode.nodeValue=U?"":re.memoizedProps}catch(ke){At(e,e.return,ke)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===e)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===e)break e;for(;re.sibling===null;){if(re.return===null||re.return===e)break e;te===re&&(te=null),re=re.return}te===re&&(te=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:lr(t,e),wr(e),l&4&&bp(e);break;case 21:break;default:lr(t,e),wr(e)}}function wr(e){var t=e.flags;if(t&2){try{e:{for(var i=e.return;i!==null;){if(wp(i)){var l=i;break e}i=i.return}throw Error(s(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(Ht(d,""),l.flags&=-33);var p=kp(e);Oc(e,p,d);break;case 3:case 4:var y=l.stateNode.containerInfo,N=kp(e);Pc(e,N,y);break;default:throw Error(s(161))}}catch(A){At(e,e.return,A)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ny(e,t,i){ve=e,Np(e)}function Np(e,t,i){for(var l=(e.mode&1)!==0;ve!==null;){var d=ve,p=d.child;if(d.tag===22&&l){var y=d.memoizedState!==null||pa;if(!y){var N=d.alternate,A=N!==null&&N.memoizedState!==null||cn;N=pa;var U=cn;if(pa=y,(cn=A)&&!U)for(ve=d;ve!==null;)y=ve,A=y.child,y.tag===22&&y.memoizedState!==null?_p(d):A!==null?(A.return=y,ve=A):_p(d);for(;p!==null;)ve=p,Np(p),p=p.sibling;ve=d,pa=N,cn=U}Cp(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ve=p):Cp(e)}}function Cp(e){for(;ve!==null;){var t=ve;if((t.flags&8772)!==0){var i=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:cn||ha(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!cn)if(i===null)l.componentDidMount();else{var d=t.elementType===t.type?i.memoizedProps:or(t.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&Ef(t,p,l);break;case 3:var y=t.updateQueue;if(y!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Ef(t,y,i)}break;case 5:var N=t.stateNode;if(i===null&&t.flags&4){i=N;var A=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":A.autoFocus&&i.focus();break;case"img":A.src&&(i.src=A.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 te=U.memoizedState;if(te!==null){var re=te.dehydrated;re!==null&&Ei(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||t.flags&512&&Lc(t)}catch(ee){At(t,t.return,ee)}}if(t===e){ve=null;break}if(i=t.sibling,i!==null){i.return=t.return,ve=i;break}ve=t.return}}function Ep(e){for(;ve!==null;){var t=ve;if(t===e){ve=null;break}var i=t.sibling;if(i!==null){i.return=t.return,ve=i;break}ve=t.return}}function _p(e){for(;ve!==null;){var t=ve;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{ha(4,t)}catch(A){At(t,i,A)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var d=t.return;try{l.componentDidMount()}catch(A){At(t,d,A)}}var p=t.return;try{Lc(t)}catch(A){At(t,p,A)}break;case 5:var y=t.return;try{Lc(t)}catch(A){At(t,y,A)}}}catch(A){At(t,t.return,A)}if(t===e){ve=null;break}var N=t.sibling;if(N!==null){N.return=t.return,ve=N;break}ve=t.return}}var Cy=Math.ceil,ma=$.ReactCurrentDispatcher,zc=$.ReactCurrentOwner,Yn=$.ReactCurrentBatchConfig,Ye=0,Yt=null,zt=null,nn=0,$n=0,si=Vr(0),Bt=0,Xi=null,Ss=0,ga=0,$c=0,Qi=null,Nn=null,Fc=0,ii=1/0,Ir=null,va=!1,Uc=null,Qr=null,ya=!1,Zr=null,xa=0,Zi=0,Bc=null,wa=-1,ka=0;function gn(){return(Ye&6)!==0?Nt():wa!==-1?wa:wa=Nt()}function Jr(e){return(e.mode&1)===0?1:(Ye&2)!==0&&nn!==0?nn&-nn:cy.transition!==null?(ka===0&&(ka=bi()),ka):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:jd(e.type)),e)}function cr(e,t,i,l){if(50<Zi)throw Zi=0,Bc=null,Error(s(185));hs(e,i,l),((Ye&2)===0||e!==Yt)&&(e===Yt&&((Ye&2)===0&&(ga|=i),Bt===4&&es(e,nn)),Cn(e,l),i===1&&Ye===0&&(t.mode&1)===0&&(ii=Nt()+500,Yo&&Gr()))}function Cn(e,t){var i=e.callbackNode;Ro(e,t);var l=ps(e,e===Yt?nn:0);if(l===0)i!==null&&rr(i),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(i!=null&&rr(i),t===1)e.tag===0?ly(Rp.bind(null,e)):mf(Rp.bind(null,e)),sy(function(){(Ye&6)===0&&Gr()}),i=null;else{switch(oe(l)){case 1:i=zr;break;case 4:i=gr;break;case 16:i=Ls;break;case 536870912:i=_o;break;default:i=Ls}i=zp(i,jp.bind(null,e))}e.callbackPriority=t,e.callbackNode=i}}function jp(e,t){if(wa=-1,ka=0,(Ye&6)!==0)throw Error(s(327));var i=e.callbackNode;if(oi()&&e.callbackNode!==i)return null;var l=ps(e,e===Yt?nn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Sa(e,l);else{t=l;var d=Ye;Ye|=2;var p=Ip();(Yt!==e||nn!==t)&&(Ir=null,ii=Nt()+500,Ts(e,t));do try{jy();break}catch(N){Ap(e,N)}while(!0);oc(),ma.current=p,Ye=d,zt!==null?t=0:(Yt=null,nn=0,t=Bt)}if(t!==0){if(t===2&&(d=Si(e),d!==0&&(l=d,t=Wc(e,d))),t===1)throw i=Xi,Ts(e,0),es(e,l),Cn(e,Nt()),i;if(t===6)es(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Ey(d)&&(t=Sa(e,l),t===2&&(p=Si(e),p!==0&&(l=p,t=Wc(e,p))),t===1))throw i=Xi,Ts(e,0),es(e,l),Cn(e,Nt()),i;switch(e.finishedWork=d,e.finishedLanes=l,t){case 0:case 1:throw Error(s(345));case 2:Ns(e,Nn,Ir);break;case 3:if(es(e,l),(l&130023424)===l&&(t=Fc+500-Nt(),10<t)){if(ps(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){gn(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Yl(Ns.bind(null,e,Nn,Ir),t);break}Ns(e,Nn,Ir);break;case 4:if(es(e,l),(l&4194240)===l)break;for(t=e.eventTimes,d=-1;0<l;){var y=31-pn(l);p=1<<y,y=t[y],y>d&&(d=y),l&=~p}if(l=d,l=Nt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Cy(l/1960))-l,10<l){e.timeoutHandle=Yl(Ns.bind(null,e,Nn,Ir),l);break}Ns(e,Nn,Ir);break;case 5:Ns(e,Nn,Ir);break;default:throw Error(s(329))}}}return Cn(e,Nt()),e.callbackNode===i?jp.bind(null,e):null}function Wc(e,t){var i=Qi;return e.current.memoizedState.isDehydrated&&(Ts(e,t).flags|=256),e=Sa(e,t),e!==2&&(t=Nn,Nn=i,t!==null&&Hc(t)),e}function Hc(e){Nn===null?Nn=e:Nn.push.apply(Nn,e)}function Ey(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(!sr(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 es(e,t){for(t&=~$c,t&=~ga,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var i=31-pn(t),l=1<<i;e[i]=-1,t&=~l}}function Rp(e){if((Ye&6)!==0)throw Error(s(327));oi();var t=ps(e,0);if((t&1)===0)return Cn(e,Nt()),null;var i=Sa(e,t);if(e.tag!==0&&i===2){var l=Si(e);l!==0&&(t=l,i=Wc(e,l))}if(i===1)throw i=Xi,Ts(e,0),es(e,t),Cn(e,Nt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ns(e,Nn,Ir),Cn(e,Nt()),null}function Vc(e,t){var i=Ye;Ye|=1;try{return e(t)}finally{Ye=i,Ye===0&&(ii=Nt()+500,Yo&&Gr())}}function bs(e){Zr!==null&&Zr.tag===0&&(Ye&6)===0&&oi();var t=Ye;Ye|=1;var i=Yn.transition,l=Ge;try{if(Yn.transition=null,Ge=1,e)return e()}finally{Ge=l,Yn.transition=i,Ye=t,(Ye&6)===0&&Gr()}}function qc(){$n=si.current,ft(si)}function Ts(e,t){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,ry(i)),zt!==null)for(i=zt.return;i!==null;){var l=i;switch(tc(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Go();break;case 3:ti(),ft(Sn),ft(on),hc();break;case 5:fc(l);break;case 4:ti();break;case 13:ft(_t);break;case 19:ft(_t);break;case 10:ac(l.type._context);break;case 22:case 23:qc()}i=i.return}if(Yt=e,zt=e=ts(e.current,null),nn=$n=t,Bt=0,Xi=null,$c=ga=Ss=0,Nn=Qi=null,xs!==null){for(t=0;t<xs.length;t++)if(i=xs[t],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var y=p.next;p.next=d,l.next=y}i.pending=l}xs=null}return e}function Ap(e,t){do{var i=zt;try{if(oc(),ia.current=ca,oa){for(var l=jt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}oa=!1}if(ks=0,Kt=Ut=jt=null,Hi=!1,Vi=0,zc.current=null,i===null||i.return===null){Bt=1,Xi=t,zt=null;break}e:{var p=e,y=i.return,N=i,A=t;if(t=nn,N.flags|=32768,A!==null&&typeof A=="object"&&typeof A.then=="function"){var U=A,te=N,re=te.tag;if((te.mode&1)===0&&(re===0||re===11||re===15)){var ee=te.alternate;ee?(te.updateQueue=ee.updateQueue,te.memoizedState=ee.memoizedState,te.lanes=ee.lanes):(te.updateQueue=null,te.memoizedState=null)}var he=np(y);if(he!==null){he.flags&=-257,rp(he,y,N,p,t),he.mode&1&&tp(p,U,t),t=he,A=U;var xe=t.updateQueue;if(xe===null){var ke=new Set;ke.add(A),t.updateQueue=ke}else xe.add(A);break e}else{if((t&1)===0){tp(p,U,t),Gc();break e}A=Error(s(426))}}else if(wt&&N.mode&1){var Pt=np(y);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),rp(Pt,y,N,p,t),sc(ni(A,N));break e}}p=A=ni(A,N),Bt!==4&&(Bt=2),Qi===null?Qi=[p]:Qi.push(p),p=y;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var z=Jf(p,A,t);Cf(p,z);break e;case 1:N=A;var D=p.type,F=p.stateNode;if((p.flags&128)===0&&(typeof D.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(Qr===null||!Qr.has(F)))){p.flags|=65536,t&=-t,p.lanes|=t;var ae=ep(p,N,t);Cf(p,ae);break e}}p=p.return}while(p!==null)}Mp(i)}catch(Se){t=Se,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function Ip(){var e=ma.current;return ma.current=ca,e===null?ca:e}function Gc(){(Bt===0||Bt===3||Bt===2)&&(Bt=4),Yt===null||(Ss&268435455)===0&&(ga&268435455)===0||es(Yt,nn)}function Sa(e,t){var i=Ye;Ye|=2;var l=Ip();(Yt!==e||nn!==t)&&(Ir=null,Ts(e,t));do try{_y();break}catch(d){Ap(e,d)}while(!0);if(oc(),Ye=i,ma.current=l,zt!==null)throw Error(s(261));return Yt=null,nn=0,Bt}function _y(){for(;zt!==null;)Dp(zt)}function jy(){for(;zt!==null&&!Nl();)Dp(zt)}function Dp(e){var t=Op(e.alternate,e,$n);e.memoizedProps=e.pendingProps,t===null?Mp(e):zt=t,zc.current=null}function Mp(e){var t=e;do{var i=t.alternate;if(e=t.return,(t.flags&32768)===0){if(i=ky(i,t,$n),i!==null){zt=i;return}}else{if(i=Sy(i,t),i!==null){i.flags&=32767,zt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Bt=6,zt=null;return}}if(t=t.sibling,t!==null){zt=t;return}zt=t=e}while(t!==null);Bt===0&&(Bt=5)}function Ns(e,t,i){var l=Ge,d=Yn.transition;try{Yn.transition=null,Ge=1,Ry(e,t,i,l)}finally{Yn.transition=d,Ge=l}return null}function Ry(e,t,i,l){do oi();while(Zr!==null);if((Ye&6)!==0)throw Error(s(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(Ao(e,p),e===Yt&&(zt=Yt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ya||(ya=!0,zp(Ls,function(){return oi(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Yn.transition,Yn.transition=null;var y=Ge;Ge=1;var N=Ye;Ye|=4,zc.current=null,Ty(e,i),Tp(i,e),Xv(Gl),Do=!!ql,Gl=ql=null,e.current=i,Ny(i),Cl(),Ye=N,Ge=y,Yn.transition=p}else e.current=i;if(ya&&(ya=!1,Zr=e,xa=d),p=e.pendingLanes,p===0&&(Qr=null),Ps(i.stateNode),Cn(e,Nt()),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(va)throw va=!1,e=Uc,Uc=null,e;return(xa&1)!==0&&e.tag!==0&&oi(),p=e.pendingLanes,(p&1)!==0?e===Bc?Zi++:(Zi=0,Bc=e):Zi=0,Gr(),null}function oi(){if(Zr!==null){var e=oe(xa),t=Yn.transition,i=Ge;try{if(Yn.transition=null,Ge=16>e?16:e,Zr===null)var l=!1;else{if(e=Zr,Zr=null,xa=0,(Ye&6)!==0)throw Error(s(331));var d=Ye;for(Ye|=4,ve=e.current;ve!==null;){var p=ve,y=p.child;if((ve.flags&16)!==0){var N=p.deletions;if(N!==null){for(var A=0;A<N.length;A++){var U=N[A];for(ve=U;ve!==null;){var te=ve;switch(te.tag){case 0:case 11:case 15:Yi(8,te,p)}var re=te.child;if(re!==null)re.return=te,ve=re;else for(;ve!==null;){te=ve;var ee=te.sibling,he=te.return;if(xp(te),te===U){ve=null;break}if(ee!==null){ee.return=he,ve=ee;break}ve=he}}}var xe=p.alternate;if(xe!==null){var ke=xe.child;if(ke!==null){xe.child=null;do{var Pt=ke.sibling;ke.sibling=null,ke=Pt}while(ke!==null)}}ve=p}}if((p.subtreeFlags&2064)!==0&&y!==null)y.return=p,ve=y;else e:for(;ve!==null;){if(p=ve,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Yi(9,p,p.return)}var z=p.sibling;if(z!==null){z.return=p.return,ve=z;break e}ve=p.return}}var D=e.current;for(ve=D;ve!==null;){y=ve;var F=y.child;if((y.subtreeFlags&2064)!==0&&F!==null)F.return=y,ve=F;else e:for(y=D;ve!==null;){if(N=ve,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:ha(9,N)}}catch(Se){At(N,N.return,Se)}if(N===y){ve=null;break e}var ae=N.sibling;if(ae!==null){ae.return=N.return,ve=ae;break e}ve=N.return}}if(Ye=d,Gr(),Ln&&typeof Ln.onPostCommitFiberRoot=="function")try{Ln.onPostCommitFiberRoot(us,e)}catch{}l=!0}return l}finally{Ge=i,Yn.transition=t}}return!1}function Lp(e,t,i){t=ni(i,t),t=Jf(e,t,1),e=Yr(e,t,1),t=gn(),e!==null&&(hs(e,1,t),Cn(e,t))}function At(e,t,i){if(e.tag===3)Lp(e,e,i);else for(;t!==null;){if(t.tag===3){Lp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Qr===null||!Qr.has(l))){e=ni(i,e),e=ep(t,e,1),t=Yr(t,e,1),e=gn(),t!==null&&(hs(t,1,e),Cn(t,e));break}}t=t.return}}function Ay(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),t=gn(),e.pingedLanes|=e.suspendedLanes&i,Yt===e&&(nn&i)===i&&(Bt===4||Bt===3&&(nn&130023424)===nn&&500>Nt()-Fc?Ts(e,0):$c|=i),Cn(e,t)}function Pp(e,t){t===0&&((e.mode&1)===0?t=1:(t=zs,zs<<=1,(zs&130023424)===0&&(zs=4194304)));var i=gn();e=jr(e,t),e!==null&&(hs(e,t,i),Cn(e,i))}function Iy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Pp(e,i)}function Dy(e,t){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(s(314))}l!==null&&l.delete(t),Pp(e,i)}var Op;Op=function(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps||Sn.current)Tn=!0;else{if((e.lanes&i)===0&&(t.flags&128)===0)return Tn=!1,wy(e,t,i);Tn=(e.flags&131072)!==0}else Tn=!1,wt&&(t.flags&1048576)!==0&&gf(t,Qo,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;fa(e,t),e=t.pendingProps;var d=Ks(t,on.current);ei(t,i),d=vc(null,t,l,e,d,i);var p=yc();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,bn(l)?(p=!0,Ko(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,uc(t),d.updater=ua,t.stateNode=d,d._reactInternals=t,Tc(t,l,e,i),t=_c(null,t,l,!0,p,i)):(t.tag=0,wt&&p&&ec(t),mn(null,t,d,i),t=t.child),t;case 16:l=t.elementType;e:{switch(fa(e,t),e=t.pendingProps,d=l._init,l=d(l._payload),t.type=l,d=t.tag=Ly(l),e=or(l,e),d){case 0:t=Ec(null,t,l,e,i);break e;case 1:t=cp(null,t,l,e,i);break e;case 11:t=sp(null,t,l,e,i);break e;case 14:t=ip(null,t,l,or(l.type,e),i);break e}throw Error(s(306,l,""))}return t;case 0:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),Ec(e,t,l,d,i);case 1:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),cp(e,t,l,d,i);case 3:e:{if(up(t),e===null)throw Error(s(387));l=t.pendingProps,p=t.memoizedState,d=p.element,Nf(e,t),ra(t,l,null,i);var y=t.memoizedState;if(l=y.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:y.cache,pendingSuspenseBoundaries:y.pendingSuspenseBoundaries,transitions:y.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=ni(Error(s(423)),t),t=dp(e,t,l,i,d);break e}else if(l!==d){d=ni(Error(s(424)),t),t=dp(e,t,l,i,d);break e}else for(zn=Hr(t.stateNode.containerInfo.firstChild),On=t,wt=!0,ir=null,i=bf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Qs(),l===d){t=Ar(e,t,i);break e}mn(e,t,l,i)}t=t.child}return t;case 5:return _f(t),e===null&&rc(t),l=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,y=d.children,Kl(l,d)?y=null:p!==null&&Kl(l,p)&&(t.flags|=32),lp(e,t),mn(e,t,y,i),t.child;case 6:return e===null&&rc(t),null;case 13:return fp(e,t,i);case 4:return dc(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Zs(t,null,l,i):mn(e,t,l,i),t.child;case 11:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),sp(e,t,l,d,i);case 7:return mn(e,t,t.pendingProps,i),t.child;case 8:return mn(e,t,t.pendingProps.children,i),t.child;case 12:return mn(e,t,t.pendingProps.children,i),t.child;case 10:e:{if(l=t.type._context,d=t.pendingProps,p=t.memoizedProps,y=d.value,ct(ea,l._currentValue),l._currentValue=y,p!==null)if(sr(p.value,y)){if(p.children===d.children&&!Sn.current){t=Ar(e,t,i);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){y=p.child;for(var A=N.firstContext;A!==null;){if(A.context===l){if(p.tag===1){A=Rr(-1,i&-i),A.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var te=U.pending;te===null?A.next=A:(A.next=te.next,te.next=A),U.pending=A}}p.lanes|=i,A=p.alternate,A!==null&&(A.lanes|=i),lc(p.return,i,t),N.lanes|=i;break}A=A.next}}else if(p.tag===10)y=p.type===t.type?null:p.child;else if(p.tag===18){if(y=p.return,y===null)throw Error(s(341));y.lanes|=i,N=y.alternate,N!==null&&(N.lanes|=i),lc(y,i,t),y=p.sibling}else y=p.child;if(y!==null)y.return=p;else for(y=p;y!==null;){if(y===t){y=null;break}if(p=y.sibling,p!==null){p.return=y.return,y=p;break}y=y.return}p=y}mn(e,t,d.children,i),t=t.child}return t;case 9:return d=t.type,l=t.pendingProps.children,ei(t,i),d=Gn(d),l=l(d),t.flags|=1,mn(e,t,l,i),t.child;case 14:return l=t.type,d=or(l,t.pendingProps),d=or(l.type,d),ip(e,t,l,d,i);case 15:return op(e,t,t.type,t.pendingProps,i);case 17:return l=t.type,d=t.pendingProps,d=t.elementType===l?d:or(l,d),fa(e,t),t.tag=1,bn(l)?(e=!0,Ko(t)):e=!1,ei(t,i),Qf(t,l,d),Tc(t,l,d,i),_c(null,t,l,!0,e,i);case 19:return hp(e,t,i);case 22:return ap(e,t,i)}throw Error(s(156,t.tag))};function zp(e,t){return Tt(e,t)}function My(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 Xn(e,t,i,l){return new My(e,t,i,l)}function Kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ly(e){if(typeof e=="function")return Kc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===De)return 11;if(e===ne)return 14}return 2}function ts(e,t){var i=e.alternate;return i===null?(i=Xn(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 ba(e,t,i,l,d,p){var y=2;if(l=e,typeof e=="function")Kc(e)&&(y=1);else if(typeof e=="string")y=5;else e:switch(e){case K:return Cs(i.children,d,p,t);case X:y=8,d|=8;break;case ue:return e=Xn(12,i,t,d|2),e.elementType=ue,e.lanes=p,e;case je:return e=Xn(13,i,t,d),e.elementType=je,e.lanes=p,e;case Le:return e=Xn(19,i,t,d),e.elementType=Le,e.lanes=p,e;case Y:return Ta(i,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:y=10;break e;case de:y=9;break e;case De:y=11;break e;case ne:y=14;break e;case q:y=16,l=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return t=Xn(y,i,t,d),t.elementType=e,t.type=l,t.lanes=p,t}function Cs(e,t,i,l){return e=Xn(7,e,l,t),e.lanes=i,e}function Ta(e,t,i,l){return e=Xn(22,e,l,t),e.elementType=Y,e.lanes=i,e.stateNode={isHidden:!1},e}function Yc(e,t,i){return e=Xn(6,e,null,t),e.lanes=i,e}function Xc(e,t,i){return t=Xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Py(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=Ti(0),this.expirationTimes=Ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ti(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Qc(e,t,i,l,d,p,y,N,A){return e=new Py(e,t,i,N,A),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Xn(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},uc(p),e}function Oy(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 $p(e){if(!e)return qr;e=e._reactInternals;e:{if(He(e)!==e||e.tag!==1)throw Error(s(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(bn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(bn(i))return pf(e,i,t)}return t}function Fp(e,t,i,l,d,p,y,N,A){return e=Qc(i,l,!0,e,d,p,y,N,A),e.context=$p(null),i=e.current,l=gn(),d=Jr(i),p=Rr(l,d),p.callback=t??null,Yr(i,p,d),e.current.lanes=d,hs(e,d,l),Cn(e,l),e}function Na(e,t,i,l){var d=t.current,p=gn(),y=Jr(d);return i=$p(i),t.context===null?t.context=i:t.pendingContext=i,t=Rr(p,y),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Yr(d,t,y),e!==null&&(cr(e,d,y,p),na(e,d,y)),y}function Ca(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 Up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Zc(e,t){Up(e,t),(e=e.alternate)&&Up(e,t)}function zy(){return null}var Bp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jc(e){this._internalRoot=e}Ea.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));Na(e,t,null,null)},Ea.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){Na(null,e,null,null)}),t[Nr]=null}};function Ea(e){this._internalRoot=e}Ea.prototype.unstable_scheduleHydration=function(e){if(e){var t=we();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Ur.length&&t!==0&&t<Ur[i].priority;i++);Ur.splice(i,0,e),i===0&&Ed(e)}};function eu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Wp(){}function $y(e,t,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var U=Ca(y);p.call(U)}}var y=Fp(t,l,e,0,null,!1,!1,"",Wp);return e._reactRootContainer=y,e[Nr]=y.current,Pi(e.nodeType===8?e.parentNode:e),bs(),y}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var N=l;l=function(){var U=Ca(A);N.call(U)}}var A=Qc(e,0,!1,null,null,!1,!1,"",Wp);return e._reactRootContainer=A,e[Nr]=A.current,Pi(e.nodeType===8?e.parentNode:e),bs(function(){Na(t,A,i,l)}),A}function ja(e,t,i,l,d){var p=i._reactRootContainer;if(p){var y=p;if(typeof d=="function"){var N=d;d=function(){var A=Ca(y);N.call(A)}}Na(t,y,e,d)}else y=$y(i,t,e,d,l);return Ca(y)}b=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var i=fs(t.pendingLanes);i!==0&&(Fr(t,i|1),Cn(t,Nt()),(Ye&6)===0&&(ii=Nt()+500,Gr()))}break;case 13:bs(function(){var l=jr(e,1);if(l!==null){var d=gn();cr(l,e,1,d)}}),Zc(e,1)}},O=function(e){if(e.tag===13){var t=jr(e,134217728);if(t!==null){var i=gn();cr(t,e,134217728,i)}Zc(e,134217728)}},J=function(e){if(e.tag===13){var t=Jr(e),i=jr(e,t);if(i!==null){var l=gn();cr(i,e,t,l)}Zc(e,t)}},we=function(){return Ge},be=function(e,t){var i=Ge;try{return Ge=e,t()}finally{Ge=i}},Ft=function(e,t,i){switch(t){case"input":if(Dt(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=qo(l);if(!d)throw Error(s(90));Ne(l),Dt(l,d)}}}break;case"textarea":pe(e,i);break;case"select":t=i.value,t!=null&&ht(e,!!i.multiple,t,!1)}},bt=Vc,xt=bs;var Fy={usingClientEntryPoint:!1,Events:[$i,qs,qo,yt,qt,Vc]},Ji={findFiberByHostInstance:ms,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Uy={bundleType:Ji.bundleType,version:Ji.version,rendererPackageName:Ji.rendererPackageName,rendererConfig:Ji.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nr(e),e===null?null:e.stateNode},findFiberByHostInstance:Ji.findFiberByHostInstance||zy,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 Ra=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ra.isDisabled&&Ra.supportsFiber)try{us=Ra.inject(Uy),Ln=Ra}catch{}}return En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fy,En.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!eu(t))throw Error(s(200));return Oy(e,t,null,i)},En.createRoot=function(e,t){if(!eu(e))throw Error(s(299));var i=!1,l="",d=Bp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Qc(e,1,!1,null,null,i,!1,l,d),e[Nr]=t.current,Pi(e.nodeType===8?e.parentNode:e),new Jc(t)},En.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=nr(t),e=e===null?null:e.stateNode,e},En.flushSync=function(e){return bs(e)},En.hydrate=function(e,t,i){if(!_a(t))throw Error(s(200));return ja(null,e,t,!0,i)},En.hydrateRoot=function(e,t,i){if(!eu(e))throw Error(s(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",y=Bp;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),t=Fp(t,null,e,1,i??null,d,!1,p,y),e[Nr]=t.current,Pi(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 Ea(t)},En.render=function(e,t,i){if(!_a(t))throw Error(s(200));return ja(null,e,t,!1,i)},En.unmountComponentAtNode=function(e){if(!_a(e))throw Error(s(40));return e._reactRootContainer?(bs(function(){ja(null,null,e,!1,function(){e._reactRootContainer=null,e[Nr]=null})}),!0):!1},En.unstable_batchedUpdates=Vc,En.unstable_renderSubtreeIntoContainer=function(e,t,i,l){if(!_a(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return ja(e,t,i,!1,l)},En.version="18.3.1-next-f1338f8080-20240426",En}var Qp;function Pm(){if(Qp)return ru.exports;Qp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),ru.exports=Xy(),ru.exports}var Zp;function Qy(){if(Zp)return Aa;Zp=1;var n=Pm();return Aa.createRoot=n.createRoot,Aa.hydrateRoot=n.hydrateRoot,Aa}var Zy=Qy();const Jy=Lm(Zy),Jp=n=>{let r;const s=new Set,o=(m,v)=>{const k=typeof m=="function"?m(r):m;if(!Object.is(k,r)){const x=r;r=v??(typeof k!="object"||k===null)?k:Object.assign({},r,k),s.forEach(S=>S(r,x))}},a=()=>r,h={setState:o,getState:a,getInitialState:()=>g,subscribe:m=>(s.add(m),()=>s.delete(m))},g=r=n(o,a,h);return h},ex=(n=>n?Jp(n):Jp),tx=n=>n;function nx(n,r=tx){const s=st.useSyncExternalStore(n.subscribe,st.useCallback(()=>r(n.getState()),[n,r]),st.useCallback(()=>r(n.getInitialState()),[n,r]));return st.useDebugValue(s),s}const rx=n=>{const r=ex(n),s=o=>nx(r,o);return Object.assign(s,r),s},sx=(n=>rx),Om="agentpane:machines",zm="agentpane:active-machine";function ix(n){return/^[a-z][a-z0-9-]{1,30}$/.test(n)}function $m(n){return`${n}.repoburg.com`}function Fm(n){const r=/^([a-z][a-z0-9-]{1,30})\.repoburg\.com$/.exec(n);return r?r[1]:null}function Um(n,r){try{const s=localStorage.getItem(n);return s==null?r:JSON.parse(s)}catch{return r}}function Bm(n,r){try{localStorage.setItem(n,JSON.stringify(r))}catch{}}function Wm(){return Um(Om,[]).filter(r=>ix(r.mahlas)&&r.hostname===$m(r.mahlas))}function ox(n){const r={mahlas:n,hostname:$m(n),lastConnectedAt:new Date().toISOString()},s=Wm(),o=[r,...s.filter(a=>a.mahlas!==n)];return Bm(Om,o),r}function ax(){const n=Um(zm,null);return n?Wm().find(r=>r.mahlas===n)??null:null}function lx(n){Bm(zm,n)}function cx(){if(typeof window>"u")return;const n=new URLSearchParams(window.location.search).get("host");if(!n)return;const r=Fm(n);r&&(ox(r),lx(r))}const eh="http://localhost:9998",ux=["agent.repoburg.com"];function dn(){if(typeof window>"u")return"";const n=new URLSearchParams(window.location.search),r=n.get("bport");if(r)return`http://localhost:${r}`;const s=n.get("host");if(s)return`https://${s}`;const o=window.location.hostname;if(ux.includes(o))return eh;if(Fm(o))return"";const a=ax();return a?`https://${a.hostname}`:o==="localhost"||o==="127.0.0.1"||o==="0.0.0.0"?"":eh}const dx="/api";async function ko(n,r,s){const o=await fetch(`${dn()}${dx}${r}`,{method:n,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!o.ok){let a=`${o.status} ${o.statusText}`;try{const u=await o.json();u!=null&&u.error&&(a=`${a} — ${u.error}`)}catch{}throw new Error(`${n} ${r} failed: ${a}`)}return o.json()}function yn(n){return ko("GET",n)}function pt(n,r){return ko("POST",n,r)}function pl(n){return ko("DELETE",n)}function Sr(n,r){return ko("PATCH",n,r)}function fx(n,r){return ko("PUT",n,r)}function px(){return yn("/sessions")}function to(n){return yn(`/sessions/${n}`)}function Ku(n){return pt("/sessions",n)}function th(n){return pl(`/sessions/${n}`)}function Hm(n,r,s,o){return pt(`/sessions/${n}/turns`,{user_prompt:r,...s!=null&&s.length?{attachments:s}:{},...o!=null&&o.originAppId?{origin_app_id:o.originAppId}:{}})}function hx(n){return pt(`/sessions/${n}/cancel`)}function mx(n,r){return pt(`/sessions/${n}/turns/${r}/resume`)}function gx(n,r){return Sr(`/sessions/${n}`,{title:r})}function nh(n){return Sr(`/sessions/${n}`,{lifecycle:"finished"})}function rh(n){return Sr(`/sessions/${n}`,{lifecycle:"working"})}function vx(n,r){return Sr(`/sessions/${n}`,{starred:r})}function sh(n){return Sr(`/sessions/${n}`,{has_unreviewed:0})}function yx(n,r,s,o){const a={model:r,model_reasoning_effort:s};return o!==void 0&&(a.runtime_type=o),Sr(`/sessions/${n}`,a)}function xx(n,r){return Sr(`/sessions/${n}`,{runtime_config:r})}function wx(n,r){return pt(`/sessions/${n}/rewind`,{turn_id:r})}function kx(n){return pt(`/sessions/${n}/restore`,{})}function Sx(n,r,s){return pt(`/sessions/${n}/branch`,{turn_id:r,title:s})}function Vm(){return yn("/workspaces")}function bx(n,r){return pt("/workspaces",{path:n,label:r})}function Tx(n){return pt("/workspaces/hide",{path:n})}async function Nx(){const n=await fetch(`${dn()}/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 qm(){return yn("/folders")}function Cx(n,r){return pt("/folders",{workspace_path:n,name:r})}function ih(n,r){return Sr(`/folders/${n}`,r)}function Ex(n){return pl(`/folders/${n}`)}function _x(n){return pt("/sessions/reorder",{moves:n})}function as(n){return n.status==="pending"||n.status==="running"}function Gm(n){return!!(n!=null&&n.turns.some(as))}function hl(n){return n?n.turns.some(as)||(n.threads??[]).some(r=>(r.turns??[]).some(as)):!1}const Km=1;function Ym(){let n="";try{n=dn()}catch{}return`agentpane:tabs:${n||window.location.origin}`}function oh(n){return Array.isArray(n)&&n.every(r=>typeof r=="string")}function ah(n){return n===null||typeof n=="string"}function jx(n){if(n==null)return null;let r;try{r=JSON.parse(n)}catch{return null}if(typeof r!="object"||r===null)return null;const s=r;return s.v!==Km||!oh(s.openTabs)||!ah(s.activeSessionId)||!oh(s.openAppTabs)||!ah(s.activeAppTabId)?null:{openTabs:s.openTabs,activeSessionId:s.activeSessionId,openAppTabs:s.openAppTabs,activeAppTabId:s.activeAppTabId}}const Xm=[()=>window.sessionStorage,()=>window.localStorage];function Rx(){const n=Ym();for(const r of Xm)try{const s=jx(r().getItem(n));if(s)return s}catch{}return null}function Ax(n){const r=Ym(),s=JSON.stringify({v:Km,openTabs:n.openTabs,activeSessionId:n.activeSessionId,openAppTabs:n.openAppTabs,activeAppTabId:n.activeAppTabId});for(const o of Xm)try{o().setItem(r,s)}catch{}}function Ix(n){return n.subscribe((r,s)=>{(r.openTabs!==s.openTabs||r.activeSessionId!==s.activeSessionId||r.openAppTabs!==s.openAppTabs||r.activeAppTabId!==s.activeAppTabId)&&Ax(r)})}function Va(n){return[...new Set(n)]}function Dx(n,r,s,o){const a=m=>s===null||s.has(m),u=Va(((n==null?void 0:n.openTabs)??[]).filter(m=>r.has(m))),f=Va(((n==null?void 0:n.openAppTabs)??[]).filter(a));let h=(n==null?void 0:n.activeSessionId)??null;h!==null&&!r.has(h)&&(h=null),h!==null&&!u.includes(h)&&u.push(h),h??(h=u.at(-1)??null);let g=(n==null?void 0:n.activeAppTabId)??null;return g!==null&&!a(g)&&(g=null),g!==null&&!f.includes(g)&&f.push(g),o!==null&&r.has(o)&&(u.includes(o)||u.push(o),h=o,g=null),{openTabs:u,activeSessionId:h,openAppTabs:f,activeAppTabId:g}}function Mx(){const n=new URLSearchParams(window.location.search);return{session:n.get("session"),thread:n.get("thread")}}function Lx(){const n=new URL(window.location.href);!n.searchParams.has("session")&&!n.searchParams.has("thread")||(n.searchParams.delete("session"),n.searchParams.delete("thread"),window.history.replaceState(window.history.state,"",n))}let ou=0;function lh(n){return n==="sidecar"?"sidecar":"turns"}async function Px(n,r){const s=await Promise.allSettled(n.map(u=>r(u))),o=new Map;let a=null;return s.forEach((u,f)=>{var h;u.status==="fulfilled"?o.set(n[f],u.value):a===null&&(a=((h=u.reason)==null?void 0:h.message)??"Request failed")}),{updated:o,firstError:a}}function ch(n,r){const s={...n.sessionDetails};r.forEach(h=>delete s[h]);const o={...n.backgroundTasks};r.forEach(h=>delete o[h]);const a=n.openTabs.filter(h=>!r.has(h));let u=n.activeSessionId,f=n.activeTurnIndex;if(u&&r.has(u)){u=a.length>0?a[a.length-1]:null;const h=u?s[u]:null;f=h&&h.turns.length>0?h.turns.length-1:0}return{sessions:n.sessions.filter(h=>!r.has(h.id)),sessionDetails:s,backgroundTasks:o,openTabs:a,activeSessionId:u,activeTurnIndex:f}}function Ox(n){const r={...n};return delete r.turns,delete r.threads,delete r.contextUsage,r}async function uh(n,r,s,o,a){if(s.length===0)return;n({error:null});const{updated:u,firstError:f}=await Px(s,o);u.size>0&&n(g=>({sessions:g.sessions.map(m=>u.get(m.id)??m)}));const h=s.length-u.size;if(h===0)r().addToast("info",`${s.length} session${s.length===1?"":"s"} ${a}`);else{n({error:f});const g=a[0].toUpperCase()+a.slice(1);r().addToast(h===s.length?"error":"warn",`${g} ${u.size} of ${s.length} — ${h} failed`)}}const zx=(n,r)=>({sessions:[],sessionDetails:{},activeSessionId:null,openTabs:[],activeTurnIndex:0,submittingPrompt:null,quotedText:null,init:async()=>{const s=Mx(),o=Rx();try{const a=localStorage.getItem("agentpane:last-model-config");a&&n({lastModelConfig:JSON.parse(a)})}catch{}n({loading:!0,error:null});try{const a=r().loadApps(),[u,f,h]=await Promise.all([px(),Vm(),qm()]);n({sessions:u,workspaces:f,folders:h,loading:!1}),Lx();const g=await a,m=Dx(o,new Set(u.map(v=>v.id)),g?new Set(r().apps.map(v=>v.id)):null,s.session);n(v=>{const k=v.activeSessionId!==null||v.activeAppTabId!==null;return{openTabs:Va([...m.openTabs,...v.openTabs]),openAppTabs:Va([...m.openAppTabs,...v.openAppTabs]),activeAppTabId:k?v.activeAppTabId:m.activeAppTabId}}),m.activeSessionId&&!r().activeSessionId&&await r().selectSession(m.activeSessionId,{keepAppView:!0}),s.thread&&(n({deepLinkThreadId:s.thread}),r().switchRightTab("threads"))}catch(a){n({loading:!1,error:a.message})}},selectSession:async(s,o)=>{const a=++ou,u=o!=null&&o.keepAppView?{}:{activeAppTabId:null},f=h=>h.includes(s)?h:[...h,s];if(r().sessionDetails[s]){const h=r().sessionDetails[s];n({activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:lh(r().activeRightTab),...u,openTabs:f(r().openTabs)}),h.has_unreviewed===1&&(sh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})));return}n({loading:!0,error:null});try{const h=await to(s);if(a!==ou){n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},openTabs:f(g.openTabs),loading:!1}));return}n(g=>({sessionDetails:{...g.sessionDetails,[s]:h},activeSessionId:s,activeTurnIndex:h.turns.length>0?h.turns.length-1:0,activeRightTab:lh(g.activeRightTab),...u,openTabs:f(g.openTabs),loading:!1})),h.has_unreviewed===1&&(sh(s).catch(()=>{}),n(g=>({sessions:g.sessions.map(m=>m.id===s?{...m,has_unreviewed:0}:m),sessionDetails:{...g.sessionDetails,[s]:{...h,has_unreviewed:0}}})))}catch(h){n(a===ou?{loading:!1,error:h.message}:{loading:!1})}},closeTab:s=>{n(o=>{const a=o.openTabs.filter(u=>u!==s);if(o.activeSessionId===s&&a.length>0){const u=a[a.length-1],f=o.sessionDetails[u];return{openTabs:a,activeSessionId:u,activeTurnIndex:f&&f.turns.length>0?f.turns.length-1:0}}return{openTabs:a,activeSessionId:o.activeSessionId===s?null:o.activeSessionId}})},updateModelConfig:async(s,o,a)=>{const u=r().activeSessionId;if(u){n({error:null});try{const f=await yx(u,s,o,a),h={provider:f.runtime_type,model:f.model??"",reasoning:f.model_reasoning_effort??""};n({lastModelConfig:h}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(h)),n(g=>({sessions:g.sessions.map(m=>m.id===u?f:m),sessionDetails:g.sessionDetails[u]?{...g.sessionDetails,[u]:{...g.sessionDetails[u],model:f.model,model_reasoning_effort:f.model_reasoning_effort,external_thread_id:f.external_thread_id}}:g.sessionDetails})),await r().refreshActiveSession()}catch(f){n({error:f.message}),r().addToast("error",`Failed to update model — ${f.message}`)}}},createSession:async s=>{n({error:null});try{const o=await Ku(s);n(u=>({sessions:[o,...u.sessions],showNewSessionDialog:!1}));const a={provider:o.runtime_type,model:o.model??"",reasoning:o.model_reasoning_effort??""};n({lastModelConfig:a}),localStorage.setItem("agentpane:last-model-config",JSON.stringify(a)),await r().selectSession(o.id),r().addLogEntry("INFO",`Session created — ${o.id.slice(0,8)}`),r().addToast("success",`Session created — ${o.title||o.id.slice(0,8)}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},addSession:s=>{n(o=>({sessions:o.sessions.some(a=>a.id===s.id)?o.sessions:[s,...o.sessions]}))},revealSession:async s=>{let o=r().sessionDetails[s];if(!o){const a=await to(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a}})),o=a}r().sessions.some(a=>a.id===s)||r().addSession(Ox(o)),await r().selectSession(s)},deleteSession:async s=>{var a;n({error:null});const o=(a=r().sessions.find(u=>u.id===s))==null?void 0:a.title;try{await th(s),n(u=>ch(u,new Set([s]))),r().addLogEntry("INFO",`Session deleted — ${s.slice(0,8)}`),r().addToast("info",`Session "${o||s.slice(0,8)}" deleted`)}catch(u){n({error:u.message}),r().addToast("error",`Failed to delete session — ${u.message}`)}},renameSession:async(s,o)=>{n({error:null});try{const a=await gx(s,o.trim());n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],title:a.title}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to rename session — ${a.message}`)}},markFinished:async s=>{n({error:null});try{const o=await nh(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session marked as finished")}catch(o){n({error:o.message}),r().addToast("error",`Failed to mark as finished — ${o.message}`)}},markFinishedMany:async s=>{await uh(n,r,s,nh,"marked as finished")},toggleStar:async s=>{const o=r().sessions.find(a=>a.id===s);if(o){n({error:null});try{const a=await vx(s,o.starred?0:1);n(u=>({sessions:u.sessions.map(f=>f.id===s?a:f),sessionDetails:u.sessionDetails[s]?{...u.sessionDetails,[s]:{...u.sessionDetails[s],starred:a.starred}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to star session — ${a.message}`)}}},reopenSession:async s=>{n({error:null});try{const o=await rh(s);n(a=>({sessions:a.sessions.map(u=>u.id===s?o:u)})),r().addToast("info","Session reopened")}catch(o){n({error:o.message}),r().addToast("error",`Failed to reopen session — ${o.message}`)}},reopenSessionMany:async s=>{await uh(n,r,s,rh,"reopened")},deleteSessionMany:async s=>{if(s.length===0)return;n({error:null});const o=await Promise.allSettled(s.map(f=>th(f))),a=new Set;if(o.forEach((f,h)=>{f.status==="fulfilled"&&a.add(s[h])}),a.size===0){n({error:"Failed to delete sessions"}),r().addToast("error","Failed to delete sessions");return}n(f=>ch(f,a)),r().addLogEntry("INFO",`${a.size} session${a.size===1?"":"s"} deleted`);const u=s.length-a.size;u===0?r().addToast("info",`${a.size} session${a.size===1?"":"s"} deleted`):(n({error:"One or more sessions failed to delete"}),r().addToast("warn",`Deleted ${a.size} of ${s.length} — ${u} failed`))},submitPrompt:async(s,o)=>{const a=r().activeSessionId;if(a){n({error:null,submittingPrompt:s}),n(u=>{const f=u.sessionDetails[a];return f?{sessionDetails:{...u.sessionDetails,[a]:{...f,is_running:1,status:"running"}},sessions:u.sessions.map(h=>h.id===a?{...h,is_running:1,status:"running"}:h)}:{}});try{const u=await Hm(a,s,o);r().addLogEntry("INFO",`Turn submitted — "${s.slice(0,40)}"`),n(f=>{const h=f.sessionDetails[a];if(!h)return{submittingPrompt:null};const g=h.turns.findIndex(v=>v.id===u.id);if(g>=0)return{submittingPrompt:null,activeTurnIndex:g};const m={...u,items:[]};return{submittingPrompt:null,sessionDetails:{...f.sessionDetails,[a]:{...h,turns:[...h.turns,m]}},activeTurnIndex:h.turns.length}})}catch(u){n({submittingPrompt:null,error:u.message}),r().addLogEntry("ERROR",`Turn failed — ${u.message}`),r().addToast("error",`Failed to send prompt — ${u.message}`),n(f=>{const h=f.sessionDetails[a];if(!h)return{};const g=hl(h)?1:0;return{sessionDetails:{...f.sessionDetails,[a]:{...h,is_running:g,status:g?"running":"active"}},sessions:f.sessions.map(m=>m.id===a?{...m,is_running:g,status:g?"running":"active"}:m)}})}}},cancelTurn:async()=>{const s=r().activeSessionId;if(s)try{await hx(s)}catch(o){n({error:o.message})}},rewindToTurn:async(s,o)=>{n({error:null});try{const a=await wx(s,o),u=await to(s);n(f=>({sessionDetails:{...f.sessionDetails,[s]:u},sessions:f.sessions.map(h=>h.id===s?{...h,external_thread_id:a.external_thread_id,is_running:0,status:"active"}:h),activeTurnIndex:u.turns.length>0?u.turns.length-1:0})),r().addToast("info","Rewound to selected turn")}catch(a){n({error:a.message}),r().addToast("error",`Failed to rewind — ${a.message}`)}},restoreSession:async s=>{n({error:null});try{const o=await kx(s),a=await to(s);n(u=>({sessionDetails:{...u.sessionDetails,[s]:a},sessions:u.sessions.map(f=>f.id===s?{...f,external_thread_id:o.external_thread_id,is_running:0,status:"active"}:f),activeTurnIndex:a.turns.length>0?a.turns.length-1:0})),r().addToast("info","Restored rewound session")}catch(o){n({error:o.message}),r().addToast("error",`Failed to restore — ${o.message}`)}},branchFromTurn:async(s,o,a)=>{n({error:null});try{const u=await Sx(s,o,a);n(f=>({sessions:[u,...f.sessions]})),await r().selectSession(u.id),r().addToast("success","Branched from selected turn")}catch(u){n({error:u.message}),r().addToast("error",`Failed to branch — ${u.message}`)}},updateRuntimeConfig:async s=>{const o=r().activeSessionId;if(o){n({error:null});try{const a=await xx(o,JSON.stringify(s));n(u=>({sessions:u.sessions.map(f=>f.id===o?a:f),sessionDetails:u.sessionDetails[o]?{...u.sessionDetails,[o]:{...u.sessionDetails[o],runtime_config:a.runtime_config}}:u.sessionDetails}))}catch(a){n({error:a.message}),r().addToast("error",`Failed to update config — ${a.message}`)}}},refreshActiveSession:async()=>{const s=r().activeSessionId;if(s)try{const o=await to(s);n(a=>({sessionDetails:{...a.sessionDetails,[s]:o},activeTurnIndex:o.turns.length>0?Math.min(a.activeTurnIndex,o.turns.length-1):0,sessions:a.sessions.map(u=>u.id===s?{...u,is_running:o.is_running,status:o.status}:u)}))}catch(o){n({error:o.message})}}}),$x=(n,r)=>({workspaces:[],addWorkspace:async s=>{n({error:null});try{const o=await bx(s.trim());n(a=>({workspaces:[...a.workspaces,o]})),r().addToast("success",`Workspace added — ${o.path}`)}catch(o){r().addToast("error",`Failed to add workspace — ${o.message}`)}},removeWorkspace:async s=>{n({error:null});try{await Tx(s);const o=await Vm();n({workspaces:o}),r().addToast("info","Workspace hidden")}catch(o){r().addToast("error",`Failed to hide workspace — ${o.message}`)}},createSessionInWorkspace:async s=>{n({error:null});try{const o=r().lastModelConfig,a=await Ku({cwd:s,runtime_type:(o==null?void 0:o.provider)??"codex",model:o==null?void 0:o.model,model_reasoning_effort:o==null?void 0:o.reasoning});n(u=>({sessions:[a,...u.sessions]})),await r().selectSession(a.id),r().addLogEntry("INFO",`Session created in ${s} — ${a.id.slice(0,8)}`),r().addToast("success",`Session created in ${s.split("/").pop()||s}`)}catch(o){n({error:o.message}),r().addToast("error",`Failed to create session — ${o.message}`)}},pickAndAddWorkspace:async()=>{try{const s=await Nx();if(s.cancelled||!s.path)return;await r().addWorkspace(s.path)}catch(s){r().addToast("error",`Failed to pick directory — ${s.message}`)}}}),Is=new Map,Yu=new Map,Xu=new Map,Qu=new Map;function Fx(n,r){Is.set(n,r)}function Ux(n){Is.delete(n)}function au(n,r){Yu.set(n,r)}function dh(n,r,s){const o=Yu.get(n);if(!o)return;const a=Is.get(o);a&&a({source:"agentpane-host",event:r,payload:s})}function Bx(n,r,s,o){const a=Is.get(n);a&&a({source:"agentpane-host",event:"tool_call",payload:{callId:r,tool:s,name:s,args:o}})}function Wx(n,r,s,o){const a=Yu.get(n);if(!a)return;const u=Is.get(a);u&&u({source:"agentpane-host",event:"turn:delta",payload:{sessionId:n,turnId:r,itemId:s,delta:o}})}function Hx(n,r){Xu.set(n,r)}function Vx(n){Xu.delete(n)}function qx(n,r){Qu.set(n,r)}function Gx(n){Qu.delete(n)}function Kx(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"state_changed",payload:{}}),(s=Qu.get(n))==null||s()}function Yx(n){var s;const r=Is.get(n);r&&r({source:"agentpane-host",event:"source:updated",payload:{}}),(s=Xu.get(n))==null||s()}const Xx=(n,r)=>({wsConnected:!1,backgroundTasks:{},retryStates:{},setWsConnected:s=>n({wsConnected:s}),onTurnCreated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return!u||o.thread_id?{}:u.turns.some(f=>f.id===o.id)?{}:{sessionDetails:{...a.sessionDetails,[s]:{...u,turns:[...u.turns,{...o,items:[]}]}}}})},onTurnStarted:(s,o)=>{r().addLogEntry("DEBUG",`turn:started — ${o.slice(0,8)}`),n(a=>{const u=_s(a.sessions,s,()=>({is_running:1,status:"running"})),f=a.sessionDetails[s];if(!f)return{sessions:u};const h=f.turns.findIndex(g=>g.id===o);return{sessionDetails:{...a.sessionDetails,[s]:{...Qn(f,o,g=>({...g,status:"running"})),is_running:1,status:"running"}},sessions:u,activeTurnIndex:a.activeSessionId===s&&h>=0?h:a.activeTurnIndex}})},onItemStarted:(s,o,a)=>{r().addLogEntry("DEBUG",`item:started — ${a.type}`),n(u=>{const f=fh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:Qn(h,o,g=>cu(g,a))},retryStates:f}:{retryStates:f}})},onItemUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Qn(f,o,h=>cu(h,a))}}:{}})},onItemCompleted:(s,o,a)=>{if(r().addLogEntry("DEBUG",`item:completed — ${a.type}`),a.type==="background_task"&&(a.status==="completed"||a.status==="failed")){const u=a.data||{},f=u.task_type||"unknown",h=u.description||"background task",m=f==="local_agent"?"Subagent":f==="local_bash"?"Monitor":"Task";a.status==="completed"?r().addToast("success",`${m} completed: ${h}`):r().addToast("error",`${m} failed: ${h}`)}n(u=>{const f=fh(a)?Es(u.retryStates,o):u.retryStates,h=u.sessionDetails[s];return h?{retryStates:f,sessionDetails:{...u.sessionDetails,[s]:Qn(h,o,g=>{var v,k;let m=cu(g,a);if(a.type==="agent_message"&&((v=a.data)!=null&&v.text)&&(m={...m,agent_response:a.data.text}),a.type==="reasoning"&&((k=a.data)!=null&&k.text)){const x=m.thoughts?m.thoughts+`
|
|
41
|
+
`+a.data.text:a.data.text;m={...m,thoughts:x}}return m})}}:{retryStates:f}})},onItemDelta:(s,o,a,u)=>{Wx(s,o,a,u),n(f=>{const h=Es(f.retryStates,o),g=f.sessionDetails[s];return g?{sessionDetails:{...f.sessionDetails,[s]:Qn(g,o,m=>Zx(m,a,u))},retryStates:h}:{retryStates:h}})},onTurnCompleted:(s,o,a,u,f)=>{const h=(a==null?void 0:a.input_tokens)??0,g=(a==null?void 0:a.output_tokens)??0;r().addLogEntry("INFO",`turn:completed — ${h} in / ${g} out`),dh(s,"turn:completed",{turnId:o,response:f??null}),r().refreshApps(),n(m=>{const v=m.sessionDetails[s],k=v?Qn(v,o,T=>({...T,status:"completed",token_usage:a??T.token_usage??null,...f&&!T.agent_response?{agent_response:f}:{}})):null,x=lu(k),S=x&&k?Ia(k):"active",E=_s(m.sessions,s,T=>({is_running:x,status:S,has_unreviewed:u?1:T.has_unreviewed})),C=Es(m.retryStates,o);return k?{sessionDetails:{...m.sessionDetails,[s]:{...k,is_running:x,status:S,has_unreviewed:u?1:k.has_unreviewed}},sessions:E,retryStates:C}:{sessions:E,retryStates:C}})},onTokenUsageUpdated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:Qn(f,o,h=>({...h,token_usage:a}))}}:{}})},onContextUsageUpdated:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,contextUsage:o}}}:{}})},onTurnFailed:(s,o,a,u)=>{r().addLogEntry("ERROR",`turn:failed — ${a}`),r().addToast("error",`Turn failed — ${a}`),dh(s,"turn:failed",{turnId:o,error:a}),n(f=>{const h=f.sessionDetails[s],g=a.includes("cancelled")||a.includes("aborted"),m=g?"aborted":"failed",v=h?Qn(h,o,C=>({...C,status:m,error:a,...u?{resume_state:u}:{},items:C.items.map(T=>T.status==="in_progress"?{...T,status:"failed"}:T)})):null,k=lu(v),x=k&&v?Ia(v):g?"active":"failed",S=_s(f.sessions,s,()=>({is_running:k,status:x})),E=Es(f.retryStates,o);return v?{sessionDetails:{...f.sessionDetails,[s]:{...v,is_running:k,status:x}},sessions:S,retryStates:E}:{sessions:S,retryStates:E}})},onTurnCancelled:(s,o)=>{n(a=>{const u=a.sessionDetails[s],f=u?Qn(u,o,k=>({...k,status:"aborted",...k.resume_state==="waiting"||k.resume_state==="resuming"?{resume_state:"cancelled"}:{},items:k.items.map(x=>x.status==="in_progress"?{...x,status:"completed"}:x)})):null,h=lu(f),g=h&&f?Ia(f):"active",m=_s(a.sessions,s,()=>({is_running:h,status:g})),v=Es(a.retryStates,o);return f?{sessionDetails:{...a.sessionDetails,[s]:{...f,is_running:h,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnInterrupted:(s,o,a)=>{r().addLogEntry("WARN",`turn:interrupted — ${a.reason}${a.detail?` (${a.detail})`:""}`),r().addToast("warn",Qx(a.reason)),n(u=>{const f=u.sessionDetails[s],h=f?Qn(f,o,k=>({...k,status:"pending",error:null,resume_state:"waiting",interrupt_reason:a.reason,interrupted_at:a.interruptedAt,resume_attempts:a.attempts})):null,g=h?Ia(h):"interrupted",m=_s(u.sessions,s,()=>({is_running:1,status:g})),v=Es(u.retryStates,o);return h?{sessionDetails:{...u.sessionDetails,[s]:{...h,is_running:1,status:g}},sessions:m,retryStates:v}:{sessions:m,retryStates:v}})},onTurnResuming:(s,o,a)=>{r().addLogEntry("INFO",`turn:resuming — ${o.slice(0,8)} (attempt ${a})`),n(u=>{const f=_s(u.sessions,s,()=>({is_running:1,status:"running"})),h=u.sessionDetails[s];return h?{sessionDetails:{...u.sessionDetails,[s]:{...Qn(h,o,g=>({...g,status:"running",error:null,resume_state:"resuming",resume_attempts:a})),is_running:1,status:"running"}},sessions:f}:{sessions:f}})},onTurnResumed:(s,o)=>{r().addLogEntry("INFO",`turn:resumed — ${o.slice(0,8)}`),r().addToast("success","Interrupted turn resumed"),n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:Qn(u,o,f=>({...f,resume_state:"resumed"}))}}:{}})},onTurnRetrying:(s,o,a)=>{r().addLogEntry("WARN",`turn:retrying — ${s.slice(0,8)}/${o.slice(0,8)} attempt ${a.attempt}/${a.maxRetries} (${a.errorStatus??"no response"}${a.error?`, ${a.error}`:""})`),n(u=>({retryStates:{...u.retryStates,[o]:a}}))},onSessionTitle:(s,o)=>{n(a=>({sessions:a.sessions.map(u=>u.id===s?{...u,title:o}:u),sessionDetails:a.sessionDetails[s]?{...a.sessionDetails,[s]:{...a.sessionDetails[s],title:o}}:a.sessionDetails}))},onSessionTouched:s=>{n(o=>{const a=o.sessionDetails[s];return{sessions:_s(o.sessions,s,()=>({user_touched:1})),sessionDetails:a?{...o.sessionDetails,[s]:{...a,user_touched:1}}:o.sessionDetails}})},onBackgroundTasksChanged:(s,o)=>{n(a=>{if(o.length===0&&!a.backgroundTasks[s])return{};const u={...a.backgroundTasks};return o.length>0?u[s]=o:delete u[s],{backgroundTasks:u}})},onBackgroundTasksSnapshot:s=>{const o={};for(const[a,u]of Object.entries(s))u.length>0&&(o[a]=u);n({backgroundTasks:o})}});function Qx(n){switch(n){case"network":return"Network error — the turn will resume when the connection is back";case"process_exit":return"The agent process stopped — resuming the turn";default:return"The agent host restarted — resuming the turn"}}function Ia(n){const r=[...n.turns,...(n.threads??[]).flatMap(s=>s.turns??[])].filter(as);return r.length>0&&r.every(s=>s.status==="pending"&&s.resume_state==="waiting")?"interrupted":"running"}function fh(n){return n.type!=="background_task"&&n.type!=="error"&&n.type!=="interruption"}function Es(n,r){if(!(r in n))return n;const s={...n};return delete s[r],s}function lu(n){return n&&(n.turns.some(as)||(n.threads??[]).some(s=>(s.turns??[]).some(as)))?1:0}function _s(n,r,s){return n.some(o=>o.id===r)?n.map(o=>o.id===r?{...o,...s(o)}:o):n}function Qn(n,r,s){const o=(n.threads??[]).map(a=>(a.turns??[]).some(u=>u.id===r)?{...a,turns:(a.turns??[]).map(u=>u.id===r?s(u):u)}:a);return{...n,turns:n.turns.map(a=>a.id===r?s(a):a),threads:o}}function cu(n,r){const s=n.items.findIndex(o=>o.external_item_id===r.external_item_id);if(s>=0){const o=[...n.items];return o[s]=r,{...n,items:o}}if(r.type==="agent_message"){const o=n.items.filter(a=>!(a.type==="agent_message"&&a.id.startsWith("delta-")));return{...n,items:[...o,r]}}return{...n,items:[...n.items,r]}}function Zx(n,r,s){var u;const o=n.items.findIndex(f=>f.external_item_id===r);if(o>=0){const f=n.items[o],g=(((u=f.data)==null?void 0:u.text)??"")+s,m=[...n.items];return m[o]={...f,data:{...f.data,text:g}},{...n,items:m,agent_response:g}}const a={id:`delta-${r}`,turn_id:n.id,external_item_id:r,type:"agent_message",data:{text:s},status:"in_progress",created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return{...n,items:[...n.items,a],agent_response:s}}function Jx(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return yn(`/providers/${n}/models${s}`)}const e0="https://github.com/celalertug/repoburg-mac-app-release/releases/latest/download/repoburg-mac-app.zip",t0=2e3,Qm="agentpane:daemon-seen";function n0(n=dn()){if(!n)return!1;try{const r=new URL(n);return r.protocol==="http:"&&(r.hostname==="localhost"||r.hostname==="127.0.0.1")}catch{return!1}}async function r0(n=dn()){try{return await fetch(`${n}/health`,{mode:"no-cors",cache:"no-store"}),!0}catch{return!1}}function s0(){try{return localStorage.getItem(Qm)==="true"}catch{return!1}}function i0(){try{localStorage.setItem(Qm,"true")}catch{}}function o0(n){let r=!1,s=!1,o=!1,a=null;function u(){a!==null&&(clearTimeout(a),a=null)}async function f(){if(r||s)return;u(),s=!0;const m=await r0();if(s=!1,!r){if(m){i0(),g(),n.onReady();return}o||(o=!0,n.onMissing()),a=setTimeout(()=>void f(),t0)}}function h(){document.visibilityState==="visible"&&f()}function g(){r=!0,u(),window.removeEventListener("focus",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("focus",h),document.addEventListener("visibilitychange",h),f(),g}const Eu=160,_u=480,a0=240,qa=220,l0=300,c0=600,u0=36;function Ga(){return typeof window>"u"?c0:Math.max(qa,Math.round(window.innerWidth*.7))}const ph="agentpane:sidebar-width",hh="agentpane:right-panel-width",uu="agentpane:right-panel-collapsed";function mh(n,r,s,o){try{const a=localStorage.getItem(n);if(a==null)return o;const u=Number(a);return Number.isFinite(u)?Math.min(s,Math.max(r,u)):o}catch{return o}}function d0(n){try{return localStorage.getItem(n)==="true"}catch{return!1}}function gh(n,r){try{localStorage.setItem(n,String(r))}catch{}}const vh=200,f0=(n,r)=>({activeRightTab:"turns",eventLog:[],loading:!1,error:null,showNewSessionDialog:!1,showRemoteModal:!1,toasts:[],showCommandPalette:!1,lastModelConfig:null,models:[],modelsLoading:!1,showModelSelector:!1,sidebarWidth:mh(ph,Eu,_u,a0),rightPanelWidth:mh(hh,qa,Ga(),l0),rightPanelCollapsed:d0(uu),deepLinkThreadId:null,vscodeViewOpen:!1,vscodeState:"stopped",vscodeId:null,vscodeToken:null,daemonStatus:n0()?"checking":"ready",setActiveTurnIndex:s=>n({activeTurnIndex:s}),switchRightTab:s=>{r().rightPanelCollapsed&&gh(uu,!1),n({activeRightTab:s,rightPanelCollapsed:!1})},setShowNewSessionDialog:s=>n({showNewSessionDialog:s}),setShowRemoteModal:s=>n({showRemoteModal:s}),setShowCommandPalette:s=>n({showCommandPalette:s}),setShowModelSelector:s=>n({showModelSelector:s}),setDeepLinkThreadId:s=>n({deepLinkThreadId:s}),setSidebarWidth:s=>{const o=Math.min(_u,Math.max(Eu,Math.round(s)));n({sidebarWidth:o});try{localStorage.setItem(ph,String(o))}catch{}},setRightPanelWidth:s=>{const o=Math.min(Ga(),Math.max(qa,Math.round(s)));n({rightPanelWidth:o});try{localStorage.setItem(hh,String(o))}catch{}},setRightPanelCollapsed:s=>{n({rightPanelCollapsed:s}),gh(uu,s)},toggleRightPanel:()=>r().setRightPanelCollapsed(!r().rightPanelCollapsed),toggleVscodeView:()=>{if(r().vscodeViewOpen){n({vscodeViewOpen:!1});return}n({vscodeViewOpen:!0,vscodeState:"starting",vscodeId:null,vscodeToken:null})},setVscodeView:(s,o,a)=>n({vscodeState:s,vscodeId:o,vscodeToken:a}),setDaemonStatus:s=>n({daemonStatus:s}),addToast:(s,o,a,u)=>{const f=Math.random().toString(36).slice(2,9);n(h=>({toasts:[...h.toasts,{id:f,type:s,message:o,undoAction:a,undoLabel:u}]}))},removeToast:s=>{n(o=>({toasts:o.toasts.filter(a=>a.id!==s)}))},addLogEntry:(s,o)=>{const a=new Date().toLocaleTimeString("en-GB",{hour12:!1});n(u=>{const f=[...u.eventLog,{time:a,level:s,message:o}];return f.length>vh&&f.splice(0,f.length-vh),{eventLog:f}})},loadModels:async(s,o)=>{if(!r().modelsLoading){n({modelsLoading:!0,models:[]});try{const a=await Jx(s,o);n({models:a,modelsLoading:!1})}catch{n({modelsLoading:!1})}}}}),p0=(n,r)=>({createThread:async(s,o)=>{try{await pt(`/sessions/${s}/threads`,o),r().addLogEntry("INFO",`Thread created — "${o.message.slice(0,40)}"`)}catch(a){r().addToast("error",`Failed to create thread — ${a.message}`)}},followupThread:async(s,o,a)=>{try{await pt(`/sessions/${s}/threads/${o}/followup`,{message:a}),r().addLogEntry("INFO",`Thread follow-up — "${a.slice(0,40)}"`)}catch(u){r().addToast("error",`Failed to send follow-up — ${u.message}`)}},cancelThreadTurn:async(s,o)=>{try{await pt(`/sessions/${s}/cancel?threadId=${encodeURIComponent(o)}`),r().addLogEntry("INFO","Thread turn cancelled")}catch(a){r().addToast("error",`Failed to cancel thread turn — ${a.message}`)}},resolveThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"resolved"})}catch(a){r().addToast("error",`Failed to resolve thread — ${a.message}`)}},reopenThread:async(s,o)=>{try{await Sr(`/sessions/${s}/threads/${o}`,{status:"open"})}catch(a){r().addToast("error",`Failed to reopen thread — ${a.message}`)}},shareThread:async(s,o,a)=>{try{const u=await pt(`/sessions/${s}/threads/${o}/summarize`,{directives:a}),f=`
|
|
42
|
+
[Shared from a resolved discussion thread — summary of its findings]
|
|
43
|
+
|
|
44
|
+
\`\`\`QUOTE
|
|
45
|
+
${u.summary}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
`;return n({quotedText:f}),r().addLogEntry("INFO",`Thread shared to main session — "${u.summary.slice(0,40)}"`),r().addToast("success","Thread summary added to your input"),!0}catch(u){return r().addToast("error",`Failed to share thread — ${u.message}`),!1}},deleteThread:async(s,o)=>{try{await pl(`/sessions/${s}/threads/${o}`)}catch(a){r().addToast("error",`Failed to delete thread — ${a.message}`)}},askSidecar:async(s,o)=>{try{return await pt(`/sessions/${s}/sidecar`,{message:o}),r().addLogEntry("INFO",`Sidecar asked — "${o.slice(0,40)}"`),!0}catch(a){return r().addToast("error",`Failed to ask the sidecar — ${a.message}`),!1}},onThreadCreated:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:[...f.threads??[],{...o,turns:[{...a,items:[]}]}]}}}:{}})},onThreadFollowup:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];return f?{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:(f.threads??[]).map(h=>h.id===o?{...h,turns:[...h.turns??[],{...a,items:[]}]}:h)}}}:{}})},onThreadResolved:(s,o,a)=>{n(u=>{const f=u.sessionDetails[s];if(!f)return{};const h=(f.threads??[]).map(g=>g.id===o?{...g,status:a,resolved_at:a==="resolved"?new Date().toISOString():null}:g);return{sessionDetails:{...u.sessionDetails,[s]:{...f,threads:h}}}})},onThreadDeleted:(s,o)=>{n(a=>{const u=a.sessionDetails[s];return u?{sessionDetails:{...a.sessionDetails,[s]:{...u,threads:(u.threads??[]).filter(f=>f.id!==o)}}}:{}})}}),h0=(n,r)=>({folders:[],loadFolders:async()=>{const s=await qm();n({folders:s})},createSidebarFolder:async(s,o)=>{try{const a=await Cx(s,o);return n(u=>({folders:[...u.folders,a]})),a}catch(a){return r().addToast("error",`Failed to create folder — ${a.message}`),null}},renameFolder:async(s,o)=>{try{const a=await ih(s,{name:o});n(u=>({folders:u.folders.map(f=>f.id===s?a:f)}))}catch(a){r().addToast("error",`Failed to rename folder — ${a.message}`)}},deleteFolder:async s=>{const o=r().folders,a=r().sessions;n(u=>({folders:u.folders.filter(f=>f.id!==s),sessions:u.sessions.map(f=>f.folder_id===s?{...f,folder_id:null}:f)}));try{await Ex(s)}catch(u){n({folders:o,sessions:a}),r().addToast("error",`Failed to delete folder — ${u.message}`)}},applyMoves:async s=>{if(s.length===0)return;const o=r().sessions,a=new Map(s.map(u=>[u.id,u]));n(u=>({sessions:u.sessions.map(f=>{const h=a.get(f.id);return h?{...f,folder_id:h.folder_id,sort_order:h.sort_order}:f})}));try{await _x(s)}catch(u){n({sessions:o}),r().addToast("error",`Failed to save session order — ${u.message}`)}},reorderFolders:async s=>{const o=r().folders,a=new Map(s.map((u,f)=>[u,f]));n(u=>({folders:u.folders.map(f=>a.has(f.id)?{...f,sort_order:a.get(f.id)}:f)}));try{await Promise.all(s.map((u,f)=>ih(u,{sort_order:f})))}catch(u){n({folders:o}),r().addToast("error",`Failed to save folder order — ${u.message}`)}}});function yh(){return yn("/apps")}function m0(){return yn("/apps/root")}function xh(n){return yn(`/apps/${n}/source`)}function wh(n,r=""){return yn(`/apps/${n}/state?workspace=${encodeURIComponent(r)}`)}function Zm(n,r,s=""){return fx(`/apps/${n}/state?workspace=${encodeURIComponent(s)}`,r)}function g0(n){return pl(`/apps/${n}`)}function v0(n){return yn(`/apps/${n}/sessions`)}function y0(){return yn("/apps/examples")}function x0(n){return pt(`/apps/examples/${n}/install`,{})}function w0(n){return pt("/apps",n)}function k0(n,r){return pt("/apps/import",{id:n,files:r})}function S0(n,r,s){return pt(`/apps/mcp/calls/${n}/result`,{result:r,error:null})}function b0(n,r){return pt(`/apps/${n}/edit-session`,r)}function T0(n,r){return pt(`/apps/${n}/files`,r)}async function N0(n,r){const s=await fetch(`${dn()}/api/apps/${n}/files/${encodeURIComponent(r)}/meta`);if(s.status===404)return null;if(!s.ok)throw new Error(`GET /apps/${n}/files/${r}/meta failed: ${s.status} ${s.statusText}`);return await s.json()}async function C0(n,r){const s=await fetch(`${dn()}/api/apps/${n}/files/${encodeURIComponent(r)}`);if(!s.ok)throw new Error(`GET /apps/${n}/files/${r} failed: ${s.status} ${s.statusText}`);return s.blob()}const Fa=new Set;async function du(n,r){Fa.add(r),await n().loadApps();const s=n().apps.find(o=>o.id===r);n().openAppTab(r),n().addToast("success",`Mini app added: ${(s==null?void 0:s.title)??r}`)}const ju="agentpane:app-workspaces";function E0(){try{const n=JSON.parse(localStorage.getItem(ju)??"{}");return n&&typeof n=="object"?n:{}}catch{return{}}}const _0=(n,r)=>({apps:[],appsRootPath:null,openAppTabs:[],activeAppTabId:null,appCatalogOpen:!1,appWorkspaces:E0(),loadApps:async()=>{try{const[s,o]=await Promise.all([yh(),m0().catch(()=>null)]);return s.forEach(a=>Fa.add(a.id)),n(o?{apps:s,appsRootPath:o.root}:{apps:s}),!0}catch{return!1}},refreshApps:async()=>{try{const s=await yh();for(const o of s)Fa.has(o.id)||(Fa.add(o.id),r().addToast("success",`New mini app discovered: ${o.title}`));n({apps:s})}catch{}},openAppTab:s=>{n(o=>({activeAppTabId:s,openAppTabs:o.openAppTabs.includes(s)?o.openAppTabs:[...o.openAppTabs,s]}))},closeAppTab:s=>{n(o=>{const a=o.openAppTabs.filter(u=>u!==s);return{openAppTabs:a,activeAppTabId:o.activeAppTabId===s?a[a.length-1]??null:o.activeAppTabId}})},setActiveAppTab:s=>n({activeAppTabId:s}),openAppCatalog:()=>n({appCatalogOpen:!0}),closeAppCatalog:()=>n({appCatalogOpen:!1}),setAppWorkspace:(s,o)=>{n(a=>{const u={...a.appWorkspaces,[s]:o};try{localStorage.setItem(ju,JSON.stringify(u))}catch{}return{appWorkspaces:u}})},installExampleApp:async s=>{try{return await x0(s),await du(r,s),!0}catch(o){return r().addToast("error",`Failed to install app — ${o.message}`),!1}},createSkeletonApp:async s=>{try{return await w0(s),await du(r,s.id),!0}catch(o){return r().addToast("error",`Failed to create app — ${o.message}`),!1}},importAppFolder:async(s,o)=>{try{return await k0(s,o),await du(r,s),!0}catch(a){return r().addToast("error",`Failed to import app — ${a.message}`),!1}},startAppEdit:async s=>{try{const o=r().lastModelConfig,a=await b0(s,{runtime_type:o==null?void 0:o.provider,model:(o==null?void 0:o.model)??null,model_reasoning_effort:(o==null?void 0:o.reasoning)??null});r().sessions.some(u=>u.id===a.id)||n(u=>({sessions:[a,...u.sessions]})),n({activeAppTabId:null}),await r().selectSession(a.id),r().addLogEntry("INFO",`App edit session opened for ${s}`)}catch(o){r().addToast("error",`Failed to open app edit session — ${o.message}`)}},toggleAppPin:async s=>{const o=r().apps.find(a=>a.id===s);if(o)try{await Zm(s,{pinned:!o.pinned}),await r().loadApps()}catch(a){r().addToast("error",`Failed to pin app — ${a.message}`)}},deleteApp:async s=>{try{await g0(s),n(o=>{const a={...o.appWorkspaces};delete a[s];try{localStorage.setItem(ju,JSON.stringify(a))}catch{}return{apps:o.apps.filter(u=>u.id!==s),openAppTabs:o.openAppTabs.filter(u=>u!==s),activeAppTabId:o.activeAppTabId===s?null:o.activeAppTabId,appWorkspaces:a}}),r().addToast("success",`Mini app deleted: ${s}`)}catch(o){r().addToast("error",`Failed to delete app — ${o.message}`)}}}),kh=3e3,Un={lagMs:100,longtaskBufferMs:50,longtaskLogMs:100,eventBufferMs:50,eventLogMs:100,keypressMs:100,wsPerSecLog:15,storePerSecLog:15,renderPerSecLog:6,frameGapMs:150},Bn=[];let Ka=0,Zu=0,Ya=0,Ju=0,Xa=0,ed=0,td=0;const go=new Map,vo=new Map;let pi=new Map,di=0,hi=new Map,fu=!1;function Qa(n,r,s){if(Bn.push({t:Date.now(),cat:n,msg:r,ms:s}),Bn.length>kh){const o=Bn.length-kh;Bn.splice(0,o),_n=Math.max(0,_n-o)}}function fi(n,r,s){Qa(n,r,s),console.log(`[perf:${n}] ${r}`)}function Jm(n){fi("note",n)}function eg(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}function j0(n,r){let s=pi.get(n);s||pi.set(n,s={n:0,bytes:0}),s.n++,s.bytes+=r;let o=go.get(n);o||go.set(n,o={n:0,bytes:0}),o.n++,o.bytes+=r}function R0(){di++,td++}function A0(n){hi.set(n,(hi.get(n)??0)+1),vo.set(n,(vo.get(n)??0)+1)}let Ua=0;function I0(){Ua=performance.now()}function D0(){const n=performance.now(),r=Ua?n-Ua:null;Ua=0,requestAnimationFrame(()=>{if(r===null)return;const s=performance.now()-n+r;s>Un.keypressMs&&fi("input",`keystroke→paint ${Math.round(s)}ms (keydown→change ${Math.round(r)}ms, change→paint ${Math.round(performance.now()-n)}ms)`)})}const M0=5e3,tg=500,Sh=2e3;let _n=0,pu=!1;function L0(n){return pt("/perf-log",{entries:n}).then(()=>{_n+=n.length})}function P0(){if(pu||_n>=Bn.length)return;const n=Bn.slice(_n,_n+tg);n.length!==0&&(pu=!0,L0(n).catch(()=>{Bn.length-_n>Sh&&(_n=Math.max(_n,Bn.length-Sh))}).finally(()=>{pu=!1}))}function bh(){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function"||_n>=Bn.length)return;const n=Bn.slice(_n,_n+tg);if(n.length!==0)try{const r=new Blob([JSON.stringify({entries:n})],{type:"application/json"});navigator.sendBeacon(`${dn()}/api/perf-log`,r),_n+=n.length}catch{}}function O0(){let n=0;for(const o of pi.values())n+=o.n;const r=[];if(n>0){const o=[...pi.entries()].sort((a,u)=>u[1].n-a[1].n).map(([a,u])=>`${a}×${u.n}(${eg(u.bytes)})`).join(", ");r.push(`ws ${n}/s [${o}]`)}di>0&&r.push(`store ${di}/s`);const s=[...hi.entries()].sort((o,a)=>a[1]-o[1]).map(([o,a])=>`${o}×${a}`);if(s.length>0&&r.push(`renders ${s.join(" ")}`),r.length>0){const o=r.join(" · ");Qa("stat",o);const a=[...hi.values()].some(u=>u>Un.renderPerSecLog);(n>Un.wsPerSecLog||di>Un.storePerSecLog||a)&&console.log(`[perf:stat] ${o}`)}pi=new Map,di=0,hi=new Map}function z0(n){if(n instanceof Element){const r=n.id?`#${n.id}`:"",s=typeof n.className=="string"&&n.className?`.${n.className.trim().split(/\s+/)[0]}`:"";return`${n.tagName.toLowerCase()}${r}${s}`}return n?"window":"unknown"}function $0(){if(fu||typeof window>"u")return()=>{};fu=!0,Ka=Date.now();const n=[];let r=performance.now()+250;const s=window.setInterval(()=>{const u=performance.now(),f=u-r;r=u+250,f>Un.lagMs&&(Zu++,Ya=Math.max(Ya,f),fi("lag",`event loop blocked ${Math.round(f)}ms`))},250);if(n.push(()=>window.clearInterval(s)),typeof window.requestAnimationFrame=="function"){let u=performance.now(),f=0;const h=g=>{const m=g-u;u=g,m>Un.frameGapMs&&fi("lag",`frame gap ${Math.round(m)}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 g of f.getEntries()){const m=g.duration;if(m<Un.longtaskBufferMs)continue;Ju++,Xa=Math.max(Xa,m);const v=(h=g.attribution)==null?void 0:h[0],k=(v==null?void 0:v.containerName)||(v==null?void 0:v.name)||"unknown",x=`long task ${Math.round(m)}ms (${k})`;m>=Un.longtaskLogMs?fi("longtask",x,m):Qa("longtask",x,m)}});u.observe({type:"longtask",buffered:!1}),n.push(()=>u.disconnect())}catch{}try{const u=new PerformanceObserver(f=>{for(const h of f.getEntries()){const g=h.duration,m=h.processingStart-h.startTime;ed++;const v=`${h.name} ${Math.round(g)}ms (input delay ${Math.round(m)}ms) on ${z0(h.target)}`;g>=Un.eventLogMs?fi("input",v,g):Qa("input",v,g)}});u.observe({type:"event",durationThreshold:Un.eventBufferMs}),n.push(()=>u.disconnect())}catch{}}const o=window.setInterval(O0,1e3);n.push(()=>window.clearInterval(o)),Jm("perf logger session started");const a=window.setInterval(P0,M0);return n.push(()=>window.clearInterval(a)),window.addEventListener("beforeunload",bh),n.push(()=>window.removeEventListener("beforeunload",bh)),window.__agentPanePerf={dump:ng,reset:rg},()=>{n.forEach(u=>u()),fu=!1}}function ng(){const n=[],r=Ka?Math.round((Date.now()-Ka)/1e3):0;if(n.push("=== agent-pane perf report ==="),n.push(`uptime ${r}s · ${Bn.length} buffered entries`),n.push(`event-loop lag: ${Zu} blocks >${Un.lagMs}ms (max ${Math.round(Ya)}ms)`),n.push(`long tasks: ${Ju} ≥${Un.longtaskBufferMs}ms (max ${Math.round(Xa)}ms)`),n.push(`slow input events (≥${Un.eventBufferMs}ms): ${ed}`),n.push(`store updates: ${td} total`),go.size>0){n.push("ws messages by type (top 15):");for(const[s,o]of[...go.entries()].sort((a,u)=>u[1].n-a[1].n).slice(0,15))n.push(` ${s}: ${o.n} msgs, ${eg(o.bytes)}`)}if(vo.size>0){n.push("render counts by component:");for(const[s,o]of[...vo.entries()].sort((a,u)=>u[1]-a[1]))n.push(` ${s}: ${o}`)}n.push("--- last 200 entries ---");for(const s of Bn.slice(-200))n.push(`${new Date(s.t).toISOString().slice(11,23)} [${s.cat}] ${s.msg}`);return n.join(`
|
|
49
|
+
`)}function rg(){Bn.length=0,_n=0,Ka=Date.now(),Zu=0,Ya=0,Ju=0,Xa=0,ed=0,td=0,go.clear(),vo.clear(),pi=new Map,di=0,hi=new Map}const Ot={start:$0,note:Jm,trackWsEvent:j0,trackStoreUpdate:R0,trackRender:A0,markKeystroke:I0,markInputChange:D0,dump:ng,reset:rg},M=sx()((...n)=>({...zx(...n),...$x(...n),...Xx(...n),...f0(...n),...p0(...n),...h0(...n),..._0(...n)}));typeof window<"u"&&(M.subscribe(()=>Ot.trackStoreUpdate()),Ix(M));function Ru(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 F0(n,r,s=!1,o="working",a=0){if(o==="finished")return"";if(n==="interrupted")return"interrupted";if(r)return"running";if(a>0)return"background";if(s&&n!=="failed")return"queued";switch(n){case"failed":return"error";case"aborted":return"paused";default:return"paused"}}function U0(n,r,s=!1,o="working",a=0){if(o==="finished")return"Finished";if(n==="interrupted")return"Interrupted";if(r)return"Running";if(a>0)return"Background";if(s&&n!=="failed")return"Review Pending";switch(n){case"failed":return"Failed";case"aborted":return"Aborted";case"active":return"Idle";case"completed":return"Completed";case"running":return"Running";default:return n}}function ml(n,r=0){const s=n.is_running===1,o=n.lifecycle==="finished",a=Ru(n.runtime_type),u=F0(n.status,s,n.has_unreviewed===1,n.lifecycle,r),f=U0(n.status,s,n.has_unreviewed===1,n.lifecycle,r);return{dot:u,label:f,dotTitle:u==="background"?`${r} background task${r===1?"":"s"} running`:f,iconClass:a.iconClass,iconText:a.iconText,isRunning:s,isFinished:o,backgroundTaskCount:r}}function gl(n,r,s=!0){w.useEffect(()=>{if(!s)return;function o(a){n.current&&!n.current.contains(a.target)&&r()}return document.addEventListener("mousedown",o),document.addEventListener("touchstart",o),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("touchstart",o)}},[n,r,s])}function nd(n,r=!0){w.useEffect(()=>{if(!r)return;function s(o){o.key==="Escape"&&n()}return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[n,r])}function rd({status:n,size:r=6,title:s}){return c.jsx("span",{className:`status-dot ${n}`,style:r!==6?{width:r,height:r}:void 0,title:s})}function sd({iconClass:n,iconText:r,size:s=20}){return c.jsx("span",{className:`runtime-icon ${n}`,style:s!==20?{width:s,height:s,fontSize:s*.45}:void 0,children:r})}/**
|
|
50
|
+
* @license lucide-react v0.469.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const B0=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sg=(...n)=>n.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim();/**
|
|
55
|
+
* @license lucide-react v0.469.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var W0={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 ig=w.forwardRef(({color:n="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:u,iconNode:f,...h},g)=>w.createElement("svg",{ref:g,...W0,width:r,height:r,stroke:n,strokeWidth:o?Number(s)*24/Number(r):s,className:sg("lucide",a),...h},[...f.map(([m,v])=>w.createElement(m,v)),...Array.isArray(u)?u:[u]]));/**
|
|
65
|
+
* @license lucide-react v0.469.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const ye=(n,r)=>{const s=w.forwardRef(({className:o,...a},u)=>w.createElement(ig,{ref:u,iconNode:r,className:sg(`lucide-${B0(n)}`,o),...a}));return s.displayName=`${n}`,s};/**
|
|
70
|
+
* @license lucide-react v0.469.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const H0=ye("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 V0=ye("BotOff",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
|
|
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 ls=ye("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"}]]);/**
|
|
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 q0=ye("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"}]]);/**
|
|
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 os=ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 mi=ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 id=ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 vl=ye("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"}]]);/**
|
|
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 G0=ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
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 Za=ye("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 K0=ye("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"}]]);/**
|
|
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 Y0=ye("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
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 X0=ye("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"}]]);/**
|
|
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 og=ye("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"}]]);/**
|
|
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 Th=ye("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"}]]);/**
|
|
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 Au=ye("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"}]]);/**
|
|
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 Q0=ye("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
|
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 Z0=ye("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
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 J0=ye("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
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 ew=ye("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"}]]);/**
|
|
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 ag=ye("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"}]]);/**
|
|
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 hu=ye("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"}]]);/**
|
|
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 Iu=ye("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"}]]);/**
|
|
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 tw=ye("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"}]]);/**
|
|
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 nw=ye("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 rw=ye("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"}]]);/**
|
|
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 lg=ye("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"}]]);/**
|
|
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 sw=ye("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
|
|
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 iw=ye("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
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 ow=ye("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"}]]);/**
|
|
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 aw=ye("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"}]]);/**
|
|
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 Jn=ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 lw=ye("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"}]]);/**
|
|
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 cw=ye("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"}]]);/**
|
|
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 cg=ye("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"}]]);/**
|
|
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 uw=ye("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"}]]);/**
|
|
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 Nh=ye("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"}]]);/**
|
|
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 dw=ye("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/**
|
|
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 fw=ye("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
|
|
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 pw=ye("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
|
|
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 hw=ye("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
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 mw=ye("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"}]]);/**
|
|
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 Ba=ye("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"}]]);/**
|
|
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 gw=ye("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"}]]);/**
|
|
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 vw=ye("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"}]]);/**
|
|
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 Rs=ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 ug=ye("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"}]]);/**
|
|
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 yw=ye("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"}]]);/**
|
|
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 yo=ye("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"}]]);/**
|
|
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 dg=ye("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
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 fg=ye("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"}]]);/**
|
|
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 xw=ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 So=ye("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"}]]);/**
|
|
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 ww=ye("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"}]]);/**
|
|
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 Ds=ye("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
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 Ja=ye("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"}]]);/**
|
|
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 pg=ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
355
|
+
* @license lucide-react v0.469.0 - ISC
|
|
356
|
+
*
|
|
357
|
+
* This source code is licensed under the ISC license.
|
|
358
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
+
*/const dr=ye("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"}]]);/**
|
|
360
|
+
* @license lucide-react v0.469.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/const kw=ye("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"}]]);/**
|
|
365
|
+
* @license lucide-react v0.469.0 - ISC
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the ISC license.
|
|
368
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
+
*/const Sw=ye("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"}]]);/**
|
|
370
|
+
* @license lucide-react v0.469.0 - ISC
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the ISC license.
|
|
373
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/const bw=ye("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"}]]);/**
|
|
375
|
+
* @license lucide-react v0.469.0 - ISC
|
|
376
|
+
*
|
|
377
|
+
* This source code is licensed under the ISC license.
|
|
378
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
+
*/const Tw=ye("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"}]]);/**
|
|
380
|
+
* @license lucide-react v0.469.0 - ISC
|
|
381
|
+
*
|
|
382
|
+
* This source code is licensed under the ISC license.
|
|
383
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
+
*/const hg=ye("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
385
|
+
* @license lucide-react v0.469.0 - ISC
|
|
386
|
+
*
|
|
387
|
+
* This source code is licensed under the ISC license.
|
|
388
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
+
*/const Nw=ye("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"}]]);/**
|
|
390
|
+
* @license lucide-react v0.469.0 - ISC
|
|
391
|
+
*
|
|
392
|
+
* This source code is licensed under the ISC license.
|
|
393
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
+
*/const Wn=ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
395
|
+
* @license lucide-react v0.469.0 - ISC
|
|
396
|
+
*
|
|
397
|
+
* This source code is licensed under the ISC license.
|
|
398
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
+
*/const Cw=ye("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"}]]),Ew=new Set(["path","circle","rect","line","ellipse","polyline","polygon"]),_w=new Set("d cx cy r rx ry x y width height x1 x2 y1 y2 points fill".split(" "));function jw(n){return n.filter(([r])=>Ew.has(r)).map(([r,s],o)=>[r,{...Object.fromEntries(Object.entries(s).filter(([a])=>_w.has(a))),key:String(o)}])}function yi({iconNode:n,size:r=14,className:s}){const o=w.useMemo(()=>n?jw(n):[],[n]);return o.length===0?c.jsx(lg,{size:r,className:s,"aria-hidden":"true","data-testid":"app-icon-default"}):c.jsx(ig,{iconNode:o,size:r,className:s,"aria-hidden":"true","data-testid":"app-icon"})}var ao=Pm();function Rw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>o=>{r.forEach(a=>a(o))},r)}const yl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xi(n){const r=Object.prototype.toString.call(n);return r==="[object Window]"||r==="[object global]"}function od(n){return"nodeType"in n}function xn(n){var r,s;return n?xi(n)?n:od(n)&&(r=(s=n.ownerDocument)==null?void 0:s.defaultView)!=null?r:window:window}function ad(n){const{Document:r}=xn(n);return n instanceof r}function bo(n){return xi(n)?!1:n instanceof xn(n).HTMLElement}function mg(n){return n instanceof xn(n).SVGElement}function wi(n){return n?xi(n)?n.document:od(n)?ad(n)?n:bo(n)||mg(n)?n.ownerDocument:document:document:document}const fr=yl?w.useLayoutEffect:w.useEffect;function xl(n){const r=w.useRef(n);return fr(()=>{r.current=n}),w.useCallback(function(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];return r.current==null?void 0:r.current(...o)},[])}function Aw(){const n=w.useRef(null),r=w.useCallback((o,a)=>{n.current=setInterval(o,a)},[]),s=w.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[r,s]}function xo(n,r){r===void 0&&(r=[n]);const s=w.useRef(n);return fr(()=>{s.current!==n&&(s.current=n)},r),s}function To(n,r){const s=w.useRef();return w.useMemo(()=>{const o=n(s.current);return s.current=o,o},[...r])}function el(n){const r=xl(n),s=w.useRef(null),o=w.useCallback(a=>{a!==s.current&&(r==null||r(a,s.current)),s.current=a},[]);return[s,o]}function tl(n){const r=w.useRef();return w.useEffect(()=>{r.current=n},[n]),r.current}let mu={};function No(n,r){return w.useMemo(()=>{if(r)return r;const s=mu[n]==null?0:mu[n]+1;return mu[n]=s,n+"-"+s},[n,r])}function gg(n){return function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return o.reduce((u,f)=>{const h=Object.entries(f);for(const[g,m]of h){const v=u[g];v!=null&&(u[g]=v+n*m)}return u},{...r})}}const gi=gg(1),nl=gg(-1);function Iw(n){return"clientX"in n&&"clientY"in n}function wl(n){if(!n)return!1;const{KeyboardEvent:r}=xn(n.target);return r&&n instanceof r}function Dw(n){if(!n)return!1;const{TouchEvent:r}=xn(n.target);return r&&n instanceof r}function rl(n){if(Dw(n)){if(n.touches&&n.touches.length){const{clientX:r,clientY:s}=n.touches[0];return{x:r,y:s}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:r,clientY:s}=n.changedTouches[0];return{x:r,y:s}}}return Iw(n)?{x:n.clientX,y:n.clientY}:null}const Pr=Object.freeze({Translate:{toString(n){if(!n)return;const{x:r,y:s}=n;return"translate3d("+(r?Math.round(r):0)+"px, "+(s?Math.round(s):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:r,scaleY:s}=n;return"scaleX("+r+") scaleY("+s+")"}},Transform:{toString(n){if(n)return[Pr.Translate.toString(n),Pr.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:r,duration:s,easing:o}=n;return r+" "+s+"ms "+o}}}),Ch="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Mw(n){return n.matches(Ch)?n:n.querySelector(Ch)}const Lw={display:"none"};function Pw(n){let{id:r,value:s}=n;return st.createElement("div",{id:r,style:Lw},s)}function Ow(n){let{id:r,announcement:s,ariaLiveType:o="assertive"}=n;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return st.createElement("div",{id:r,style:a,role:"status","aria-live":o,"aria-atomic":!0},s)}function zw(){const[n,r]=w.useState("");return{announce:w.useCallback(o=>{o!=null&&r(o)},[]),announcement:n}}const vg=w.createContext(null);function $w(n){const r=w.useContext(vg);w.useEffect(()=>{if(!r)throw new Error("useDndMonitor must be used within a children of <DndContext>");return r(n)},[n,r])}function Fw(){const[n]=w.useState(()=>new Set),r=w.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[w.useCallback(o=>{let{type:a,event:u}=o;n.forEach(f=>{var h;return(h=f[a])==null?void 0:h.call(f,u)})},[n]),r]}const Uw={draggable:`
|
|
400
|
+
To pick up a draggable item, press the space bar.
|
|
401
|
+
While dragging, use the arrow keys to move the item.
|
|
402
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
403
|
+
`},Bw={onDragStart(n){let{active:r}=n;return"Picked up draggable item "+r.id+"."},onDragOver(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was moved over droppable area "+s.id+".":"Draggable item "+r.id+" is no longer over a droppable area."},onDragEnd(n){let{active:r,over:s}=n;return s?"Draggable item "+r.id+" was dropped over droppable area "+s.id:"Draggable item "+r.id+" was dropped."},onDragCancel(n){let{active:r}=n;return"Dragging was cancelled. Draggable item "+r.id+" was dropped."}};function Ww(n){let{announcements:r=Bw,container:s,hiddenTextDescribedById:o,screenReaderInstructions:a=Uw}=n;const{announce:u,announcement:f}=zw(),h=No("DndLiveRegion"),[g,m]=w.useState(!1);if(w.useEffect(()=>{m(!0)},[]),$w(w.useMemo(()=>({onDragStart(k){let{active:x}=k;u(r.onDragStart({active:x}))},onDragMove(k){let{active:x,over:S}=k;r.onDragMove&&u(r.onDragMove({active:x,over:S}))},onDragOver(k){let{active:x,over:S}=k;u(r.onDragOver({active:x,over:S}))},onDragEnd(k){let{active:x,over:S}=k;u(r.onDragEnd({active:x,over:S}))},onDragCancel(k){let{active:x,over:S}=k;u(r.onDragCancel({active:x,over:S}))}}),[u,r])),!g)return null;const v=st.createElement(st.Fragment,null,st.createElement(Pw,{id:o,value:a.draggable}),st.createElement(Ow,{id:h,announcement:f}));return s?ao.createPortal(v,s):v}var Wt;(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"})(Wt||(Wt={}));function sl(){}function Hw(n,r){return w.useMemo(()=>({sensor:n,options:r??{}}),[n,r])}function Vw(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return w.useMemo(()=>[...r].filter(o=>o!=null),[...r])}const pr=Object.freeze({x:0,y:0});function qw(n,r){return Math.sqrt(Math.pow(n.x-r.x,2)+Math.pow(n.y-r.y,2))}function Gw(n,r){const s=rl(n);if(!s)return"0 0";const o={x:(s.x-r.left)/r.width*100,y:(s.y-r.top)/r.height*100};return o.x+"% "+o.y+"%"}function Kw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return s-o}function Yw(n,r){let{data:{value:s}}=n,{data:{value:o}}=r;return o-s}function Xw(n,r){if(!n||n.length===0)return null;const[s]=n;return s[r]}function Eh(n,r,s){return r===void 0&&(r=n.left),s===void 0&&(s=n.top),{x:r+n.width*.5,y:s+n.height*.5}}const Qw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=Eh(r,r.left,r.top),u=[];for(const f of o){const{id:h}=f,g=s.get(h);if(g){const m=qw(Eh(g),a);u.push({id:h,data:{droppableContainer:f,value:m}})}}return u.sort(Kw)};function Zw(n,r){const s=Math.max(r.top,n.top),o=Math.max(r.left,n.left),a=Math.min(r.left+r.width,n.left+n.width),u=Math.min(r.top+r.height,n.top+n.height),f=a-o,h=u-s;if(o<a&&s<u){const g=r.width*r.height,m=n.width*n.height,v=f*h,k=v/(g+m-v);return Number(k.toFixed(4))}return 0}const Jw=n=>{let{collisionRect:r,droppableRects:s,droppableContainers:o}=n;const a=[];for(const u of o){const{id:f}=u,h=s.get(f);if(h){const g=Zw(h,r);g>0&&a.push({id:f,data:{droppableContainer:u,value:g}})}}return a.sort(Yw)};function e1(n,r,s){return{...n,scaleX:r&&s?r.width/s.width:1,scaleY:r&&s?r.height/s.height:1}}function yg(n,r){return n&&r?{x:n.left-r.left,y:n.top-r.top}:pr}function t1(n){return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];return a.reduce((f,h)=>({...f,top:f.top+n*h.y,bottom:f.bottom+n*h.y,left:f.left+n*h.x,right:f.right+n*h.x}),{...s})}}const n1=t1(1);function xg(n){if(n.startsWith("matrix3d(")){const r=n.slice(9,-1).split(/, /);return{x:+r[12],y:+r[13],scaleX:+r[0],scaleY:+r[5]}}else if(n.startsWith("matrix(")){const r=n.slice(7,-1).split(/, /);return{x:+r[4],y:+r[5],scaleX:+r[0],scaleY:+r[3]}}return null}function r1(n,r,s){const o=xg(r);if(!o)return n;const{scaleX:a,scaleY:u,x:f,y:h}=o,g=n.left-f-(1-a)*parseFloat(s),m=n.top-h-(1-u)*parseFloat(s.slice(s.indexOf(" ")+1)),v=a?n.width/a:n.width,k=u?n.height/u:n.height;return{width:v,height:k,top:m,right:g+v,bottom:m+k,left:g}}const s1={ignoreTransform:!1};function ki(n,r){r===void 0&&(r=s1);let s=n.getBoundingClientRect();if(r.ignoreTransform){const{transform:m,transformOrigin:v}=xn(n).getComputedStyle(n);m&&(s=r1(s,m,v))}const{top:o,left:a,width:u,height:f,bottom:h,right:g}=s;return{top:o,left:a,width:u,height:f,bottom:h,right:g}}function _h(n){return ki(n,{ignoreTransform:!0})}function i1(n){const r=n.innerWidth,s=n.innerHeight;return{top:0,left:0,right:r,bottom:s,width:r,height:s}}function o1(n,r){return r===void 0&&(r=xn(n).getComputedStyle(n)),r.position==="fixed"}function a1(n,r){r===void 0&&(r=xn(n).getComputedStyle(n));const s=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const u=r[a];return typeof u=="string"?s.test(u):!1})}function ld(n,r){const s=[];function o(a){if(r!=null&&s.length>=r||!a)return s;if(ad(a)&&a.scrollingElement!=null&&!s.includes(a.scrollingElement))return s.push(a.scrollingElement),s;if(!bo(a)||mg(a)||s.includes(a))return s;const u=xn(n).getComputedStyle(a);return a!==n&&a1(a,u)&&s.push(a),o1(a,u)?s:o(a.parentNode)}return n?o(n):s}function wg(n){const[r]=ld(n,1);return r??null}function gu(n){return!yl||!n?null:xi(n)?n:od(n)?ad(n)||n===wi(n).scrollingElement?window:bo(n)?n:null:null}function kg(n){return xi(n)?n.scrollX:n.scrollLeft}function Sg(n){return xi(n)?n.scrollY:n.scrollTop}function Du(n){return{x:kg(n),y:Sg(n)}}var Jt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Jt||(Jt={}));function bg(n){return!yl||!n?!1:n===document.scrollingElement}function Tg(n){const r={x:0,y:0},s=bg(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-s.width,y:n.scrollHeight-s.height},a=n.scrollTop<=r.y,u=n.scrollLeft<=r.x,f=n.scrollTop>=o.y,h=n.scrollLeft>=o.x;return{isTop:a,isLeft:u,isBottom:f,isRight:h,maxScroll:o,minScroll:r}}const l1={x:.2,y:.2};function c1(n,r,s,o,a){let{top:u,left:f,right:h,bottom:g}=s;o===void 0&&(o=10),a===void 0&&(a=l1);const{isTop:m,isBottom:v,isLeft:k,isRight:x}=Tg(n),S={x:0,y:0},E={x:0,y:0},C={height:r.height*a.y,width:r.width*a.x};return!m&&u<=r.top+C.height?(S.y=Jt.Backward,E.y=o*Math.abs((r.top+C.height-u)/C.height)):!v&&g>=r.bottom-C.height&&(S.y=Jt.Forward,E.y=o*Math.abs((r.bottom-C.height-g)/C.height)),!x&&h>=r.right-C.width?(S.x=Jt.Forward,E.x=o*Math.abs((r.right-C.width-h)/C.width)):!k&&f<=r.left+C.width&&(S.x=Jt.Backward,E.x=o*Math.abs((r.left+C.width-f)/C.width)),{direction:S,speed:E}}function u1(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:r,left:s,right:o,bottom:a}=n.getBoundingClientRect();return{top:r,left:s,right:o,bottom:a,width:n.clientWidth,height:n.clientHeight}}function Ng(n){return n.reduce((r,s)=>gi(r,Du(s)),pr)}function d1(n){return n.reduce((r,s)=>r+kg(s),0)}function f1(n){return n.reduce((r,s)=>r+Sg(s),0)}function Cg(n,r){if(r===void 0&&(r=ki),!n)return;const{top:s,left:o,bottom:a,right:u}=r(n);wg(n)&&(a<=0||u<=0||s>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const p1=[["x",["left","right"],d1],["y",["top","bottom"],f1]];class cd{constructor(r,s){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=ld(s),a=Ng(o);this.rect={...r},this.width=r.width,this.height=r.height;for(const[u,f,h]of p1)for(const g of f)Object.defineProperty(this,g,{get:()=>{const m=h(o),v=a[u]-m;return this.rect[g]+v},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class uo{constructor(r){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(s=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...s)})},this.target=r}add(r,s,o){var a;(a=this.target)==null||a.addEventListener(r,s,o),this.listeners.push([r,s,o])}}function h1(n){const{EventTarget:r}=xn(n);return n instanceof r?n:wi(n)}function vu(n,r){const s=Math.abs(n.x),o=Math.abs(n.y);return typeof r=="number"?Math.sqrt(s**2+o**2)>r:"x"in r&&"y"in r?s>r.x&&o>r.y:"x"in r?s>r.x:"y"in r?o>r.y:!1}var er;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(er||(er={}));function jh(n){n.preventDefault()}function m1(n){n.stopPropagation()}var et;(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"})(et||(et={}));const Eg={start:[et.Space,et.Enter],cancel:[et.Esc],end:[et.Space,et.Enter,et.Tab]},g1=(n,r)=>{let{currentCoordinates:s}=r;switch(n.code){case et.Right:return{...s,x:s.x+25};case et.Left:return{...s,x:s.x-25};case et.Down:return{...s,y:s.y+25};case et.Up:return{...s,y:s.y-25}}};class _g{constructor(r){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=r;const{event:{target:s}}=r;this.props=r,this.listeners=new uo(wi(s)),this.windowListeners=new uo(xn(s)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:r,onStart:s}=this.props,o=r.node.current;o&&Cg(o),s(pr)}handleKeyDown(r){if(wl(r)){const{active:s,context:o,options:a}=this.props,{keyboardCodes:u=Eg,coordinateGetter:f=g1,scrollBehavior:h="smooth"}=a,{code:g}=r;if(u.end.includes(g)){this.handleEnd(r);return}if(u.cancel.includes(g)){this.handleCancel(r);return}const{collisionRect:m}=o.current,v=m?{x:m.left,y:m.top}:pr;this.referenceCoordinates||(this.referenceCoordinates=v);const k=f(r,{active:s,context:o.current,currentCoordinates:v});if(k){const x=nl(k,v),S={x:0,y:0},{scrollableAncestors:E}=o.current;for(const C of E){const T=r.code,{isTop:I,isRight:R,isLeft:B,isBottom:$,maxScroll:W,minScroll:Q}=Tg(C),K=u1(C),X={x:Math.min(T===et.Right?K.right-K.width/2:K.right,Math.max(T===et.Right?K.left:K.left+K.width/2,k.x)),y:Math.min(T===et.Down?K.bottom-K.height/2:K.bottom,Math.max(T===et.Down?K.top:K.top+K.height/2,k.y))},ue=T===et.Right&&!R||T===et.Left&&!B,me=T===et.Down&&!$||T===et.Up&&!I;if(ue&&X.x!==k.x){const de=C.scrollLeft+x.x,De=T===et.Right&&de<=W.x||T===et.Left&&de>=Q.x;if(De&&!x.y){C.scrollTo({left:de,behavior:h});return}De?S.x=C.scrollLeft-de:S.x=T===et.Right?C.scrollLeft-W.x:C.scrollLeft-Q.x,S.x&&C.scrollBy({left:-S.x,behavior:h});break}else if(me&&X.y!==k.y){const de=C.scrollTop+x.y,De=T===et.Down&&de<=W.y||T===et.Up&&de>=Q.y;if(De&&!x.x){C.scrollTo({top:de,behavior:h});return}De?S.y=C.scrollTop-de:S.y=T===et.Down?C.scrollTop-W.y:C.scrollTop-Q.y,S.y&&C.scrollBy({top:-S.y,behavior:h});break}}this.handleMove(r,gi(nl(k,this.referenceCoordinates),S))}}}handleMove(r,s){const{onMove:o}=this.props;r.preventDefault(),o(s)}handleEnd(r){const{onEnd:s}=this.props;r.preventDefault(),this.detach(),s()}handleCancel(r){const{onCancel:s}=this.props;r.preventDefault(),this.detach(),s()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}_g.activators=[{eventName:"onKeyDown",handler:(n,r,s)=>{let{keyboardCodes:o=Eg,onActivation:a}=r,{active:u}=s;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const h=u.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),a==null||a({event:n.nativeEvent}),!0)}return!1}}];function Rh(n){return!!(n&&"distance"in n)}function Ah(n){return!!(n&&"delay"in n)}class ud{constructor(r,s,o){var a;o===void 0&&(o=h1(r.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=r,this.events=s;const{event:u}=r,{target:f}=u;this.props=r,this.events=s,this.document=wi(f),this.documentListeners=new uo(this.document),this.listeners=new uo(o),this.windowListeners=new uo(xn(f)),this.initialCoordinates=(a=rl(u))!=null?a:pr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:r,props:{options:{activationConstraint:s,bypassActivationConstraint:o}}}=this;if(this.listeners.add(r.move.name,this.handleMove,{passive:!1}),this.listeners.add(r.end.name,this.handleEnd),r.cancel&&this.listeners.add(r.cancel.name,this.handleCancel),this.windowListeners.add(er.Resize,this.handleCancel),this.windowListeners.add(er.DragStart,jh),this.windowListeners.add(er.VisibilityChange,this.handleCancel),this.windowListeners.add(er.ContextMenu,jh),this.documentListeners.add(er.Keydown,this.handleKeydown),s){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ah(s)){this.timeoutId=setTimeout(this.handleStart,s.delay),this.handlePending(s);return}if(Rh(s)){this.handlePending(s);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(r,s){const{active:o,onPending:a}=this.props;a(o,r,this.initialCoordinates,s)}handleStart(){const{initialCoordinates:r}=this,{onStart:s}=this.props;r&&(this.activated=!0,this.documentListeners.add(er.Click,m1,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(er.SelectionChange,this.removeTextSelection),s(r))}handleMove(r){var s;const{activated:o,initialCoordinates:a,props:u}=this,{onMove:f,options:{activationConstraint:h}}=u;if(!a)return;const g=(s=rl(r))!=null?s:pr,m=nl(a,g);if(!o&&h){if(Rh(h)){if(h.tolerance!=null&&vu(m,h.tolerance))return this.handleCancel();if(vu(m,h.distance))return this.handleStart()}if(Ah(h)&&vu(m,h.tolerance))return this.handleCancel();this.handlePending(h,m);return}r.cancelable&&r.preventDefault(),f(g)}handleEnd(){const{onAbort:r,onEnd:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleCancel(){const{onAbort:r,onCancel:s}=this.props;this.detach(),this.activated||r(this.props.active),s()}handleKeydown(r){r.code===et.Esc&&this.handleCancel()}removeTextSelection(){var r;(r=this.document.getSelection())==null||r.removeAllRanges()}}const v1={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class dd extends ud{constructor(r){const{event:s}=r,o=wi(s.target);super(r,v1,o)}}dd.activators=[{eventName:"onPointerDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return!s.isPrimary||s.button!==0?!1:(o==null||o({event:s}),!0)}}];const y1={move:{name:"mousemove"},end:{name:"mouseup"}};var Mu;(function(n){n[n.RightClick=2]="RightClick"})(Mu||(Mu={}));class x1 extends ud{constructor(r){super(r,y1,wi(r.event.target))}}x1.activators=[{eventName:"onMouseDown",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;return s.button===Mu.RightClick?!1:(o==null||o({event:s}),!0)}}];const yu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class w1 extends ud{constructor(r){super(r,yu)}static setup(){return window.addEventListener(yu.move.name,r,{capture:!1,passive:!1}),function(){window.removeEventListener(yu.move.name,r)};function r(){}}}w1.activators=[{eventName:"onTouchStart",handler:(n,r)=>{let{nativeEvent:s}=n,{onActivation:o}=r;const{touches:a}=s;return a.length>1?!1:(o==null||o({event:s}),!0)}}];var fo;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(fo||(fo={}));var il;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(il||(il={}));function k1(n){let{acceleration:r,activator:s=fo.Pointer,canScroll:o,draggingRect:a,enabled:u,interval:f=5,order:h=il.TreeOrder,pointerCoordinates:g,scrollableAncestors:m,scrollableAncestorRects:v,delta:k,threshold:x}=n;const S=b1({delta:k,disabled:!u}),[E,C]=Aw(),T=w.useRef({x:0,y:0}),I=w.useRef({x:0,y:0}),R=w.useMemo(()=>{switch(s){case fo.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case fo.DraggableRect:return a}},[s,a,g]),B=w.useRef(null),$=w.useCallback(()=>{const Q=B.current;if(!Q)return;const K=T.current.x*I.current.x,X=T.current.y*I.current.y;Q.scrollBy(K,X)},[]),W=w.useMemo(()=>h===il.TreeOrder?[...m].reverse():m,[h,m]);w.useEffect(()=>{if(!u||!m.length||!R){C();return}for(const Q of W){if((o==null?void 0:o(Q))===!1)continue;const K=m.indexOf(Q),X=v[K];if(!X)continue;const{direction:ue,speed:me}=c1(Q,X,R,r,x);for(const de of["x","y"])S[de][ue[de]]||(me[de]=0,ue[de]=0);if(me.x>0||me.y>0){C(),B.current=Q,E($,f),T.current=me,I.current=ue;return}}T.current={x:0,y:0},I.current={x:0,y:0},C()},[r,$,o,C,u,f,JSON.stringify(R),JSON.stringify(S),E,m,W,v,JSON.stringify(x)])}const S1={x:{[Jt.Backward]:!1,[Jt.Forward]:!1},y:{[Jt.Backward]:!1,[Jt.Forward]:!1}};function b1(n){let{delta:r,disabled:s}=n;const o=tl(r);return To(a=>{if(s||!o||!a)return S1;const u={x:Math.sign(r.x-o.x),y:Math.sign(r.y-o.y)};return{x:{[Jt.Backward]:a.x[Jt.Backward]||u.x===-1,[Jt.Forward]:a.x[Jt.Forward]||u.x===1},y:{[Jt.Backward]:a.y[Jt.Backward]||u.y===-1,[Jt.Forward]:a.y[Jt.Forward]||u.y===1}}},[s,r,o])}function T1(n,r){const s=r!=null?n.get(r):void 0,o=s?s.node.current:null;return To(a=>{var u;return r==null?null:(u=o??a)!=null?u:null},[o,r])}function N1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{const{sensor:a}=o,u=a.activators.map(f=>({eventName:f.eventName,handler:r(f.handler,o)}));return[...s,...u]},[]),[n,r])}var wo;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(wo||(wo={}));var Lu;(function(n){n.Optimized="optimized"})(Lu||(Lu={}));const Ih=new Map;function C1(n,r){let{dragging:s,dependencies:o,config:a}=r;const[u,f]=w.useState(null),{frequency:h,measure:g,strategy:m}=a,v=w.useRef(n),k=T(),x=xo(k),S=w.useCallback(function(I){I===void 0&&(I=[]),!x.current&&f(R=>R===null?I:R.concat(I.filter(B=>!R.includes(B))))},[x]),E=w.useRef(null),C=To(I=>{if(k&&!s)return Ih;if(!I||I===Ih||v.current!==n||u!=null){const R=new Map;for(let B of n){if(!B)continue;if(u&&u.length>0&&!u.includes(B.id)&&B.rect.current){R.set(B.id,B.rect.current);continue}const $=B.node.current,W=$?new cd(g($),$):null;B.rect.current=W,W&&R.set(B.id,W)}return R}return I},[n,u,s,k,g]);return w.useEffect(()=>{v.current=n},[n]),w.useEffect(()=>{k||S()},[s,k]),w.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),w.useEffect(()=>{k||typeof h!="number"||E.current!==null||(E.current=setTimeout(()=>{S(),E.current=null},h))},[h,k,S,...o]),{droppableRects:C,measureDroppableContainers:S,measuringScheduled:u!=null};function T(){switch(m){case wo.Always:return!1;case wo.BeforeDragging:return s;default:return!s}}}function fd(n,r){return To(s=>n?s||(typeof r=="function"?r(n):n):null,[r,n])}function E1(n,r){return fd(n,r)}function _1(n){let{callback:r,disabled:s}=n;const o=xl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function kl(n){let{callback:r,disabled:s}=n;const o=xl(r),a=w.useMemo(()=>{if(s||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[s]);return w.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function j1(n){return new cd(ki(n),n)}function Dh(n,r,s){r===void 0&&(r=j1);const[o,a]=w.useState(null);function u(){a(g=>{if(!n)return null;if(n.isConnected===!1){var m;return(m=g??s)!=null?m:null}const v=r(n);return JSON.stringify(g)===JSON.stringify(v)?g:v})}const f=_1({callback(g){if(n)for(const m of g){const{type:v,target:k}=m;if(v==="childList"&&k instanceof HTMLElement&&k.contains(n)){u();break}}}}),h=kl({callback:u});return fr(()=>{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 R1(n){const r=fd(n);return yg(n,r)}const Mh=[];function A1(n){const r=w.useRef(n),s=To(o=>n?o&&o!==Mh&&n&&r.current&&n.parentNode===r.current.parentNode?o:ld(n):Mh,[n]);return w.useEffect(()=>{r.current=n},[n]),s}function I1(n){const[r,s]=w.useState(null),o=w.useRef(n),a=w.useCallback(u=>{const f=gu(u.target);f&&s(h=>h?(h.set(f,Du(f)),new Map(h)):null)},[]);return w.useEffect(()=>{const u=o.current;if(n!==u){f(u);const h=n.map(g=>{const m=gu(g);return m?(m.addEventListener("scroll",a,{passive:!0}),[m,Du(m)]):null}).filter(g=>g!=null);s(h.length?new Map(h):null),o.current=n}return()=>{f(n),f(u)};function f(h){h.forEach(g=>{const m=gu(g);m==null||m.removeEventListener("scroll",a)})}},[a,n]),w.useMemo(()=>n.length?r?Array.from(r.values()).reduce((u,f)=>gi(u,f),pr):Ng(n):pr,[n,r])}function Lh(n,r){r===void 0&&(r=[]);const s=w.useRef(null);return w.useEffect(()=>{s.current=null},r),w.useEffect(()=>{const o=n!==pr;o&&!s.current&&(s.current=n),!o&&s.current&&(s.current=null)},[n]),s.current?nl(n,s.current):pr}function D1(n){w.useEffect(()=>{if(!yl)return;const r=n.map(s=>{let{sensor:o}=s;return o.setup==null?void 0:o.setup()});return()=>{for(const s of r)s==null||s()}},n.map(r=>{let{sensor:s}=r;return s}))}function M1(n,r){return w.useMemo(()=>n.reduce((s,o)=>{let{eventName:a,handler:u}=o;return s[a]=f=>{u(f,r)},s},{}),[n,r])}function jg(n){return w.useMemo(()=>n?i1(n):null,[n])}const Ph=[];function L1(n,r){r===void 0&&(r=ki);const[s]=n,o=jg(s?xn(s):null),[a,u]=w.useState(Ph);function f(){u(()=>n.length?n.map(g=>bg(g)?o:new cd(r(g),g)):Ph)}const h=kl({callback:f});return fr(()=>{h==null||h.disconnect(),f(),n.forEach(g=>h==null?void 0:h.observe(g))},[n]),a}function Rg(n){if(!n)return null;if(n.children.length>1)return n;const r=n.children[0];return bo(r)?r:n}function P1(n){let{measure:r}=n;const[s,o]=w.useState(null),a=w.useCallback(m=>{for(const{target:v}of m)if(bo(v)){o(k=>{const x=r(v);return k?{...k,width:x.width,height:x.height}:x});break}},[r]),u=kl({callback:a}),f=w.useCallback(m=>{const v=Rg(m);u==null||u.disconnect(),v&&(u==null||u.observe(v)),o(v?r(v):null)},[r,u]),[h,g]=el(f);return w.useMemo(()=>({nodeRef:h,rect:s,setRef:g}),[s,h,g])}const O1=[{sensor:dd,options:{}},{sensor:_g,options:{}}],z1={current:{}},Wa={draggable:{measure:_h},droppable:{measure:_h,strategy:wo.WhileDragging,frequency:Lu.Optimized},dragOverlay:{measure:ki}};class po extends Map{get(r){var s;return r!=null&&(s=super.get(r))!=null?s:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(r=>{let{disabled:s}=r;return!s})}getNodeFor(r){var s,o;return(s=(o=this.get(r))==null?void 0:o.node.current)!=null?s:void 0}}const $1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new po,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:sl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Wa,measureDroppableContainers:sl,windowRect:null,measuringScheduled:!1},Ag={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:sl,draggableNodes:new Map,over:null,measureDroppableContainers:sl},Co=w.createContext(Ag),Ig=w.createContext($1);function F1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new po}}}function U1(n,r){switch(r.type){case Wt.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:r.initialCoordinates,active:r.active}};case Wt.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:r.coordinates.x-n.draggable.initialCoordinates.x,y:r.coordinates.y-n.draggable.initialCoordinates.y}}};case Wt.DragEnd:case Wt.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Wt.RegisterDroppable:{const{element:s}=r,{id:o}=s,a=new po(n.droppable.containers);return a.set(o,s),{...n,droppable:{...n.droppable,containers:a}}}case Wt.SetDroppableDisabled:{const{id:s,key:o,disabled:a}=r,u=n.droppable.containers.get(s);if(!u||o!==u.key)return n;const f=new po(n.droppable.containers);return f.set(s,{...u,disabled:a}),{...n,droppable:{...n.droppable,containers:f}}}case Wt.UnregisterDroppable:{const{id:s,key:o}=r,a=n.droppable.containers.get(s);if(!a||o!==a.key)return n;const u=new po(n.droppable.containers);return u.delete(s),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function B1(n){let{disabled:r}=n;const{active:s,activatorEvent:o,draggableNodes:a}=w.useContext(Co),u=tl(o),f=tl(s==null?void 0:s.id);return w.useEffect(()=>{if(!r&&!o&&u&&f!=null){if(!wl(u)||document.activeElement===u.target)return;const h=a.get(f);if(!h)return;const{activatorNode:g,node:m}=h;if(!g.current&&!m.current)return;requestAnimationFrame(()=>{for(const v of[g.current,m.current]){if(!v)continue;const k=Mw(v);if(k){k.focus();break}}})}},[o,r,a,f,u]),null}function Dg(n,r){let{transform:s,...o}=r;return n!=null&&n.length?n.reduce((a,u)=>u({transform:a,...o}),s):s}function W1(n){return w.useMemo(()=>({draggable:{...Wa.draggable,...n==null?void 0:n.draggable},droppable:{...Wa.droppable,...n==null?void 0:n.droppable},dragOverlay:{...Wa.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 H1(n){let{activeNode:r,measure:s,initialRect:o,config:a=!0}=n;const u=w.useRef(!1),{x:f,y:h}=typeof a=="boolean"?{x:a,y:a}:a;fr(()=>{if(!f&&!h||!r){u.current=!1;return}if(u.current||!o)return;const m=r==null?void 0:r.node.current;if(!m||m.isConnected===!1)return;const v=s(m),k=yg(v,o);if(f||(k.x=0),h||(k.y=0),u.current=!0,Math.abs(k.x)>0||Math.abs(k.y)>0){const x=wg(m);x&&x.scrollBy({top:k.y,left:k.x})}},[r,f,h,o,s])}const Sl=w.createContext({...pr,scaleX:1,scaleY:1});var ss;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(ss||(ss={}));const V1=w.memo(function(r){var s,o,a,u;let{id:f,accessibility:h,autoScroll:g=!0,children:m,sensors:v=O1,collisionDetection:k=Jw,measuring:x,modifiers:S,...E}=r;const C=w.useReducer(U1,void 0,F1),[T,I]=C,[R,B]=Fw(),[$,W]=w.useState(ss.Uninitialized),Q=$===ss.Initialized,{draggable:{active:K,nodes:X,translate:ue},droppable:{containers:me}}=T,de=K!=null?X.get(K):null,De=w.useRef({initial:null,translated:null}),je=w.useMemo(()=>{var rt;return K!=null?{id:K,data:(rt=de==null?void 0:de.data)!=null?rt:z1,rect:De}:null},[K,de]),Le=w.useRef(null),[ne,q]=w.useState(null),[Y,P]=w.useState(null),Z=xo(E,Object.values(E)),V=No("DndDescribedBy",f),j=w.useMemo(()=>me.getEnabled(),[me]),L=W1(x),{droppableRects:ce,measureDroppableContainers:G,measuringScheduled:le}=C1(j,{dragging:Q,dependencies:[ue.x,ue.y],config:L.droppable}),fe=T1(X,K),Pe=w.useMemo(()=>Y?rl(Y):null,[Y]),Te=Vt(),Ee=E1(fe,L.draggable.measure);H1({activeNode:K!=null?X.get(K):null,config:Te.layoutShiftCompensation,initialRect:Ee,measure:L.draggable.measure});const Ce=Dh(fe,L.draggable.measure,Ee),it=Dh(fe?fe.parentElement:null),Ne=w.useRef({activatorEvent:null,active:null,activeNode:fe,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:X,draggingNode:null,draggingNodeRect:null,droppableContainers:me,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),kt=me.getNodeFor((s=Ne.current.over)==null?void 0:s.id),$e=P1({measure:L.dragOverlay.measure}),It=(o=$e.nodeRef.current)!=null?o:fe,Fe=Q?(a=$e.rect)!=null?a:Ce:null,Dt=!!($e.nodeRef.current&&$e.rect),jn=R1(Dt?null:Ce),St=jg(It?xn(It):null),Mt=A1(Q?kt??fe:null),ht=L1(Mt),en=Dg(S,{transform:{x:ue.x-jn.x,y:ue.y-jn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:je,activeNodeRect:Ce,containerNodeRect:it,draggingNodeRect:Fe,over:Ne.current.over,overlayNodeRect:$e.rect,scrollableAncestors:Mt,scrollableAncestorRects:ht,windowRect:St}),H=Pe?gi(Pe,ue):null,pe=I1(Mt),Ue=Lh(pe),tt=Lh(pe,[Ce]),mt=gi(en,Ue),gt=Fe?n1(Fe,en):null,Rt=je&>?k({active:je,collisionRect:gt,droppableRects:ce,droppableContainers:j,pointerCoordinates:H}):null,Ht=Xw(Rt,"id"),[ut,Rn]=w.useState(null),Hn=Dt?en:gi(en,tt),br=e1(Hn,(u=ut==null?void 0:ut.rect)!=null?u:null,Ce),hr=w.useRef(null),An=w.useCallback((rt,vt)=>{let{sensor:yt,options:qt}=vt;if(Le.current==null)return;const bt=X.get(Le.current);if(!bt)return;const xt=rt.nativeEvent,ot=new yt({active:Le.current,activeNode:bt,event:xt,options:qt,context:Ne,onAbort(Je){if(!X.get(Je))return;const{onDragAbort:ie}=Z.current,se={id:Je};ie==null||ie(se),R({type:"onDragAbort",event:se})},onPending(Je,_,ie,se){if(!X.get(Je))return;const{onDragPending:ze}=Z.current,Be={id:Je,constraint:_,initialCoordinates:ie,offset:se};ze==null||ze(Be),R({type:"onDragPending",event:Be})},onStart(Je){const _=Le.current;if(_==null)return;const ie=X.get(_);if(!ie)return;const{onDragStart:se}=Z.current,ge={activatorEvent:xt,active:{id:_,data:ie.data,rect:De}};ao.unstable_batchedUpdates(()=>{se==null||se(ge),W(ss.Initializing),I({type:Wt.DragStart,initialCoordinates:Je,active:_}),R({type:"onDragStart",event:ge}),q(hr.current),P(xt)})},onMove(Je){I({type:Wt.DragMove,coordinates:Je})},onEnd:Gt(Wt.DragEnd),onCancel:Gt(Wt.DragCancel)});hr.current=ot;function Gt(Je){return async function(){const{active:ie,collisions:se,over:ge,scrollAdjustedTranslate:ze}=Ne.current;let Be=null;if(ie&&ze){const{cancelDrop:Ie}=Z.current;Be={activatorEvent:xt,active:ie,collisions:se,delta:ze,over:ge},Je===Wt.DragEnd&&typeof Ie=="function"&&await Promise.resolve(Ie(Be))&&(Je=Wt.DragCancel)}Le.current=null,ao.unstable_batchedUpdates(()=>{I({type:Je}),W(ss.Uninitialized),Rn(null),q(null),P(null),hr.current=null;const Ie=Je===Wt.DragEnd?"onDragEnd":"onDragCancel";if(Be){const at=Z.current[Ie];at==null||at(Be),R({type:Ie,event:Be})}})}}},[X]),In=w.useCallback((rt,vt)=>(yt,qt)=>{const bt=yt.nativeEvent,xt=X.get(qt);if(Le.current!==null||!xt||bt.dndKit||bt.defaultPrevented)return;const ot={active:xt};rt(yt,vt.options,ot)===!0&&(bt.dndKit={capturedBy:vt.sensor},Le.current=qt,An(yt,vt))},[X,An]),fn=N1(v,In);D1(v),fr(()=>{Ce&&$===ss.Initializing&&W(ss.Initialized)},[Ce,$]),w.useEffect(()=>{const{onDragMove:rt}=Z.current,{active:vt,activatorEvent:yt,collisions:qt,over:bt}=Ne.current;if(!vt||!yt)return;const xt={active:vt,activatorEvent:yt,collisions:qt,delta:{x:mt.x,y:mt.y},over:bt};ao.unstable_batchedUpdates(()=>{rt==null||rt(xt),R({type:"onDragMove",event:xt})})},[mt.x,mt.y]),w.useEffect(()=>{const{active:rt,activatorEvent:vt,collisions:yt,droppableContainers:qt,scrollAdjustedTranslate:bt}=Ne.current;if(!rt||Le.current==null||!vt||!bt)return;const{onDragOver:xt}=Z.current,ot=qt.get(Ht),Gt=ot&&ot.rect.current?{id:ot.id,rect:ot.rect.current,data:ot.data,disabled:ot.disabled}:null,Je={active:rt,activatorEvent:vt,collisions:yt,delta:{x:bt.x,y:bt.y},over:Gt};ao.unstable_batchedUpdates(()=>{Rn(Gt),xt==null||xt(Je),R({type:"onDragOver",event:Je})})},[Ht]),fr(()=>{Ne.current={activatorEvent:Y,active:je,activeNode:fe,collisionRect:gt,collisions:Rt,droppableRects:ce,draggableNodes:X,draggingNode:It,draggingNodeRect:Fe,droppableContainers:me,over:ut,scrollableAncestors:Mt,scrollAdjustedTranslate:mt},De.current={initial:Fe,translated:gt}},[je,fe,Rt,gt,X,It,Fe,ce,me,ut,Mt,mt]),k1({...Te,delta:ue,draggingRect:gt,pointerCoordinates:H,scrollableAncestors:Mt,scrollableAncestorRects:ht});const wn=w.useMemo(()=>({active:je,activeNode:fe,activeNodeRect:Ce,activatorEvent:Y,collisions:Rt,containerNodeRect:it,dragOverlay:$e,draggableNodes:X,droppableContainers:me,droppableRects:ce,over:ut,measureDroppableContainers:G,scrollableAncestors:Mt,scrollableAncestorRects:ht,measuringConfiguration:L,measuringScheduled:le,windowRect:St}),[je,fe,Ce,Y,Rt,it,$e,X,me,ce,ut,G,Mt,ht,L,le,St]),Ft=w.useMemo(()=>({activatorEvent:Y,activators:fn,active:je,activeNodeRect:Ce,ariaDescribedById:{draggable:V},dispatch:I,draggableNodes:X,over:ut,measureDroppableContainers:G}),[Y,fn,je,Ce,I,V,X,ut,G]);return st.createElement(vg.Provider,{value:B},st.createElement(Co.Provider,{value:Ft},st.createElement(Ig.Provider,{value:wn},st.createElement(Sl.Provider,{value:br},m)),st.createElement(B1,{disabled:(h==null?void 0:h.restoreFocus)===!1})),st.createElement(Ww,{...h,hiddenTextDescribedById:V}));function Vt(){const rt=(ne==null?void 0:ne.autoScrollEnabled)===!1,vt=typeof g=="object"?g.enabled===!1:g===!1,yt=Q&&!rt&&!vt;return typeof g=="object"?{...g,enabled:yt}:{enabled:yt}}}),q1=w.createContext(null),Oh="button",G1="Draggable";function K1(n){let{id:r,data:s,disabled:o=!1,attributes:a}=n;const u=No(G1),{activators:f,activatorEvent:h,active:g,activeNodeRect:m,ariaDescribedById:v,draggableNodes:k,over:x}=w.useContext(Co),{role:S=Oh,roleDescription:E="draggable",tabIndex:C=0}=a??{},T=(g==null?void 0:g.id)===r,I=w.useContext(T?Sl:q1),[R,B]=el(),[$,W]=el(),Q=M1(f,r),K=xo(s);fr(()=>(k.set(r,{id:r,key:u,node:R,activatorNode:$,data:K}),()=>{const ue=k.get(r);ue&&ue.key===u&&k.delete(r)}),[k,r]);const X=w.useMemo(()=>({role:S,tabIndex:C,"aria-disabled":o,"aria-pressed":T&&S===Oh?!0:void 0,"aria-roledescription":E,"aria-describedby":v.draggable}),[o,S,C,T,E,v.draggable]);return{active:g,activatorEvent:h,activeNodeRect:m,attributes:X,isDragging:T,listeners:o?void 0:Q,node:R,over:x,setNodeRef:B,setActivatorNodeRef:W,transform:I}}function Mg(){return w.useContext(Ig)}const Y1="Droppable",X1={timeout:25};function Lg(n){let{data:r,disabled:s=!1,id:o,resizeObserverConfig:a}=n;const u=No(Y1),{active:f,dispatch:h,over:g,measureDroppableContainers:m}=w.useContext(Co),v=w.useRef({disabled:s}),k=w.useRef(!1),x=w.useRef(null),S=w.useRef(null),{disabled:E,updateMeasurementsFor:C,timeout:T}={...X1,...a},I=xo(C??o),R=w.useCallback(()=>{if(!k.current){k.current=!0;return}S.current!=null&&clearTimeout(S.current),S.current=setTimeout(()=>{m(Array.isArray(I.current)?I.current:[I.current]),S.current=null},T)},[T]),B=kl({callback:R,disabled:E||!f}),$=w.useCallback((X,ue)=>{B&&(ue&&(B.unobserve(ue),k.current=!1),X&&B.observe(X))},[B]),[W,Q]=el($),K=xo(r);return w.useEffect(()=>{!B||!W.current||(B.disconnect(),k.current=!1,B.observe(W.current))},[W,B]),w.useEffect(()=>(h({type:Wt.RegisterDroppable,element:{id:o,key:u,disabled:s,node:W,rect:x,data:K}}),()=>h({type:Wt.UnregisterDroppable,key:u,id:o})),[o]),w.useEffect(()=>{s!==v.current.disabled&&(h({type:Wt.SetDroppableDisabled,id:o,key:u,disabled:s}),v.current.disabled=s)},[o,u,s,h]),{active:f,rect:x,isOver:(g==null?void 0:g.id)===o,node:W,over:g,setNodeRef:Q}}function Q1(n){let{animation:r,children:s}=n;const[o,a]=w.useState(null),[u,f]=w.useState(null),h=tl(s);return!s&&!o&&h&&a(h),fr(()=>{if(!u)return;const g=o==null?void 0:o.key,m=o==null?void 0:o.props.id;if(g==null||m==null){a(null);return}Promise.resolve(r(m,u)).then(()=>{a(null)})},[r,o,u]),st.createElement(st.Fragment,null,s,o?w.cloneElement(o,{ref:f}):null)}const Z1={x:0,y:0,scaleX:1,scaleY:1};function J1(n){let{children:r}=n;return st.createElement(Co.Provider,{value:Ag},st.createElement(Sl.Provider,{value:Z1},r))}const ek={position:"fixed",touchAction:"none"},tk=n=>wl(n)?"transform 250ms ease":void 0,nk=w.forwardRef((n,r)=>{let{as:s,activatorEvent:o,adjustScale:a,children:u,className:f,rect:h,style:g,transform:m,transition:v=tk}=n;if(!h)return null;const k=a?m:{...m,scaleX:1,scaleY:1},x={...ek,width:h.width,height:h.height,top:h.top,left:h.left,transform:Pr.Transform.toString(k),transformOrigin:a&&o?Gw(o,h):void 0,transition:typeof v=="function"?v(o):v,...g};return st.createElement(s,{className:f,style:x,ref:r},u)}),rk=n=>r=>{let{active:s,dragOverlay:o}=r;const a={},{styles:u,className:f}=n;if(u!=null&&u.active)for(const[h,g]of Object.entries(u.active))g!==void 0&&(a[h]=s.node.style.getPropertyValue(h),s.node.style.setProperty(h,g));if(u!=null&&u.dragOverlay)for(const[h,g]of Object.entries(u.dragOverlay))g!==void 0&&o.node.style.setProperty(h,g);return f!=null&&f.active&&s.node.classList.add(f.active),f!=null&&f.dragOverlay&&o.node.classList.add(f.dragOverlay),function(){for(const[g,m]of Object.entries(a))s.node.style.setProperty(g,m);f!=null&&f.active&&s.node.classList.remove(f.active)}},sk=n=>{let{transform:{initial:r,final:s}}=n;return[{transform:Pr.Transform.toString(r)},{transform:Pr.Transform.toString(s)}]},ik={duration:250,easing:"ease",keyframes:sk,sideEffects:rk({styles:{active:{opacity:"0"}}})};function ok(n){let{config:r,draggableNodes:s,droppableContainers:o,measuringConfiguration:a}=n;return xl((u,f)=>{if(r===null)return;const h=s.get(u);if(!h)return;const g=h.node.current;if(!g)return;const m=Rg(f);if(!m)return;const{transform:v}=xn(f).getComputedStyle(f),k=xg(v);if(!k)return;const x=typeof r=="function"?r:ak(r);return Cg(g,a.draggable.measure),x({active:{id:u,data:h.data,node:g,rect:a.draggable.measure(g)},draggableNodes:s,dragOverlay:{node:f,rect:a.dragOverlay.measure(m)},droppableContainers:o,measuringConfiguration:a,transform:k})})}function ak(n){const{duration:r,easing:s,sideEffects:o,keyframes:a}={...ik,...n};return u=>{let{active:f,dragOverlay:h,transform:g,...m}=u;if(!r)return;const v={x:h.rect.left-f.rect.left,y:h.rect.top-f.rect.top},k={scaleX:g.scaleX!==1?f.rect.width*g.scaleX/h.rect.width:1,scaleY:g.scaleY!==1?f.rect.height*g.scaleY/h.rect.height:1},x={x:g.x-v.x,y:g.y-v.y,...k},S=a({...m,active:f,dragOverlay:h,transform:{initial:g,final:x}}),[E]=S,C=S[S.length-1];if(JSON.stringify(E)===JSON.stringify(C))return;const T=o==null?void 0:o({active:f,dragOverlay:h,...m}),I=h.node.animate(S,{duration:r,easing:s,fill:"forwards"});return new Promise(R=>{I.onfinish=()=>{T==null||T(),R()}})}}let zh=0;function lk(n){return w.useMemo(()=>{if(n!=null)return zh++,zh},[n])}const ck=st.memo(n=>{let{adjustScale:r=!1,children:s,dropAnimation:o,style:a,transition:u,modifiers:f,wrapperElement:h="div",className:g,zIndex:m=999}=n;const{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:S,draggableNodes:E,droppableContainers:C,dragOverlay:T,over:I,measuringConfiguration:R,scrollableAncestors:B,scrollableAncestorRects:$,windowRect:W}=Mg(),Q=w.useContext(Sl),K=lk(k==null?void 0:k.id),X=Dg(f,{activatorEvent:v,active:k,activeNodeRect:x,containerNodeRect:S,draggingNodeRect:T.rect,over:I,overlayNodeRect:T.rect,scrollableAncestors:B,scrollableAncestorRects:$,transform:Q,windowRect:W}),ue=fd(x),me=ok({config:o,draggableNodes:E,droppableContainers:C,measuringConfiguration:R}),de=ue?T.setRef:void 0;return st.createElement(J1,null,st.createElement(Q1,{animation:me},k&&K?st.createElement(nk,{key:K,id:k.id,ref:de,as:h,activatorEvent:v,adjustScale:r,className:g,transition:u,rect:ue,style:{zIndex:m,...a},transform:X},s):null))});function Pg(n,r,s){const o=n.slice();return o.splice(s<0?o.length+s:s,0,o.splice(r,1)[0]),o}function uk(n,r){return n.reduce((s,o,a)=>{const u=r.get(o);return u&&(s[a]=u),s},Array(n.length))}function Da(n){return n!==null&&n>=0}function dk(n,r){if(n===r)return!0;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==r[s])return!1;return!0}function fk(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const Og=n=>{let{rects:r,activeIndex:s,overIndex:o,index:a}=n;const u=Pg(r,o,s),f=r[a],h=u[a];return!h||!f?null:{x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height}},Ma={scaleX:1,scaleY:1},$h=n=>{var r;let{activeIndex:s,activeNodeRect:o,index:a,rects:u,overIndex:f}=n;const h=(r=u[s])!=null?r:o;if(!h)return null;if(a===s){const m=u[f];return m?{x:0,y:s<f?m.top+m.height-(h.top+h.height):m.top-h.top,...Ma}:null}const g=pk(u,a,s);return a>s&&a<=f?{x:0,y:-h.height-g,...Ma}:a<s&&a>=f?{x:0,y:h.height+g,...Ma}:{x:0,y:0,...Ma}};function pk(n,r,s){const o=n[r],a=n[r-1],u=n[r+1];return o?s<r?a?o.top-(a.top+a.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):a?o.top-(a.top+a.height):0:0}const zg="Sortable",$g=st.createContext({activeIndex:-1,containerId:zg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Og,disabled:{draggable:!1,droppable:!1}});function Fh(n){let{children:r,id:s,items:o,strategy:a=Og,disabled:u=!1}=n;const{active:f,dragOverlay:h,droppableRects:g,over:m,measureDroppableContainers:v}=Mg(),k=No(zg,s),x=h.rect!==null,S=w.useMemo(()=>o.map(Q=>typeof Q=="object"&&"id"in Q?Q.id:Q),[o]),E=f!=null,C=f?S.indexOf(f.id):-1,T=m?S.indexOf(m.id):-1,I=w.useRef(S),R=!dk(S,I.current),B=T!==-1&&C===-1||R,$=fk(u);fr(()=>{R&&E&&v(S)},[R,S,E,v]),w.useEffect(()=>{I.current=S},[S]);const W=w.useMemo(()=>({activeIndex:C,containerId:k,disabled:$,disableTransforms:B,items:S,overIndex:T,useDragOverlay:x,sortedRects:uk(S,g),strategy:a}),[C,k,$.draggable,$.droppable,B,S,T,g,x,a]);return st.createElement($g.Provider,{value:W},r)}const hk=n=>{let{id:r,items:s,activeIndex:o,overIndex:a}=n;return Pg(s,o,a).indexOf(r)},mk=n=>{let{containerId:r,isSorting:s,wasDragging:o,index:a,items:u,newIndex:f,previousItems:h,previousContainerId:g,transition:m}=n;return!m||!o||h!==u&&a===f?!1:s?!0:f!==a&&r===g},gk={duration:200,easing:"ease"},Fg="transform",vk=Pr.Transition.toString({property:Fg,duration:0,easing:"linear"}),yk={roleDescription:"sortable"};function xk(n){let{disabled:r,index:s,node:o,rect:a}=n;const[u,f]=w.useState(null),h=w.useRef(s);return fr(()=>{if(!r&&s!==h.current&&o.current){const g=a.current;if(g){const m=ki(o.current,{ignoreTransform:!0}),v={x:g.left-m.left,y:g.top-m.top,scaleX:g.width/m.width,scaleY:g.height/m.height};(v.x||v.y)&&f(v)}}s!==h.current&&(h.current=s)},[r,s,o,a]),w.useEffect(()=>{u&&f(null)},[u]),u}function Ug(n){let{animateLayoutChanges:r=mk,attributes:s,disabled:o,data:a,getNewIndex:u=hk,id:f,strategy:h,resizeObserverConfig:g,transition:m=gk}=n;const{items:v,containerId:k,activeIndex:x,disabled:S,disableTransforms:E,sortedRects:C,overIndex:T,useDragOverlay:I,strategy:R}=w.useContext($g),B=wk(o,S),$=v.indexOf(f),W=w.useMemo(()=>({sortable:{containerId:k,index:$,items:v},...a}),[k,a,$,v]),Q=w.useMemo(()=>v.slice(v.indexOf(f)),[v,f]),{rect:K,node:X,isOver:ue,setNodeRef:me}=Lg({id:f,data:W,disabled:B.droppable,resizeObserverConfig:{updateMeasurementsFor:Q,...g}}),{active:de,activatorEvent:De,activeNodeRect:je,attributes:Le,setNodeRef:ne,listeners:q,isDragging:Y,over:P,setActivatorNodeRef:Z,transform:V}=K1({id:f,data:W,attributes:{...yk,...s},disabled:B.draggable}),j=Rw(me,ne),L=!!de,ce=L&&!E&&Da(x)&&Da(T),G=!I&&Y,le=G&&ce?V:null,Pe=ce?le??(h??R)({rects:C,activeNodeRect:je,activeIndex:x,overIndex:T,index:$}):null,Te=Da(x)&&Da(T)?u({id:f,items:v,activeIndex:x,overIndex:T}):$,Ee=de==null?void 0:de.id,Ce=w.useRef({activeId:Ee,items:v,newIndex:Te,containerId:k}),it=v!==Ce.current.items,Ne=r({active:de,containerId:k,isDragging:Y,isSorting:L,id:f,index:$,items:v,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:m,wasDragging:Ce.current.activeId!=null}),kt=xk({disabled:!Ne,index:$,node:X,rect:K});return w.useEffect(()=>{L&&Ce.current.newIndex!==Te&&(Ce.current.newIndex=Te),k!==Ce.current.containerId&&(Ce.current.containerId=k),v!==Ce.current.items&&(Ce.current.items=v)},[L,Te,k,v]),w.useEffect(()=>{if(Ee===Ce.current.activeId)return;if(Ee!=null&&Ce.current.activeId==null){Ce.current.activeId=Ee;return}const It=setTimeout(()=>{Ce.current.activeId=Ee},50);return()=>clearTimeout(It)},[Ee]),{active:de,activeIndex:x,attributes:Le,data:W,rect:K,index:$,newIndex:Te,items:v,isOver:ue,isSorting:L,isDragging:Y,listeners:q,node:X,overIndex:T,over:P,setNodeRef:j,setActivatorNodeRef:Z,setDroppableNodeRef:me,setDraggableNodeRef:ne,transform:kt??Pe,transition:$e()};function $e(){if(kt||it&&Ce.current.newIndex===$)return vk;if(!(G&&!wl(De)||!m)&&(L||Ne))return Pr.Transition.toString({...m,property:Fg})}}function wk(n,r){var s,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(s=n==null?void 0:n.draggable)!=null?s:r.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:r.droppable}}et.Down,et.Right,et.Up,et.Left;function La(n){const[r,s]=w.useState(()=>{try{const a=localStorage.getItem(n);if(a==null)return new Set;const u=JSON.parse(a);return Array.isArray(u)?new Set(u.filter(f=>typeof f=="string")):new Set}catch{return new Set}}),o=w.useCallback(a=>{s(u=>{const f=a(new Set(u));try{localStorage.setItem(n,JSON.stringify([...f]))}catch{}return f})},[n]);return[r,o]}function kk(n,r=!1){const[s,o]=w.useState(()=>{try{const u=localStorage.getItem(n);return u==="1"?!0:u==="0"?!1:r}catch{return r}}),a=w.useCallback(u=>{o(u);try{localStorage.setItem(n,u?"1":"0")}catch{}},[n]);return[s,a]}async function Pu(n){try{return await navigator.clipboard.writeText(n),!0}catch{try{const r=document.createElement("textarea");r.value=n,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const s=document.execCommand("copy");return document.body.removeChild(r),s}catch{return!1}}}function Sk(n){return n.origin_app_id!=null&&!n.user_touched&&!n.starred}function ol(n){return n.replaceAll("\\","/").replace(/\/+$/,"")}function Uh(n,r){if(!r||!n.cwd)return!1;const s=ol(n.cwd),o=ol(r);return s.startsWith(`${o}/`)}function bk(n,r){const s=new Map;for(const f of r){const h=f.cwd||"(no directory)",g=s.get(h)??[];g.push(f),s.set(h,g)}const o=new Set,a=new Set(n.filter(f=>f.deleted===1).map(f=>f.path)),u=[];for(const f of n){if(f.deleted===1){o.add(f.path);continue}o.add(f.path),u.push({path:f.path,label:f.label||f.path.split("/").pop()||f.path,sessions:s.get(f.path)??[],workspace:f})}for(const[f,h]of s)o.has(f)||a.has(f)||u.push({path:f,label:f==="(no directory)"?"Other":f.split("/").pop()||f,sessions:h,workspace:null});return u}function al(n){return[...n].sort((r,s)=>s.sort_order-r.sort_order||(r.created_at<s.created_at?1:-1))}function Bh(n,r,s,o){const a=r.map(u=>({folder:u,sessions:n.sessions.filter(f=>f.folder_id===u.id),finishedKey:`folder:${u.id}:finished`,hidden:o.has(u.id)}));return a.push({folder:null,sessions:n.sessions.filter(u=>!(u.folder_id&&s.has(u.folder_id))),finishedKey:`${n.path}:finished`,hidden:!1}),a}function Wh(n,r){return{working:al(n.sessions.filter(s=>s.lifecycle!=="finished")),finished:al(n.sessions.filter(s=>s.lifecycle==="finished")),finishedCollapsed:r.has(n.finishedKey)}}function Pa(n,r){return n.folder_id&&r.has(n.folder_id)?n.folder_id:null}function Tk(n){const r=new Set(n.map(o=>o.name));if(!r.has("New Folder"))return"New Folder";let s=2;for(;r.has(`New Folder ${s}`);)s++;return`New Folder ${s}`}function Hh({id:n,children:r,className:s}){const{setNodeRef:o,isOver:a}=Lg({id:n});return c.jsx("div",{ref:o,className:`${s??""}${a?" drop-over":""}`,children:r})}function pd({inputRef:n,value:r,onChange:s,onConfirm:o,onCancel:a}){return c.jsx("input",{ref:n,className:"tree-rename-input",value:r,onChange:u=>s(u.target.value),onClick:u=>u.stopPropagation(),onPointerDown:u=>u.stopPropagation(),onKeyDown:u=>{u.key==="Enter"&&o(),u.key==="Escape"&&a()},onBlur:o})}function Nk({s:n,backgroundTaskCount:r,isActive:s,isSelected:o,originApp:a,renaming:u,renameValue:f,renameRef:h,onRenameValue:g,onRenameConfirm:m,onRenameCancel:v,onSelect:k,onCtxMenu:x,onToggleStar:S}){const{attributes:E,listeners:C,setNodeRef:T,transform:I,transition:R,isDragging:B}=Ug({id:`s:${n.id}`}),$=ml(n,r);return c.jsxs("div",{ref:T,style:{transform:Pr.Transform.toString(I),transition:R},className:`tree-item ${s?"active":""}${o?" selected":""} ${$.isFinished?"tree-item-finished":""}${B?" dragging":""}${n.starred?" tree-item-starred":""}`,...E,...C,onClick:k,onContextMenu:x,children:[c.jsx(sd,{iconClass:$.iconClass,iconText:$.iconText,size:16}),a&&c.jsx("span",{className:"tree-app-badge",title:"Created by a mini app",children:c.jsx(yi,{iconNode:a.iconNode,size:10})}),u?c.jsx(pd,{inputRef:h,value:f,onChange:g,onConfirm:m,onCancel:v}):c.jsx("span",{className:"tree-label",children:n.title||n.id.slice(0,8)}),!u&&c.jsx("button",{className:`star-btn${n.starred?" starred":""}`,title:n.starred?"Unstar session":"Star session",onClick:W=>{W.stopPropagation(),S()},onPointerDown:W=>W.stopPropagation(),children:c.jsx(Ja,{size:10,fill:n.starred?"currentColor":"none"})}),$.dot&&c.jsx(rd,{status:$.dot,title:$.dotTitle})]})}function Ck({folder:n,count:r,collapsed:s,renaming:o,renameValue:a,renameRef:u,onRenameValue:f,onRenameConfirm:h,onRenameCancel:g,onToggle:m,onCtxMenu:v,children:k}){const{attributes:x,listeners:S,setNodeRef:E,transform:C,transition:T,isDragging:I,over:R}=Ug({id:`f:${n.id}`}),B=R!=null&&String(R.id).startsWith("s:");return c.jsxs("div",{ref:E,style:{transform:Pr.Transform.toString(C),transition:T},className:`tree-folder ${s?"collapsed":""}${I?" dragging":""}`,children:[c.jsx("div",{className:`tree-folder-header${B?" drop-over":""}`,...x,...S,onClick:()=>{o||m()},onContextMenu:v,children:o?c.jsx(pd,{inputRef:u,value:a,onChange:f,onConfirm:h,onCancel:g}):c.jsxs(c.Fragment,{children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx(Iu,{size:12}),c.jsx("span",{className:"tree-folder-label",children:n.name}),c.jsx("span",{className:"tree-count",children:r})]})}),!s&&c.jsx("div",{className:"tree-folder-children",children:k})]})}function Ek(){const n=M(_=>_.sessions),r=M(_=>_.backgroundTasks),s=M(_=>_.workspaces),o=M(_=>_.folders),a=M(_=>_.activeSessionId),u=M(_=>_.selectSession),f=M(_=>_.deleteSession),h=M(_=>_.removeWorkspace),g=M(_=>_.createSessionInWorkspace),m=M(_=>_.pickAndAddWorkspace),v=M(_=>_.renameSession),k=M(_=>_.markFinished),x=M(_=>_.markFinishedMany),S=M(_=>_.toggleStar),E=M(_=>_.reopenSession),C=M(_=>_.reopenSessionMany),T=M(_=>_.deleteSessionMany),I=M(_=>_.createSidebarFolder),R=M(_=>_.renameFolder),B=M(_=>_.deleteFolder),$=M(_=>_.applyMoves),W=M(_=>_.reorderFolders),Q=M(_=>_.apps),K=M(_=>_.appsRootPath),X=M(_=>_.activeAppTabId),ue=M(_=>_.openAppTab),me=M(_=>_.startAppEdit),de=M(_=>_.toggleAppPin),De=M(_=>_.deleteApp),je=M(_=>_.openAppCatalog),[Le,ne]=La("agentpane:sidebar-ws-collapsed"),[q,Y]=La("agentpane:sidebar-sub-collapsed"),[P,Z]=La("agentpane:sidebar-folders-collapsed"),[V,j]=La("agentpane:sidebar-app-edits-collapsed"),[L,ce]=kk("agentpane:sidebar-hide-auto-sessions"),[G,le]=w.useState(null),[fe,Pe]=w.useState(null),[Te,Ee]=w.useState(""),[Ce,it]=w.useState(null),[Ne,kt]=w.useState(new Set),[$e,It]=w.useState(null),Fe=w.useRef(null),Dt=w.useRef(null),jn=w.useRef(null),St=w.useRef(!1),Mt=Vw(Hw(dd,{activationConstraint:{distance:5}}));function ht(){kt(new Set),It(null)}gl(Fe,()=>le(null),!!G),nd(()=>{le(null),ht()},!!G||Ne.size>0),w.useLayoutEffect(()=>{const _=Fe.current;if(!G||!_)return;const ie=8,{offsetWidth:se,offsetHeight:ge}=_,ze=G.x+se>window.innerWidth-ie?Math.max(ie,G.x-se):G.x,Be=G.y+ge>window.innerHeight-ie?Math.max(ie,G.y-ge):G.y;_.style.left=`${ze}px`,_.style.top=`${Be}px`},[G]);const en=w.useMemo(()=>new Map(n.map(_=>[_.id,_])),[n]),H=w.useMemo(()=>new Map(o.map(_=>[_.id,_])),[o]),pe=w.useMemo(()=>{const _=new Map;for(const ie of[...o].sort((se,ge)=>se.sort_order-ge.sort_order)){const se=_.get(ie.workspace_path)??[];se.push(ie),_.set(ie.workspace_path,se)}return _},[o]);function Ue(_){ne(ie=>{const se=new Set(ie);return se.has(_)?se.delete(_):se.add(_),se})}function tt(_){Y(ie=>{const se=new Set(ie);return se.has(_)?se.delete(_):se.add(_),se})}function mt(_){Z(ie=>{const se=new Set(ie);return se.has(_)?se.delete(_):se.add(_),se})}function gt(){ce(!L),ht()}function Rt(_){j(ie=>{const se=new Set(ie);return se.has(_)?se.delete(_):se.add(_),se})}w.useEffect(()=>{fe&&Dt.current&&(Dt.current.focus(),Dt.current.select())},[fe]),w.useEffect(()=>{var _,ie,se;St.current||!a||(St.current=!0,(se=(ie=(_=jn.current)==null?void 0:_.querySelector(".tree-item.active, .sidebar-app-edit-row.active"))==null?void 0:ie.scrollIntoView)==null||se.call(ie,{block:"nearest"}))},[a]);function Ht(_,ie,se,ge=""){Pe({kind:_,id:ie}),Ee(se||ge)}function ut(){if(fe){const _=Te.trim();_&&(fe.kind==="session"?v(fe.id,_):R(fe.id,_))}Pe(null)}function Rn(){Pe(null),Ee("")}async function Hn(_){const ie=Tk(pe.get(_)??[]),se=await I(_,ie);se&&Ht("folder",se.id,se.name)}function br(_){const ie=String(_.active.id);if(ie.startsWith("s:")){const se=en.get(ie.slice(2));se&&it({kind:"session",label:se.title||se.id.slice(0,8)})}else if(ie.startsWith("f:")){const se=H.get(ie.slice(2));se&&it({kind:"folder",label:se.name})}}function hr(_){it(null);const{active:ie,over:se}=_;if(!se)return;const ge=String(ie.id),ze=String(se.id);if(ge.startsWith("s:")){const Be=en.get(ge.slice(2));if(!Be)return;const Ie=Be.cwd||"(no directory)",at=Pa(Be,H);let Dn,Mn;if(ze.startsWith("f:")){const Xe=H.get(ze.slice(2));if(!Xe)return;Dn=Xe.workspace_path,Mn=Xe.id}else if(ze.startsWith("s:")){const Xe=en.get(ze.slice(2));if(!Xe)return;Dn=Xe.cwd||"(no directory)",Mn=Pa(Xe,H)}else if(ze.startsWith("c:")){const Xe=ze.slice(2),Tt=Xe.lastIndexOf("|");Dn=Xe.slice(0,Tt);const rr=Xe.slice(Tt+1);Mn=rr==="root"?null:rr}else return;if(Dn!==Ie)return;const He=al(n.filter(Xe=>(Xe.cwd||"(no directory)")===Dn&&Pa(Xe,H)===Mn)),kn=He.filter(Xe=>Xe.id!==Be.id);let Or=kn.length;if(ze.startsWith("s:")){const Xe=kn.findIndex(Tt=>Tt.id===ze.slice(2));Xe>=0&&(Or=Xe)}const tr=[...kn.slice(0,Or),Be,...kn.slice(Or)],nr=[];if(Mn===at){if(tr.length===He.length&&tr.every((Xe,Tt)=>Xe.id===He[Tt].id))return;tr.forEach((Xe,Tt)=>nr.push({id:Xe.id,folder_id:Mn,sort_order:tr.length-1-Tt}))}else{const Xe=al(n.filter(Tt=>(Tt.cwd||"(no directory)")===Ie&&Pa(Tt,H)===at)).filter(Tt=>Tt.id!==Be.id);Xe.forEach((Tt,rr)=>nr.push({id:Tt.id,folder_id:at,sort_order:Xe.length-1-rr})),tr.forEach((Tt,rr)=>nr.push({id:Tt.id,folder_id:Mn,sort_order:tr.length-1-rr}))}$(nr);return}if(ge.startsWith("f:")){if(!ze.startsWith("f:"))return;const Be=H.get(ge.slice(2)),Ie=H.get(ze.slice(2));if(!Be||!Ie||Be.id===Ie.id||Be.workspace_path!==Ie.workspace_path)return;const at=(pe.get(Be.workspace_path)??[]).map(He=>He.id),Dn=at.indexOf(Be.id),Mn=at.indexOf(Ie.id);at.splice(Mn,0,...at.splice(Dn,1)),W(at)}}const An=K?n.filter(_=>!Uh(_,K)):n,In=new Set(L?An.filter(_=>Sk(_)&&_.id!==a).map(_=>_.id):[]),fn=bk(s,In.size>0?An.filter(_=>!In.has(_.id)):An),wn=w.useMemo(()=>{const _=new Map;if(!K)return _;const ie=ol(K);for(const se of n){if(!Uh(se,K))continue;const ge=ol(se.cwd).slice(ie.length+1).split("/")[0],ze=_.get(ge)??[];ze.push(se),_.set(ge,ze)}return _},[n,K]);function Ft(_){return{folder:null,sessions:wn.get(_)??[],finishedKey:`app:${_}:finished`,hidden:V.has(_)}}const Vt=[],rt=_=>{if(_.hidden)return;const{working:ie,finished:se,finishedCollapsed:ge}=Wh(_,q);Vt.push(...ie.map(ze=>ze.id)),ge||Vt.push(...se.map(ze=>ze.id))};for(const _ of fn){if(Le.has(_.path))continue;const ie=pe.get(_.path)??[],se=new Set(ie.map(ge=>ge.id));Bh(_,ie,se,P).forEach(rt)}Q.forEach(_=>rt(Ft(_.id)));const vt=n.filter(_=>Ne.has(_.id)),yt=vt.filter(_=>_.lifecycle!=="finished").map(_=>_.id),qt=vt.filter(_=>_.lifecycle==="finished").map(_=>_.id);function bt(_,ie){if(ie.metaKey||ie.ctrlKey){ie.preventDefault(),It(_.id),kt(se=>{const ge=new Set(se);return ge.has(_.id)?ge.delete(_.id):ge.add(_.id),ge});return}if(ie.shiftKey){ie.preventDefault();const se=$e??_.id;It(se);const ge=Vt.indexOf(se),ze=Vt.indexOf(_.id);if(ge>=0&&ze>=0){const[Be,Ie]=ge<ze?[ge,ze]:[ze,ge];kt(new Set(Vt.slice(Be,Ie+1)))}return}ht(),It(_.id),u(_.id)}function xt(_,ie){ie.preventDefault();const se=Ne.has(_.id)&&Ne.size>1;Ne.has(_.id)||(kt(new Set),It(_.id)),le({x:ie.clientX,y:ie.clientY,type:"session",sessionId:_.id,sessionTitle:_.title,sessionLifecycle:_.lifecycle,sessionExternalId:_.external_thread_id,multi:se})}function ot(_){var se;const ie=_.origin_app_id?Q.find(ge=>ge.id===_.origin_app_id):null;return c.jsx(Nk,{s:_,backgroundTaskCount:((se=r[_.id])==null?void 0:se.length)??0,isActive:a===_.id,isSelected:Ne.has(_.id),originApp:ie??null,renaming:(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id,renameValue:Te,renameRef:Dt,onRenameValue:Ee,onRenameConfirm:ut,onRenameCancel:Rn,onSelect:ge=>bt(_,ge),onToggleStar:()=>S(_.id),onCtxMenu:ge=>xt(_,ge)},_.id)}function Gt(_){var se;const ie=ml(_,((se=r[_.id])==null?void 0:se.length)??0);return c.jsxs("div",{className:`sidebar-app-edit-row${a===_.id?" active":""}${Ne.has(_.id)?" selected":""}${ie.isFinished?" tree-item-finished":""}`,title:"App edit session — click to open",onClick:ge=>bt(_,ge),onContextMenu:ge=>xt(_,ge),children:[c.jsx(sd,{iconClass:ie.iconClass,iconText:ie.iconText,size:14}),(fe==null?void 0:fe.kind)==="session"&&fe.id===_.id?c.jsx(pd,{inputRef:Dt,value:Te,onChange:Ee,onConfirm:ut,onCancel:Rn}):c.jsx("span",{className:"tree-label",children:_.title||_.id.slice(0,8)}),ie.dot&&c.jsx(rd,{status:ie.dot,title:ie.dotTitle})]},_.id)}function Je(_,ie="workspace"){const{working:se,finished:ge,finishedCollapsed:ze}=Wh(_,q),Be=ie==="workspace"?ot:Gt,Ie=c.jsxs(c.Fragment,{children:[se.length===0&&ge.length===0?c.jsx("div",{className:"tree-empty",children:"No sessions"}):se.map(Be),ge.length>0&&c.jsxs("div",{className:`tree-subgroup ${ze?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-subgroup-header",onClick:()=>tt(_.finishedKey),children:[c.jsx(mi,{size:8,className:"tree-chevron"}),c.jsx("span",{className:"tree-subgroup-label",children:"Finished"}),c.jsx("span",{className:"tree-subgroup-count",children:ge.length})]}),!ze&&c.jsx("div",{className:"tree-subgroup-items",children:ge.map(Be)})]})]});if(ie==="app")return Ie;const at=[...se,...ge].map(Dn=>`s:${Dn.id}`);return c.jsx(Fh,{items:at,strategy:$h,children:Ie})}return c.jsxs("div",{className:"ide-sidebar",ref:jn,children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("span",{className:"sidebar-header-title",children:"Workspaces"}),c.jsxs("div",{className:"sidebar-header-actions",children:[c.jsx("button",{className:`sidebar-add sidebar-filter${L?" active":""}`,title:L?`Show automatic sessions (${In.size} hidden)`:"Hide automatic sessions — the ones mini apps run on their own. Sessions you message, stop, rewind, rename or star stay visible.","aria-label":L?"Show automatic sessions":"Hide automatic sessions","aria-pressed":L,onClick:gt,children:L?c.jsx(V0,{size:14}):c.jsx(ls,{size:14})}),c.jsx("button",{className:"sidebar-add",title:"Add workspace",onClick:()=>m(),children:c.jsx(Rs,{size:14})})]})]}),c.jsxs(V1,{sensors:Mt,collisionDetection:Qw,onDragStart:br,onDragEnd:hr,children:[fn.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No workspaces yet. Click + to add one."}):fn.map(_=>{const ie=Le.has(_.path),se=pe.get(_.path)??[],ge=new Set(se.map(Ie=>Ie.id)),ze=Bh(_,se,ge,P),Be=ze[ze.length-1];return c.jsxs("div",{className:`tree-section ${ie?"collapsed":""}`,children:[c.jsxs("div",{className:"tree-section-header",onClick:()=>Ue(_.path),onContextMenu:Ie=>{Ie.preventDefault(),le({x:Ie.clientX,y:Ie.clientY,type:"workspace",path:_.path})},children:[c.jsx(mi,{size:9,className:"tree-chevron"}),c.jsx(Iu,{size:14}),c.jsx("span",{className:"tree-section-label",children:_.label}),c.jsx("button",{className:"tree-section-add",title:"New session in this workspace",onClick:Ie=>{Ie.stopPropagation(),g(_.path)},children:c.jsx(Rs,{size:11})}),c.jsx("button",{className:"tree-section-add",title:"New folder in this workspace",onClick:Ie=>{Ie.stopPropagation(),Hn(_.path)},children:c.jsx(hu,{size:11})}),c.jsx("span",{className:"tree-count",children:_.sessions.length})]}),!ie&&c.jsxs("div",{className:"tree-children",children:[c.jsx(Fh,{items:se.map(Ie=>`f:${Ie.id}`),strategy:$h,children:ze.filter(Ie=>Ie.folder).map(Ie=>c.jsx(Ck,{folder:Ie.folder,count:Ie.sessions.length,collapsed:Ie.hidden,renaming:(fe==null?void 0:fe.kind)==="folder"&&fe.id===Ie.folder.id,renameValue:Te,renameRef:Dt,onRenameValue:Ee,onRenameConfirm:ut,onRenameCancel:Rn,onToggle:()=>mt(Ie.folder.id),onCtxMenu:at=>{at.preventDefault(),le({x:at.clientX,y:at.clientY,type:"folder",folderId:Ie.folder.id,folderName:Ie.folder.name})},children:c.jsx(Hh,{id:`c:${_.path}|${Ie.folder.id}`,children:Je(Ie)})},Ie.folder.id))}),c.jsx(Hh,{id:`c:${_.path}|root`,children:Je(Be)})]})]},_.path)}),c.jsx(ck,{children:Ce&&c.jsxs("div",{className:"drag-overlay",children:[Ce.kind==="folder"&&c.jsx(Iu,{size:12}),c.jsx("span",{children:Ce.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:()=>je(),children:c.jsx(Rs,{size:14})})]}),Q.length===0&&c.jsx("div",{className:"tree-empty",children:"No apps yet"}),Q.map(_=>{const ie=Ft(_.id),se=ie.sessions.length>0&&!ie.hidden;return c.jsxs("div",{className:"sidebar-app-block",children:[c.jsxs("div",{className:`sidebar-app-row${X===_.id?" active":""}`,title:_.description??void 0,onClick:()=>ue(_.id),onContextMenu:ge=>{ge.preventDefault(),le({x:ge.clientX,y:ge.clientY,type:"app",appId:_.id,appPinned:_.pinned})},children:[ie.sessions.length>0&&c.jsx("button",{className:`sidebar-app-chevron${se?"":" closed"}`,title:"Edit sessions of this app",onClick:ge=>{ge.stopPropagation(),Rt(_.id)},children:c.jsx(mi,{size:10,className:"tree-chevron"})}),c.jsx(yi,{iconNode:_.iconNode,size:14,className:"sidebar-app-icon"}),c.jsx("span",{className:"tree-label",children:_.title}),ie.sessions.length>0&&c.jsx("span",{className:"sidebar-app-count",children:ie.sessions.length}),_.pinned&&c.jsx(Ja,{size:10,className:"sidebar-app-pin",fill:"currentColor"})]}),se&&c.jsx("div",{className:"sidebar-app-edits",children:Je(ie,"app")})]},_.id)})]}),c.jsxs("div",{className:"sidebar-footer",onClick:()=>m(),children:[c.jsx(hu,{size:14}),c.jsx("span",{children:"Add workspace"})]}),G&&c.jsxs("div",{ref:Fe,className:"ctx-menu",style:{position:"fixed",left:G.x,top:G.y,zIndex:500},children:[G.type==="workspace"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{g(G.path),le(null)},children:[c.jsx(Rs,{size:12})," New Session"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Hn(G.path),le(null)},children:[c.jsx(hu,{size:12})," New Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{h(G.path),le(null)},children:[c.jsx(dr,{size:12})," Hide Workspace"]})]}),G.type==="folder"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("folder",G.folderId,G.folderName??""),le(null)},children:[c.jsx(Ba,{size:12})," Rename Folder"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{B(G.folderId),le(null)},children:[c.jsx(dr,{size:12})," Delete Folder"]})]}),G.type==="session"&&!G.multi&&c.jsx(c.Fragment,{children:G.sessionLifecycle!=="finished"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{Ht("session",G.sessionId,G.sessionTitle??""),le(null)},children:[c.jsx(Ba,{size:12})," Rename"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{k(G.sessionId),le(null)},children:[c.jsx(Za,{size:12})," Mark as Finished"]}),c.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(Pu(G.sessionExternalId),le(null))},children:[c.jsx(Au,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(G.sessionId),le(null)},children:[c.jsx(dr,{size:12})," Delete Session"]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{E(G.sessionId),le(null)},children:[c.jsx(yo,{size:12})," Reopen"]}),c.jsxs("div",{className:`ctx-menu-item${G.sessionExternalId?"":" ctx-disabled"}`,title:G.sessionExternalId?void 0:"Session not started",onClick:()=>{G.sessionExternalId&&(Pu(G.sessionExternalId),le(null))},children:[c.jsx(Au,{size:12})," Copy Session ID"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{f(G.sessionId),le(null)},children:[c.jsx(dr,{size:12})," Delete Session"]})]})}),G.type==="session"&&G.multi&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-header",children:[vt.length," sessions selected"]}),yt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{x(yt),le(null),ht()},children:[c.jsx(Za,{size:12})," Mark ",yt.length," as Finished"]}),qt.length>0&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{C(qt),le(null),ht()},children:[c.jsx(yo,{size:12})," Reopen ",qt.length]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{T([...Ne]),le(null),ht()},children:[c.jsx(dr,{size:12})," Delete ",vt.length," Sessions"]})]}),G.type==="app"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{me(G.appId),le(null)},children:[c.jsx(Ba,{size:12})," Edit App"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{de(G.appId),le(null)},children:[c.jsx(Ja,{size:12})," ",G.appPinned?"Unpin":"Pin"]}),c.jsxs("div",{className:"ctx-menu-item ctx-danger",onClick:()=>{De(G.appId),le(null)},children:[c.jsx(dr,{size:12})," Delete App"]})]})]})]})}function _k(){const n=M(S=>S.openTabs),r=M(S=>S.activeSessionId),s=M(S=>S.sessions),o=M(S=>S.backgroundTasks),a=M(S=>S.selectSession),u=M(S=>S.closeTab),f=M(S=>S.setShowNewSessionDialog),h=M(S=>S.apps),g=M(S=>S.openAppTabs),m=M(S=>S.activeAppTabId),v=M(S=>S.openAppTab),k=M(S=>S.closeAppTab),x=M(S=>S.setActiveAppTab);return c.jsxs("div",{className:"ide-tabs",children:[n.map(S=>{var I;const E=s.find(R=>R.id===S);if(!E)return null;const C=ml(E,((I=o[S])==null?void 0:I.length)??0),T=r===S&&m==null;return c.jsxs("div",{className:`ide-tab ${T?"active":""}`,onClick:()=>{m!=null&&x(null),a(S)},children:[c.jsx(sd,{iconClass:C.iconClass,iconText:C.iconText,size:14}),E.title||S.slice(0,8),C.dot&&c.jsx(rd,{status:C.dot,title:C.dotTitle}),c.jsx("span",{className:"ide-tab-close",onClick:R=>{R.stopPropagation(),u(S)},children:c.jsx(Wn,{size:12})})]},S)}),g.map(S=>{const E=h.find(T=>T.id===S),C=m===S;return c.jsxs("div",{className:`ide-tab ${C?"active":""}`,onClick:()=>v(S),children:[c.jsx(yi,{iconNode:E==null?void 0:E.iconNode,size:12,className:"miniapp-tab-icon"}),(E==null?void 0:E.title)??S,c.jsx("span",{className:"ide-tab-close",onClick:T=>{T.stopPropagation(),k(S)},children:c.jsx(Wn,{size:12})})]},S)}),c.jsx("div",{className:"ide-tab-add",title:"New Session",onClick:()=>f(!0),children:c.jsx(Rs,{size:14})})]})}function hd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ms=hd();function Bg(n){Ms=n}var ho={exec:()=>null};function nt(n,r=""){let s=typeof n=="string"?n:n.source;const o={replace:(a,u)=>{let f=typeof u=="string"?u:u.source;return f=f.replace(vn.caret,"$1"),s=s.replace(a,f),o},getRegex:()=>new RegExp(s,r)};return o}var vn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},jk=/^(?:[ \t]*(?:\n|$))+/,Rk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ak=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Eo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ik=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,md=/(?:[*+-]|\d{1,9}[.)])/,Wg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hg=nt(Wg).replace(/bull/g,md).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(),Dk=nt(Wg).replace(/bull/g,md).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(),gd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Mk=/^[^\n]+/,vd=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Lk=nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pk=nt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,md).getRegex(),bl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",yd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ok=nt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",yd).replace("tag",bl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Vg=nt(gd).replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bl).getRegex(),zk=nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Vg).getRegex(),xd={blockquote:zk,code:Rk,def:Lk,fences:Ak,heading:Ik,hr:Eo,html:Ok,lheading:Hg,list:Pk,newline:jk,paragraph:Vg,table:ho,text:Mk},Vh=nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bl).getRegex(),$k={...xd,lheading:Dk,table:Vh,paragraph:nt(gd).replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Vh).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",bl).getRegex()},Fk={...xd,html:nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",yd).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:ho,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:nt(gd).replace("hr",Eo).replace("heading",` *#{1,6} *[^
|
|
404
|
+
]`).replace("lheading",Hg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Uk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Bk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qg=/^( {2,}|\\)\n(?!\s*$)/,Wk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Tl=/[\p{P}\p{S}]/u,wd=/[\s\p{P}\p{S}]/u,Gg=/[^\s\p{P}\p{S}]/u,Hk=nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wd).getRegex(),Kg=/(?!~)[\p{P}\p{S}]/u,Vk=/(?!~)[\s\p{P}\p{S}]/u,qk=/(?:[^\s\p{P}\p{S}]|~)/u,Gk=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Yg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Kk=nt(Yg,"u").replace(/punct/g,Tl).getRegex(),Yk=nt(Yg,"u").replace(/punct/g,Kg).getRegex(),Xg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xk=nt(Xg,"gu").replace(/notPunctSpace/g,Gg).replace(/punctSpace/g,wd).replace(/punct/g,Tl).getRegex(),Qk=nt(Xg,"gu").replace(/notPunctSpace/g,qk).replace(/punctSpace/g,Vk).replace(/punct/g,Kg).getRegex(),Zk=nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gg).replace(/punctSpace/g,wd).replace(/punct/g,Tl).getRegex(),Jk=nt(/\\(punct)/,"gu").replace(/punct/g,Tl).getRegex(),eS=nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=nt(yd).replace("(?:-->|$)","-->").getRegex(),nS=nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ll=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ll).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qg=nt(/^!?\[(label)\]\[(ref)\]/).replace("label",ll).replace("ref",vd).getRegex(),Zg=nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vd).getRegex(),sS=nt("reflink|nolink(?!\\()","g").replace("reflink",Qg).replace("nolink",Zg).getRegex(),kd={_backpedal:ho,anyPunctuation:Jk,autolink:eS,blockSkip:Gk,br:qg,code:Bk,del:ho,emStrongLDelim:Kk,emStrongRDelimAst:Xk,emStrongRDelimUnd:Zk,escape:Uk,link:rS,nolink:Zg,punctuation:Hk,reflink:Qg,reflinkSearch:sS,tag:nS,text:Wk,url:ho},iS={...kd,link:nt(/^!?\[(label)\]\((.*?)\)/).replace("label",ll).getRegex(),reflink:nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ll).getRegex()},Ou={...kd,emStrongRDelimAst:Qk,emStrongLDelim:Yk,url:nt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={...Ou,br:nt(qg).replace("{2,}","*").getRegex(),text:nt(Ou.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Oa={normal:xd,gfm:$k,pedantic:Fk},no={normal:kd,gfm:Ou,breaks:oS,pedantic:iS},aS={"&":"&","<":"<",">":">",'"':""","'":"'"},qh=n=>aS[n];function kr(n,r){if(r){if(vn.escapeTest.test(n))return n.replace(vn.escapeReplace,qh)}else if(vn.escapeTestNoEncode.test(n))return n.replace(vn.escapeReplaceNoEncode,qh);return n}function Gh(n){try{n=encodeURI(n).replace(vn.percentDecode,"%")}catch{return null}return n}function Kh(n,r){var u;const s=n.replace(vn.findPipe,(f,h,g)=>{let m=!1,v=h;for(;--v>=0&&g[v]==="\\";)m=!m;return m?"|":" |"}),o=s.split(vn.splitPipe);let a=0;if(o[0].trim()||o.shift(),o.length>0&&!((u=o.at(-1))!=null&&u.trim())&&o.pop(),r)if(o.length>r)o.splice(r);else for(;o.length<r;)o.push("");for(;a<o.length;a++)o[a]=o[a].trim().replace(vn.slashPipe,"|");return o}function ro(n,r,s){const o=n.length;if(o===0)return"";let a=0;for(;a<o&&n.charAt(o-a-1)===r;)a++;return n.slice(0,o-a)}function lS(n,r){if(n.indexOf(r[1])===-1)return-1;let s=0;for(let o=0;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===r[0])s++;else if(n[o]===r[1]&&(s--,s<0))return o;return s>0?-2:-1}function Yh(n,r,s,o,a){const u=r.href,f=r.title||null,h=n[1].replace(a.other.outputLinkReplace,"$1");o.state.inLink=!0;const g={type:n[0].charAt(0)==="!"?"image":"link",raw:s,href:u,title:f,text:h,tokens:o.inlineTokens(h)};return o.state.inLink=!1,g}function cS(n,r,s){const o=n.match(s.other.indentCodeCompensation);if(o===null)return r;const a=o[1];return r.split(`
|
|
405
|
+
`).map(u=>{const f=u.match(s.other.beginningSpace);if(f===null)return u;const[h]=f;return h.length>=a.length?u.slice(a.length):u}).join(`
|
|
406
|
+
`)}var cl=class{constructor(n){lt(this,"options");lt(this,"rules");lt(this,"lexer");this.options=n||Ms}space(n){const r=this.rules.block.newline.exec(n);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(n){const r=this.rules.block.code.exec(n);if(r){const s=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?s:ro(s,`
|
|
407
|
+
`)}}}fences(n){const r=this.rules.block.fences.exec(n);if(r){const s=r[0],o=cS(s,r[3]||"",this.rules);return{type:"code",raw:s,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(n){const r=this.rules.block.heading.exec(n);if(r){let s=r[2].trim();if(this.rules.other.endingHash.test(s)){const o=ro(s,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(s=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(n){const r=this.rules.block.hr.exec(n);if(r)return{type:"hr",raw:ro(r[0],`
|
|
408
|
+
`)}}blockquote(n){const r=this.rules.block.blockquote.exec(n);if(r){let s=ro(r[0],`
|
|
409
|
+
`).split(`
|
|
410
|
+
`),o="",a="";const u=[];for(;s.length>0;){let f=!1;const h=[];let g;for(g=0;g<s.length;g++)if(this.rules.other.blockquoteStart.test(s[g]))h.push(s[g]),f=!0;else if(!f)h.push(s[g]);else break;s=s.slice(g);const m=h.join(`
|
|
411
|
+
`),v=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
412
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
413
|
+
${m}`:m,a=a?`${a}
|
|
414
|
+
${v}`:v;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(v,u,!0),this.lexer.state.top=k,s.length===0)break;const x=u.at(-1);if((x==null?void 0:x.type)==="code")break;if((x==null?void 0:x.type)==="blockquote"){const S=x,E=S.raw+`
|
|
415
|
+
`+s.join(`
|
|
416
|
+
`),C=this.blockquote(E);u[u.length-1]=C,o=o.substring(0,o.length-S.raw.length)+C.raw,a=a.substring(0,a.length-S.text.length)+C.text;break}else if((x==null?void 0:x.type)==="list"){const S=x,E=S.raw+`
|
|
417
|
+
`+s.join(`
|
|
418
|
+
`),C=this.list(E);u[u.length-1]=C,o=o.substring(0,o.length-x.raw.length)+C.raw,a=a.substring(0,a.length-S.raw.length)+C.raw,s=E.substring(u.at(-1).raw.length).split(`
|
|
419
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:u,text:a}}}list(n){let r=this.rules.block.list.exec(n);if(r){let s=r[1].trim();const o=s.length>1,a={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");const u=this.rules.other.listItemRegex(s);let f=!1;for(;n;){let g=!1,m="",v="";if(!(r=u.exec(n))||this.rules.block.hr.test(n))break;m=r[0],n=n.substring(m.length);let k=r[2].split(`
|
|
420
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,I=>" ".repeat(3*I.length)),x=n.split(`
|
|
421
|
+
`,1)[0],S=!k.trim(),E=0;if(this.options.pedantic?(E=2,v=k.trimStart()):S?E=r[1].length+1:(E=r[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,v=k.slice(E),E+=r[1].length),S&&this.rules.other.blankLine.test(x)&&(m+=x+`
|
|
422
|
+
`,n=n.substring(x.length+1),g=!0),!g){const I=this.rules.other.nextBulletRegex(E),R=this.rules.other.hrRegex(E),B=this.rules.other.fencesBeginRegex(E),$=this.rules.other.headingBeginRegex(E),W=this.rules.other.htmlBeginRegex(E);for(;n;){const Q=n.split(`
|
|
423
|
+
`,1)[0];let K;if(x=Q,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),K=x):K=x.replace(this.rules.other.tabCharGlobal," "),B.test(x)||$.test(x)||W.test(x)||I.test(x)||R.test(x))break;if(K.search(this.rules.other.nonSpaceChar)>=E||!x.trim())v+=`
|
|
424
|
+
`+K.slice(E);else{if(S||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(k)||$.test(k)||R.test(k))break;v+=`
|
|
425
|
+
`+x}!S&&!x.trim()&&(S=!0),m+=Q+`
|
|
426
|
+
`,n=n.substring(Q.length+1),k=K.slice(E)}}a.loose||(f?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(f=!0));let C=null,T;this.options.gfm&&(C=this.rules.other.listIsTask.exec(v),C&&(T=C[0]!=="[ ] ",v=v.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:m,task:!!C,checked:T,loose:!1,text:v,tokens:[]}),a.raw+=m}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 g=0;g<a.items.length;g++)if(this.lexer.state.top=!1,a.items[g].tokens=this.lexer.blockTokens(a.items[g].text,[]),!a.loose){const m=a.items[g].tokens.filter(k=>k.type==="space"),v=m.length>0&&m.some(k=>this.rules.other.anyLine.test(k.raw));a.loose=v}if(a.loose)for(let g=0;g<a.items.length;g++)a.items[g].loose=!0;return a}}html(n){const r=this.rules.block.html.exec(n);if(r)return{type:"html",block:!0,raw:r[0],pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]}}def(n){const r=this.rules.block.def.exec(n);if(r){const s=r[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=r[2]?r[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=r[3]?r[3].substring(1,r[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):r[3];return{type:"def",tag:s,raw:r[0],href:o,title:a}}}table(n){var f;const r=this.rules.block.table.exec(n);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;const s=Kh(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(f=r[3])!=null&&f.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
427
|
+
`):[],u={type:"table",raw:r[0],header:[],align:[],rows:[]};if(s.length===o.length){for(const h of o)this.rules.other.tableAlignRight.test(h)?u.align.push("right"):this.rules.other.tableAlignCenter.test(h)?u.align.push("center"):this.rules.other.tableAlignLeft.test(h)?u.align.push("left"):u.align.push(null);for(let h=0;h<s.length;h++)u.header.push({text:s[h],tokens:this.lexer.inline(s[h]),header:!0,align:u.align[h]});for(const h of a)u.rows.push(Kh(h,u.header.length).map((g,m)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:u.align[m]})));return u}}lheading(n){const r=this.rules.block.lheading.exec(n);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(n){const r=this.rules.block.paragraph.exec(n);if(r){const s=r[1].charAt(r[1].length-1)===`
|
|
428
|
+
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:s,tokens:this.lexer.inline(s)}}}text(n){const r=this.rules.block.text.exec(n);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(n){const r=this.rules.inline.escape.exec(n);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(n){const r=this.rules.inline.tag.exec(n);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(n){const r=this.rules.inline.link.exec(n);if(r){const s=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const u=ro(s.slice(0,-1),"\\");if((s.length-u.length)%2===0)return}else{const u=lS(r[2],"()");if(u===-2)return;if(u>-1){const h=(r[0].indexOf("!")===0?5:4)+r[1].length+u;r[2]=r[2].substring(0,u),r[0]=r[0].substring(0,h).trim(),r[3]=""}}let o=r[2],a="";if(this.options.pedantic){const u=this.rules.other.pedanticHrefTitle.exec(o);u&&(o=u[1],a=u[3])}else a=r[3]?r[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?o=o.slice(1):o=o.slice(1,-1)),Yh(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},r[0],this.lexer,this.rules)}}reflink(n,r){let s;if((s=this.rules.inline.reflink.exec(n))||(s=this.rules.inline.nolink.exec(n))){const o=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=r[o.toLowerCase()];if(!a){const u=s[0].charAt(0);return{type:"text",raw:u,text:u}}return Yh(s,a,s[0],this.lexer,this.rules)}}emStrong(n,r,s=""){let o=this.rules.inline.emStrongLDelim.exec(n);if(!o||o[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const u=[...o[0]].length-1;let f,h,g=u,m=0;const v=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,r=r.slice(-1*n.length+u);(o=v.exec(r))!=null;){if(f=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!f)continue;if(h=[...f].length,o[3]||o[4]){g+=h;continue}else if((o[5]||o[6])&&u%3&&!((u+h)%3)){m+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g+m);const k=[...o[0]][0].length,x=n.slice(0,u+o.index+k+h);if(Math.min(u,h)%2){const E=x.slice(1,-1);return{type:"em",raw:x,text:E,tokens:this.lexer.inlineTokens(E)}}const S=x.slice(2,-2);return{type:"strong",raw:x,text:S,tokens:this.lexer.inlineTokens(S)}}}}codespan(n){const r=this.rules.inline.code.exec(n);if(r){let s=r[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(s),a=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return o&&a&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:r[0],text:s}}}br(n){const r=this.rules.inline.br.exec(n);if(r)return{type:"br",raw:r[0]}}del(n){const r=this.rules.inline.del.exec(n);if(r)return{type:"del",raw:r[0],text:r[2],tokens:this.lexer.inlineTokens(r[2])}}autolink(n){const r=this.rules.inline.autolink.exec(n);if(r){let s,o;return r[2]==="@"?(s=r[1],o="mailto:"+s):(s=r[1],o=s),{type:"link",raw:r[0],text:s,href:o,tokens:[{type:"text",raw:s,text:s}]}}}url(n){var s;let r;if(r=this.rules.inline.url.exec(n)){let o,a;if(r[2]==="@")o=r[0],a="mailto:"+o;else{let u;do u=r[0],r[0]=((s=this.rules.inline._backpedal.exec(r[0]))==null?void 0:s[0])??"";while(u!==r[0]);o=r[0],r[1]==="www."?a="http://"+r[0]:a=r[0]}return{type:"link",raw:r[0],text:o,href:a,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(n){const r=this.rules.inline.text.exec(n);if(r){const s=this.lexer.state.inRawBlock;return{type:"text",raw:r[0],text:r[0],escaped:s}}}},Mr=class zu{constructor(r){lt(this,"tokens");lt(this,"options");lt(this,"state");lt(this,"tokenizer");lt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||Ms,this.options.tokenizer=this.options.tokenizer||new cl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const s={other:vn,block:Oa.normal,inline:no.normal};this.options.pedantic?(s.block=Oa.pedantic,s.inline=no.pedantic):this.options.gfm&&(s.block=Oa.gfm,this.options.breaks?s.inline=no.breaks:s.inline=no.gfm),this.tokenizer.rules=s}static get rules(){return{block:Oa,inline:no}}static lex(r,s){return new zu(s).lex(r)}static lexInline(r,s){return new zu(s).inlineTokens(r)}lex(r){r=r.replace(vn.carriageReturn,`
|
|
429
|
+
`),this.blockTokens(r,this.tokens);for(let s=0;s<this.inlineQueue.length;s++){const o=this.inlineQueue[s];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(r,s=[],o=!1){var a,u,f;for(this.options.pedantic&&(r=r.replace(vn.tabCharGlobal," ").replace(vn.spaceLine,""));r;){let h;if((u=(a=this.options.extensions)==null?void 0:a.block)!=null&&u.some(m=>(h=m.call({lexer:this},r,s))?(r=r.substring(h.raw.length),s.push(h),!0):!1))continue;if(h=this.tokenizer.space(r)){r=r.substring(h.raw.length);const m=s.at(-1);h.raw.length===1&&m!==void 0?m.raw+=`
|
|
430
|
+
`:s.push(h);continue}if(h=this.tokenizer.code(r)){r=r.substring(h.raw.length);const m=s.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
431
|
+
`+h.raw,m.text+=`
|
|
432
|
+
`+h.text,this.inlineQueue.at(-1).src=m.text):s.push(h);continue}if(h=this.tokenizer.fences(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.heading(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.hr(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.blockquote(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.list(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.html(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.def(r)){r=r.substring(h.raw.length);const m=s.at(-1);(m==null?void 0:m.type)==="paragraph"||(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
433
|
+
`+h.raw,m.text+=`
|
|
434
|
+
`+h.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title});continue}if(h=this.tokenizer.table(r)){r=r.substring(h.raw.length),s.push(h);continue}if(h=this.tokenizer.lheading(r)){r=r.substring(h.raw.length),s.push(h);continue}let g=r;if((f=this.options.extensions)!=null&&f.startBlock){let m=1/0;const v=r.slice(1);let k;this.options.extensions.startBlock.forEach(x=>{k=x.call({lexer:this},v),typeof k=="number"&&k>=0&&(m=Math.min(m,k))}),m<1/0&&m>=0&&(g=r.substring(0,m+1))}if(this.state.top&&(h=this.tokenizer.paragraph(g))){const m=s.at(-1);o&&(m==null?void 0:m.type)==="paragraph"?(m.raw+=`
|
|
435
|
+
`+h.raw,m.text+=`
|
|
436
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):s.push(h),o=g.length!==r.length,r=r.substring(h.raw.length);continue}if(h=this.tokenizer.text(r)){r=r.substring(h.raw.length);const m=s.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=`
|
|
437
|
+
`+h.raw,m.text+=`
|
|
438
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):s.push(h);continue}if(r){const m="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,s}inline(r,s=[]){return this.inlineQueue.push({src:r,tokens:s}),s}inlineTokens(r,s=[]){var h,g,m;let o=r,a=null;if(this.tokens.links){const v=Object.keys(this.tokens.links);if(v.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)v.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let u=!1,f="";for(;r;){u||(f=""),u=!1;let v;if((g=(h=this.options.extensions)==null?void 0:h.inline)!=null&&g.some(x=>(v=x.call({lexer:this},r,s))?(r=r.substring(v.raw.length),s.push(v),!0):!1))continue;if(v=this.tokenizer.escape(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.tag(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.link(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(v.raw.length);const x=s.at(-1);v.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):s.push(v);continue}if(v=this.tokenizer.emStrong(r,o,f)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.codespan(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.br(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.del(r)){r=r.substring(v.raw.length),s.push(v);continue}if(v=this.tokenizer.autolink(r)){r=r.substring(v.raw.length),s.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(r))){r=r.substring(v.raw.length),s.push(v);continue}let k=r;if((m=this.options.extensions)!=null&&m.startInline){let x=1/0;const S=r.slice(1);let E;this.options.extensions.startInline.forEach(C=>{E=C.call({lexer:this},S),typeof E=="number"&&E>=0&&(x=Math.min(x,E))}),x<1/0&&x>=0&&(k=r.substring(0,x+1))}if(v=this.tokenizer.inlineText(k)){r=r.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(f=v.raw.slice(-1)),u=!0;const x=s.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=v.raw,x.text+=v.text):s.push(v);continue}if(r){const x="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return s}},ul=class{constructor(n){lt(this,"options");lt(this,"parser");this.options=n||Ms}space(n){return""}code({text:n,lang:r,escaped:s}){var u;const o=(u=(r||"").match(vn.notSpaceStart))==null?void 0:u[0],a=n.replace(vn.endingNewline,"")+`
|
|
439
|
+
`;return o?'<pre><code class="language-'+kr(o)+'">'+(s?a:kr(a,!0))+`</code></pre>
|
|
440
|
+
`:"<pre><code>"+(s?a:kr(a,!0))+`</code></pre>
|
|
441
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
442
|
+
${this.parser.parse(n)}</blockquote>
|
|
443
|
+
`}html({text:n}){return n}heading({tokens:n,depth:r}){return`<h${r}>${this.parser.parseInline(n)}</h${r}>
|
|
444
|
+
`}hr(n){return`<hr>
|
|
445
|
+
`}list(n){const r=n.ordered,s=n.start;let o="";for(let f=0;f<n.items.length;f++){const h=n.items[f];o+=this.listitem(h)}const a=r?"ol":"ul",u=r&&s!==1?' start="'+s+'"':"";return"<"+a+u+`>
|
|
446
|
+
`+o+"</"+a+`>
|
|
447
|
+
`}listitem(n){var s;let r="";if(n.task){const o=this.checkbox({checked:!!n.checked});n.loose?((s=n.tokens[0])==null?void 0:s.type)==="paragraph"?(n.tokens[0].text=o+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=o+" "+kr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:o+" ",text:o+" ",escaped:!0}):r+=o+" "}return r+=this.parser.parse(n.tokens,!!n.loose),`<li>${r}</li>
|
|
448
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
449
|
+
`}table(n){let r="",s="";for(let a=0;a<n.header.length;a++)s+=this.tablecell(n.header[a]);r+=this.tablerow({text:s});let o="";for(let a=0;a<n.rows.length;a++){const u=n.rows[a];s="";for(let f=0;f<u.length;f++)s+=this.tablecell(u[f]);o+=this.tablerow({text:s})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
450
|
+
<thead>
|
|
451
|
+
`+r+`</thead>
|
|
452
|
+
`+o+`</table>
|
|
453
|
+
`}tablerow({text:n}){return`<tr>
|
|
454
|
+
${n}</tr>
|
|
455
|
+
`}tablecell(n){const r=this.parser.parseInline(n.tokens),s=n.header?"th":"td";return(n.align?`<${s} align="${n.align}">`:`<${s}>`)+r+`</${s}>
|
|
456
|
+
`}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>${kr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:r,tokens:s}){const o=this.parser.parseInline(s),a=Gh(n);if(a===null)return o;n=a;let u='<a href="'+n+'"';return r&&(u+=' title="'+kr(r)+'"'),u+=">"+o+"</a>",u}image({href:n,title:r,text:s,tokens:o}){o&&(s=this.parser.parseInline(o,this.parser.textRenderer));const a=Gh(n);if(a===null)return kr(s);n=a;let u=`<img src="${n}" alt="${s}"`;return r&&(u+=` title="${kr(r)}"`),u+=">",u}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:kr(n.text)}},Sd=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""}},Lr=class $u{constructor(r){lt(this,"options");lt(this,"renderer");lt(this,"textRenderer");this.options=r||Ms,this.options.renderer=this.options.renderer||new ul,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sd}static parse(r,s){return new $u(s).parse(r)}static parseInline(r,s){return new $u(s).parseInline(r)}parse(r,s=!0){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const m=h,v=this.options.extensions.renderers[m.type].call({parser:this},m);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(m.type)){o+=v||"";continue}}const g=h;switch(g.type){case"space":{o+=this.renderer.space(g);continue}case"hr":{o+=this.renderer.hr(g);continue}case"heading":{o+=this.renderer.heading(g);continue}case"code":{o+=this.renderer.code(g);continue}case"table":{o+=this.renderer.table(g);continue}case"blockquote":{o+=this.renderer.blockquote(g);continue}case"list":{o+=this.renderer.list(g);continue}case"html":{o+=this.renderer.html(g);continue}case"paragraph":{o+=this.renderer.paragraph(g);continue}case"text":{let m=g,v=this.renderer.text(m);for(;f+1<r.length&&r[f+1].type==="text";)m=r[++f],v+=`
|
|
457
|
+
`+this.renderer.text(m);s?o+=this.renderer.paragraph({type:"paragraph",raw:v,text:v,tokens:[{type:"text",raw:v,text:v,escaped:!0}]}):o+=v;continue}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}parseInline(r,s=this.renderer){var a,u;let o="";for(let f=0;f<r.length;f++){const h=r[f];if((u=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&u[h.type]){const m=this.options.extensions.renderers[h.type].call({parser:this},h);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type)){o+=m||"";continue}}const g=h;switch(g.type){case"escape":{o+=s.text(g);break}case"html":{o+=s.html(g);break}case"link":{o+=s.link(g);break}case"image":{o+=s.image(g);break}case"strong":{o+=s.strong(g);break}case"em":{o+=s.em(g);break}case"codespan":{o+=s.codespan(g);break}case"br":{o+=s.br(g);break}case"del":{o+=s.del(g);break}case"text":{o+=s.text(g);break}default:{const m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return o}},Cu,Ha=(Cu=class{constructor(n){lt(this,"options");lt(this,"block");this.options=n||Ms}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?Mr.lex:Mr.lexInline}provideParser(){return this.block?Lr.parse:Lr.parseInline}},lt(Cu,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Cu),uS=class{constructor(...n){lt(this,"defaults",hd());lt(this,"options",this.setOptions);lt(this,"parse",this.parseMarkdown(!0));lt(this,"parseInline",this.parseMarkdown(!1));lt(this,"Parser",Lr);lt(this,"Renderer",ul);lt(this,"TextRenderer",Sd);lt(this,"Lexer",Mr);lt(this,"Tokenizer",cl);lt(this,"Hooks",Ha);this.use(...n)}walkTokens(n,r){var o,a;let s=[];for(const u of n)switch(s=s.concat(r.call(this,u)),u.type){case"table":{const f=u;for(const h of f.header)s=s.concat(this.walkTokens(h.tokens,r));for(const h of f.rows)for(const g of h)s=s.concat(this.walkTokens(g.tokens,r));break}case"list":{const f=u;s=s.concat(this.walkTokens(f.items,r));break}default:{const f=u;(a=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&a[f.type]?this.defaults.extensions.childTokens[f.type].forEach(h=>{const g=f[h].flat(1/0);s=s.concat(this.walkTokens(g,r))}):f.tokens&&(s=s.concat(this.walkTokens(f.tokens,r)))}}return s}use(...n){const r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(s=>{const o={...s};if(o.async=this.defaults.async||o.async||!1,s.extensions&&(s.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const u=r.renderers[a.name];u?r.renderers[a.name]=function(...f){let h=a.renderer.apply(this,f);return h===!1&&(h=u.apply(this,f)),h}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const u=r[a.level];u?u.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),o.extensions=r),s.renderer){const a=this.defaults.renderer||new ul(this.defaults);for(const u in s.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;const f=u,h=s.renderer[f],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v||""}}o.renderer=a}if(s.tokenizer){const a=this.defaults.tokenizer||new cl(this.defaults);for(const u in s.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;const f=u,h=s.tokenizer[f],g=a[f];a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.tokenizer=a}if(s.hooks){const a=this.defaults.hooks||new Ha;for(const u in s.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;const f=u,h=s.hooks[f],g=a[f];Ha.passThroughHooks.has(u)?a[f]=m=>{if(this.defaults.async)return Promise.resolve(h.call(a,m)).then(k=>g.call(a,k));const v=h.call(a,m);return g.call(a,v)}:a[f]=(...m)=>{let v=h.apply(a,m);return v===!1&&(v=g.apply(a,m)),v}}o.hooks=a}if(s.walkTokens){const a=this.defaults.walkTokens,u=s.walkTokens;o.walkTokens=function(f){let h=[];return h.push(u.call(this,f)),a&&(h=h.concat(a.call(this,f))),h}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Mr.lex(n,r??this.defaults)}parser(n,r){return Lr.parse(n,r??this.defaults)}parseMarkdown(n){return(s,o)=>{const a={...o},u={...this.defaults,...a},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&a.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));u.hooks&&(u.hooks.options=u,u.hooks.block=n);const h=u.hooks?u.hooks.provideLexer():n?Mr.lex:Mr.lexInline,g=u.hooks?u.hooks.provideParser():n?Lr.parse:Lr.parseInline;if(u.async)return Promise.resolve(u.hooks?u.hooks.preprocess(s):s).then(m=>h(m,u)).then(m=>u.hooks?u.hooks.processAllTokens(m):m).then(m=>u.walkTokens?Promise.all(this.walkTokens(m,u.walkTokens)).then(()=>m):m).then(m=>g(m,u)).then(m=>u.hooks?u.hooks.postprocess(m):m).catch(f);try{u.hooks&&(s=u.hooks.preprocess(s));let m=h(s,u);u.hooks&&(m=u.hooks.processAllTokens(m)),u.walkTokens&&this.walkTokens(m,u.walkTokens);let v=g(m,u);return u.hooks&&(v=u.hooks.postprocess(v)),v}catch(m){return f(m)}}}onError(n,r){return s=>{if(s.message+=`
|
|
458
|
+
Please report this to https://github.com/markedjs/marked.`,n){const o="<p>An error occurred:</p><pre>"+kr(s.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(s);throw s}}},As=new uS;function qe(n,r){return As.parse(n,r)}qe.options=qe.setOptions=function(n){return As.setOptions(n),qe.defaults=As.defaults,Bg(qe.defaults),qe};qe.getDefaults=hd;qe.defaults=Ms;qe.use=function(...n){return As.use(...n),qe.defaults=As.defaults,Bg(qe.defaults),qe};qe.walkTokens=function(n,r){return As.walkTokens(n,r)};qe.parseInline=As.parseInline;qe.Parser=Lr;qe.parser=Lr.parse;qe.Renderer=ul;qe.TextRenderer=Sd;qe.Lexer=Mr;qe.lexer=Mr.lex;qe.Tokenizer=cl;qe.Hooks=Ha;qe.parse=qe;qe.options;qe.setOptions;qe.use;qe.walkTokens;qe.parseInline;Lr.parse;Mr.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 Xh(n,r){(r==null||r>n.length)&&(r=n.length);for(var s=0,o=Array(r);s<r;s++)o[s]=n[s];return o}function dS(n){if(Array.isArray(n))return n}function fS(n,r){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var o,a,u,f,h=[],g=!0,m=!1;try{if(u=(s=s.call(n)).next,r!==0)for(;!(g=(o=u.call(s)).done)&&(h.push(o.value),h.length!==r);g=!0);}catch(v){m=!0,a=v}finally{try{if(!g&&s.return!=null&&(f=s.return(),Object(f)!==f))return}finally{if(m)throw a}}return h}}function pS(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hS(n,r){return dS(n)||fS(n,r)||mS(n,r)||pS()}function mS(n,r){if(n){if(typeof n=="string")return Xh(n,r);var s={}.toString.call(n).slice(8,-1);return s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?Xh(n,r):void 0}}const Jg=Object.entries,Qh=Object.setPrototypeOf,gS=Object.isFrozen,vS=Object.getPrototypeOf,yS=Object.getOwnPropertyDescriptor;let rn=Object.freeze,sn=Object.seal,ui=Object.create,ev=typeof Reflect<"u"&&Reflect,Fu=ev.apply,Uu=ev.construct;rn||(rn=function(r){return r});sn||(sn=function(r){return r});Fu||(Fu=function(r,s){for(var o=arguments.length,a=new Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r.apply(s,a)});Uu||(Uu=function(r){for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return new r(...o)});const ai=$t(Array.prototype.forEach),xS=$t(Array.prototype.lastIndexOf),Zh=$t(Array.prototype.pop),li=$t(Array.prototype.push),wS=$t(Array.prototype.splice),is=Array.isArray,lo=$t(String.prototype.toLowerCase),xu=$t(String.prototype.toString),Jh=$t(String.prototype.match),so=$t(String.prototype.replace),em=$t(String.prototype.indexOf),kS=$t(String.prototype.trim),SS=$t(Number.prototype.toString),bS=$t(Boolean.prototype.toString),tm=typeof BigInt>"u"?null:$t(BigInt.prototype.toString),nm=typeof Symbol>"u"?null:$t(Symbol.prototype.toString),Zt=$t(Object.prototype.hasOwnProperty),io=$t(Object.prototype.toString),Qt=$t(RegExp.prototype.test),js=TS(TypeError);function $t(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var s=arguments.length,o=new Array(s>1?s-1:0),a=1;a<s;a++)o[a-1]=arguments[a];return Fu(n,r,o)}}function TS(n){return function(){for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return Uu(n,s)}}function Ve(n,r){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lo;if(Qh&&Qh(n,null),!is(r))return n;let o=r.length;for(;o--;){let a=r[o];if(typeof a=="string"){const u=s(a);u!==a&&(gS(r)||(r[o]=u),a=u)}n[a]=!0}return n}function NS(n){for(let r=0;r<n.length;r++)Zt(n,r)||(n[r]=null);return n}function un(n){const r=ui(null);for(const o of Jg(n)){var s=hS(o,2);const a=s[0],u=s[1];Zt(n,a)&&(is(u)?r[a]=NS(u):u&&typeof u=="object"&&u.constructor===Object?r[a]=un(u):r[a]=u)}return r}function CS(n){switch(typeof n){case"string":return n;case"number":return SS(n);case"boolean":return bS(n);case"bigint":return tm?tm(n):"0";case"symbol":return nm?nm(n):"Symbol()";case"undefined":return io(n);case"function":case"object":{if(n===null)return io(n);const r=n,s=ur(r,"toString");if(typeof s=="function"){const o=s(r);return typeof o=="string"?o:io(o)}return io(n)}default:return io(n)}}function ur(n,r){for(;n!==null;){const o=yS(n,r);if(o){if(o.get)return $t(o.get);if(typeof o.value=="function")return $t(o.value)}n=vS(n)}function s(){return null}return s}function ES(n){try{return Qt(n,""),!0}catch{return!1}}const rm=rn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),wu=rn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ku=rn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_S=rn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Su=rn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jS=rn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sm=rn(["#text"]),im=rn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),bu=rn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),om=rn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),za=rn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),RS=sn(/{{[\w\W]*|^[\w\W]*}}/g),AS=sn(/<%[\w\W]*|^[\w\W]*%>/g),IS=sn(/\${[\w\W]*/g),DS=sn(/^data-[\-\w.\u00B7-\uFFFF]+$/),MS=sn(/^aria-[\-\w]+$/),am=sn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),LS=sn(/^(?:\w+script|data):/i),PS=sn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),OS=sn(/^html$/i),zS=sn(/^[a-z][.\w]*(-[.\w]+)+$/i),lm=sn(/<[/\w!]/g),cm=sn(/<[/\w]/g),$S=sn(/<\/no(script|embed|frames)/i),FS=sn(/\/>/i),Fn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},US=function(){return typeof window>"u"?null:window},BS=function(r,s){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let o=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(o=s.getAttribute(a));const u="dompurify"+(o?"#"+o:"");try{return r.createPolicy(u,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},um=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rs=function(r,s,o,a){return Zt(r,s)&&is(r[s])?Ve(a.base?un(a.base):{},r[s],a.transform):o};function tv(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:US();const r=oe=>tv(oe);if(r.version="3.4.13",r.removed=[],!n||!n.document||n.document.nodeType!==Fn.document||!n.Element)return r.isSupported=!1,r;let s=n.document;const o=s,a=o.currentScript;n.DocumentFragment;const u=n.HTMLTemplateElement,f=n.Node,h=n.Element,g=n.NodeFilter,m=n.NamedNodeMap;m===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const v=n.DOMParser,k=n.trustedTypes,x=h.prototype,S=ur(x,"cloneNode"),E=ur(x,"remove"),C=ur(x,"nextSibling"),T=ur(x,"childNodes"),I=ur(x,"parentNode"),R=ur(x,"shadowRoot"),B=ur(x,"attributes"),$=f&&f.prototype?ur(f.prototype,"nodeType"):null,W=f&&f.prototype?ur(f.prototype,"nodeName"):null,Q=f&&f.prototype?ur(f.prototype,"ownerDocument"):null;if(typeof u=="function"){const oe=s.createElement("template");oe.content&&oe.content.ownerDocument&&(s=oe.content.ownerDocument)}let K,X="",ue,me=!1,de=0;const De=function(){if(de>0)throw js('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.')},je=function(b){De(),de++;try{return K.createHTML(b)}finally{de--}},Le=function(b){De(),de++;try{return K.createScriptURL(b)}finally{de--}},ne=function(){return me||(ue=BS(k,a),me=!0),ue},q=s,Y=q.implementation,P=q.createNodeIterator,Z=q.createDocumentFragment,V=q.getElementsByTagName,j=o.importNode;let L=um();r.isSupported=typeof Jg=="function"&&typeof I=="function"&&Y&&Y.createHTMLDocument!==void 0;const ce=RS,G=AS,le=IS,fe=DS,Pe=MS,Te=LS,Ee=PS,Ce=zS;let it=am,Ne=null;const kt=Ve({},[...rm,...wu,...ku,...Su,...sm]);let $e=null;const It=Ve({},[...im,...bu,...om,...za]);let Fe=Object.seal(ui(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}})),Dt=null,jn=null;const St=Object.seal(ui(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mt=!0,ht=!0,en=!1,H=!0,pe=!1,Ue=!0,tt=!1,mt=!1,gt=null,Rt=null,Ht=!1,ut=!1,Rn=!1,Hn=!1,br=!0,hr=!1;const An="user-content-";let In=!0,fn=!1,wn={},Ft=null;const Vt=Ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let rt=null;const vt=Ve({},["audio","video","img","source","image","track"]);let yt=null;const qt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",ot="http://www.w3.org/1999/xhtml";let Gt=ot,Je=!1,_=null;const ie=Ve({},[bt,xt,ot],xu),se=rn(["mi","mo","mn","ms","mtext"]);let ge=Ve({},se);const ze=rn(["annotation-xml"]);let Be=Ve({},ze);const Ie=Ve({},["title","style","font","a","script"]);let at=null;const Dn=["application/xhtml+xml","text/html"],Mn="text/html";let He=null,kn=null;const Or=s.createElement("form"),tr=function(b){return b instanceof RegExp||b instanceof Function},nr=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===b)return;(!b||typeof b!="object")&&(b={}),b=un(b),at=Dn.indexOf(b.PARSER_MEDIA_TYPE)===-1?Mn:b.PARSER_MEDIA_TYPE,He=at==="application/xhtml+xml"?xu:lo,Ne=rs(b,"ALLOWED_TAGS",kt,{transform:He}),$e=rs(b,"ALLOWED_ATTR",It,{transform:He}),_=rs(b,"ALLOWED_NAMESPACES",ie,{transform:xu}),yt=rs(b,"ADD_URI_SAFE_ATTR",qt,{transform:He,base:qt}),rt=rs(b,"ADD_DATA_URI_TAGS",vt,{transform:He,base:vt}),Ft=rs(b,"FORBID_CONTENTS",Vt,{transform:He}),Dt=rs(b,"FORBID_TAGS",un({}),{transform:He}),jn=rs(b,"FORBID_ATTR",un({}),{transform:He}),wn=Zt(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?un(b.USE_PROFILES):b.USE_PROFILES:!1,Mt=b.ALLOW_ARIA_ATTR!==!1,ht=b.ALLOW_DATA_ATTR!==!1,en=b.ALLOW_UNKNOWN_PROTOCOLS||!1,H=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=b.SAFE_FOR_TEMPLATES||!1,Ue=b.SAFE_FOR_XML!==!1,tt=b.WHOLE_DOCUMENT||!1,ut=b.RETURN_DOM||!1,Rn=b.RETURN_DOM_FRAGMENT||!1,Hn=b.RETURN_TRUSTED_TYPE||!1,Ht=b.FORCE_BODY||!1,br=b.SANITIZE_DOM!==!1,hr=b.SANITIZE_NAMED_PROPS||!1,In=b.KEEP_CONTENT!==!1,fn=b.IN_PLACE||!1,it=ES(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:am,Gt=typeof b.NAMESPACE=="string"?b.NAMESPACE:ot,ge=Zt(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?un(b.MATHML_TEXT_INTEGRATION_POINTS):Ve({},se),Be=Zt(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?un(b.HTML_INTEGRATION_POINTS):Ve({},ze);const O=Zt(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?un(b.CUSTOM_ELEMENT_HANDLING):ui(null);if(Fe=ui(null),Zt(O,"tagNameCheck")&&tr(O.tagNameCheck)&&(Fe.tagNameCheck=O.tagNameCheck),Zt(O,"attributeNameCheck")&&tr(O.attributeNameCheck)&&(Fe.attributeNameCheck=O.attributeNameCheck),Zt(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),sn(Fe),pe&&(ht=!1),Rn&&(ut=!0),wn&&(Ne=Ve({},sm),$e=ui(null),wn.html===!0&&(Ve(Ne,rm),Ve($e,im)),wn.svg===!0&&(Ve(Ne,wu),Ve($e,bu),Ve($e,za)),wn.svgFilters===!0&&(Ve(Ne,ku),Ve($e,bu),Ve($e,za)),wn.mathMl===!0&&(Ve(Ne,Su),Ve($e,om),Ve($e,za))),St.tagCheck=null,St.attributeCheck=null,Zt(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?St.tagCheck=b.ADD_TAGS:is(b.ADD_TAGS)&&(Ne===kt&&(Ne=un(Ne)),Ve(Ne,b.ADD_TAGS,He))),Zt(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?St.attributeCheck=b.ADD_ATTR:is(b.ADD_ATTR)&&($e===It&&($e=un($e)),Ve($e,b.ADD_ATTR,He))),Zt(b,"ADD_URI_SAFE_ATTR")&&is(b.ADD_URI_SAFE_ATTR)&&Ve(yt,b.ADD_URI_SAFE_ATTR,He),Zt(b,"FORBID_CONTENTS")&&is(b.FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,b.FORBID_CONTENTS,He)),Zt(b,"ADD_FORBID_CONTENTS")&&is(b.ADD_FORBID_CONTENTS)&&(Ft===Vt&&(Ft=un(Ft)),Ve(Ft,b.ADD_FORBID_CONTENTS,He)),In&&(Ne["#text"]=!0),tt&&Ve(Ne,["html","head","body"]),Ne.table&&(Ve(Ne,["tbody"]),delete Dt.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw js('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=K;K=b.TRUSTED_TYPES_POLICY;try{X=je("")}catch(we){throw K=J,we}}else b.TRUSTED_TYPES_POLICY===null?(K=void 0,X=""):(K===void 0&&(K=ne()),K&&typeof X=="string"&&(X=je("")));rn&&rn(b),kn=b},Xe=Ve({},[...wu,...ku,..._S]),Tt=Ve({},[...Su,...jS]),rr=function(b,O,J){return O.namespaceURI===ot?b==="svg":O.namespaceURI===bt?b==="svg"&&(J==="annotation-xml"||ge[J]):!!Xe[b]},Nl=function(b,O,J){return O.namespaceURI===ot?b==="math":O.namespaceURI===xt?b==="math"&&Be[J]:!!Tt[b]},Cl=function(b,O,J){return O.namespaceURI===xt&&!Be[J]||O.namespaceURI===bt&&!ge[J]?!1:!Tt[b]&&(Ie[b]||!Xe[b])},Nt=function(b){let O=I(b);(!O||!O.tagName)&&(O={namespaceURI:Gt,tagName:"template"});const J=lo(b.tagName),we=lo(O.tagName);return _[b.namespaceURI]?b.namespaceURI===xt?rr(J,O,we):b.namespaceURI===bt?Nl(J,O,we):b.namespaceURI===ot?Cl(J,O,we):!!(at==="application/xhtml+xml"&&_[b.namespaceURI]):!1},mr=function(b){li(r.removed,{element:b});try{I(b).removeChild(b)}catch{if(E(b),!I(b))throw js("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},zr=function(b){cs(b);const O=T(b);if(O){const we=[];ai(O,be=>{li(we,be)}),ai(we,be=>{try{E(be)}catch{}})}const J=B(b);if(J)for(let we=J.length-1;we>=0;--we){const be=J[we],Oe=be&&be.name;if(typeof Oe=="string")try{b.removeAttribute(Oe)}catch{}}},gr=function(b,O){try{li(r.removed,{attribute:O.getAttributeNode(b),from:O})}catch{li(r.removed,{attribute:null,from:O})}if(O.removeAttribute(b),b==="is")if(ut||Rn)try{mr(O)}catch{}else try{O.setAttribute(b,"")}catch{}},Ls=function(b){const O=B(b);if(O)for(let J=O.length-1;J>=0;--J){const we=O[J],be=we&&we.name;if(!(typeof be!="string"||$e[He(be)]))try{b.removeAttribute(be)}catch{}}},cs=function(b){const O=[b];for(;O.length>0;){const J=O.pop();($?$(J):J.nodeType)===Fn.element&&Ls(J);const be=T(J);if(be)for(let Oe=be.length-1;Oe>=0;--Oe)O.push(be[Oe])}},_o=function(b){if(!Ue)return;const O=[b];for(;O.length>0;){const J=O.pop(),we=$?$(J):J.nodeType;if(we===Fn.processingInstruction||we===Fn.comment&&Qt(cm,J.data)){try{E(J)}catch{}continue}if(we===Fn.element){const Oe=J,Ke=He(W?W(J):J.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&Ke!=="label"&&Ke!=="output"&&Oe.removeAttribute("for")}catch{}}const be=T(J);if(be)for(let Oe=be.length-1;Oe>=0;--Oe)O.push(be[Oe])}},us=function(b){let O=null,J=null;if(Ht)b="<remove></remove>"+b;else{const Oe=Jh(b,/^[\r\n\t ]+/);J=Oe&&Oe[0]}at==="application/xhtml+xml"&&Gt===ot&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const we=K?je(b):b;if(Gt===ot)try{O=new v().parseFromString(we,at)}catch{}if(!O||!O.documentElement){O=Y.createDocument(Gt,"template",null);try{O.documentElement.innerHTML=Je?X:we}catch{}}const be=O.body||O.documentElement;return b&&J&&be.insertBefore(s.createTextNode(J),be.childNodes[0]||null),Gt===ot?V.call(O,tt?"html":"body")[0]:tt?O.documentElement:be},Ln=function(b){const O=Q?Q(b):b.ownerDocument;return P.call(O||b,b,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ps=function(b){return b=so(b,ce," "),b=so(b,G," "),b=so(b,le," "),b},pn=function(b){var O;b.normalize();const J=Q?Q(b):b.ownerDocument,we=P.call(J||b,b,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let be=we.nextNode();for(;be;)be.data=Ps(be.data),be=we.nextNode();const Oe=(O=b.querySelectorAll)===null||O===void 0?void 0:O.call(b,"template");Oe&&ai(Oe,Ke=>{$r(Ke.content)&&pn(Ke.content)})},Os=function(b){const O=W?W(b):null;return typeof O!="string"||He(O)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==B(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==$(b)||b.childNodes!==T(b)},$r=function(b){if(!$||typeof b!="object"||b===null)return!1;try{return $(b)===Fn.documentFragment}catch{return!1}},ds=function(b){if(!$||typeof b!="object"||b===null)return!1;try{return typeof $(b)=="number"}catch{return!1}};function hn(oe,b,O){oe.length!==0&&ai(oe,J=>{J.call(r,b,O,kn)})}const zs=function(b,O){return!!(Ue&&b.hasChildNodes()&&!ds(b.firstElementChild)&&Qt(lm,b.textContent)&&Qt(lm,b.innerHTML)||Ue&&b.namespaceURI===ot&&O==="style"&&ds(b.firstElementChild)||b.nodeType===Fn.processingInstruction||Ue&&b.nodeType===Fn.comment&&Qt(cm,b.data))},fs=function(b,O,J){if(!Dt[O]&&bi(O)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,O)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(O)))return!1;if(In&&!Ft[O]){const we=I(b),be=T(b);if(be&&we){const Oe=be.length;for(let Ke=Oe-1;Ke>=0;--Ke){const Qe=b===J?S(be[Ke],!0):be[Ke];we.insertBefore(Qe,C(b))}}}return mr(b),!0},ps=function(b,O,J,we){return b.length===0?O:O===J||O===we?un(O):O},jo=function(b,O){if(hn(L.beforeSanitizeElements,b,null),b!==O&&I(b)===null)return fn&&cs(b),!0;if(Os(b))return mr(b),!0;const J=He(W?W(b):b.nodeName);if(Ne=ps(L.uponSanitizeElement,Ne,kt,gt),hn(L.uponSanitizeElement,b,{tagName:J,allowedTags:Ne}),b!==O&&I(b)===null)return fn&&cs(b),!0;if(zs(b,J))return mr(b),!0;if(Dt[J]||!(St.tagCheck instanceof Function&&St.tagCheck(J))&&!Ne[J]){const be=fs(b,J,O);return be===!1&&hn(L.afterSanitizeElements,b,null),be}if(($?$(b):b.nodeType)===Fn.element&&!Nt(b)||(J==="noscript"||J==="noembed"||J==="noframes")&&Qt($S,b.innerHTML))return mr(b),!0;if(pe&&b.nodeType===Fn.text){const be=Ps(b.textContent);b.textContent!==be&&(li(r.removed,{element:b.cloneNode()}),b.textContent=be)}return hn(L.afterSanitizeElements,b,null),!1},Ro=function(b,O,J){if(jn[O]||Ue&&O==="patchsrc"||Ue&&O==="for"&&b!=="label"&&b!=="output"||br&&(O==="id"||O==="name")&&(J in s||J in Or))return!1;const we=$e[O]||St.attributeCheck instanceof Function&&St.attributeCheck(O,b);if(!(ht&&Qt(fe,O))){if(!(Mt&&Qt(Pe,O))){if(we){if(!yt[O]){if(!Qt(it,so(J,Ee,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&b!=="script"&&em(J,"data:")===0&&rt[b])){if(!(en&&!Qt(Te,so(J,Ee,"")))){if(J)return!1}}}}}else if(!(bi(b)&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,b)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(b))&&(Fe.attributeNameCheck instanceof RegExp&&Qt(Fe.attributeNameCheck,O)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(O,b))||O==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Qt(Fe.tagNameCheck,J)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(J))))return!1}}return!0},Si=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),bi=function(b){return!Si[lo(b)]&&Qt(Ce,b)},Ti=function(b,O,J,we){if(K&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!J)switch(k.getAttributeType(b,O)){case"TrustedHTML":return je(we);case"TrustedScriptURL":return Le(we)}return we},hs=function(b,O,J,we){try{J?b.setAttributeNS(J,O,we):b.setAttribute(O,we),Os(b)?mr(b):Zh(r.removed)}catch{gr(O,b)}},Ao=function(b){hn(L.beforeSanitizeAttributes,b,null);const O=b.attributes;if(!O||Os(b))return;$e=ps(L.uponSanitizeAttribute,$e,It,Rt);const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let we=O.length;const be=He(b.nodeName);for(;we--;){const Oe=O[we],Ke=Oe.name,Qe=Oe.namespaceURI,Ct=Oe.value,Et=He(Ke),Tr=Ct;let Lt=Ke==="value"?Tr:kS(Tr);if(J.attrName=Et,J.attrValue=Lt,J.keepAttr=!0,J.forceKeepAttr=void 0,hn(L.uponSanitizeAttribute,b,J),Lt=J.attrValue,hr&&(Et==="id"||Et==="name")&&em(Lt,An)!==0&&(gr(Ke,b),Lt=An+Lt),Ue&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Lt)){gr(Ke,b);continue}if(Et==="attributename"&&Jh(Lt,"href")){gr(Ke,b);continue}if(!J.forceKeepAttr){if(!J.keepAttr){gr(Ke,b);continue}if(!H&&Qt(FS,Lt)){gr(Ke,b);continue}if(pe&&(Lt=Ps(Lt)),!Ro(be,Et,Lt)){gr(Ke,b);continue}Lt=Ti(be,Et,Qe,Lt),Lt!==Tr&&hs(b,Ke,Qe,Lt)}}hn(L.afterSanitizeAttributes,b,null)},Fr=function(b){let O=null;const J=Ln(b);for(hn(L.beforeSanitizeShadowDOM,b,null);O=J.nextNode();)if(hn(L.uponSanitizeShadowNode,O,null),jo(O,b),Ao(O),$r(O.content)&&Fr(O.content),($?$(O):O.nodeType)===Fn.element){const be=R(O);$r(be)&&(Ge(be),Fr(be))}hn(L.afterSanitizeShadowDOM,b,null)},Ge=function(b){const O=[{node:b,shadow:null}];for(;O.length>0;){const J=O.pop();if(J.shadow){Fr(J.shadow);continue}const we=J.node,Oe=($?$(we):we.nodeType)===Fn.element,Ke=T(we);if(Ke)for(let Qe=Ke.length-1;Qe>=0;--Qe)O.push({node:Ke[Qe],shadow:null});if(Oe){const Qe=W?W(we):null;if(typeof Qe=="string"&&He(Qe)==="template"){const Ct=we.content;$r(Ct)&&O.push({node:Ct,shadow:null})}}if(Oe){const Qe=R(we);$r(Qe)&&O.push({node:null,shadow:Qe},{node:Qe,shadow:null})}}};return r.sanitize=function(oe){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,J=null,we=null,be=null;if(Je=!oe,Je&&(oe="<!-->"),typeof oe!="string"&&!ds(oe)&&(oe=CS(oe),typeof oe!="string"))throw js("dirty is not a string, aborting");if(!r.isSupported)return oe;mt?(Ne=gt,$e=Rt):nr(b),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(Ne=un(Ne)),L.uponSanitizeAttribute.length>0&&($e=un($e)),r.removed=[];const Oe=fn&&typeof oe!="string"&&ds(oe);if(Oe){_o(oe);const Ct=W?W(oe):oe.nodeName;if(typeof Ct=="string"){const Et=He(Ct);if(!Ne[Et]||Dt[Et])throw zr(oe),js("root node is forbidden and cannot be sanitized in-place")}if(Os(oe))throw zr(oe),js("root node is clobbered and cannot be sanitized in-place");try{Ge(oe)}catch(Et){throw zr(oe),Et}}else if(ds(oe))O=us("<!---->"),J=O.ownerDocument.importNode(oe,!0),J.nodeType===Fn.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?O=J:O.appendChild(J),Ge(J);else{if(!ut&&!pe&&!tt&&oe.indexOf("<")===-1)return K&&Hn?je(oe):oe;if(O=us(oe),!O)return ut?null:Hn?X:""}O&&Ht&&mr(O.firstChild);const Ke=Oe?oe:O;try{const Ct=Ln(Ke);for(;we=Ct.nextNode();)jo(we,Ke),Ao(we),$r(we.content)&&Fr(we.content)}catch(Ct){throw Oe&&(zr(oe),ai(r.removed,Et=>{Et.element&&cs(Et.element)})),Ct}if(Oe)return ai(r.removed,Ct=>{Ct.element&&cs(Ct.element)}),pe&&pn(oe),oe;if(ut){if(pe&&pn(O),Rn)for(be=Z.call(O.ownerDocument);O.firstChild;)be.appendChild(O.firstChild);else be=O;return($e.shadowroot||$e.shadowrootmode)&&(be=j.call(o,be,!0)),be}let Qe=tt?O.outerHTML:O.innerHTML;return tt&&Ne["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&Qt(OS,O.ownerDocument.doctype.name)&&(Qe="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
|
|
460
|
+
`+Qe),pe&&(Qe=Ps(Qe)),K&&Hn?je(Qe):Qe},r.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nr(oe),mt=!0,gt=Ne,Rt=$e},r.clearConfig=function(){kn=null,mt=!1,gt=null,Rt=null,K=ue,X=""},r.isValidAttribute=function(oe,b,O){kn||nr({});const J=He(oe),we=He(b);return Ro(J,we,O)},r.addHook=function(oe,b){typeof b=="function"&&Zt(L,oe)&&li(L[oe],b)},r.removeHook=function(oe,b){if(Zt(L,oe)){if(b!==void 0){const O=xS(L[oe],b);return O===-1?void 0:wS(L[oe],O,1)[0]}return Zh(L[oe])}},r.removeHooks=function(oe){Zt(L,oe)&&(L[oe]=[])},r.removeAllHooks=function(){L=um()},r}var bd=tv();const WS=new Set(["command_execution","file_change","mcp_tool_call","web_search"]);function dm(n){return WS.has(n.type)}function HS({items:n,runtimeType:r,turn:s,threads:o=[]}){const[a,u]=w.useState(!1);if(n.length===0)return null;const f=n.length;return c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>u(h=>!h),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(Nw,{size:12})}),c.jsxs("span",{className:"tool-calls-summary",children:[f," tool call",f>1?"s":""]}),c.jsx(id,{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(Dr,{item:h,runtimeType:r,turn:s,threads:o},h.id))})]})}qe.setOptions({breaks:!0,gfm:!0});function VS(n){const r=qe.parse(n);return bd.sanitize(r)}function fm(n,r){var a;const s=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let o=0;for(;s.nextNode();){const u=s.currentNode,f=((a=u.textContent)==null?void 0:a.length)??0;if(o+f>r)return{node:u,offset:r-o};o+=f}return null}function qS(n,r,s){const o=document.createTreeWalker(n,NodeFilter.SHOW_TEXT),a=[];for(;o.nextNode();){const u=o.currentNode;if(!u.textContent||u.textContent.trim()==="")continue;const f=document.createRange();f.selectNodeContents(u),!(f.compareBoundaryPoints(Range.START_TO_END,r)<=0)&&(f.compareBoundaryPoints(Range.END_TO_START,r)>=0||a.push(u))}for(const u of a){const f=u.length;let h=0,g=f;if(u===r.startContainer&&(h=Math.min(r.startOffset,f)),u===r.endContainer&&(g=Math.min(r.endOffset,f)),h>=g)continue;g<f&&u.splitText(g);const m=h>0?u.splitText(h):u,v=s(),k=m.parentNode;k&&(k.insertBefore(v,m),v.appendChild(m))}}function GS(n,r){n.querySelectorAll("mark[data-thread-id]").forEach(s=>{const o=s.parentNode;if(!o)return;const a=document.createTextNode(s.textContent||"");o.replaceChild(a,s),o.normalize()});for(const s of r){if(s.start_offset===null||s.end_offset===null)continue;const o=fm(n,s.start_offset),a=fm(n,s.end_offset);if(!o||!a)continue;const u=document.createRange();u.setStart(o.node,o.offset),u.setEnd(a.node,a.offset),qS(n,u,()=>{const f=document.createElement("mark");return f.setAttribute("data-thread-id",s.id),s.status==="resolved"&&f.classList.add("thread-mark-resolved"),f})}}function KS(n){const r=window.getSelection();if(!r||r.rangeCount===0)return null;const s=r.getRangeAt(0);if(s.collapsed||!n.contains(s.commonAncestorContainer))return null;const o=document.createRange();o.setStart(n,0),o.setEnd(s.startContainer,s.startOffset);const a=o.toString().length,u=s.toString();return{start:a,end:a+u.length,text:u}}function YS({itemId:n,turnId:r,sessionId:s,content:o,threads:a}){const u=w.useRef(null),f=w.useRef(null),h=w.useRef(null),g=w.useRef(""),m=w.useRef(0),[v,k]=w.useState(!1),[x,S]=w.useState({x:0,y:0}),[E,C]=w.useState(!1),[T,I]=w.useState({x:0,y:0}),[R,B]=w.useState(""),[$,W]=w.useState(null),[Q,K]=w.useState(!1),X=M(V=>V.createThread),ue=M(V=>V.switchRightTab),me=M(V=>hl(V.sessionDetails[s])),de=w.useCallback(async()=>{await Pu(o||""),K(!0),setTimeout(()=>K(!1),1500)},[o]),De=w.useCallback(()=>{var j;if(!$)return;const V=`
|
|
461
|
+
\`\`\`QUOTE
|
|
462
|
+
${$.text}
|
|
463
|
+
\`\`\`
|
|
464
|
+
|
|
465
|
+
`;M.setState({quotedText:V}),k(!1),W(null),(j=window.getSelection())==null||j.removeAllRanges()},[$]),je=w.useMemo(()=>VS(o||"…"),[o]),Le=w.useMemo(()=>a.filter(V=>V.item_id===n),[a,n]);w.useEffect(()=>{u.current&&GS(u.current,Le)},[je,Le]),w.useEffect(()=>{g.current=R},[R]),w.useEffect(()=>{function V(j){f.current&&!f.current.contains(j.target)&&(k(!1),g.current.trim()||C(!1))}return document.addEventListener("mousedown",V),()=>document.removeEventListener("mousedown",V)},[]);const ne=w.useCallback(()=>{k(!1),g.current.trim()||C(!1)},[]),q=w.useCallback(()=>{const V=u.current;if(!V)return;const j=KS(V);if(j&&j.text.trim().length>0){const L=window.getSelection();if(L&&L.rangeCount>0&&L.anchorNode&&L.focusNode){const G=L.getRangeAt(0).getBoundingClientRect(),le=28,fe=6,Pe=170;let Te=!1;try{const it=document.createRange();it.setStart(L.focusNode,L.focusOffset),it.setEnd(L.focusNode,L.focusOffset);const Ne=document.createRange();Ne.setStart(L.anchorNode,L.anchorOffset),Ne.setEnd(L.anchorNode,L.anchorOffset),Te=Ne.compareBoundaryPoints(Range.START_TO_START,it)>0}catch{Te=!1}let Ee=G.top-le-fe;Ee<8&&(Ee=G.bottom+fe);let Ce=Te?G.left-Pe:G.right;Ce=Math.max(8,Math.min(Ce,window.innerWidth-Pe-8)),S({x:Ce,y:Ee}),k(!0),W(j)}}else k(!1)},[]);w.useEffect(()=>{function V(j){const L=j.target;L&&(L.closest(".selection-actions")||L.closest(".thread-create-popover"))||q()}return document.addEventListener("mouseup",V),()=>document.removeEventListener("mouseup",V)},[q]);const Y=w.useCallback(()=>{k(!1),C(!0),I({x:x.x,y:x.y})},[x]);w.useLayoutEffect(()=>{if(!E)return;const V=h.current;if(!V)return;const j=V.offsetWidth,L=V.offsetHeight,ce=8;let G=x.x,le=x.y;G-j<ce&&(G=j+ce),G>window.innerWidth-ce&&(G=window.innerWidth-ce),le<ce&&(le=ce),le+L>window.innerHeight-ce&&(le=window.innerHeight-L-ce),I({x:G,y:le})},[E,x]);const P=w.useCallback(async()=>{var V;me||!$||!R.trim()||(await X(s,{itemId:n,turnId:r,startOffset:$.start,endOffset:$.end,selectedText:$.text,message:R.trim()}),B(""),C(!1),W(null),(V=window.getSelection())==null||V.removeAllRanges(),ue("threads"))},[$,R,X,s,n,r,ue,me]),Z=w.useCallback(V=>{const j=V.target;if(j.tagName==="MARK"&&j.hasAttribute("data-thread-id")){V.preventDefault(),ue("threads");const L=j.getAttribute("data-thread-id");setTimeout(()=>{const ce=document.getElementById(`thread-${L}`);ce&&(ce.scrollIntoView({behavior:"smooth",block:"center"}),ce.classList.add("thread-card-highlighted"),setTimeout(()=>ce.classList.remove("thread-card-highlighted"),1500))},100)}},[ue]);return c.jsxs("div",{className:"copy-text-wrapper",style:{position:"relative"},ref:f,children:[c.jsx("div",{ref:u,dangerouslySetInnerHTML:{__html:je},onMouseDown:ne,onClick:Z}),c.jsx("button",{className:`copy-text-btn${Q?" copied":""}`,onClick:de,title:Q?"Copied":"Copy message","aria-label":"Copy message text",children:Q?c.jsx(os,{size:14}):c.jsx(Au,{size:14})}),v&&!E&&c.jsxs("div",{className:"selection-actions",style:{left:x.x,top:x.y},children:[!me&&c.jsxs("button",{className:"discuss-button",onClick:Y,title:"Start a discussion about this text",children:[c.jsx(cw,{size:14}),c.jsx("span",{children:"Discuss"})]}),c.jsxs("button",{className:"discuss-button",onClick:De,title:"Quote this text in your message",children:[c.jsx(ug,{size:14}),c.jsx("span",{children:"Quote"})]})]}),E&&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:['"',$==null?void 0:$.text.slice(0,80),$&&$.text.length>80?"…":"",'"']}),c.jsx("button",{className:"thread-create-close",onClick:()=>{C(!1),W(null)},children:c.jsx(Wn,{size:14})})]}),c.jsx("textarea",{className:"thread-create-input",placeholder:"Ask about this text…",value:R,onChange:V=>B(V.target.value),autoFocus:!0,rows:2,onKeyDown:V=>{if(V.key==="Enter"&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),P()),V.key==="Escape")if(g.current.trim()){const j=Date.now();m.current&&j-m.current<400?(m.current=0,C(!1),W(null)):m.current=j}else C(!1),W(null)}}),c.jsxs("div",{className:"thread-create-footer",children:[c.jsx("span",{className:"thread-create-hint",children:"⌘↵ to send · Esc to cancel"}),c.jsxs("button",{className:"thread-create-send",onClick:P,disabled:!R.trim()||me,title:me?"Wait for the running turn to finish first":void 0,children:[c.jsx(So,{size:13}),c.jsx("span",{children:"Send"})]})]})]})]})}const pm=w.memo(YS),dl=new Map,nv=new Set,Bu=new Set,hm=new Map;function rv(){Bu.forEach(n=>n())}function sv(n,r){return`${n}:${r}`}function XS(n,r,s,o,a){var g;const u=sv(r,s),f=dl.get(n)??new Map,h=new Map(f);((g=h.get(u))==null?void 0:g.answer)===a?h.delete(u):h.set(u,{itemIndex:r,groupIndex:s,question:o,answer:a}),dl.set(n,h),rv()}function QS(n){dl.delete(n),rv()}function ZS(n){nv.add(n),QS(n)}function JS(n){const r=w.useCallback(s=>(Bu.add(s),()=>{Bu.delete(s)}),[]);return w.useSyncExternalStore(r,()=>dl.get(n)??hm,()=>hm)}function eb(n){return[...n].sort((r,s)=>r.itemIndex-s.itemIndex||r.groupIndex-s.groupIndex).map(r=>`> ${r.question}
|
|
466
|
+
${r.answer}`).join(`
|
|
467
|
+
|
|
468
|
+
`)}function mm({item:n,turn:r}){var S;const s=n.data??{},o=w.useMemo(()=>Array.isArray(s.groups)?s.groups.filter(E=>!!E&&Array.isArray(E.selections)&&E.selections.length>0):[],[s.groups]),a=JS(r.id),u=M(E=>r.session_id?E.sessionDetails[r.session_id]:null),f=M(E=>E.activeSessionId),h=r.items.findIndex(E=>E.id===n.id),g=u?((S=u.turns[u.turns.length-1])==null?void 0:S.id)===r.id:!0,m=nv.has(r.id),v=m||Gm(u)||!g||r.session_id!==f,k=(E,C,T)=>{v||XS(r.id,h,E,C,T)},x=()=>{const E=[...a.values()];if(E.length===0)return;const C=eb(E);ZS(r.id),M.getState().submitPrompt(C)};return c.jsxs("div",{className:"render-content ask-user-card",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(K0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Question"}),m&&c.jsx("span",{className:"turn-header-meta",children:"answered"})]}),o.length>0?c.jsxs("div",{className:"ask-user-groups",children:[o.map((E,C)=>c.jsxs("div",{className:"ask-user-group",children:[E.question&&c.jsx("div",{className:"ask-user-question",children:E.question}),c.jsx("div",{className:"ask-user-options",children:E.selections.map(T=>{var R;const I=((R=a.get(sv(h,C)))==null?void 0:R.answer)===T;return c.jsx("button",{type:"button",className:`ask-user-option ${I?"selected":""}`,disabled:v,onClick:()=>k(C,E.question,T),children:T},T)})})]},C)),v?m&&c.jsx("div",{className:"ask-user-submitted",children:"Answer sent"}):c.jsxs("button",{type:"button",className:"ask-user-send",disabled:a.size===0,onClick:x,children:[c.jsx(So,{size:12}),"Send"]})]}):s.question?c.jsx("p",{className:"user-message",children:s.question}):c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Waiting for user response"})]})}const tb={host_shutdown:"host shutdown",host_restart:"host restart",process_exit:"agent process stopped",network:"network error"};function co(n){return n&&tb[n]||"interrupted"}function fl(n){if(!n)return"";const r=new Date(n);return Number.isNaN(r.getTime())?"":r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function nb(n){switch(n){case"network":return"Interrupted — network error. Will resume when the connection is back.";case"process_exit":return"Interrupted — the agent process stopped. Resuming automatically…";case"host_shutdown":return"Interrupted — the agent host shut down. Resuming automatically…";default:return"Interrupted — the agent host restarted. Resuming automatically…"}}function rb(n){return n.items.filter(r=>r.type==="interruption").map(r=>r.data)}function sb({item:n}){const r=n.data,s=fl(r.interrupted_at);let o="";switch(r.outcome){case"waiting":o="waiting to resume";break;case"resuming":o="resuming…";break;case"resumed":o=r.resumed_at?`resumed ${fl(r.resumed_at)}`:"resumed";break;case"cancelled":o="stopped";break;case"unsupported":o="cannot be resumed";break;default:o="not resumed"}return c.jsx("div",{className:"interruption-marker",title:r.detail??void 0,children:c.jsxs("span",{children:["Interrupted",s?` ${s}`:""," (",co(r.reason),") · ",o]})})}function ib({turn:n,label:r}){const[s,o]=w.useState(!1),a=M(f=>f.addToast),u=()=>{o(!0),mx(n.session_id,n.id).catch(f=>a("error",`Could not resume the turn — ${f.message}`)).finally(()=>o(!1))};return c.jsxs("button",{type:"button",className:"banner-action",onClick:u,disabled:s,children:[c.jsx(dg,{size:12}),r]})}function ob({turn:n}){const r=n.resume_state;if(!r||r==="cancelled")return null;const s=n.interrupt_reason,o=rb(n),a=o[o.length-1],u=fl(n.interrupted_at??(a==null?void 0:a.interrupted_at));if(r==="resumed"){const m=fl(a==null?void 0:a.resumed_at),v=n.status==="running"||n.status==="pending";return c.jsxs("div",{className:"interruption-banner resumed","data-state":"resumed",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(dg,{size:12})}),c.jsxs("span",{className:"banner-text",children:["Interrupted",u?` ${u}`:""," (",co(s),") · resumed",m?` ${m}`:"",v?" — continuing…":""]})]})}let f,h=null,g=null;switch(r){case"waiting":f=nb(s),g="Resume now";break;case"resuming":f=`Interrupted (${co(s)}) — resuming from where it left off…`;break;case"gave_up":{const m=Math.max(o.length,1);f=`Interrupted ${m===1?"once":`${m} times`} — automatic resume stopped.`,h=n.error&&!n.error.startsWith("Automatic resume stopped")?n.error:null,g="Resume";break}case"skipped":f=`Interrupted${u?` ${u}`:""} (${co(s)}) — too long ago to resume automatically.`,g="Resume";break;default:f=`Interrupted (${co(s)}) — this turn cannot be resumed.`,h=n.error}return c.jsxs("div",{className:"interruption-banner","data-state":r,children:[c.jsx("span",{className:"banner-icon",children:s==="network"?c.jsx(hg,{size:12}):c.jsx(vl,{size:12})}),c.jsxs("span",{className:"banner-text",children:[f,h&&c.jsx("span",{className:"banner-detail",children:h})]}),g&&c.jsx(ib,{turn:n,label:g})]})}function ab({turnId:n}){const r=M(o=>o.retryStates[n]);if(!r)return null;const s=r.errorStatus?`API error ${r.errorStatus}`:"Connection problem";return c.jsxs("div",{className:"retry-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(hg,{size:12})}),c.jsxs("span",{className:"banner-text",children:[s," — retrying (attempt ",r.attempt," of ",r.maxRetries,")…"]})]})}qe.setOptions({breaks:!0,gfm:!0});function lb({attachments:n}){const[r,s]=w.useState(null);return w.useEffect(()=>{if(!r)return;function o(a){a.key==="Escape"&&s(null)}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[r]),!Array.isArray(n)||n.length===0?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"attachment-pills",children:n.map((o,a)=>{const u=o.media_type.startsWith("image/"),f=`data:${o.media_type};base64,${o.data}`;return c.jsxs("span",{className:"attachment-pill",title:o.name,onClick:u?()=>s(f):void 0,style:u?{cursor:"pointer"}:void 0,children:[u?c.jsx("img",{src:f,alt:o.name,className:"attachment-pill-thumb"}):c.jsx(ag,{size:12,className:"attachment-pill-icon"}),c.jsx("span",{className:"attachment-pill-name",children:o.name})]},a)})}),r&&c.jsx("div",{className:"image-preview-modal",onClick:()=>s(null),children:c.jsxs("div",{className:"image-preview-content",onClick:o=>o.stopPropagation(),children:[c.jsx("img",{src:r,alt:"preview"}),c.jsx("button",{className:"image-preview-close",onClick:()=>s(null),children:c.jsx(Wn,{size:20})})]})})]})}function cb(n){const r=qe.parse(n);return bd.sanitize(r)}function gm(n){var r;return(r=n.data)!=null&&r.text?n.data.text:""}function ub(n){const r=n.match(/^\/bin\/\w+\s+-\w+\s+"(.*)"$/s);return r?r[1]:n}const vm='<script>(function(){function report(){var h=Math.max(document.documentElement.scrollHeight,document.body?document.body.scrollHeight:0);if(h>0)parent.postMessage(Math.ceil(h),"*");}window.addEventListener("load",report);new ResizeObserver(report).observe(document.documentElement);report();})();<\/script>';function db(n){return/<\/body>/i.test(n)?n.replace(/<\/body>/i,`${vm}</body>`):n+vm}function fb({html:n}){const[r,s]=w.useState(480),o=w.useRef(null);return w.useEffect(()=>{function a(u){var f;u.source===((f=o.current)==null?void 0:f.contentWindow)&&typeof u.data=="number"&&u.data>0&&s(u.data)}return window.addEventListener("message",a),()=>window.removeEventListener("message",a)},[]),c.jsx("iframe",{ref:o,sandbox:"allow-scripts",srcDoc:db(n),title:"HTML content",style:{width:"100%",height:`${r}px`,border:"1px solid var(--border)",borderRadius:"var(--r-md)",background:"#fff",marginTop:"8px"}})}const ym=1e4;function pb({item:n,runtimeType:r,turn:s,threads:o}){var h,g,m,v,k,x,S,E;const a=n.status==="in_progress",[u,f]=w.useState(!1);switch(n.type){case"agent_message":{const{iconClass:C,iconText:T}=Ru(r??"codex");return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${C}`,children:T}),c.jsx("span",{className:"turn-header-title",children:"Agent"}),a&&c.jsx("span",{className:"turn-header-meta",children:"writing…"})]}),c.jsx(pm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:gm(n)||"…",threads:o,runtimeType:r})]})}case"reasoning":return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(q0,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Reasoning"})]}),c.jsx("div",{dangerouslySetInnerHTML:{__html:cb(gm(n))}})]});case"command_execution":{const C=n.data||{},T=ub(C.command||""),I=C.aggregated_output||"",R=C.exit_code,B=a?"running…":R!==null?`exit ${R}`:"",$=I.length>ym,W=$&&!u?I.slice(0,ym)+`
|
|
469
|
+
… (truncated, click to expand)`:I;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(pg,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Command"}),B&&c.jsx("span",{className:"turn-header-meta",children:B})]}),c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:T})}),I&&c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:W})}),$&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>f(Q=>!Q),children:u?"Show less":`Show full output (${(I.length/1024).toFixed(0)}KB)`})]})]})}case"file_change":{const C=(h=n.data)==null?void 0:h.changes,T=Array.isArray(C)?C:[],I=`${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(ew,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"File Changes"}),c.jsx("span",{className:"turn-header-meta",children:I})]}),c.jsx("div",{className:"file-change-list",children:T.map((R,B)=>{const $=R.kind==="add"?"A":R.kind==="delete"?"D":"M",W=R.kind==="add"?"fc-add":R.kind==="delete"?"fc-del":"fc-mod";return c.jsxs("div",{className:"file-change",children:[c.jsx("span",{className:`fc-status ${W}`,children:$}),c.jsx("span",{className:"fc-name",children:R.path})]},B)})})]})}case"mcp_tool_call":{const C=n.data||{},T=C.tool||"mcp";if(T==="Agent"){const X=C.arguments,ue=(X==null?void 0:X.description)||(X==null?void 0:X.prompt)||"Subagent",me=n.status==="failed",de=a?"running…":me?"failed":"done";return c.jsxs("div",{className:"agent-call-card",children:[c.jsx("span",{className:"agent-call-icon",children:c.jsx(ls,{size:14})}),c.jsx("span",{className:"agent-call-desc",children:ue}),c.jsx("span",{className:`agent-call-status ${a?"running":me?"failed":"done"}`,children:de})]})}const I=C.server||"",R=C.arguments,B=C.result,$=C.error,W=n.status==="failed"||!!$,Q=a?"running…":W?"failed":"done",K=((g=B==null?void 0:B.content)==null?void 0:g.filter(X=>X.type==="text").map(X=>X.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(vw,{size:14})}),c.jsxs("span",{className:"turn-header-title",children:["MCP: ",T]}),I&&c.jsx("span",{className:"turn-header-meta",children:I}),c.jsx("span",{className:"turn-header-meta",style:W?{color:"var(--red)"}:void 0,children:Q})]}),R&&Object.keys(R).length>0&&c.jsx("div",{className:"mcp-args",children:Object.entries(R).map(([X,ue])=>c.jsxs("div",{className:"mcp-arg",children:[c.jsx("span",{className:"mcp-arg-key",children:X}),X==="code"?c.jsx("pre",{className:"cmd-block",children:c.jsx("code",{children:String(ue)})}):c.jsx("span",{className:"mcp-arg-value",children:typeof ue=="string"?ue:JSON.stringify(ue,null,2)})]},X))}),K.length>0&&K.map((X,ue)=>c.jsx("pre",{className:"cmd-output",children:c.jsx("code",{children:X})},ue)),$&&c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:$})})]})}case"web_search":{const C=((m=n.data)==null?void 0:m.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(xw,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Web Search"})]}),c.jsx("p",{className:"user-message",children:C})]})}case"todo_list":{const C=((v=n.data)==null?void 0:v.items)||[];return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(ow,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Todo List"})]}),c.jsx("ul",{className:"todo-list",children:C.map((T,I)=>c.jsxs("li",{className:T.completed?"todo-done":"todo-pending",children:[T.completed?c.jsx(os,{size:14}):c.jsx(Ds,{size:14})," ",T.text]},I))})]})}case"ask_user":return c.jsx(mm,{item:n,turn:s});case"final_result":{const C=n.data??{},T=C.text||"",I=C.html||null,R=Array.isArray(C.groups)?C.groups.filter(W=>!!W&&Array.isArray(W.selections)&&W.selections.length>0):[],{iconClass:B,iconText:$}=Ru(r??"codex");return c.jsxs(c.Fragment,{children:[(T||I)&&c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:`turn-header-icon ${B}`,children:$}),c.jsx("span",{className:"turn-header-title",children:"Agent"})]}),T&&c.jsx(pm,{itemId:n.id,turnId:s.id,sessionId:s.session_id,content:T,threads:o,runtimeType:r}),I&&c.jsx(fb,{html:I})]}),R.length>0&&c.jsx(mm,{item:n,turn:s})]})}case"background_task":{const C=n.data||{},T=C.task_type||"unknown",I=C.subagent_type||null,R=C.description||"",B=C.status||"running",$=C.last_tool_name||null,W=C.token_count||null,Q=T==="local_agent",K=T==="local_bash",X=Q?ls:K?fg:og,ue=Q?`Subagent${I?`: ${I}`:""}`:K?"Monitor":"Background Task",me=B==="running"?"running…":B==="completed"?"done":B==="failed"?"failed":B==="stopped"?"stopped":B,de=n.status==="failed"||B==="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(X,{size:14})}),c.jsx("span",{className:"turn-header-title",children:ue}),c.jsx("span",{className:"turn-header-meta",style:de?{color:"var(--red)"}:void 0,children:me})]}),R&&c.jsx("p",{className:"user-message",style:{fontSize:"13px"},children:R}),$&&a&&c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)",fontSize:"12px"},children:["last tool: ",$,W!=null&&` · ${W.toLocaleString()} tokens`]}),c.jsx("div",{className:"cmd-output",style:{color:"var(--text-muted)",fontSize:"11px"},children:"Output available in Tasks panel — click the status bar indicator or the Tasks tab."})]})}case"context_compaction":{const C=((k=n.data)==null?void 0:k.trigger)??"auto",T=((x=n.data)==null?void 0:x.pre_tokens)??0,I=((S=n.data)==null?void 0:S.post_tokens)??0,R=T>0?Math.round((1-I/T)*100):0,B=C==="manual"?"Context compacted (/compact)":"Context auto-compacted";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--surface-2)",color:"var(--text-3)"},children:c.jsx(uw,{size:14})}),c.jsx("span",{className:"turn-header-title",children:B})]}),c.jsxs("div",{className:"cmd-output",style:{color:"var(--text-3)"},children:[T.toLocaleString()," → ",I.toLocaleString()," tokens (",R,"% reduction)"]})]})}case"interruption":return c.jsx(sb,{item:n});case"error":{const C=((E=n.data)==null?void 0:E.message)||"Unknown error";return c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--red)",color:"#fff"},children:c.jsx(vl,{size:14})}),c.jsx("span",{className:"turn-header-title",children:"Error"})]}),c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:C})})]})}default:return null}}const Dr=w.memo(pb,(n,r)=>n.item===r.item&&n.runtimeType===r.runtimeType&&n.threads===r.threads&&n.turn.id===r.turn.id);function hb({turn:n,runtimeType:r,threads:s=[]}){Ot.trackRender("TurnContent");const[o,a]=w.useState(!1);w.useEffect(()=>{const R=n.items.some(B=>B.type==="background_task"&&B.status==="in_progress");n.status==="running"||n.status==="pending"?a(!0):n.status==="completed"&&!R&&a(!1)},[n.status,n.items]);let u=-1;for(let R=n.items.length-1;R>=0;R--)if(n.items[R].type==="agent_message"){u=R;break}const f=u>=0,h=f?n.items.slice(0,u):n.items,g=n.items.some(R=>R.type==="final_result"||R.type==="ask_user"),m=!f&&n.status==="completed"&&n.agent_response&&!g?{id:`response-${n.id}`,turn_id:n.id,external_item_id:`response-${n.id}`,type:"agent_message",data:{text:n.agent_response},status:"completed",created_at:n.created_at,updated_at:n.updated_at}:null,k=h.filter(R=>{var B;return!(R.type==="reasoning"&&(!((B=R.data)!=null&&B.text)||R.data.text===""))}).filter(R=>!(R.type==="background_task"||R.type==="ask_user"||R.type==="final_result")),x=[];let S=null;for(const R of k)R.type==="agent_message"?(S&&x.push(S),S={agentMessage:R,toolItems:[],otherItems:[]}):R.type==="interruption"||R.type==="error"?(S&&x.push(S),x.push({agentMessage:null,toolItems:[],otherItems:[R]}),S=null):(S||(S={agentMessage:null,toolItems:[],otherItems:[]}),dm(R)?S.toolItems.push(R):S.otherItems.push(R));S&&x.push(S);const E=k.filter(R=>dm(R)).length,C=E>0||k.length>0&&(n.status==="running"||n.status==="pending"),T=n.status==="pending"&&n.resume_state==="waiting",I=n.resume_state==="gave_up"||n.resume_state==="skipped"||n.resume_state==="unsupported";return c.jsxs("div",{className:"turn-group",children:[c.jsxs("div",{className:"render-content",children:[c.jsxs("div",{className:"turn-header",children:[c.jsx("span",{className:"turn-header-icon",style:{background:"var(--amber)",color:"#fff"},children:"U"}),c.jsx("span",{className:"turn-header-title",children:"You"})]}),c.jsx("p",{className:"user-message",children:n.user_prompt}),Array.isArray(n.attachments)&&n.attachments.length>0&&c.jsx(lb,{attachments:n.attachments})]}),C&&c.jsxs("div",{className:"tool-calls",children:[c.jsxs("div",{className:"tool-calls-header",onClick:()=>a(R=>!R),children:[c.jsx("span",{className:"tool-calls-icon",children:c.jsx(rw,{size:12})}),c.jsx("span",{className:"tool-calls-summary",children:E>0?`${E} tool call${E>1?"s":""}`:T?"interrupted":"thinking…"}),c.jsx(id,{size:14,className:"tool-calls-chevron",style:{transform:o?"rotate(90deg)":"none"}})]}),o&&c.jsx("div",{className:"tool-calls-body",children:x.map((R,B)=>c.jsxs("div",{className:"intermediate-segment",children:[R.agentMessage&&c.jsx(Dr,{item:R.agentMessage,runtimeType:r,turn:n,threads:s}),R.otherItems.map($=>c.jsx(Dr,{item:$,runtimeType:r,turn:n,threads:s},$.id)),R.toolItems.length>0&&c.jsx(HS,{items:R.toolItems,runtimeType:r,turn:n,threads:s})]},B))})]}),n.items.filter(R=>R.type==="background_task").map(R=>c.jsx(Dr,{item:R,runtimeType:r,turn:n,threads:s},`task-${R.id}`)),f&&c.jsx(Dr,{item:n.items[u],runtimeType:r,turn:n,threads:s},n.items[u].id),m&&c.jsx(Dr,{item:m,runtimeType:r,turn:n,threads:s},m.id),f&&n.items.slice(u+1).filter(R=>R.type!=="ask_user"&&R.type!=="background_task"&&R.type!=="final_result").map(R=>c.jsx(Dr,{item:R,runtimeType:r,turn:n,threads:s},R.id)),n.items.filter(R=>R.type==="final_result").map(R=>c.jsx(Dr,{item:R,runtimeType:r,turn:n,threads:s},`final-${R.id}`)),n.items.filter(R=>R.type==="ask_user").map(R=>c.jsx(Dr,{item:R,runtimeType:r,turn:n,threads:s},`ask-${R.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&&!I&&c.jsx("div",{className:"render-content",children:c.jsx("pre",{className:"cmd-output",style:{color:"var(--red)"},children:c.jsx("code",{children:n.error})})}),n.status==="running"&&c.jsx(ab,{turnId:n.id}),c.jsx(ob,{turn:n}),n.status==="aborted"&&c.jsxs("div",{className:"aborted-banner",children:[c.jsx("span",{className:"banner-icon",children:c.jsx(Ds,{size:12})}),c.jsx("span",{className:"banner-text",children:"Turn stopped — work generated so far is kept."})]})]})}const mb=w.memo(hb),gb=[],$a=50;function vb(){Ot.trackRender("RenderArea");const n=M(x=>x.activeSessionId),r=M(x=>x.activeSessionId?x.sessionDetails[x.activeSessionId]:null),s=M(x=>x.submittingPrompt),o=M(x=>x.loading),a=(r==null?void 0:r.turns)??[],u=(r==null?void 0:r.threads)??gb,f=w.useRef(null),[h,g]=w.useState($a);w.useEffect(()=>{g($a)},[n]);const m=a.filter(x=>!x.thread_id),v=Math.max(0,m.length-h),k=m.slice(v);return w.useEffect(()=>{f.current&&(f.current.scrollTop=f.current.scrollHeight)},[n,a.length]),o&&!r?c.jsx("div",{className:"render-scroll",children:c.jsxs("div",{className:"skeleton-bars",children:[c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"}),c.jsx("div",{className:"skeleton-bar"})]})}):r?c.jsxs("div",{className:"render-scroll",ref:f,children:[s&&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:s})]}),c.jsx("div",{className:"render-content",children:c.jsx("p",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"Sending…"})})]})}),a.length===0&&!s&&c.jsx("div",{className:"empty-state",children:"No turns yet. Send a message below to start."}),v>0&&c.jsx("div",{className:"render-load-earlier",children:c.jsxs("button",{className:"render-load-earlier-btn",onClick:()=>g(x=>x+$a),children:["Show ",Math.min($a,v)," earlier turns (",v," hidden)"]})}),k.map((x,S)=>c.jsx("div",{id:`turn-${v+S}`,className:"turn-block",children:c.jsx(mb,{turn:x,runtimeType:r.runtime_type,threads:u})},x.id))]}):c.jsx("div",{className:"render-scroll",children:c.jsx("div",{className:"empty-state",children:"No session selected"})})}const yb=w.memo(vb),xb=[{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 wb(n){return n.map(r=>({id:r.name,label:`/${r.name}`,hint:r.description,capability:null,insertAsText:!0}))}function kb(n,r,s=[]){const o=[...xb,...wb(s)],a=new Set;return o.filter(u=>!(a.has(u.label)||(a.add(u.label),u.capability&&!r[u.capability])||n&&!u.label.toLowerCase().includes(n.toLowerCase())))}function Sb({commands:n,selectedIndex:r,onSelect:s,onHover:o}){return c.jsxs("div",{className:"slash-popup",children:[c.jsx("div",{className:"slash-popup-header",children:"Commands"}),n.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching commands"}),n.map((a,u)=>c.jsxs("div",{className:`slash-popup-item ${u===r?"selected":""}`,onMouseEnter:()=>o(u),onClick:()=>s(a),children:[c.jsx("span",{className:"slash-popup-label",children:a.label}),c.jsx("span",{className:"slash-popup-hint",children:a.hint})]},a.id))]})}function Tu({title:n,options:r,currentValue:s,onSelect:o,onClose:a}){return c.jsxs("div",{className:"slash-popup",children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:a,children:"← Back"}),c.jsx("span",{children:n})]}),r.map(u=>c.jsxs("div",{className:`slash-popup-item ${u.value===s?"selected":""}`,onClick:()=>o(u.value),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:u.label}),u.description&&c.jsx("span",{className:"slash-popup-hint",children:u.description})]}),u.value===s&&c.jsx("span",{className:"slash-popup-check",children:"✓"})]},u.value))]})}function bb(n){return yn("/skills")}function Tb({filter:n,onSelect:r,onClose:s}){const[o,a]=w.useState([]),[u,f]=w.useState(!0),[h,g]=w.useState(0),m=w.useRef(null);w.useEffect(()=>{bb().then(a).catch(()=>a([])).finally(()=>f(!1))},[]);const v=o.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())||k.description.toLowerCase().includes(n.toLowerCase()));return w.useEffect(()=>{g(0)},[n]),w.useEffect(()=>{function k(x){x.key==="ArrowDown"?(x.preventDefault(),g(S=>Math.min(S+1,v.length-1))):x.key==="ArrowUp"?(x.preventDefault(),g(S=>Math.max(S-1,0))):x.key==="Enter"?(x.preventDefault(),v[h]&&r(v[h])):x.key==="Escape"&&(x.preventDefault(),s())}return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v,h,r,s]),c.jsxs("div",{className:"slash-popup",ref:m,children:[c.jsxs("div",{className:"slash-popup-header",children:[c.jsx("button",{className:"slash-popup-back",onClick:s,children:"← Back"}),c.jsx("span",{children:"Skills"})]}),u&&c.jsx("div",{className:"slash-popup-empty",children:"Loading skills…"}),!u&&v.length===0&&c.jsx("div",{className:"slash-popup-empty",children:"No matching skills"}),v.map((k,x)=>c.jsxs("div",{className:`slash-popup-item ${x===h?"selected":""}`,onMouseEnter:()=>g(x),onClick:()=>r(k),children:[c.jsxs("div",{className:"slash-popup-item-main",children:[c.jsx("span",{className:"slash-popup-label",children:k.name}),k.description&&c.jsx("span",{className:"slash-popup-hint",children:k.description})]}),!!k.metadata.isSystem&&c.jsx("span",{className:"slash-popup-hint",children:"system"})]},k.id))]})}function Nb(){return yn("/providers")}function Cb(n,r){const s=r?`?cwd=${encodeURIComponent(r)}`:"";return yn(`/providers/${n}/commands${s}`)}const Eb={dynamicModels:!1,skills:!1,plugins:!1,mcpServers:!1,imageAttachments:!1,sandbox:!1,webSearch:!1,networkAccess:!1,fileReferences:!1};function _b(n){const[r,s]=w.useState([]),[o,a]=w.useState(!0);w.useEffect(()=>{Nb().then(s).catch(()=>s([])).finally(()=>a(!1))},[]);const u=r.find(f=>f.id===n)??null;return{provider:u,capabilities:(u==null?void 0:u.capabilities)??Eb,loading:o}}const ci=32,Nu=200;function xm(n){if(!n)return{};try{return JSON.parse(n)}catch{return{}}}function wm(n){return n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:`${(n/(1024*1024)).toFixed(1)}MB`}let km=0;function jb(){return km+=1,`att-${Date.now()}-${km}`}function Rb(){Ot.trackRender("CommandInputBar");const[n,r]=w.useState(""),s=w.useRef(null),o=w.useRef(ci),a=w.useRef(null),{submitPrompt:u,cancelTurn:f,updateRuntimeConfig:h,setShowModelSelector:g}=M(),m=M(H=>H.activeSessionId),v=M(H=>H.activeSessionId?H.sessionDetails[H.activeSessionId]:null),k=M(H=>H.quotedText),x=Gm(v),S=!!(v!=null&&v.turns.some(H=>H.status==="pending"&&H.resume_state==="waiting")),E=!m,{capabilities:C}=_b(v==null?void 0:v.runtime_type),T=(v==null?void 0:v.runtime_type)??null,I=C.imageAttachments,[R,B]=w.useState([]),[$,W]=w.useState(!1),[Q,K]=w.useState(null),[X,ue]=w.useState([]);w.useEffect(()=>{if(!T){ue([]);return}let H=!1;return Cb(T,(v==null?void 0:v.cwd)??void 0).then(pe=>{H||ue(pe)}).catch(()=>{H||ue([])}),()=>{H=!0}},[T,v==null?void 0:v.cwd]);const[me,de]=w.useState(!1),[De,je]=w.useState(""),[Le,ne]=w.useState(0),[q,Y]=w.useState(void 0),[P,Z]=w.useState(!1),[V,j]=w.useState(""),[L,ce]=w.useState([]),G=me?kb(De,C,X):[];w.useEffect(()=>{k!==null&&(r(H=>H+k),setTimeout(()=>{if(s.current){Ne(),s.current.focus();const H=s.current.value.length;s.current.setSelectionRange(H,H)}},0),M.setState({quotedText:null}))},[k]),w.useEffect(()=>{if(!x)return;function H(pe){pe.key==="Escape"&&(pe.preventDefault(),f())}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[x,f]),w.useEffect(()=>{de(!1),Y(void 0),Z(!1),ce([]),B(H=>{for(const pe of H)pe.previewUrl&&URL.revokeObjectURL(pe.previewUrl);return[]})},[m]),w.useEffect(()=>{if(!Q)return;function H(pe){pe.key==="Escape"&&(pe.preventDefault(),K(null))}return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[Q]);const le=w.useCallback(H=>{if(!H)return;const pe=Array.from(H);for(const Ue of pe){const tt=new FileReader;tt.onload=()=>{const gt=tt.result.split(",")[1]??"",Rt=Ue.type.startsWith("image/")?URL.createObjectURL(Ue):void 0;B(Ht=>[...Ht,{id:jb(),name:Ue.name,media_type:Ue.type||"application/octet-stream",data:gt,previewUrl:Rt,size:Ue.size}])},tt.readAsDataURL(Ue)}},[]),fe=w.useCallback(H=>{B(pe=>{const Ue=pe.find(tt=>tt.id===H);return Ue!=null&&Ue.previewUrl&&URL.revokeObjectURL(Ue.previewUrl),pe.filter(tt=>tt.id!==H)})},[]),Pe=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),!(!I||x)&&W(!0)},[I,x]),Te=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1)},[]),Ee=w.useCallback(H=>{H.preventDefault(),H.stopPropagation(),W(!1),!(!I||x)&&le(H.dataTransfer.files)},[I,x,le]),Ce=w.useCallback(H=>{var tt;if(!I)return;const pe=(tt=H.clipboardData)==null?void 0:tt.items;if(!pe)return;const Ue=[];for(let mt=0;mt<pe.length;mt++){const gt=pe[mt];if(gt.type.startsWith("image/")){const Rt=gt.getAsFile();Rt&&Ue.push(Rt)}}Ue.length>0&&(H.preventDefault(),le(Ue))},[I,le]);function it(H){const pe=s.current;pe&&(pe.style.height=`${H}px`,o.current=H)}function Ne(){const H=s.current;if(H){if(H.scrollHeight>H.clientHeight){const pe=Math.min(H.scrollHeight,Nu);pe!==o.current&&it(pe);return}o.current>ci&&(H.style.height="auto",it(Math.min(H.scrollHeight,Nu)))}}function kt(){const H=n.trim();if(!H||x)return;let pe=H;L.length>0&&(pe=`${L.map(mt=>`$${mt.name}`).join(" ")}
|
|
470
|
+
|
|
471
|
+
${H}`);const Ue=R.map(({id:tt,previewUrl:mt,size:gt,...Rt})=>Rt);r(""),ce([]),it(ci),de(!1),Y(void 0),Z(!1);for(const tt of R)tt.previewUrl&&URL.revokeObjectURL(tt.previewUrl);B([]),u(pe,Ue.length>0?Ue:void 0)}function $e(H){if(H.insertAsText){const pe=`/${H.id} `;r(pe),de(!1),Y(void 0),requestAnimationFrame(()=>{if(s.current){s.current.focus();const Ue=pe.length;s.current.setSelectionRange(Ue,Ue),Ne()}});return}H.subPopup?Y(H.subPopup):H.id==="skills"?(Z(!0),j(""),de(!1),r("")):H.id==="model"?(g(!0),de(!1),r("")):(de(!1),r(""))}function It(H){ce(pe=>[...pe,H]),Z(!1),r(""),it(ci)}function Fe(H){const pe=xm(v==null?void 0:v.runtime_config);q==="sandbox"?pe.sandboxMode=H:q==="websearch"?pe.webSearchMode=H:q==="network"&&(pe.networkAccessEnabled=H==="true"),h(pe),Y(void 0),de(!1),r(""),it(ci)}function Dt(H){if(Ot.markKeystroke(),me&&!q){if(H.key==="ArrowDown"){H.preventDefault(),ne(pe=>Math.min(pe+1,G.length-1));return}if(H.key==="ArrowUp"){H.preventDefault(),ne(pe=>Math.max(pe-1,0));return}if(H.key==="Enter"){H.preventDefault(),G[Le]&&$e(G[Le]);return}if(H.key==="Escape"){H.preventDefault(),de(!1),r("");return}}if(q&&H.key==="Escape"){H.preventDefault(),Y(void 0);return}if(H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&!x){H.preventDefault(),kt();return}H.key==="Escape"&&x&&(H.preventDefault(),f())}function jn(H){Ot.markInputChange();const pe=H.target.value;r(pe),Ne(),pe.startsWith("/")&&!pe.includes(" ")&&!x?(de(!0),je(pe.slice(1)),ne(0)):(de(!1),Y(void 0)),pe.startsWith("$")&&!x?(Z(!0),j(pe.slice(1))):pe.startsWith("$")||Z(!1)}const St=xm(v==null?void 0:v.runtime_config),Mt=[{value:"read-only",label:"Read Only",description:"Agent can only read files"},{value:"workspace-write",label:"Workspace Write",description:"Agent can read and write in workspace"},{value:"danger-full-access",label:"Danger Full Access",description:"Agent has unrestricted access"}],ht=[{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"}],en=[{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${$?" drag-over":""}`,onDragOver:Pe,onDragLeave:Te,onDrop:Ee,children:[me&&!q&&c.jsx(Sb,{commands:G,selectedIndex:Le,onSelect:$e,onHover:ne}),me&&q==="sandbox"&&c.jsx(Tu,{title:"Sandbox Mode",options:Mt,currentValue:St.sandboxMode,onSelect:Fe,onClose:()=>Y(void 0)}),me&&q==="websearch"&&c.jsx(Tu,{title:"Web Search",options:ht,currentValue:St.webSearchMode,onSelect:Fe,onClose:()=>Y(void 0)}),me&&q==="network"&&c.jsx(Tu,{title:"Network Access",options:en,currentValue:St.networkAccessEnabled===!0?"true":"false",onSelect:Fe,onClose:()=>Y(void 0)}),P&&c.jsx(Tb,{filter:V,onSelect:It,onClose:()=>{Z(!1),r("")}}),L.length>0&&c.jsx("div",{className:"skill-badges",children:L.map(H=>c.jsxs("span",{className:"skill-badge",children:["$",H.name,c.jsx("button",{className:"skill-badge-remove",onClick:()=>ce(pe=>pe.filter(Ue=>Ue.id!==H.id)),children:"×"})]},H.id))}),R.length>0&&c.jsx("div",{className:"attachment-preview-area",children:R.map(H=>c.jsxs("div",{className:"attachment-chip",title:H.name,children:[H.previewUrl?c.jsx("img",{src:H.previewUrl,alt:H.name,className:"attachment-thumb",onClick:()=>K(H),style:{cursor:"pointer"}}):c.jsx(ag,{size:20,className:"attachment-file-icon"}),c.jsxs("div",{className:"attachment-info",children:[c.jsx("span",{className:"attachment-name",children:H.name}),c.jsx("span",{className:"attachment-size",children:wm(H.size)})]}),c.jsx("button",{className:"attachment-remove",onClick:()=>fe(H.id),title:"Remove attachment",children:c.jsx(Wn,{size:14})})]},H.id))}),I&&!x&&!E&&c.jsx("input",{ref:a,type:"file",multiple:!0,accept:"image/*,application/pdf,text/*,.ts,.js,.tsx,.jsx,.py,.go,.rs,.java,.c,.cpp,.h,.css,.html,.xml,.yml,.yaml,.toml,.ini,.sh,.sql",style:{display:"none"},onChange:H=>{le(H.target.files),H.target.value=""}}),c.jsxs("div",{className:"cmd-input-row",children:[I&&!x&&!E&&c.jsx("button",{className:"attachment-clip-btn",onClick:()=>{var H;return(H=a.current)==null?void 0:H.click()},title:"Attach files",disabled:x,children:c.jsx(mw,{size:16})}),c.jsx("textarea",{ref:s,className:"cmd-textarea",placeholder:E?"Select or create a session…":S?"Interrupted — waiting to resume…":x?"Agent is running…":"Type a message… Use / for commands",autoComplete:"off",value:n,disabled:x||E,rows:1,style:{minHeight:ci,maxHeight:Nu},onChange:jn,onKeyDown:Dt,onPaste:Ce}),x?c.jsx("button",{className:"cmd-stop-btn",onClick:()=>f(),title:"Stop (Esc)",children:c.jsx(Ds,{size:15})}):c.jsx("button",{className:"cmd-send-btn",onClick:kt,disabled:!n.trim()||E,title:"Send (⌘↵)",children:c.jsx(H0,{size:16})})]}),Q&&c.jsx("div",{className:"image-preview-modal",onClick:()=>K(null),children:c.jsxs("div",{className:"image-preview-content",onClick:H=>H.stopPropagation(),children:[c.jsx("img",{src:Q.previewUrl,alt:Q.name}),c.jsxs("div",{className:"image-preview-info",children:[c.jsx("span",{children:Q.name}),c.jsx("span",{children:wm(Q.size)})]}),c.jsx("button",{className:"image-preview-close",onClick:()=>K(null),children:c.jsx(Wn,{size:20})})]})})]})}function Ab(){const n=M(T=>T.activeSessionId),r=M(T=>T.activeSessionId?T.sessionDetails[T.activeSessionId]:null),s=M(T=>T.activeTurnIndex),o=M(T=>T.setActiveTurnIndex),a=M(T=>T.rewindToTurn),u=M(T=>T.restoreSession),f=M(T=>T.branchFromTurn),h=(r==null?void 0:r.turns)??[],g=hl(r),m=!!(r!=null&&r.rewound_at_turn_id),v=(r==null?void 0:r.runtime_type)==="repoburg",k=v?"Rewind to this turn? Runtime history after this point is PERMANENTLY deleted and cannot be restored.":"Rewind to this turn? Hidden turns can be restored later.",[x,S]=w.useState(null),E=w.useRef(null);if(gl(E,()=>S(null),!!x),nd(()=>S(null),!!x),h.length===0)return c.jsx("div",{className:"empty-state",children:"No turns yet"});function C(T){o(T),requestAnimationFrame(()=>{var I;(I=document.getElementById(`turn-${T}`))==null||I.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,I)=>{const R=I===s,B=T.user_prompt.length>50?T.user_prompt.slice(0,50)+"…":T.user_prompt,$=T.status==="running"||T.status==="pending";return c.jsx("div",{children:c.jsxs("div",{className:`turn-item ${R?"active":""}`,onClick:()=>C(I),onContextMenu:W=>{W.preventDefault(),S({x:W.clientX,y:W.clientY,turnId:T.id,turnIndex:I,isLast:I===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(Tw,{size:12})}),c.jsx("span",{className:"turn-item-label",children:B}),$&&c.jsx("span",{className:"turn-item-status",children:T.status==="pending"&&T.resume_state==="waiting"?"interrupted":"running…"})]})},T.id)}),x&&c.jsxs("div",{ref:E,className:"ctx-menu",style:{position:"fixed",left:x.x,top:x.y,zIndex:500},children:[c.jsxs("div",{className:`ctx-menu-item ${x.isLast||g||x.isSlashCommand?"ctx-disabled":""}`,onClick:()=>{x.isLast||g||x.isSlashCommand||(window.confirm(k)&&a(n,x.turnId),S(null))},children:[c.jsx(yw,{size:12})," Rewind to Here",x.isSlashCommand?" (slash command)":""]}),m&&!v&&c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{u(n),S(null)},children:[c.jsx(yo,{size:12})," Restore Rewind"]}),c.jsxs("div",{className:"ctx-menu-item",onClick:()=>{f(n,x.turnId),S(null)},children:[c.jsx(tw,{size:12})," Branch from Here"]})]})]})}const Sm=2e4;function Ib(n){const r=[];return n.forEach((s,o)=>{var a;for(const u of s.items)if(u.type==="background_task"){if((((a=u.data)==null?void 0:a.task_type)||"unknown")==="local_agent")continue;r.push({item:u,turnIndex:o,turnPrompt:s.user_prompt})}}),r}function Db({entry:n}){const{item:r,turnIndex:s,turnPrompt:o}=n,a=r.data||{},u=a.task_type||"unknown",f=a.subagent_type||null,h=a.description||"",g=a.status||"running",m=a.summary||null,v=a.last_tool_name||null,k=a.token_count||null,x=a.output||"",S=r.status==="in_progress",E=u==="local_agent",C=u==="local_bash",T=E?ls:C?fg:og,I=E?`Subagent${f?`: ${f}`:""}`:C?"Monitor":"Background Task",R=g==="running"?"running…":g==="completed"?"done":g==="failed"?"failed":g==="stopped"?"stopped":g,B=r.status==="failed"||g==="failed",[$,W]=w.useState(S),[Q,K]=w.useState(!1),X=w.useRef(null);w.useEffect(()=>{S&&W(!0)},[S]),w.useEffect(()=>{$&&S&&X.current&&(X.current.scrollTop=X.current.scrollHeight)},[$,S,x]);const ue=x.length>Sm,me=ue&&!Q?x.slice(0,Sm)+`
|
|
472
|
+
… (truncated, click to expand)`:x,de=S?null:g==="completed"?c.jsx(os,{size:12}):B?c.jsx(vl,{size:12}):c.jsx(Ds,{size:12});return c.jsxs("div",{className:`task-card ${S?"task-running":""} ${B?"task-failed":""}`,children:[c.jsxs("div",{className:"task-card-header",onClick:()=>W(De=>!De),style:{cursor:"pointer"},children:[c.jsx("span",{className:"task-card-icon",children:c.jsx(T,{size:14})}),c.jsx("span",{className:"task-card-type",children:I}),c.jsxs("span",{className:`task-card-status ${B?"task-status-failed":S?"task-status-running":"task-status-done"}`,children:[de," ",R]}),c.jsx(id,{size:14,className:"task-card-chevron",style:{transform:$?"rotate(90deg)":"none",marginLeft:"auto"}})]}),h&&c.jsx("div",{className:"task-card-desc",children:h}),S&&v&&c.jsxs("div",{className:"task-card-meta",children:["last tool: ",v,k!=null&&` · ${k.toLocaleString()} tokens`]}),$&&c.jsxs("div",{className:"task-card-body",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("pre",{className:"cmd-output task-output",ref:X,children:c.jsx("code",{children:me})}),ue&&c.jsx("button",{className:"cmd-output-toggle",onClick:()=>K(De=>!De),children:Q?"Show less":`Show full output (${(x.length/1024).toFixed(0)}KB)`})]}):m?c.jsx("pre",{className:"cmd-output task-output",children:c.jsx("code",{children:m})}):S?c.jsx("div",{className:"task-card-placeholder",children:"Waiting for output…"}):c.jsx("div",{className:"task-card-placeholder",children:"No output captured."}),c.jsxs("div",{className:"task-card-context",title:o,children:["from turn ",s+1,": ",o.length>60?o.slice(0,60)+"…":o]})]})]})}const Mb=w.memo(Db);function Lb(){var g,m;const n=M(v=>v.activeSessionId?v.sessionDetails[v.activeSessionId]:null),r=M(v=>v.activeSessionId?v.backgroundTasks[v.activeSessionId]:void 0),s=(n==null?void 0:n.turns)??[],o=r??[],a=Ib(s),u=[...a].sort((v,k)=>{const x=v.item.status==="in_progress",S=k.item.status==="in_progress";return x&&!S?-1:!x&&S?1:k.turnIndex-v.turnIndex}),f=new Map;for(const v of o)v.task_type==="local_bash"&&f.set(v.task_id,v.task_type);for(const v of a)if(v.item.status==="in_progress"){const k=((g=v.item.data)==null?void 0:g.task_id)??v.item.external_item_id,x=((m=v.item.data)==null?void 0:m.task_type)??"unknown";f.set(k,x)}const h=[...f.values()].filter(v=>v==="local_bash").length;return a.length===0?c.jsx("div",{className:"empty-state",children:"No background tasks yet"}):c.jsxs("div",{className:"right-section",children:[c.jsxs("div",{className:"right-section-title",children:["Background Tasks (",a.length,")",h>0&&c.jsxs("span",{className:"task-count-badge",style:{color:"var(--amber)"},children:[" ",h," running"]})]}),u.map(v=>c.jsx(Mb,{entry:v},v.item.id))]})}const Pb=w.memo(Lb),Ob="Your job is to answer questions about this session:",bm="Understand the user's question below, read the session file given above, and answer.",zb=new Set(["claude"]);function $b(n){return zb.has(n)}function Td(n){return n.kind==="sidecar"}function Fb(n){const r=(n??[]).filter(Td);return r.length?r[r.length-1]:null}function Ub(n){if(!n.startsWith(Ob))return n;const r=n.indexOf(bm);return r<0?n:n.slice(r+bm.length).replace(/^\n+/,"")}function Bb({thread:n,onClose:r}){const{activeSessionId:s,resolveThread:o,shareThread:a}=M(),[u,f]=w.useState(""),[h,g]=w.useState(!1),[m,v]=w.useState(!1);async function k(){if(!s||h)return;g(!0),await a(s,n.id,u)?r():g(!1)}async function x(){!s||m||(v(!0),await o(s,n.id),r())}const S=h||m;return c.jsx("div",{className:"dialog-overlay",onClick:S?void 0:r,children:c.jsxs("div",{className:"dialog",onClick:E=>E.stopPropagation(),children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Resolve thread"}),c.jsx("button",{className:"dialog-close",onClick:r,disabled:S,children:c.jsx(Wn,{size:16})})]}),c.jsxs("div",{className:"dialog-body",children:[c.jsx("div",{className:"dialog-hint",children:"Share this thread's findings with the main session? The discussion will be summarized and the summary is added to your input as a quote."}),c.jsxs("label",{className:"dialog-label",children:["Summarization directives (optional)",c.jsx("textarea",{className:"dialog-input share-directives-input",placeholder:"e.g. focus on the performance findings, keep file paths",value:u,onChange:E=>f(E.target.value),rows:3,disabled:S,autoFocus:!0})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:r,disabled:S,children:"Cancel"}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:x,disabled:S,title:"Resolve without sharing",children:[m?c.jsx(Jn,{size:13,className:"spin"}):c.jsx(Za,{size:13}),"Resolve only"]}),c.jsxs("button",{className:"dialog-btn-create",onClick:k,disabled:S,children:[h?c.jsx(Jn,{size:13,className:"spin"}):c.jsx(ww,{size:13}),h?"Summarizing…":"Share & Resolve"]})]})]})})}const Tm=[];qe.setOptions({breaks:!0,gfm:!0});function Wb(n){const r=qe.parse(n);return bd.sanitize(r)}function Hb(n){var r,s,o;if(n.type==="agent_message"||n.type==="final_result"){const a=(r=n.data)==null?void 0:r.text;return typeof a=="string"&&a?a:null}if(n.type==="ask_user"){const a=Array.isArray((s=n.data)==null?void 0:s.groups)?n.data.groups:[],u=[(o=n.data)==null?void 0:o.question,...a.map(f=>f.question)].filter(f=>typeof f=="string"&&!!f);return u.length?u.join(`
|
|
473
|
+
|
|
474
|
+
`):null}return null}function Vb(n){const r=n.match(/^\[Quoting from your previous response\]:\n> .*\n\n([\s\S]*)$/);return r?r[1]:n}function iv({turn:n,formatPrompt:r=Vb}){const s=r(n.user_prompt),o=n.items.map(Hb).filter(a=>a!==null);return o.length===0&&n.status==="completed"&&n.agent_response&&o.push(n.agent_response),c.jsxs("div",{className:"thread-card-turn",children:[c.jsx("div",{className:"thread-card-user-message",children:s}),o.map((a,u)=>c.jsx("div",{className:"thread-card-ai-response",dangerouslySetInnerHTML:{__html:Wb(a)}},u)),o.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 qb({thread:n,threadTurns:r,onStop:s,onResolve:o,onReopen:a,onDelete:u,onFollowup:f,onLocate:h}){var je,Le,ne;const[g,m]=w.useState(""),[v,k]=w.useState(!0),x=w.useRef(null),S=w.useRef(null),[E,C]=w.useState(!1),[T,I]=w.useState({x:0,y:0}),[R,B]=w.useState(""),$=r.some(as),W=28,Q=120,K=w.useRef(W);w.useEffect(()=>{const q=S.current;q&&(q.scrollTop=q.scrollHeight)},[r.length,v]);function X(q){const Y=x.current;Y&&(Y.style.height=`${q}px`,K.current=q)}function ue(){const q=x.current;if(q){if(q.scrollHeight>q.clientHeight){const Y=Math.min(q.scrollHeight,Q);Y!==K.current&&X(Y);return}K.current>W&&(q.style.height="auto",X(Math.min(q.scrollHeight,Q)))}}const me=w.useCallback(()=>{C(!1)},[]),de=w.useCallback(()=>{const q=S.current;if(!q)return;const Y=window.getSelection();if(!Y||Y.rangeCount===0||Y.isCollapsed){C(!1);return}const P=Y.getRangeAt(0);if(!q.contains(P.commonAncestorContainer)){C(!1);return}const Z=P.commonAncestorContainer.nodeType===Node.TEXT_NODE?P.commonAncestorContainer.parentElement:P.commonAncestorContainer;if(!(Z!=null&&Z.closest(".thread-card-ai-response"))){C(!1);return}const V=Y.toString();if(!V.trim()){C(!1);return}const j=P.getBoundingClientRect(),L=28,ce=6,G=170;let le=!1;if(Y.anchorNode&&Y.focusNode)try{const Te=document.createRange();Te.setStart(Y.focusNode,Y.focusOffset),Te.setEnd(Y.focusNode,Y.focusOffset);const Ee=document.createRange();Ee.setStart(Y.anchorNode,Y.anchorOffset),Ee.setEnd(Y.anchorNode,Y.anchorOffset),le=Ee.compareBoundaryPoints(Range.START_TO_START,Te)>0}catch{le=!1}let fe=j.top-L-ce;fe<8&&(fe=j.bottom+ce);let Pe=le?j.left-G:j.right;Pe=Math.max(8,Math.min(Pe,window.innerWidth-G-8)),I({x:Pe,y:fe}),B(V),C(!0)},[]);w.useEffect(()=>{function q(Y){const P=Y.target;P&&P.closest(".selection-actions")||de()}return document.addEventListener("mouseup",q),()=>document.removeEventListener("mouseup",q)},[de]);const De=w.useCallback(()=>{var Y;const q=`
|
|
475
|
+
\`\`\`QUOTE
|
|
476
|
+
${R}
|
|
477
|
+
\`\`\`
|
|
478
|
+
|
|
479
|
+
`;m(P=>P+q),C(!1),B(""),(Y=window.getSelection())==null||Y.removeAllRanges(),setTimeout(()=>{if(x.current){ue(),x.current.focus();const P=x.current.value.length;x.current.setSelectionRange(P,P)}},0)},[R]);return c.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[c.jsxs("div",{className:"thread-card-header",onClick:()=>k(q=>!q),children:[c.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((ne=(Le=(je=n.turns)==null?void 0:je[0])==null?void 0:Le.user_prompt)==null?void 0:ne.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:q=>{q.stopPropagation(),h()},title:"Scroll to text",children:c.jsx(dw,{size:12})}),c.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),v&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"thread-card-conversation",ref:S,onMouseDown:me,children:[r.map(q=>c.jsx(iv,{turn:q},q.id)),r.length===0&&c.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),E&&c.jsx("div",{className:"selection-actions",style:{left:T.x,top:T.y},children:c.jsxs("button",{className:"discuss-button",onClick:De,title:"Quote this text in your follow-up",children:[c.jsx(ug,{size:14}),c.jsx("span",{children:"Quote"})]})}),n.status==="open"&&c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:$?"Agent is running…":"Type a follow-up…",value:g,onChange:q=>{Ot.markInputChange(),m(q.target.value),ue()},disabled:$,rows:1,style:{minHeight:W,maxHeight:Q},onKeyDown:q=>{Ot.markKeystroke(),q.key==="Enter"&&(q.metaKey||q.ctrlKey)&&!$&&g.trim()&&(q.preventDefault(),f(g.trim()),m(""),X(W))}}),c.jsx("button",{className:"thread-card-followup-send",disabled:$||!g.trim(),onClick:()=>{f(g.trim()),m("")},children:c.jsx(So,{size:13})}),$&&c.jsx("button",{className:"thread-card-followup-stop",onClick:s,title:"Stop this thread's turn (Esc)",children:c.jsx(Ds,{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(Za,{size:13})," Resolve"]}):c.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[c.jsx(yo,{size:13})," Reopen"]}),c.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:u,title:"Delete thread",children:[c.jsx(dr,{size:13})," Delete"]})]})]})]})}function Gb(){Ot.trackRender("ThreadsPanel");const n=M(I=>I.activeSessionId),r=M(I=>{var R;return I.activeSessionId?((R=I.sessionDetails[I.activeSessionId])==null?void 0:R.threads)??Tm:Tm}),s=w.useMemo(()=>r.filter(I=>!Td(I)),[r]),o=M(I=>I.followupThread),a=M(I=>I.cancelThreadTurn),u=M(I=>I.reopenThread),f=M(I=>I.deleteThread),h=M(I=>I.deepLinkThreadId),g=M(I=>I.setDeepLinkThreadId),[m,v]=w.useState("open"),[k,x]=w.useState(null);w.useEffect(()=>{if(!h)return;const I=h;g(null),v(B=>s.some($=>$.id===I&&$.status==="open")?B:"all");const R=setTimeout(()=>{const B=document.getElementById(`thread-${I}`);B&&(B.scrollIntoView({behavior:"smooth",block:"center"}),B.classList.add("thread-card-highlighted"),setTimeout(()=>B.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(R)},[h,g,s]);const S=s.filter(I=>m==="open"?I.status==="open":m==="resolved"?I.status==="resolved":!0),E=s.filter(I=>I.status==="open").length,C=s.filter(I=>I.status==="resolved").length;function T(I){setTimeout(()=>{const R=document.querySelector(`mark[data-thread-id="${I}"]`);R&&(R.scrollIntoView({behavior:"smooth",block:"center"}),R.classList.add("thread-mark-flash"),setTimeout(()=>R.classList.remove("thread-mark-flash"),1500))},50)}return n?s.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(cg,{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 ${m==="open"?"active":""}`,onClick:()=>v("open"),children:["Open (",E,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="resolved"?"active":""}`,onClick:()=>v("resolved"),children:["Resolved (",C,")"]}),c.jsxs("button",{className:`thread-filter-tab ${m==="all"?"active":""}`,onClick:()=>v("all"),children:["All (",s.length,")"]})]}),S.length===0?c.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",m," threads."]}):S.map(I=>c.jsx(qb,{thread:I,threadTurns:I.turns??[],onStop:()=>a(n,I.id),onResolve:()=>x(I),onReopen:()=>u(n,I.id),onDelete:()=>f(n,I.id),onFollowup:R=>o(n,I.id,R),onLocate:()=>T(I.id)},I.id)),k&&c.jsx(Bb,{thread:k,onClose:()=>x(null)})]}):c.jsx("div",{className:"empty-state",children:"No session selected"})}function Kb(){const n=M(f=>f.apps),r=M(f=>f.activeAppTabId),s=M(f=>f.openAppTab),o=M(f=>f.startAppEdit),a=M(f=>f.toggleAppPin),u=M(f=>f.deleteApp);return n.length===0?c.jsx("div",{className:"empty-state",style:{padding:"16px"},children:"No mini apps yet. Add one with the + button in the sidebar Apps section."}):c.jsx("div",{className:"apps-panel",children:n.map(f=>c.jsxs("div",{className:`apps-panel-row${r===f.id?" active":""}`,onClick:()=>s(f.id),title:f.description??void 0,children:[c.jsx(yi,{iconNode:f.iconNode,size:14,className:"sidebar-app-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(Ba,{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(Ja,{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(dr,{size:12})})]},f.id))})}function Yb(){Ot.trackRender("SidecarPanel");const n=M(T=>T.activeSessionId),r=M(T=>{var I;return T.activeSessionId?(I=T.sessionDetails[T.activeSessionId])==null?void 0:I.runtime_type:void 0}),s=M(T=>{var I;return T.activeSessionId?Fb((I=T.sessionDetails[T.activeSessionId])==null?void 0:I.threads):null}),o=M(T=>T.askSidecar),a=M(T=>T.cancelThreadTurn),u=M(T=>T.deleteThread),[f,h]=w.useState(""),[g,m]=w.useState(!1),v=w.useRef(null),k=(s==null?void 0:s.turns)??[],x=k[k.length-1],S=k.some(as);if(w.useEffect(()=>{var T,I;(I=(T=v.current)==null?void 0:T.scrollIntoView)==null||I.call(T,{block:"end"})},[k.length,x==null?void 0:x.items.length,x==null?void 0:x.status]),!n||!r)return c.jsx("div",{className:"empty-state",children:"No session selected"});if(!$b(r))return c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsxs("div",{children:["The sidecar is not available for ",r," sessions yet."]})]});const E=!S&&!g&&f.trim().length>0;async function C(){if(!n||!E)return;m(!0);const T=await o(n,f.trim());m(!1),T&&h("")}return c.jsxs("div",{className:"sidecar-panel",children:[c.jsxs("div",{className:"sidecar-conversation",children:[k.length===0?c.jsxs("div",{className:"empty-state",children:[c.jsx(ls,{size:24,style:{opacity:.3,marginBottom:8}}),c.jsx("div",{children:"Ask about this session."}),c.jsx("div",{className:"sidecar-hint",children:"Where does it stand? Is it stuck? When will it finish? What is done and what is left?"})]}):k.map(T=>c.jsx(iv,{turn:T,formatPrompt:Ub},T.id)),c.jsx("div",{ref:v})]}),c.jsxs("div",{className:"sidecar-footer",children:[c.jsxs("div",{className:"thread-card-followup",children:[c.jsx("textarea",{className:"thread-card-followup-input","aria-label":"Ask the sidecar",placeholder:S?"Sidecar is answering…":"Ask about this session… (⌘/Ctrl+Enter)",value:f,rows:2,disabled:S,onChange:T=>{Ot.markInputChange(),h(T.target.value)},onKeyDown:T=>{Ot.markKeystroke(),T.key==="Enter"&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),C())}}),S&&s?c.jsx("button",{className:"thread-card-followup-stop",title:"Stop the answer","aria-label":"Stop the answer",onClick:()=>a(n,s.id),children:c.jsx(Ds,{size:13})}):c.jsx("button",{className:"thread-card-followup-send",title:"Ask","aria-label":"Ask",disabled:!E,onClick:()=>void C(),children:c.jsx(So,{size:13})})]}),s&&c.jsx("div",{className:"thread-card-actions",children:c.jsxs("button",{className:"thread-action-btn thread-action-danger",title:"Clear the sidecar conversation",disabled:S,onClick:()=>u(n,s.id),children:[c.jsx(dr,{size:13})," Clear"]})})]})]})}function Xb(){var g;Ot.trackRender("RightPanel");const n=M(m=>m.activeRightTab),r=M(m=>m.switchRightTab),s=M(m=>m.rightPanelCollapsed),o=M(m=>m.toggleRightPanel),a=M(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),u=M(m=>{var v;return m.activeSessionId?((v=m.backgroundTasks[m.activeSessionId])==null?void 0:v.length)??0:0}),f=((g=a==null?void 0:a.threads)==null?void 0:g.filter(m=>m.status==="open"&&!Td(m)).length)??0,h=[{id:"turns",label:"Turns",icon:iw},{id:"sidecar",label:"Sidecar",icon:ls},{id:"tasks",label:"Tasks",icon:sw,badge:u||void 0},{id:"threads",label:"Threads",icon:cg,badge:f||void 0},{id:"apps",label:"Apps",icon:lg}];return s?c.jsxs("div",{className:"ide-right collapsed",children:[c.jsx("button",{type:"button",className:"right-icon-btn",title:"Expand panel","aria-label":"Expand panel","aria-expanded":!1,onClick:o,children:c.jsx(pw,{size:15})}),c.jsx("div",{className:"right-rail-divider"}),h.map(m=>{const v=m.icon,k=m.badge?`${m.label} (${m.badge})`:m.label;return c.jsxs("button",{type:"button",className:`right-icon-btn right-rail-tab ${n===m.id?"active":""}`,title:k,"aria-label":k,onClick:()=>r(m.id),children:[c.jsx(v,{size:15}),m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id)})]}):c.jsxs("div",{className:"ide-right",children:[c.jsxs("div",{className:"right-header",children:[c.jsx("div",{className:"right-tabs",children:h.map(m=>c.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?c.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),c.jsx("button",{type:"button",className:"right-icon-btn right-collapse-btn",title:"Collapse panel","aria-label":"Collapse panel","aria-expanded":!0,onClick:o,children:c.jsx(fw,{size:14})})]}),c.jsxs("div",{className:"right-content",children:[n==="turns"&&c.jsx(Ab,{}),n==="sidecar"&&c.jsx(Yb,{}),n==="tasks"&&c.jsx(Pb,{}),n==="threads"&&c.jsx(Gb,{}),n==="apps"&&c.jsx(Kb,{})]})]})}const _e={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Wu=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max,_e.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max,_e.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high,_e.xhigh,_e.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[_e.low,_e.medium,_e.high]}]}];function Qb(n){return Wu.find(r=>r.id===n)}function Nd(n){const r=Qb(n);return(r==null?void 0:r.models)??[]}function ov(n,r){return Nd(n).find(s=>s.slug===r)}function Hu(n,r){var s;return((s=ov(n,r))==null?void 0:s.reasoningLevels)??[]}function Vu(n,r){var s;return(s=ov(n,r))==null?void 0:s.defaultReasoning}function Zb(){const{activeSessionId:n,sessions:r,updateModelConfig:s}=M(),o=M(ne=>ne.showModelSelector),a=M(ne=>ne.setShowModelSelector),u=r.find(ne=>ne.id===n),f=M(ne=>ne.models),h=M(ne=>ne.modelsLoading),g=M(ne=>ne.loadModels),[m,v]=w.useState(!1),k=w.useRef(null);if(gl(k,()=>v(!1),m),nd(()=>v(!1),m),w.useEffect(()=>{o&&(v(!0),a(!1))},[o,a]),w.useEffect(()=>{u!=null&&u.runtime_type&&g(u.runtime_type,u.cwd??void 0)},[u==null?void 0:u.runtime_type,u==null?void 0:u.cwd,g]),!u)return null;const x=u.runtime_type,S=u.model??"",E=u.model_reasoning_effort??"",C=f.length>0?f:[],T=Nd(x),R=[...C.length>0?C:T];if(S&&!R.some(ne=>ne.slug===S)){const ne=T[0];R.unshift({slug:S,displayName:S,description:"Custom model",defaultReasoning:(ne==null?void 0:ne.defaultReasoning)??"medium",reasoningLevels:(ne==null?void 0:ne.reasoningLevels)??[]})}function B(ne){return R.find(q=>q.slug===ne)}function $(ne){var q;return C.length>0?((q=B(ne))==null?void 0:q.reasoningLevels)??[]:Hu(x,ne)}function W(ne){var q;return C.length>0?(q=B(ne))==null?void 0:q.defaultReasoning:Vu(x,ne)}const Q=Wu.find(ne=>ne.id===x),K=B(S),X=S?$(S):[],ue=(Q==null?void 0:Q.label)??x,me=(K==null?void 0:K.displayName)??(S||"Default"),de=X.find(ne=>ne.effort===E),De=(de==null?void 0:de.label)??(E||"Default");function je(ne){var Z;const q=$(ne),P=q.some(V=>V.effort===E)?E:W(ne)??((Z=q[0])==null?void 0:Z.effort)??"";s(ne,P),v(!1)}function Le(ne){s(S,ne),v(!1)}return c.jsxs("div",{className:"model-selector",ref:k,children:[c.jsxs("button",{className:"model-selector-btn",onClick:()=>v(!m),title:"Change model and thinking level",children:[c.jsx("span",{className:"model-selector-provider",children:ue}),c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-model",children:me}),De!=="Default"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"model-selector-sep",children:"›"}),c.jsx("span",{className:"model-selector-reasoning",children:De})]}),c.jsx(mi,{size:12,className:"model-selector-chevron"})]}),m&&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"}),Wu.map(ne=>c.jsxs("div",{className:`model-selector-item ${ne.id===x?"selected":""} ${ne.available?"":"disabled"}`,onClick:()=>{if(ne.available){if(ne.id===x){v(!1);return}s("","",ne.id)}},children:[c.jsx("span",{children:ne.label}),!ne.available&&c.jsxs("span",{className:"model-selector-coming-soon",children:[c.jsx(lw,{size:10})," Soon"]}),ne.id===x&&c.jsx(os,{size:12})]},ne.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&&R.length===0&&c.jsx("div",{className:"model-selector-empty",children:"No models available"}),R.map(ne=>c.jsxs("div",{className:`model-selector-item ${ne.slug===S?"selected":""}`,onClick:()=>je(ne.slug),children:[c.jsxs("div",{className:"model-selector-item-main",children:[c.jsx("span",{className:"model-selector-item-name",children:ne.displayName}),c.jsx("span",{className:"model-selector-item-desc",children:ne.description})]}),ne.slug===S&&c.jsx(os,{size:12})]},ne.slug))]}),c.jsxs("div",{className:"model-selector-column",children:[c.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),X.length===0&&c.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),X.map(ne=>c.jsxs("div",{className:`model-selector-item ${ne.effort===E?"selected":""}`,onClick:()=>Le(ne.effort),children:[c.jsx("span",{children:ne.label}),ne.effort===E&&c.jsx(os,{size:12})]},ne.effort))]})]})]})}function oo(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Nm(){const n=M(r=>r.setShowRemoteModal);return c.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[c.jsx(Cw,{size:14})," Repoburg"]})}function Cm(){const n=M(s=>s.vscodeViewOpen),r=M(s=>s.toggleVscodeView);return c.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[c.jsx(X0,{size:14})," Code"]})}function Jb(){var x,S;Ot.trackRender("StatusBar");const n=M(E=>E.activeSessionId),r=M(E=>n?E.sessions.find(C=>C.id===n)??null:null),s=M(E=>n?E.sessionDetails[n]??null:null),o=M(E=>n?E.backgroundTasks[n]:void 0),a=M(E=>E.wsConnected),u=M(E=>E.switchRightTab),f=(s==null?void 0:s.contextUsage)??null;if(!r)return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Cm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-spacer"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(Th,{size:14})," K"]})]});const h=o??[],g=ml(r,h.length),m=new Set,v=new Map;for(const E of h)m.add(E.task_id),v.set(E.task_id,E.task_type);for(const E of(s==null?void 0:s.turns)??[])for(const C of E.items)if(C.type==="background_task"&&C.status==="in_progress"){const T=((x=C.data)==null?void 0:x.task_id)??C.external_item_id,I=((S=C.data)==null?void 0:S.task_type)??"unknown";m.add(T),v.set(T,I)}const k=[...v.values()].filter(E=>E==="local_bash").length;return c.jsxs("div",{className:"ide-statusbar",children:[c.jsx(Nm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Cm,{}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx(Zb,{}),k>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>u("tasks"),children:[c.jsx(pg,{size:14})," ",k]})]}),c.jsx("div",{className:"sb-spacer"}),c.jsx("div",{className:"sb-item",title:a?"WebSocket connected":"WebSocket disconnected",children:a?"Live":"Offline"}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-item",style:g.dot==="background"?{color:"var(--purple)"}:r.status==="failed"?{color:"var(--red)"}:void 0,title:g.dot==="background"?g.dotTitle:void 0,children:g.label}),f&&c.jsx(eT,{usage:f}),c.jsx("div",{className:"sb-divider",children:"|"}),c.jsxs("div",{className:"sb-item",children:[c.jsx(Th,{size:14})," K"]})]})}function eT({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",s=`${oo(n.totalTokens)} / ${oo(n.contextWindow)} tokens`+(n.autoCompactThreshold?` · auto-compacts at ${oo(n.autoCompactThreshold)}`:"");return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sb-divider",children:"|"}),c.jsx("div",{className:"sb-context",title:s,children:c.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",oo(n.totalTokens)," / ",oo(n.contextWindow)]})})]})}function Em(n){return yn(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function tT(n){return pt("/vscode-web/start",{folder:n})}function nT(n){return pt("/vscode-web/heartbeat",{id:n})}const rT=1e3,sT=5*6e4;function _m({children:n}){const r=M(s=>s.toggleVscodeView);return c.jsxs("div",{className:"vscode-view vscode-view--loading",children:[n,c.jsx("button",{className:"dialog-close vscode-view-close",title:"Close VS Code view","aria-label":"Close VS Code view",onClick:r,children:c.jsx(Wn,{size:16})})]})}function iT(){const n=M(E=>E.vscodeState),r=M(E=>E.vscodeId),s=M(E=>E.vscodeToken),o=M(E=>E.setVscodeView),a=M(E=>{var T;const C=E.activeSessionId?E.sessions.find(I=>I.id===E.activeSessionId):null;return C!=null&&C.cwd?C.cwd:((T=E.workspaces.find(I=>I.deleted===0))==null?void 0:T.path)??null}),[u,f]=w.useState(!1),[h,g]=w.useState(0),m=w.useRef(null),v=dn(),k=v===""||v===window.location.origin,x=`${v}/vscode/${r??""}/?tkn=${s??""}${a?`&folder=${encodeURIComponent(a)}`:""}`;w.useEffect(()=>{let E=!1;function C(){m.current&&(clearInterval(m.current),m.current=null)}async function T(){try{let R=await Em(a);if((R.state==="stopped"||R.state==="error")&&(R=await tT(a)),E||(o(R.state,R.id,R.token),R.state==="running"||R.state==="error"))return;m.current=setInterval(async()=>{const B=await Em(a);E||(o(B.state,B.id,B.token),(B.state==="running"||B.state==="error"||B.state==="stopped")&&C())},rT)}catch{E||o("error",null,null)}}T();const I=setInterval(()=>{const R=M.getState().vscodeId;R&&nT(R).catch(()=>{})},sT);return()=>{E=!0,C(),clearInterval(I)}},[h,a,o]);function S(){f(!1),o("starting",null,null),g(E=>E+1)}return n!=="running"||!s||!r?c.jsx(_m,{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:S,children:[c.jsx(yo,{size:14})," Retry"]})]}):c.jsxs("span",{className:"vscode-view-hint",children:[c.jsx(Jn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):k?c.jsxs("div",{className:"vscode-view",children:[!u&&c.jsxs("div",{className:"vscode-view-overlay",children:[c.jsx(Jn,{size:16,className:"spin"})," Loading VS Code…"]}),c.jsx("iframe",{src:x,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]}):c.jsxs(_m,{children:[c.jsx("span",{children:"VS Code cannot be embedded on this host — serve-web allows same-origin frames only."}),c.jsxs("button",{className:"dialog-btn-cancel",onClick:()=>window.open(x,"_blank","noopener"),children:[c.jsx(J0,{size:14})," Open VS Code in a new tab"]})]})}const jm=/^[a-f0-9]{64}\.(?:png|jpg|gif|webp)$/,oT=/^(?:https?:\/\/[^/?#]+)?\/api\/apps\/([^/?#]+)\/files\/([^/?#]+)$/i,aT={png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function av(){return dn()||window.location.origin}function lv(n,r){let s=r;if(s&&typeof s=="object"){const f=s;s=typeof f.id=="string"?f.id:f.url}if(typeof s!="string")return null;const o=s.trim();if(jm.test(o))return o;const a=oT.exec(o);if(!a)return null;let u;try{u=decodeURIComponent(a[1])}catch{return null}return u===n&&jm.test(a[2])?a[2]:null}function Rm(n){return/^https?:\/\//i.test(n.url)?n:{...n,url:`${av()}${n.url}`}}function lT(n){return aT[n.slice(n.lastIndexOf(".")+1)]??"application/octet-stream"}function cv(n){return new Promise((r,s)=>{const o=new FileReader;o.onload=()=>{const a=String(o.result??"");r(a.slice(a.indexOf(",")+1))},o.onerror=()=>s(o.error??new Error("Could not read the file")),o.readAsDataURL(n)})}function cT(n,r){const s=/^data:([^;,]*)(?:;[^;,]*)*;base64,/i.exec(n);return s?{type:r||s[1]||void 0,data:n.slice(s[0].length)}:{type:r,data:n}}async function uv(n){if(n instanceof Blob){const r=n.name;return{name:typeof r=="string"&&r?r:void 0,type:n.type||void 0,data:await cv(n)}}if(n&&typeof n=="object"&&typeof n.data=="string"){const r=n;return{name:typeof r.name=="string"&&r.name?r.name:void 0,type:typeof r.type=="string"&&r.type?r.type:void 0,data:r.data}}return null}async function uT(n){const r=await uv(n);if(!r)throw new Error("uploadFile: expected a Blob/File or { name, type, data }");return r}async function dT(n,r,s){if(r==null)return[];if(!Array.isArray(r))throw new Error("submitTurn: attachments must be an array");const o=[];for(let a=0;a<r.length;a++){const u=r[a],f=await uv(u);if(f){const{type:m,data:v}=cT(f.data,f.type);if(!m)throw new Error(`submitTurn: attachment ${a+1} has no type`);o.push({name:f.name??`attachment-${a+1}`,media_type:m,data:v});continue}const h=lv(n,u);if(!h)throw new Error(`submitTurn: attachment ${a+1} is not a file of this app`);const g=await s(h);o.push({name:h,media_type:lT(h),data:await cv(g)})}return o}const fT=`function (config) {
|
|
480
|
+
var nextId = 1;
|
|
481
|
+
var pending = new Map();
|
|
482
|
+
var listeners = [];
|
|
483
|
+
// Absolute http(s) URL, or null. Relative and #fragment hrefs are not
|
|
484
|
+
// external and keep their in-frame behavior.
|
|
485
|
+
function externalUrl(raw) {
|
|
486
|
+
if (typeof raw !== 'string' || !/^\\s*https?:\\/\\//i.test(raw)) return null;
|
|
487
|
+
try { return new URL(raw.trim()).href; } catch (err) { return null; }
|
|
488
|
+
}
|
|
489
|
+
// New browser tab. The sandbox lets popups escape it, so the page loads
|
|
490
|
+
// like any other tab; noopener leaves it no handle back to this frame.
|
|
491
|
+
function openTab(url) {
|
|
492
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
493
|
+
}
|
|
494
|
+
// A plain external link would navigate THIS frame: the app disappears and
|
|
495
|
+
// most sites refuse to be framed anyway. Open it in a new tab instead.
|
|
496
|
+
// Bubble phase on window, so the app's own handlers run first and can
|
|
497
|
+
// still claim the click with preventDefault(). Modifier clicks and
|
|
498
|
+
// target="_blank" links already open a tab natively.
|
|
499
|
+
window.addEventListener('click', function (e) {
|
|
500
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
501
|
+
var a = e.target && e.target.closest ? e.target.closest('a[href]') : null;
|
|
502
|
+
if (!a) return;
|
|
503
|
+
var target = (a.getAttribute('target') || '').toLowerCase();
|
|
504
|
+
if (target && target !== '_self' && target !== '_parent' && target !== '_top') return;
|
|
505
|
+
var url = externalUrl(a.getAttribute('href'));
|
|
506
|
+
if (!url) return;
|
|
507
|
+
e.preventDefault();
|
|
508
|
+
openTab(url);
|
|
509
|
+
});
|
|
510
|
+
// Stored files: <apiOrigin>/api/apps/<app-id>/files/<id>. Same reference
|
|
511
|
+
// rules as the pane (utils/appFiles.ts): an id, a file URL of this app on
|
|
512
|
+
// any origin, or an object carrying id/url.
|
|
513
|
+
var FILE_ID_RE = /^[a-f0-9]{64}\\.(?:png|jpg|gif|webp)$/;
|
|
514
|
+
var FILE_URL_RE = /^(?:https?:\\/\\/[^\\/?#]+)?\\/api\\/apps\\/([^\\/?#]+)\\/files\\/([^\\/?#]+)$/i;
|
|
515
|
+
function fileRefId(ref) {
|
|
516
|
+
if (ref && typeof ref === 'object') ref = typeof ref.id === 'string' ? ref.id : ref.url;
|
|
517
|
+
if (typeof ref !== 'string') return null;
|
|
518
|
+
var s = ref.trim();
|
|
519
|
+
if (FILE_ID_RE.test(s)) return s;
|
|
520
|
+
var m = FILE_URL_RE.exec(s);
|
|
521
|
+
if (!m) return null;
|
|
522
|
+
var owner;
|
|
523
|
+
try { owner = decodeURIComponent(m[1]); } catch (err) { return null; }
|
|
524
|
+
return owner === config.appId && FILE_ID_RE.test(m[2]) ? m[2] : null;
|
|
525
|
+
}
|
|
526
|
+
function fileUrl(ref) {
|
|
527
|
+
var id = fileRefId(ref);
|
|
528
|
+
if (!id) return typeof ref === 'string' ? ref : '';
|
|
529
|
+
return config.apiOrigin + '/api/apps/' + encodeURIComponent(config.appId) + '/files/' + id;
|
|
530
|
+
}
|
|
531
|
+
window.addEventListener('message', function (e) {
|
|
532
|
+
var msg = e.data;
|
|
533
|
+
if (!msg || msg.source !== 'agentpane-host') return;
|
|
534
|
+
if (msg.id != null && pending.has(msg.id)) {
|
|
535
|
+
var p = pending.get(msg.id);
|
|
536
|
+
pending.delete(msg.id);
|
|
537
|
+
if (msg.ok) p.resolve(msg.result); else p.reject(new Error(msg.error || 'bridge error'));
|
|
538
|
+
} else if (msg.event) {
|
|
539
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
540
|
+
try { listeners[i](msg.event, msg.payload); } catch (err) { /* app error */ }
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
function call(method, params) {
|
|
545
|
+
return new Promise(function (resolve, reject) {
|
|
546
|
+
var id = nextId++;
|
|
547
|
+
pending.set(id, { resolve: resolve, reject: reject });
|
|
548
|
+
try {
|
|
549
|
+
parent.postMessage({ source: 'agentpane-app', id: id, method: method, params: params || null }, '*');
|
|
550
|
+
} catch (err) {
|
|
551
|
+
// Params that cannot be cloned (functions, DOM nodes, ...).
|
|
552
|
+
pending.delete(id);
|
|
553
|
+
reject(err);
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
window.AgentPane = {
|
|
558
|
+
getApp: function () { return call('getApp'); },
|
|
559
|
+
getState: function () { return call('getState'); },
|
|
560
|
+
setState: function (data) { return call('setState', { data: data }); },
|
|
561
|
+
createSession: function (opts) { return call('createSession', opts); },
|
|
562
|
+
submitTurn: function (sessionId, prompt, opts) {
|
|
563
|
+
var params = { sessionId: sessionId, prompt: prompt };
|
|
564
|
+
if (opts && opts.attachments != null) params.attachments = opts.attachments;
|
|
565
|
+
return call('submitTurn', params);
|
|
566
|
+
},
|
|
567
|
+
onTurnCompleted: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:completed' || event === 'turn:failed') cb(event, payload); }); },
|
|
568
|
+
onTurnDelta: function (cb) { listeners.push(function (event, payload) { if (event === 'turn:delta' && payload) cb(payload); }); },
|
|
569
|
+
onToolCall: function (cb) { listeners.push(function (event, payload) { if (event === 'tool_call' && payload) cb(payload); }); },
|
|
570
|
+
onStateChanged: function (cb) { listeners.push(function (event, payload) { if (event === 'state_changed') cb(payload || {}); }); },
|
|
571
|
+
resolveToolCall: function (callId, result) { return call('resolveToolCall', { callId: callId, result: result }); },
|
|
572
|
+
openSession: function (sessionId) { return call('openSession', { sessionId: sessionId }); },
|
|
573
|
+
openUrl: function (url) {
|
|
574
|
+
var href = externalUrl(url);
|
|
575
|
+
if (!href) return Promise.reject(new Error('openUrl: expected an absolute http(s) URL, got ' + JSON.stringify(url)));
|
|
576
|
+
try { openTab(href); } catch (err) { return Promise.reject(err); }
|
|
577
|
+
return Promise.resolve({ ok: true });
|
|
578
|
+
},
|
|
579
|
+
uploadFile: function (file) { return call('uploadFile', { file: file }); },
|
|
580
|
+
getFile: function (ref) { return call('getFile', { ref: ref }); },
|
|
581
|
+
fileUrl: fileUrl
|
|
582
|
+
};
|
|
583
|
+
// Runtime error reporting — surface compile checks' blind side to the pane.
|
|
584
|
+
window.addEventListener('error', function (e) {
|
|
585
|
+
parent.postMessage({
|
|
586
|
+
source: 'agentpane-app', report: 'error',
|
|
587
|
+
message: e.message || 'Unknown error',
|
|
588
|
+
stack: (e.error && e.error.stack) || '',
|
|
589
|
+
line: e.lineno || 0, col: e.colno || 0
|
|
590
|
+
}, '*');
|
|
591
|
+
});
|
|
592
|
+
window.addEventListener('unhandledrejection', function (e) {
|
|
593
|
+
var r = e.reason;
|
|
594
|
+
var msg = r && (r.message || String(r)) || 'unknown';
|
|
595
|
+
parent.postMessage({
|
|
596
|
+
source: 'agentpane-app', report: 'error',
|
|
597
|
+
message: 'Unhandled promise rejection: ' + msg,
|
|
598
|
+
stack: (r && r.stack) || '', line: 0, col: 0
|
|
599
|
+
}, '*');
|
|
600
|
+
});
|
|
601
|
+
}`;function pT(n){return`(${fT})(${JSON.stringify(n)});`}function Am(n){return n.replace(/<\/script/gi,"<\\/script")}function hT(n,r){const s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(s,"gi");let a=-1,u;for(;(u=o.exec(n))!==null;)a=u.index;return a}function Im(n,r,s){const o=hT(n,r);return o===-1?n+s:n.slice(0,o)+s+n.slice(o)}function mT(n,r,s){let o=n;const a=`<script>${Am(r)}<\/script>`;if(/<\/head>/i.test(o)?o=Im(o,"</head>",a):/<html[^>]*>/i.test(o)?o=o.replace(/(<html[^>]*>)/i,`$1<head>${a}</head>`):o=`${a}${o}`,s){const u=`<script>${Am(s)}<\/script>`;o=Im(o,"</body>",u)}return o}function gT({appId:n,workspace:r=""}){const s=w.useRef(null),o=w.useRef({pinned:!1,data:null}),[a,u]=w.useState(null),[f,h]=w.useState(null),[g,m]=w.useState([]);w.useEffect(()=>{let S=!0;Fx(n,C=>{var T,I;return(I=(T=s.current)==null?void 0:T.contentWindow)==null?void 0:I.postMessage(C,"*")});const E=async C=>{var $,W,Q,K,X,ue,me,de,De,je,Le,ne;if(C.source!==(($=s.current)==null?void 0:$.contentWindow))return;const T=C.data;if(!T||T.source!=="agentpane-app")return;if(T.report==="error"){const q={message:String(T.message??"Unknown error"),stack:String(T.stack??"")};m(Y=>{const P=Y[Y.length-1];return P&&P.message===q.message?Y:[...Y,q].slice(-20)});return}if(typeof T.method!="string")return;let I=!0,R,B;try{switch(T.method){case"getApp":R={id:n};break;case"getState":R=o.current;break;case"setState":{const q=((W=T.params)==null?void 0:W.data)??null,Y=await Zm(n,{data:q},r);o.current=Y,R=Y;break}case"createSession":{const q=T.params??{},Y=await Ku({title:typeof q.title=="string"?q.title:void 0,runtime_type:typeof q.runtime_type=="string"?q.runtime_type:void 0,model:typeof q.model=="string"?q.model:void 0,model_reasoning_effort:typeof q.model_reasoning_effort=="string"?q.model_reasoning_effort:void 0,cwd:typeof q.cwd=="string"?q.cwd:void 0,origin_app_id:n});au(Y.id,n),M.getState().addSession(Y),R=Y;break}case"submitTurn":{const q=String(((Q=T.params)==null?void 0:Q.sessionId)??""),Y=String(((K=T.params)==null?void 0:K.prompt)??""),P=await dT(n,(X=T.params)==null?void 0:X.attachments,V=>C0(n,V)),Z=await Hm(q,Y,P.length?P:void 0,{originAppId:n});au(q,n),R=Z;break}case"resolveToolCall":{const q=String(((ue=T.params)==null?void 0:ue.callId)??""),Y=(me=T.params)==null?void 0:me.result;await S0(q,Y),R={ok:!0};break}case"openSession":{if(M.getState().activeAppTabId!==n)throw new Error("openSession: the app is not on screen — call it from a click in the app");const q=typeof((de=T.params)==null?void 0:de.sessionId)=="string"?T.params.sessionId.trim():"";if(!q)throw new Error("openSession: sessionId is required");try{await M.getState().revealSession(q)}catch(Y){throw new Error(`openSession: ${Y instanceof Error?Y.message:String(Y)}`)}R={ok:!0};break}case"uploadFile":{const q=await uT((De=T.params)==null?void 0:De.file);try{R=Rm(await T0(n,q))}catch(Y){throw new Error(`uploadFile: ${Y instanceof Error?Y.message:String(Y)}`)}break}case"getFile":{const q=lv(n,(je=T.params)==null?void 0:je.ref),Y=q?await N0(n,q):null;R=Y?Rm(Y):null;break}default:throw new Error(`Unknown bridge method: ${T.method}`)}}catch(q){I=!1,B=q instanceof Error?q.message:String(q)}(ne=(Le=s.current)==null?void 0:Le.contentWindow)==null||ne.postMessage({source:"agentpane-host",id:T.id,ok:I,result:R,error:B},"*")};return window.addEventListener("message",E),qx(n,()=>{wh(n,r).then(C=>{S&&(o.current=C)}).catch(()=>{})}),Hx(n,()=>{xh(n).then(C=>{S&&(u(C),m([]))}).catch(()=>{})}),(async()=>{try{const[C,T,I]=await Promise.all([xh(n),wh(n,r),v0(n).catch(()=>[])]);if(!S)return;o.current=T,I.forEach(R=>au(R.id,n)),u(C)}catch(C){S&&h(C instanceof Error?C.message:String(C))}})(),()=>{S=!1,Ux(n),Vx(n),Gx(n),window.removeEventListener("message",E)}},[n,r]);const v=w.useMemo(()=>a?mT(a.html,pT({appId:n,apiOrigin:av()}),a.js):"",[a,n]);if(f)return c.jsxs("div",{className:"empty-state",style:{padding:"24px"},children:["Mini app failed to load: ",f]});if(!v)return c.jsx("div",{className:"empty-state",style:{padding:"24px"},children:"Loading mini app…"});const k=(a==null?void 0:a.diagnostics)??[],x=k.some(S=>S.severity==="error");return c.jsxs("div",{className:"miniapp-runtime",children:[k.length>0&&c.jsxs("div",{className:`miniapp-diagnostics${x?"":" miniapp-diagnostics-warn"}`,"data-testid":"miniapp-diagnostics",children:[c.jsx("div",{className:"miniapp-diagnostics-title",children:x?`Compile errors in ${(a==null?void 0:a.sourceFile)??"the app logic"} — the pane serves the last code that parsed:`:"Warnings — the app runs, but fix these:"}),k.map((S,E)=>c.jsxs("div",{className:"miniapp-diag",children:[S.file,":",S.line,":",S.column," — ",S.message]},E))]}),c.jsx("iframe",{ref:s,className:"miniapp-frame",sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",title:`Mini app: ${n}`,srcDoc:v}),g.length>0&&c.jsx("div",{className:"miniapp-rt-errors","data-testid":"miniapp-rt-errors",children:g.map((S,E)=>c.jsxs("div",{className:"miniapp-rt-error",children:[c.jsx("div",{className:"miniapp-rt-error-message",children:S.message}),S.stack&&c.jsx("pre",{className:"miniapp-rt-error-stack",children:S.stack})]},E))})]})}function vT({appId:n,active:r}){const s=M(x=>x.apps),o=M(x=>x.workspaces),a=M(x=>x.appWorkspaces),u=M(x=>x.setAppWorkspace),f=M(x=>x.setActiveAppTab),h=M(x=>x.startAppEdit),g=s.find(x=>x.id===n),m=a[n]??"",v=o.filter(x=>x.deleted!==1),k=m!==""&&!v.some(x=>x.path===m)?m:null;return c.jsxs("div",{className:`miniapp-view ${r?"":"miniapp-view-hidden"}`,children:[c.jsxs("div",{className:"miniapp-header",children:[c.jsx(yi,{iconNode:g==null?void 0:g.iconNode,size:14,className:"miniapp-header-icon"}),c.jsx("span",{className:"miniapp-header-title",children:(g==null?void 0:g.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:x=>u(n,x.target.value),children:[c.jsx("option",{value:"",children:"All workspaces (global)"}),v.map(x=>c.jsx("option",{value:x.path,children:x.label||x.path.split("/").pop()||x.path},x.path)),k&&c.jsx("option",{value:k,children:`${k} (unknown workspace)`})]}),c.jsxs("button",{className:"miniapp-header-btn",title:"Edit this app with the agent (opens an edit session on the app folder)",onClick:()=>void h(n),children:[c.jsx(gw,{size:13}),"Edit"]}),c.jsx("button",{className:"miniapp-header-close",title:"Close app",onClick:()=>f(null),children:c.jsx(Wn,{size:14})})]}),c.jsx("div",{className:"miniapp-body",children:c.jsx(gT,{appId:n,workspace:m},`${n}:${m}`)})]})}function yT({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const[u,f]=w.useState(!1),h=w.useRef(0),g=w.useRef(0),m=w.useCallback(x=>{const S=x.clientX-h.current,E=n==="left"?g.current+S:g.current-S,C=Math.min(s,Math.max(r,E));a(C)},[n,r,s,a]),v=w.useCallback(()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",v),document.body.classList.remove("is-resizing"),f(!1)},[m]);return{onPointerDown:w.useCallback(x=>{var S,E;x.preventDefault(),x.stopPropagation();try{(E=(S=x.currentTarget)==null?void 0:S.setPointerCapture)==null||E.call(S,x.pointerId)}catch{}h.current=x.clientX,g.current=o(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",m),window.addEventListener("pointerup",v)},[o,m,v]),dragging:u}}function Dm({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a}){const{onPointerDown:u,dragging:f}=yT({side:n,minWidth:r,maxWidth:s,getWidth:o,setWidth:a});return c.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:u,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function xT(){Ot.trackRender("IdeWorkspace");const n=M(m=>m.sidebarWidth),r=M(m=>m.rightPanelWidth),s=M(m=>m.setSidebarWidth),o=M(m=>m.setRightPanelWidth),a=M(m=>m.rightPanelCollapsed),u=M(m=>m.vscodeViewOpen),f=M(m=>m.activeAppTabId),h=M(m=>m.openAppTabs);w.useEffect(()=>{const m=()=>{const v=Ga(),{rightPanelWidth:k,setRightPanelWidth:x}=M.getState();k>v&&x(v)};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);const g=a?`${n}px 6px 1fr ${u0}px`:`${n}px 6px 1fr 6px ${r}px`;return c.jsxs("div",{className:"ide-root",children:[c.jsxs("div",{className:`ide-layout ${u?"ide-hidden":""}`,style:{gridTemplateColumns:g},children:[c.jsx(Ek,{}),c.jsx(Dm,{side:"left",minWidth:Eu,maxWidth:_u,getWidth:()=>M.getState().sidebarWidth,setWidth:s}),c.jsxs("div",{className:"ide-center",children:[c.jsx(_k,{}),c.jsxs("div",{className:"ide-render",children:[h.map(m=>c.jsx(vT,{appId:m,active:f===m},m)),f==null&&c.jsx(yb,{})]}),c.jsx(Rb,{})]}),!a&&c.jsx(Dm,{side:"right",minWidth:qa,maxWidth:Ga(),getWidth:()=>M.getState().rightPanelWidth,setWidth:o}),c.jsx(Xb,{})]}),u&&c.jsx(iT,{}),c.jsx(Jb,{})]})}function wT(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:s,lastModelConfig:o}=M(),a=(o==null?void 0:o.provider)??"codex",u=(o==null?void 0:o.model)??"",f=(o==null?void 0:o.reasoning)??"",[h,g]=w.useState(""),[m,v]=w.useState(u),[k,x]=w.useState(f),[S,E]=w.useState("");if(!n)return null;const C=Nd(a),T=m?Hu(a,m):[];function I(){s({title:h.trim()||void 0,model:m||void 0,model_reasoning_effort:k||void 0,cwd:S.trim()||void 0,runtime_type:a}),g(""),E("")}function R($){$.key==="Escape"&&r(!1)}function B($){var K;v($);const W=Hu(a,$);W.some(X=>X.effort===k)||x(Vu(a,$)??((K=W[0])==null?void 0:K.effort)??"")}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:$=>$.stopPropagation(),onKeyDown:R,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"New Session"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Wn,{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:$=>g($.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:m,onChange:$=>B($.target.value),children:[c.jsx("option",{value:"",children:"Default (Codex picks)"}),C.map($=>c.jsxs("option",{value:$.slug,children:[$.displayName," — ",$.description]},$.slug))]})]}),T.length>0&&c.jsxs("label",{className:"dialog-label",children:["Thinking Level",c.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:$=>x($.target.value),children:[c.jsxs("option",{value:"",children:["Default (",Vu(a,m),")"]}),T.map($=>c.jsx("option",{value:$.effort,children:$.label},$.effort))]})]}),c.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",c.jsx("input",{className:"dialog-input",type:"text",value:S,onChange:$=>E($.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),c.jsxs("div",{className:"dialog-footer",children:[c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),c.jsx("button",{className:"dialog-btn-create",onClick:I,children:"Create"})]})]})})}const kT=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,ST=512*1024;function bT(n){const r=n.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"");return/^[a-z0-9]/.test(r)?r:""}function TT(){const{appCatalogOpen:n,closeAppCatalog:r,apps:s,installExampleApp:o,createSkeletonApp:a,importAppFolder:u}=M(),[f,h]=w.useState("examples"),[g,m]=w.useState(null),[v,k]=w.useState(null),[x,S]=w.useState(!1),[E,C]=w.useState(""),[T,I]=w.useState(""),[R,B]=w.useState(""),[$,W]=w.useState(""),[Q,K]=w.useState(null),[X,ue]=w.useState(""),me=w.useRef(null);if(w.useEffect(()=>{n&&(m(null),y0().then(m).catch(()=>m([])))},[n]),w.useEffect(()=>{me.current&&(me.current.webkitdirectory=!0)},[f]),!n)return null;const de=new Set(s.map(P=>P.id));async function De(P){k(P);try{await o(P)&&r()}finally{k(null)}}async function je(){if(x)return;const P=E.trim(),Z=T.trim();if(!(!P||!Z)){S(!0);try{await a({id:P,title:Z,description:R.trim()||void 0,icon:$.trim()||void 0})&&(C(""),I(""),B(""),W(""),r())}finally{S(!1)}}}async function Le(P){const Z=Array.from(P.target.files??[]),V={};let j="";for(const L of Z){const G=(L.webkitRelativePath??"").split("/");!j&&G.length>1&&(j=G[0]);const le=G[G.length-1];if(!(!le||!kT.test(le))&&!(L.size>ST))try{V[le]=await L.text()}catch{}}K(Object.keys(V).length>0?V:null),ue(bT(j))}async function ne(){if(!(x||!Q||!X.trim())){S(!0);try{await u(X.trim(),Q)&&(K(null),ue(""),r())}finally{S(!1)}}}function q(P){P.key==="Escape"&&r()}const Y=[{key:"examples",label:"Examples"},{key:"new",label:"New App"},{key:"upload",label:"Upload"}];return c.jsx("div",{className:"dialog-overlay",onClick:r,children:c.jsxs("div",{className:"dialog app-catalog",onClick:P=>P.stopPropagation(),onKeyDown:q,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Add Mini App"}),c.jsx("button",{className:"dialog-close",onClick:r,children:"✕"})]}),c.jsx("div",{className:"catalog-tabs",children:Y.map(P=>c.jsx("button",{className:`catalog-tab${f===P.key?" active":""}`,onClick:()=>h(P.key),children:P.label},P.key))}),c.jsxs("div",{className:"dialog-body catalog-body",children:[f==="examples"&&c.jsx("div",{className:"catalog-examples",children:g===null?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"Loading examples…"}):g.length===0?c.jsx("div",{className:"empty-state",style:{padding:"12px"},children:"No example apps available."}):g.map(P=>{const Z=de.has(P.id);return c.jsxs("div",{className:"example-row",children:[c.jsx(yi,{iconNode:P.iconNode,size:14,className:"sidebar-app-icon"}),c.jsxs("div",{className:"example-info",children:[c.jsx("span",{className:"example-title",children:P.title}),P.description&&c.jsx("span",{className:"example-desc",children:P.description})]}),c.jsx("button",{className:"example-install",disabled:Z||v===P.id,onClick:()=>De(P.id),title:Z?"Already installed":"Install this example",children:Z?"Installed":v===P.id?"Installing…":"Install"})]},P.id)})}),f==="new"&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id (folder name)",c.jsx("input",{className:"dialog-input",type:"text",value:E,onChange:P=>C(P.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:P=>I(P.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:R,onChange:P=>B(P.target.value),placeholder:"What does this app do?"})]}),c.jsxs("label",{className:"dialog-label",children:[c.jsxs("span",{children:["Icon (optional, a"," ",c.jsx("a",{href:"https://lucide.dev/icons",target:"_blank",rel:"noreferrer",children:"Lucide icon"})," ","name)"]}),c.jsx("input",{className:"dialog-input",type:"text",value:$,onChange:P=>W(P.target.value),placeholder:"e.g. notebook-pen",spellCheck:!1,autoCapitalize:"off"})]}),c.jsxs("button",{className:"dialog-btn-create catalog-action-btn",disabled:x||!E.trim()||!T.trim(),onClick:je,children:[c.jsx(Rs,{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:me,type:"file",multiple:!0,onChange:Le}),Q&&c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["App id",c.jsx("input",{className:"dialog-input",type:"text",value:X,onChange:P=>ue(P.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:x||!Q||!X.trim(),onClick:ne,children:[c.jsx(bw,{size:13})," Import App"]})]})]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:r,children:"Close"})})]})})}function NT(){const n=M(k=>k.showCommandPalette),r=M(k=>k.setShowCommandPalette),s=M(),[o,a]=w.useState(""),[u,f]=w.useState(0),h=w.useRef(null),g=w.useMemo(()=>{const k=s.activeSessionId?s.sessionDetails[s.activeSessionId]:null,x=hl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Rs,action:()=>s.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:dr,action:()=>{s.activeSessionId&&s.deleteSession(s.activeSessionId)},available:!!s.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:So,action:()=>{const S=document.querySelector(".cmd-input");S==null||S.focus()},available:!!s.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:Ds,action:()=>s.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:aw,action:()=>s.switchRightTab("turns"),available:!!s.activeSessionId},{id:"tab-sidecar",label:"Ask Sidecar",hint:"Ask about this session — status, blockers, what is left",icon:ls,action:()=>s.switchRightTab("sidecar"),available:!!s.activeSessionId},{id:"toggle-right-panel",label:"Toggle Right Panel",hint:s.rightPanelCollapsed?"Expand the right panel":"Collapse the right panel to its icon rail",icon:hw,action:()=>s.toggleRightPanel(),available:!0},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:Wn,action:()=>{s.activeSessionId&&s.closeTab(s.activeSessionId)},available:!!s.activeSessionId}]},[s]),m=w.useMemo(()=>{const k=o.toLowerCase().trim(),x=g.filter(S=>S.available);return k?x.filter(S=>S.label.toLowerCase().includes(k)||S.hint.toLowerCase().includes(k)):x},[g,o]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function v(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,m.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=m[u];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?c.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[c.jsxs("div",{className:"palette-search",children:[c.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:o,onChange:k=>{a(k.target.value),f(0)},onKeyDown:v}),c.jsx("span",{className:"palette-esc",children:"ESC"})]}),m.length===0?c.jsx("div",{className:"palette-empty",children:"No matching commands"}):c.jsx("div",{className:"palette-list",children:m.map((k,x)=>{const S=k.icon;return c.jsxs("div",{className:`palette-item ${x===u?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[c.jsx("span",{className:"palette-item-icon",children:c.jsx(S,{size:16})}),c.jsx("span",{className:"palette-item-label",children:k.label}),c.jsx("span",{className:"palette-item-hint",children:k.hint}),x===u&&c.jsx(Q0,{size:12,className:"palette-item-enter"})]},k.id)})}),c.jsxs("div",{className:"palette-footer",children:[c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↑"}),c.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"↵"})," Select"]}),c.jsxs("span",{className:"palette-footer-hint",children:[c.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Mm=/^[a-z][a-z0-9-]{1,30}$/,CT=2e3;function ET(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:s}=M(),[o,a]=w.useState(null),[u,f]=w.useState(null),[h,g]=w.useState(!1),[m,v]=w.useState(!1),[k,x]=w.useState(!1),[S,E]=w.useState(!1),[C,T]=w.useState("main"),[I,R]=w.useState(""),[B,$]=w.useState(!1),[W,Q]=w.useState(null),K=w.useRef(null);gl(K,()=>E(!1),S);const X=m||k,ue=w.useCallback(async()=>{g(!0),f(null);try{const P=await fetch(`${dn()}/remote/status`,{headers:{Accept:"application/json"}});if(!P.ok)throw new Error(`status ${P.status}`);a(await P.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{g(!1)}},[]);w.useEffect(()=>{n&&(T("main"),Q(null),ue())},[n,ue]);const me=W!==null&&W.state==="running";if(w.useEffect(()=>{if(!me)return;const P=setInterval(async()=>{try{const Z=await fetch(`${dn()}/remote/enable`,{headers:{Accept:"application/json"}});Z.ok&&Q(await Z.json())}catch{}},CT);return()=>clearInterval(P)},[me]),!n)return null;const de=!!(o!=null&&o.tunnel.provisioned)&&!!(o!=null&&o.service.running)&&!!(o!=null&&o.connection.ok);function De(P){P.key==="Escape"&&r(!1)}async function je(P){if(Mm.test(P)){$(!0);try{const Z=await fetch(`${dn()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:P})});if(!Z.ok)throw new Error(`enable ${Z.status}`);Q(await Z.json()),T("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{$(!1)}}}function Le(){W!=null&&W.troubleshootingSessionId&&(s(W.troubleshootingSessionId),r(!1))}async function ne(){v(!0);try{await fetch(`${dn()}/remote/disable`,{method:"POST"}),await ue()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{v(!1)}}async function q(){if(E(!1),!!window.confirm(`Remove the tunnel completely?
|
|
602
|
+
|
|
603
|
+
This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
|
|
604
|
+
|
|
605
|
+
This cannot be undone.`)){x(!0);try{const Z=await fetch(`${dn()}/remote/uninstall`,{method:"DELETE"});if(!Z.ok)throw new Error(`uninstall ${Z.status}`);await ue()}catch{f("Could not remove the tunnel — check the daemon logs.")}finally{x(!1)}}}function Y(){if(!W)return c.jsxs(c.Fragment,{children:[c.jsxs("label",{className:"dialog-label",children:["Machine name (mahlas)",c.jsx("input",{className:"dialog-input",value:I,onChange:j=>R(j.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:!Mm.test(I)||B,onClick:()=>void je(I),children:[B?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Start setup"]})]})]});const P=["detect","provision","install","verify","ready"],Z=P.indexOf(W.step),V=W.state==="ready";return c.jsxs(c.Fragment,{children:[W.state==="running"&&c.jsxs("div",{className:"dialog-label",style:{display:"flex",alignItems:"center",gap:6},children:[c.jsx(Jn,{size:14,className:"spin"})," Setting up the remote tunnel…"]}),W.state==="ready"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--green)",display:"flex",alignItems:"center",gap:6},children:[c.jsx(os,{size:14})," Setup complete — you can close this window."]}),W.state==="ready"&&W.hostname&&c.jsxs("div",{className:"dialog-label",children:["This machine is accessible at"," ",c.jsx("a",{href:`https://${W.hostname}`,target:"_blank",rel:"noreferrer",children:W.hostname})]}),c.jsx("ol",{className:"dialog-label",style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:P.map((j,L)=>{const ce=V||Z>-1&&L<Z,G=!V&&L===Z&&W.state==="running";return c.jsxs("li",{style:{display:"flex",alignItems:"center",gap:6,opacity:ce||G?1:.4,color:ce?"var(--green)":void 0},children:[ce?c.jsx(os,{size:13}):G?c.jsx(Jn,{size:13,className:"spin"}):c.jsx(Y0,{size:9,style:{marginLeft:2,marginRight:2}}),j]},j)})}),W.logs.length>0&&c.jsx("div",{className:"dialog-label",style:{opacity:.7,fontSize:12,whiteSpace:"pre-wrap"},children:W.logs.slice(-3).map(j=>j.message).join(`
|
|
606
|
+
`)}),W.state==="troubleshooting"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:"Setup failed — a troubleshooting session is open and the agent is working on the fix in the background."}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-create",onClick:Le,children:"Open troubleshooting session"})})]}),W.state==="failed"&&c.jsxs("div",{className:"dialog-label",style:{color:"var(--red)"},children:["Setup failed: ",W.error]}),c.jsx("div",{className:"dialog-footer",children:c.jsx("button",{className:"dialog-btn-cancel",onClick:()=>void ue(),children:"Refresh status"})})]})}return c.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:c.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:De,children:[c.jsxs("div",{className:"dialog-header",children:[c.jsx("span",{className:"dialog-title",children:"Remote Access"}),c.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:c.jsx(Wn,{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(Jn,{size:14,className:"spin"})," Loading machine status…"]}),u&&c.jsx("div",{className:"dialog-label",style:{color:"var(--red)"},children:u}),C==="setup"?Y():c.jsxs(c.Fragment,{children:[de&&(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 ne(),disabled:X,children:[m?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):null,"Stop tunnel connection"]}),c.jsx("button",{className:"dialog-btn-cancel",style:{width:30,borderLeft:"none",borderTopLeftRadius:0,borderBottomLeftRadius:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},onClick:()=>E(P=>!P),disabled:X,"aria-label":"More tunnel actions","aria-haspopup":"menu","aria-expanded":S,children:k?c.jsx(Jn,{size:14,className:"spin"}):c.jsx(mi,{size:14})}),S&&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 q(),children:[c.jsx(dr,{size:12})," Remove tunnel"]})})]})]}),!de&&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 je(o.tunnel.mahlas),disabled:B,children:[B?c.jsx(Jn,{size:14,className:"spin",style:{verticalAlign:"middle",marginRight:6}}):c.jsx(Nh,{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(Nh,{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 _T={success:G0,error:vl,info:nw,warn:kw},jT=4e3;function RT({toast:n}){const r=M(f=>f.removeToast),s=_T[n.type],o=w.useRef(null);w.useEffect(()=>{function f(){o.current=setTimeout(()=>r(n.id),jT)}return f(),()=>{o.current&&clearTimeout(o.current)}},[n.id,r]);function a(){o.current&&(clearTimeout(o.current),o.current=null)}function u(){o.current=setTimeout(()=>r(n.id),2e3)}return c.jsxs("div",{className:`toast toast-${n.type}`,onMouseEnter:a,onMouseLeave:u,children:[c.jsx(s,{size:16}),c.jsx("span",{className:"toast-message",children:n.message}),n.undoAction&&c.jsxs("button",{className:"toast-undo",onClick:()=>{var f;(f=n.undoAction)==null||f.call(n),r(n.id)},children:[c.jsx(Sw,{size:12})," ",n.undoLabel||"Undo"]}),c.jsx("button",{className:"toast-close",onClick:()=>r(n.id),children:c.jsx(Wn,{size:14})})]})}function AT(){const n=M(r=>r.toasts);return n.length===0?null:c.jsx("div",{className:"toast-container",children:n.map(r=>c.jsx(RT,{toast:r},r.id))})}function IT(){const[n]=w.useState(s0),[r,s]=w.useState(!1);return c.jsxs("main",{className:"daemon-download",children:[c.jsx("h1",{className:"daemon-download-title",children:"Repoburg"}),n&&c.jsx("p",{className:"daemon-download-text",children:"Open the Repoburg Daemon app to continue."}),c.jsxs("a",{className:n?"daemon-download-link":"daemon-download-btn",href:e0,onClick:()=>s(!0),children:[c.jsx(Z0,{size:n?13:16}),"Download for Mac"]}),(n||r)&&c.jsxs("p",{className:"daemon-download-waiting",role:"status",children:[c.jsx(Jn,{size:13,className:"spin"}),"Waiting for Repoburg to start…"]})]})}let Zn=null,vi=null,mo=1e3;const DT=1e4;function MT(){const n=dn();return n?`${n.replace(/^http/,"ws")}/ws`:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function qu(){Zn&&(Zn.readyState===WebSocket.OPEN||Zn.readyState===WebSocket.CONNECTING)||(Zn=new WebSocket(MT()),Zn.onopen=()=>{const n=mo>1e3;if(mo=1e3,M.getState().setWsConnected(!0),M.getState().addLogEntry("INFO","WebSocket connected"),n){const r=M.getState();r.activeSessionId&&(r.refreshActiveSession(),r.addToast("info","WebSocket reconnected — session state reconciled"))}},Zn.onclose=()=>{M.getState().setWsConnected(!1),M.getState().addLogEntry("WARN","WebSocket disconnected"),M.getState().addToast("warn","WebSocket disconnected — reconnecting…"),PT()},Zn.onerror=()=>{},Zn.onmessage=n=>{try{const r=JSON.parse(n.data);Ot.trackWsEvent(typeof r.event=="string"?r.event:"unknown",typeof n.data=="string"?n.data.length:0);const s=OT[r.event];s&&s(r.data)}catch{}})}function LT(){vi&&(clearTimeout(vi),vi=null),Zn&&(Zn.onclose=null,Zn.close(),Zn=null),M.getState().setWsConnected(!1)}function PT(){vi||(vi=window.setTimeout(()=>{vi=null,qu()},mo),mo=Math.min(mo*2,DT))}const OT={"turn:created":n=>{const r=n;M.getState().onTurnCreated(r.sessionId,r.turn)},"turn:started":n=>{const r=n;Ot.note(`turn:started — ${r.turnId.slice(0,8)}`),M.getState().onTurnStarted(r.sessionId,r.turnId)},"item:started":n=>{const r=n;M.getState().onItemStarted(r.sessionId,r.turnId,r.item)},"item:updated":n=>{const r=n;M.getState().onItemUpdated(r.sessionId,r.turnId,r.item)},"item:completed":n=>{const r=n;M.getState().onItemCompleted(r.sessionId,r.turnId,r.item)},"item:delta":n=>{const r=n;M.getState().onItemDelta(r.sessionId,r.turnId,r.itemId,r.delta)},"turn:completed":n=>{const r=n;Ot.note(`turn:completed — ${r.turnId.slice(0,8)}`),M.getState().onTurnCompleted(r.sessionId,r.turnId,r.usage,r.hasUnreviewed,r.response??void 0)},"turn:tokenUsage":n=>{const r=n;M.getState().onTokenUsageUpdated(r.sessionId,r.turnId,r.usage)},"turn:contextUsage":n=>{const r=n,s={totalTokens:r.totalTokens,contextWindow:r.contextWindow,percentage:r.percentage,...r.autoCompactThreshold?{autoCompactThreshold:r.autoCompactThreshold}:{}};M.getState().onContextUsageUpdated(r.sessionId,s)},"turn:failed":n=>{const r=n;M.getState().onTurnFailed(r.sessionId,r.turnId,r.error,r.resumeState)},"turn:interrupted":n=>{const r=n;Ot.note(`turn:interrupted — ${r.turnId.slice(0,8)} (${r.reason})`),M.getState().onTurnInterrupted(r.sessionId,r.turnId,{reason:r.reason,interruptedAt:r.interruptedAt,attempts:r.attempts,detail:r.detail??null})},"turn:resuming":n=>{const r=n;M.getState().onTurnResuming(r.sessionId,r.turnId,r.attempt)},"turn:resumed":n=>{const r=n;M.getState().onTurnResumed(r.sessionId,r.turnId)},"turn:retrying":n=>{const r=n;M.getState().onTurnRetrying(r.sessionId,r.turnId,{attempt:r.attempt,maxRetries:r.maxRetries,retryDelayMs:r.retryDelayMs,errorStatus:r.errorStatus??null,error:r.error??null})},"turn:cancelled":n=>{const r=n;M.getState().onTurnCancelled(r.sessionId,r.turnId)},"session:title":n=>{const r=n;M.getState().onSessionTitle(r.sessionId,r.title)},"session:touched":n=>{const r=n;M.getState().onSessionTouched(r.sessionId)},background_tasks:n=>{const r=n;Ot.note(`background_tasks — ${r.tasks.length} live (${r.tasks.map(s=>s.task_type).join(", ")||"none"})`),M.getState().onBackgroundTasksChanged(r.sessionId,r.tasks)},"background_tasks:snapshot":n=>{const r=n;M.getState().onBackgroundTasksSnapshot(r.sessions??{})},"thread:created":n=>{const r=n;M.getState().onThreadCreated(r.sessionId,r.thread,r.turn)},"thread:followup":n=>{const r=n;M.getState().onThreadFollowup(r.sessionId,r.threadId,r.turn)},"thread:resolved":n=>{const r=n;M.getState().onThreadResolved(r.sessionId,r.threadId,r.status)},"thread:deleted":n=>{const r=n;M.getState().onThreadDeleted(r.sessionId,r.threadId)},"app:tool_call":n=>{const r=n;Bx(r.appId,r.callId,r.tool,r.args??{})},"app:source:updated":n=>{Yx(n.appId)},"app:state_changed":n=>{Kx(n.appId)}};function zT(){const n=M(r=>r.init);return w.useEffect(()=>{cx();function r(){n(),qu()}const{daemonStatus:s,setDaemonStatus:o}=M.getState();let a=null;s==="ready"?r():a=o0({onMissing:()=>o("missing"),onReady:()=>{o("ready"),r()}});function u(){if(document.visibilityState!=="visible")return;const f=M.getState(),h=f.activeSessionId;if(!h)return;const g=f.sessionDetails[h];f.wsConnected||qu(),g&&g.is_running===1&&(f.refreshActiveSession(),f.addLogEntry("INFO","Tab returned — reconciling session state"))}return document.addEventListener("visibilitychange",u),()=>{a==null||a(),LT(),document.removeEventListener("visibilitychange",u)}},[n]),null}function $T(){const n=M(u=>u.loading),r=M(u=>u.error),s=M(u=>u.sessions),o=M(u=>u.daemonStatus),a=M(u=>u.setShowCommandPalette);return w.useEffect(()=>Ot.start(),[]),w.useEffect(()=>{function u(f){(f.metaKey||f.ctrlKey)&&f.key==="k"&&(f.preventDefault(),a(!0))}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[a]),c.jsxs(c.Fragment,{children:[c.jsx(zT,{}),o==="missing"?c.jsx(IT,{}):o==="checking"||n&&s.length===0?c.jsx("div",{className:"empty-state",children:"Loading sessions…"}):r&&s.length===0?c.jsxs("div",{className:"empty-state",children:["Error: ",r]}):c.jsxs(c.Fragment,{children:[c.jsx(xT,{}),c.jsx(wT,{}),c.jsx(TT,{}),c.jsx(ET,{}),c.jsx(NT,{}),c.jsx(AT,{})]})]})}Jy.createRoot(document.getElementById("root")).render(c.jsx(st.StrictMode,{children:c.jsx($T,{})}));
|