@i14ks/ccv 0.43.0 → 0.43.1
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/bundle/ccv.mjs +21 -3
- package/package.json +1 -1
- package/web/assets/{codemirror-DjTNnRJo.js → codemirror-DsTONvL-.js} +1 -1
- package/web/assets/{index-lVfOWzf7.js → index-1f2CtYmb.js} +1 -1
- package/web/assets/{index-CKeUUzZ4.js → index-B5PgjCy2.js} +1 -1
- package/web/assets/index-B5TsjSo7.js +135 -0
- package/web/assets/{index-C8_WYb85.js → index-BEknqxbE.js} +1 -1
- package/web/assets/{index-nscEh6Ei.js → index-BMdxgpgr.js} +1 -1
- package/web/assets/{index-mAK-pdLV.js → index-BieVw7oe.js} +1 -1
- package/web/assets/{index-D22elh7w.js → index-CKm4LyXr.js} +1 -1
- package/web/assets/{index-DtNN1POB.js → index-CTOsqnj0.js} +1 -1
- package/web/assets/{index-C8RjbD6D.js → index-CdCc_AYg.js} +1 -1
- package/web/assets/{index-CkcKnaq6.js → index-Cs3FSccd.js} +1 -1
- package/web/assets/{index-DigjctZP.js → index-DFrY42c9.js} +1 -1
- package/web/assets/{index-aCEL14r8.js → index-DIp8Svzr.js} +1 -1
- package/web/assets/{index-Cshdudzx.js → index-DSH6K6tq.js} +1 -1
- package/web/assets/{index-C48_SNrc.js → index-D_IqGnua.js} +1 -1
- package/web/assets/{index-rE3yJvdu.js → index-Duur5KBZ.js} +1 -1
- package/web/assets/{index-CHlsny3O.js → index-DvbV5juq.js} +1 -1
- package/web/assets/{index-Dq-kUCoX.js → index-M02GPU4M.js} +1 -1
- package/web/assets/{index-SCOptWM3.js → index-eBfccJOZ.js} +1 -1
- package/web/assets/{index-D7wUDiSO.js → index-qP25soUp.js} +1 -1
- package/web/assets/{index-uOoe6_p5.js → index-uknuSOmh.js} +1 -1
- package/web/index.html +1 -1
- package/web/assets/index-CfLA21Ka.js +0 -135
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Duur5KBZ.js","./index-qP25soUp.js","./index-DSH6K6tq.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-eBfccJOZ.js","./index-M02GPU4M.js","./index-1f2CtYmb.js","./index-B5PgjCy2.js","./index-Cs3FSccd.js","./index-BMdxgpgr.js","./index-DIp8Svzr.js","./index-BieVw7oe.js","./index-CdCc_AYg.js","./index-DFrY42c9.js","./index-D_IqGnua.js","./index-BEknqxbE.js","./index-uknuSOmh.js","./index-CKm4LyXr.js","./index-DvbV5juq.js","./index-CTOsqnj0.js","./codemirror-DsTONvL-.js","./xterm-D6Mng-DB.js","./_commonjsHelpers-CqkleIqs.js","./addon-fit-CevVMrUA.js","./addon-web-links-CnB65OV_.js","./xterm-DYP7pi_n.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var tv=Object.defineProperty;var $x=n=>{throw TypeError(n)};var nv=(n,l,r)=>l in n?tv(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var Ft=(n,l,r)=>nv(n,typeof l!="symbol"?l+"":l,r),Zh=(n,l,r)=>l.has(n)||$x("Cannot "+r);var Fe=(n,l,r)=>(Zh(n,l,"read from private field"),r?r.call(n):l.get(n)),kn=(n,l,r)=>l.has(n)?$x("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,r),Lt=(n,l,r,c)=>(Zh(n,l,"write to private field"),c?c.call(n,r):l.set(n,r),r),Qn=(n,l,r)=>(Zh(n,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Jh={exports:{}},fu={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var qx;function sv(){if(qx)return fu;qx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:d}}return fu.Fragment=l,fu.jsx=r,fu.jsxs=r,fu}var Gx;function lv(){return Gx||(Gx=1,Jh.exports=sv()),Jh.exports}var a=lv(),Wh={exports:{}},tt={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Yx;function av(){if(Yx)return tt;Yx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function Q(E,P,me){this.props=E,this.context=P,this.refs=A,this.updater=me||k}Q.prototype.isReactComponent={},Q.prototype.setState=function(E,P){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,P,"setState")},Q.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function V(){}V.prototype=Q.prototype;function $(E,P,me){this.props=E,this.context=P,this.refs=A,this.updater=me||k}var B=$.prototype=new V;B.constructor=$,C(B,Q.prototype),B.isPureReactComponent=!0;var Y=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function K(E,P,me){var ke=me.ref;return{$$typeof:n,type:E,key:P,ref:ke!==void 0?ke:null,props:me}}function ie(E,P){return K(E.type,P,E.props)}function q(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function H(E){var P={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(me){return P[me]})}var fe=/\/+/g;function je(E,P){return typeof E=="object"&&E!==null&&E.key!=null?H(""+E.key):P.toString(36)}function Z(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(M,M):(E.status="pending",E.then(function(P){E.status==="pending"&&(E.status="fulfilled",E.value=P)},function(P){E.status==="pending"&&(E.status="rejected",E.reason=P)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function L(E,P,me,ke,G){var Se=typeof E;(Se==="undefined"||Se==="boolean")&&(E=null);var le=!1;if(E===null)le=!0;else switch(Se){case"bigint":case"string":case"number":le=!0;break;case"object":switch(E.$$typeof){case n:case l:le=!0;break;case y:return le=E._init,L(le(E._payload),P,me,ke,G)}}if(le)return G=G(E),le=ke===""?"."+je(E,0):ke,Y(G)?(me="",le!=null&&(me=le.replace(fe,"$&/")+"/"),L(G,P,me,"",function(qt){return qt})):G!=null&&(q(G)&&(G=ie(G,me+(G.key==null||E&&E.key===G.key?"":(""+G.key).replace(fe,"$&/")+"/")+le)),P.push(G)),1;le=0;var Ge=ke===""?".":ke+":";if(Y(E))for(var Re=0;Re<E.length;Re++)ke=E[Re],Se=Ge+je(ke,Re),le+=L(ke,P,me,Se,G);else if(Re=S(E),typeof Re=="function")for(E=Re.call(E),Re=0;!(ke=E.next()).done;)ke=ke.value,Se=Ge+je(ke,Re++),le+=L(ke,P,me,Se,G);else if(Se==="object"){if(typeof E.then=="function")return L(Z(E),P,me,ke,G);throw P=String(E),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return le}function U(E,P,me){if(E==null)return E;var ke=[],G=0;return L(E,ke,"","",function(Se){return P.call(me,Se,G++)}),ke}function oe(E){if(E._status===-1){var P=E._result;P=P(),P.then(function(me){(E._status===0||E._status===-1)&&(E._status=1,E._result=me)},function(me){(E._status===0||E._status===-1)&&(E._status=2,E._result=me)}),E._status===-1&&(E._status=0,E._result=P)}if(E._status===1)return E._result.default;throw E._result}var pe=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},we={map:U,forEach:function(E,P,me){U(E,function(){P.apply(this,arguments)},me)},count:function(E){var P=0;return U(E,function(){P++}),P},toArray:function(E){return U(E,function(P){return P})||[]},only:function(E){if(!q(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return tt.Activity=j,tt.Children=we,tt.Component=Q,tt.Fragment=r,tt.Profiler=o,tt.PureComponent=$,tt.StrictMode=c,tt.Suspense=g,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,tt.__COMPILER_RUNTIME={__proto__:null,c:function(E){return z.H.useMemoCache(E)}},tt.cache=function(E){return function(){return E.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(E,P,me){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var ke=C({},E.props),G=E.key;if(P!=null)for(Se in P.key!==void 0&&(G=""+P.key),P)!R.call(P,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&P.ref===void 0||(ke[Se]=P[Se]);var Se=arguments.length-2;if(Se===1)ke.children=me;else if(1<Se){for(var le=Array(Se),Ge=0;Ge<Se;Ge++)le[Ge]=arguments[Ge+2];ke.children=le}return K(E.type,G,ke)},tt.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},tt.createElement=function(E,P,me){var ke,G={},Se=null;if(P!=null)for(ke in P.key!==void 0&&(Se=""+P.key),P)R.call(P,ke)&&ke!=="key"&&ke!=="__self"&&ke!=="__source"&&(G[ke]=P[ke]);var le=arguments.length-2;if(le===1)G.children=me;else if(1<le){for(var Ge=Array(le),Re=0;Re<le;Re++)Ge[Re]=arguments[Re+2];G.children=Ge}if(E&&E.defaultProps)for(ke in le=E.defaultProps,le)G[ke]===void 0&&(G[ke]=le[ke]);return K(E,Se,G)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(E){return{$$typeof:m,render:E}},tt.isValidElement=q,tt.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:oe}},tt.memo=function(E,P){return{$$typeof:b,type:E,compare:P===void 0?null:P}},tt.startTransition=function(E){var P=z.T,me={};z.T=me;try{var ke=E(),G=z.S;G!==null&&G(me,ke),typeof ke=="object"&&ke!==null&&typeof ke.then=="function"&&ke.then(M,pe)}catch(Se){pe(Se)}finally{P!==null&&me.types!==null&&(P.types=me.types),z.T=P}},tt.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},tt.use=function(E){return z.H.use(E)},tt.useActionState=function(E,P,me){return z.H.useActionState(E,P,me)},tt.useCallback=function(E,P){return z.H.useCallback(E,P)},tt.useContext=function(E){return z.H.useContext(E)},tt.useDebugValue=function(){},tt.useDeferredValue=function(E,P){return z.H.useDeferredValue(E,P)},tt.useEffect=function(E,P){return z.H.useEffect(E,P)},tt.useEffectEvent=function(E){return z.H.useEffectEvent(E)},tt.useId=function(){return z.H.useId()},tt.useImperativeHandle=function(E,P,me){return z.H.useImperativeHandle(E,P,me)},tt.useInsertionEffect=function(E,P){return z.H.useInsertionEffect(E,P)},tt.useLayoutEffect=function(E,P){return z.H.useLayoutEffect(E,P)},tt.useMemo=function(E,P){return z.H.useMemo(E,P)},tt.useOptimistic=function(E,P){return z.H.useOptimistic(E,P)},tt.useReducer=function(E,P,me){return z.H.useReducer(E,P,me)},tt.useRef=function(E){return z.H.useRef(E)},tt.useState=function(E){return z.H.useState(E)},tt.useSyncExternalStore=function(E,P,me){return z.H.useSyncExternalStore(E,P,me)},tt.useTransition=function(){return z.H.useTransition()},tt.version="19.2.8",tt}var Xx;function Bp(){return Xx||(Xx=1,Wh.exports=av()),Wh.exports}var x=Bp(),Ph={exports:{}},hu={},ep={exports:{}},tp={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Vx;function iv(){return Vx||(Vx=1,(function(n){function l(L,U){var oe=L.length;L.push(U);e:for(;0<oe;){var pe=oe-1>>>1,we=L[pe];if(0<o(we,U))L[pe]=U,L[oe]=we,oe=pe;else break e}}function r(L){return L.length===0?null:L[0]}function c(L){if(L.length===0)return null;var U=L[0],oe=L.pop();if(oe!==U){L[0]=oe;e:for(var pe=0,we=L.length,E=we>>>1;pe<E;){var P=2*(pe+1)-1,me=L[P],ke=P+1,G=L[ke];if(0>o(me,oe))ke<we&&0>o(G,me)?(L[pe]=G,L[ke]=oe,pe=ke):(L[pe]=me,L[P]=oe,pe=P);else if(ke<we&&0>o(G,oe))L[pe]=G,L[ke]=oe,pe=ke;else break e}}return U}function o(L,U){var oe=L.sortIndex-U.sortIndex;return oe!==0?oe:L.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var g=[],b=[],y=1,j=null,v=3,S=!1,k=!1,C=!1,A=!1,Q=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function B(L){for(var U=r(b);U!==null;){if(U.callback===null)c(b);else if(U.startTime<=L)c(b),U.sortIndex=U.expirationTime,l(g,U);else break;U=r(b)}}function Y(L){if(C=!1,B(L),!k)if(r(g)!==null)k=!0,M||(M=!0,H());else{var U=r(b);U!==null&&Z(Y,U.startTime-L)}}var M=!1,z=-1,R=5,K=-1;function ie(){return A?!0:!(n.unstable_now()-K<R)}function q(){if(A=!1,M){var L=n.unstable_now();K=L;var U=!0;try{e:{k=!1,C&&(C=!1,V(z),z=-1),S=!0;var oe=v;try{t:{for(B(L),j=r(g);j!==null&&!(j.expirationTime>L&&ie());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var we=pe(j.expirationTime<=L);if(L=n.unstable_now(),typeof we=="function"){j.callback=we,B(L),U=!0;break t}j===r(g)&&c(g),B(L)}else c(g);j=r(g)}if(j!==null)U=!0;else{var E=r(b);E!==null&&Z(Y,E.startTime-L),U=!1}}break e}finally{j=null,v=oe,S=!1}U=void 0}}finally{U?H():M=!1}}}var H;if(typeof $=="function")H=function(){$(q)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,je=fe.port2;fe.port1.onmessage=q,H=function(){je.postMessage(null)}}else H=function(){Q(q,0)};function Z(L,U){z=Q(function(){L(n.unstable_now())},U)}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(L){L.callback=null},n.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<L?Math.floor(1e3/L):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(L){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var oe=v;v=U;try{return L()}finally{v=oe}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(L,U){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var oe=v;v=L;try{return U()}finally{v=oe}},n.unstable_scheduleCallback=function(L,U,oe){var pe=n.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?pe+oe:pe):oe=pe,L){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=oe+we,L={id:y++,callback:U,priorityLevel:L,startTime:oe,expirationTime:we,sortIndex:-1},oe>pe?(L.sortIndex=oe,l(b,L),r(g)===null&&L===r(b)&&(C?(V(z),z=-1):C=!0,Z(Y,oe-pe))):(L.sortIndex=we,l(g,L),k||S||(k=!0,M||(M=!0,H()))),L},n.unstable_shouldYield=ie,n.unstable_wrapCallback=function(L){var U=v;return function(){var oe=v;v=U;try{return L.apply(this,arguments)}finally{v=oe}}}})(tp)),tp}var Qx;function rv(){return Qx||(Qx=1,ep.exports=iv()),ep.exports}var np={exports:{}},js={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var Kx;function cv(){if(Kx)return js;Kx=1;var n=Bp();function l(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)b+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:y}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return js.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,js.createPortal=function(g,b){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(l(299));return d(g,b,null,y)},js.flushSync=function(g){var b=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=y,c.d.f()}},js.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},js.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},js.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,S=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;y==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:S}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:S,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},js.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var y=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},js.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin);c.d.L(g,y,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},js.preloadModule=function(g,b){if(typeof g=="string")if(b){var y=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},js.requestFormReset=function(g){c.d.r(g)},js.unstable_batchedUpdates=function(g,b){return g(b)},js.useFormState=function(g,b,y){return h.H.useFormState(g,b,y)},js.useFormStatus=function(){return h.H.useHostTransitionStatus()},js.version="19.2.8",js}var Fx;function ov(){if(Fx)return np.exports;Fx=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(l){console.error(l)}}return n(),np.exports=cv(),np.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var Zx;function uv(){if(Zx)return hu;Zx=1;var n=rv(),l=Bp(),r=ov();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function h(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 m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,i=t;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(s.return!==i.return)s=u,i=f;else{for(var _=!1,N=u.child;N;){if(N===s){_=!0,s=u,i=f;break}if(N===i){_=!0,i=u,s=f;break}N=N.sibling}if(!_){for(N=f.child;N;){if(N===s){_=!0,s=f,i=u;break}if(N===i){_=!0,i=f,s=u;break}N=N.sibling}if(!_)throw Error(c(189))}}if(s.alternate!==i)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),Q=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),$=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case Q:return"Profiler";case A:return"StrictMode";case Y:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case $:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var Z=Array.isArray,L=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},pe=[],we=-1;function E(e){return{current:e}}function P(e){0>we||(e.current=pe[we],pe[we]=null,we--)}function me(e,t){we++,pe[we]=e.current,e.current=t}var ke=E(null),G=E(null),Se=E(null),le=E(null);function Ge(e,t){switch(me(Se,t),me(G,e),me(ke,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ux(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ux(t),e=dx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(ke),me(ke,e)}function Re(){P(ke),P(G),P(Se)}function qt(e){e.memoizedState!==null&&me(le,e);var t=ke.current,s=dx(t,e.type);t!==s&&(me(G,e),me(ke,s))}function Xe(e){G.current===e&&(P(ke),P(G)),le.current===e&&(P(le),cu._currentValue=oe)}var nn,Pe;function dt(e){if(nn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);nn=t&&t[1]||"",Pe=-1<s.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+nn+e+Pe}var st=!1;function vt(e,t){if(!e||st)return"";st=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(ce){var ae=ce}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(ce){ae=ce}e.call(xe.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),_=f[0],N=f[1];if(_&&N){var D=_.split(`
|
|
45
|
+
`),ne=N.split(`
|
|
46
|
+
`);for(u=i=0;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;for(;u<ne.length&&!ne[u].includes("DetermineComponentFrameRoot");)u++;if(i===D.length||u===ne.length)for(i=D.length-1,u=ne.length-1;1<=i&&0<=u&&D[i]!==ne[u];)u--;for(;1<=i&&0<=u;i--,u--)if(D[i]!==ne[u]){if(i!==1||u!==1)do if(i--,u--,0>u||D[i]!==ne[u]){var de=`
|
|
47
|
+
`+D[i].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=i&&0<=u);break}}}finally{st=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?dt(s):""}function gs(e,t){switch(e.tag){case 26:case 27:case 5:return dt(e.type);case 16:return dt("Lazy");case 13:return e.child!==t&&t!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return vt(e.type,!1);case 11:return vt(e.type.render,!1);case 1:return vt(e.type,!0);case 31:return dt("Activity");default:return""}}function gt(e){try{var t="",s=null;do t+=gs(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
|
|
48
|
+
Error generating stack: `+i.message+`
|
|
49
|
+
`+i.stack}}var lt=Object.prototype.hasOwnProperty,Te=n.unstable_scheduleCallback,et=n.unstable_cancelCallback,jt=n.unstable_shouldYield,ot=n.unstable_requestPaint,Ze=n.unstable_now,zt=n.unstable_getCurrentPriorityLevel,rs=n.unstable_ImmediatePriority,Tt=n.unstable_UserBlockingPriority,sn=n.unstable_NormalPriority,Fn=n.unstable_LowPriority,_n=n.unstable_IdlePriority,An=n.log,xs=n.unstable_setDisableYieldValue,ln=null,St=null;function Zn(e){if(typeof An=="function"&&xs(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(ln,e)}catch{}}var Gt=Math.clz32?Math.clz32:Ne,Jn=Math.log,ue=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(Jn(e)/ue|0)|0}var Ve=256,at=262144,We=4194304;function ft(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function X(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~f,i!==0?u=ft(i):(_&=N,_!==0?u=ft(_):s||(s=N&~e,s!==0&&(u=ft(s))))):(N=i&~f,N!==0?u=ft(N):_!==0?u=ft(_):s||(s=i&~e,s!==0&&(u=ft(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function De(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function He(){var e=We;return We<<=1,(We&62914560)===0&&(We=4194304),e}function Yt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ts(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ls(e,t,s,i,u,f){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,ne=e.hiddenUpdates;for(s=_&~s;0<s;){var de=31-Gt(s),xe=1<<de;N[de]=0,D[de]=-1;var ae=ne[de];if(ae!==null)for(ne[de]=null,de=0;de<ae.length;de++){var ce=ae[de];ce!==null&&(ce.lane&=-536870913)}s&=~xe}i!==0&&el(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(_&~t))}function el(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Gt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function xl(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-Gt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function Ol(e,t){var s=t&-t;return s=(s&42)!==0?1:zs(s),(s&(e.suspendedLanes|t))!==0?0:s}function zs(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ns(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Ox(e.type))}function zn(e,t){var s=U.p;try{return U.p=e,t()}finally{U.p=s}}var yn=Math.random().toString(36).slice(2),rn="__reactFiber$"+yn,Je="__reactProps$"+yn,Mn="__reactContainer$"+yn,tl="__reactEvents$"+yn,bl="__reactListeners$"+yn,sa="__reactHandles$"+yn,Ll="__reactResources$"+yn,Us="__reactMarker$"+yn;function cs(e){delete e[rn],delete e[Je],delete e[tl],delete e[bl],delete e[sa]}function Ss(e){var t=e[rn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Mn]||s[rn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bx(e);e!==null;){if(s=e[rn])return s;e=bx(e)}return t}e=s,s=e.parentNode}return null}function nl(e){if(e=e[rn]||e[Mn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Un(e){var t=e[Ll];return t||(t=e[Ll]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Xt(e){e[Us]=!0}var Rn=new Set,Dn={};function Es(e,t){os(e,t),os(e+"Capture",t)}function os(e,t){for(Dn[e]=t,e=0;e<t.length;e++)Rn.add(t[e])}var La=RegExp("^[: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]*$"),Ts={},In={};function _l(e){return lt.call(In,e)?!0:lt.call(Ts,e)?!1:La.test(e)?In[e]=!0:(Ts[e]=!0,!1)}function ss(e,t,s){if(_l(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Bn(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function it(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function Ut(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sn(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,f.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yl(e){if(!e._valueTracker){var t=vn(e)?"checked":"value";e._valueTracker=Sn(e,t,""+e[t])}}function sl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=vn(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Wn(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}}var ll=/[\n"\\]/g;function Vt(e){return e.replace(ll,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ul(e,t,s,i,u,f,_,N){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ut(t)):e.value!==""+Ut(t)&&(e.value=""+Ut(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?_s(e,_,Ut(t)):s!=null?_s(e,_,Ut(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Ut(N):e.removeAttribute("name")}function pn(e,t,s,i,u,f,_,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){yl(e);return}s=s!=null?""+Ut(s):"",t=t!=null?""+Ut(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),yl(e)}function _s(e,t,s){t==="number"&&Wn(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ct(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Ut(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function ve(e,t,s){if(t!=null&&(t=""+Ut(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Ut(s):""}function T(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(c(92));if(Z(i)){if(1<i.length)throw Error(c(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=Ut(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),yl(e)}function W(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var _e=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Le(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||_e.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function $e(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&Le(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Le(e,f,t[f])}function Ie(e){if(e.indexOf("-")===-1)return!1;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 At=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function On(e){return xt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dt(){}var mn=null;function jn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var al=null,Is=null;function us(e){var t=nl(e);if(t&&(e=t.stateNode)){var s=e[Je]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ul(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Vt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[Je]||null;if(!u)throw Error(c(90));Ul(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&sl(i)}break e;case"textarea":ve(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ct(e,!!s.multiple,t,!1)}}}var la=!1;function Zt(e,t,s){if(la)return e(t,s);la=!0;try{var i=e(t);return i}finally{if(la=!1,(al!==null||Is!==null)&&(bd(),al&&(t=al,e=Is,Is=al=null,us(t),e)))for(t=0;t<e.length;t++)us(e[t])}}function Il(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Je]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xr=!1;if(Jt)try{var za={};Object.defineProperty(za,"passive",{get:function(){xr=!0}}),window.addEventListener("test",za,za),window.removeEventListener("test",za,za)}catch{xr=!1}var il=null,vi=null,ji=null;function aa(){if(ji)return ji;var e,t=vi,s=t.length,i,u="value"in il?il.value:il.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(i=1;i<=_&&t[s-i]===u[f-i];i++);return ji=u.slice(e,1<i?1-i:void 0)}function Ua(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 ia(){return!0}function Ia(){return!1}function En(e){function t(s,i,u,f,_){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=_,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ia:Ia,this.isPropagationStopped=Ia,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ia)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ia)},persist:function(){},isPersistent:ia}),t}var w={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},se=En(w),ye=j({},w,{view:0,detail:0}),ze=En(ye),bt,Hn,It,gn=j({},ye,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qa,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!==It&&(It&&e.type==="mousemove"?(bt=e.screenX-It.screenX,Hn=e.screenY-It.screenY):Hn=bt=0,It=e),bt)},movementY:function(e){return"movementY"in e?e.movementY:Hn}}),br=En(gn),Ba=j({},gn,{dataTransfer:0}),Mf=En(Ba),ra=j({},ye,{relatedTarget:0}),Ha=En(ra),sc=j({},w,{animationName:0,elapsedTime:0,pseudoElement:0}),_r=En(sc),lc=j({},w,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Rf=En(lc),yo=j({},w,{data:0}),yr=En(yo),Ru={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ac={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"},Du={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $a(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Du[e])?!!t[e]:!1}function qa(){return $a}var Df=j({},ye,{key:function(e){if(e.key){var t=Ru[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ua(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ac[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qa,charCode:function(e){return e.type==="keypress"?Ua(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ua(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vo=En(Df),ic=j({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rc=En(ic),Ou=j({},ye,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qa}),cc=En(Ou),Ni=j({},w,{propertyName:0,elapsedTime:0,pseudoElement:0}),jo=En(Ni),oc=j({},gn,{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}),vr=En(oc),Of=j({},w,{newState:0,oldState:0}),uc=En(Of),Lf=[9,13,27,32],wi=Jt&&"CompositionEvent"in window,ca=null;Jt&&"documentMode"in document&&(ca=document.documentMode);var No=Jt&&"TextEvent"in window&&!ca,ki=Jt&&(!wi||ca&&8<ca&&11>=ca),oa=" ",jr=!1;function dc(e,t){switch(e){case"keyup":return Lf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function fc(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(jr=!0,oa);case"textInput":return e=t.data,e===oa&&jr?null:e;default:return null}}function zu(e,t){if(Bs)return e==="compositionend"||!wi&&dc(e,t)?(e=aa(),ji=vi=il=null,Bs=!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 ki&&t.locale!=="ko"?null:t.data;default:return null}}var hc={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 wo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!hc[e.type]:t==="textarea"}function Nr(e,t,s,i){al?Is?Is.push(i):Is=[i]:al=i,t=kd(t,"onChange"),0<t.length&&(s=new se("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Cs=null,ua=null;function wr(e){lx(e,0)}function vl(e){var t=zl(e);if(sl(t))return e}function Si(e,t){if(e==="change")return t}var cn=!1;if(Jt){var kr;if(Jt){var ko="oninput"in document;if(!ko){var Uu=document.createElement("div");Uu.setAttribute("oninput","return;"),ko=typeof Uu.oninput=="function"}kr=ko}else kr=!1;cn=kr&&(!document.documentMode||9<document.documentMode)}function pc(){Cs&&(Cs.detachEvent("onpropertychange",Sr),ua=Cs=null)}function Sr(e){if(e.propertyName==="value"&&vl(ua)){var t=[];Nr(t,ua,e,jn(e)),Zt(wr,t)}}function $n(e,t,s){e==="focusin"?(pc(),Cs=t,ua=s,Cs.attachEvent("onpropertychange",Sr)):e==="focusout"&&pc()}function Er(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vl(ua)}function Tr(e,t){if(e==="click")return vl(t)}function da(e,t){if(e==="input"||e==="change")return vl(t)}function Iu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Iu;function Ei(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!lt.call(t,u)||!Nt(e[u],t[u]))return!1}return!0}function So(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jl(e,t){var s=So(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=So(s)}}function Eo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Eo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wn(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Wn(e.document)}return t}function Ti(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")}var Ar=Jt&&"documentMode"in document&&11>=document.documentMode,Hs=null,mc=null,Bl=null,Ci=!1;function Ai(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ci||Hs==null||Hs!==Wn(i)||(i=Hs,"selectionStart"in i&&Ti(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bl&&Ei(Bl,i)||(Bl=i,i=kd(mc,"onSelect"),0<i.length&&(t=new se("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Hs)))}function rl(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ga={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionrun:rl("Transition","TransitionRun"),transitionstart:rl("Transition","TransitionStart"),transitioncancel:rl("Transition","TransitionCancel"),transitionend:rl("Transition","TransitionEnd")},Ya={},Bu={};Jt&&(Bu=document.createElement("div").style,"AnimationEvent"in window||(delete Ga.animationend.animation,delete Ga.animationiteration.animation,delete Ga.animationstart.animation),"TransitionEvent"in window||delete Ga.transitionend.transition);function te(e){if(Ya[e])return Ya[e];if(!Ga[e])return e;var t=Ga[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Bu)return Ya[e]=t[s];return e}var Xa=te("animationend"),gc=te("animationiteration"),Hu=te("animationstart"),zf=te("transitionrun"),J=te("transitionstart"),Hl=te("transitioncancel"),$s=te("transitionend"),To=new Map,Mi="abort auxClick beforeToggle 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(" ");Mi.push("scrollEnd");function qs(e,t){To.set(e,t),Es(t,[e])}var xc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},xn=[],Ri=0,bc=0;function _c(){for(var e=Ri,t=bc=Ri=0;t<e;){var s=xn[t];xn[t++]=null;var i=xn[t];xn[t++]=null;var u=xn[t];xn[t++]=null;var f=xn[t];if(xn[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}f!==0&&$u(s,u,f)}}function $l(e,t,s,i){xn[Ri++]=e,xn[Ri++]=t,xn[Ri++]=s,xn[Ri++]=i,bc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function yc(e,t,s,i){return $l(e,t,s,i),vc(e)}function Va(e,t){return $l(e,null,null,t),vc(e)}function $u(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Gt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function vc(e){if(50<tu)throw tu=0,yh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Di={};function Oi(e,t,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function As(e,t,s,i){return new Oi(e,t,s,i)}function Co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nl(e,t){var s=e.alternate;return s===null?(s=As(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function qu(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function jc(e,t,s,i,u,f){var _=0;if(i=e,typeof e=="function")Co(e)&&(_=1);else if(typeof e=="string")_=G0(e,s,ke.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=As(31,s,t,u),e.elementType=K,e.lanes=f,e;case C:return Qa(s.children,u,f,t);case A:_=8,u|=24;break;case Q:return e=As(12,s,t,u|2),e.elementType=Q,e.lanes=f,e;case Y:return e=As(13,s,t,u),e.elementType=Y,e.lanes=f,e;case M:return e=As(19,s,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:_=10;break e;case V:_=9;break e;case B:_=11;break e;case z:_=14;break e;case R:_=16,i=null;break e}_=29,s=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=As(_,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Qa(e,t,s,i){return e=As(7,e,i,t),e.lanes=s,e}function Ao(e,t,s){return e=As(6,e,null,t),e.lanes=s,e}function Gu(e){var t=As(18,null,null,0);return t.stateNode=e,t}function Mo(e,t,s){return t=As(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yu=new WeakMap;function Gs(e,t){if(typeof e=="object"&&e!==null){var s=Yu.get(e);return s!==void 0?s:(t={value:e,source:t,stack:gt(t)},Yu.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var fa=[],Li=0,Nc=null,Ka=0,Ys=[],Xs=0,wl=null,kl=1,cl="";function ol(e,t){fa[Li++]=Ka,fa[Li++]=Nc,Nc=e,Ka=t}function Ro(e,t,s){Ys[Xs++]=kl,Ys[Xs++]=cl,Ys[Xs++]=wl,wl=e;var i=kl;e=cl;var u=32-Gt(i)-1;i&=~(1<<u),s+=1;var f=32-Gt(t)+u;if(30<f){var _=u-u%5;f=(i&(1<<_)-1).toString(32),i>>=_,u-=_,kl=1<<32-Gt(t)+u|s<<u|i,cl=f+e}else kl=1<<f|s<<u|i,cl=e}function Mr(e){e.return!==null&&(ol(e,1),Ro(e,1,0))}function wc(e){for(;e===Nc;)Nc=fa[--Li],fa[Li]=null,Ka=fa[--Li],fa[Li]=null;for(;e===wl;)wl=Ys[--Xs],Ys[Xs]=null,cl=Ys[--Xs],Ys[Xs]=null,kl=Ys[--Xs],Ys[Xs]=null}function Do(e,t){Ys[Xs++]=kl,Ys[Xs++]=cl,Ys[Xs++]=wl,kl=t.id,cl=t.overflow,wl=e}var qn=null,Wt=null,ht=!1,ql=null,Vs=!1,kc=Error(c(519));function Sl(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rr(Gs(t,e)),kc}function Xu(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[rn]=e,t[Je]=i,s){case"dialog":mt("cancel",t),mt("close",t);break;case"iframe":case"object":case"embed":mt("load",t);break;case"video":case"audio":for(s=0;s<su.length;s++)mt(su[s],t);break;case"source":mt("error",t);break;case"img":case"image":case"link":mt("error",t),mt("load",t);break;case"details":mt("toggle",t);break;case"input":mt("invalid",t),pn(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":mt("invalid",t);break;case"textarea":mt("invalid",t),T(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||cx(t.textContent,s)?(i.popover!=null&&(mt("beforetoggle",t),mt("toggle",t)),i.onScroll!=null&&mt("scroll",t),i.onScrollEnd!=null&&mt("scrollend",t),i.onClick!=null&&(t.onclick=Dt),t=!0):t=!1,t||Sl(e,!0)}function Sc(e){for(qn=e.return;qn;)switch(qn.tag){case 5:case 31:case 13:Vs=!1;return;case 27:case 3:Vs=!0;return;default:qn=qn.return}}function zi(e){if(e!==qn)return!1;if(!ht)return Sc(e),ht=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Lh(e.type,e.memoizedProps)),s=!s),s&&Wt&&Sl(e),Sc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Wt=xx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Wt=xx(e)}else t===27?(t=Wt,Pi(e.type)?(e=Hh,Hh=null,Wt=e):Wt=t):Wt=qn?Tl(e.stateNode.nextSibling):null;return!0}function Fa(){Wt=qn=null,ht=!1}function Oo(){var e=ql;return e!==null&&(Js===null?Js=e:Js.push.apply(Js,e),ql=null),e}function Rr(e){ql===null?ql=[e]:ql.push(e)}var Za=E(null),ha=null,Gl=null;function Yl(e,t,s){me(Za,t._currentValue),t._currentValue=s}function Xl(e){e._currentValue=Za.current,P(Za)}function Lo(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function zo(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var _=u.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=u;for(var D=0;D<t.length;D++)if(N.context===t[D]){f.lanes|=s,N=f.alternate,N!==null&&(N.lanes|=s),Lo(f.return,s,e),i||(_=null);break e}f=N.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=s,f=_.alternate,f!==null&&(f.lanes|=s),Lo(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function Ui(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(c(387));if(_=_.memoizedProps,_!==null){var N=u.type;Nt(u.pendingProps.value,_.value)||(e!==null?e.push(N):e=[N])}}else if(u===le.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(cu):e=[cu])}u=u.return}e!==null&&zo(t,e,s,i),t.flags|=262144}function Ec(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ja(e){ha=e,Gl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pn(e){return Vu(ha,e)}function Tc(e,t){return ha===null&&Ja(e),Vu(e,t)}function Vu(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Gl===null){if(e===null)throw Error(c(308));Gl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gl=Gl.next=t;return s}var Uf=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},If=n.unstable_scheduleCallback,Bf=n.unstable_NormalPriority,Nn={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Uo(){return{controller:new Uf,data:new Map,refCount:0}}function Dr(e){e.refCount--,e.refCount===0&&If(Bf,function(){e.controller.abort()})}var Or=null,Io=0,pa=0,ma=null;function Cc(e,t){if(Or===null){var s=Or=[];Io=0,pa=Sh(),ma={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Io++,t.then(Qu,Qu),t}function Qu(){if(--Io===0&&Or!==null){ma!==null&&(ma.status="fulfilled");var e=Or;Or=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Hf(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Ku=L.S;L.S=function(e,t){Rg=Ze(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Cc(e,t),Ku!==null&&Ku(e,t)};var Wa=E(null);function Bo(){var e=Wa.current;return e!==null?e:tn.pooledCache}function Ac(e,t){t===null?me(Wa,Wa.current):me(Wa,t.pool)}function Fu(){var e=Bo();return e===null?null:{parent:Nn._currentValue,pool:e}}var Ii=Error(c(460)),Ho=Error(c(474)),Mc=Error(c(542)),Rc={then:function(){}};function Zu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ju(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Dt,Dt),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pu(e),e;default:if(typeof t.status=="string")t.then(Dt,Dt);else{if(e=tn,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pu(e),e}throw ei=t,Ii}}function Pa(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ei=s,Ii):s}}var ei=null;function Wu(){if(ei===null)throw Error(c(459));var e=ei;return ei=null,e}function Pu(e){if(e===Ii||e===Mc)throw Error(c(483))}var ti=null,Bi=0;function ni(e){var t=Bi;return Bi+=1,ti===null&&(ti=[]),Ju(ti,e,t)}function ds(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ys(e,t){throw t.$$typeof===v?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Pt(e){function t(F,I){if(e){var ee=F.deletions;ee===null?(F.deletions=[I],F.flags|=16):ee.push(I)}}function s(F,I){if(!e)return null;for(;I!==null;)t(F,I),I=I.sibling;return null}function i(F){for(var I=new Map;F!==null;)F.key!==null?I.set(F.key,F):I.set(F.index,F),F=F.sibling;return I}function u(F,I){return F=Nl(F,I),F.index=0,F.sibling=null,F}function f(F,I,ee){return F.index=ee,e?(ee=F.alternate,ee!==null?(ee=ee.index,ee<I?(F.flags|=67108866,I):ee):(F.flags|=67108866,I)):(F.flags|=1048576,I)}function _(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function N(F,I,ee,he){return I===null||I.tag!==6?(I=Ao(ee,F.mode,he),I.return=F,I):(I=u(I,ee),I.return=F,I)}function D(F,I,ee,he){var qe=ee.type;return qe===C?de(F,I,ee.props.children,he,ee.key):I!==null&&(I.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===R&&Pa(qe)===I.type)?(I=u(I,ee.props),ds(I,ee),I.return=F,I):(I=jc(ee.type,ee.key,ee.props,null,F.mode,he),ds(I,ee),I.return=F,I)}function ne(F,I,ee,he){return I===null||I.tag!==4||I.stateNode.containerInfo!==ee.containerInfo||I.stateNode.implementation!==ee.implementation?(I=Mo(ee,F.mode,he),I.return=F,I):(I=u(I,ee.children||[]),I.return=F,I)}function de(F,I,ee,he,qe){return I===null||I.tag!==7?(I=Qa(ee,F.mode,he,qe),I.return=F,I):(I=u(I,ee),I.return=F,I)}function xe(F,I,ee){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Ao(""+I,F.mode,ee),I.return=F,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case S:return ee=jc(I.type,I.key,I.props,null,F.mode,ee),ds(ee,I),ee.return=F,ee;case k:return I=Mo(I,F.mode,ee),I.return=F,I;case R:return I=Pa(I),xe(F,I,ee)}if(Z(I)||H(I))return I=Qa(I,F.mode,ee,null),I.return=F,I;if(typeof I.then=="function")return xe(F,ni(I),ee);if(I.$$typeof===$)return xe(F,Tc(F,I),ee);ys(F,I)}return null}function ae(F,I,ee,he){var qe=I!==null?I.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return qe!==null?null:N(F,I,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:return ee.key===qe?D(F,I,ee,he):null;case k:return ee.key===qe?ne(F,I,ee,he):null;case R:return ee=Pa(ee),ae(F,I,ee,he)}if(Z(ee)||H(ee))return qe!==null?null:de(F,I,ee,he,null);if(typeof ee.then=="function")return ae(F,I,ni(ee),he);if(ee.$$typeof===$)return ae(F,I,Tc(F,ee),he);ys(F,ee)}return null}function ce(F,I,ee,he,qe){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return F=F.get(ee)||null,N(I,F,""+he,qe);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case S:return F=F.get(he.key===null?ee:he.key)||null,D(I,F,he,qe);case k:return F=F.get(he.key===null?ee:he.key)||null,ne(I,F,he,qe);case R:return he=Pa(he),ce(F,I,ee,he,qe)}if(Z(he)||H(he))return F=F.get(ee)||null,de(I,F,he,qe,null);if(typeof he.then=="function")return ce(F,I,ee,ni(he),qe);if(he.$$typeof===$)return ce(F,I,ee,Tc(I,he),qe);ys(I,he)}return null}function Ue(F,I,ee,he){for(var qe=null,Mt=null,Be=I,ct=I=0,yt=null;Be!==null&&ct<ee.length;ct++){Be.index>ct?(yt=Be,Be=null):yt=Be.sibling;var Rt=ae(F,Be,ee[ct],he);if(Rt===null){Be===null&&(Be=yt);break}e&&Be&&Rt.alternate===null&&t(F,Be),I=f(Rt,I,ct),Mt===null?qe=Rt:Mt.sibling=Rt,Mt=Rt,Be=yt}if(ct===ee.length)return s(F,Be),ht&&ol(F,ct),qe;if(Be===null){for(;ct<ee.length;ct++)Be=xe(F,ee[ct],he),Be!==null&&(I=f(Be,I,ct),Mt===null?qe=Be:Mt.sibling=Be,Mt=Be);return ht&&ol(F,ct),qe}for(Be=i(Be);ct<ee.length;ct++)yt=ce(Be,F,ct,ee[ct],he),yt!==null&&(e&&yt.alternate!==null&&Be.delete(yt.key===null?ct:yt.key),I=f(yt,I,ct),Mt===null?qe=yt:Mt.sibling=yt,Mt=yt);return e&&Be.forEach(function(lr){return t(F,lr)}),ht&&ol(F,ct),qe}function Ke(F,I,ee,he){if(ee==null)throw Error(c(151));for(var qe=null,Mt=null,Be=I,ct=I=0,yt=null,Rt=ee.next();Be!==null&&!Rt.done;ct++,Rt=ee.next()){Be.index>ct?(yt=Be,Be=null):yt=Be.sibling;var lr=ae(F,Be,Rt.value,he);if(lr===null){Be===null&&(Be=yt);break}e&&Be&&lr.alternate===null&&t(F,Be),I=f(lr,I,ct),Mt===null?qe=lr:Mt.sibling=lr,Mt=lr,Be=yt}if(Rt.done)return s(F,Be),ht&&ol(F,ct),qe;if(Be===null){for(;!Rt.done;ct++,Rt=ee.next())Rt=xe(F,Rt.value,he),Rt!==null&&(I=f(Rt,I,ct),Mt===null?qe=Rt:Mt.sibling=Rt,Mt=Rt);return ht&&ol(F,ct),qe}for(Be=i(Be);!Rt.done;ct++,Rt=ee.next())Rt=ce(Be,F,ct,Rt.value,he),Rt!==null&&(e&&Rt.alternate!==null&&Be.delete(Rt.key===null?ct:Rt.key),I=f(Rt,I,ct),Mt===null?qe=Rt:Mt.sibling=Rt,Mt=Rt);return e&&Be.forEach(function(ev){return t(F,ev)}),ht&&ol(F,ct),qe}function Kt(F,I,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===C&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case S:e:{for(var qe=ee.key;I!==null;){if(I.key===qe){if(qe=ee.type,qe===C){if(I.tag===7){s(F,I.sibling),he=u(I,ee.props.children),he.return=F,F=he;break e}}else if(I.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===R&&Pa(qe)===I.type){s(F,I.sibling),he=u(I,ee.props),ds(he,ee),he.return=F,F=he;break e}s(F,I);break}else t(F,I);I=I.sibling}ee.type===C?(he=Qa(ee.props.children,F.mode,he,ee.key),he.return=F,F=he):(he=jc(ee.type,ee.key,ee.props,null,F.mode,he),ds(he,ee),he.return=F,F=he)}return _(F);case k:e:{for(qe=ee.key;I!==null;){if(I.key===qe)if(I.tag===4&&I.stateNode.containerInfo===ee.containerInfo&&I.stateNode.implementation===ee.implementation){s(F,I.sibling),he=u(I,ee.children||[]),he.return=F,F=he;break e}else{s(F,I);break}else t(F,I);I=I.sibling}he=Mo(ee,F.mode,he),he.return=F,F=he}return _(F);case R:return ee=Pa(ee),Kt(F,I,ee,he)}if(Z(ee))return Ue(F,I,ee,he);if(H(ee)){if(qe=H(ee),typeof qe!="function")throw Error(c(150));return ee=qe.call(ee),Ke(F,I,ee,he)}if(typeof ee.then=="function")return Kt(F,I,ni(ee),he);if(ee.$$typeof===$)return Kt(F,I,Tc(F,ee),he);ys(F,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,I!==null&&I.tag===6?(s(F,I.sibling),he=u(I,ee),he.return=F,F=he):(s(F,I),he=Ao(ee,F.mode,he),he.return=F,F=he),_(F)):s(F,I)}return function(F,I,ee,he){try{Bi=0;var qe=Kt(F,I,ee,he);return ti=null,qe}catch(Be){if(Be===Ii||Be===Mc)throw Be;var Mt=As(29,Be,null,F.mode);return Mt.lanes=he,Mt.return=F,Mt}finally{}}}var Vl=Pt(!0),ed=Pt(!1),ga=!1;function Hi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ul(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function El(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ot&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=vc(e),$u(e,null,s),t}return $l(e,i,t,s),vc(e)}function $i(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,xl(e,s)}}function qi(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=_:f=f.next=_,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Oc=!1;function Lr(){if(Oc){var e=ma;if(e!==null)throw e}}function Ql(e,t,s,i){Oc=!1;var u=e.updateQueue;ga=!1;var f=u.firstBaseUpdate,_=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var D=N,ne=D.next;D.next=null,_===null?f=ne:_.next=ne,_=D;var de=e.alternate;de!==null&&(de=de.updateQueue,N=de.lastBaseUpdate,N!==_&&(N===null?de.firstBaseUpdate=ne:N.next=ne,de.lastBaseUpdate=D))}if(f!==null){var xe=u.baseState;_=0,de=ne=D=null,N=f;do{var ae=N.lane&-536870913,ce=ae!==N.lane;if(ce?(_t&ae)===ae:(i&ae)===ae){ae!==0&&ae===pa&&(Oc=!0),de!==null&&(de=de.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ue=e,Ke=N;ae=t;var Kt=s;switch(Ke.tag){case 1:if(Ue=Ke.payload,typeof Ue=="function"){xe=Ue.call(Kt,xe,ae);break e}xe=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Ke.payload,ae=typeof Ue=="function"?Ue.call(Kt,xe,ae):Ue,ae==null)break e;xe=j({},xe,ae);break e;case 2:ga=!0}}ae=N.callback,ae!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=u.callbacks,ce===null?u.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},de===null?(ne=de=ce,D=xe):de=de.next=ce,_|=ae;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,u.lastBaseUpdate=ce,u.shared.pending=null}}while(!0);de===null&&(D=xe),u.baseState=D,u.firstBaseUpdate=ne,u.lastBaseUpdate=de,f===null&&(u.shared.lanes=0),Ki|=_,e.lanes=_,e.memoizedState=xe}}function $o(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function td(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)$o(s[e],t)}var xa=E(null),Lc=E(0);function Gi(e,t){e=hi,me(Lc,e),me(xa,t),hi=e|t.baseLanes}function ba(){me(Lc,hi),me(xa,xa.current)}function qo(){hi=Lc.current,P(xa),P(Lc)}var vs=E(null),Ms=null;function _a(e){var t=e.alternate;me(wn,wn.current&1),me(vs,e),Ms===null&&(t===null||xa.current!==null||t.memoizedState!==null)&&(Ms=e)}function Go(e){me(wn,wn.current),me(vs,e),Ms===null&&(Ms=e)}function Yo(e){e.tag===22?(me(wn,wn.current),me(vs,e),Ms===null&&(Ms=e)):Kl()}function Kl(){me(wn,wn.current),me(vs,vs.current)}function Rs(e){P(vs),Ms===e&&(Ms=null),P(wn)}var wn=E(0);function Qs(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Ih(s)||Bh(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){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 Fl=0,Ye=null,Et=null,Tn=null,Yi=!1,si=!1,li=!1,dl=0,ai=0,Xi=null,nd=0;function on(){throw Error(c(321))}function p(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Nt(e[s],t[s]))return!1;return!0}function O(e,t,s,i,u,f){return Fl=f,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?Gm:Ff,li=!1,f=s(i,u),li=!1,si&&(f=Ce(t,s,i,u)),re(e),f}function re(e){L.H=Vo;var t=Et!==null&&Et.next!==null;if(Fl=0,Tn=Et=Ye=null,Yi=!1,ai=0,Xi=null,t)throw Error(c(300));e===null||Xn||(e=e.dependencies,e!==null&&Ec(e)&&(Xn=!0))}function Ce(e,t,s,i){Ye=e;var u=0;do{if(si&&(Xi=null),ai=0,si=!1,25<=u)throw Error(c(301));if(u+=1,Tn=Et=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}L.H=Ym,f=t(s,i)}while(si);return f}function rt(){var e=L.H,t=e.useState()[0];return t=typeof t.then=="function"?Zl(t):t,e=e.useState()[0],(Et!==null?Et.memoizedState:null)!==e&&(Ye.flags|=1024),t}function en(){var e=dl!==0;return dl=0,e}function Ln(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function fl(e){if(Yi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yi=!1}Fl=0,Tn=Et=Ye=null,si=!1,ai=dl=0,Xi=null}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?Ye.memoizedState=Tn=e:Tn=Tn.next=e,Tn}function an(){if(Et===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=Et.next;var t=Tn===null?Ye.memoizedState:Tn.next;if(t!==null)Tn=t,Et=e;else{if(e===null)throw Ye.alternate===null?Error(c(467)):Error(c(310));Et=e,e={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},Tn===null?Ye.memoizedState=Tn=e:Tn=Tn.next=e}return Tn}function ii(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zl(e){var t=ai;return ai+=1,Xi===null&&(Xi=[]),e=Ju(Xi,e,t),t=Ye,(Tn===null?t.memoizedState:Tn.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?Gm:Ff),e}function be(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zl(e);if(e.$$typeof===$)return Pn(e)}throw Error(c(438,String(e)))}function Ee(e){var t=null,s=Ye.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Ye.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=ii(),Ye.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=ie;return t.index++,s}function Ae(e,t){return typeof t=="function"?t(e):t}function Qe(e){var t=an();return ut(t,Et,e)}function ut(e,t,s){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var _=u.next;u.next=f.next,f.next=_}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var N=_=null,D=null,ne=t,de=!1;do{var xe=ne.lane&-536870913;if(xe!==ne.lane?(_t&xe)===xe:(Fl&xe)===xe){var ae=ne.revertLane;if(ae===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),xe===pa&&(de=!0);else if((Fl&ae)===ae){ne=ne.next,ae===pa&&(de=!0);continue}else xe={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},D===null?(N=D=xe,_=f):D=D.next=xe,Ye.lanes|=ae,Ki|=ae;xe=ne.action,li&&s(f,xe),f=ne.hasEagerState?ne.eagerState:s(f,xe)}else ae={lane:xe,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},D===null?(N=D=ae,_=f):D=D.next=ae,Ye.lanes|=xe,Ki|=xe;ne=ne.next}while(ne!==null&&ne!==t);if(D===null?_=f:D.next=N,!Nt(f,e.memoizedState)&&(Xn=!0,de&&(s=ma,s!==null)))throw s;e.memoizedState=f,e.baseState=_,e.baseQueue=D,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Yn(e){var t=an(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do f=e(f,_.action),_=_.next;while(_!==u);Nt(f,t.memoizedState)||(Xn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function sd(e,t,s){var i=Ye,u=an(),f=ht;if(f){if(s===void 0)throw Error(c(407));s=s()}else s=t();var _=!Nt((Et||u).memoizedState,s);if(_&&(u.memoizedState=s,Xn=!0),u=u.queue,Gf(fm.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||Tn!==null&&Tn.memoizedState.tag&1){if(i.flags|=2048,zc(9,{destroy:void 0},dm.bind(null,i,u,s,t),null),tn===null)throw Error(c(349));f||(Fl&127)!==0||um(i,t,s)}return s}function um(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ye.updateQueue,t===null?(t=ii(),Ye.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function dm(e,t,s,i){t.value=s,t.getSnapshot=i,hm(t)&&pm(e)}function fm(e,t,s){return s(function(){hm(t)&&pm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Nt(e,s)}catch{return!0}}function pm(e){var t=Va(e,2);t!==null&&Ws(t,e,2)}function $f(e){var t=Gn();if(typeof e=="function"){var s=e;if(e=s(),li){Zn(!0);try{s()}finally{Zn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ae,lastRenderedState:e},t}function mm(e,t,s,i){return e.baseState=s,ut(e,Et,typeof i=="function"?i:Ae)}function Vy(e,t,s,i,u){if(id(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){f.listeners.push(_)}};L.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,gm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function gm(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=L.T,_={};L.T=_;try{var N=s(u,i),D=L.S;D!==null&&D(_,N),xm(e,t,N)}catch(ne){qf(e,t,ne)}finally{f!==null&&_.types!==null&&(f.types=_.types),L.T=f}}else try{f=s(u,i),xm(e,t,f)}catch(ne){qf(e,t,ne)}}function xm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){bm(e,t,i)},function(i){return qf(e,t,i)}):bm(e,t,s)}function bm(e,t,s){t.status="fulfilled",t.value=s,_m(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,gm(e,s)))}function qf(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,_m(t),t=t.next;while(t!==i)}e.action=null}function _m(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function vm(e,t){if(ht){var s=tn.formState;if(s!==null){e:{var i=Ye;if(ht){if(Wt){t:{for(var u=Wt,f=Vs;u.nodeType!==8;){if(!f){u=null;break t}if(u=Tl(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Wt=Tl(u.nextSibling),i=u.data==="F!";break e}}Sl(i)}i=!1}i&&(t=s[0])}}return s=Gn(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},s.queue=i,s=Hm.bind(null,Ye,i),i.dispatch=s,i=$f(!1),f=Kf.bind(null,Ye,!1,i.queue),i=Gn(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Vy.bind(null,Ye,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function jm(e){var t=an();return Nm(t,Et,e)}function Nm(e,t,s){if(t=ut(e,t,ym)[0],e=Qe(Ae)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Zl(t)}catch(_){throw _===Ii?Mc:_}else i=t;t=an();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(Ye.flags|=2048,zc(9,{destroy:void 0},Qy.bind(null,u,s),null)),[i,f,e]}function Qy(e,t){e.action=t}function wm(e){var t=an(),s=Et;if(s!==null)return Nm(t,s,e);an(),t=t.memoizedState,s=an();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function zc(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Ye.updateQueue,t===null&&(t=ii(),Ye.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function km(){return an().memoizedState}function ld(e,t,s,i){var u=Gn();Ye.flags|=e,u.memoizedState=zc(1|t,{destroy:void 0},s,i===void 0?null:i)}function ad(e,t,s,i){var u=an();i=i===void 0?null:i;var f=u.memoizedState.inst;Et!==null&&i!==null&&p(i,Et.memoizedState.deps)?u.memoizedState=zc(t,f,s,i):(Ye.flags|=e,u.memoizedState=zc(1|t,f,s,i))}function Sm(e,t){ld(8390656,8,e,t)}function Gf(e,t){ad(2048,8,e,t)}function Ky(e){Ye.flags|=4;var t=Ye.updateQueue;if(t===null)t=ii(),Ye.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Em(e){var t=an().memoizedState;return Ky({ref:t,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return ad(4,2,e,t)}function Cm(e,t){return ad(4,4,e,t)}function Am(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mm(e,t,s){s=s!=null?s.concat([e]):null,ad(4,4,Am.bind(null,t,e),s)}function Yf(){}function Rm(e,t){var s=an();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&p(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function Dm(e,t){var s=an();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&p(t,i[1]))return i[0];if(i=e(),li){Zn(!0);try{e()}finally{Zn(!1)}}return s.memoizedState=[i,t],i}function Xf(e,t,s){return s===void 0||(Fl&1073741824)!==0&&(_t&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Og(),Ye.lanes|=e,Ki|=e,s)}function Om(e,t,s,i){return Nt(s,t)?s:xa.current!==null?(e=Xf(e,s,i),Nt(e,t)||(Xn=!0),e):(Fl&42)===0||(Fl&1073741824)!==0&&(_t&261930)===0?(Xn=!0,e.memoizedState=s):(e=Og(),Ye.lanes|=e,Ki|=e,t)}function Lm(e,t,s,i,u){var f=U.p;U.p=f!==0&&8>f?f:8;var _=L.T,N={};L.T=N,Kf(e,!1,t,s);try{var D=u(),ne=L.S;if(ne!==null&&ne(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var de=Hf(D,i);Xo(e,t,de,ml(e))}else Xo(e,t,i,ml(e))}catch(xe){Xo(e,t,{then:function(){},status:"rejected",reason:xe},ml())}finally{U.p=f,_!==null&&N.types!==null&&(_.types=N.types),L.T=_}}function Fy(){}function Vf(e,t,s,i){if(e.tag!==5)throw Error(c(476));var u=zm(e).queue;Lm(e,u,t,oe,s===null?Fy:function(){return Um(e),s(i)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ae,lastRenderedState:oe},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ae,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),Xo(e,t.next.queue,{},ml())}function Qf(){return Pn(cu)}function Im(){return an().memoizedState}function Bm(){return an().memoizedState}function Zy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=ml();e=ul(s);var i=El(t,e,s);i!==null&&(Ws(i,t,s),$i(i,t,s)),t={cache:Uo()},e.payload=t;return}t=t.return}}function Jy(e,t,s){var i=ml();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},id(e)?$m(t,s):(s=yc(e,t,s,i),s!==null&&(Ws(s,e,i),qm(s,t,i)))}function Hm(e,t,s){var i=ml();Xo(e,t,s,i)}function Xo(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(id(e))$m(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var _=t.lastRenderedState,N=f(_,s);if(u.hasEagerState=!0,u.eagerState=N,Nt(N,_))return $l(e,t,u,0),tn===null&&_c(),!1}catch{}finally{}if(s=yc(e,t,u,i),s!==null)return Ws(s,e,i),qm(s,t,i),!0}return!1}function Kf(e,t,s,i){if(i={lane:2,revertLane:Sh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},id(e)){if(t)throw Error(c(479))}else t=yc(e,s,i,2),t!==null&&Ws(t,e,2)}function id(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function $m(e,t){si=Yi=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function qm(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,xl(e,s)}}var Vo={readContext:Pn,use:be,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useLayoutEffect:on,useInsertionEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useSyncExternalStore:on,useId:on,useHostTransitionStatus:on,useFormState:on,useActionState:on,useOptimistic:on,useMemoCache:on,useCacheRefresh:on};Vo.useEffectEvent=on;var Gm={readContext:Pn,use:be,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:Sm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ld(4194308,4,Am.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ld(4194308,4,e,t)},useInsertionEffect:function(e,t){ld(4,2,e,t)},useMemo:function(e,t){var s=Gn();t=t===void 0?null:t;var i=e();if(li){Zn(!0);try{e()}finally{Zn(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Gn();if(s!==void 0){var u=s(t);if(li){Zn(!0);try{s(t)}finally{Zn(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=Jy.bind(null,Ye,e),[i.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:function(e){e=$f(e);var t=e.queue,s=Hm.bind(null,Ye,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Yf,useDeferredValue:function(e,t){var s=Gn();return Xf(s,e,t)},useTransition:function(){var e=$f(!1);return e=Lm.bind(null,Ye,e.queue,!0,!1),Gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Ye,u=Gn();if(ht){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),tn===null)throw Error(c(349));(_t&127)!==0||um(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,Sm(fm.bind(null,i,f,e),[e]),i.flags|=2048,zc(9,{destroy:void 0},dm.bind(null,i,f,s,t),null),s},useId:function(){var e=Gn(),t=tn.identifierPrefix;if(ht){var s=cl,i=kl;s=(i&~(1<<32-Gt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=dl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=nd++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Qf,useFormState:vm,useActionState:vm,useOptimistic:function(e){var t=Gn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Kf.bind(null,Ye,!0,s),s.dispatch=t,[e,t]},useMemoCache:Ee,useCacheRefresh:function(){return Gn().memoizedState=Zy.bind(null,Ye)},useEffectEvent:function(e){var t=Gn(),s={impl:e};return t.memoizedState=s,function(){if((Ot&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},Ff={readContext:Pn,use:be,useCallback:Rm,useContext:Pn,useEffect:Gf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Qe,useRef:km,useState:function(){return Qe(Ae)},useDebugValue:Yf,useDeferredValue:function(e,t){var s=an();return Om(s,Et.memoizedState,e,t)},useTransition:function(){var e=Qe(Ae)[0],t=an().memoizedState;return[typeof e=="boolean"?e:Zl(e),t]},useSyncExternalStore:sd,useId:Im,useHostTransitionStatus:Qf,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var s=an();return mm(s,Et,e,t)},useMemoCache:Ee,useCacheRefresh:Bm};Ff.useEffectEvent=Em;var Ym={readContext:Pn,use:be,useCallback:Rm,useContext:Pn,useEffect:Gf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Yn,useRef:km,useState:function(){return Yn(Ae)},useDebugValue:Yf,useDeferredValue:function(e,t){var s=an();return Et===null?Xf(s,e,t):Om(s,Et.memoizedState,e,t)},useTransition:function(){var e=Yn(Ae)[0],t=an().memoizedState;return[typeof e=="boolean"?e:Zl(e),t]},useSyncExternalStore:sd,useId:Im,useHostTransitionStatus:Qf,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var s=an();return Et!==null?mm(s,Et,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Ee,useCacheRefresh:Bm};Ym.useEffectEvent=Em;function Zf(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:j({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Jf={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=ml(),u=ul(i);u.payload=t,s!=null&&(u.callback=s),t=El(e,u,i),t!==null&&(Ws(t,e,i),$i(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=ml(),u=ul(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=El(e,u,i),t!==null&&(Ws(t,e,i),$i(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ml(),i=ul(s);i.tag=2,t!=null&&(i.callback=t),t=El(e,i,s),t!==null&&(Ws(t,e,s),$i(t,e,s))}};function Xm(e,t,s,i,u,f,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,_):t.prototype&&t.prototype.isPureReactComponent?!Ei(s,i)||!Ei(u,f):!0}function Vm(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Jf.enqueueReplaceState(t,t.state,null)}function zr(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=j({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Qm(e){xc(e)}function Km(e){console.error(e)}function Fm(e){xc(e)}function rd(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Zm(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Wf(e,t,s){return s=ul(s),s.tag=3,s.payload={element:null},s.callback=function(){rd(e,t)},s}function Jm(e){return e=ul(e),e.tag=3,e}function Wm(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Zm(t,s,i)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Zm(t,s,i),typeof u!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Wy(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&Ui(t,s,u,!0),s=vs.current,s!==null){switch(s.tag){case 31:case 13:return Ms===null?_d():s.alternate===null&&Cn===0&&(Cn=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===Rc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),Nh(e,i,u)),!1;case 22:return s.flags|=65536,i===Rc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),Nh(e,i,u)),!1}throw Error(c(435,s.tag))}return Nh(e,i,u),_d(),!1}if(ht)return t=vs.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==kc&&(e=Error(c(422),{cause:i}),Rr(Gs(e,s)))):(i!==kc&&(t=Error(c(423),{cause:i}),Rr(Gs(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Gs(i,s),u=Wf(e.stateNode,i,u),qi(e,u),Cn!==4&&(Cn=2)),!1;var f=Error(c(520),{cause:i});if(f=Gs(f,s),eu===null?eu=[f]:eu.push(f),Cn!==4&&(Cn=2),t===null)return!0;i=Gs(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Wf(s.stateNode,i,e),qi(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Fi===null||!Fi.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Jm(u),Wm(u,e,s,i),qi(s,u),!1}s=s.return}while(s!==null);return!1}var Pf=Error(c(461)),Xn=!1;function fs(e,t,s,i){t.child=e===null?ed(t,null,s,i):Vl(t,e.child,s,i)}function Pm(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var _={};for(var N in i)N!=="ref"&&(_[N]=i[N])}else _=i;return Ja(t),i=O(e,t,s,_,f,u),N=en(),e!==null&&!Xn?(Ln(e,t,u),ri(e,t,u)):(ht&&N&&Mr(t),t.flags|=1,fs(e,t,i,u),t.child)}function eg(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!Co(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,tg(e,t,f,i,u)):(e=jc(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!rh(e,u)){var _=f.memoizedProps;if(s=s.compare,s=s!==null?s:Ei,s(_,i)&&e.ref===t.ref)return ri(e,t,u)}return t.flags|=1,e=Nl(f,i),e.ref=t.ref,e.return=t,t.child=e}function tg(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Ei(f,i)&&e.ref===t.ref)if(Xn=!1,t.pendingProps=i=f,rh(e,u))(e.flags&131072)!==0&&(Xn=!0);else return t.lanes=e.lanes,ri(e,t,u)}return eh(e,t,s,i,u)}function ng(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return sg(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ac(t,f!==null?f.cachePool:null),f!==null?Gi(t,f):ba(),Yo(t);else return i=t.lanes=536870912,sg(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Ac(t,f.cachePool),Gi(t,f),Kl(),t.memoizedState=null):(e!==null&&Ac(t,null),ba(),Kl());return fs(e,t,u,s),t.child}function Qo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sg(e,t,s,i,u){var f=Bo();return f=f===null?null:{parent:Nn._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Ac(t,null),ba(),Yo(t),e!==null&&Ui(e,t,i,!0),t.childLanes=u,null}function cd(e,t){return t=ud({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lg(e,t,s){return Vl(t,e.child,null,s),e=cd(t,t.pendingProps),e.flags|=2,Rs(t),t.memoizedState=null,e}function Py(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ht){if(i.mode==="hidden")return e=cd(t,i),t.lanes=536870912,Qo(null,e);if(Go(t),(e=Wt)?(e=gx(e,Vs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wl!==null?{id:kl,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,qn=t,Wt=null)):e=null,e===null)throw Sl(t);return t.lanes=536870912,null}return cd(t,i)}var f=e.memoizedState;if(f!==null){var _=f.dehydrated;if(Go(t),u)if(t.flags&256)t.flags&=-257,t=lg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Xn||Ui(e,t,s,!1),u=(s&e.childLanes)!==0,Xn||u){if(i=tn,i!==null&&(_=Ol(i,s),_!==0&&_!==f.retryLane))throw f.retryLane=_,Va(e,_),Ws(i,e,_),Pf;_d(),t=lg(e,t,s)}else e=f.treeContext,Wt=Tl(_.nextSibling),qn=t,ht=!0,ql=null,Vs=!1,e!==null&&Do(t,e),t=cd(t,i),t.flags|=4096;return t}return e=Nl(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function od(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function eh(e,t,s,i,u){return Ja(t),s=O(e,t,s,i,void 0,u),i=en(),e!==null&&!Xn?(Ln(e,t,u),ri(e,t,u)):(ht&&i&&Mr(t),t.flags|=1,fs(e,t,s,u),t.child)}function ag(e,t,s,i,u,f){return Ja(t),t.updateQueue=null,s=Ce(t,i,s,u),re(e),i=en(),e!==null&&!Xn?(Ln(e,t,f),ri(e,t,f)):(ht&&i&&Mr(t),t.flags|=1,fs(e,t,s,f),t.child)}function ig(e,t,s,i,u){if(Ja(t),t.stateNode===null){var f=Di,_=s.contextType;typeof _=="object"&&_!==null&&(f=Pn(_)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Jf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Hi(t),_=s.contextType,f.context=typeof _=="object"&&_!==null?Pn(_):Di,f.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Zf(t,s,_,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(_=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),_!==f.state&&Jf.enqueueReplaceState(f,f.state,null),Ql(t,i,f,u),Lr(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var N=t.memoizedProps,D=zr(s,N);f.props=D;var ne=f.context,de=s.contextType;_=Di,typeof de=="object"&&de!==null&&(_=Pn(de));var xe=s.getDerivedStateFromProps;de=typeof xe=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,de||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||ne!==_)&&Vm(t,f,i,_),ga=!1;var ae=t.memoizedState;f.state=ae,Ql(t,i,f,u),Lr(),ne=t.memoizedState,N||ae!==ne||ga?(typeof xe=="function"&&(Zf(t,s,xe,i),ne=t.memoizedState),(D=ga||Xm(t,s,D,i,ae,ne,_))?(de||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=ne),f.props=i,f.state=ne,f.context=_,i=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Dc(e,t),_=t.memoizedProps,de=zr(s,_),f.props=de,xe=t.pendingProps,ae=f.context,ne=s.contextType,D=Di,typeof ne=="object"&&ne!==null&&(D=Pn(ne)),N=s.getDerivedStateFromProps,(ne=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_!==xe||ae!==D)&&Vm(t,f,i,D),ga=!1,ae=t.memoizedState,f.state=ae,Ql(t,i,f,u),Lr();var ce=t.memoizedState;_!==xe||ae!==ce||ga||e!==null&&e.dependencies!==null&&Ec(e.dependencies)?(typeof N=="function"&&(Zf(t,s,N,i),ce=t.memoizedState),(de=ga||Xm(t,s,de,i,ae,ce,D)||e!==null&&e.dependencies!==null&&Ec(e.dependencies))?(ne||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ce,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ce,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ce),f.props=i,f.state=ce,f.context=D,i=de):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,od(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Vl(t,e.child,null,u),t.child=Vl(t,null,s,u)):fs(e,t,s,u),t.memoizedState=f.state,e=t.child):e=ri(e,t,u),e}function rg(e,t,s,i){return Fa(),t.flags|=256,fs(e,t,s,i),t.child}var th={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nh(e){return{baseLanes:e,cachePool:Fu()}}function sh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=pl),e}function cg(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,_;if((_=f)||(_=e!==null&&e.memoizedState===null?!1:(wn.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(ht){if(u?_a(t):Kl(),(e=Wt)?(e=gx(e,Vs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wl!==null?{id:kl,overflow:cl}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,qn=t,Wt=null)):e=null,e===null)throw Sl(t);return Bh(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,u?(Kl(),u=t.mode,N=ud({mode:"hidden",children:N},u),i=Qa(i,u,s,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=nh(s),i.childLanes=sh(e,_,s),t.memoizedState=th,Qo(null,i)):(_a(t),lh(t,N))}var D=e.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(f)t.flags&256?(_a(t),t.flags&=-257,t=ah(e,t,s)):t.memoizedState!==null?(Kl(),t.child=e.child,t.flags|=128,t=null):(Kl(),N=i.fallback,u=t.mode,i=ud({mode:"visible",children:i.children},u),N=Qa(N,u,s,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Vl(t,e.child,null,s),i=t.child,i.memoizedState=nh(s),i.childLanes=sh(e,_,s),t.memoizedState=th,t=Qo(null,i));else if(_a(t),Bh(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var ne=_.dgst;_=ne,i=Error(c(419)),i.stack="",i.digest=_,Rr({value:i,source:null,stack:null}),t=ah(e,t,s)}else if(Xn||Ui(e,t,s,!1),_=(s&e.childLanes)!==0,Xn||_){if(_=tn,_!==null&&(i=Ol(_,s),i!==0&&i!==D.retryLane))throw D.retryLane=i,Va(e,i),Ws(_,e,i),Pf;Ih(N)||_d(),t=ah(e,t,s)}else Ih(N)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,Wt=Tl(N.nextSibling),qn=t,ht=!0,ql=null,Vs=!1,e!==null&&Do(t,e),t=lh(t,i.children),t.flags|=4096);return t}return u?(Kl(),N=i.fallback,u=t.mode,D=e.child,ne=D.sibling,i=Nl(D,{mode:"hidden",children:i.children}),i.subtreeFlags=D.subtreeFlags&65011712,ne!==null?N=Nl(ne,N):(N=Qa(N,u,s,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Qo(null,i),i=t.child,N=e.child.memoizedState,N===null?N=nh(s):(u=N.cachePool,u!==null?(D=Nn._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=Fu(),N={baseLanes:N.baseLanes|s,cachePool:u}),i.memoizedState=N,i.childLanes=sh(e,_,s),t.memoizedState=th,Qo(e.child,i)):(_a(t),s=e.child,e=s.sibling,s=Nl(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function lh(e,t){return t=ud({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ud(e,t){return e=As(22,e,null,t),e.lanes=0,e}function ah(e,t,s){return Vl(t,e.child,null,s),e=lh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function og(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Lo(e.return,t,s)}function ih(e,t,s,i,u,f){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=s,_.tailMode=u,_.treeForkCount=f)}function ug(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var _=wn.current,N=(_&2)!==0;if(N?(_=_&1|2,t.flags|=128):_&=1,me(wn,_),fs(e,t,i,s),i=ht?Ka:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&og(e,s,t);else if(e.tag===19)og(e,s,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}switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&Qs(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),ih(t,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Qs(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}ih(t,!0,s,null,f,i);break;case"together":ih(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ri(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ki|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Ui(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=Nl(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Nl(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function rh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ec(e)))}function e0(e,t,s){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),Yl(t,Nn,e.memoizedState.cache),Fa();break;case 27:case 5:qt(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:Yl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Go(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(_a(t),t.flags|=128,null):(s&t.child.childLanes)!==0?cg(e,t,s):(_a(t),e=ri(e,t,s),e!==null?e.sibling:null);_a(t);break;case 19:var u=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(Ui(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return ug(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),me(wn,wn.current),i)break;return null;case 22:return t.lanes=0,ng(e,t,s,t.pendingProps);case 24:Yl(t,Nn,e.memoizedState.cache)}return ri(e,t,s)}function dg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xn=!0;else{if(!rh(e,s)&&(t.flags&128)===0)return Xn=!1,e0(e,t,s);Xn=(e.flags&131072)!==0}else Xn=!1,ht&&(t.flags&1048576)!==0&&Ro(t,Ka,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Pa(t.elementType),t.type=e,typeof e=="function")Co(e)?(i=zr(e,i),t.tag=1,t=ig(null,t,e,i,s)):(t.tag=0,t=eh(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===B){t.tag=11,t=Pm(null,t,e,i,s);break e}else if(u===z){t.tag=14,t=eg(null,t,e,i,s);break e}}throw t=je(e)||e,Error(c(306,t,""))}}return t;case 0:return eh(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=zr(i,t.pendingProps),ig(e,t,i,u,s);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Dc(e,t),Ql(t,i,null,s);var _=t.memoizedState;if(i=_.cache,Yl(t,Nn,i),i!==f.cache&&zo(t,[Nn],s,!0),Lr(),i=_.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=rg(e,t,i,s);break e}else if(i!==u){u=Gs(Error(c(424)),t),Rr(u),t=rg(e,t,i,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Wt=Tl(e.firstChild),qn=t,ht=!0,ql=null,Vs=!0,s=ed(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Fa(),i===u){t=ri(e,t,s);break e}fs(e,t,i,s)}t=t.child}return t;case 26:return od(e,t),e===null?(s=jx(t.type,null,t.pendingProps,null))?t.memoizedState=s:ht||(s=t.type,e=t.pendingProps,i=Sd(Se.current).createElement(s),i[rn]=t,i[Je]=e,hs(i,s,e),Xt(i),t.stateNode=i):t.memoizedState=jx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&ht&&(i=t.stateNode=_x(t.type,t.pendingProps,Se.current),qn=t,Vs=!0,u=Wt,Pi(t.type)?(Hh=u,Wt=Tl(i.firstChild)):Wt=u),fs(e,t,t.pendingProps.children,s),od(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ht&&((u=i=Wt)&&(i=A0(i,t.type,t.pendingProps,Vs),i!==null?(t.stateNode=i,qn=t,Wt=Tl(i.firstChild),Vs=!1,u=!0):u=!1),u||Sl(t)),qt(t),u=t.type,f=t.pendingProps,_=e!==null?e.memoizedProps:null,i=f.children,Lh(u,f)?i=null:_!==null&&Lh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=O(e,t,rt,null,null,s),cu._currentValue=u),od(e,t),fs(e,t,i,s),t.child;case 6:return e===null&&ht&&((e=s=Wt)&&(s=M0(s,t.pendingProps,Vs),s!==null?(t.stateNode=s,qn=t,Wt=null,e=!0):e=!1),e||Sl(t)),null;case 13:return cg(e,t,s);case 4:return Ge(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Vl(t,null,i,s):fs(e,t,i,s),t.child;case 11:return Pm(e,t,t.type,t.pendingProps,s);case 7:return fs(e,t,t.pendingProps,s),t.child;case 8:return fs(e,t,t.pendingProps.children,s),t.child;case 12:return fs(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Yl(t,t.type,i.value),fs(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ja(t),u=Pn(u),i=i(u),t.flags|=1,fs(e,t,i,s),t.child;case 14:return eg(e,t,t.type,t.pendingProps,s);case 15:return tg(e,t,t.type,t.pendingProps,s);case 19:return ug(e,t,s);case 31:return Py(e,t,s);case 22:return ng(e,t,s,t.pendingProps);case 24:return Ja(t),i=Pn(Nn),e===null?(u=Bo(),u===null&&(u=tn,f=Uo(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Hi(t),Yl(t,Nn,u)):((e.lanes&s)!==0&&(Dc(e,t),Ql(t,null,null,s),Lr()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Yl(t,Nn,i)):(i=f.cache,Yl(t,Nn,i),i!==u.cache&&zo(t,[Nn],s,!0))),fs(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ci(e){e.flags|=4}function ch(e,t,s,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Ig())e.flags|=8192;else throw ei=Rc,Ho}else e.flags&=-16777217}function fg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ex(t))if(Ig())e.flags|=8192;else throw ei=Rc,Ho}function dd(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?He():536870912,e.lanes|=t,Hc|=t)}function Ko(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function un(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function t0(e,t,s){var i=t.pendingProps;switch(wc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(t),null;case 1:return un(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xl(Nn),Re(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(zi(t)?ci(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Oo())),un(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(ci(t),f!==null?(un(t),fg(t,f)):(un(t),ch(t,u,null,i,s))):f?f!==e.memoizedState?(ci(t),un(t),fg(t,f)):(un(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ci(t),un(t),ch(t,u,e,i,s)),null;case 27:if(Xe(t),s=Se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ci(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return un(t),null}e=ke.current,zi(t)?Xu(t):(e=_x(u,i,s),t.stateNode=e,ci(t))}return un(t),null;case 5:if(Xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ci(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return un(t),null}if(f=ke.current,zi(t))Xu(t);else{var _=Sd(Se.current);switch(f){case 1:f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=_.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?_.createElement("select",{is:i.is}):_.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?_.createElement(u,{is:i.is}):_.createElement(u)}}f[rn]=t,f[Je]=i;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)f.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=f;e:switch(hs(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ci(t)}}return un(t),ch(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ci(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=Se.current,zi(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=qn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[rn]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||cx(e.nodeValue,s)),e||Sl(t,!0)}else e=Sd(e).createTextNode(i),e[rn]=t,t.stateNode=e}return un(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=zi(t),s!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[rn]=t}else Fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;un(t),e=!1}else s=Oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Rs(t),t):(Rs(t),null);if((t.flags&128)!==0)throw Error(c(558))}return un(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=zi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[rn]=t}else Fa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;un(t),u=!1}else u=Oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Rs(t),t):(Rs(t),null)}return Rs(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),dd(t,t.updateQueue),un(t),null);case 4:return Re(),e===null&&Ah(t.stateNode.containerInfo),un(t),null;case 10:return Xl(t.type),un(t),null;case 19:if(P(wn),i=t.memoizedState,i===null)return un(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Ko(i,!1);else{if(Cn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Qs(e),f!==null){for(t.flags|=128,Ko(i,!1),e=f.updateQueue,t.updateQueue=e,dd(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)qu(s,e),s=s.sibling;return me(wn,wn.current&1|2),ht&&ol(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ze()>gd&&(t.flags|=128,u=!0,Ko(i,!1),t.lanes=4194304)}else{if(!u)if(e=Qs(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,dd(t,e),Ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!ht)return un(t),null}else 2*Ze()-i.renderingStartTime>gd&&s!==536870912&&(t.flags|=128,u=!0,Ko(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ze(),e.sibling=null,s=wn.current,me(wn,u?s&1|2:s&1),ht&&ol(t,i.treeForkCount),e):(un(t),null);case 22:case 23:return Rs(t),qo(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),s=t.updateQueue,s!==null&&dd(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&P(Wa),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Xl(Nn),un(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function n0(e,t){switch(wc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xl(Nn),Re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Xe(t),null;case 31:if(t.memoizedState!==null){if(Rs(t),t.alternate===null)throw Error(c(340));Fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Rs(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(wn),null;case 4:return Re(),null;case 10:return Xl(t.type),null;case 22:case 23:return Rs(t),qo(),e!==null&&P(Wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xl(Nn),null;case 25:return null;default:return null}}function hg(e,t){switch(wc(t),t.tag){case 3:Xl(Nn),Re();break;case 26:case 27:case 5:Xe(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Rs(t);break;case 13:Rs(t);break;case 19:P(wn);break;case 10:Xl(t.type);break;case 22:case 23:Rs(t),qo(),e!==null&&P(Wa);break;case 24:Xl(Nn)}}function Fo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,_=s.inst;i=f(),_.destroy=i}s=s.next}while(s!==u)}}catch(N){$t(t,t.return,N)}}function Vi(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var _=i.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,u=t;var D=s,ne=N;try{ne()}catch(de){$t(u,D,de)}}}i=i.next}while(i!==f)}}catch(de){$t(t,t.return,de)}}function pg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{td(t,s)}catch(i){$t(e,e.return,i)}}}function mg(e,t,s){s.props=zr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){$t(e,t,i)}}function Zo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){$t(e,t,u)}}function ya(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){$t(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){$t(e,t,u)}else s.current=null}function gg(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){$t(e,e.return,u)}}function oh(e,t,s){try{var i=e.stateNode;w0(i,e.type,s,t),i[Je]=t}catch(u){$t(e,e.return,u)}}function xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Pi(e.type)||e.tag===4}function uh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xg(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.tag===27&&Pi(e.type)||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 dh(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Dt));else if(i!==4&&(i===27&&Pi(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(dh(e,t,s),e=e.sibling;e!==null;)dh(e,t,s),e=e.sibling}function fd(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Pi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(fd(e,t,s),e=e.sibling;e!==null;)fd(e,t,s),e=e.sibling}function bg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);hs(t,i,s),t[rn]=e,t[Je]=s}catch(f){$t(e,e.return,f)}}var oi=!1,Vn=!1,fh=!1,_g=typeof WeakSet=="function"?WeakSet:Set,ls=null;function s0(e,t){if(e=e.containerInfo,Dh=Dd,e=Cr(e),Ti(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var _=0,N=-1,D=-1,ne=0,de=0,xe=e,ae=null;t:for(;;){for(var ce;xe!==s||u!==0&&xe.nodeType!==3||(N=_+u),xe!==f||i!==0&&xe.nodeType!==3||(D=_+i),xe.nodeType===3&&(_+=xe.nodeValue.length),(ce=xe.firstChild)!==null;)ae=xe,xe=ce;for(;;){if(xe===e)break t;if(ae===s&&++ne===u&&(N=_),ae===f&&++de===i&&(D=_),(ce=xe.nextSibling)!==null)break;xe=ae,ae=xe.parentNode}xe=ce}s=N===-1||D===-1?null:{start:N,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(Oh={focusedElem:e,selectionRange:s},Dd=!1,ls=t;ls!==null;)if(t=ls,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ls=e;else for(;ls!==null;){switch(t=ls,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var Ue=zr(s.type,u);e=i.getSnapshotBeforeUpdate(Ue,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ke){$t(s,s.return,Ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Uh(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Uh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ls=e;break}ls=t.return}}function yg(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:di(e,s),i&4&&Fo(5,s);break;case 1:if(di(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){$t(s,s.return,_)}else{var u=zr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){$t(s,s.return,_)}}i&64&&pg(s),i&512&&Zo(s,s.return);break;case 3:if(di(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{td(e,t)}catch(_){$t(s,s.return,_)}}break;case 27:t===null&&i&4&&bg(s);case 26:case 5:di(e,s),t===null&&i&4&&gg(s),i&512&&Zo(s,s.return);break;case 12:di(e,s);break;case 31:di(e,s),i&4&&Ng(e,s);break;case 13:di(e,s),i&4&&wg(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=f0.bind(null,s),R0(e,s))));break;case 22:if(i=s.memoizedState!==null||oi,!i){t=t!==null&&t.memoizedState!==null||Vn,u=oi;var f=Vn;oi=i,(Vn=t)&&!f?fi(e,s,(s.subtreeFlags&8772)!==0):di(e,s),oi=u,Vn=f}break;case 30:break;default:di(e,s)}}function vg(e){var t=e.alternate;t!==null&&(e.alternate=null,vg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&cs(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bn=null,Ks=!1;function ui(e,t,s){for(s=s.child;s!==null;)jg(e,t,s),s=s.sibling}function jg(e,t,s){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(ln,s)}catch{}switch(s.tag){case 26:Vn||ya(s,t),ui(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Vn||ya(s,t);var i=bn,u=Ks;Pi(s.type)&&(bn=s.stateNode,Ks=!1),ui(e,t,s),au(s.stateNode),bn=i,Ks=u;break;case 5:Vn||ya(s,t);case 6:if(i=bn,u=Ks,bn=null,ui(e,t,s),bn=i,Ks=u,bn!==null)if(Ks)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(s.stateNode)}catch(f){$t(s,t,f)}else try{bn.removeChild(s.stateNode)}catch(f){$t(s,t,f)}break;case 18:bn!==null&&(Ks?(e=bn,px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Kc(e)):px(bn,s.stateNode));break;case 4:i=bn,u=Ks,bn=s.stateNode.containerInfo,Ks=!0,ui(e,t,s),bn=i,Ks=u;break;case 0:case 11:case 14:case 15:Vi(2,s,t),Vn||Vi(4,s,t),ui(e,t,s);break;case 1:Vn||(ya(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&mg(s,t,i)),ui(e,t,s);break;case 21:ui(e,t,s);break;case 22:Vn=(i=Vn)||s.memoizedState!==null,ui(e,t,s),Vn=i;break;default:ui(e,t,s)}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kc(e)}catch(s){$t(t,t.return,s)}}}function wg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kc(e)}catch(s){$t(t,t.return,s)}}function l0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(c(435,e.tag))}}function hd(e,t){var s=l0(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=h0.bind(null,e,i);i.then(u,u)}})}function Fs(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,_=t,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Pi(N.type)){bn=N.stateNode,Ks=!1;break e}break;case 5:bn=N.stateNode,Ks=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Ks=!0;break e}N=N.return}if(bn===null)throw Error(c(160));jg(f,_,u),bn=null,Ks=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kg(t,e),t=t.sibling}var Jl=null;function kg(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Fs(t,e),Zs(e),i&4&&(Vi(3,e,e.return),Fo(3,e),Vi(5,e,e.return));break;case 1:Fs(t,e),Zs(e),i&512&&(Vn||s===null||ya(s,s.return)),i&64&&oi&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=Jl;if(Fs(t,e),Zs(e),i&512&&(Vn||s===null||ya(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Us]||f[rn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),hs(f,i,s),f[rn]=e,Xt(f),i=f;break e;case"link":var _=kx("link","href",u).get(i+(s.href||""));if(_){for(var N=0;N<_.length;N++)if(f=_[N],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(N,1);break t}}f=u.createElement(i),hs(f,i,s),u.head.appendChild(f);break;case"meta":if(_=kx("meta","content",u).get(i+(s.content||""))){for(N=0;N<_.length;N++)if(f=_[N],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(N,1);break t}}f=u.createElement(i),hs(f,i,s),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[rn]=e,Xt(f),i=f}e.stateNode=i}else Sx(u,e.type,e.stateNode);else e.stateNode=wx(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Sx(u,e.type,e.stateNode):wx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&oh(e,e.memoizedProps,s.memoizedProps)}break;case 27:Fs(t,e),Zs(e),i&512&&(Vn||s===null||ya(s,s.return)),s!==null&&i&4&&oh(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Fs(t,e),Zs(e),i&512&&(Vn||s===null||ya(s,s.return)),e.flags&32){u=e.stateNode;try{W(u,"")}catch(Ue){$t(e,e.return,Ue)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,oh(e,u,s!==null?s.memoizedProps:u)),i&1024&&(fh=!0);break;case 6:if(Fs(t,e),Zs(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(Ue){$t(e,e.return,Ue)}}break;case 3:if(Cd=null,u=Jl,Jl=Ed(t.containerInfo),Fs(t,e),Jl=u,Zs(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Kc(t.containerInfo)}catch(Ue){$t(e,e.return,Ue)}fh&&(fh=!1,Sg(e));break;case 4:i=Jl,Jl=Ed(e.stateNode.containerInfo),Fs(t,e),Zs(e),Jl=i;break;case 12:Fs(t,e),Zs(e);break;case 31:Fs(t,e),Zs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,hd(e,i)));break;case 13:Fs(t,e),Zs(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(md=Ze()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,hd(e,i)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,ne=oi,de=Vn;if(oi=ne||u,Vn=de||D,Fs(t,e),Vn=de,oi=ne,Zs(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||oi||Vn||Ur(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(f=D.stateNode,u)_=f.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=D.stateNode;var xe=D.memoizedProps.style,ae=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ue){$t(D,D.return,Ue)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(Ue){$t(D,D.return,Ue)}}}else if(t.tag===18){if(s===null){D=t;try{var ce=D.stateNode;u?mx(ce,!0):mx(D.stateNode,!1)}catch(Ue){$t(D,D.return,Ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,hd(e,s))));break;case 19:Fs(t,e),Zs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,hd(e,i)));break;case 30:break;case 21:break;default:Fs(t,e),Zs(e)}}function Zs(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(xg(i)){s=i;break}i=i.return}if(s==null)throw Error(c(160));switch(s.tag){case 27:var u=s.stateNode,f=uh(e);fd(e,f,u);break;case 5:var _=s.stateNode;s.flags&32&&(W(_,""),s.flags&=-33);var N=uh(e);fd(e,N,_);break;case 3:case 4:var D=s.stateNode.containerInfo,ne=uh(e);dh(e,ne,D);break;default:throw Error(c(161))}}catch(de){$t(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function di(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yg(e,t.alternate,t),t=t.sibling}function Ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vi(4,t,t.return),Ur(t);break;case 1:ya(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&mg(t,t.return,s),Ur(t);break;case 27:au(t.stateNode);case 26:case 5:ya(t,t.return),Ur(t);break;case 22:t.memoizedState===null&&Ur(t);break;case 30:Ur(t);break;default:Ur(t)}e=e.sibling}}function fi(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,_=f.flags;switch(f.tag){case 0:case 11:case 15:fi(u,f,s),Fo(4,f);break;case 1:if(fi(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(ne){$t(i,i.return,ne)}if(i=f,u=i.updateQueue,u!==null){var N=i.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)$o(D[u],N)}catch(ne){$t(i,i.return,ne)}}s&&_&64&&pg(f),Zo(f,f.return);break;case 27:bg(f);case 26:case 5:fi(u,f,s),s&&i===null&&_&4&&gg(f),Zo(f,f.return);break;case 12:fi(u,f,s);break;case 31:fi(u,f,s),s&&_&4&&Ng(u,f);break;case 13:fi(u,f,s),s&&_&4&&wg(u,f);break;case 22:f.memoizedState===null&&fi(u,f,s),Zo(f,f.return);break;case 30:break;default:fi(u,f,s)}t=t.sibling}}function hh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Dr(s))}function ph(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Dr(e))}function Wl(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(e,t,s,i),t=t.sibling}function Eg(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Wl(e,t,s,i),u&2048&&Fo(9,t);break;case 1:Wl(e,t,s,i);break;case 3:Wl(e,t,s,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Dr(e)));break;case 12:if(u&2048){Wl(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,_=f.id,N=f.onPostCommit;typeof N=="function"&&N(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){$t(t,t.return,D)}}else Wl(e,t,s,i);break;case 31:Wl(e,t,s,i);break;case 13:Wl(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,_=t.alternate,t.memoizedState!==null?f._visibility&2?Wl(e,t,s,i):Jo(e,t):f._visibility&2?Wl(e,t,s,i):(f._visibility|=2,Uc(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&hh(_,t);break;case 24:Wl(e,t,s,i),u&2048&&ph(t.alternate,t);break;default:Wl(e,t,s,i)}}function Uc(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,_=t,N=s,D=i,ne=_.flags;switch(_.tag){case 0:case 11:case 15:Uc(f,_,N,D,u),Fo(8,_);break;case 23:break;case 22:var de=_.stateNode;_.memoizedState!==null?de._visibility&2?Uc(f,_,N,D,u):Jo(f,_):(de._visibility|=2,Uc(f,_,N,D,u)),u&&ne&2048&&hh(_.alternate,_);break;case 24:Uc(f,_,N,D,u),u&&ne&2048&&ph(_.alternate,_);break;default:Uc(f,_,N,D,u)}t=t.sibling}}function Jo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Jo(s,i),u&2048&&hh(i.alternate,i);break;case 24:Jo(s,i),u&2048&&ph(i.alternate,i);break;default:Jo(s,i)}t=t.sibling}}var Wo=8192;function Ic(e,t,s){if(e.subtreeFlags&Wo)for(e=e.child;e!==null;)Tg(e,t,s),e=e.sibling}function Tg(e,t,s){switch(e.tag){case 26:Ic(e,t,s),e.flags&Wo&&e.memoizedState!==null&&Y0(s,Jl,e.memoizedState,e.memoizedProps);break;case 5:Ic(e,t,s);break;case 3:case 4:var i=Jl;Jl=Ed(e.stateNode.containerInfo),Ic(e,t,s),Jl=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Wo,Wo=16777216,Ic(e,t,s),Wo=i):Ic(e,t,s));break;default:Ic(e,t,s)}}function Cg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ls=i,Mg(i,e)}Cg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ag(e),e=e.sibling}function Ag(e){switch(e.tag){case 0:case 11:case 15:Po(e),e.flags&2048&&Vi(9,e,e.return);break;case 3:Po(e);break;case 12:Po(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,pd(e)):Po(e);break;default:Po(e)}}function pd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ls=i,Mg(i,e)}Cg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vi(8,t,t.return),pd(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,pd(t));break;default:pd(t)}e=e.sibling}}function Mg(e,t){for(;ls!==null;){var s=ls;switch(s.tag){case 0:case 11:case 15:Vi(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Dr(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,ls=i;else e:for(s=e;ls!==null;){i=ls;var u=i.sibling,f=i.return;if(vg(i),i===s){ls=null;break e}if(u!==null){u.return=f,ls=u;break e}ls=f}}}var a0={getCacheForType:function(e){var t=Pn(Nn),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Pn(Nn).controller.signal}},i0=typeof WeakMap=="function"?WeakMap:Map,Ot=0,tn=null,pt=null,_t=0,Ht=0,hl=null,Qi=!1,Bc=!1,mh=!1,hi=0,Cn=0,Ki=0,Ir=0,gh=0,pl=0,Hc=0,eu=null,Js=null,xh=!1,md=0,Rg=0,gd=1/0,xd=null,Fi=null,es=0,Zi=null,$c=null,pi=0,bh=0,_h=null,Dg=null,tu=0,yh=null;function ml(){return(Ot&2)!==0&&_t!==0?_t&-_t:L.T!==null?Sh():ns()}function Og(){if(pl===0)if((_t&536870912)===0||ht){var e=at;at<<=1,(at&3932160)===0&&(at=262144),pl=e}else pl=536870912;return e=vs.current,e!==null&&(e.flags|=32),pl}function Ws(e,t,s){(e===tn&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)&&(qc(e,0),Ji(e,_t,pl,!1)),ts(e,s),((Ot&2)===0||e!==tn)&&(e===tn&&((Ot&2)===0&&(Ir|=s),Cn===4&&Ji(e,_t,pl,!1)),va(e))}function Lg(e,t,s){if((Ot&6)!==0)throw Error(c(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ge(e,t),u=i?o0(e,t):jh(e,t,!0),f=i;do{if(u===0){Bc&&!i&&Ji(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!r0(s)){u=jh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var N=e;u=eu;var D=N.current.memoizedState.isDehydrated;if(D&&(qc(N,_).flags|=256),_=jh(N,_,!1),_!==2){if(mh&&!D){N.errorRecoveryDisabledLanes|=f,Ir|=f,u=4;break e}f=Js,Js=u,f!==null&&(Js===null?Js=f:Js.push.apply(Js,f))}u=_}if(f=!1,u!==2)continue}}if(u===1){qc(e,0),Ji(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ji(i,t,pl,!Qi);break e;case 2:Js=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=md+300-Ze(),10<u)){if(Ji(i,t,pl,!Qi),X(i,0,!0)!==0)break e;pi=t,i.timeoutHandle=fx(zg.bind(null,i,s,Js,xd,xh,t,pl,Ir,Hc,Qi,f,"Throttled",-0,0),u);break e}zg(i,s,Js,xd,xh,t,pl,Ir,Hc,Qi,f,null,-0,0)}}break}while(!0);va(e)}function zg(e,t,s,i,u,f,_,N,D,ne,de,xe,ae,ce){if(e.timeoutHandle=-1,xe=t.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dt},Tg(t,f,xe);var Ue=(f&62914560)===f?md-Ze():(f&4194048)===f?Rg-Ze():0;if(Ue=X0(xe,Ue),Ue!==null){pi=f,e.cancelPendingCommit=Ue(Yg.bind(null,e,t,f,s,i,u,_,N,D,de,xe,null,ae,ce)),Ji(e,f,_,!ne);return}}Yg(e,t,f,s,i,u,_,N,D)}function r0(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!Nt(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Ji(e,t,s,i){t&=~gh,t&=~Ir,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Gt(u),_=1<<f;i[f]=-1,u&=~_}s!==0&&el(e,s,t)}function bd(){return(Ot&6)===0?(nu(0),!1):!0}function vh(){if(pt!==null){if(Ht===0)var e=pt.return;else e=pt,Gl=ha=null,fl(e),ti=null,Bi=0,e=pt;for(;e!==null;)hg(e.alternate,e),e=e.return;pt=null}}function qc(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,E0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),pi=0,vh(),tn=e,pt=s=Nl(e.current,null),_t=t,Ht=0,hl=null,Qi=!1,Bc=ge(e,t),mh=!1,Hc=pl=gh=Ir=Ki=Cn=0,Js=eu=null,xh=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-Gt(i),f=1<<u;t|=e[u],i&=~f}return hi=t,_c(),s}function Ug(e,t){Ye=null,L.H=Vo,t===Ii||t===Mc?(t=Wu(),Ht=3):t===Ho?(t=Wu(),Ht=4):Ht=t===Pf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hl=t,pt===null&&(Cn=1,rd(e,Gs(t,e.current)))}function Ig(){var e=vs.current;return e===null?!0:(_t&4194048)===_t?Ms===null:(_t&62914560)===_t||(_t&536870912)!==0?e===Ms:!1}function Bg(){var e=L.H;return L.H=Vo,e===null?Vo:e}function Hg(){var e=L.A;return L.A=a0,e}function _d(){Cn=4,Qi||(_t&4194048)!==_t&&vs.current!==null||(Bc=!0),(Ki&134217727)===0&&(Ir&134217727)===0||tn===null||Ji(tn,_t,pl,!1)}function jh(e,t,s){var i=Ot;Ot|=2;var u=Bg(),f=Hg();(tn!==e||_t!==t)&&(xd=null,qc(e,t)),t=!1;var _=Cn;e:do try{if(Ht!==0&&pt!==null){var N=pt,D=hl;switch(Ht){case 8:vh(),_=6;break e;case 3:case 2:case 9:case 6:vs.current===null&&(t=!0);var ne=Ht;if(Ht=0,hl=null,Gc(e,N,D,ne),s&&Bc){_=0;break e}break;default:ne=Ht,Ht=0,hl=null,Gc(e,N,D,ne)}}c0(),_=Cn;break}catch(de){Ug(e,de)}while(!0);return t&&e.shellSuspendCounter++,Gl=ha=null,Ot=i,L.H=u,L.A=f,pt===null&&(tn=null,_t=0,_c()),_}function c0(){for(;pt!==null;)$g(pt)}function o0(e,t){var s=Ot;Ot|=2;var i=Bg(),u=Hg();tn!==e||_t!==t?(xd=null,gd=Ze()+500,qc(e,t)):Bc=ge(e,t);e:do try{if(Ht!==0&&pt!==null){t=pt;var f=hl;t:switch(Ht){case 1:Ht=0,hl=null,Gc(e,t,f,1);break;case 2:case 9:if(Zu(f)){Ht=0,hl=null,qg(t);break}t=function(){Ht!==2&&Ht!==9||tn!==e||(Ht=7),va(e)},f.then(t,t);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:Zu(f)?(Ht=0,hl=null,qg(t)):(Ht=0,hl=null,Gc(e,t,f,7));break;case 5:var _=null;switch(pt.tag){case 26:_=pt.memoizedState;case 5:case 27:var N=pt;if(_?Ex(_):N.stateNode.complete){Ht=0,hl=null;var D=N.sibling;if(D!==null)pt=D;else{var ne=N.return;ne!==null?(pt=ne,yd(ne)):pt=null}break t}}Ht=0,hl=null,Gc(e,t,f,5);break;case 6:Ht=0,hl=null,Gc(e,t,f,6);break;case 8:vh(),Cn=6;break e;default:throw Error(c(462))}}u0();break}catch(de){Ug(e,de)}while(!0);return Gl=ha=null,L.H=i,L.A=u,Ot=s,pt!==null?0:(tn=null,_t=0,_c(),Cn)}function u0(){for(;pt!==null&&!jt();)$g(pt)}function $g(e){var t=dg(e.alternate,e,hi);e.memoizedProps=e.pendingProps,t===null?yd(e):pt=t}function qg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=ag(s,t,t.pendingProps,t.type,void 0,_t);break;case 11:t=ag(s,t,t.pendingProps,t.type.render,t.ref,_t);break;case 5:fl(t);default:hg(s,t),t=pt=qu(t,hi),t=dg(s,t,hi)}e.memoizedProps=e.pendingProps,t===null?yd(e):pt=t}function Gc(e,t,s,i){Gl=ha=null,fl(t),ti=null,Bi=0;var u=t.return;try{if(Wy(e,u,t,s,_t)){Cn=1,rd(e,Gs(s,e.current)),pt=null;return}}catch(f){if(u!==null)throw pt=u,f;Cn=1,rd(e,Gs(s,e.current)),pt=null;return}t.flags&32768?(ht||i===1?e=!0:Bc||(_t&536870912)!==0?e=!1:(Qi=e=!0,(i===2||i===9||i===3||i===6)&&(i=vs.current,i!==null&&i.tag===13&&(i.flags|=16384))),Gg(t,e)):yd(t)}function yd(e){var t=e;do{if((t.flags&32768)!==0){Gg(t,Qi);return}e=t.return;var s=t0(t.alternate,t,hi);if(s!==null){pt=s;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);Cn===0&&(Cn=5)}function Gg(e,t){do{var s=n0(e.alternate,e);if(s!==null){s.flags&=32767,pt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){pt=e;return}pt=e=s}while(e!==null);Cn=6,pt=null}function Yg(e,t,s,i,u,f,_,N,D){e.cancelPendingCommit=null;do vd();while(es!==0);if((Ot&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=bc,Ls(e,s,f,_,N,D),e===tn&&(pt=tn=null,_t=0),$c=t,Zi=e,pi=s,bh=f,_h=u,Dg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,p0(sn,function(){return Fg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=L.T,L.T=null,u=U.p,U.p=2,_=Ot,Ot|=4;try{s0(e,t,s)}finally{Ot=_,U.p=u,L.T=i}}es=1,Xg(),Vg(),Qg()}}function Xg(){if(es===1){es=0;var e=Zi,t=$c,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=L.T,L.T=null;var i=U.p;U.p=2;var u=Ot;Ot|=4;try{kg(t,e);var f=Oh,_=Cr(e.containerInfo),N=f.focusedElem,D=f.selectionRange;if(_!==N&&N&&N.ownerDocument&&Eo(N.ownerDocument.documentElement,N)){if(D!==null&&Ti(N)){var ne=D.start,de=D.end;if(de===void 0&&(de=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(de,N.value.length);else{var xe=N.ownerDocument||document,ae=xe&&xe.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),Ue=N.textContent.length,Ke=Math.min(D.start,Ue),Kt=D.end===void 0?Ke:Math.min(D.end,Ue);!ce.extend&&Ke>Kt&&(_=Kt,Kt=Ke,Ke=_);var F=jl(N,Ke),I=jl(N,Kt);if(F&&I&&(ce.rangeCount!==1||ce.anchorNode!==F.node||ce.anchorOffset!==F.offset||ce.focusNode!==I.node||ce.focusOffset!==I.offset)){var ee=xe.createRange();ee.setStart(F.node,F.offset),ce.removeAllRanges(),Ke>Kt?(ce.addRange(ee),ce.extend(I.node,I.offset)):(ee.setEnd(I.node,I.offset),ce.addRange(ee))}}}}for(xe=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&xe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<xe.length;N++){var he=xe[N];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Dd=!!Dh,Oh=Dh=null}finally{Ot=u,U.p=i,L.T=s}}e.current=t,es=2}}function Vg(){if(es===2){es=0;var e=Zi,t=$c,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=L.T,L.T=null;var i=U.p;U.p=2;var u=Ot;Ot|=4;try{yg(e,t.alternate,t)}finally{Ot=u,U.p=i,L.T=s}}es=3}}function Qg(){if(es===4||es===3){es=0,ot();var e=Zi,t=$c,s=pi,i=Dg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?es=5:(es=0,$c=Zi=null,Kg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Fi=null),bs(s),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(ln,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=L.T,u=U.p,U.p=2,L.T=null;try{for(var f=e.onRecoverableError,_=0;_<i.length;_++){var N=i[_];f(N.value,{componentStack:N.stack})}}finally{L.T=t,U.p=u}}(pi&3)!==0&&vd(),va(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===yh?tu++:(tu=0,yh=e):tu=0,nu(0)}}function Kg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Dr(t)))}function vd(){return Xg(),Vg(),Qg(),Fg()}function Fg(){if(es!==5)return!1;var e=Zi,t=bh;bh=0;var s=bs(pi),i=L.T,u=U.p;try{U.p=32>s?32:s,L.T=null,s=_h,_h=null;var f=Zi,_=pi;if(es=0,$c=Zi=null,pi=0,(Ot&6)!==0)throw Error(c(331));var N=Ot;if(Ot|=4,Ag(f.current),Eg(f,f.current,_,s),Ot=N,nu(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(ln,f)}catch{}return!0}finally{U.p=u,L.T=i,Kg(e,t)}}function Zg(e,t,s){t=Gs(s,t),t=Wf(e.stateNode,t,2),e=El(e,t,2),e!==null&&(ts(e,2),va(e))}function $t(e,t,s){if(e.tag===3)Zg(e,e,s);else for(;t!==null;){if(t.tag===3){Zg(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Fi===null||!Fi.has(i))){e=Gs(s,e),s=Jm(2),i=El(t,s,2),i!==null&&(Wm(s,i,t,e),ts(i,2),va(i));break}}t=t.return}}function Nh(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new i0;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(mh=!0,u.add(s),e=d0.bind(null,e,t,s),t.then(e,e))}function d0(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,tn===e&&(_t&s)===s&&(Cn===4||Cn===3&&(_t&62914560)===_t&&300>Ze()-md?(Ot&2)===0&&qc(e,0):gh|=s,Hc===_t&&(Hc=0)),va(e)}function Jg(e,t){t===0&&(t=He()),e=Va(e,t),e!==null&&(ts(e,t),va(e))}function f0(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Jg(e,s)}function h0(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(c(314))}i!==null&&i.delete(t),Jg(e,s)}function p0(e,t){return Te(e,t)}var jd=null,Yc=null,wh=!1,Nd=!1,kh=!1,Wi=0;function va(e){e!==Yc&&e.next===null&&(Yc===null?jd=Yc=e:Yc=Yc.next=e),Nd=!0,wh||(wh=!0,g0())}function nu(e,t){if(!kh&&Nd){kh=!0;do for(var s=!1,i=jd;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var _=i.suspendedLanes,N=i.pingedLanes;f=(1<<31-Gt(42|e)+1)-1,f&=u&~(_&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,tx(i,f))}else f=_t,f=X(i,i===tn?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||ge(i,f)||(s=!0,tx(i,f));i=i.next}while(s);kh=!1}}function m0(){Wg()}function Wg(){Nd=wh=!1;var e=0;Wi!==0&&S0()&&(e=Wi);for(var t=Ze(),s=null,i=jd;i!==null;){var u=i.next,f=Pg(i,t);f===0?(i.next=null,s===null?jd=u:s.next=u,u===null&&(Yc=s)):(s=i,(e!==0||(f&3)!==0)&&(Nd=!0)),i=u}es!==0&&es!==5||nu(e),Wi!==0&&(Wi=0)}function Pg(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var _=31-Gt(f),N=1<<_,D=u[_];D===-1?((N&s)===0||(N&i)!==0)&&(u[_]=De(N,t)):D<=t&&(e.expiredLanes|=N),f&=~N}if(t=tn,s=_t,s=X(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&et(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ge(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&et(i),bs(s)){case 2:case 8:s=Tt;break;case 32:s=sn;break;case 268435456:s=_n;break;default:s=sn}return i=ex.bind(null,e),s=Te(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&et(i),e.callbackPriority=2,e.callbackNode=null,2}function ex(e,t){if(es!==0&&es!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(vd()&&e.callbackNode!==s)return null;var i=_t;return i=X(e,e===tn?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Lg(e,i,t),Pg(e,Ze()),e.callbackNode!=null&&e.callbackNode===s?ex.bind(null,e):null)}function tx(e,t){if(vd())return null;Lg(e,t,!0)}function g0(){T0(function(){(Ot&6)!==0?Te(rs,m0):Wg()})}function Sh(){if(Wi===0){var e=pa;e===0&&(e=Ve,Ve<<=1,(Ve&261888)===0&&(Ve=256)),Wi=e}return Wi}function nx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:On(""+e)}function sx(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function x0(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=nx((u[Je]||null).action),_=i.submitter;_&&(t=(t=_[Je]||null)?nx(t.formAction):_.getAttribute("formAction"),t!==null&&(f=t,_=null));var N=new se("action","action",null,i,u);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Wi!==0){var D=_?sx(u,_):new FormData(u);Vf(s,{pending:!0,data:D,method:u.method,action:f},null,D)}}else typeof f=="function"&&(N.preventDefault(),D=_?sx(u,_):new FormData(u),Vf(s,{pending:!0,data:D,method:u.method,action:f},f,D))},currentTarget:u}]})}}for(var Eh=0;Eh<Mi.length;Eh++){var Th=Mi[Eh],b0=Th.toLowerCase(),_0=Th[0].toUpperCase()+Th.slice(1);qs(b0,"on"+_0)}qs(Xa,"onAnimationEnd"),qs(gc,"onAnimationIteration"),qs(Hu,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs(zf,"onTransitionRun"),qs(J,"onTransitionStart"),qs(Hl,"onTransitionCancel"),qs($s,"onTransitionEnd"),os("onMouseEnter",["mouseout","mouseover"]),os("onMouseLeave",["mouseout","mouseover"]),os("onPointerEnter",["pointerout","pointerover"]),os("onPointerLeave",["pointerout","pointerover"]),Es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Es("onBeforeInput",["compositionend","keypress","textInput","paste"]),Es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var su="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(" "),y0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(su));function lx(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var _=i.length-1;0<=_;_--){var N=i[_],D=N.instance,ne=N.currentTarget;if(N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ne;try{f(u)}catch(de){xc(de)}u.currentTarget=null,f=D}else for(_=0;_<i.length;_++){if(N=i[_],D=N.instance,ne=N.currentTarget,N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ne;try{f(u)}catch(de){xc(de)}u.currentTarget=null,f=D}}}}function mt(e,t){var s=t[tl];s===void 0&&(s=t[tl]=new Set);var i=e+"__bubble";s.has(i)||(ax(t,e,2,!1),s.add(i))}function Ch(e,t,s){var i=0;t&&(i|=4),ax(s,e,i,t)}var wd="_reactListening"+Math.random().toString(36).slice(2);function Ah(e){if(!e[wd]){e[wd]=!0,Rn.forEach(function(s){s!=="selectionchange"&&(y0.has(s)||Ch(s,!1,e),Ch(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Ch("selectionchange",!1,t))}}function ax(e,t,s,i){switch(Ox(t)){case 2:var u=K0;break;case 8:u=F0;break;default:u=Xh}s=u.bind(null,t,s,e),u=void 0,!xr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Mh(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var N=i.stateNode.containerInfo;if(N===u)break;if(_===4)for(_=i.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;N!==null;){if(_=Ss(N),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){i=f=_;continue e}N=N.parentNode}}i=i.return}Zt(function(){var ne=f,de=jn(s),xe=[];e:{var ae=To.get(e);if(ae!==void 0){var ce=se,Ue=e;switch(e){case"keypress":if(Ua(s)===0)break e;case"keydown":case"keyup":ce=vo;break;case"focusin":Ue="focus",ce=Ha;break;case"focusout":Ue="blur",ce=Ha;break;case"beforeblur":case"afterblur":ce=Ha;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=br;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Mf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=cc;break;case Xa:case gc:case Hu:ce=_r;break;case $s:ce=jo;break;case"scroll":case"scrollend":ce=ze;break;case"wheel":ce=vr;break;case"copy":case"cut":case"paste":ce=Rf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=rc;break;case"toggle":case"beforetoggle":ce=uc}var Ke=(t&4)!==0,Kt=!Ke&&(e==="scroll"||e==="scrollend"),F=Ke?ae!==null?ae+"Capture":null:ae;Ke=[];for(var I=ne,ee;I!==null;){var he=I;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||F===null||(he=Il(I,F),he!=null&&Ke.push(lu(I,he,ee))),Kt)break;I=I.return}0<Ke.length&&(ae=new ce(ae,Ue,null,s,de),xe.push({event:ae,listeners:Ke}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",ae&&s!==mn&&(Ue=s.relatedTarget||s.fromElement)&&(Ss(Ue)||Ue[Mn]))break e;if((ce||ae)&&(ae=de.window===de?de:(ae=de.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(Ue=s.relatedTarget||s.toElement,ce=ne,Ue=Ue?Ss(Ue):null,Ue!==null&&(Kt=d(Ue),Ke=Ue.tag,Ue!==Kt||Ke!==5&&Ke!==27&&Ke!==6)&&(Ue=null)):(ce=null,Ue=ne),ce!==Ue)){if(Ke=br,he="onMouseLeave",F="onMouseEnter",I="mouse",(e==="pointerout"||e==="pointerover")&&(Ke=rc,he="onPointerLeave",F="onPointerEnter",I="pointer"),Kt=ce==null?ae:zl(ce),ee=Ue==null?ae:zl(Ue),ae=new Ke(he,I+"leave",ce,s,de),ae.target=Kt,ae.relatedTarget=ee,he=null,Ss(de)===ne&&(Ke=new Ke(F,I+"enter",Ue,s,de),Ke.target=ee,Ke.relatedTarget=Kt,he=Ke),Kt=he,ce&&Ue)t:{for(Ke=v0,F=ce,I=Ue,ee=0,he=F;he;he=Ke(he))ee++;he=0;for(var qe=I;qe;qe=Ke(qe))he++;for(;0<ee-he;)F=Ke(F),ee--;for(;0<he-ee;)I=Ke(I),he--;for(;ee--;){if(F===I||I!==null&&F===I.alternate){Ke=F;break t}F=Ke(F),I=Ke(I)}Ke=null}else Ke=null;ce!==null&&ix(xe,ae,ce,Ke,!1),Ue!==null&&Kt!==null&&ix(xe,Kt,Ue,Ke,!0)}}e:{if(ae=ne?zl(ne):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Mt=Si;else if(wo(ae))if(cn)Mt=da;else{Mt=Er;var Be=$n}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&Ie(ne.elementType)&&(Mt=Si):Mt=Tr;if(Mt&&(Mt=Mt(e,ne))){Nr(xe,Mt,s,de);break e}Be&&Be(e,ae,ne),e==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&_s(ae,"number",ae.value)}switch(Be=ne?zl(ne):window,e){case"focusin":(wo(Be)||Be.contentEditable==="true")&&(Hs=Be,mc=ne,Bl=null);break;case"focusout":Bl=mc=Hs=null;break;case"mousedown":Ci=!0;break;case"contextmenu":case"mouseup":case"dragend":Ci=!1,Ai(xe,s,de);break;case"selectionchange":if(Ar)break;case"keydown":case"keyup":Ai(xe,s,de)}var ct;if(wi)e:{switch(e){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else Bs?dc(e,s)&&(yt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(yt="onCompositionStart");yt&&(ki&&s.locale!=="ko"&&(Bs||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&Bs&&(ct=aa()):(il=de,vi="value"in il?il.value:il.textContent,Bs=!0)),Be=kd(ne,yt),0<Be.length&&(yt=new yr(yt,e,null,s,de),xe.push({event:yt,listeners:Be}),ct?yt.data=ct:(ct=Lu(s),ct!==null&&(yt.data=ct)))),(ct=No?fc(e,s):zu(e,s))&&(yt=kd(ne,"onBeforeInput"),0<yt.length&&(Be=new yr("onBeforeInput","beforeinput",null,s,de),xe.push({event:Be,listeners:yt}),Be.data=ct)),x0(xe,e,ne,s,de)}lx(xe,t)})}function lu(e,t,s){return{instance:e,listener:t,currentTarget:s}}function kd(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Il(e,s),u!=null&&i.unshift(lu(e,u,f)),u=Il(e,t),u!=null&&i.push(lu(e,u,f))),e.tag===3)return i;e=e.return}return[]}function v0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ix(e,t,s,i,u){for(var f=t._reactName,_=[];s!==null&&s!==i;){var N=s,D=N.alternate,ne=N.stateNode;if(N=N.tag,D!==null&&D===i)break;N!==5&&N!==26&&N!==27||ne===null||(D=ne,u?(ne=Il(s,f),ne!=null&&_.unshift(lu(s,ne,D))):u||(ne=Il(s,f),ne!=null&&_.push(lu(s,ne,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var j0=/\r\n?/g,N0=/\u0000|\uFFFD/g;function rx(e){return(typeof e=="string"?e:""+e).replace(j0,`
|
|
50
|
+
`).replace(N0,"")}function cx(e,t){return t=rx(t),rx(e)===t}function Qt(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||W(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&W(e,""+i);break;case"className":Bn(e,"class",i);break;case"tabIndex":Bn(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Bn(e,s,i);break;case"style":$e(e,i,f);break;case"data":if(t!=="object"){Bn(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=On(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(s==="formAction"?(t!=="input"&&Qt(e,t,"name",u.name,u,null),Qt(e,t,"formEncType",u.formEncType,u,null),Qt(e,t,"formMethod",u.formMethod,u,null),Qt(e,t,"formTarget",u.formTarget,u,null)):(Qt(e,t,"encType",u.encType,u,null),Qt(e,t,"method",u.method,u,null),Qt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=On(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=Dt);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=On(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":mt("beforetoggle",e),mt("toggle",e),ss(e,"popover",i);break;case"xlinkActuate":it(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":it(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":it(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":it(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":it(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":it(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":it(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":it(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":it(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ss(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=At.get(s)||s,ss(e,s,i))}}function Rh(e,t,s,i,u,f){switch(s){case"style":$e(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"children":typeof i=="string"?W(e,i):(typeof i=="number"||typeof i=="bigint")&&W(e,""+i);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Dt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dn.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),f=e[Je]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):ss(e,s,i)}}}function hs(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",e),mt("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var _=s[f];if(_!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,f,_,s,null)}}u&&Qt(e,t,"srcSet",s.srcSet,s,null),i&&Qt(e,t,"src",s.src,s,null);return;case"input":mt("invalid",e);var N=f=_=u=null,D=null,ne=null;for(i in s)if(s.hasOwnProperty(i)){var de=s[i];if(de!=null)switch(i){case"name":u=de;break;case"type":_=de;break;case"checked":D=de;break;case"defaultChecked":ne=de;break;case"value":f=de;break;case"defaultValue":N=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(c(137,t));break;default:Qt(e,t,i,de,s,null)}}pn(e,f,N,D,ne,_,u,!1);return;case"select":mt("invalid",e),i=_=f=null;for(u in s)if(s.hasOwnProperty(u)&&(N=s[u],N!=null))switch(u){case"value":f=N;break;case"defaultValue":_=N;break;case"multiple":i=N;default:Qt(e,t,u,N,s,null)}t=f,s=_,e.multiple=!!i,t!=null?Ct(e,!!i,t,!1):s!=null&&Ct(e,!!i,s,!0);return;case"textarea":mt("invalid",e),f=u=i=null;for(_ in s)if(s.hasOwnProperty(_)&&(N=s[_],N!=null))switch(_){case"value":i=N;break;case"defaultValue":u=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:Qt(e,t,_,N,s,null)}T(e,i,u,f);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(i=s[D],i!=null))switch(D){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Qt(e,t,D,i,s,null)}return;case"dialog":mt("beforetoggle",e),mt("toggle",e),mt("cancel",e),mt("close",e);break;case"iframe":case"object":mt("load",e);break;case"video":case"audio":for(i=0;i<su.length;i++)mt(su[i],e);break;case"image":mt("error",e),mt("load",e);break;case"details":mt("toggle",e);break;case"embed":case"source":case"link":mt("error",e),mt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in s)if(s.hasOwnProperty(ne)&&(i=s[ne],i!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,ne,i,s,null)}return;default:if(Ie(t)){for(de in s)s.hasOwnProperty(de)&&(i=s[de],i!==void 0&&Rh(e,t,de,i,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(i=s[N],i!=null&&Qt(e,t,N,i,s,null))}function w0(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,_=null,N=null,D=null,ne=null,de=null;for(ce in s){var xe=s[ce];if(s.hasOwnProperty(ce)&&xe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":D=xe;default:i.hasOwnProperty(ce)||Qt(e,t,ce,null,i,xe)}}for(var ae in i){var ce=i[ae];if(xe=s[ae],i.hasOwnProperty(ae)&&(ce!=null||xe!=null))switch(ae){case"type":f=ce;break;case"name":u=ce;break;case"checked":ne=ce;break;case"defaultChecked":de=ce;break;case"value":_=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(c(137,t));break;default:ce!==xe&&Qt(e,t,ae,ce,i,xe)}}Ul(e,_,N,D,ne,de,f,u);return;case"select":ce=_=N=ae=null;for(f in s)if(D=s[f],s.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":ce=D;default:i.hasOwnProperty(f)||Qt(e,t,f,null,i,D)}for(u in i)if(f=i[u],D=s[u],i.hasOwnProperty(u)&&(f!=null||D!=null))switch(u){case"value":ae=f;break;case"defaultValue":N=f;break;case"multiple":_=f;default:f!==D&&Qt(e,t,u,f,i,D)}t=N,s=_,i=ce,ae!=null?Ct(e,!!s,ae,!1):!!i!=!!s&&(t!=null?Ct(e,!!s,t,!0):Ct(e,!!s,s?[]:"",!1));return;case"textarea":ce=ae=null;for(N in s)if(u=s[N],s.hasOwnProperty(N)&&u!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Qt(e,t,N,null,i,u)}for(_ in i)if(u=i[_],f=s[_],i.hasOwnProperty(_)&&(u!=null||f!=null))switch(_){case"value":ae=u;break;case"defaultValue":ce=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Qt(e,t,_,u,i,f)}ve(e,ae,ce);return;case"option":for(var Ue in s)if(ae=s[Ue],s.hasOwnProperty(Ue)&&ae!=null&&!i.hasOwnProperty(Ue))switch(Ue){case"selected":e.selected=!1;break;default:Qt(e,t,Ue,null,i,ae)}for(D in i)if(ae=i[D],ce=s[D],i.hasOwnProperty(D)&&ae!==ce&&(ae!=null||ce!=null))switch(D){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Qt(e,t,D,ae,i,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ke in s)ae=s[Ke],s.hasOwnProperty(Ke)&&ae!=null&&!i.hasOwnProperty(Ke)&&Qt(e,t,Ke,null,i,ae);for(ne in i)if(ae=i[ne],ce=s[ne],i.hasOwnProperty(ne)&&ae!==ce&&(ae!=null||ce!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(c(137,t));break;default:Qt(e,t,ne,ae,i,ce)}return;default:if(Ie(t)){for(var Kt in s)ae=s[Kt],s.hasOwnProperty(Kt)&&ae!==void 0&&!i.hasOwnProperty(Kt)&&Rh(e,t,Kt,void 0,i,ae);for(de in i)ae=i[de],ce=s[de],!i.hasOwnProperty(de)||ae===ce||ae===void 0&&ce===void 0||Rh(e,t,de,ae,i,ce);return}}for(var F in s)ae=s[F],s.hasOwnProperty(F)&&ae!=null&&!i.hasOwnProperty(F)&&Qt(e,t,F,null,i,ae);for(xe in i)ae=i[xe],ce=s[xe],!i.hasOwnProperty(xe)||ae===ce||ae==null&&ce==null||Qt(e,t,xe,ae,i,ce)}function ox(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function k0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,_=u.initiatorType,N=u.duration;if(f&&N&&ox(_)){for(_=0,N=u.responseEnd,i+=1;i<s.length;i++){var D=s[i],ne=D.startTime;if(ne>N)break;var de=D.transferSize,xe=D.initiatorType;de&&ox(xe)&&(D=D.responseEnd,_+=de*(D<N?1:(N-ne)/(D-ne)))}if(--i,t+=8*(f+_)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Dh=null,Oh=null;function Sd(e){return e.nodeType===9?e:e.ownerDocument}function ux(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dx(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Lh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var zh=null;function S0(){var e=window.event;return e&&e.type==="popstate"?e===zh?!1:(zh=e,!0):(zh=null,!1)}var fx=typeof setTimeout=="function"?setTimeout:void 0,E0=typeof clearTimeout=="function"?clearTimeout:void 0,hx=typeof Promise=="function"?Promise:void 0,T0=typeof queueMicrotask=="function"?queueMicrotask:typeof hx<"u"?function(e){return hx.resolve(null).then(e).catch(C0)}:fx;function C0(e){setTimeout(function(){throw e})}function Pi(e){return e==="head"}function px(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Kc(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")au(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,au(s);for(var f=s.firstChild;f;){var _=f.nextSibling,N=f.nodeName;f[Us]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=_}}else s==="body"&&au(e.ownerDocument.body);s=u}while(s);Kc(t)}function mx(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Uh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Uh(s),cs(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function A0(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Us])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Tl(e.nextSibling),e===null)break}return null}function M0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Tl(e.nextSibling),e===null))return null;return e}function gx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Tl(e.nextSibling),e===null))return null;return e}function Ih(e){return e.data==="$?"||e.data==="$~"}function Bh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function R0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Tl(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Hh=null;function xx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Tl(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function _x(e,t,s){switch(t=Sd(s),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function au(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);cs(e)}var Cl=new Map,yx=new Set;function Ed(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mi=U.d;U.d={f:D0,r:O0,D:L0,C:z0,L:U0,m:I0,X:H0,S:B0,M:$0};function D0(){var e=mi.f(),t=bd();return e||t}function O0(e){var t=nl(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):mi.r(e)}var Xc=typeof document>"u"?null:document;function vx(e,t,s){var i=Xc;if(i&&typeof t=="string"&&t){var u=Vt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),yx.has(u)||(yx.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),hs(t,"link",e),Xt(t),i.head.appendChild(t)))}}function L0(e){mi.D(e),vx("dns-prefetch",e,null)}function z0(e,t){mi.C(e,t),vx("preconnect",e,t)}function U0(e,t,s){mi.L(e,t,s);var i=Xc;if(i&&e&&t){var u='link[rel="preload"][as="'+Vt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Vt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Vt(s.imageSizes)+'"]')):u+='[href="'+Vt(e)+'"]';var f=u;switch(t){case"style":f=Vc(e);break;case"script":f=Qc(e)}Cl.has(f)||(e=j({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Cl.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(iu(f))||t==="script"&&i.querySelector(ru(f))||(t=i.createElement("link"),hs(t,"link",e),Xt(t),i.head.appendChild(t)))}}function I0(e,t){mi.m(e,t);var s=Xc;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Vt(i)+'"][href="'+Vt(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Qc(e)}if(!Cl.has(f)&&(e=j({rel:"modulepreload",href:e},t),Cl.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ru(f)))return}i=s.createElement("link"),hs(i,"link",e),Xt(i),s.head.appendChild(i)}}}function B0(e,t,s){mi.S(e,t,s);var i=Xc;if(i&&e){var u=Un(i).hoistableStyles,f=Vc(e);t=t||"default";var _=u.get(f);if(!_){var N={loading:0,preload:null};if(_=i.querySelector(iu(f)))N.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Cl.get(f))&&$h(e,s);var D=_=i.createElement("link");Xt(D),hs(D,"link",e),D._p=new Promise(function(ne,de){D.onload=ne,D.onerror=de}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Td(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:N},u.set(f,_)}}}function H0(e,t){mi.X(e,t);var s=Xc;if(s&&e){var i=Un(s).hoistableScripts,u=Qc(e),f=i.get(u);f||(f=s.querySelector(ru(u)),f||(e=j({src:e,async:!0},t),(t=Cl.get(u))&&qh(e,t),f=s.createElement("script"),Xt(f),hs(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function $0(e,t){mi.M(e,t);var s=Xc;if(s&&e){var i=Un(s).hoistableScripts,u=Qc(e),f=i.get(u);f||(f=s.querySelector(ru(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=Cl.get(u))&&qh(e,t),f=s.createElement("script"),Xt(f),hs(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function jx(e,t,s,i){var u=(u=Se.current)?Ed(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Vc(s.href),s=Un(u).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Vc(s.href);var f=Un(u).hoistableStyles,_=f.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,_),(f=u.querySelector(iu(e)))&&!f._p&&(_.instance=f,_.state.loading=5),Cl.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Cl.set(e,s),f||q0(u,e,s,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qc(s),s=Un(u).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Vc(e){return'href="'+Vt(e)+'"'}function iu(e){return'link[rel="stylesheet"]['+e+"]"}function Nx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function q0(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),hs(t,"link",s),Xt(t),e.head.appendChild(t))}function Qc(e){return'[src="'+Vt(e)+'"]'}function ru(e){return"script[async]"+e}function wx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Vt(s.href)+'"]');if(i)return t.instance=i,Xt(i),i;var u=j({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Xt(i),hs(i,"style",u),Td(i,s.precedence,e),t.instance=i;case"stylesheet":u=Vc(s.href);var f=e.querySelector(iu(u));if(f)return t.state.loading|=4,t.instance=f,Xt(f),f;i=Nx(s),(u=Cl.get(u))&&$h(i,u),f=(e.ownerDocument||e).createElement("link"),Xt(f);var _=f;return _._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),hs(f,"link",i),t.state.loading|=4,Td(f,s.precedence,e),t.instance=f;case"script":return f=Qc(s.src),(u=e.querySelector(ru(f)))?(t.instance=u,Xt(u),u):(i=s,(u=Cl.get(f))&&(i=j({},s),qh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Xt(u),hs(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Td(i,s.precedence,e));return t.instance}function Td(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,_=0;_<i.length;_++){var N=i[_];if(N.dataset.precedence===t)f=N;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Cd=null;function kx(e,t,s){if(Cd===null){var i=new Map,u=Cd=new Map;u.set(s,i)}else u=Cd,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[Us]||f[rn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var _=f.getAttribute(t)||"";_=e+_;var N=i.get(_);N?N.push(f):i.set(_,[f])}}return i}function Sx(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function G0(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ex(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Y0(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Vc(i.href),f=t.querySelector(iu(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ad.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Xt(f);return}f=t.ownerDocument||t,i=Nx(i),(u=Cl.get(u))&&$h(i,u),f=f.createElement("link"),Xt(f);var _=f;_._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),hs(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ad.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Gh=0;function X0(e,t){return e.stylesheets&&e.count===0&&Rd(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Rd(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Gh===0&&(Gh=62500*k0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Rd(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Gh?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Ad(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Md=null;function Rd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Md=new Map,t.forEach(V0,e),Md=null,Ad.call(e))}function V0(e,t){if(!(t.state.loading&4)){var s=Md.get(e);if(s)var i=s.get(null);else{s=new Map,Md.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var _=u[f];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),i=_)}i&&s.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),f=s.get(_)||i,f===i&&s.set(null,u),s.set(_,u),this.count++,i=Ad.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var cu={$$typeof:$,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function Q0(e,t,s,i,u,f,_,N,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Tx(e,t,s,i,u,f,_,N,D,ne,de,xe){return e=new Q0(e,t,s,_,D,ne,de,xe,N),t=1,f===!0&&(t|=24),f=As(3,null,null,t),e.current=f,f.stateNode=e,t=Uo(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Hi(f),e}function Cx(e){return e?(e=Di,e):Di}function Ax(e,t,s,i,u,f){u=Cx(u),i.context===null?i.context=u:i.pendingContext=u,i=ul(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=El(e,i,t),s!==null&&(Ws(s,e,t),$i(s,e,t))}function Mx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Yh(e,t){Mx(e,t),(e=e.alternate)&&Mx(e,t)}function Rx(e){if(e.tag===13||e.tag===31){var t=Va(e,67108864);t!==null&&Ws(t,e,67108864),Yh(e,67108864)}}function Dx(e){if(e.tag===13||e.tag===31){var t=ml();t=zs(t);var s=Va(e,t);s!==null&&Ws(s,e,t),Yh(e,t)}}var Dd=!0;function K0(e,t,s,i){var u=L.T;L.T=null;var f=U.p;try{U.p=2,Xh(e,t,s,i)}finally{U.p=f,L.T=u}}function F0(e,t,s,i){var u=L.T;L.T=null;var f=U.p;try{U.p=8,Xh(e,t,s,i)}finally{U.p=f,L.T=u}}function Xh(e,t,s,i){if(Dd){var u=Vh(i);if(u===null)Mh(e,t,i,Od,s),Lx(e,i);else if(J0(u,e,t,s,i))i.stopPropagation();else if(Lx(e,i),t&4&&-1<Z0.indexOf(e)){for(;u!==null;){var f=nl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var _=ft(f.pendingLanes);if(_!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var D=1<<31-Gt(_);N.entanglements[1]|=D,_&=~D}va(f),(Ot&6)===0&&(gd=Ze()+500,nu(0))}}break;case 31:case 13:N=Va(f,2),N!==null&&Ws(N,f,2),bd(),Yh(f,2)}if(f=Vh(i),f===null&&Mh(e,t,i,Od,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Mh(e,t,i,null,s)}}function Vh(e){return e=jn(e),Qh(e)}var Od=null;function Qh(e){if(Od=null,e=Ss(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Od=e,null}function Ox(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(zt()){case rs:return 2;case Tt:return 8;case sn:case Fn:return 32;case _n:return 268435456;default:return 32}default:return 32}}var Kh=!1,er=null,tr=null,nr=null,ou=new Map,uu=new Map,sr=[],Z0="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".split(" ");function Lx(e,t){switch(e){case"focusin":case"focusout":er=null;break;case"dragenter":case"dragleave":tr=null;break;case"mouseover":case"mouseout":nr=null;break;case"pointerover":case"pointerout":ou.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":uu.delete(t.pointerId)}}function du(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=nl(t),t!==null&&Rx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function J0(e,t,s,i,u){switch(t){case"focusin":return er=du(er,e,t,s,i,u),!0;case"dragenter":return tr=du(tr,e,t,s,i,u),!0;case"mouseover":return nr=du(nr,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return ou.set(f,du(ou.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,uu.set(f,du(uu.get(f)||null,e,t,s,i,u)),!0}return!1}function zx(e){var t=Ss(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,zn(e.priority,function(){Dx(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,zn(e.priority,function(){Dx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ld(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Vh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);mn=i,s.target.dispatchEvent(i),mn=null}else return t=nl(s),t!==null&&Rx(t),e.blockedOn=s,!1;t.shift()}return!0}function Ux(e,t,s){Ld(e)&&s.delete(t)}function W0(){Kh=!1,er!==null&&Ld(er)&&(er=null),tr!==null&&Ld(tr)&&(tr=null),nr!==null&&Ld(nr)&&(nr=null),ou.forEach(Ux),uu.forEach(Ux)}function zd(e,t){e.blockedOn===t&&(e.blockedOn=null,Kh||(Kh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,W0)))}var Ud=null;function Ix(e){Ud!==e&&(Ud=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ud===e&&(Ud=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Qh(i||s)===null)continue;break}var f=nl(s);f!==null&&(e.splice(t,3),t-=3,Vf(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Kc(e){function t(D){return zd(D,e)}er!==null&&zd(er,e),tr!==null&&zd(tr,e),nr!==null&&zd(nr,e),ou.forEach(t),uu.forEach(t);for(var s=0;s<sr.length;s++){var i=sr[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<sr.length&&(s=sr[0],s.blockedOn===null);)zx(s),s.blockedOn===null&&sr.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],_=u[Je]||null;if(typeof f=="function")_||Ix(s);else if(_){var N=null;if(f&&f.hasAttribute("formAction")){if(u=f,_=f[Je]||null)N=_.formAction;else if(Qh(u)!==null)continue}else N=_.action;typeof N=="function"?s[i+1]=N:(s.splice(i,3),i-=3),Ix(s)}}}function Bx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Fh(e){this._internalRoot=e}Id.prototype.render=Fh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,i=ml();Ax(s,i,e,t,null,null)},Id.prototype.unmount=Fh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ax(e.current,2,null,e,null,null),bd(),t[Mn]=null}};function Id(e){this._internalRoot=e}Id.prototype.unstable_scheduleHydration=function(e){if(e){var t=ns();e={blockedOn:null,target:e,priority:t};for(var s=0;s<sr.length&&t!==0&&t<sr[s].priority;s++);sr.splice(s,0,e),s===0&&zx(e)}};var Hx=l.version;if(Hx!=="19.2.8")throw Error(c(527,Hx,"19.2.8"));U.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var P0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bd.isDisabled&&Bd.supportsFiber)try{ln=Bd.inject(P0),St=Bd}catch{}}return hu.createRoot=function(e,t){if(!o(e))throw Error(c(299));var s=!1,i="",u=Qm,f=Km,_=Fm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Tx(e,1,!1,null,null,s,i,null,u,f,_,Bx),e[Mn]=t.current,Ah(e),new Fh(t)},hu.hydrateRoot=function(e,t,s){if(!o(e))throw Error(c(299));var i=!1,u="",f=Qm,_=Km,N=Fm,D=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=Tx(e,1,!0,t,s??null,i,u,D,f,_,N,Bx),t.context=Cx(null),s=t.current,i=ml(),i=zs(i),u=ul(i),u.callback=null,El(s,u,i),s=i,t.current.lanes=s,ts(t,s),va(t),e[Mn]=t.current,Ah(e),new Id(t)},hu.version="19.2.8",hu}var Jx;function dv(){if(Jx)return Ph.exports;Jx=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(l){console.error(l)}}return n(),Ph.exports=uv(),Ph.exports}var fv=dv();const D_=1,or="main",Wx=["skills","agents","hooks","commands","plugins","output-styles","CLAUDE.md","settings.json","keybindings.json"],yi=["orange","blue","green","purple","pink","teal"];function hv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${O_(n)}`}function pv(n){const l=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${l.replace(/^-+|-+$/g,"")||"project"}-${O_(n)}`,c=hv(n);return[l,r].filter(o=>o!==c)}function O_(n){const l=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return mv(l?n.toLowerCase():n)}function mv(n){let l=3735928559,r=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);l=Math.imul(l^o,2654435761),r=Math.imul(r^o,1597334677)}return l=Math.imul(l^l>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(l^l>>>13,3266489909),(4294967296*(2097151&r)+(l>>>0)).toString(36)}const Hp=x.createContext({accounts:[],auth:{},multi:!1});function $p(){return x.useContext(Hp)}function gv(n,l="claude"){const{accounts:r,multi:c}=x.useContext(Hp);return!c||l==="antigravity"||!n?null:r.find(o=>o.id===n)??null}const nf={orange:"оранжевый",blue:"синий",green:"зелёный",purple:"фиолетовый",pink:"розовый",teal:"бирюзовый"};function L_(n){const l=Array.from(n.trim())[0];return l?l.toUpperCase():"?"}function z_(n){return n?n.loggedIn?n.plan||"вход выполнен":"вход не выполнен":""}const U_="ccv:last-account";function xv(){try{return localStorage.getItem(U_)}catch{return null}}function bv(n){try{localStorage.setItem(U_,n)}catch{}}function Oa({account:n,size:l="sm",className:r}){const c=`Аккаунт «${n.name}», ${nf[n.color]}`;return a.jsx("span",{className:`acct-mark acct-mark--${l} acct--${n.color}${r?` ${r}`:""}`,role:"img","aria-label":c,title:c,children:a.jsx("span",{"aria-hidden":"true",children:L_(n.name)})})}function Px({account:n,onClick:l,className:r}){const c=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"acct-mark acct-mark--sm","aria-hidden":"true",children:a.jsx("span",{children:L_(n.name)})}),a.jsx("span",{className:"acct-chip__name",children:n.name})]}),o=`acct-chip acct--${n.color}${r?` ${r}`:""}`,d=`Сессия идёт под аккаунтом «${n.name}» — лимиты и тариф берутся из него`;return l?a.jsx("button",{type:"button",className:o,title:d,"aria-label":`Аккаунт «${n.name}». Открыть аккаунты`,onClick:l,children:c}):a.jsx("span",{className:o,title:d,role:"group","aria-label":`Аккаунт «${n.name}»`,children:c})}var _i,ro,co,oo,uo,Au,fo,Nf,I_;class _v{constructor(l){kn(this,Nf);kn(this,_i,null);kn(this,ro,new Set);kn(this,co,500);kn(this,oo,null);kn(this,uo,!1);kn(this,Au,null);kn(this,fo,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){Lt(this,fo,l)}connect(){if(Fe(this,uo))return;const l=new WebSocket(this.url);Lt(this,_i,l),l.addEventListener("open",()=>{var r,c;Lt(this,co,500),this.send({type:"hello",protocol:D_,clientName:"ccv-web"}),(r=Fe(this,Au))==null||r.call(this),(c=Fe(this,fo))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Fe(this,ro))o(c)}),l.addEventListener("close",()=>{var r;Lt(this,_i,null),(r=Fe(this,fo))==null||r.call(this),Qn(this,Nf,I_).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){Lt(this,Au,l)}on(l){return Fe(this,ro).add(l),()=>Fe(this,ro).delete(l)}send(l){var r;((r=Fe(this,_i))==null?void 0:r.readyState)===WebSocket.OPEN&&Fe(this,_i).send(JSON.stringify(l))}get connected(){var l;return((l=Fe(this,_i))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;Lt(this,uo,!0),(l=Fe(this,_i))==null||l.close()}}_i=new WeakMap,ro=new WeakMap,co=new WeakMap,oo=new WeakMap,uo=new WeakMap,Au=new WeakMap,fo=new WeakMap,Nf=new WeakSet,I_=function(){if(Fe(this,uo)||Fe(this,oo)!==null)return;const l=Fe(this,co);Lt(this,co,Math.min(l*2,1e4)),Lt(this,oo,window.setTimeout(()=>{Lt(this,oo,null),this.connect()},l))};const yv=1,B_="ccv:relay",sf="ccv:relay.host";function vv(){try{const n=localStorage.getItem(B_);if(!n)return null;const l=JSON.parse(n);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function H_(){localStorage.removeItem(B_)}var Ca,ho,Aa,po,mo,hr,Vr,Qr,pr,Kr,go,Fr,Zr,fn,rr,jp,$_,Gr,Np;class jv{constructor(l){kn(this,fn);kn(this,Ca,null);kn(this,ho,new Set);kn(this,Aa,null);kn(this,po,null);kn(this,mo,500);kn(this,hr,null);kn(this,Vr,!1);kn(this,Qr,!1);kn(this,pr,!1);kn(this,Kr,null);kn(this,go,"Подключаемся…");kn(this,Fr,0);kn(this,Zr,[]);this.session=l}get connected(){return Fe(this,Qr)&&Fe(this,pr)}get statusText(){return Fe(this,go)}get hostId(){return Fe(this,Kr)}on(l){return Fe(this,ho).add(l),()=>Fe(this,ho).delete(l)}onReconnect(l){Lt(this,po,l)}onStatus(l){Lt(this,Aa,l)}connect(){Fe(this,Vr)||Qn(this,fn,jp).call(this)}send(l){if(!Fe(this,Qr)){Fe(this,Zr).length<64&&Fe(this,Zr).push(l);return}Qn(this,fn,Gr).call(this,{t:"client.frame",body:l})}close(){var l;Lt(this,Vr,!0),Fe(this,hr)!==null&&window.clearTimeout(Fe(this,hr)),(l=Fe(this,Ca))==null||l.close()}}Ca=new WeakMap,ho=new WeakMap,Aa=new WeakMap,po=new WeakMap,mo=new WeakMap,hr=new WeakMap,Vr=new WeakMap,Qr=new WeakMap,pr=new WeakMap,Kr=new WeakMap,go=new WeakMap,Fr=new WeakMap,Zr=new WeakMap,fn=new WeakSet,rr=function(l){var r;Fe(this,go)!==l&&(Lt(this,go,l),(r=Fe(this,Aa))==null||r.call(this))},jp=async function(){if(Fe(this,Ca))return;if(!Fe(this,Kr))try{Lt(this,Kr,await Nv(this.session.token))}catch(c){Qn(this,fn,rr).call(this,c instanceof Error?c.message:String(c)),Qn(this,fn,Np).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);Lt(this,Ca,r),r.addEventListener("open",()=>{Qn(this,fn,Gr).call(this,{t:"client.hello",protocol:yv,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Qn(this,fn,$_).call(this,o)}),r.addEventListener("close",()=>{var c;Lt(this,Ca,null),Lt(this,Qr,!1),Lt(this,pr,!1),Qn(this,fn,rr).call(this,"Нет связи с сервером"),(c=Fe(this,Aa))==null||c.call(this),Qn(this,fn,Np).call(this)}),r.addEventListener("error",()=>r.close())},$_=function(l){var r,c,o,d,h,m,g;switch(l.t){case"client.ok":Lt(this,mo,500),Qn(this,fn,Gr).call(this,{t:"client.attach",hostId:Fe(this,Kr)??"",...Fe(this,Fr)>0?{sinceRseq:Fe(this,Fr)}:{}});return;case"client.attached":Lt(this,Qr,!0),Lt(this,pr,l.online),Lt(this,Fr,l.rseq),Qn(this,fn,rr).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Qn(this,fn,Gr).call(this,{t:"client.frame",body:{type:"hello",protocol:D_,clientName:"ccv-web-relay"}});const b=Fe(this,Zr);Lt(this,Zr,[]);for(const y of b)Qn(this,fn,Gr).call(this,{t:"client.frame",body:y});(r=Fe(this,po))==null||r.call(this),(c=Fe(this,Aa))==null||c.call(this);return;case"host.frame":{l.rseq>0&&Lt(this,Fr,l.rseq);const y=l.body;for(const j of Fe(this,ho))j(y);return}case"host.online":Lt(this,pr,!0),Qn(this,fn,rr).call(this,"Хост на связи"),(o=Fe(this,po))==null||o.call(this),(d=Fe(this,Aa))==null||d.call(this);return;case"host.offline":Lt(this,pr,!1),Qn(this,fn,rr).call(this,"Компьютер не на связи"),(h=Fe(this,Aa))==null||h.call(this);return;case"ping":Qn(this,fn,Gr).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){H_(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(sf),Qn(this,fn,rr).call(this,"Этот компьютер отвязан от аккаунта"),Lt(this,Vr,!0),(m=Fe(this,Ca))==null||m.close();return}l.code!=="offline"&&Qn(this,fn,rr).call(this,l.message),(g=Fe(this,Aa))==null||g.call(this);return}},Gr=function(l){var r;((r=Fe(this,Ca))==null?void 0:r.readyState)===WebSocket.OPEN&&Fe(this,Ca).send(JSON.stringify(l))},Np=function(){if(Fe(this,Vr)||Fe(this,hr)!==null)return;const l=Fe(this,mo);Lt(this,mo,Math.min(l*2,1e4)),Lt(this,hr,window.setTimeout(()=>{Lt(this,hr,null),Qn(this,fn,jp).call(this)},l))};async function Nv(n){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(sf,l),l;const r=localStorage.getItem(sf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw H_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(sf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function lf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const wv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function kv(){if(lf()==="local")return new _v(wv);const n=vv();return n?new jv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const q_="ccv:drafts",Sv=40,Ev=2e4,Tv=500;let Nu=null,wu=null;function qp(){if(Nu)return Nu;const n=new Map;try{const l=localStorage.getItem(q_);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return Nu=n,window.addEventListener("pagehide",X_),n}function sp(n){return qp().get(n)??""}function G_(n,l){const r=qp(),c=l.slice(0,Ev),o=r.has(n);if(o&&r.delete(n),c!=="")r.set(n,c);else if(!o)return;for(;r.size>Sv;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Mv(),Av()}function Y_(){const n=new Set;for(const l of qp().keys())n.add(l.startsWith("side:")?l.slice(5):l);return[...n].sort()}const wp=new Set;let eb="";function Cv(n){return wp.add(n),()=>wp.delete(n)}function Av(){const n=Y_(),l=n.join(`
|
|
51
|
+
`);if(l!==eb){eb=l;for(const r of wp)r(n)}}function Mv(){wu===null&&(wu=window.setTimeout(X_,Tv))}function X_(){if(wu!==null&&window.clearTimeout(wu),wu=null,!!Nu)try{localStorage.setItem(q_,JSON.stringify(Object.fromEntries(Nu)))}catch{}}const Ds={items:[],pending:[],lastSeq:0,contextTokens:null},lp={entries:[],total:0,loading:!1};function V_(n){var l;return((l=n.entries[0])==null?void 0:l.seq)??1}function tb(n){return n.total>0&&V_(n)>1}function Rv(n,l){const r=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function Dv(n){return af(Ds,n).items.map(l=>({...l,id:`h:${l.id}`}))}function af(n,l){let r=n;for(const c of l)c.seq<=r.lastSeq||(r={...Ov(r,c.event,c.seq),lastSeq:c.seq});return r}function Ov(n,l,r){var o,d;const c=n.items;switch(l.kind){case"user.message":return ja(n,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ja(n,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const m=c[h];return Fc(n,h,{...m,text:m.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?ja(n,m):Fc(n,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ja(n,{id:l.blockId,kind:"thinking",text:l.text});const m=c[h];return Fc(n,h,{...m,text:m.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"thinking",text:l.text};return h===-1?ja(n,m):Fc(n,h,m)}case"tool.use":return ja(n,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return n;const m=c[h];return Fc(n,h,{...m,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===l.requestId),m=n.pending.filter(g=>g.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return Fc({...n,pending:m},g,{...b,answers:l.answers})}}return l.decision==="allow"?{...n,pending:m}:ja({...n,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=l.contextTokens??n.contextTokens;return ja({...n,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?n:ja(n,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ja(n,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return n;case"rewound":return n;default:return n}}function Lv(n,l){let r=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(r===l)return n.slice(0,c);r++}return n}function zv(n,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<n.length;d++)if(n[d].kind==="user"){if(o===c)return n.slice(0,d);o++}return n}function ja(n,l){return{...n,items:[...n.items,l]}}function Fc(n,l,r){const c=n.items.slice();return c[l]=r,{...n,items:c}}const kp="ccv:theme",ap=["system","light","dark"];function Uv(){const[n,l]=x.useState(Iv);x.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[n]);const r=x.useCallback(o=>{try{localStorage.setItem(kp,o)}catch{}l(o)},[]),c=x.useCallback(()=>{l(o=>{const d=ap[(ap.indexOf(o)+1)%ap.length];try{localStorage.setItem(kp,d)}catch{}return d})},[]);return[n,r,c]}function Iv(){try{const n=localStorage.getItem(kp);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}const Q_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Bv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Jr={sidebar:{side:"left",min:200,max:520,width:276,label:"сессий"},files:{side:"left",min:180,max:560,width:260,label:"файлов"},search:{side:"left",min:220,max:640,width:320,label:"поиска"},git:{side:"left",min:220,max:640,width:320,label:"истории"},ask:{side:"right",min:260,max:720,width:380,label:"вопроса"}},Hv=320,K_="ccv:panes";function $v(n){return`--${n}-w`}function F_(n,l){const r=Jr[n];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function qv(){const n={};for(const l of Object.keys(Jr))n[l]=Jr[l].width;try{const l=localStorage.getItem(K_);if(l){const r=JSON.parse(l);for(const c of Object.keys(Jr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=F_(c,o))}}}catch{}return n}function Gv(){const[n,l]=x.useState(qv),r=x.useCallback(h=>{try{localStorage.setItem(K_,JSON.stringify(h))}catch{}},[]),c=x.useCallback((h,m)=>{l(g=>{const b=F_(h,m);if(g[h]===b)return g;const y={...g,[h]:b};return r(y),y})},[r]),o=x.useCallback(h=>{l(m=>{const g={...m,[h]:Jr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(Jr))d[$v(h)]=`${n[h]}px`;return{widths:n,style:d,setWidth:c,reset:o}}const ip=260,Z_=120,Yv=200,nb="ccv:terminal-h";function sb(n,l){return Math.round(Math.min(l,Math.max(Z_,n)))}function Xv(){const[n,l]=x.useState(()=>{try{const d=localStorage.getItem(nb);if(d){const h=Number(d);if(Number.isFinite(h))return sb(h,1/0)}}catch{}return ip}),r=x.useCallback(d=>{try{localStorage.setItem(nb,String(d))}catch{}},[]),c=x.useCallback((d,h)=>{const m=sb(d,h);l(g=>g===m?g:(r(m),m))},[r]),o=x.useCallback(()=>{l(ip),r(ip)},[r]);return{height:n,setHeight:c,reset:o}}function wf(n){const[l,r]=x.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return x.useEffect(()=>{const c=window.matchMedia(n),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),l}const Vv=500,Qv=6;function J_({onLongPress:n,onClick:l,disabled:r=!1,thresholdMs:c=Vv,moveCancelPx:o=Qv}){const d=x.useRef(null),[h,m]=x.useState(!1),g=x.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=x.useCallback(C=>{if(r||C.button!==0)return;const A={timer:0,x:C.clientX,y:C.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,m(!1),n()},c),d.current=A,m(!0)},[r,c,n]),y=x.useCallback(C=>{const A=d.current;!A||A.fired||Math.hypot(C.clientX-A.x,C.clientY-A.y)>o&&g()},[o,g]),j=x.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=x.useCallback(C=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,C.preventDefault();return}if(!r){if(C.shiftKey){n();return}l()}},[r,l,n]),S=x.useCallback(C=>{C.preventDefault()},[]),k=x.useCallback(C=>{r||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),n())},[r,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:S,onKeyDown:k}}}const Kv={height:0,offsetTop:0,offsetLeft:0};function lb(){if(typeof window>"u")return Kv;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Fv(n){const[l,r]=x.useState(lb);return x.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const d=lb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[n]),l}function Gp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var tc=Gp();function W_(n){tc=n}var Yr={exec:()=>null};function Zc(n){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=n(c),l[c]=o),o}}function kt(n,l=""){let r=typeof n=="string"?n:n.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(ws.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Zv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),ws={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,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:Zc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Zc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Zc(n=>new RegExp(`^ {0,${n}}>`))},Jv=/^(?:[ \t]*(?:\n|$))+/,Wv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ej=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Yp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,P_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ey=kt(P_).replace(/bull/g,Yp).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tj=kt(P_).replace(/bull/g,Yp).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Xp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,nj=/^[^\n]+/,Vp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,sj=kt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lj=kt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Yp).getRegex(),kf="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",Qp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,aj=kt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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",Qp).replace("tag",kf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ty=n=>kt(Xp).replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kf).getRegex(),ij=ty(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),rj=ty(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),cj=kt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rj).getRegex(),Kp={blockquote:cj,code:Wv,def:sj,fences:Pv,heading:ej,hr:Mu,html:aj,lheading:ey,list:lj,newline:Jv,paragraph:ij,table:Yr,text:nj},ab=kt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kf).getRegex(),oj={...Kp,lheading:tj,table:ab,paragraph:kt(Xp).replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ab).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",kf).getRegex()},uj={...Kp,html:kt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qp).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:Yr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kt(Xp).replace("hr",Mu).replace("heading",` *#{1,6} *[^
|
|
52
|
+
]`).replace("lheading",ey).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},dj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ny=/^( {2,}|\\)\n(?!\s*$)/,hj=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bo=/[\p{P}\p{S}]/u,Sf=/[\s\p{P}\p{S}]/u,Fp=/[^\s\p{P}\p{S}]/u,pj=kt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sf).getRegex(),sy=/(?!~)[\p{P}\p{S}]/u,mj=/(?!~)[\s\p{P}\p{S}]/u,gj=/(?:[^\s\p{P}\p{S}]|~)/u,xj=kt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Zv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ly=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,bj=kt(ly,"u").replace(/punct/g,bo).getRegex(),_j=kt(ly,"u").replace(/punct/g,sy).getRegex(),ay="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yj=kt(ay,"gu").replace(/notPunctSpace/g,Fp).replace(/punctSpace/g,Sf).replace(/punct/g,bo).getRegex(),vj=kt(ay,"gu").replace(/notPunctSpace/g,gj).replace(/punctSpace/g,mj).replace(/punct/g,sy).getRegex(),jj=kt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Fp).replace(/punctSpace/g,Sf).replace(/punct/g,bo).getRegex(),Nj=kt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bo).getRegex(),wj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",kj=kt(wj,"gu").replace(/notPunctSpace/g,Fp).replace(/punctSpace/g,Sf).replace(/punct/g,bo).getRegex(),Sj=kt(/\\(punct)/,"gu").replace(/punct/g,bo).getRegex(),Ej=kt(/^<(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(),Tj=kt(Qp).replace("(?:-->|$)","-->").getRegex(),Cj=kt("^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",Tj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Aj=kt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",hf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iy=kt(/^!?\[(label)\]\[(ref)\]/).replace("label",hf).replace("ref",Vp).getRegex(),ry=kt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vp).getRegex(),Mj=kt("reflink|nolink(?!\\()","g").replace("reflink",iy).replace("nolink",ry).getRegex(),ib=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zp={_backpedal:Yr,anyPunctuation:Sj,autolink:Ej,blockSkip:xj,br:ny,code:fj,del:Yr,delLDelim:Yr,delRDelim:Yr,emStrongLDelim:bj,emStrongRDelimAst:yj,emStrongRDelimUnd:jj,escape:dj,link:Aj,nolink:ry,punctuation:pj,reflink:iy,reflinkSearch:Mj,tag:Cj,text:hj,url:Yr},Rj={...Zp,link:kt(/^!?\[(label)\]\((.*?)\)/).replace("label",hf).getRegex(),reflink:kt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hf).getRegex()},Sp={...Zp,emStrongRDelimAst:vj,emStrongLDelim:_j,delLDelim:Nj,delRDelim:kj,url:kt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ib).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:kt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ib).getRegex()},Dj={...Sp,br:kt(ny).replace("{2,}","*").getRegex(),text:kt(Sp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Hd={normal:Kp,gfm:oj,pedantic:uj},pu={normal:Zp,gfm:Sp,breaks:Dj,pedantic:Rj},Oj={"&":"&","<":"<",">":">",'"':""","'":"'"},rb=n=>Oj[n];function Sa(n,l){if(l){if(ws.escapeTest.test(n))return n.replace(ws.escapeReplace,rb)}else if(ws.escapeTestNoEncode.test(n))return n.replace(ws.escapeReplaceNoEncode,rb);return n}function cb(n){try{n=encodeURI(n).replace(ws.percentDecode,"%")}catch{return null}return n}function ob(n,l){var d;let r=n.replace(ws.findPipe,(h,m,g)=>{let b=!1,y=m;for(;--y>=0&&g[y]==="\\";)b=!b;return b?"|":" |"}),c=r.split(ws.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(ws.slashPipe,"|");return c}function ar(n,l,r){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===l;)o++;return n.slice(0,c-o)}function ub(n){let l=n.split(`
|
|
53
|
+
`),r=l.length-1;for(;r>=0&&ws.blankLine.test(l[r]);)r--;return l.length-r<=2?n:l.slice(0,r+1).join(`
|
|
54
|
+
`)}function Lj(n,l){if(n.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===l[0])r++;else if(n[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function zj(n,l=0){let r=l,c="";for(let o of n)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function db(n,l,r,c,o){let d=l.href,h=l.title||null,m=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Uj(n,l,r){let c=n.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
+
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
+
`)}var pf=class{constructor(n){Ft(this,"options");Ft(this,"rules");Ft(this,"lexer");this.options=n||tc}space(n){let l=this.rules.block.newline.exec(n);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(n){let l=this.rules.block.code.exec(n);if(l){let r=this.options.pedantic?l[0]:ub(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(n){let l=this.rules.block.fences.exec(n);if(l){let r=l[0],c=Uj(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(n){let l=this.rules.block.heading.exec(n);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=ar(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:ar(l[0],`
|
|
57
|
+
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let l=this.rules.block.hr.exec(n);if(l)return{type:"hr",raw:ar(l[0],`
|
|
58
|
+
`)}}blockquote(n){let l=this.rules.block.blockquote.exec(n);if(l){let r=ar(l[0],`
|
|
59
|
+
`).split(`
|
|
60
|
+
`),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let b=m.join(`
|
|
61
|
+
`),y=b.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
+
${b}`:b,o=o?`${o}
|
|
64
|
+
${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let S=v,k=S.raw+`
|
|
65
|
+
`+r.join(`
|
|
66
|
+
`),C=this.blockquote(k);d[d.length-1]=C,c=c.substring(0,c.length-S.raw.length)+C.raw,o=o.substring(0,o.length-S.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){let S=v,k=S.raw+`
|
|
67
|
+
`+r.join(`
|
|
68
|
+
`),C=this.list(k);d[d.length-1]=C,c=c.substring(0,c.length-v.raw.length)+C.raw,o=o.substring(0,o.length-S.raw.length)+C.raw,r=k.substring(d.at(-1).raw.length).split(`
|
|
69
|
+
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(n){let l=this.rules.block.list.exec(n);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;n;){let g=!1,b="",y="";if(!(l=d.exec(n))||this.rules.block.hr.test(n))break;b=l[0],n=n.substring(b.length);let j=zj(l[2].split(`
|
|
70
|
+
`,1)[0],l[1].length),v=n.split(`
|
|
71
|
+
`,1)[0],S=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):S?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=l[1].length),S&&this.rules.other.blankLine.test(v)&&(b+=v+`
|
|
72
|
+
`,n=n.substring(v.length+1),g=!0),!g){let C=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),Q=this.rules.other.fencesBeginRegex(k),V=this.rules.other.headingBeginRegex(k),$=this.rules.other.htmlBeginRegex(k),B=this.rules.other.blockquoteBeginRegex(k);for(;n;){let Y=n.split(`
|
|
73
|
+
`,1)[0],M;if(v=Y,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),Q.test(v)||V.test(v)||$.test(v)||B.test(v)||C.test(v)||A.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
|
|
74
|
+
`+M.slice(k);else{if(S||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(j)||V.test(j)||A.test(j))break;y+=`
|
|
75
|
+
`+v}S=!v.trim(),b+=Y+`
|
|
76
|
+
`,n=n.substring(Y.length+1),j=M.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=b}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let y=g.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(n){let l=this.rules.block.html.exec(n);if(l){let r=ub(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(n){let l=this.rules.block.def.exec(n);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:ar(l[0],`
|
|
77
|
+
`),href:c,title:o}}}table(n){var h;let l=this.rules.block.table.exec(n);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=ob(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
+
`):[],d={type:"table",raw:ar(l[0],`
|
|
79
|
+
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(ob(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(n){let l=this.rules.block.lheading.exec(n);if(l){let r=l[1].trim();return{type:"heading",raw:ar(l[0],`
|
|
80
|
+
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let l=this.rules.block.paragraph.exec(n);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
+
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let l=this.rules.block.text.exec(n);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(n){let l=this.rules.inline.escape.exec(n);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(n){let l=this.rules.inline.tag.exec(n);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(n){let l=this.rules.inline.link.exec(n);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=ar(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Lj(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),db(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(n,l){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return db(r,o,r[0],this.lexer,this.rules)}}emStrong(n,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,l=l.slice(-1*n.length+o);(c=b.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=n.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let S=j.slice(1,-1);return{type:"em",raw:j,text:S,tokens:this.lexer.inlineTokens(S)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let l=this.rules.inline.code.exec(n);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(n){let l=this.rules.inline.br.exec(n);if(l)return{type:"br",raw:l[0]}}del(n,l,r=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,l=l.slice(-1*n.length+o);(c=g.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,y=n.slice(0,o+c.index+b+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(n){let l=this.rules.inline.autolink.exec(n);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let l;if(l=this.rules.inline.url.exec(n)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let l=this.rules.inline.text.exec(n);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},ea=class Ep{constructor(l){Ft(this,"tokens");Ft(this,"options");Ft(this,"state");Ft(this,"inlineQueue");Ft(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||tc,this.options.tokenizer=this.options.tokenizer||new pf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:ws,block:Hd.normal,inline:pu.normal};this.options.pedantic?(r.block=Hd.pedantic,r.inline=pu.pedantic):this.options.gfm&&(r.block=Hd.gfm,this.options.breaks?r.inline=pu.breaks:r.inline=pu.gfm),this.tokenizer.rules=r}static get rules(){return{block:Hd,inline:pu}}static lex(l,r){return new Ep(r).lex(l)}static lexInline(l,r){return new Ep(r).inlineTokens(l)}lex(l){l=l.replace(ws.carriageReturn,`
|
|
82
|
+
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(ws.tabCharGlobal," ").replace(ws.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(g=y.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
|
|
83
|
+
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
84
|
+
`)?"":`
|
|
85
|
+
`)+g.raw,y.text+=`
|
|
86
|
+
`+g.text,this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(g=this.tokenizer.fences(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
87
|
+
`)?"":`
|
|
88
|
+
`)+g.raw,y.text+=`
|
|
89
|
+
`+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let b=l;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(S=>{v=S.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(b=l.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(b))){let y=r.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
|
|
90
|
+
`)?"":`
|
|
91
|
+
`)+g.raw,y.text+=`
|
|
92
|
+
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g),c=b.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
93
|
+
`)?"":`
|
|
94
|
+
`)+g.raw,y.text+=`
|
|
95
|
+
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var m,g,b,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>v.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,S,k)=>{let C=k?k.length:0;return v.slice(0,C)+"["+"a".repeat(v.length-C-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(b=this.options.extensions)==null?void 0:b.inline)!=null&&y.some(k=>(v=k.call({lexer:this},l,r))?(l=l.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let k=r.at(-1);v.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),r.push(v);continue}let S=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,C=l.slice(1),A;this.options.extensions.startInline.forEach(Q=>{A=Q.call({lexer:this},C),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(S=l.substring(0,k+1))}if(v=this.tokenizer.inlineText(S)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},mf=class{constructor(n){Ft(this,"options");Ft(this,"parser");this.options=n||tc}space(n){return""}code({text:n,lang:l,escaped:r}){var d;let c=(d=(l||"").match(ws.notSpaceStart))==null?void 0:d[0],o=n.replace(ws.endingNewline,"")+`
|
|
96
|
+
`;return c?'<pre><code class="language-'+Sa(c)+'">'+(r?o:Sa(o,!0))+`</code></pre>
|
|
97
|
+
`:"<pre><code>"+(r?o:Sa(o,!0))+`</code></pre>
|
|
98
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
99
|
+
${this.parser.parse(n)}</blockquote>
|
|
100
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:l}){return`<h${l}>${this.parser.parseInline(n)}</h${l}>
|
|
101
|
+
`}hr(n){return`<hr>
|
|
102
|
+
`}list(n){let l=n.ordered,r=n.start,c="";for(let h=0;h<n.items.length;h++){let m=n.items[h];c+=this.listitem(m)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
+
`+c+"</"+o+`>
|
|
104
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
105
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
106
|
+
`}table(n){let l="",r="";for(let o=0;o<n.header.length;o++)r+=this.tablecell(n.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<n.rows.length;o++){let d=n.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
+
<thead>
|
|
108
|
+
`+l+`</thead>
|
|
109
|
+
`+c+`</table>
|
|
110
|
+
`}tablerow({text:n}){return`<tr>
|
|
111
|
+
${n}</tr>
|
|
112
|
+
`}tablecell(n){let l=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+l+`</${r}>
|
|
113
|
+
`}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>${Sa(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:l,tokens:r}){let c=this.parser.parseInline(r),o=cb(n);if(o===null)return c;n=o;let d='<a href="'+n+'"';return l&&(d+=' title="'+Sa(l)+'"'),d+=">"+c+"</a>",d}image({href:n,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=cb(n);if(o===null)return Sa(r);n=o;let d=`<img src="${n}" alt="${Sa(r)}"`;return l&&(d+=` title="${Sa(l)}"`),d+=">",d}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:Sa(n.text)}},Jp=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""}checkbox({raw:n}){return n}},ta=class Tp{constructor(l){Ft(this,"options");Ft(this,"renderer");Ft(this,"textRenderer");this.options=l||tc,this.options.renderer=this.options.renderer||new mf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jp}static parse(l,r){return new Tp(r).parse(l)}static parseInline(l,r){return new Tp(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(l,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let m=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";continue}}let g=m;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},tf,yu=(tf=class{constructor(n){Ft(this,"options");Ft(this,"block");this.options=n||tc}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?ea.lex:ea.lexInline}provideParser(n=this.block){return n?ta.parse:ta.parseInline}},Ft(tf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ft(tf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),tf),Ij=class{constructor(...n){Ft(this,"defaults",Gp());Ft(this,"options",this.setOptions);Ft(this,"parse",this.parseMarkdown(!0));Ft(this,"parseInline",this.parseMarkdown(!1));Ft(this,"Parser",ta);Ft(this,"Renderer",mf);Ft(this,"TextRenderer",Jp);Ft(this,"Lexer",ea);Ft(this,"Tokenizer",pf);Ft(this,"Hooks",yu);this.use(...n)}walkTokens(n,l){var c,o;let r=[];for(let d of n)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,l));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...n){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new mf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...b)=>{let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new pf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...b)=>{let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new yu;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];yu.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&yu.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let y=m.call(o,b);return g.call(o,y)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,l){return ea.lex(n,l??this.defaults)}parser(n,l){return ta.parse(n,l??this.defaults)}parseMarkdown(n){return(l,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,m=await(o.hooks?await o.hooks.provideLexer(n):n?ea.lex:ea.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(n):n?ta.parse:ta.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(n):n?ea.lex:ea.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(n):n?ta.parse:ta.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(n,l){return r=>{if(r.message+=`
|
|
114
|
+
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+Sa(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},ec=new Ij;function Bt(n,l){return ec.parse(n,l)}Bt.options=Bt.setOptions=function(n){return ec.setOptions(n),Bt.defaults=ec.defaults,W_(Bt.defaults),Bt};Bt.getDefaults=Gp;Bt.defaults=tc;Bt.use=function(...n){return ec.use(...n),Bt.defaults=ec.defaults,W_(Bt.defaults),Bt};Bt.walkTokens=function(n,l){return ec.walkTokens(n,l)};Bt.parseInline=ec.parseInline;Bt.Parser=ta;Bt.parser=ta.parse;Bt.Renderer=mf;Bt.TextRenderer=Jp;Bt.Lexer=ea;Bt.lexer=ea.lex;Bt.Tokenizer=pf;Bt.Hooks=yu;Bt.parse=Bt;Bt.options;Bt.setOptions;Bt.use;Bt.walkTokens;Bt.parseInline;ta.parse;ea.lex;/*! @license DOMPurify 3.4.12 | (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.12/LICENSE */function fb(n,l){(l==null||l>n.length)&&(l=n.length);for(var r=0,c=Array(l);r<l;r++)c[r]=n[r];return c}function Bj(n){if(Array.isArray(n))return n}function Hj(n,l){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(n)).next,l!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==l);g=!0);}catch(y){b=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function $j(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qj(n,l){return Bj(n)||Hj(n,l)||Gj(n,l)||$j()}function Gj(n,l){if(n){if(typeof n=="string")return fb(n,l);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fb(n,l):void 0}}const cy=Object.entries,hb=Object.setPrototypeOf,Yj=Object.isFrozen,Xj=Object.getPrototypeOf,Vj=Object.getOwnPropertyDescriptor;let ps=Object.freeze,ms=Object.seal,Pc=Object.create,oy=typeof Reflect<"u"&&Reflect,Cp=oy.apply,Ap=oy.construct;ps||(ps=function(l){return l});ms||(ms=function(l){return l});Cp||(Cp=function(l,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(r,o)});Ap||(Ap=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const Jc=Kn(Array.prototype.forEach),Qj=Kn(Array.prototype.lastIndexOf),pb=Kn(Array.prototype.pop),Wc=Kn(Array.prototype.push),Kj=Kn(Array.prototype.splice),fr=Array.isArray,vu=Kn(String.prototype.toLowerCase),rp=Kn(String.prototype.toString),mb=Kn(String.prototype.match),mu=Kn(String.prototype.replace),gb=Kn(String.prototype.indexOf),Fj=Kn(String.prototype.trim),Zj=Kn(Number.prototype.toString),Jj=Kn(Boolean.prototype.toString),xb=typeof BigInt>"u"?null:Kn(BigInt.prototype.toString),bb=typeof Symbol>"u"?null:Kn(Symbol.prototype.toString),is=Kn(Object.prototype.hasOwnProperty),gu=Kn(Object.prototype.toString),as=Kn(RegExp.prototype.test),Br=Wj(TypeError);function Kn(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return Cp(n,l,c)}}function Wj(n){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Ap(n,r)}}function wt(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vu;if(hb&&hb(n,null),!fr(l))return n;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(Yj(l)||(l[c]=d),o=d)}n[o]=!0}return n}function Pj(n){for(let l=0;l<n.length;l++)is(n,l)||(n[l]=null);return n}function Os(n){const l=Pc(null);for(const c of cy(n)){var r=qj(c,2);const o=r[0],d=r[1];is(n,o)&&(fr(d)?l[o]=Pj(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=Os(d):l[o]=d)}return l}function e1(n){switch(typeof n){case"string":return n;case"number":return Zj(n);case"boolean":return Jj(n);case"bigint":return xb?xb(n):"0";case"symbol":return bb?bb(n):"Symbol()";case"undefined":return gu(n);case"function":case"object":{if(n===null)return gu(n);const l=n,r=Ea(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:gu(c)}return gu(n)}default:return gu(n)}}function Ea(n,l){for(;n!==null;){const c=Vj(n,l);if(c){if(c.get)return Kn(c.get);if(typeof c.value=="function")return Kn(c.value)}n=Xj(n)}function r(){return null}return r}function t1(n){try{return as(n,""),!0}catch{return!1}}const _b=ps(["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"]),cp=ps(["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"]),op=ps(["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"]),n1=ps(["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"]),up=ps(["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"]),s1=ps(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yb=ps(["#text"]),vb=ps(["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"]),dp=ps(["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"]),jb=ps(["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"]),$d=ps(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),l1=ms(/{{[\w\W]*|^[\w\W]*}}/g),a1=ms(/<%[\w\W]*|^[\w\W]*%>/g),i1=ms(/\${[\w\W]*/g),r1=ms(/^data-[\-\w.\u00B7-\uFFFF]+$/),c1=ms(/^aria-[\-\w]+$/),Nb=ms(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),o1=ms(/^(?:\w+script|data):/i),u1=ms(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),d1=ms(/^html$/i),f1=ms(/^[a-z][.\w]*(-[.\w]+)+$/i),wb=ms(/<[/\w!]/g),kb=ms(/<[/\w]/g),h1=ms(/<\/no(script|embed|frames)/i),p1=ms(/\/>/i),gl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},m1=function(){return typeof window>"u"?null:window},g1=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Sb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ir=function(l,r,c,o){return is(l,r)&&fr(l[r])?wt(o.base?Os(o.base):{},l[r],o.transform):c};function uy(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m1();const l=ve=>uy(ve);if(l.version="3.4.12",l.removed=[],!n||!n.document||n.document.nodeType!==gl.document||!n.Element)return l.isSupported=!1,l;let r=n.document;const c=r,o=c.currentScript;n.DocumentFragment;const d=n.HTMLTemplateElement,h=n.Node,m=n.Element,g=n.NodeFilter,b=n.NamedNodeMap;b===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,j=n.trustedTypes,v=m.prototype,S=Ea(v,"cloneNode"),k=Ea(v,"remove"),C=Ea(v,"nextSibling"),A=Ea(v,"childNodes"),Q=Ea(v,"parentNode"),V=Ea(v,"shadowRoot"),$=Ea(v,"attributes"),B=h&&h.prototype?Ea(h.prototype,"nodeType"):null,Y=h&&h.prototype?Ea(h.prototype,"nodeName"):null;if(typeof d=="function"){const ve=r.createElement("template");ve.content&&ve.content.ownerDocument&&(r=ve.content.ownerDocument)}let M,z="",R,K=!1,ie=0;const q=function(){if(ie>0)throw Br('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.')},H=function(T){q(),ie++;try{return M.createHTML(T)}finally{ie--}},fe=function(T){q(),ie++;try{return M.createScriptURL(T)}finally{ie--}},je=function(){return K||(R=g1(j,o),K=!0),R},Z=r,L=Z.implementation,U=Z.createNodeIterator,oe=Z.createDocumentFragment,pe=Z.getElementsByTagName,we=c.importNode;let E=Sb();l.isSupported=typeof cy=="function"&&typeof Q=="function"&&L&&L.createHTMLDocument!==void 0;const P=l1,me=a1,ke=i1,G=r1,Se=c1,le=o1,Ge=u1,Re=f1;let qt=Nb,Xe=null;const nn=wt({},[..._b,...cp,...op,...up,...yb]);let Pe=null;const dt=wt({},[...vb,...dp,...jb,...$d]);let st=Object.seal(Pc(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}})),vt=null,gs=null;const gt=Object.seal(Pc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let lt=!0,Te=!0,et=!1,jt=!0,ot=!1,Ze=!0,zt=!1,rs=!1,Tt=null,sn=null,Fn=!1,_n=!1,An=!1,xs=!1,ln=!0,St=!1;const Zn="user-content-";let Gt=!0,Jn=!1,ue={},Ne=null;const Ve=wt({},["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 at=null;const We=wt({},["audio","video","img","source","image","track"]);let ft=null;const X=wt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",De="http://www.w3.org/2000/svg",He="http://www.w3.org/1999/xhtml";let Yt=He,ts=!1,Ls=null;const el=wt({},[ge,De,He],rp),xl=ps(["mi","mo","mn","ms","mtext"]);let Ol=wt({},xl);const zs=ps(["annotation-xml"]);let bs=wt({},zs);const ns=wt({},["title","style","font","a","script"]);let zn=null;const yn=["application/xhtml+xml","text/html"],rn="text/html";let Je=null,Mn=null;const tl=r.createElement("form"),bl=function(T){return T instanceof RegExp||T instanceof Function},sa=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Mn&&Mn===T)return;(!T||typeof T!="object")&&(T={}),T=Os(T),zn=yn.indexOf(T.PARSER_MEDIA_TYPE)===-1?rn:T.PARSER_MEDIA_TYPE,Je=zn==="application/xhtml+xml"?rp:vu,Xe=ir(T,"ALLOWED_TAGS",nn,{transform:Je}),Pe=ir(T,"ALLOWED_ATTR",dt,{transform:Je}),Ls=ir(T,"ALLOWED_NAMESPACES",el,{transform:rp}),ft=ir(T,"ADD_URI_SAFE_ATTR",X,{transform:Je,base:X}),at=ir(T,"ADD_DATA_URI_TAGS",We,{transform:Je,base:We}),Ne=ir(T,"FORBID_CONTENTS",Ve,{transform:Je}),vt=ir(T,"FORBID_TAGS",Os({}),{transform:Je}),gs=ir(T,"FORBID_ATTR",Os({}),{transform:Je}),ue=is(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Os(T.USE_PROFILES):T.USE_PROFILES:!1,lt=T.ALLOW_ARIA_ATTR!==!1,Te=T.ALLOW_DATA_ATTR!==!1,et=T.ALLOW_UNKNOWN_PROTOCOLS||!1,jt=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ot=T.SAFE_FOR_TEMPLATES||!1,Ze=T.SAFE_FOR_XML!==!1,zt=T.WHOLE_DOCUMENT||!1,_n=T.RETURN_DOM||!1,An=T.RETURN_DOM_FRAGMENT||!1,xs=T.RETURN_TRUSTED_TYPE||!1,Fn=T.FORCE_BODY||!1,ln=T.SANITIZE_DOM!==!1,St=T.SANITIZE_NAMED_PROPS||!1,Gt=T.KEEP_CONTENT!==!1,Jn=T.IN_PLACE||!1,qt=t1(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Nb,Yt=typeof T.NAMESPACE=="string"?T.NAMESPACE:He,Ol=is(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?Os(T.MATHML_TEXT_INTEGRATION_POINTS):wt({},xl),bs=is(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?Os(T.HTML_INTEGRATION_POINTS):wt({},zs);const W=is(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?Os(T.CUSTOM_ELEMENT_HANDLING):Pc(null);if(st=Pc(null),is(W,"tagNameCheck")&&bl(W.tagNameCheck)&&(st.tagNameCheck=W.tagNameCheck),is(W,"attributeNameCheck")&&bl(W.attributeNameCheck)&&(st.attributeNameCheck=W.attributeNameCheck),is(W,"allowCustomizedBuiltInElements")&&typeof W.allowCustomizedBuiltInElements=="boolean"&&(st.allowCustomizedBuiltInElements=W.allowCustomizedBuiltInElements),ms(st),ot&&(Te=!1),An&&(_n=!0),ue&&(Xe=wt({},yb),Pe=Pc(null),ue.html===!0&&(wt(Xe,_b),wt(Pe,vb)),ue.svg===!0&&(wt(Xe,cp),wt(Pe,dp),wt(Pe,$d)),ue.svgFilters===!0&&(wt(Xe,op),wt(Pe,dp),wt(Pe,$d)),ue.mathMl===!0&&(wt(Xe,up),wt(Pe,jb),wt(Pe,$d))),gt.tagCheck=null,gt.attributeCheck=null,is(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?gt.tagCheck=T.ADD_TAGS:fr(T.ADD_TAGS)&&(Xe===nn&&(Xe=Os(Xe)),wt(Xe,T.ADD_TAGS,Je))),is(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?gt.attributeCheck=T.ADD_ATTR:fr(T.ADD_ATTR)&&(Pe===dt&&(Pe=Os(Pe)),wt(Pe,T.ADD_ATTR,Je))),is(T,"ADD_URI_SAFE_ATTR")&&fr(T.ADD_URI_SAFE_ATTR)&&wt(ft,T.ADD_URI_SAFE_ATTR,Je),is(T,"FORBID_CONTENTS")&&fr(T.FORBID_CONTENTS)&&(Ne===Ve&&(Ne=Os(Ne)),wt(Ne,T.FORBID_CONTENTS,Je)),is(T,"ADD_FORBID_CONTENTS")&&fr(T.ADD_FORBID_CONTENTS)&&(Ne===Ve&&(Ne=Os(Ne)),wt(Ne,T.ADD_FORBID_CONTENTS,Je)),Gt&&(Xe["#text"]=!0),zt&&wt(Xe,["html","head","body"]),Xe.table&&(wt(Xe,["tbody"]),delete vt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Br('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _e=M;M=T.TRUSTED_TYPES_POLICY;try{z=H("")}catch(Le){throw M=_e,Le}}else T.TRUSTED_TYPES_POLICY===null?(M=void 0,z=""):(M===void 0&&(M=je()),M&&typeof z=="string"&&(z=H("")));ps&&ps(T),Mn=T},Ll=wt({},[...cp,...op,...n1]),Us=wt({},[...up,...s1]),cs=function(T,W,_e){return W.namespaceURI===He?T==="svg":W.namespaceURI===ge?T==="svg"&&(_e==="annotation-xml"||Ol[_e]):!!Ll[T]},Ss=function(T,W,_e){return W.namespaceURI===He?T==="math":W.namespaceURI===De?T==="math"&&bs[_e]:!!Us[T]},nl=function(T,W,_e){return W.namespaceURI===De&&!bs[_e]||W.namespaceURI===ge&&!Ol[_e]?!1:!Us[T]&&(ns[T]||!Ll[T])},zl=function(T){let W=Q(T);(!W||!W.tagName)&&(W={namespaceURI:Yt,tagName:"template"});const _e=vu(T.tagName),Le=vu(W.tagName);return Ls[T.namespaceURI]?T.namespaceURI===De?cs(_e,W,Le):T.namespaceURI===ge?Ss(_e,W,Le):T.namespaceURI===He?nl(_e,W,Le):!!(zn==="application/xhtml+xml"&&Ls[T.namespaceURI]):!1},Un=function(T){Wc(l.removed,{element:T});try{Q(T).removeChild(T)}catch{if(k(T),!Q(T))throw Br("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Xt=function(T){Es(T);const W=A(T);if(W){const Le=[];Jc(W,$e=>{Wc(Le,$e)}),Jc(Le,$e=>{try{k($e)}catch{}})}const _e=$(T);if(_e)for(let Le=_e.length-1;Le>=0;--Le){const $e=_e[Le],Ie=$e&&$e.name;if(typeof Ie=="string")try{T.removeAttribute(Ie)}catch{}}},Rn=function(T,W){try{Wc(l.removed,{attribute:W.getAttributeNode(T),from:W})}catch{Wc(l.removed,{attribute:null,from:W})}if(W.removeAttribute(T),T==="is")if(_n||An)try{Un(W)}catch{}else try{W.setAttribute(T,"")}catch{}},Dn=function(T){const W=$(T);if(W)for(let _e=W.length-1;_e>=0;--_e){const Le=W[_e],$e=Le&&Le.name;if(!(typeof $e!="string"||Pe[Je($e)]))try{T.removeAttribute($e)}catch{}}},Es=function(T){const W=[T];for(;W.length>0;){const _e=W.pop();(B?B(_e):_e.nodeType)===gl.element&&Dn(_e);const $e=A(_e);if($e)for(let Ie=$e.length-1;Ie>=0;--Ie)W.push($e[Ie])}},os=function(T){if(!Ze)return;const W=[T];for(;W.length>0;){const _e=W.pop(),Le=B?B(_e):_e.nodeType;if(Le===gl.processingInstruction||Le===gl.comment&&as(kb,_e.data)){try{k(_e)}catch{}continue}if(Le===gl.element){const Ie=_e,At=Je(Y?Y(_e):_e.nodeName);try{Ie.hasAttribute&&Ie.hasAttribute("patchsrc")&&Ie.removeAttribute("patchsrc"),Ie.hasAttribute&&Ie.hasAttribute("for")&&At!=="label"&&At!=="output"&&Ie.removeAttribute("for")}catch{}}const $e=A(_e);if($e)for(let Ie=$e.length-1;Ie>=0;--Ie)W.push($e[Ie])}},La=function(T){let W=null,_e=null;if(Fn)T="<remove></remove>"+T;else{const Ie=mb(T,/^[\r\n\t ]+/);_e=Ie&&Ie[0]}zn==="application/xhtml+xml"&&Yt===He&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const Le=M?H(T):T;if(Yt===He)try{W=new y().parseFromString(Le,zn)}catch{}if(!W||!W.documentElement){W=L.createDocument(Yt,"template",null);try{W.documentElement.innerHTML=ts?z:Le}catch{}}const $e=W.body||W.documentElement;return T&&_e&&$e.insertBefore(r.createTextNode(_e),$e.childNodes[0]||null),Yt===He?pe.call(W,zt?"html":"body")[0]:zt?W.documentElement:$e},Ts=function(T){return U.call(T.ownerDocument||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},In=function(T){return T=mu(T,P," "),T=mu(T,me," "),T=mu(T,ke," "),T},_l=function(T){var W;T.normalize();const _e=U.call(T.ownerDocument||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Le=_e.nextNode();for(;Le;)Le.data=In(Le.data),Le=_e.nextNode();const $e=(W=T.querySelectorAll)===null||W===void 0?void 0:W.call(T,"template");$e&&Jc($e,Ie=>{Bn(Ie.content)&&_l(Ie.content)})},ss=function(T){const W=Y?Y(T):null;return typeof W!="string"||Je(W)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==$(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==B(T)||T.childNodes!==A(T)},Bn=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return B(T)===gl.documentFragment}catch{return!1}},it=function(T){if(!B||typeof T!="object"||T===null)return!1;try{return typeof B(T)=="number"}catch{return!1}};function Ut(ve,T,W){ve.length!==0&&Jc(ve,_e=>{_e.call(l,T,W,Mn)})}const vn=function(T,W){return!!(Ze&&T.hasChildNodes()&&!it(T.firstElementChild)&&as(wb,T.textContent)&&as(wb,T.innerHTML)||Ze&&T.namespaceURI===He&&W==="style"&&it(T.firstElementChild)||T.nodeType===gl.processingInstruction||Ze&&T.nodeType===gl.comment&&as(kb,T.data))},Sn=function(T,W){if(!vt[W]&&ll(W)&&(st.tagNameCheck instanceof RegExp&&as(st.tagNameCheck,W)||st.tagNameCheck instanceof Function&&st.tagNameCheck(W)))return!1;if(Gt&&!Ne[W]){const _e=Q(T),Le=A(T);if(Le&&_e){const $e=Le.length;for(let Ie=$e-1;Ie>=0;--Ie){const At=Jn?Le[Ie]:S(Le[Ie],!0);_e.insertBefore(At,C(T))}}}return Un(T),!0},yl=function(T,W){if(Ut(E.beforeSanitizeElements,T,null),T!==W&&Q(T)===null)return!0;if(ss(T))return Un(T),!0;const _e=Je(Y?Y(T):T.nodeName);if(Ut(E.uponSanitizeElement,T,{tagName:_e,allowedTags:Xe}),T!==W&&Q(T)===null)return!0;if(vn(T,_e))return Un(T),!0;if(vt[_e]||!(gt.tagCheck instanceof Function&>.tagCheck(_e))&&!Xe[_e]){const $e=Sn(T,_e);return $e===!1&&Ut(E.afterSanitizeElements,T,null),$e}if((B?B(T):T.nodeType)===gl.element&&!zl(T)||(_e==="noscript"||_e==="noembed"||_e==="noframes")&&as(h1,T.innerHTML))return Un(T),!0;if(ot&&T.nodeType===gl.text){const $e=In(T.textContent);T.textContent!==$e&&(Wc(l.removed,{element:T.cloneNode()}),T.textContent=$e)}return Ut(E.afterSanitizeElements,T,null),!1},sl=function(T,W,_e){if(gs[W]||Ze&&W==="patchsrc"||Ze&&W==="for"&&T!=="label"&&T!=="output"||ln&&(W==="id"||W==="name")&&(_e in r||_e in tl))return!1;const Le=Pe[W]||gt.attributeCheck instanceof Function&>.attributeCheck(W,T);if(!(Te&&as(G,W))){if(!(lt&&as(Se,W))){if(Le){if(!ft[W]){if(!as(qt,mu(_e,Ge,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&T!=="script"&&gb(_e,"data:")===0&&at[T])){if(!(et&&!as(le,mu(_e,Ge,"")))){if(_e)return!1}}}}}else if(!(ll(T)&&(st.tagNameCheck instanceof RegExp&&as(st.tagNameCheck,T)||st.tagNameCheck instanceof Function&&st.tagNameCheck(T))&&(st.attributeNameCheck instanceof RegExp&&as(st.attributeNameCheck,W)||st.attributeNameCheck instanceof Function&&st.attributeNameCheck(W,T))||W==="is"&&st.allowCustomizedBuiltInElements&&(st.tagNameCheck instanceof RegExp&&as(st.tagNameCheck,_e)||st.tagNameCheck instanceof Function&&st.tagNameCheck(_e))))return!1}}return!0},Wn=wt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ll=function(T){return!Wn[vu(T)]&&as(Re,T)},Vt=function(T,W,_e,Le){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!_e)switch(j.getAttributeType(T,W)){case"TrustedHTML":return H(Le);case"TrustedScriptURL":return fe(Le)}return Le},Ul=function(T,W,_e,Le){try{_e?T.setAttributeNS(_e,W,Le):T.setAttribute(W,Le),ss(T)?Un(T):pb(l.removed)}catch{Rn(W,T)}},pn=function(T){Ut(E.beforeSanitizeAttributes,T,null);const W=T.attributes;if(!W||ss(T))return;const _e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let Le=W.length;const $e=Je(T.nodeName);for(;Le--;){const Ie=W[Le],At=Ie.name,xt=Ie.namespaceURI,On=Ie.value,Dt=Je(At),mn=On;let jn=At==="value"?mn:Fj(mn);if(_e.attrName=Dt,_e.attrValue=jn,_e.keepAttr=!0,_e.forceKeepAttr=void 0,Ut(E.uponSanitizeAttribute,T,_e),jn=_e.attrValue,St&&(Dt==="id"||Dt==="name")&&gb(jn,Zn)!==0&&(Rn(At,T),jn=Zn+jn),Ze&&as(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,jn)){Rn(At,T);continue}if(Dt==="attributename"&&mb(jn,"href")){Rn(At,T);continue}if(!_e.forceKeepAttr){if(!_e.keepAttr){Rn(At,T);continue}if(!jt&&as(p1,jn)){Rn(At,T);continue}if(ot&&(jn=In(jn)),!sl($e,Dt,jn)){Rn(At,T);continue}jn=Vt($e,Dt,xt,jn),jn!==mn&&Ul(T,At,xt,jn)}}Ut(E.afterSanitizeAttributes,T,null)},_s=function(T){let W=null;const _e=Ts(T);for(Ut(E.beforeSanitizeShadowDOM,T,null);W=_e.nextNode();)if(Ut(E.uponSanitizeShadowNode,W,null),yl(W,T),pn(W),Bn(W.content)&&_s(W.content),(B?B(W):W.nodeType)===gl.element){const $e=V(W);Bn($e)&&(Ct($e),_s($e))}Ut(E.afterSanitizeShadowDOM,T,null)},Ct=function(T){const W=[{node:T,shadow:null}];for(;W.length>0;){const _e=W.pop();if(_e.shadow){_s(_e.shadow);continue}const Le=_e.node,Ie=(B?B(Le):Le.nodeType)===gl.element,At=A(Le);if(At)for(let xt=At.length-1;xt>=0;--xt)W.push({node:At[xt],shadow:null});if(Ie){const xt=Y?Y(Le):null;if(typeof xt=="string"&&Je(xt)==="template"){const On=Le.content;Bn(On)&&W.push({node:On,shadow:null})}}if(Ie){const xt=V(Le);Bn(xt)&&W.push({node:null,shadow:xt},{node:xt,shadow:null})}}};return l.sanitize=function(ve){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,_e=null,Le=null,$e=null;if(ts=!ve,ts&&(ve="<!-->"),typeof ve!="string"&&!it(ve)&&(ve=e1(ve),typeof ve!="string"))throw Br("dirty is not a string, aborting");if(!l.isSupported)return ve;rs?(Xe=Tt,Pe=sn):sa(T),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Xe=Os(Xe)),E.uponSanitizeAttribute.length>0&&(Pe=Os(Pe)),l.removed=[];const Ie=Jn&&typeof ve!="string"&&it(ve);if(Ie){os(ve);const Dt=Y?Y(ve):ve.nodeName;if(typeof Dt=="string"){const mn=Je(Dt);if(!Xe[mn]||vt[mn])throw Xt(ve),Br("root node is forbidden and cannot be sanitized in-place")}if(ss(ve))throw Xt(ve),Br("root node is clobbered and cannot be sanitized in-place");try{Ct(ve)}catch(mn){throw Xt(ve),mn}}else if(it(ve))W=La("<!---->"),_e=W.ownerDocument.importNode(ve,!0),_e.nodeType===gl.element&&_e.nodeName==="BODY"||_e.nodeName==="HTML"?W=_e:W.appendChild(_e),Ct(_e);else{if(!_n&&!ot&&!zt&&ve.indexOf("<")===-1)return M&&xs?H(ve):ve;if(W=La(ve),!W)return _n?null:xs?z:""}W&&Fn&&Un(W.firstChild);const At=Ie?ve:W,xt=Ts(At);try{for(;Le=xt.nextNode();)yl(Le,At),pn(Le),Bn(Le.content)&&_s(Le.content)}catch(Dt){throw Ie&&(Xt(ve),Jc(l.removed,mn=>{mn.element&&Es(mn.element)})),Dt}if(Ie)return Jc(l.removed,Dt=>{Dt.element&&Es(Dt.element)}),ot&&_l(ve),ve;if(_n){if(ot&&_l(W),An)for($e=oe.call(W.ownerDocument);W.firstChild;)$e.appendChild(W.firstChild);else $e=W;return(Pe.shadowroot||Pe.shadowrootmode)&&($e=we.call(c,$e,!0)),$e}let On=zt?W.outerHTML:W.innerHTML;return zt&&Xe["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&as(d1,W.ownerDocument.doctype.name)&&(On="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
116
|
+
`+On),ot&&(On=In(On)),M&&xs?H(On):On},l.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sa(ve),rs=!0,Tt=Xe,sn=Pe},l.clearConfig=function(){Mn=null,rs=!1,Tt=null,sn=null,M=R,z=""},l.isValidAttribute=function(ve,T,W){Mn||sa({});const _e=Je(ve),Le=Je(T);return sl(_e,Le,W)},l.addHook=function(ve,T){typeof T=="function"&&is(E,ve)&&Wc(E[ve],T)},l.removeHook=function(ve,T){if(is(E,ve)){if(T!==void 0){const W=Qj(E[ve],T);return W===-1?void 0:Kj(E[ve],W,1)[0]}return pb(E[ve])}},l.removeHooks=function(ve){is(E,ve)&&(E[ve]=[])},l.removeAllHooks=function(){E=Sb()},l}var x1=uy();const b1=1024;let _1=0;class Dl{constructor(l,r){this.from=l,this.to=r}}class hn{constructor(l={}){this.id=_1++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=na.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}hn.closedBy=new hn({deserialize:n=>n.split(" ")});hn.openedBy=new hn({deserialize:n=>n.split(" ")});hn.group=new hn({deserialize:n=>n.split(" ")});hn.isolate=new hn({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});hn.contextHash=new hn({perNode:!0});hn.lookAhead=new hn({perNode:!0});hn.mounted=new hn({perNode:!0});class ao{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[hn.mounted.id]}}const y1=Object.create(null);class na{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):y1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new na(l.name||"",r,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(hn.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(hn.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}na.none=new na("",Object.create(null),0,8);class dy{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new na(c.name,o,c.id,c.flags):c)}return new dy(r)}}const qd=new WeakMap,Eb=new WeakMap;var dn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(dn||(dn={}));class Ps{constructor(l,r,c,o,d){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let l=ao.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new gf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=qd.get(this)||this.topNode,d=new gf(o);return d.moveTo(l,r),qd.set(this,d._tree),d}get topNode(){return new ks(this,0,0,null)}resolve(l,r=0){let c=Eu(qd.get(this)||this.topNode,l,r,!1);return qd.set(this,c),c}resolveInner(l,r=0){let c=Eu(Eb.get(this)||this.topNode,l,r,!0);return Eb.set(this,c),c}resolveStack(l,r=0){return N1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,m=(h&dn.IncludeAnonymous)>0;for(let g=this.cursor(h|dn.IncludeAnonymous);;){let b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:em(na.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Ps(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Ps(na.none,r,c,o)))}static build(l){return w1(l)}}Ps.empty=new Ps(na.none,[],[],0);class Wp{constructor(l,r){this.buffer=l,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Wp(this.buffer,this.index)}}class gr{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return na.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=l;g!=r&&!(fy(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let m=l,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-l,h=Math.max(h,b)}return new gr(d,h,this.set)}}function fy(n,l,r,c){switch(n){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function Eu(n,l,r,c){for(var o;n.from==n.to||(r<1?n.from>=l:n.from>l)||(r>-1?n.to<=l:n.to<l);){let h=!c&&n instanceof ks&&n.index<0?null:n.parent;if(!h)return n;n=h}let d=c?0:dn.IgnoreOverlays;if(c)for(let h=n,m=h.parent;m;h=m,m=h.parent)h instanceof ks&&h.index<0&&((o=m.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(n=m);for(;;){let h=n.enter(l,r,d);if(!h)return n;n=h}}class hy{cursor(l=0){return new gf(this,l)}getChild(l,r=null,c=null){let o=Tb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return Tb(this,l,r,c)}resolve(l,r=0){return Eu(this,l,r,!1)}resolveInner(l,r=0){return Eu(this,l,r,!0)}matchContext(l){return Mp(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class ks extends hy{constructor(l,r,c,o){super(),this._tree=l,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;l!=b;l+=r){let y=m[l],j=g[l]+h.from,v;if(!(!(d&dn.EnterBracketed&&y instanceof Ps&&(v=ao.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!fy(o,c,j,j+y.length))){if(y instanceof gr){if(d&dn.ExcludeBuffers)continue;let S=y.findChild(0,y.buffer.length,r,c-j,o);if(S>-1)return new Ma(new v1(h,y,l,j),null,S)}else if(d&dn.IncludeAnonymous||!y.type.isAnonymous||Pp(y)){let S;if(!(d&dn.IgnoreMounts)&&(S=ao.get(y))&&!S.overlay)return new ks(S.tree,j,l,h);let k=new ks(y,j,l,h);return d&dn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&dn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&dn.IgnoreOverlays)&&(o=ao.get(this._tree))&&o.overlay){let d=l-this.from,h=c&dn.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new ks(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Tb(n,l,r,c){let o=n.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function Mp(n,l,r=l.length-1){for(let c=n;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class v1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class Ma extends hy{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return d<0?null:new Ma(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&dn.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return d<0?null:new Ma(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new Ma(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new Ma(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),r.push(0)}return new Ps(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function py(n){if(!n.length)return null;let l=0,r=n[0];for(let d=1;d<n.length;d++){let h=n[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof ks&&r.index<0?null:r.parent,o=n.slice();return c?o[l]=c:o.splice(l,1),new j1(o,r)}class j1{constructor(l,r){this.heads=l,this.node=r}get next(){return py(this.heads)}}function N1(n,l,r){let c=n.resolveInner(l,r),o=null;for(let d=c instanceof ks?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=ao.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let m=new ks(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Eu(m,l,r,!1))}}return o?py(o):c}class gf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~dn.EnterBracketed,l instanceof ks)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof ks?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&dn.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&dn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&dn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let m=c._tree.children[d];if(this.mode&dn.IncludeAnonymous||m instanceof gr||!m.type.isAnonymous||Pp(m))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new Ma(this.buffer,r,this.stack[o]);return this.bufferNode=new Ma(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Mp(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Mp(this._tree,l,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Pp(n){return n.children.some(l=>l instanceof gr||!l.type.isAnonymous||Pp(l))}function w1(n){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=b1,reused:d=[],minRepeatType:h=c.types.length}=n,m=Array.isArray(r)?new Wp(r,r.length):r,g=c.types,b=0,y=0;function j(Y,M,z,R,K,ie){let{id:q,start:H,end:fe,size:je}=m,Z=y,L=b;if(je<0)if(m.next(),je==-1){let E=d[q];z.push(E),R.push(H-Y);return}else if(je==-3){b=q;return}else if(je==-4){y=q;return}else throw new RangeError(`Unrecognized record size: ${je}`);let U=g[q],oe,pe,we=H-Y;if(fe-H<=o&&(pe=A(m.pos-M,K))){let E=new Uint16Array(pe.size-pe.skip),P=m.pos-pe.size,me=E.length;for(;m.pos>P;)me=Q(pe.start,E,me);oe=new gr(E,fe-pe.start,c),we=pe.start-Y}else{let E=m.pos-je;m.next();let P=[],me=[],ke=q>=h?q:-1,G=0,Se=fe;for(;m.pos>E;)ke>=0&&m.id==ke&&m.size>=0?(m.end<=Se-o&&(k(P,me,H,G,m.end,Se,ke,Z,L),G=P.length,Se=m.end),m.next()):ie>2500?v(H,E,P,me):j(H,E,P,me,ke,ie+1);if(ke>=0&&G>0&&G<P.length&&k(P,me,H,G,H,Se,ke,Z,L),P.reverse(),me.reverse(),ke>-1&&G>0){let le=S(U,L);oe=em(U,P,me,0,P.length,0,fe-H,le,le)}else oe=C(U,P,me,fe-H,Z-fe,L)}z.push(oe),R.push(we)}function v(Y,M,z,R){let K=[],ie=0,q=-1;for(;m.pos>M;){let{id:H,start:fe,end:je,size:Z}=m;if(Z>4)m.next();else{if(q>-1&&fe<q)break;q<0&&(q=je-o),K.push(H,fe,je),ie++,m.next()}}if(ie){let H=new Uint16Array(ie*4),fe=K[K.length-2];for(let je=K.length-3,Z=0;je>=0;je-=3)H[Z++]=K[je],H[Z++]=K[je+1]-fe,H[Z++]=K[je+2]-fe,H[Z++]=Z;z.push(new gr(H,K[2]-fe,c)),R.push(fe-Y)}}function S(Y,M){return(z,R,K)=>{let ie=0,q=z.length-1,H,fe;if(q>=0&&(H=z[q])instanceof Ps){if(!q&&H.type==Y&&H.length==K)return H;(fe=H.prop(hn.lookAhead))&&(ie=R[q]+H.length+fe)}return C(Y,z,R,K,ie,M)}}function k(Y,M,z,R,K,ie,q,H,fe){let je=[],Z=[];for(;Y.length>R;)je.push(Y.pop()),Z.push(M.pop()+z-K);Y.push(C(c.types[q],je,Z,ie-K,H-ie,fe)),M.push(K-z)}function C(Y,M,z,R,K,ie,q){if(ie){let H=[hn.contextHash,ie];q=q?[H].concat(q):[H]}if(K>25){let H=[hn.lookAhead,K];q=q?[H].concat(q):[H]}return new Ps(Y,M,z,R,q)}function A(Y,M){let z=m.fork(),R=0,K=0,ie=0,q=z.end-o,H={size:0,start:0,skip:0};e:for(let fe=z.pos-Y;z.pos>fe;){let je=z.size;if(z.id==M&&je>=0){H.size=R,H.start=K,H.skip=ie,ie+=4,R+=4,z.next();continue}let Z=z.pos-je;if(je<0||Z<fe||z.start<q)break;let L=z.id>=h?4:0,U=z.start;for(z.next();z.pos>Z;){if(z.size<0)if(z.size==-3||z.size==-4)L+=4;else break e;else z.id>=h&&(L+=4);z.next()}K=U,R+=je,ie+=L}return(M<0||R==Y)&&(H.size=R,H.start=K,H.skip=ie),H.size>4?H:void 0}function Q(Y,M,z){let{id:R,start:K,end:ie,size:q}=m;if(m.next(),q>=0&&R<h){let H=z;if(q>4){let fe=m.pos-(q-4);for(;m.pos>fe;)z=Q(Y,M,z)}M[--z]=H,M[--z]=ie-Y,M[--z]=K-Y,M[--z]=R}else q==-3?b=R:q==-4&&(y=R);return z}let V=[],$=[];for(;m.pos>0;)j(n.start||0,n.bufferStart||0,V,$,-1,0);let B=(l=n.length)!==null&&l!==void 0?l:V.length?$[0]+V[0].length:0;return new Ps(g[n.topID],V.reverse(),$.reverse(),B)}const Cb=new WeakMap;function rf(n,l){if(!n.isAnonymous||l instanceof gr||l.type!=n)return 1;let r=Cb.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=n||!(c instanceof Ps)){r=1;break}r+=rf(n,c)}Cb.set(l,r)}return r}function em(n,l,r,c,o,d,h,m,g){let b=0;for(let k=c;k<o;k++)b+=rf(n,l[k]);let y=Math.ceil(b*1.5/8),j=[],v=[];function S(k,C,A,Q,V){for(let $=A;$<Q;){let B=$,Y=C[$],M=rf(n,k[$]);for($++;$<Q;$++){let z=rf(n,k[$]);if(M+z>=y)break;M+=z}if($==B+1){if(M>y){let z=k[B];S(z.children,z.positions,0,z.children.length,C[B]+V);continue}j.push(k[B])}else{let z=C[$-1]+k[$-1].length-Y;j.push(em(n,k,C,B,$,Y,z,null,g))}v.push(Y+V-d)}}return S(l,r,c,o,0),(m||g)(j,v,h)}class YE{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof Ma?this.setBuffer(l.context.buffer,l.index,r):l instanceof ks&&this.map.set(l.tree,r)}get(l){return l instanceof Ma?this.getBuffer(l.context.buffer,l.index):l instanceof ks?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Tu{constructor(l,r,c,o,d=!1,h=!1){this.from=l,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,r=[],c=!1){let o=[new Tu(0,l.length,l,0,!1,c)];for(let d of r)d.to>l.length&&o.push(d);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let m=0,g=0,b=0;;m++){let y=m<r.length?r[m]:null,j=y?y.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||b){let S=Math.max(v.from,g)-b,k=Math.min(v.to,j)-b;v=S>=k?null:new Tu(S,k,v.tree,v.offset+b,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;g=y.toA,b=y.toA-y.toB}return o}}class XE{startParse(l,r,c){return typeof l=="string"&&(l=new k1(l)),c=c?c.length?c.map(o=>new Dl(o.from,o.to)):[new Dl(0,0)]:[new Dl(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let d=o.advance();if(d)return d}}}class k1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function VE(n){return(l,r,c,o)=>new E1(l,n,r,c,o)}class Ab{constructor(l,r,c,o,d,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Mb(n){if(!n.length||n.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class S1{constructor(l,r,c,o,d,h,m,g){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const Rp=new hn({perNode:!0});class E1{constructor(l,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Ps(c.type,c.children,c.positions,c.length,c.propValues.concat([[Rp,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[hn.mounted.id]=new ao(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new A1(this.fragments),r=null,c=null,o=new gf(new ks(this.baseTree,this.ranges[0].from,0,null),dn.IncludeAnonymous|dn.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(l.hasNode(o)){if(r){let b=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(b)for(let y of b.mount.overlay){let j=y.from+b.pos,v=y.to+b.pos;j>=o.from&&v<=o.to&&!r.ranges.some(S=>S.from<v&&S.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=T1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(C1(o),r&&r.depth++,c&&c.depth++);let b=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new S1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=Ob(this.ranges,d.overlay||(o.from<o.to?[new Dl(o.from,o.to)]:[]));y.length&&Mb(y),(y.length||!d.overlay)&&this.inner.push(new Ab(d.parser,y.length?d.parser.startParse(this.input,Lb(b,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Dl(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new Dl(o.from,o.to)),g.from<g.to)){let b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let b=Ob(this.ranges,r.ranges);b.length&&(Mb(b),this.inner.splice(r.index,0,new Ab(r.parser,r.parser.startParse(this.input,Lb(r.mounts,b),b),r.ranges.map(y=>new Dl(y.from-r.start,y.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function T1(n,l,r){for(let c of n){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function Rb(n,l,r,c,o,d){if(l<r){let h=n.buffer[l+1];c.push(n.slice(l,r,h)),o.push(h-d)}}function C1(n){let{node:l}=n,r=[],c=l.context.buffer;do r.push(n.index),n.parent();while(!n.tree);let o=n.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(y,j,v,S,k,C){let A=r[C],Q=[],V=[];Rb(h,y,A,Q,V,S);let $=m[A+1],B=m[A+2];g.push(Q.length);let Y=C?b(A+4,m[A+3],h.set.types[m[A]],$,B-$,C-1):l.toTree();return Q.push(Y),V.push($-S),Rb(h,m[A+3],j,Q,V,S),new Ps(v,Q,V,k)}o.children[d]=b(0,m.length,na.none,0,h.length,r.length-1);for(let y of g){let j=n.tree.children[y],v=n.tree.positions[y];n.yield(new ks(j,v+n.from,y,n._tree))}}class Db{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(dn.IncludeAnonymous|dn.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,dn.IgnoreOverlays|dn.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Ps)r=r.children[0];else break}return!1}}class A1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(Rp))!==null&&r!==void 0?r:c.to,this.inner=new Db(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(Rp))!==null&&l!==void 0?l:r.to,this.inner=new Db(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(hn.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function Ob(n,l){let r=null,c=l;for(let o=1,d=0;o<n.length;o++){let h=n[o-1].to,m=n[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[d]=new Dl(g.from,h),g.to>m&&r.splice(d+1,0,new Dl(m,g.to))):g.to>m?r[d--]=new Dl(m,g.to):r.splice(d--,1))}}return c}function M1(n,l,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let y=o==n.length?1e9:h?n[o].to:n[o].from,j=d==l.length?1e9:m?l[d].to:l[d].from;if(h!=m){let v=Math.max(g,r),S=Math.min(y,j,c);v<S&&b.push(new Dl(v,S))}if(g=Math.min(y,j),g==1e9)break;y==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return b}function Lb(n,l){let r=[];for(let{pos:c,mount:o,frag:d}of n){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),b=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new Dl(v.from+c,v.to+c)),j=M1(l,y,g,b);for(let v=0,S=g;;v++){let k=v==j.length,C=k?b:j[v].from;if(C>S&&r.push(new Tu(S,C,o.tree,-h,d.from>=S||d.openStart,d.to<=C||d.openEnd)),k)break;S=j[v].to}}else r.push(new Tu(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let R1=0;class Ml{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=R1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof Ml&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new Ml(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new xf(l);return c=>c.modified.indexOf(r)>-1?c:xf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let D1=0;class xf{constructor(l){this.name=l,this.instances=[],this.id=D1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(m=>m.base==l&&O1(r,m.modified));if(c)return c;let o=[],d=new Ml(l.name,o,l,r);for(let m of r)m.instances.push(d);let h=L1(r);for(let m of l.set)if(!m.modified.length)for(let g of h)o.push(xf.get(m,g));return d}}function O1(n,l){return n.length==l.length&&n.every((r,c)=>r==l[c])}function L1(n){let l=[[]];for(let r=0;r<n.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(n[r]));return l.sort((r,c)=>c.length-r.length)}function QE(n){let l=Object.create(null);for(let r in n){let c=n[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let S=o[j++];if(j==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let y=new Cu(c,h,g>0?d.slice(0,g):null);l[b]=y.sort(l[b])}}return my.add(l)}const my=new hn({combine(n,l){let r,c,o;for(;n||l;){if(!n||l&&n.depth>=l.depth?(o=l,l=l.next):(o=n,n=n.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new Cu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Cu{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}Cu.empty=new Cu([],2,null);function gy(n,l){let r=Object.create(null);for(let d of n)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function z1(n,l){let r=null;for(let c of n){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function U1(n,l,r,c=0,o=n.length){let d=new B1(c,Array.isArray(l)?l:[l],r);d.highlightRange(n.cursor(),c,o,"",d.highlighters),d.flush(o)}function I1(n,l,r,c,o,d=0,h=n.length){let m=d;function g(b,y){if(!(b<=m)){for(let j=n.slice(m,b),v=0;;){let S=j.indexOf(`
|
|
117
|
+
`,v),k=S<0?j.length:S;if(k>v&&c(j.slice(v,k),y),S<0)break;o(),v=S+1}m=b}}U1(l,r,(b,y,j)=>{g(b,""),g(y,j)},d,h),g(h,"")}class B1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,d){let{type:h,from:m,to:g}=l;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(S=>!S.scope||S.scope(h)));let b=o,y=H1(l)||Cu.empty,j=z1(d,y.tags);if(j&&(b&&(b+=" "),b+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),y.opaque)return;let v=l.tree&&l.tree.prop(hn.mounted);if(v&&v.overlay){let S=l.node.enter(v.overlay[0].from+m,1),k=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),C=l.firstChild();for(let A=0,Q=m;;A++){let V=A<v.overlay.length?v.overlay[A]:null,$=V?V.from+m:g,B=Math.max(r,Q),Y=Math.min(c,$);if(B<Y&&C)for(;l.from<Y&&(this.highlightRange(l,B,Y,o,d),this.startSpan(Math.min(Y,l.to),b),!(l.to>=$||!l.nextSibling())););if(!V||$>c)break;Q=V.to+m,Q>r&&(this.highlightRange(S.cursor(),Math.max(r,V.from+m),Math.min(c,Q),"",k),this.startSpan(Math.min(c,Q),b))}C&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),b)}while(l.nextSibling());l.parent()}}}function H1(n){let l=n.type.prop(my);for(;l&&l.context&&!n.matchContext(l.context);)l=l.next;return l||null}const Me=Ml.define,Gd=Me(),ur=Me(),zb=Me(ur),Ub=Me(ur),dr=Me(),Yd=Me(dr),fp=Me(dr),Ta=Me(),Hr=Me(Ta),Na=Me(),wa=Me(),Dp=Me(),xu=Me(Dp),Xd=Me(),Oe={comment:Gd,lineComment:Me(Gd),blockComment:Me(Gd),docComment:Me(Gd),name:ur,variableName:Me(ur),typeName:zb,tagName:Me(zb),propertyName:Ub,attributeName:Me(Ub),className:Me(ur),labelName:Me(ur),namespace:Me(ur),macroName:Me(ur),literal:dr,string:Yd,docString:Me(Yd),character:Me(Yd),attributeValue:Me(Yd),number:fp,integer:Me(fp),float:Me(fp),bool:Me(dr),regexp:Me(dr),escape:Me(dr),color:Me(dr),url:Me(dr),keyword:Na,self:Me(Na),null:Me(Na),atom:Me(Na),unit:Me(Na),modifier:Me(Na),operatorKeyword:Me(Na),controlKeyword:Me(Na),definitionKeyword:Me(Na),moduleKeyword:Me(Na),operator:wa,derefOperator:Me(wa),arithmeticOperator:Me(wa),logicOperator:Me(wa),bitwiseOperator:Me(wa),compareOperator:Me(wa),updateOperator:Me(wa),definitionOperator:Me(wa),typeOperator:Me(wa),controlOperator:Me(wa),punctuation:Dp,separator:Me(Dp),bracket:xu,angleBracket:Me(xu),squareBracket:Me(xu),paren:Me(xu),brace:Me(xu),content:Ta,heading:Hr,heading1:Me(Hr),heading2:Me(Hr),heading3:Me(Hr),heading4:Me(Hr),heading5:Me(Hr),heading6:Me(Hr),contentSeparator:Me(Ta),list:Me(Ta),quote:Me(Ta),emphasis:Me(Ta),strong:Me(Ta),link:Me(Ta),monospace:Me(Ta),strikethrough:Me(Ta),inserted:Me(),deleted:Me(),changed:Me(),invalid:Me(),meta:Xd,documentMeta:Me(Xd),annotation:Me(Xd),processingInstruction:Me(Xd),definition:Ml.defineModifier("definition"),constant:Ml.defineModifier("constant"),function:Ml.defineModifier("function"),standard:Ml.defineModifier("standard"),local:Ml.defineModifier("local"),special:Ml.defineModifier("special")};for(let n in Oe){let l=Oe[n];l instanceof Ml&&(l.name=n)}gy([{tag:Oe.link,class:"tok-link"},{tag:Oe.heading,class:"tok-heading"},{tag:Oe.emphasis,class:"tok-emphasis"},{tag:Oe.strong,class:"tok-strong"},{tag:Oe.keyword,class:"tok-keyword"},{tag:Oe.atom,class:"tok-atom"},{tag:Oe.bool,class:"tok-bool"},{tag:Oe.url,class:"tok-url"},{tag:Oe.labelName,class:"tok-labelName"},{tag:Oe.inserted,class:"tok-inserted"},{tag:Oe.deleted,class:"tok-deleted"},{tag:Oe.literal,class:"tok-literal"},{tag:Oe.string,class:"tok-string"},{tag:Oe.number,class:"tok-number"},{tag:[Oe.regexp,Oe.escape,Oe.special(Oe.string)],class:"tok-string2"},{tag:Oe.variableName,class:"tok-variableName"},{tag:Oe.local(Oe.variableName),class:"tok-variableName tok-local"},{tag:Oe.definition(Oe.variableName),class:"tok-variableName tok-definition"},{tag:Oe.special(Oe.variableName),class:"tok-variableName2"},{tag:Oe.definition(Oe.propertyName),class:"tok-propertyName tok-definition"},{tag:Oe.typeName,class:"tok-typeName"},{tag:Oe.namespace,class:"tok-namespace"},{tag:Oe.className,class:"tok-className"},{tag:Oe.macroName,class:"tok-macroName"},{tag:Oe.propertyName,class:"tok-propertyName"},{tag:Oe.operator,class:"tok-operator"},{tag:Oe.comment,class:"tok-comment"},{tag:Oe.meta,class:"tok-meta"},{tag:Oe.invalid,class:"tok-invalid"},{tag:Oe.punctuation,class:"tok-punctuation"}]);const $1="modulepreload",q1=function(n,l){return new URL(n,l).href},Ib={},nt=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=q1(y,c),y in Ib)return;Ib[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let C=m.length-1;C>=0;C--){const A=m[C];if(A.href===y&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":$1,j||(k.as="script"),k.crossOrigin="",k.href=y,b&&k.setAttribute("nonce",b),document.head.appendChild(k),j)return new Promise((C,A)=>{k.addEventListener("load",C),k.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return l().catch(d)})},xy={js:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await nt(async()=>{const{javascript:n}=await import("./index-Duur5KBZ.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await nt(async()=>{const{json:n}=await import("./index-M02GPU4M.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await nt(async()=>{const{json:n}=await import("./index-M02GPU4M.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await nt(async()=>{const{css:n}=await import("./index-1f2CtYmb.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await nt(async()=>{const{css:n}=await import("./index-1f2CtYmb.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await nt(async()=>{const{css:n}=await import("./index-1f2CtYmb.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await nt(async()=>{const{html:n}=await import("./index-B5PgjCy2.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await nt(async()=>{const{html:n}=await import("./index-B5PgjCy2.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await nt(async()=>{const{html:n}=await import("./index-B5PgjCy2.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await nt(async()=>{const{html:n}=await import("./index-B5PgjCy2.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await nt(async()=>{const{markdown:n}=await import("./index-Cs3FSccd.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await nt(async()=>{const{markdown:n}=await import("./index-Cs3FSccd.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await nt(async()=>{const{python:n}=await import("./index-BMdxgpgr.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await nt(async()=>{const{python:n}=await import("./index-BMdxgpgr.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await nt(async()=>{const{yaml:n}=await import("./index-DIp8Svzr.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await nt(async()=>{const{yaml:n}=await import("./index-DIp8Svzr.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await nt(async()=>{const{rust:n}=await import("./index-BieVw7oe.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await nt(async()=>{const{cpp:n}=await import("./index-CdCc_AYg.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await nt(async()=>{const{cpp:n}=await import("./index-CdCc_AYg.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await nt(async()=>{const{cpp:n}=await import("./index-CdCc_AYg.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await nt(async()=>{const{cpp:n}=await import("./index-CdCc_AYg.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await nt(async()=>{const{cpp:n}=await import("./index-CdCc_AYg.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await nt(async()=>{const{java:n}=await import("./index-DFrY42c9.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await nt(async()=>{const{go:n}=await import("./index-D_IqGnua.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await nt(async()=>{const{php:n}=await import("./index-BEknqxbE.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await nt(async()=>{const{sql:n}=await import("./index-uknuSOmh.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await nt(async()=>{const{xml:n}=await import("./index-CKm4LyXr.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await nt(async()=>{const{xml:n}=await import("./index-CKm4LyXr.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},G1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},Y1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function X1(n){const l=Y1[n.toLowerCase()]??n.toLowerCase(),r=xy[l];return r?r().catch(()=>null):null}async function V1(n){const l=(n.split("/").pop()??"").toLowerCase(),r=G1[l]??l.split(".").pop()??"",c=xy[r];return c?c().catch(()=>null):null}const Q1=gy([{tag:[Oe.keyword,Oe.modifier,Oe.controlKeyword,Oe.moduleKeyword],class:"cmh-key"},{tag:[Oe.propertyName],class:"cmh-prop"},{tag:[Oe.function(Oe.variableName),Oe.labelName],class:"cmh-fn"},{tag:[Oe.color,Oe.constant(Oe.name),Oe.standard(Oe.name),Oe.bool],class:"cmh-const"},{tag:[Oe.typeName,Oe.className,Oe.changed,Oe.annotation,Oe.self,Oe.namespace],class:"cmh-type"},{tag:[Oe.number,Oe.integer,Oe.float],class:"cmh-num"},{tag:[Oe.string,Oe.special(Oe.string),Oe.regexp],class:"cmh-str"},{tag:[Oe.operator,Oe.operatorKeyword,Oe.escape],class:"cmh-op"},{tag:[Oe.meta,Oe.comment],class:"cmh-comment"},{tag:Oe.invalid,class:"cmh-invalid"}]);function Vd(n){return n.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function K1(n,l){const r=l?await X1(l):null;if(!r)return Vd(n);try{const c=r.language.parser.parse(n);let o="";return I1(n,c,Q1,(d,h)=>{o+=h?`<span class="${h}">${Vd(d)}</span>`:Vd(d)},()=>{o+=`
|
|
118
|
+
`}),o}catch{return Vd(n)}}Bt.setOptions({gfm:!0,breaks:!1});function by(n){var r;const l=(r=n.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function Ef(n){const l=await Bt.parse(n,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await K1(c.text,c.lang??""),c.escaped=!0}});return x1.sanitize(l)}function Bb(n,l){return{path:n.path,text:n.content,saved:n.content,eol:n.eol,encoding:n.encoding,mtime:n.mtime,size:n.size,binary:n.binary,tooLarge:n.tooLarge,mediaMime:n.mediaMime,mediaTooLarge:n.mediaTooLarge,stale:!1,revision:l,previewMode:by(n.path)}}function gi(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function F1(n){return n.split("/").pop()??n}function Wr(n){const l=n.lastIndexOf("/");return l===-1?"":n.slice(0,l)}function cf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}function mr({x:n,y:l,items:r,note:c,onClose:o}){const d=x.useRef(null),[h,m]=x.useState({left:n,top:l}),[g,b]=x.useState(()=>{const S=r.findIndex(k=>!k.disabled);return S===-1?0:S}),y=x.useRef(null);x.useLayoutEffect(()=>{const S=d.current;if(!S)return;y.current=document.elementsFromPoint(n,l).find(V=>!S.contains(V))??null;const k=S.getBoundingClientRect(),C=8,A=Math.max(C,Math.min(n,window.innerWidth-k.width-C)),Q=Math.max(C,Math.min(l,window.innerHeight-k.height-C));m({left:A,top:Q})},[n,l]),x.useLayoutEffect(()=>{var S;(S=d.current)==null||S.focus()},[]),x.useLayoutEffect(()=>{function S(C){var A;(A=d.current)!=null&&A.contains(C.target)||o()}function k(C){var V;const A=C.target;if(A===document||A===document.documentElement){o();return}if(!(A instanceof Node)||(V=d.current)!=null&&V.contains(A))return;const Q=y.current;(!Q||A.contains(Q))&&o()}return document.addEventListener("mousedown",S),document.addEventListener("scroll",k,!0),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("scroll",k,!0)}},[o]);function j(S){S.disabled||(S.onSelect(),o())}function v(S){if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),o();return}const k=r.map((C,A)=>({item:C,index:A})).filter(C=>!C.item.disabled);if(k.length!==0){if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const C=S.key==="ArrowDown"?1:-1,A=k.findIndex(V=>V.index===g),Q=k[(((A===-1?0:A)+C)%k.length+k.length)%k.length];Q&&b(Q.index);return}if(S.key==="Enter"||S.key===" "){S.preventDefault();const C=r[g];C&&j(C)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:v,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((S,k)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":S.disabled,className:"ctxmenu__item"+(k===g?" is-cursor":""),onMouseEnter:()=>b(k),onClick:()=>j(S),children:[a.jsx("span",{className:"ctxmenu__label",children:S.label}),S.hint&&a.jsx("span",{className:"ctxmenu__hint",children:S.hint})]},S.id))]})}const Z1=3500,J1=9e3,Hb=220;function nc({result:n,onDismiss:l}){const[r,c]=x.useState(n),[o,d]=x.useState(!1);if(x.useEffect(()=>{if(!n){c(null),d(!1);return}if(c(n),d(!1),n.url)return;const m=n.ok?Z1:J1,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+Hb);return()=>{clearTimeout(g),clearTimeout(b)}},[n]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Hb)};return a.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&a.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Ra({value:n,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=x.useState(n),m=x.useRef(null);x.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===n)return o();c(b)}return a.jsx("input",{ref:m,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function _o({active:n}){return n?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const W1=500,$r="application/x-ccv-fs-path",P1=200;function eN({open:n,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:y,onOpen:j,onCreate:v,onRename:S,onMove:k,onCopy:C,onDelete:A,onRefresh:Q,onClose:V,zoomed:$,onToggleZoom:B}){const[Y,M]=x.useState(""),[z,R]=x.useState(null),[K,ie]=x.useState(null),[q,H]=x.useState(null),[fe,je]=x.useState(null),[Z,L]=x.useState(null),[U,oe]=x.useState(null),pe=wf("(hover: hover)"),we=x.useRef(null),E=x.useMemo(()=>sN(d),[d]);function P(ue){return!(!q||ue===q.path||q.kind==="dir"&&ue.startsWith(`${q.path}/`)||ue===Wr(q.path))}function me(ue){return!(!Z||ue===Z.path||Z.kind==="dir"&&ue.startsWith(`${Z.path}/`)||Z.mode==="cut"&&ue===Wr(Z.path))}function ke(ue){L({path:ue.path,kind:ue.kind,mode:"copy"})}function G(ue){L({path:ue.path,kind:ue.kind,mode:"cut"})}function Se(ue){!Z||!me(ue)||(ue&&!r.has(ue)&&y(ue),Z.mode==="cut"?(k(Z.path,ue),L(null)):C(Z.path,ue))}function le(ue,Ne){const Ve=ue.touches[0];if(!Ve)return;const at={timer:0,x:Ve.clientX,y:Ve.clientY,el:ue.currentTarget,fired:!1};at.timer=window.setTimeout(()=>{at.fired=!0,Ne(at.x,at.y,at.el)},W1),we.current=at}function Ge(ue){const Ne=we.current,Ve=ue.touches[0];!Ne||!Ve||Math.hypot(Ve.clientX-Ne.x,Ve.clientY-Ne.y)>10&&(window.clearTimeout(Ne.timer),we.current=null)}function Re(ue){const Ne=we.current;Ne&&(window.clearTimeout(Ne.timer),Ne.fired&&ue.preventDefault())}function qt(){var ue;return(ue=we.current)!=null&&ue.fired?(we.current=null,!0):!1}function Xe(ue,Ne,Ve,at){M((at==null?void 0:at.path)??""),oe({x:ue,y:Ne,opener:Ve,entry:at})}function nn(){const ue=U==null?void 0:U.opener;oe(null),ue!=null&&ue.isConnected&&ue.focus()}function Pe(ue){return{onContextMenu:Ne=>{Ne.preventDefault(),Xe(Ne.clientX,Ne.clientY,Ne.currentTarget,ue)},onTouchStart:Ne=>le(Ne,(Ve,at,We)=>Xe(Ve,at,We,ue)),onTouchMove:Ge,onTouchEnd:Re,onTouchCancel:Re}}function dt(ue){ue.target===ue.currentTarget&&(ue.preventDefault(),Xe(ue.clientX,ue.clientY,ue.currentTarget,null))}function st(ue){ue.target===ue.currentTarget&&le(ue,(Ne,Ve,at)=>Xe(Ne,Ve,at,null))}function vt(ue){if(!(ue.ctrlKey||ue.metaKey)||ue.target instanceof HTMLInputElement)return;const Ne=ue.key.toLowerCase();if(Ne==="v"){ue.preventDefault(),Se(xs());return}if(!Y)return;const Ve=$b(l,Y);Ve&&(Ne==="c"?(ue.preventDefault(),ke(Ve)):Ne==="x"&&(ue.preventDefault(),G(Ve)))}function gs(ue){return Ne=>{Ne.dataTransfer.effectAllowed="move",Ne.dataTransfer.setData($r,ue.path),H({path:ue.path,kind:ue.kind})}}function gt(){H(null),je(null)}function lt(ue){return Ne=>{Ne.dataTransfer.types.includes($r)&&(Ne.stopPropagation(),!(ue.kind!=="dir"||!P(ue.path))&&(Ne.preventDefault(),je(ue.path)))}}function Te(ue){return Ne=>{if(!Ne.dataTransfer.types.includes($r)||(Ne.stopPropagation(),ue.kind!=="dir"||!P(ue.path)))return;Ne.preventDefault();const Ve=Ne.dataTransfer.getData($r);je(null),Ve&&k(Ve,ue.path)}}function et(ue){!ue.dataTransfer.types.includes($r)||!P("")||(ue.preventDefault(),je(""))}function jt(ue){if(!ue.dataTransfer.types.includes($r)||!P(""))return;ue.preventDefault();const Ne=ue.dataTransfer.getData($r);je(null),Ne&&k(Ne,"")}const[ot,Ze]=x.useState(""),zt=ot.trim(),rs=zt.length>0,Tt=x.useRef(null),sn=x.useRef(g);sn.current=g;function Fn(ue){Ze(ue),Tt.current&&clearTimeout(Tt.current);const Ne=ue.trim();if(!Ne){sn.current("");return}Tt.current=setTimeout(()=>sn.current(Ne),P1)}function _n(ue){Tt.current&&clearTimeout(Tt.current),Ze(""),sn.current(""),M(ue.path),b(ue)}const An=rs&&(m==null?void 0:m.query)===zt?m:null;function xs(){if(Y==="")return"";const ue=$b(l,Y);if((ue==null?void 0:ue.kind)==="dir")return Y;const Ne=Y.lastIndexOf("/");return Ne===-1?"":Y.slice(0,Ne)}function ln(ue,Ne){const Ve=Ne??xs();Ve&&!r.has(Ve)&&y(Ve),ie({parent:Ve,kind:ue})}function St(){if(!U)return[];const ue=at=>pe?at:void 0;if(!U.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:ue("Ctrl+V"),disabled:!me(""),onSelect:()=>Se("")},{id:"new-file",label:"Создать файл",onSelect:()=>ln("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>ln("dir","")}];const Ne=U.entry,Ve=[Ne.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(Ne.path)}:{id:"toggle",label:r.has(Ne.path)?"Свернуть":"Развернуть",onSelect:()=>y(Ne.path)},{id:"copy",label:"Копировать",hint:ue("Ctrl+C"),onSelect:()=>ke(Ne)},{id:"cut",label:"Вырезать",hint:ue("Ctrl+X"),onSelect:()=>G(Ne)}];return Ne.kind==="dir"&&(Ve.push({id:"paste",label:"Вставить",hint:ue("Ctrl+V"),disabled:!me(Ne.path),onSelect:()=>Se(Ne.path)}),Ve.push({id:"new-file",label:"Создать файл",onSelect:()=>ln("file",Ne.path)}),Ve.push({id:"new-dir",label:"Создать каталог",onSelect:()=>ln("dir",Ne.path)})),Ve.push({id:"rename",label:"Переименовать",onSelect:()=>R(Ne.path)}),Ve.push({id:"delete",label:"Удалить",onSelect:()=>A(Ne)}),Ve}const Zn=rs?[]:Gt("",0);function Gt(ue,Ne){const Ve=l[ue],at=[];if(K&&K.parent===ue&&at.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:xi(Ne),children:[a.jsx("span",{className:"fsrow__icon",children:K.kind==="dir"?a.jsx(_f,{}):a.jsx(yf,{})}),a.jsx(Ra,{className:"rename--file",value:"",placeholder:K.kind==="dir"?"имя каталога":"имя файла",onCommit:We=>{ie(null),v(ue,K.kind,We)},onCancel:()=>ie(null)})]},`draft:${ue}`)),!Ve)return at.push(a.jsx("p",{className:"fsrow__pending",style:xi(Ne),children:"читаем…"},`wait:${ue}`)),at;Ve.length===0&&!K&&at.push(a.jsx("p",{className:"fsrow__pending",style:xi(Ne),children:"пусто"},`empty:${ue}`));for(const We of Ve){const ft=We.kind==="dir"&&r.has(We.path);at.push(z===We.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:xi(Ne),children:[a.jsx("span",{className:"fsrow__icon",children:We.kind==="dir"?a.jsx(_f,{open:ft}):a.jsx(yf,{})}),a.jsx(Ra,{className:"rename--file",value:We.name,placeholder:"новое имя",onCommit:X=>{R(null),S(We.path,X)},onCancel:()=>R(null)})]},We.path):a.jsx(tN,{entry:We,depth:Ne,open:ft,active:We.path===c,selected:We.path===Y,dirty:o.has(We.path),gitStatus:E.get(We.path),dragging:(q==null?void 0:q.path)===We.path,dropTarget:fe===We.path,cut:(Z==null?void 0:Z.mode)==="cut"&&Z.path===We.path,onClick:()=>{qt()||(M(We.path),We.kind==="dir"?y(We.path):j(We.path))},onRename:()=>R(We.path),onDelete:()=>A(We),onDragStart:gs(We),onDragEnd:gt,onDragOver:lt(We),onDrop:Te(We),...Pe(We)},We.path)),ft&&at.push(...Gt(We.path,Ne+1))}return at}function Jn(){if(!An)return[a.jsx("p",{className:"fsrow__pending",style:xi(0),children:"ищем…"},"search:wait")];if(An.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:xi(0),children:"ничего не найдено"},"search:empty")];const ue=An.entries.map(Ne=>a.jsx(nN,{entry:Ne,gitStatus:E.get(Ne.path),onClick:()=>_n(Ne)},Ne.path));return An.truncated&&ue.push(a.jsxs("p",{className:"fsrow__pending",style:xi(0),children:["показаны первые ",An.entries.length," — уточните запрос"]},"search:truncated")),ue}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+($?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:vt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:ue=>{B&&(ue.target.closest("button")||B())},children:[a.jsx(rN,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>ln("file"),children:a.jsx(aN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>ln("dir"),children:a.jsx(iN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:Q,children:"↻"}),B&&a.jsx("button",{className:"sidepane__btn",title:$?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":$?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":$,onClick:B,children:a.jsx(_o,{active:$})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:V,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(cN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:ot,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:ue=>Fn(ue.target.value),onKeyDown:ue=>{ue.stopPropagation(),ue.key==="Escape"&&(ue.preventDefault(),ot?Fn(""):ue.currentTarget.blur())}}),ot&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Fn(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(fe===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:et,onDrop:jt,onContextMenu:dt,onTouchStart:st,onTouchMove:Ge,onTouchEnd:Re,onTouchCancel:Re,children:rs?Jn():Zn}),a.jsx(nc,{result:h}),U&&a.jsx(mr,{x:U.x,y:U.y,items:St(),onClose:nn})]})}function tN({entry:n,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:y,onRename:j,onDelete:v,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:Q,onTouchStart:V,onTouchMove:$,onTouchEnd:B,onTouchCancel:Y}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return a.jsxs("div",{className:M,style:xi(l),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:Q,onTouchStart:V,onTouchMove:$,onTouchEnd:B,onTouchCancel:Y,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:_y(n),children:[a.jsx("span",{className:"fsrow__icon"+bf("fsrow__icon",h),children:n.kind==="dir"?a.jsx(_f,{open:r}):a.jsx(yf,{})}),a.jsx("span",{className:"fsrow__name"+bf("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:v,children:"✕"})]})}function nN({entry:n,gitStatus:l,onClick:r}){const c=n.path.slice(0,n.path.length-n.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:xi(0),onClick:r,title:_y(n),children:[a.jsx("span",{className:"fsrow__icon"+bf("fsrow__icon",l),children:n.kind==="dir"?a.jsx(_f,{}):a.jsx(yf,{})}),a.jsx("span",{className:"fsrow__name"+bf("fsrow__name",l),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function _y(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function xi(n){return{"--depth":n}}function $b(n,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=n[c])==null?void 0:o.find(d=>d.path===l))??null}function sN(n){const l=new Map,r={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||r[d]>r[h])&&l.set(o,d)};for(const o of n){const d=lN(o.status);if(!d)continue;c(o.path,d);let h=Wr(o.path);for(;c(h,d),!!h;)h=Wr(h)}return l}function lN(n){if(n==="??")return"added";const[l="",r=""]=n;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function bf(n,l){return l?` ${n}--git-${l}`:""}function _f({open:n=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?a.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function yf(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]})}function aN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function iN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function rN(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function cN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const oN=200;function uN({open:n,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=x.useState(""),b=m.trim(),y=b.length>0,j=x.useRef(null),v=x.useRef(r);v.current=r;function S(A){g(A),j.current&&clearTimeout(j.current);const Q=A.trim();if(!Q){v.current("");return}j.current=setTimeout(()=>v.current(Q),oN)}const k=y&&(l==null?void 0:l.query)===b?l:null;function C(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let Q="";for(const V of k.matches)V.path!==Q&&(Q=V.path,A.push(a.jsx("p",{className:"searchgroup__path",title:V.path,children:V.path},`path:${V.path}`))),A.push(a.jsx(dN,{match:V,onClick:()=>c(V)},`${V.path}:${V.line}:${V.column}`));return k.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[a.jsx(fN,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:a.jsx(_o,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(hN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>S(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?S(""):A.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?C():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function dN({match:n,onClick:l}){const r=n.lineText.slice(0,n.column-1),c=n.lineText.slice(n.column-1,n.column-1+n.matchLength),o=n.lineText.slice(n.column-1+n.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:l,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function fN(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function hN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Qd=null;function pN(){return Qd||(Qd=Promise.all([nt(()=>import("./index-DvbV5juq.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),nt(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),nt(()=>import("./index-BHot-lnj.js"),[],import.meta.url),nt(()=>import("./index-CTOsqnj0.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),nt(()=>import("./codemirror-DsTONvL-.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Qd=null,n})),Qd}function mN({path:n,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=x.useRef(null),m=x.useRef(null),g=x.useRef(null),b=x.useRef(new Map),y=x.useRef(new Map),j=x.useRef(new Set),v=x.useRef(null),S=x.useRef(o),k=x.useRef(d),C=x.useRef(n),A=x.useRef(r),Q=x.useRef(l);S.current=o,k.current=d,C.current=n,A.current=r,Q.current=l;const[V,$]=x.useState("loading"),[B,Y]=x.useState(!1);function M(R,K,ie,q,H){const fe=b.current.get(q),je=y.current.get(q)===H;if(fe&&je)ie.setState(fe);else{const L=R.EditorState.create({doc:Q.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(C.current),!0)}])),R.keymap.of([R.indentWithTab]),K.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(U=>{U.docChanged&&S.current(C.current,U.state.doc.toString())})]});b.current.set(q,L),y.current.set(q,H),ie.setState(L),j.current.delete(q)}if(j.current.has(q))return()=>{};let Z=!1;return V1(q).then(L=>{Z||!L||C.current!==q||(ie.dispatch({effects:K.reconfigure(L)}),b.current.set(q,ie.state),j.current.add(q))}),()=>{Z=!0}}x.useEffect(()=>{if(!h.current)return;let K=!1,ie=null,q=null;$("loading"),Y(!1);const H=window.setTimeout(()=>{K||Y(!0)},200);return(async()=>{let fe;try{fe=await pN()}catch{window.clearTimeout(H),K||$("error");return}if(K||!h.current)return;window.clearTimeout(H);const je=new fe.Compartment;v.current=je,g.current=fe,q=new fe.EditorView({parent:h.current}),m.current=q,ie=M(fe,je,q,C.current,A.current),$("ready")})(),()=>{K=!0,window.clearTimeout(H),ie==null||ie(),q==null||q.destroy(),m.current===q&&(m.current=null),g.current=null,v.current=null}},[]),x.useEffect(()=>{const R=g.current,K=m.current,ie=v.current;if(!(!R||!K||!ie))return M(R,ie,K,n,r)},[n,r]);const z=x.useRef(0);return x.useEffect(()=>{const R=m.current,K=g.current;if(!R||!K||!c||c.token===z.current)return;z.current=c.token;const ie=R.state.doc.lines,q=Math.min(Math.max(c.line,1),ie),H=R.state.doc.line(q),fe=Math.min(H.from+Math.max(c.column-1,0),H.to);R.dispatch({selection:K.EditorSelection.cursor(fe),effects:K.EditorView.scrollIntoView(fe,{y:"center"})}),R.focus()},[c]),x.useEffect(()=>()=>{const R=m.current;R&&b.current.set(n,R.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(V==="ready"?"":" is-hidden")}),V==="loading"&&B&&a.jsxs("div",{className:"editor__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),V==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Rl({value:n,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=x.useState(!1),[b,y]=x.useState(0),j=x.useRef(null),v=x.useRef(null),S=l.find(A=>A.value===n)??null;x.useEffect(()=>{if(!m)return;const A=l.findIndex(Q=>Q.value===n);y(A===-1?0:A)},[m]),x.useEffect(()=>{if(!m)return;function A(Q){var V;(V=j.current)!=null&&V.contains(Q.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),x.useEffect(()=>{var A,Q;m&&((Q=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||Q.scrollIntoView({block:"nearest"}))},[m,b]),x.useEffect(()=>{if(!m)return;const A=v.current,Q=gN(j.current);if(!A||!Q)return;const V=A.getBoundingClientRect().bottom-Q.getBoundingClientRect().bottom;V>0&&(Q.scrollTop+=Math.min(V+8,A.offsetHeight))},[m]);function k(A){g(!1),A.value!==n&&r(A.value)}function C(A){if(A.key==="Escape"){if(!m)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!m)return g(!0);const Q=A.key==="ArrowDown"?1:l.length-1;return y(V=>(V+Q)%l.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const Q=l[b];Q&&k(Q)}}return a.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(A=>!A),onKeyDown:C,children:[a.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),a.jsx(xN,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((A,Q)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===n,className:"select__option"+(Q===b?" is-cursor":"")+(A.value===n?" is-on":""),onMouseEnter:()=>y(Q),onClick:()=>k(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function gN(n){let l=(n==null?void 0:n.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function xN(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function bN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function _N(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M4.6 6.6h4"})]})}function yN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function vN({path:n,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){x.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(n)},[]);const m=jN(r,l);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",cf(d),"). Лимит — 64 МБ."]})}):c?a.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[a.jsx("p",{className:"mediaview__error",children:c}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):m?l.startsWith("image/")?a.jsx(wN,{url:m}):l.startsWith("video/")?a.jsx(SN,{url:m}):null:a.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[a.jsx("div",{className:"mediaview__progress",children:a.jsx("div",{className:"mediaview__progress-fill"})}),a.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function jN(n,l){const[r,c]=x.useState(null);return x.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[n,l]),r}const cr=1,yy=8,Kd=1.25;function NN(n){return Math.min(yy,Math.max(cr,n))}function wN({url:n}){const[l,r]=x.useState({scale:cr,x:0,y:0}),[c,o]=x.useState(!1),d=x.useRef(null),h=x.useRef(null);function m(S,k,C){r(A=>{const Q=NN(A.scale*S);if(Q===A.scale)return A;if(Q<=cr)return{scale:cr,x:0,y:0};const V=(k-A.x)/A.scale,$=(C-A.y)/A.scale;return{scale:Q,x:k-Q*V,y:C-Q*$}})}x.useEffect(()=>{const S=d.current;if(!S)return;function k(C){C.preventDefault();const A=S.getBoundingClientRect(),Q=C.clientX-A.left-A.width/2,V=C.clientY-A.top-A.height/2;m(C.deltaY<0?Kd:1/Kd,Q,V)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function g(S){l.scale<=cr||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:l.x,origY:l.y},o(!0))}function b(S){const k=h.current;!k||k.pointerId!==S.pointerId||r(C=>({...C,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=l.scale>cr,v=!j&&l.x===0&&l.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:l.scale<=cr,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Kd,0,0),children:a.jsx(_N,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:l.scale>=yy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Kd,0,0),children:a.jsx(bN,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:cr,x:0,y:0}),children:a.jsx(yN,{})})]})]})}const kN=[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× — обычная"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"2",label:"2×"}];function SN({url:n}){const l=x.useRef(null),[r,c]=x.useState("1");return x.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:l,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Rl,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:kN})]})]})}function EN({file:n,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=gi(n),b=by(n.path)&&!n.binary&&!n.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:n.path,children:n.path}),a.jsxs("span",{className:"editor__meta",children:[cf(n.size),n.eol==="crlf"&&" · CRLF"]}),b&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&m(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&m(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(vN,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",cf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",cf(n.size),"). Такие правит агент, а не браузер."]}):b&&n.previewMode?a.jsx(TN,{text:n.text}):a.jsx(mN,{path:n.path,doc:n.text,revision:n.revision,goto:l,onChange:r,onSave:c})]})}function TN({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Ef(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function CN({files:n,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(m=>a.jsxs("div",{className:"worktab"+(m.path===l?" is-on":""),role:"tab","aria-selected":m.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:F1(m.path)}),gi(m)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),a.jsx("div",{className:"worktabs__spacer"}),h&&a.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:a.jsx(_o,{active:d})})]})}function Al(n){return n.claudeSessionId??n.id}function of(n,l,r,c){if(!l||l.length===0)return n;const o=new Map(l.map((m,g)=>[m,g])),d=[],h=[];for(const m of n)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function qb(n){return n.state!=="closed"}function vy(n){return[...n.filter(qb),...n.filter(l=>!qb(l))]}function Fd(n,l,r,c){if(l===r||!n.includes(l)||!n.includes(r))return null;const o=n.filter(m=>m!==l),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),l,...o.slice(d)];return h.every((m,g)=>m===n[g])?null:h}function tm(n,l,r,c){const o=n%10,d=n%100;return o===1&&d!==11?l:o>=2&&o<=4&&(d<12||d>14)?r:c}function jy(n){return`${n} ${tm(n,"агент","агента","агентов")}`}function AN(n){const l=n.filter(o=>o.kind==="agent").length,r=n.length-l,c=[];return l>0&&c.push(jy(l)),r>0&&c.push(`${r} ${tm(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function MN(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function RN(n){const l=Math.max(0,Math.floor(n/1e3)),r=Math.floor(l/3600),c=Math.floor(l%3600/60),o=l%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function DN(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function ON({tasks:n,onStop:l}){const[r,c]=x.useState(!1),[o,d]=x.useState(()=>Date.now()),[h,m]=x.useState(()=>new Set);x.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),x.useEffect(()=>{m(b=>{const y=new Set(n.map(v=>v.id)),j=new Set([...b].filter(v=>y.has(v)));return j.size===b.size?b:j})},[n]);const g=b=>{m(y=>new Set(y).add(b)),l(b),window.setTimeout(()=>{m(y=>{if(!y.has(b))return y;const j=new Set(y);return j.delete(b),j})},1e4)};return a.jsxs("div",{className:r?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(b=>!b),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:AN(n)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(b=>{const y=h.has(b.id);return a.jsxs("li",{className:y?"task is-stopping":"task",children:[a.jsxs("div",{className:"task__main",children:[a.jsxs("div",{className:"task__head",children:[a.jsx("span",{className:"task__kind",children:MN(b)}),b.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:RN(o-b.startedAt)})]}),a.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&a.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),a.jsxs("div",{className:"task__stats",children:[DN(b.tokens)," · ",b.toolUses," ",tm(b.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:y?"Останавливается":"Стоп"})]},b.id)})})]})}const LN=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function nm({className:n}){return a.jsx("img",{src:LN,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const zN=450,UN=6,IN={claude:{label:"Claude",hint:"Claude Code — как обычно"},antigravity:{label:"Antigravity",hint:"Google agy, отдельная палитра и права"}};function BN({disabled:n,providers:l,lastAccountId:r,onStart:c,onSignIn:o}){var L;const{accounts:d,auth:h,multi:m}=$p(),g=["claude","antigravity"].filter(U=>l.includes(U)).flatMap(U=>U==="claude"&&m?d.map(oe=>{const pe=h[oe.id],we=z_(pe);return{key:`claude:${oe.id}`,id:"claude",label:oe.name,hint:we?`Claude Code, ${we}`:"Claude Code",account:oe,isDefault:oe.id===r,needsLogin:oe.id!==or&&pe!=null&&!pe.loggedIn}}):[{key:U,id:U,...IN[U]}]),b=g.length>1,y=g.find(U=>U.isDefault)??g[0],j=Math.max(0,g.indexOf(y)),[v,S]=x.useState(!1),[k,C]=x.useState(0),[A,Q]=x.useState({left:0,top:0}),V=x.useRef(null),$=x.useRef(null),B=x.useRef(null);function Y(){B.current&&window.clearTimeout(B.current.timer),B.current=null}function M(){Y(),C(j),S(!0)}function z(U){var oe;S(!1),U&&((oe=V.current)==null||oe.focus())}function R(U){if(n||!b||U.button!==0)return;const oe={timer:0,x:U.clientX,y:U.clientY,fired:!1};oe.timer=window.setTimeout(()=>{oe.fired=!0,M()},zN),B.current=oe}function K(U){const oe=B.current;!oe||oe.fired||Math.hypot(U.clientX-oe.x,U.clientY-oe.y)>UN&&Y()}function ie(){B.current&&!B.current.fired&&Y()}function q(U){var oe;if((oe=B.current)!=null&&oe.fired){B.current=null,U.preventDefault();return}n||y&&je(y)}function H(U){b&&(U.preventDefault(),!n&&M())}function fe(U){if(n||!b)return;(U.key==="ArrowDown"||U.key==="ArrowUp"||U.key==="Enter"&&U.shiftKey)&&(U.preventDefault(),M())}x.useLayoutEffect(()=>{if(!v)return;const U=V.current,oe=$.current;if(!U||!oe)return;const pe=U.getBoundingClientRect(),we=oe.getBoundingClientRect(),E=8,P=Math.max(E,Math.min(pe.right-we.width,window.innerWidth-we.width-E));let me=pe.top-we.height-8;me<E&&(me=Math.min(pe.bottom+8,window.innerHeight-we.height-E)),Q({left:P,top:me})},[v]),x.useLayoutEffect(()=>{var U;v&&((U=$.current)==null||U.focus())},[v]),x.useLayoutEffect(()=>{if(!v)return;function U(oe){var we,E;const pe=oe.target;!((we=$.current)!=null&&we.contains(pe))&&!((E=V.current)!=null&&E.contains(pe))&&z(!1)}return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[v]);function je(U){var oe;if(z(!1),U.needsLogin&&U.account){o(U.account.id);return}c(U.id,(oe=U.account)==null?void 0:oe.id)}function Z(U){if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),z(!0);return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();const oe=U.key==="ArrowDown"?1:-1;C(pe=>(pe+oe+g.length)%g.length);return}if(U.key==="Enter"||U.key===" "){U.preventDefault();const oe=g[k];oe&&je(oe);return}U.key==="Tab"&&z(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:V,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:b?m?`Новая сессия под «${((L=y==null?void 0:y.account)==null?void 0:L.name)??""}». Удерживайте, чтобы выбрать агента или аккаунт`:"Удерживайте, чтобы выбрать агента":void 0,"aria-label":m&&(y!=null&&y.account)?`Новая сессия, аккаунт «${y.account.name}»`:void 0,"aria-haspopup":b?"menu":void 0,"aria-expanded":b?v:void 0,onClick:q,onContextMenu:H,onPointerDown:R,onPointerMove:K,onPointerUp:ie,onPointerCancel:ie,onPointerLeave:ie,onKeyDown:fe,children:["+ Сессия",m&&(y==null?void 0:y.account)&&a.jsx("span",{className:`newsession__acct acct--${y.account.color}`,"aria-hidden":"true"}),b&&a.jsx(HN,{})]}),v&&b&&a.jsx("div",{ref:$,className:"newsession__menu",style:{left:A.left,top:A.top},role:"menu","aria-label":m?"Выбрать агента и аккаунт для новой сессии":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:Z,children:g.map((U,oe)=>{var pe;return a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(oe===k?" is-cursor":"")+(oe>0&&((pe=g[oe-1])==null?void 0:pe.id)!==U.id?" newsession__item--sep":""),onMouseEnter:()=>C(oe),onClick:()=>je(U),children:[U.account?a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Oa,{account:U.account,size:"md"})}):a.jsx("span",{className:`newsession__mark newsession__mark--${U.id}`,"aria-hidden":"true",children:U.id==="antigravity"?a.jsx(nm,{className:"newsession__mark-logo"}):a.jsx($N,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:U.label}),a.jsx("span",{className:"newsession__hint",children:U.hint})]}),U.needsLogin?a.jsx("span",{className:"newsession__tag newsession__tag--login",children:"Войти"}):U.isDefault&&a.jsx("span",{className:"newsession__tag",children:"по клику"})]},U.key)})})]})}function HN(){return a.jsx("svg",{className:"newsession__caret",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function $N(){return a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}const Ny="ccv:sidebar.collapsed",wy="ccv:sidebar.mode",ky="ccv:sidebar.foldersCollapsed",Gb="ccv:sidebar.expandedProjects",Yb="ccv:sidebar.expandedProjectArchives",qN=500,Op="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function GN({open:n,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:b,pinned:y,live:j,listOrder:v,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:C,activeSessionId:A,onSelectWorkspace:Q,onRenameSession:V,onStopSession:$,onPinSessions:B,onSelectPinned:Y,onCloseWorkspaces:M,onRestoreWorkspaces:z,onUnmarkWorkspaces:R,onArchiveSessions:K,onUnarchiveSessions:ie,onCreateFolder:q,onRenameFolder:H,onSetFolderColor:fe,onDeleteFolder:je,onAssignToFolder:Z,folderNotice:L,onDismissFolderNotice:U,movingProjectId:oe,foldersReady:pe,onOpenWorkspace:we,onOpenUnopened:E,onNewSession:P,enabledProviders:me,lastAccountId:ke,onSignInAccount:G,onOpenExtensions:Se,account:le,onOpenAccount:Ge,relay:Re,onOpenRelay:qt,onOpenSettings:Xe,themeMode:nn,onCycleTheme:Pe}){var En;const dt=$p(),[st,vt]=x.useState(null),[gs,gt]=x.useState(null),[lt,Te]=x.useState(null);function et(w){return(lt==null?void 0:lt.folderId)===w.id?lt.color??void 0:w.color}function jt(w){const se=w&&et(w);return se?{"--folder-color":se}:void 0}const ot=x.useRef(void 0),[Ze,zt]=x.useState(null),[rs,Tt]=x.useState(null),[sn,Fn]=x.useState(""),[_n,An]=x.useState(lw),[xs,ln]=x.useState(aw),[St,Zn]=x.useState(iw),[Gt,Jn]=x.useState(()=>Qb(Gb)),[ue,Ne]=x.useState(()=>Qb(Yb)),[Ve,at]=x.useState([]);function We(w){Zn(w);try{localStorage.setItem(wy,w)}catch{}}const ft=sn.trim().toLowerCase(),X=ft!=="",ge=x.useMemo(()=>of(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),De=x.useMemo(()=>{const w=of(y,v==null?void 0:v.pinned,Al,"bottom");return S?vy(w):w},[y,v,S]),He=x.useMemo(()=>of(j,v==null?void 0:v.live,Al,"bottom"),[j,v]),Yt=x.useMemo(()=>{const w=new Map,se=new Map,ye=new Map,ze=new Map(c.map(bt=>[bt.id,bt.folderId]));for(const bt of j){const Hn=Cy(bt);pp(w,bt.workspaceId,Hn),bt.folderId&&pp(se,bt.folderId,Hn);const It=ze.get(bt.workspaceId);It&&pp(ye,It,Hn)}return{byWorkspace:w,bySessionFolder:se,byWorkspaceFolder:ye}},[j,c]),ts=w=>w.name.toLowerCase().includes(ft)||w.path.toLowerCase().includes(ft),Ls=x.useMemo(()=>pe?X?ge.filter(w=>{if(ts(w))return!0;const se=g[w.id];return!!se&&(se.sessions.some(ye=>ku(ye,ft))||se.archived.some(ye=>ku(ye,ft)))}):ge:[],[ge,g,ft,X,pe]),el=x.useMemo(()=>pe?X?o.filter(ts):o:[],[o,ft,X,pe]),xl=w=>{var se;return((se=c.find(ye=>ye.id===w))==null?void 0:se.name)??"—"},Ol=w=>{var se;return(se=c.find(ye=>ye.id===w))==null?void 0:se.path},zs=x.useMemo(()=>X?De.filter(w=>(w.title??"").toLowerCase().includes(ft)||xl(w.workspaceId).toLowerCase().includes(ft)):De,[De,c,ft,X]),bs=x.useMemo(()=>X?He.filter(w=>(w.title??"").toLowerCase().includes(ft)||xl(w.workspaceId).toLowerCase().includes(ft)):He,[He,c,ft,X]),ns=!X;function zn(w){An(se=>{const ye=se.includes(w)?se.filter(ze=>ze!==w):[...se,w];try{localStorage.setItem(Ny,JSON.stringify(ye))}catch{}return ye})}const yn=w=>!_n.includes(w);function rn(w){ln(se=>{const ye=se.includes(w)?se.filter(ze=>ze!==w):[...se,w];try{localStorage.setItem(ky,JSON.stringify(ye))}catch{}return ye})}const Je=w=>!xs.includes(w);function Mn(w,se){Jn(ye=>{if(ye.includes(w)===se)return ye;const ze=se?[...ye,w]:ye.filter(bt=>bt!==w);return Kb(Gb,ze),ze})}function tl(w){Ne(se=>{const ye=se.includes(w)?se.filter(ze=>ze!==w):[...se,w];return Kb(Yb,ye),ye})}x.useEffect(()=>{C&&Mn(C,!0)},[C]),x.useEffect(()=>at(w=>w.length?[]:w),[ft]);const bl=x.useRef(new Set);x.useEffect(()=>{if(!l){bl.current.clear();return}for(const w of Gt)bl.current.has(w)||!c.some(se=>se.id===w)||(bl.current.add(w),w!==C&&b(w))},[l,Gt,c,C]);function sa(w){const se=g[w.id],ye=!X||ts(w),ze=!ye,bt=ze?!Ve.includes(w.id):Gt.includes(w.id),Hn=se?ye?se.sessions.length:se.sessions.filter(It=>ku(It,ft)).length:void 0;return{entry:se,showAll:ye,forced:ze,open:bt,count:Hn}}function Ll(w,se){if(se.forced){at(ye=>ye.includes(w.id)?ye.filter(ze=>ze!==w.id):[...ye,w.id]);return}Mn(w.id,!se.open)}function Us(w,se){Ll(w,se),!se.open&&w.id!==C&&Q(w.id)}const cs=x.useMemo(()=>Su(Ls,d,void 0,!X),[Ls,d,X]),Ss=x.useMemo(()=>{const w=new Map;for(const se of d){const ye=(se.unopened??[]).filter(ze=>!X||ze.name.toLowerCase().includes(ft));ye.length&&w.set(se.id,ye)}return w},[d,ft,X]),nl=x.useMemo(()=>{if(!X)return cs.groups;const w=new Set(cs.groups.map(ye=>ye.folder.id)),se=d.filter(ye=>!w.has(ye.id)&&Ss.has(ye.id)).map(ye=>({folder:ye,items:[]}));return se.length?[...cs.groups,...se].sort((ye,ze)=>ye.folder.name.localeCompare(ze.folder.name,"ru")):cs.groups},[cs,d,Ss,X]),[zl,Un]=x.useState([]),Xt=x.useMemo(()=>Su(el,d),[el,d]),Rn=x.useMemo(()=>Su(zs,m,w=>w.pinnedFolderId,!X),[zs,m,X]),Dn=x.useMemo(()=>({groups:[],ungrouped:bs}),[bs]),Es=((v==null?void 0:v.workspaces.length)??0)>0,os=((v==null?void 0:v.pinned.length)??0)>0,La=((v==null?void 0:v.live.length)??0)>0,Ts=df({enabled:ns,scope:"workspaces",itemKey:w=>w.id,groups:cs.groups,ungrouped:cs.ungrouped,onReorder:k,onMoveToGroup:(w,se)=>{Z("workspace",w,se.folderId),se.order&&k("workspaces",se.order)}}),In=df({enabled:ns,scope:"pinned",itemKey:Al,groups:Rn.groups,ungrouped:Rn.ungrouped,onReorder:k}),_l=df({enabled:ns,scope:"live",itemKey:Al,groups:Dn.groups,ungrouped:Dn.ungrouped,onReorder:k});x.useEffect(()=>{if(!lt)return;const w=[...m,...d,...h].find(se=>se.id===lt.folderId);w&&w.color===(lt.color??void 0)&&Te(null)},[lt,m,d,h]),x.useEffect(()=>()=>window.clearTimeout(ot.current),[]);const ss=Lp(Ls),Bn=Lp(el),[it,Ut]=x.useState(null),[vn,Sn]=x.useState(null),[yl,sl]=x.useState(null),[Wn,ll]=x.useState(null),[Vt,Ul]=x.useState(null),pn=x.useRef(null);function _s(w,se){const ye=w.touches[0];if(!ye)return;const ze={timer:0,x:ye.clientX,y:ye.clientY,el:w.currentTarget,fired:!1};ze.timer=window.setTimeout(()=>{ze.fired=!0,se(ze.x,ze.y,ze.el)},qN),pn.current=ze}function Ct(w){const se=pn.current,ye=w.touches[0];!se||!ye||Math.hypot(ye.clientX-se.x,ye.clientY-se.y)>10&&(window.clearTimeout(se.timer),pn.current=null)}function ve(w){const se=pn.current;se&&(window.clearTimeout(se.timer),se.fired&&w.preventDefault())}function T(){var w;return(w=pn.current)!=null&&w.fired?(pn.current=null,!0):!1}function W(){const w=it==null?void 0:it.opener;Ut(null),w!=null&&w.isConnected&&w.focus()}function _e(){const w=vn==null?void 0:vn.opener;Sn(null),w!=null&&w.isConnected&&w.focus()}function Le(){const w=Wn==null?void 0:Wn.opener;ll(null),w!=null&&w.isConnected&&w.focus()}function $e(){const w=Vt==null?void 0:Vt.opener;Ul(null),w!=null&&w.isConnected&&w.focus()}function Ie(w){return{onContextMenu:se=>{se.preventDefault(),Ut({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:ss.targetsFor(w)})},onTouchStart:se=>_s(se,(ye,ze,bt)=>Ut({x:ye,y:ze,opener:bt,ids:ss.targetsFor(w)})),onTouchMove:Ct,onTouchEnd:ve,onTouchCancel:ve}}function At(w){return{onContextMenu:se=>{se.preventDefault(),Sn({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:Bn.targetsFor(w)})},onTouchStart:se=>_s(se,(ye,ze,bt)=>Sn({x:ye,y:ze,opener:bt,ids:Bn.targetsFor(w)})),onTouchMove:Ct,onTouchEnd:ve,onTouchCancel:ve}}function xt(w){return{onContextMenu:se=>{se.preventDefault(),ll({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:[w.id]})},onTouchStart:se=>_s(se,(ye,ze,bt)=>ll({x:ye,y:ze,opener:bt,ids:[w.id]})),onTouchMove:Ct,onTouchEnd:ve,onTouchCancel:ve}}function On(w){return{onContextMenu:se=>{se.preventDefault(),Ul({x:se.clientX,y:se.clientY,opener:se.currentTarget,ids:[w.id]})},onTouchStart:se=>_s(se,(ye,ze,bt)=>Ul({x:ye,y:ze,opener:bt,ids:[w.id]})),onTouchMove:Ct,onTouchEnd:ve,onTouchCancel:ve}}const Dt=((C?(En=g[C])==null?void 0:En.sessions:void 0)??[]).filter(w=>w.state!=="closed").length,mn=it?Ls.find(w=>w.id===it.ids[0]):void 0,jn=it?[{id:"close",label:it.ids.length>1?`Закрыть проекты (${it.ids.length})`:"Закрыть проект",onSelect:()=>{M(it.ids),ss.clear()}},...it.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const w=it.ids[0];Mn(w,!0),Tt(w)}}]:[],...it.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>sl(it.ids[0])}]:[],...ju({folders:d,ids:it.ids,hasFolder:(mn==null?void 0:mn.folderId)!=null,assign:(w,se)=>Z("workspace",w,se),onClear:()=>ss.clear(),onNewFolder:()=>zt("workspace")}),...it.ids.length===1&&ns?Ts.menuItems(it.ids[0],Es):[]]:[],al=it?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&it.ids.includes(C)&&Dt>0?` в нём сейчас незавершённых сессий: ${Dt} — при закрытии они остановятся на хосте.`:""):void 0,Is=vn?el.find(w=>w.id===vn.ids[0]):void 0,us=vn?[{id:"restore",label:vn.ids.length>1?`Вернуть проекты (${vn.ids.length})`:"Вернуть проект",onSelect:()=>{z(vn.ids),Bn.clear()}},...vn.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>sl(vn.ids[0])}]:[],...ju({folders:d,ids:vn.ids,hasFolder:(Is==null?void 0:Is.folderId)!=null,assign:(w,se)=>Z("workspace",w,se),onClear:()=>Bn.clear(),onNewFolder:()=>zt("workspace")})]:[],la=vn?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Zt=Wn?zs.find(w=>w.id===Wn.ids[0]):void 0,Il=Wn?[{id:"rename",label:"Переименовать",onSelect:()=>vt(Wn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Zt&&B(Zt.workspaceId,[Zt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Zt&&K(Zt.workspaceId,[Zt.id])}},...Zt&&Zt.workspaceId===C?ju({folders:h.filter(w=>w.workspaceId===Zt.workspaceId),ids:[Zt.id],hasFolder:Zt.folderId!=null,assign:(w,se)=>Z("session",w,se,Zt.workspaceId),onClear:()=>{},onNewFolder:()=>{Mn(Zt.workspaceId,!0),Tt(Zt.workspaceId)}}):[],...KN(Zt?ju({folders:m,ids:[Zt.id],hasFolder:Zt.pinnedFolderId!=null,assign:(w,se)=>Z("pinned",w,se),onClear:()=>{},onNewFolder:()=>zt("pinned")}):[]),...ns&&Zt?In.menuItems(Al(Zt),os):[]]:[],Jt=Vt?bs.find(w=>w.id===Vt.ids[0]):void 0,xr=Vt?[{id:"stop",label:"Остановить",onSelect:()=>{Jt&&$(Jt)}},{id:"rename",label:"Переименовать",onSelect:()=>vt(Vt.ids[0])},{id:"pin",label:(Jt==null?void 0:Jt.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Jt&&B(Jt.workspaceId,[Jt.id],Jt.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Jt&&K(Jt.workspaceId,[Jt.id])}},...ns&&Jt?_l.menuItems(Al(Jt),La):[]]:[],za={start:_s,move:Ct,end:ve,consumed:T};function il(w,se){return a.jsxs("div",{className:"row row--confirm",style:to(se),role:"alertdialog","aria-label":`Снять отметку с «${w.name}»`,children:[a.jsx("p",{className:"row__confirm-text",children:`Снять отметку с «${w.name}»? Каталог и файлы останутся на диске, сессии проекта будут остановлены.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>sl(null),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>{sl(null),R([w.id])},children:"Снять отметку"})]})]},w.id)}function vi(w,se){var Hn,It;const ye=se?1:0;if(yl===w.id)return il(w,ye);const ze=sa(w),bt=`ws-branch-${w.id}`;return a.jsxs(x.Fragment,{children:[a.jsxs("div",{"data-row-key":w.id,"data-row-scope":"workspaces",className:eo(w.id===C,ss.selected.includes(w.id),!1,!!se)+" row--project"+Ts.dropClass(w.id),style:bi(ye,jt(se)),...Ie(w),children:[Xr(se),ns&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в папку (каталог проекта переедет на диске) или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...Ts.gripHandlers(w.id),children:a.jsx(ff,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":ze.open,"aria-controls":bt,"aria-label":`${ze.open?"Свернуть":"Развернуть"} проект «${w.name}»`,title:ze.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{T()||Us(w,ze)},children:a.jsx(Tf,{open:ze.open})}),a.jsxs("button",{className:"row__main",onClick:gn=>{T()||ss.click(gn,w,()=>{Q(w.id),Mn(w.id,!0)})},onKeyDown:gn=>Ts.onKeyDown(w.id,gn),children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:w.path,children:oe===w.id?"переносим…":w.path})]}),a.jsx(Ay,{agg:Yt.byWorkspace.get(w.id)}),ze.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Всего сессий в проекте, запущенных и нет",children:ze.count})]}),ze.open&&a.jsx("div",{id:bt,role:"group","aria-label":`Сессии проекта «${w.name}»`,className:se?"tree__branch tree__branch--railed":"tree__branch",style:bi(ye,jt(se)),children:a.jsx(YN,{workspace:w,baseDepth:ye+1,loaded:ze.entry!==void 0,sessions:((Hn=ze.entry)==null?void 0:Hn.sessions)??Xb,archived:((It=ze.entry)==null?void 0:It.archived)??Xb,folders:h.filter(gn=>gn.workspaceId===w.id),needle:ft,showAll:ze.showAll,reorderEnabled:ns,listOrder:v,liveSessionsFirst:S,activeSessionId:A,archiveExpanded:ue.includes(w.id),onToggleArchive:()=>tl(w.id),creatingFolder:rs===w.id,onStartCreateFolder:()=>Tt(w.id),onFinishCreateFolder:()=>Tt(null),renamingId:st,setRenamingId:vt,renderFolderHead:Ia,liveInFolder:Yt.bySessionFolder,isFolderOpen:Je,folderRowStyle:jt,longPress:za,onOpenSession:Y,onRenameSession:V,onPinSessions:B,onArchiveSessions:K,onUnarchiveSessions:ie,onCreateFolder:q,onAssignToFolder:Z,onReorder:k})})]},w.id)}function ji(w){const se=Ss.get(w.id);if(!se)return null;const ye=X||zl.includes(w.id),ze=ye?se:se.slice(0,Vb),bt=se.length-ze.length,Hn=bi(1,jt(w));return a.jsxs("div",{role:"group","aria-label":`Не открытые в ccv каталоги папки «${w.name}»`,children:[ze.map(It=>a.jsxs("div",{className:"row row--foldered row--unopened",style:Hn,children:[Xr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened",title:`${It.path}
|
|
119
|
+
Не открыт в ccv — нажмите, чтобы открыть как проект`,onClick:()=>E(It.path),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true",children:a.jsx(PN,{})}),a.jsx("span",{className:"row__title",children:It.name})]})]},It.path)),(bt>0||ye&&!X&&se.length>Vb)&&a.jsxs("div",{className:"row row--foldered row--unopened",style:Hn,children:[Xr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened row__more","aria-expanded":ye,onClick:()=>Un(It=>It.includes(w.id)?It.filter(gn=>gn!==w.id):[...It,w.id]),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true"}),a.jsx("span",{className:"row__title",children:bt>0?`Ещё ${bt}`:"Свернуть"})]})]})]})}function aa(w,se){return yl===w.id?il(w,se?1:0):a.jsxs("div",{className:eo(w.id===C,Bn.selected.includes(w.id),!1,!!se),style:jt(se),...At(w),children:[Xr(se),a.jsxs("button",{className:"row__main",onClick:ye=>{T()||Bn.click(ye,w,()=>Q(w.id))},children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:hw(w)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>z([w.id]),children:"Вернуть"})]},w.id)}function Ua(w,se){const ye=Al(w);return a.jsxs("div",{"data-row-key":ye,"data-row-scope":"pinned",className:eo(w.id===A,!1,w.provider==="antigravity",!!se,!0)+In.dropClass(ye),style:jt(se),...st===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...xt(w)},children:[Xr(se),st===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:w.title??"",onCommit:ze=>{V(w,ze),vt(null)},onCancel:()=>vt(null)})}):a.jsxs(a.Fragment,{children:[ns&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...In.gripHandlers(ye),children:a.jsx(ff,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{T()||Y(w)},onKeyDown:ze=>In.onKeyDown(ye,ze),children:a.jsx(vf,{session:w,pinned:!1,projectName:xl(w.workspaceId),projectPath:Ol(w.workspaceId)})})]})]},w.id)}function ia(w){const se=Al(w);return a.jsx("div",{"data-row-key":se,"data-row-scope":"live",className:eo(w.id===A,!1,w.provider==="antigravity",!1,!0)+_l.dropClass(se),...st===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...On(w)},children:st===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:w.title??"",onCommit:ye=>{V(w,ye),vt(null)},onCancel:()=>vt(null)})}):a.jsxs(a.Fragment,{children:[ns&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",..._l.gripHandlers(se),children:a.jsx(ff,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{T()||Y(w)},onKeyDown:ye=>_l.onKeyDown(se,ye),children:a.jsx(vf,{session:w,pinned:w.pinned===!0,projectName:xl(w.workspaceId),projectPath:Ol(w.workspaceId)})}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:ye=>{ye.stopPropagation(),!T()&&$(w)},children:a.jsx(ew,{})})]})},w.id)}function Ia(w,se,ye={}){return a.jsx(JN,{folder:w,count:se,live:ye.live,depth:ye.depth??0,droppable:ye.droppable===!0,dropActive:ye.droppable===!0&&Ts.isDropFolder(w.id),open:Je(w.id),renaming:gs===w.id,onToggle:()=>rn(w.id),onStartRename:()=>gt(w.id),onCommitRename:ze=>{H(w.id,ze),gt(null)},onCancelRename:()=>gt(null),onDelete:()=>je(w.id),onOpenAsProject:w.id.startsWith("dir:")&&w.path?()=>E(w.path):void 0,color:et(w),onPreviewColor:ze=>{window.clearTimeout(ot.current),Te({folderId:w.id,color:ze})},onCommitColor:ze=>{Te({folderId:w.id,color:ze}),fe(w.id,ze),window.clearTimeout(ot.current),ot.current=window.setTimeout(()=>Te(null),4e3)},onResetColor:()=>{window.clearTimeout(ot.current),Te(null),fe(w.id,null)}},w.id)}return a.jsxs("aside",{className:n?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:l?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Fb[nn]}`,"aria-label":`Тема: ${Fb[nn]}. Переключить`,onClick:Pe,children:a.jsx(rw,{mode:nn})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":St==="default",className:St==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>We("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":St==="pinned",className:St==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>We("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":St==="live",className:St==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>We("live"),children:[a.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&a.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),a.jsxs("div",{className:"fssearch fssearch--sidebar",children:[a.jsx(nw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:sn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>Fn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),sn?Fn(""):w.currentTarget.blur())}}),sn&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Fn(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:St==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Zd,{title:"Закреплённые",count:zs.length,open:yn("pinned"),onToggle:()=>zn("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{zt("pinned"),yn("pinned")||zn("pinned")}}}),yn("pinned")&&a.jsxs(a.Fragment,{children:[Ze==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:"",placeholder:"Название папки",onCommit:w=>{q("pinned",w),zt(null)},onCancel:()=>zt(null)})})}),zs.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:X?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Rn.groups.map(w=>a.jsxs(x.Fragment,{children:[Ia(w.folder,w.items.length),Je(w.folder.id)&&w.items.map(se=>Ua(se,w.folder))]},w.folder.id)),Rn.ungrouped.map(w=>Ua(w))]})]}):St==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Zd,{title:"Запущенные",count:bs.length,open:yn("live"),onToggle:()=>zn("live")}),yn("live")&&a.jsxs(a.Fragment,{children:[bs.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:X?"Ничего не найдено":"Нет запущенных сессий"})}),bs.map(w=>ia(w))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Zd,{title:"Проекты",count:Ls.length,open:yn("workspaces"),onToggle:()=>zn("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{zt("workspace"),yn("workspaces")||zn("workspaces")}}}),yn("workspaces")&&a.jsxs(a.Fragment,{children:[L&&a.jsxs("div",{className:"sidebar__notice",role:"alert",children:[a.jsx("span",{children:L}),a.jsx("button",{type:"button",className:"sidebar__notice-close","aria-label":"Закрыть сообщение",onClick:U,children:"✕"})]}),Ze==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:"",placeholder:"Название папки",onCommit:w=>{q("workspace",w),zt(null)},onCancel:()=>zt(null)})})}),pe&&Ls.length===0&&Ss.size===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:X?"Ничего не найдено":"Пока ни одного"})}),nl.map(w=>a.jsxs(x.Fragment,{children:[Ia(w.folder,w.items.length,{droppable:ns,live:Yt.byWorkspaceFolder.get(w.folder.id)}),Je(w.folder.id)&&w.items.map(se=>vi(se,w.folder)),Je(w.folder.id)&&ji(w.folder)]},w.folder.id)),cs.ungrouped.map(w=>vi(w)),Ts.canUngroup&&a.jsx("div",{className:Ts.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Zd,{title:"Архив проектов",count:el.length,open:yn("workspacesArchive"),onToggle:()=>zn("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),yn("workspacesArchive")&&a.jsxs(a.Fragment,{children:[el.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:X?"Ничего не найдено":"Пока пусто"})}),Xt.groups.map(w=>a.jsxs(x.Fragment,{children:[Ia(w.folder,w.items.length),Je(w.folder.id)&&w.items.map(se=>aa(se,w.folder))]},w.folder.id)),Xt.ungrouped.map(w=>aa(w))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[dt.multi?a.jsxs("button",{className:"account-btn",title:"Аккаунты Claude",onClick:Ge,children:[a.jsx("span",{className:"account-btn__marks",children:dt.accounts.map(w=>{var ye;const se=((ye=dt.auth[w.id])==null?void 0:ye.loggedIn)===!1;return a.jsx("span",{className:se?"account-btn__mark is-out":"account-btn__mark",children:a.jsx(Oa,{account:w})},w.id)})}),a.jsx("span",{className:"account-btn__id",children:"Аккаунты Claude"}),dt.accounts.some(w=>{var se;return((se=dt.auth[w.id])==null?void 0:se.loggedIn)===!1})&&a.jsx("span",{className:"chip chip--warn",children:"нет входа"})]}):a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:Ge,children:[a.jsx("span",{className:le!=null&&le.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:le===null?"Аккаунт":le.loggedIn?le.email||"Вход выполнен":"Войти в аккаунт"}),(le==null?void 0:le.plan)&&a.jsx("span",{className:"chip",children:le.plan})]}),qt&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:qt,children:[a.jsx("span",{className:Re!=null&&Re.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Re===null?"Удалённый доступ":Re.paired?Re.connected?Re.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(Re==null?void 0:Re.connected)&&Re.clients>0&&a.jsx("span",{className:"chip",children:Re.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!Se,title:"MCP-серверы и плагины",onClick:()=>Se==null?void 0:Se(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:Xe,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:we,children:"+ Проект"}),a.jsx(BN,{disabled:!C,providers:me,lastAccountId:ke,onStart:P,onSignIn:G})]})]}),it&&a.jsx(mr,{x:it.x,y:it.y,items:jn,note:al,onClose:W}),vn&&a.jsx(mr,{x:vn.x,y:vn.y,items:us,note:la,onClose:_e}),Wn&&a.jsx(mr,{x:Wn.x,y:Wn.y,items:Il,note:Op,onClose:Le}),Vt&&a.jsx(mr,{x:Vt.x,y:Vt.y,items:xr,note:Op,onClose:$e})]})}const Xb=[];function ku(n,l){return(n.title??"").toLowerCase().includes(l)}function Xr(n){return n?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function bi(n,l){return{"--depth":n,...l}}function YN({workspace:n,baseDepth:l,loaded:r,sessions:c,archived:o,folders:d,needle:h,showAll:m,reorderEnabled:g,listOrder:b,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:S,creatingFolder:k,onStartCreateFolder:C,onFinishCreateFolder:A,renamingId:Q,setRenamingId:V,renderFolderHead:$,liveInFolder:B,isFolderOpen:Y,folderRowStyle:M,longPress:z,onOpenSession:R,onRenameSession:K,onPinSessions:ie,onArchiveSessions:q,onUnarchiveSessions:H,onCreateFolder:fe,onAssignToFolder:je,onReorder:Z}){var lt;const L=n.id,U=h!=="",oe=x.useMemo(()=>{const Te=of(c,b==null?void 0:b.sessions[L],Al,"top");return y?vy(Te):Te},[c,b,L,y]),pe=x.useMemo(()=>m?oe:oe.filter(Te=>ku(Te,h)),[oe,m,h]),we=x.useMemo(()=>m?o:o.filter(Te=>ku(Te,h)),[o,m,h]),E=x.useMemo(()=>Su(pe,d,void 0,!U),[pe,d,U]),P=x.useMemo(()=>Su(we,d),[we,d]),me=(((lt=b==null?void 0:b.sessions[L])==null?void 0:lt.length)??0)>0,ke=df({enabled:g,scope:"sessions",workspaceId:L,itemKey:Al,groups:E.groups,ungrouped:E.ungrouped,onReorder:Z}),G=Lp(pe),[Se,le]=x.useState(null),[Ge,Re]=x.useState(!1);x.useEffect(()=>Re(!1),[h]);const qt=U&&we.length>0,Xe=qt?!Ge:v;function nn(){const Te=Se==null?void 0:Se.opener;le(null),Te!=null&&Te.isConnected&&Te.focus()}function Pe(Te){return{onContextMenu:et=>{et.preventDefault(),le({x:et.clientX,y:et.clientY,opener:et.currentTarget,ids:G.targetsFor(Te)})},onTouchStart:et=>z.start(et,(jt,ot,Ze)=>le({x:jt,y:ot,opener:Ze,ids:G.targetsFor(Te)})),onTouchMove:z.move,onTouchEnd:z.end,onTouchCancel:z.end}}const dt=Se?pe.find(Te=>Te.id===Se.ids[0]):void 0,st=(dt==null?void 0:dt.pinned)!==!0,vt=Se?[...Se.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>V(Se.ids[0])}]:[],{id:"pin",label:st?Se.ids.length>1?`Закрепить (${Se.ids.length})`:"Закрепить":Se.ids.length>1?`Открепить (${Se.ids.length})`:"Открепить",onSelect:()=>{ie(L,Se.ids,st),G.clear()}},{id:"archive",label:Se.ids.length>1?`Убрать в архив (${Se.ids.length})`:"Убрать в архив",onSelect:()=>{q(L,Se.ids),G.clear()}},...ju({folders:d,ids:Se.ids,hasFolder:(dt==null?void 0:dt.folderId)!=null,assign:(Te,et)=>je("session",Te,et,L),onClear:()=>G.clear(),onNewFolder:C}),...Se.ids.length===1&&g&&dt?ke.menuItems(Al(dt),me):[]]:[];function gs(Te,et,jt){const ot=Al(Te);return a.jsxs("div",{"data-row-key":ot,"data-row-scope":"sessions",className:eo(Te.id===j,G.selected.includes(Te.id),Te.provider==="antigravity",!!jt,!0)+ke.dropClass(ot),style:bi(et,M(jt)),...Q===Te.id?{}:Pe(Te),children:[Xr(jt),Q===Te.id?a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:Te.title??"",onCommit:Ze=>{K(Te,Ze),V(null)},onCancel:()=>V(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...ke.gripHandlers(ot),children:a.jsx(ff,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:Ze=>{z.consumed()||G.click(Ze,Te,()=>R(Te))},onKeyDown:Ze=>ke.onKeyDown(ot,Ze),children:a.jsx(vf,{session:Te,pinned:Te.pinned===!0})}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{z.consumed()||V(Te.id)},children:"✎"})]})]},Te.id)}function gt(Te,et,jt){return a.jsxs("div",{className:eo(Te.id===j,!1,Te.provider==="antigravity",!!jt,!0),style:bi(et,M(jt)),children:[Xr(jt),a.jsx("button",{className:"row__main row__main--session",onClick:()=>R(Te),children:a.jsx(vf,{session:Te,pinned:!1,archived:!0})}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>H(L,[Te.id]),children:"Вернуть"})]},Te.id)}return a.jsxs(a.Fragment,{children:[k&&a.jsx("div",{className:"row row--hint",style:bi(l,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:"",placeholder:"Название папки",onCommit:Te=>{fe("session",Te,L),A()},onCancel:A})})}),r?pe.length===0&&a.jsx("div",{className:"row row--hint",style:bi(l,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:bi(l,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),E.groups.map(Te=>a.jsxs(x.Fragment,{children:[$(Te.folder,Te.items.length,{depth:l,live:B.get(Te.folder.id)}),Y(Te.folder.id)&&Te.items.map(et=>gs(et,l+1,Te.folder))]},Te.folder.id)),E.ungrouped.map(Te=>gs(Te,l)),r&&o.length>0&&(!U||we.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(XN,{title:"Архив",count:we.length,open:Xe,depth:l,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>qt?Re(Te=>!Te):S()}),Xe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:bi(l,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),P.groups.map(Te=>a.jsxs(x.Fragment,{children:[$(Te.folder,Te.items.length,{depth:l}),Y(Te.folder.id)&&Te.items.map(et=>gt(et,l+1,Te.folder))]},Te.folder.id)),P.ungrouped.map(Te=>gt(Te,l))]})]}),Se&&a.jsx(mr,{x:Se.x,y:Se.y,items:vt,note:Op,onClose:nn})]})}function XN({title:n,count:l,open:r,depth:c,hint:o,onToggle:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsx("div",{className:"row",style:to(c),children:a.jsxs("button",{className:"row__main",style:Sy,"aria-expanded":r,title:`${h} — ${o}`,onClick:d,children:[a.jsx(Tf,{open:r}),a.jsx("span",{style:Ty,children:n}),a.jsx("span",{className:"sidebar__count",children:l})]})})}function eo(n,l,r,c,o){const d=["row"];return o&&d.push("row--session"),c&&d.push("row--foldered"),n&&d.push("row--active"),l&&d.push("row--selected"),r&&d.push("row--antigravity"),d.join(" ")}function Su(n,l,r=o=>o.folderId,c=!1){const o=new Map(l.map(g=>[g.id,g])),d=new Map,h=[];for(const g of n){const b=r(g),y=b?o.get(b):void 0;if(!y){h.push(g);continue}const j=d.get(y.id);j?j.push(g):d.set(y.id,[g])}if(c)for(const g of l)d.has(g.id)||d.set(g.id,[]);return{groups:[...d.entries()].map(([g,b])=>({folder:o.get(g),items:b})).sort((g,b)=>g.folder.name.localeCompare(b.folder.name,"ru")),ungrouped:h}}function VN(n,l,r){return[...n.flatMap(c=>c.items.map(r)),...l.map(r)]}const uf="\0ungrouped";function QN(n,l,r){const c=new Map;for(const o of n)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of l)c.set(r(o),uf);return c}function hp(n,l,r,c,o){const d=[...l.map(m=>m.items),r].find(m=>m.some(g=>c(g)===n));if(!d)return null;const h=d.findIndex(m=>c(m)===n);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function df(n){const[l,r]=x.useState(null),[c,o]=x.useState(null),[d,h]=x.useState(null),m=n.onMoveToGroup,g=x.useMemo(()=>VN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),b=x.useMemo(()=>QN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),y=x.useRef({raf:0,el:null,x:0,y:0}),j=x.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function S(q){v();const H=y.current;if(H.el=q.closest(".sidebar__scroll"),!H.el)return;const fe=56,je=16,Z=()=>{const L=H.el;if(!L)return;const U=L.getBoundingClientRect();let oe=0;if(H.y<U.top+fe?oe=-je*Math.min(1,(U.top+fe-H.y)/fe):H.y>U.bottom-fe&&(oe=je*Math.min(1,(H.y-(U.bottom-fe))/fe)),oe!==0){const pe=L.scrollTop;L.scrollTop=pe+oe,L.scrollTop!==pe&&j.current(H.x,H.y)}H.raf=window.requestAnimationFrame(Z)};H.raf=window.requestAnimationFrame(Z)}x.useEffect(()=>v,[]);function k(){v(),r(null),o(null),h(null)}function C(q,H){n.enabled&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),y.current.x=H.clientX,y.current.y=H.clientY,S(H.currentTarget),r(q),o(null),h(null))}function A(q,H){if(!l)return;const fe=document.elementFromPoint(q,H),je=b.get(l);if(m){const we=fe==null?void 0:fe.closest("[data-drop-folder]"),E=we?null:fe==null?void 0:fe.closest("[data-drop-zone]");if(we||E){const P=we?we.dataset.dropFolder:null,me=P??uf;o(null),h(me===je?null:{folderId:P});return}}const Z=fe==null?void 0:fe.closest("[data-row-key]"),L=(Z==null?void 0:Z.dataset.rowScope)===n.scope?Z.dataset.rowKey:void 0,U=L?b.get(L):void 0;if(h(null),!L||L===l||U===void 0||!m&&U!==je){o(null);return}const oe=Z.getBoundingClientRect(),pe=H-oe.top<oe.height/2?"before":"after";o(we=>(we==null?void 0:we.key)===L&&we.position===pe?we:{key:L,position:pe})}j.current=A;function Q(q){y.current.x=q.clientX,y.current.y=q.clientY,A(q.clientX,q.clientY)}function V(){if(l&&d&&m)m(l,{folderId:d.folderId,order:null});else if(l&&c){const q=Fd(g,l,c.key,c.position),H=b.get(c.key);m&&H!==b.get(l)?m(l,{folderId:H===uf?null:H??null,order:q}):q&&n.onReorder(n.scope,q,n.workspaceId)}k()}function $(q,H){if(!n.enabled)return;const fe=hp(q,n.groups,n.ungrouped,n.itemKey,H);if(!fe)return;const je=Fd(g,q,fe.target,fe.position);je&&n.onReorder(n.scope,je,n.workspaceId)}function B(q,H){const fe=hp(q,n.groups,n.ungrouped,n.itemKey,"up"),je=hp(q,n.groups,n.ungrouped,n.itemKey,"down"),Z=[{id:"move-up",label:"Переместить выше",disabled:!fe,onSelect:()=>{if(!fe)return;const L=Fd(g,q,fe.target,fe.position);L&&n.onReorder(n.scope,L,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!je,onSelect:()=>{if(!je)return;const L=Fd(g,q,je.target,je.position);L&&n.onReorder(n.scope,L,n.workspaceId)}}];return H&&Z.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),Z}function Y(q){return l===q?" row--dragging":(c==null?void 0:c.key)===q?c.position==="before"?" row--drop-before":" row--drop-after":""}function M(q){return{onPointerDown:H=>C(q,H),onPointerMove:Q,onPointerUp:V,onPointerCancel:k,onLostPointerCapture:k}}function z(q,H){!H.altKey||H.key!=="ArrowUp"&&H.key!=="ArrowDown"||(H.preventDefault(),$(q,H.key==="ArrowUp"?"up":"down"))}const R=q=>(d==null?void 0:d.folderId)===q,K=!!m&&l!==null&&b.get(l)!==uf,ie=d!==null&&d.folderId===null;return{dragging:l!==null,dropClass:Y,gripHandlers:M,onKeyDown:z,menuItems:B,isDropFolder:R,canUngroup:K,zoneActive:ie}}function ju(n){return[...[...n.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,r.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(r=>n.assign(r,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function KN(n){return n.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Lp(n){const[l,r]=x.useState([]),c=x.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(y=>y.includes(g.id)?y.filter(j=>j!==g.id):[...y,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const y=n.findIndex(v=>v.id===c.current),j=n.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,S]=y<j?[y,j]:[j,y];r(n.slice(v,S+1).map(k=>k.id));return}}o(),c.current=g.id,b()}function h(m){return l.includes(m.id)?l:(r([m.id]),c.current=m.id,[m.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const FN={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},ZN={width:22,height:22,borderRadius:6};function Zd({title:n,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:FN,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(Tf,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:l})]}),d&&a.jsx("button",{className:"theme-btn",style:ZN,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(sw,{})})]})}function to(n){return{paddingLeft:`calc(37px + ${n} * var(--tree-indent, 24px))`}}const Sy={display:"flex",alignItems:"center",gap:6,width:"100%"},Ey={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500},Ty={...Ey,color:"var(--muted)",fontSize:12.5};function JN({folder:n,count:l,live:r,open:c,renaming:o,onToggle:d,onStartRename:h,onCommitRename:m,onCancelRename:g,onDelete:b,onOpenAsProject:y,color:j,onPreviewColor:v,onCommitColor:S,onResetColor:k,depth:C,droppable:A,dropActive:Q}){const V=x.useRef(null),[$,B]=x.useState(!1),[Y,M]=x.useState(!1),z=x.useRef(S);if(z.current=S,x.useEffect(()=>{const R=V.current;if(!R)return;const K=()=>z.current(R.value);return R.addEventListener("change",K),()=>R.removeEventListener("change",K)},[o]),Y&&y)return a.jsxs("div",{className:"row row--confirm",style:to(C),role:"alertdialog","aria-label":`Открыть «${n.name}» как проект`,children:[a.jsx("p",{className:"row__confirm-text",children:`Открыть «${n.name}» как проект? Проекты внутри останутся открытыми, но без папки.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>M(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm",autoFocus:!0,onClick:()=>{M(!1),y()},children:"Открыть как проект"})]})]});if($){const R=n.id.startsWith("dir:");return a.jsxs("div",{className:"row row--confirm",style:to(C),role:"alertdialog","aria-label":`Удалить папку «${n.name}»`,children:[a.jsx("p",{className:"row__confirm-text",children:R?`Удалить папку «${n.name}»? Проекты внутри поднимутся в корень проектов, ничего не удаляется.`:`Удалить папку «${n.name}»? Её содержимое останется, просто без папки.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>B(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>{B(!1),b()},children:"Удалить папку"})]})]})}return o?a.jsx("div",{className:"row",style:to(C),children:a.jsx("div",{className:"row__main",children:a.jsx(Ra,{value:n.name,placeholder:"Название папки",onCommit:m,onCancel:g})})}):a.jsxs("div",{className:Q?"row row--drop-target":"row",style:to(C),"data-drop-folder":A?n.id:void 0,children:[a.jsxs("button",{className:"row__main",style:Sy,"aria-expanded":c,title:c?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:d,children:[a.jsx(Tf,{open:c}),a.jsx("span",{style:C>0?Ty:Ey,children:n.name}),!c&&a.jsx(Ay,{agg:r}),a.jsx("span",{className:"sidebar__count",children:l})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:h,children:"✎"}),a.jsxs("label",{className:j?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:j?{background:j}:void 0}),a.jsx("input",{ref:V,type:"color",value:j??WN(),"aria-label":`Цвет папки «${n.name}»`,onChange:R=>v(R.target.value)})]}),n.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:k,children:"↺"}),y&&a.jsx("button",{className:"row__edit row__edit--text",title:"Открыть каталог как проект: подойдёт, если в нём нет git","aria-label":`Это проект: открыть «${n.name}» как проект`,onClick:()=>M(!0),children:"Это проект"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — проекты и сессии внутри останутся, просто без папки","aria-label":`Удалить папку «${n.name}»`,onClick:()=>B(!0),children:"✕"})]})}function WN(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}const Vb=8;function PN(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",children:a.jsx("path",{d:"M2 4.5A1.5 1.5 0 0 1 3.5 3h2.6l1.4 1.5h5A1.5 1.5 0 0 1 14 6v5.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 11.5z"})})}function Tf({open:n}){return a.jsx("svg",{className:n?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function ff(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"5.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"5.5",cy:"12",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"4",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"8",r:"1.15"}),a.jsx("circle",{cx:"10.5",cy:"12",r:"1.15"})]})}function ew(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function tw({className:n}){return a.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),a.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),a.jsx("path",{d:"M8 12.2v1.4"})]})}function nw(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function sw(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function lw(){try{const n=localStorage.getItem(Ny);if(n===null)return["workspacesArchive"];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Qb(n){try{const l=localStorage.getItem(n);if(l===null)return[];const r=JSON.parse(l);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Kb(n,l){try{localStorage.setItem(n,JSON.stringify(l))}catch{}}function aw(){try{const n=localStorage.getItem(ky);if(n===null)return[];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function iw(){try{const n=localStorage.getItem(wy);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Fb={system:"как в системе",light:"светлая",dark:"тёмная"};function rw({mode:n}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?a.jsx("svg",{...l,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):n==="light"?a.jsxs("svg",{...l,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...l,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Zb(n){const l=cw(n),r=(n.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${l} · ${jy(r)}`:l}function cw(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":ow(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function ow(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Cy(n){switch(n.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return n.backgroundWork?"background":uw(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function uw(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function vf({session:n,pinned:l,projectName:r,projectPath:c,archived:o}){const d=o?"closed":Cy(n);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`row__lead row__state--${d}`,"aria-hidden":"true",children:a.jsx("span",{className:"row__state-dot"})}),a.jsxs("span",{className:"row__body"+(r!==void 0?" row__body--with-project":"")+(o?" row__body--archived":""),title:o?fw(n):`${Zb(n)} · ${new Date(n.updatedAt).toLocaleString()}`,children:[a.jsx(dw,{title:n.title??"Без названия",pinned:l,provider:n.provider,accountId:n.accountId,projectName:r,projectPath:c}),o?a.jsxs("span",{className:"row__meta row__vh row__vh--wide",children:[a.jsx("span",{className:"row__state",children:n.archivedAuto?"по сроку":"вручную"}),n.archivedAt?a.jsx("span",{className:"row__time",children:` · ${mp(n.archivedAt)}`}):null]}):a.jsxs("span",{className:`row__meta${d==="closed"?` row__vh${r===void 0?" row__vh--time":""}`:""}`,children:[a.jsx("span",{className:`row__state row__state--${d}${d==="closed"?" row__vh":""}`,children:Zb(n)}),r===void 0&&a.jsx("span",{className:"row__time",children:d==="closed"?mp(n.updatedAt):` · ${mp(n.updatedAt)}`})]})]})]})}const Jb=["waiting","error","running","reconnecting","background","starting","halted","ready","fresh","closed"];function pp(n,l,r){const c=n.get(l);if(!c){n.set(l,{count:1,tone:r,waiting:r==="waiting"?1:0});return}c.count+=1,r==="waiting"&&(c.waiting+=1),Jb.indexOf(r)<Jb.indexOf(c.tone)&&(c.tone=r)}function Ay({agg:n}){if(!n)return null;const l=`Запущено сессий: ${n.count}`,r=n.waiting>0?`${l}, ждут решения: ${n.waiting}`:l;return a.jsxs("span",{className:`row__live row__state--${n.tone}`,role:"img","aria-label":r,title:r,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),a.jsx("span",{"aria-hidden":"true",children:n.count})]})}function dw({title:n,pinned:l,provider:r,accountId:c,projectName:o,projectPath:d}){const h=gv(c,r);return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[l&&a.jsx(tw,{className:"row__pin"}),h&&a.jsx(Oa,{account:h,className:"row__acct"}),r==="antigravity"&&a.jsx(nm,{className:"row__provider"}),n]}),o!==void 0&&a.jsx("span",{className:"row__project",title:d,children:o})]})}function mp(n){const l=new Date(n);return l.toDateString()===new Date().toDateString()?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"})}function fw(n){const l=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${l}`:l}function hw(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Wb=3,pw=15e5;function My(n,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(n==="Write"){if(typeof r.content!="string")return null;const o=gp(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=bw(mw(gp(r.old_string),gp(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function gp(n){if(n==="")return[];const l=n.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function mw(n,l){let r=0;for(;r<n.length&&r<l.length&&n[r]===l[r];)r++;let c=n.length,o=l.length;for(;c>r&&o>r&&n[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...n.slice(0,r).map(d),...gw(n.slice(r,c),l.slice(r,o)),...n.slice(c).map(d)]}function gw(n,l){if(n.length===0&&l.length===0)return[];if(n.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return n.map(y=>({type:"del",text:y}));if((n.length+1)*(l.length+1)>pw)return[...n.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const r=n.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=n[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const y=n[g],j=l[b];y===j?(m.push({type:"ctx",text:y}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:n[g++]});for(;b<c;)m.push({type:"add",text:l[b++]});return xw(m)}function xw(n){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of n)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function bw(n){if(!n.some(d=>d.type!=="ctx"))return n;const l=n.map(()=>!1);n.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Wb);m<=Math.min(n.length-1,h+Wb);m++)l[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${_w(c.length)} без изменений`}),c=[]}return n.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function _w(n){const l=n%100;if(l>=11&&l<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Da(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const l=document.createElement("textarea");l.value=n,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function zp(){try{return await navigator.clipboard.readText()}catch{return null}}const sm=1600,Pr="Копировать",io="Скопировано";function xo({text:n,hint:l,className:r}){const[c,o]=x.useState(!1);return x.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),sm);return()=>clearTimeout(d)},[c]),x.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?io:`${Pr} ${l}`,title:c?io:`${Pr} ${l}`,onClick:()=>{Da(n).then(d=>{d&&o(!0)})},children:c?io:Pr})}function lm({diff:n}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&a.jsx("div",{className:"diff__note",children:n.note}),a.jsx("div",{className:"diff__body",children:n.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((l,r)=>a.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function yw({waiting:n}){const[l,r]=x.useState(0);return x.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:n?"work work--wait":"work",children:[a.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:n?"ждёт разрешения":"думает"}),!n&&a.jsxs("span",{className:"work__time",children:[l," с"]})]})}function am({items:n,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=x.useRef(null),j=x.useRef(null),v=x.useRef(!0),S=x.useRef(null),k=x.useRef(null),C=x.useRef(!1);x.useEffect(()=>{v.current=!0,S.current=null,C.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[m]),x.useEffect(()=>{const B=y.current,Y=j.current;if(!B||!Y)return;function M(K){!B||K===B.scrollTop||(C.current=!0,B.scrollTop=K)}function z(){if(!B)return;const K=S.current;if(K){const ie=e_(B,K.id);if(ie){const q=ie.getBoundingClientRect().top-B.getBoundingClientRect().top;M(B.scrollTop+(q-K.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{S.current=null},500);return}v.current&&M(B.scrollHeight)}const R=new ResizeObserver(z);return R.observe(Y),()=>{R.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function A(){const B=y.current;if(B){if(C.current){C.current=!1;return}v.current=B.scrollHeight-B.scrollTop-B.clientHeight<80}}function Q(){if(d)return;const B=y.current,Y=c[0];if(B&&Y){const M=e_(B,Y.id);M&&(S.current={id:Y.id,top:M.getBoundingClientRect().top-B.getBoundingClientRect().top})}h==null||h()}let V=0;function $(B){return B.kind==="user"?V++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:A,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:Q,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(B=>a.jsx(Pb,{item:B,userIndex:$(B),onEditMessage:g},B.id)),c.length>0&&n.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&a.jsx("p",{className:"empty",children:b}),n.map(B=>a.jsx(Pb,{item:B,userIndex:$(B),onEditMessage:g},B.id)),l&&a.jsx(yw,{waiting:r})]})})}function Pb({item:n,userIndex:l,onEditMessage:r}){switch(n.kind){case"user":return a.jsx(jw,{item:n,userIndex:l,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(Nw,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(xo,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return a.jsx(kw,{item:n});case"result":return a.jsxs("div",{className:"result-line","data-item-id":n.id,children:[a.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),a.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&a.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",n_(n.inputTokens)," ↓",n_(n.outputTokens)]})]});case"notice":return a.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const vw=500;function jw({item:n,userIndex:l,onEditMessage:r}){const[c,o]=x.useState(null),[d,h]=x.useState(!1),[m,g]=x.useState(n.text),b=x.useRef(null),y=x.useRef(!1),j=wf("(max-width: 860px)"),v=x.useRef(null);function S(R,K){o({x:R,y:K})}function k(R){R.preventDefault(),S(R.clientX,R.clientY)}function C(R){const K=R.touches[0];if(!K)return;const ie={timer:0,x:K.clientX,y:K.clientY,fired:!1};ie.timer=window.setTimeout(()=>{ie.fired=!0,S(ie.x,ie.y)},vw),v.current=ie}function A(R){const K=v.current,ie=R.touches[0];!K||!ie||Math.hypot(ie.clientX-K.x,ie.clientY-K.y)>10&&(window.clearTimeout(K.timer),v.current=null)}function Q(R){const K=v.current;K&&(window.clearTimeout(K.timer),K.fired&&R.preventDefault())}function V(){g(n.text),h(!0)}function $(){h(!1)}function B(){const R=m.trim();if(R===""&&!(n.images&&n.images.length>0))return;const K=r==null?void 0:r(l,R,n.images);if(K instanceof Promise){if(y.current)return;y.current=!0,K.then(ie=>{y.current=!1,ie&&h(!1)},()=>{y.current=!1});return}K!==!1&&h(!1)}x.useEffect(()=>{const R=b.current;!R||!d||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,d]),x.useEffect(()=>{if(!d)return;const R=b.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[d]);function Y(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),$();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),B())}const M=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((R,K)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},K))});if(d){const R=m.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[M,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:K=>g(K.target.value),onKeyDown:Y,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:$,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:B,disabled:!R,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Da(n.text)},...r?[{id:"edit",label:"Изменить",onSelect:V}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:C,onTouchMove:A,onTouchEnd:Q,onTouchCancel:Q,children:[M,n.text,c&&a.jsx(mr,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function e_(n,l){const r=n.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function Nw({text:n}){const[l,r]=x.useState(""),c=x.useRef([]);x.useEffect(()=>{let d=!1;return Ef(n).then(h=>{d||r(ww(h))}),()=>{d=!0}},[n]),x.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&Da(m).then(y=>{if(!y)return;h.textContent=io,h.setAttribute("aria-label",io),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Pr,h.setAttribute("aria-label",Up),h.classList.remove("copybtn--done"))},sm);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Up=`${Pr} блок кода`;function ww(n){if(!n.includes("<pre"))return n;const l=new DOMParser().parseFromString(n,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Up),o.title=Up,o.textContent=Pr,c.append(o)}return l.body.innerHTML}function kw({item:n}){const[l,r]=x.useState(!1),c=n.result===null,o=My(n.name,n.input),d=n.name==="AskUserQuestion"?Tw(n.input):null;return a.jsxs("div",{className:"tool"+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:n.name}),a.jsx("span",{className:"tool__arg",children:d?Ew(d):Sw(n.input)}),a.jsx("span",{className:"tool__status",children:c?"…":n.isError?"ошибка":l?"▴":"▾"})]}),l&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(Cw,{questions:d,answers:n.answers}):o?a.jsx(lm,{diff:o}):a.jsx(t_,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!d||n.isError)&&a.jsx(t_,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function t_({text:n,hint:l,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(xo,{text:n,hint:l,className:"codeblock__copy"})]})}function Sw(n){if(!n||typeof n!="object")return"";const l=n;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function Ew(n){var r;const l=n.map(c=>c.header).filter(c=>c.length>0);return l.length===n.length?l.join(" · "):((r=n[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function Tw(n){if(typeof n!="object"||n===null)return null;const l=n.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:y,description:j,preview:v}=b;if(typeof y!="string"||typeof j!="string")return null;g.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function Cw({questions:n,answers:l}){return a.jsx("div",{className:"tool__questions",children:n.map((r,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[r.header&&a.jsx("span",{className:"chip chip--accent",children:r.header}),a.jsx("span",{className:"tool__question-text",children:r.question})]}),a.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?a.jsx("span",{className:"tool__answer-value",children:l[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function n_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const Aw="ccv.dictation.lang",s_="ru-RU";function Mw(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function l_(){const n=window,l=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(Mw);return!r&&l.length>0&&Pl("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function Ry(){var n;try{return((n=localStorage.getItem(Aw))==null?void 0:n.trim())||s_}catch{return s_}}function Pl(n,l){l===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,l)}const Rw=3,Dw=400,Ow=5,Lw=250,zw=2e3,Uw=2e4;async function Iw(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Bw={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Ry()}`};function Hw(n){const[l]=x.useState(()=>l_()!==null),[r,c]=x.useState(!1),[o,d]=x.useState(null),h=x.useRef(null),m=x.useRef(!1),g=x.useRef(!1),b=x.useRef(n),y=x.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=x.useRef(null),v=x.useRef(!1),S=x.useRef(null),k=x.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),C=x.useCallback(()=>{k();const B=async Y=>{if(S.current=null,!(!m.current||v.current)){if(!Y&&!await Iw()){if(Pl("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;S.current=setTimeout(()=>void B(!0),Uw);return}Pl("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void B(!1),zw)},[k]);x.useEffect(()=>{b.current=n}),x.useEffect(()=>{const B=l_();if(!B)return;const Y=new B;return Y.lang=Ry(),Y.continuous=!0,Y.interimResults=!0,Y.onstart=()=>{Pl("сессия открыта"),v.current=!0,k(),c(!0)},Y.onaudiostart=()=>{Pl("пошёл звук с микрофона"),y.current.audio=!0},Y.onresult=M=>{var ie;if(g.current)return;let z="",R="";for(let q=M.resultIndex;q<M.results.length;q++){const H=M.results[q];if(!H)continue;const fe=((ie=H[0])==null?void 0:ie.transcript)??"";H.isFinal?z+=fe:R+=fe}const K=y.current;K.heard=!0,K.everHeard=!0,Pl("распознано",{final:z,interim:R}),b.current(z,R)},Y.onerror=M=>{y.current.lastError=M.error,Pl("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(Bw[M.error]??`Распознавание не работает: ${M.error}`))},Y.onend=()=>{g.current=!1,v.current=!1;const M=y.current,z=Date.now()-M.openedAt;if(Pl("сессия закрыта",{мс:z,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&z<Dw?M.dead+1:0,M.dead>=Ow){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=Rw&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",C();try{Y.start()}catch{}}},Lw)},h.current=Y,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),Y.onend=null,Y.onresult=null,Y.onerror=null,Y.onstart=null,Y.onaudiostart=null,Y.abort(),h.current=null}},[]);const A=x.useCallback(()=>{var B;if(m.current){if(m.current=!1,Pl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(B=h.current)==null||B.stop()}},[]),Q=x.useCallback(()=>{const B=h.current;if(B){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,y.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Pl("включение микрофона",{язык:B.lang}),C();try{B.start()}catch(Y){Pl("start() не прошёл",Y)}}},[C]),V=x.useCallback(()=>{m.current?A():Q()},[Q,A]),$=x.useCallback(()=>{var B;m.current&&v.current&&(g.current=!0,(B=h.current)==null||B.abort())},[]);return{supported:l,listening:r,error:o,toggle:V,stop:A,drop:$}}const $w="(max-width: 860px)",a_=/^\/(\S*)$/,qw=new Set(["model","permissions"]);function Gw(n){return qw.has(n.name)||n.name.startsWith("__")}const Yw=new Set(["clear","rename"]),i_=/(?:^|\s)@([^\s@]*)$/,Xw=200,Vw=100,Qw=190,Kw=5,Fw=20*1024*1024,Zw=1568,Jw=.85;let r_=0;async function Ww(n){var j,v;if(!n.type.startsWith("image/")||n.size>Fw)return null;const l=await Pw(n);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,Zw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,d.width,d.height),(v=(j=l.image).close)==null||v.call(j);const m=n.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:Jw),y=b.slice(b.indexOf(",")+1);return y?(r_+=1,{id:`att${r_}`,mediaType:g,data:y,previewUrl:b}):null}async function Pw(n){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(n);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function Dy({disabled:n,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:S,onSend:k,onInterrupt:C,onEscape:A}){var ft;const Q=wf($w),[V,$]=x.useState(()=>m?sp(m):""),[B,Y]=x.useState(!1),[M,z]=x.useState(0),R=x.useRef(null),K=x.useRef(null),ie=x.useRef(!1),q=x.useRef(null),[H,fe]=x.useState(()=>m?sp(m).length:0),[je,Z]=x.useState([]),L=x.useRef(null),U=x.useCallback(X=>{!y||X.length===0||Promise.all(X.map(Ww)).then(ge=>{const De=ge.filter(He=>He!==null);De.length!==0&&Z(He=>[...He,...De].slice(0,Kw))})},[y]);function oe(X){Z(ge=>ge.filter(De=>De.id!==X))}function pe(X){var He;if(!y)return;const ge=(He=X.clipboardData)==null?void 0:He.items;if(!ge)return;const De=[];for(const Yt of ge){if(!Yt.type.startsWith("image/"))continue;const ts=Yt.getAsFile();ts&&De.push(ts)}De.length!==0&&(X.preventDefault(),U(De))}function we(X){const ge=X.target.files?Array.from(X.target.files):[];X.target.value="",U(ge)}x.useEffect(()=>{y||Z([])},[y]);const[E,P]=x.useState([]),[me,ke]=x.useState(-1),G=x.useRef(""),[Se,le]=x.useState(""),Ge=Hw(x.useCallback((X,ge)=>{X&&$(De=>xp(De,X)),le(ge.trim())},[])),Re=Se?xp(V,Se):V;x.useEffect(()=>{Ge.listening||Se===""||($(X=>xp(X,Se)),le(""))},[Ge.listening,Se]),x.useEffect(()=>{var X;b&&((X=R.current)==null||X.focus())},[b]);const qt=x.useRef(new Map),Xe=x.useRef(new Map),nn=x.useRef(m),Pe=x.useRef({text:V,caret:H});Pe.current={text:V,caret:H};const dt=x.useCallback((X,ge,De)=>{ge===""?(qt.current.delete(X),Xe.current.delete(X)):(qt.current.set(X,ge),Xe.current.set(X,De)),G_(X,ge)},[]),st=Ge.drop;x.useLayoutEffect(()=>{const X=nn.current;if(X===m)return;nn.current=m,X&&dt(X,Pe.current.text,Pe.current.caret);const ge=m?qt.current.get(m)??sp(m):"",De=m?Xe.current.get(m):void 0,He=Math.min(De??ge.length,ge.length);$(ge),fe(He),q.current=[He,He],le(""),z(0),Y(!1),ke(-1),G.current="",Z([]),st()},[m,dt,st]),x.useEffect(()=>{m&&dt(m,V,H)},[m,V,H,dt]);const vt=n?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",gs=x.useRef(0),gt=x.useCallback(X=>{const ge=parseFloat(getComputedStyle(X).maxHeight),De=Number.isFinite(ge)&&ge>0?ge:Qw;X.style.height="auto";const He=X.scrollHeight;X.style.height=`${Math.min(He,De)}px`,X.style.overflowY=He>De?"auto":"hidden"},[]);x.useEffect(()=>{const X=R.current;X&>(X)},[Re,vt,n,gt]),x.useLayoutEffect(()=>{const X=R.current,ge=q.current;!X||!ge||(q.current=null,X.setSelectionRange(ge[0],ge[1]))}),x.useEffect(()=>{const X=R.current;if(!X)return;const ge=new ResizeObserver(([De])=>{const He=De==null?void 0:De.contentRect.width;He===void 0||Math.abs(He-gs.current)<1||(gs.current=He,gt(X))});return ge.observe(X),()=>ge.disconnect()},[gt]);const lt=Ge.stop;x.useEffect(()=>{n&<()},[n,lt]);const Te=x.useMemo(()=>Ge.error?{ok:!1,message:Ge.error}:null,[Ge.error]),et=x.useMemo(()=>{var De;const X=(De=a_.exec(V))==null?void 0:De[1];if(X===void 0)return[];const ge=X.toLowerCase();return r.filter(He=>!Gw(He)&&bp(He,ge)<Oy).sort((He,Yt)=>bp(He,ge)-bp(Yt,ge))},[V,r]),jt=!B&&et.length>0,ot=Math.min(M,et.length-1),Ze=B?null:((ft=i_.exec(Re.slice(0,H)))==null?void 0:ft[1])??null,zt=x.useRef(v);zt.current=v,x.useEffect(()=>{if(Ze===null||Ze===""||Ze.endsWith("/")){zt.current(Ze);return}const X=setTimeout(()=>zt.current(Ze),Xw);return()=>clearTimeout(X)},[Ze]);const rs=Ze!==null&&(o==null?void 0:o.query)===Ze,Tt=rs?o.entries:[],sn=Ze!==null,Fn=sn&&!rs,_n=Math.min(M,Math.max(Tt.length-1,0));x.useEffect(()=>{var ge,De;if(!jt&&!sn)return;const X=jt?ot:_n;(De=(ge=K.current)==null?void 0:ge.children[X])==null||De.scrollIntoView({block:"nearest"})},[jt,sn,ot,_n]);function An(X,ge){var De;$(X),fe(ge),q.current=[ge,ge],z(0),Y(!1),Se!==""&&(le(""),Ge.drop()),(De=R.current)==null||De.focus()}function xs(){$(""),le(""),z(0),fe(0),Y(!1),ke(-1),G.current="",Z([]),Ge.drop(),m&&dt(m,"",0)}function ln(X){const ge=X.trim();if(ge===""&&je.length===0||n||j||ie.current)return;const De=k(ge,je.length>0?je.map(He=>({mediaType:He.mediaType,data:He.data})):void 0);if(De instanceof Promise){ie.current=!0,De.then(He=>{ie.current=!1,He&&St(ge)},()=>{ie.current=!1});return}De!==!1&&St(ge)}function St(X){X!==""&&P(ge=>[X,...ge.filter(De=>De!==X)].slice(0,Vw)),xs()}function Zn(X){if(X<-1||X>=E.length)return;me===-1&&(G.current=V);const ge=X===-1?G.current:E[X]??"";ke(X),An(ge,ge.length)}function Gt(){var He;const X=((He=R.current)==null?void 0:He.selectionStart)??Re.length,De=`${X>0&&!/\s$/.test(Re.slice(0,X))?" ":""}@`;An(Re.slice(0,X)+De+Re.slice(X),X+De.length)}function Jn(X){var Yt;const ge=(Yt=i_.exec(Re.slice(0,H)))==null?void 0:Yt[1];if(ge===void 0)return;const De=H-ge.length-1,He=X.kind==="dir"?`@${X.path}/`:`@${X.path} `;An(Re.slice(0,De)+He+Re.slice(H),De+He.length)}function ue(){var ge;if(j)return;const X=(ge=a_.exec(Re.trim()))==null?void 0:ge[1];if(X&&S(X)){xs();return}ln(Re)}function Ne(X,ge){$(X),fe(ge),z(0),Y(!1),ke(-1),Se!==""&&(le(""),Ge.drop())}function Ve(X){var He;const ge=Yw.has(X.name)?c:null,De=`/${X.name} `;$(De+(ge??"")),fe(De.length+((ge==null?void 0:ge.length)??0)),ge&&(q.current=[De.length,De.length+ge.length]),z(0),(He=R.current)==null||He.focus()}function at(X){if(S(X.name)){$(""),z(0),Y(!1);return}X.argumentHint?Ve(X):ln(`/${X.name}`)}function We(X){if(jt){if(X.key==="ArrowDown")return X.preventDefault(),z(ge=>(Math.min(ge,et.length-1)+1)%et.length);if(X.key==="ArrowUp"){X.preventDefault();const ge=et.length-1;return z(De=>(Math.min(De,ge)+ge)%et.length)}if(X.key==="Enter"&&!X.shiftKey){X.preventDefault();const ge=et[ot];ge&&at(ge);return}if(X.key==="Tab"){X.preventDefault();const ge=et[ot];ge&&Ve(ge);return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),Y(!0);return}}if(sn){if(X.key==="ArrowDown"&&Tt.length>0)return X.preventDefault(),z(ge=>(Math.min(ge,Tt.length-1)+1)%Tt.length);if(X.key==="ArrowUp"&&Tt.length>0){X.preventDefault();const ge=Tt.length-1;return z(De=>(Math.min(De,ge)+ge)%Tt.length)}if(X.key==="Enter"&&!X.shiftKey||X.key==="Tab"){const ge=Tt[_n];if(ge){X.preventDefault(),Jn(ge);return}if(X.key==="Tab")return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),Y(!0);return}}if((X.key==="ArrowUp"||X.key==="ArrowDown")&&!X.shiftKey){const ge=X.currentTarget,De=ge.selectionStart;if(ge.selectionEnd===De){const Yt=X.key==="ArrowUp"?me+1:me-1;Yt>=-1&&Yt<E.length&&requestAnimationFrame(()=>{ge.selectionStart===De&&ge.selectionEnd===De&&Zn(Yt)})}}if(X.key==="Escape"&&A){X.preventDefault(),X.stopPropagation(),A();return}X.key==="Enter"&&!X.shiftKey&&!Q&&(X.preventDefault(),ue())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(nc,{result:Te}),sn&&!jt&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:K,children:[Tt.map((X,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===_n,className:ge===_n?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:De=>{De.preventDefault(),Jn(X)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[X.name,X.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:X.path}),X.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},X.path)),Tt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:Fn?"ищем…":Ze?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),jt&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:K,children:et.map((X,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===ot,className:ge===ot?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:De=>{De.preventDefault(),at(X)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",X.name]}),X.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:X.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:X.description})]},X.name))}),je.length>0&&a.jsx("div",{className:"composer__attachments",children:je.map(X=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:X.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>oe(X.id),children:a.jsx(ak,{})})]},X.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:Gt,children:a.jsx(nk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:we}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var X;return(X=L.current)==null?void 0:X.click()},children:a.jsx(lk,{})})]}),a.jsx("textarea",{ref:R,value:Re,disabled:n,placeholder:vt,onChange:X=>Ne(X.target.value,X.target.selectionStart),onSelect:X=>fe(X.currentTarget.selectionStart),onKeyDown:We,onPaste:pe}),Ge.supported&&a.jsx("button",{type:"button",className:Ge.listening?"micbtn is-on":"micbtn",title:Ge.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ge.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ge.listening,disabled:n,onClick:Ge.toggle,children:a.jsx(ik,{on:Ge.listening})}),l?a.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:ue,disabled:n||j||Re.trim()===""&&je.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(sk,{})]})]})]})})}function xp(n,l){const r=l.trim();if(r==="")return n;const c=Ip(r).slice(ek(n,r)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function ek(n,l){const r=Ip(n),c=Ip(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>tk(d,c[h]??"")))return o;return 0}function Ip(n){return n.split(/\s+/).filter(l=>l!=="")}function tk(n,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(n)===r(l)}function nk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function sk(){return a.jsx("svg",{className:"sendbtn__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function lk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M10.8 4.2 5.9 9.1a2 2 0 0 0 2.8 2.8l4.6-4.6a3.3 3.3 0 0 0-4.7-4.7L3.9 7.3a4.6 4.6 0 0 0 6.5 6.5l4.4-4.4"})})}function ak(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function ik({on:n}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),a.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),a.jsx("path",{d:"M8 12.8v1.5"})]})}const Oy=4;function bp(n,l){const r=n.name.toLowerCase();return r===l?0:r.startsWith(l)?1:n.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:Oy}function rk({request:n,plan:l,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=x.useState(l),[b,y]=x.useState("preview");x.useEffect(()=>{g(l),y("preview")},[n.requestId,l]);const j=m.trim().length>0;function v(){j&&d(n.requestId,m)}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:a.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[a.jsxs("div",{className:"plansheet__head",children:[a.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:a.jsx(Ly,{})}),a.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),a.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(b==="preview"?" is-on":""),role:"tab","aria-selected":b==="preview",onClick:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(b==="source"?" is-on":""),role:"tab","aria-selected":b==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(im,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[n.reason&&a.jsx("p",{className:"plansheet__reason",children:n.reason}),a.jsx("div",{className:"plansheet__content",children:b==="preview"?a.jsx(ck,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:S=>g(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function ck({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Ef(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function Ly(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M4.4 2.5h5.6L13 5.5v7.4a.6.6 0 0 1-.6.6H4.4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z"}),a.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),a.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function ok({kind:n,toolName:l,queued:r,onExpand:c}){const o=n==="question"?"Уточняющий вопрос":n==="plan"?"План на согласование":`Разрешить действие: ${l}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${n}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:n==="question"?"?":n==="plan"?a.jsx(Ly,{}):"!"}),a.jsxs("span",{className:"decision-bar__text",children:[a.jsx("span",{className:"decision-bar__title",children:o}),a.jsxs("span",{className:"decision-bar__sub",children:["ждёт вашего решения",r>0&&` — ещё ${r} в очереди`]})]}),a.jsxs("span",{className:"decision-bar__action",children:["Развернуть",a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 10 4-4 4 4"})})]})]})}function im({onClick:n}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 6 4 4 4-4"})}),a.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function uk({request:n,queued:l,collapsed:r,onCollapse:c,onDecide:o}){const d=My(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[a.jsxs("div",{className:"sheet__head",children:[a.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),a.jsx(im,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&a.jsx("p",{className:"sheet__reason",children:n.reason}),d?a.jsx(lm,{diff:d}):a.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function dk({request:n,queued:l,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=n,[m,g]=x.useState(()=>h.map(()=>new Set)),[b,y]=x.useState(()=>h.map(()=>"")),[j,v]=x.useState(()=>c_(h));x.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(c_(h))},[n.requestId]);const S=x.useMemo(()=>hk(h,m,b),[h,m,b]),k=S!==null;function C(Y,M){var z,R;(R=(z=h[Y])==null?void 0:z.options[M])!=null&&R.preview&&v(K=>{const ie=K.slice();return ie[Y]=M,ie})}function A(Y,M,z){g(R=>{const K=R.slice(),ie=new Set(K[Y]);return z?ie.has(M)?ie.delete(M):ie.add(M):ie.has(M)||(ie.clear(),ie.add(M)),K[Y]=ie,K}),M!=="other"&&C(Y,M)}function Q(Y,M){y(z=>{const R=z.slice();return R[Y]=M,R})}function V(){S&&o(n.requestId,S)}function $(Y){Y.key==="Enter"&&(Y.target.closest("button")||k&&(Y.preventDefault(),V()))}function B(Y){var K;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Y.key))return;const M=Array.from(Y.currentTarget.querySelectorAll("button.qsheet__option")),z=M.indexOf(document.activeElement);if(z===-1)return;Y.preventDefault();const R=Y.key==="ArrowDown"||Y.key==="ArrowRight"?1:-1;(K=M[(z+R+M.length)%M.length])==null||K.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:$,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,l>0&&` — ещё ${l} в очереди`]}),a.jsx(im,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((Y,M)=>a.jsx(fk,{q:Y,qi:M,selected:m[M]??new Set,otherText:b[M]??"",previewIndex:j[M]??null,onToggle:A,onFocusOption:C,onOtherText:Q,onOptionsKeyDown:B},M))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:V,children:"Ответить"})]})]})})}function fk({q:n,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var S;const b=n.options.some(k=>k.preview),y=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,j=r.has("other"),v=n.multiSelect?"checkbox":"radio";return a.jsxs("div",{className:"qsheet__question",children:[a.jsxs("div",{className:"qsheet__qhead",children:[a.jsx("span",{className:"chip chip--accent",children:n.header}),a.jsx("span",{className:"qsheet__qtext",children:n.question})]}),a.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:g,children:[n.options.map((k,C)=>{const A=r.has(C);return a.jsxs("button",{type:"button",role:v,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>d(l,C,n.multiSelect),onFocus:()=>h(l,C),onMouseEnter:()=>h(l,C),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},C)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",n.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>m(l,k.target.value),autoFocus:!0})]})]}),b&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function c_(n){return n.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function hk(n,l,r){const c={};for(let o=0;o<n.length;o++){const d=n[o];if(!d)continue;const h=l[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const b=d.options[g];b&&h.has(g)&&m.push(b.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function pk(n,l){if(n!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function zy({path:n}){const[l,r]=x.useState(!1),[c,o]=x.useState(!1),d=x.useRef(null);x.useEffect(()=>{if(!l)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[l]),x.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),sm);return()=>clearTimeout(m)},[c]),x.useEffect(()=>r(!1),[n]);async function h(){await Da(n)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${n}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!l||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(mk,{open:l}),a.jsx("span",{className:"cwd__short",children:n})]}),l&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:n}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?io:Pr})]})]})}function mk({open:n}){return a.jsx("svg",{className:n?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const gk=["low","medium","high"];function Uy({models:n,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[S,k]=x.useState(!1),[C,A]=x.useState(0),Q=x.useRef(null),V=x.useRef(null),$=n.find(R=>R.value===l)??null,B=$&&$.supportsEffort?$.effortLevels.length>0?$.effortLevels:gk:[],Y=B.includes("xhigh");x.useEffect(()=>{if(!S)return;const R=n.findIndex(K=>K.value===l);A(R===-1?0:R)},[S]),x.useEffect(()=>{if(!S)return;function R(K){var ie;(ie=Q.current)!=null&&ie.contains(K.target)||k(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[S]),x.useEffect(()=>{var R,K;S&&((K=(R=V.current)==null?void 0:R.querySelector(".is-cursor"))==null||K.scrollIntoView({block:"nearest"}))},[S,C]);function M(R){k(!1),R.value!==l&&g(R.value)}function z(R){if(R.key==="Escape"){if(!S)return;R.preventDefault(),R.stopPropagation(),k(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!S)return k(!0);if(n.length===0)return;const K=R.key==="ArrowDown"?1:n.length-1;return A(ie=>(ie+K)%n.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!S)return k(!0);const K=n[C];K&&M(K)}}return a.jsxs("div",{ref:Q,className:"select"+(S?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":S,onClick:()=>k(R=>!R),onKeyDown:z,children:[($==null?void 0:$.displayName)??l?a.jsx("span",{className:"select__value",children:($==null?void 0:$.displayName)??l}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):B.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(xk,{})]}),S&&a.jsxs("div",{ref:V,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((R,K)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===l,className:"select__option"+(K===C?" is-cursor":"")+(R.value===l?" is-on":""),onMouseEnter:()=>A(K),onClick:()=>M(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),B.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"modelmenu__sep",role:"separator"}),a.jsxs("div",{className:"modelmenu__row",children:[a.jsxs("span",{className:"modelmenu__label",children:["Усилие",a.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),a.jsx("span",{className:"modelmenu__levels",children:B.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(R),children:R},R))})]}),Y&&a.jsx(_p,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),($==null?void 0:$.supportsThinking)!==!1&&a.jsx(_p,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(_p,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function _p({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function xk(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ns({title:n,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=x.useRef(null);return x.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const y=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:n}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:l}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function bk({candidates:n,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,folders:h,projectsRoot:m,created:g,onSearch:b,onAskAgent:y,onInterrupt:j,onSubmit:v,onCreate:S,onClose:k}){const[C,A]=x.useState("open"),[Q,V]=x.useState(""),[$,B]=x.useState(!1),[Y,M]=x.useState(""),[z,R]=x.useState(""),[K,ie]=x.useState(""),[q,H]=x.useState({git:!0,claudeMd:!0,readme:!0}),fe=Q.trim(),je=fe!=="",Z=Y.trim(),L=z.trim(),U=h.find(G=>G.id===K),oe=U!==void 0&&m!==null,pe=L!==""&&(oe||K===""&&Z!==""),we=[{value:"",label:"Без папки",hint:"каталог по указанному пути"},...h.map(G=>({value:G.id,label:G.name}))];x.useEffect(()=>{Y===""&&d.length>0&&M(d[0])},[d]);const E=x.useRef(b);E.current=b,x.useEffect(()=>{if(C!=="open")return;const G=Q.trim(),Se=setTimeout(()=>E.current(G),200);return()=>clearTimeout(Se)},[Q,C]);function P(){je&&v(fe)}function me(){pe&&S(oe?m:Z,L,q,oe?U.id:void 0)}function ke(){je&&(B(!0),y(fe))}return g?a.jsxs(Ns,{title:"Новый проект",onClose:k,actions:a.jsx("button",{className:"btn btn--primary",onClick:k,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:g.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:g.warnings.map(G=>a.jsx("li",{children:G},G))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(Ns,{title:"Новый проект",className:$&&C==="open"?"modal--wide":void 0,onClose:k,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:k,children:"Отмена"}),C==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:j,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!je,onClick:ke,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!je,onClick:P,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!pe,onClick:me,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(o_,{label:"Открыть",on:C==="open",onClick:()=>A("open")}),a.jsx(o_,{label:"Создать",on:C==="create",onClick:()=>A("create")})]}),C==="open"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),a.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),a.jsx("input",{id:"workspace-path",className:"input input--mono",value:Q,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:G=>V(G.target.value),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),P())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(G=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:G.open,title:G.open?"Этот проект уже открыт":G.path,onClick:()=>V(G.path),onDoubleClick:()=>v(G.path),children:[a.jsx("span",{className:"find__name",children:G.name}),a.jsx("span",{className:"find__path",children:G.path}),a.jsx("span",{className:"find__note",children:yk(G)})]})},G.path))}),n.length===0&&je&&!l&&!$&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&a.jsx("div",{className:"finds__agent",children:a.jsx(am,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),h.length>0&&m!==null&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"field",children:"Папка"}),a.jsx(Rl,{value:K,options:we,ariaLabel:"Папка проектов",onChange:ie})]}),oe?a.jsxs("p",{className:"account__step newproj__where",children:["Каталог появится внутри папки «",U.name,"» в корне проектов."]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Y,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:G=>M(G.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(G=>a.jsx("button",{type:"button",className:G===Z?"newproj__root is-on":"newproj__root",title:G,onClick:()=>M(G),children:_k(G)},G))})]}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:G=>R(G.target.value),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),me())}}),a.jsx("p",{className:"newproj__preview",children:pe?u_(oe?u_(m,U.name):Z,L):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(yp,{label:"git init",desc:"панель истории работает сразу",on:q.git,onToggle:()=>H(G=>({...G,git:!G.git}))}),a.jsx(yp,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:q.claudeMd,onToggle:()=>H(G=>({...G,claudeMd:!G.claudeMd}))}),a.jsx(yp,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:q.readme,onToggle:()=>H(G=>({...G,readme:!G.readme}))})]})]})]})}function o_({label:n,on:l,onClick:r}){return a.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:n})}function yp({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function u_(n,l){const r=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+r+l}function _k(n){const l=n.includes("\\")?"\\":"/",r=n.split(/[\\/]/).filter(Boolean);return r.length<=2?n:`…${l}${r.slice(-2).join(l)}`}function yk(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${vk(n.sessions)}${jk(n.lastUsedAt)}`}function vk(n){const l=n%10,r=n%100;return r>=11&&r<=14?`${n} сессий`:l===1?`${n} сессия`:l>=2&&l<=4?`${n} сессии`:`${n} сессий`}function jk(n){if(!n)return"";const l=Math.floor((Date.now()-n)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const rm=7;function Nk(n){const l=[],r=[];let c=1;for(const o of n){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=d_(l),l[h]=o.hash);const[m,...g]=o.parents;l[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let S=l.indexOf(v);S===-1&&(S=d_(l),l[S]=v),b.push({from:h,to:S})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const S=d[v];!S||S===o.hash||v===h||l[v]===S&&j.push(v)}wk(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:y,down:b,through:j})}return{rows:r,columns:Math.min(c,rm)}}function d_(n){const l=n.indexOf(null);return l!==-1?l:(n.push(null),n.length-1)}function wk(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const Iy=1500;function kk(n){const l=[];let r=!1;for(const c of n.patch.split(`
|
|
120
|
+
`)){if(l.length>=Iy){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:Sk(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:l,added:n.added,removed:n.removed,note:Ek(n,r)}}function Sk(n){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!l)return n;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Ek(n,l){const r=[];return n.status==="added"&&r.push("новый файл"),n.status==="deleted"&&r.push("файл удалён"),n.status==="renamed"&&r.push(`переименован из ${n.oldPath}`),n.binary?r.push("двоичный файл"):n.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${Iy} строк`),r.length>0?r.join(" · "):null}function Tk({open:n,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:S,zoomed:k,onToggleZoom:C}){const A=Nk((l==null?void 0:l.commits)??[]),Q=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(V=>({value:V.name,label:V.name,hint:V.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:V=>{C&&(V.target.closest("button")||C())},children:[a.jsx(Ok,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),C&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:C,children:a.jsx(_o,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),l===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Rl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:Q,onChange:V=>{V&&m(V,`ветку ${V}`)}}),a.jsx(xo,{text:l.detached?l.head:l.branch,hint:l.detached?"хеш HEAD":"имя ветки"})]}),l.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(Ik,{}),o]}):l.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(Lk,{}),"Отправить",l.ahead>0&&a.jsx("span",{className:"gitbar__count",children:l.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[a.jsx(zk,{}),"Забрать",l.behind>0&&a.jsx("span",{className:"gitbar__count",children:l.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:a.jsx(Uk,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),a.jsxs("div",{className:"sidepane__scroll",children:[a.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:a.jsxs("span",{className:"gitrow__body",children:[a.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${qk(l.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(V=>$k(V.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(V=>a.jsx(Ak,{row:V,columns:A.columns,head:V.commit.hash===l.head,local:l.hasRemote&&!V.commit.pushed,active:c===V.commit.hash,onOpen:()=>h(V.commit.hash)},V.commit.hash)),A.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(nc,{result:r,onDismiss:v})]})}const bu=50,f_=13,Ck=500;function Ak({row:n,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=n,m=h.refs.map(Bk).filter(Boolean),[g,b]=x.useState(null),y=x.useRef(null);function j(C){const A=C.touches[0];if(!A)return;const Q={timer:0,x:A.clientX,y:A.clientY,fired:!1};Q.timer=window.setTimeout(()=>{Q.fired=!0,b({x:Q.x,y:Q.y})},Ck),y.current=Q}function v(C){const A=y.current,Q=C.touches[0];!A||!Q||Math.hypot(Q.clientX-A.x,Q.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function S(C){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&C.preventDefault())}function k(){const C=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void Da(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void Da(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void Da(h.subject)}],A=new Set;for(const Q of h.refs){const V=Q.startsWith("tag: "),$=Hk(Q);!$||A.has($)||(A.add($),C.push({id:`ref:${$}`,label:V?"Копировать тег":"Копировать ветку",hint:$,onSelect:()=>void Da($)}))}return C}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var C;if((C=y.current)!=null&&C.fired){y.current=null;return}d()},onContextMenu:C=>{C.preventDefault(),b({x:C.clientX,y:C.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:S,onTouchCancel:S,children:[a.jsx(Mk,{row:n,columns:l,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(C=>a.jsx("span",{className:"gitrow__ref",children:C},C)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Gk(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(mr,{x:g.x,y:g.y,items:k(),onClose:()=>b(null)})]})}function Mk({row:n,columns:l,head:r,local:c}){const o=l*f_+6,d=bu/2,h=b=>8+Math.min(b,rm-1)*f_,m=c?"3.5 2.5":void 0,g=Jd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:bu,viewBox:`0 0 ${o} ${bu}`,"aria-hidden":"true",children:[n.through.map(b=>a.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:bu,style:{stroke:Jd(b)}},`t${b}`)),n.up.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:Jd(b.from),strokeDasharray:m}},`u${y}`)),n.down.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${bu}`,fill:"none",style:{stroke:Jd(b.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:d,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:d,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Jd(n){return`var(--lane-${n%rm})`}function Rk({detail:n,local:l,onCheckout:r,onClose:c}){const o=n.hash==="";return a.jsxs(Ns,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),a.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&a.jsxs("div",{className:"commit__head",children:[a.jsxs("div",{className:"commit__line",children:[a.jsx("p",{className:"commit__subject",children:n.subject}),a.jsx(xo,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",Yk(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(xo,{text:n.hash,hint:"хеш коммита"})]}),l&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(d=>d.slice(0,8)).join(", ")]}),n.body&&a.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(d=>a.jsx(Dk,{file:d,defaultOpen:n.files.length<=3},d.path+d.oldPath))]})}function Dk({file:n,defaultOpen:l}){const[r,c]=x.useState(l);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(lm,{diff:kk(n)})]})}function Ok(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Lk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function zk(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function Uk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"m13 13-2.6-2.6"})]})}function h_(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function Ik(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Bk(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Hk(n){const l=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return l==="HEAD"?"":l}function $k(n){const l=n.split("/");return l[l.length-1]??n}function qk(n){const l=n%100;if(l>=11&&l<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Gk(n){const l=Date.parse(n);if(Number.isNaN(l))return n;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Yk(n){const l=Date.parse(n);return Number.isNaN(l)?n:new Date(l).toLocaleString()}function p_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Xk({status:n,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:y,onClose:j}){var oe;const[v,S]=x.useState(()=>p_(c)),[k,C]=x.useState(""),[A,Q]=x.useState(""),[V,$]=x.useState(!0),[B,Y]=x.useState("Первый коммит"),[M,z]=x.useState(null),[R,K]=x.useState("");x.useEffect(()=>{!k&&l.length>0&&C(l[0].login)},[k,l]),x.useEffect(()=>{r&&M===null&&z(new Set(r.files))},[r,M]);const ie=(n==null?void 0:n.connected)===!0,q=l.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),H=x.useMemo(()=>{if(!r)return[];const pe=R.trim().toLowerCase();return pe?r.files.filter(we=>we.toLowerCase().includes(pe)):r.files},[r,R]),fe=(M==null?void 0:M.size)??0,je=ie&&v.trim()!==""&&k!==""&&d===""&&(o||fe>0);function Z(pe){z(we=>{const E=new Set(we??[]);return E.has(pe)?E.delete(pe):E.add(pe),E})}function L(pe){z(we=>{const E=new Set(we??[]);for(const P of H)pe?E.add(P):E.delete(P);return E})}function U(){if(!je)return;const pe=(r==null?void 0:r.files)??[];b({owner:k,name:v.trim(),description:A.trim(),private:V,include:o?[]:pe.filter(we=>M==null?void 0:M.has(we)),ignore:o?[]:pe.filter(we=>!(M!=null&&M.has(we))),message:o?"":B.trim()||"Первый коммит"})}return a.jsxs(Ns,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!je,onClick:U,children:d||"Опубликовать"})]}),children:[a.jsx(Vk,{status:n,onRefreshStatus:m,onSaveToken:g}),a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Имя"}),a.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>S(p_(pe.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),l.length>1?a.jsx(Rl,{className:"settings__select",value:k,options:q,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((oe=l[0])==null?void 0:oe.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:pe=>Q(pe.target.value)})]}),a.jsxs("div",{className:"field publish__field",children:[a.jsx("span",{children:"Видимость"}),a.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[a.jsx(m_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:V,onClick:()=>$(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!V,onClick:()=>$(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?a.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"publish__filehead",children:[a.jsxs("span",{className:"publish__filecount",children:[fe," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>L(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>L(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>K(pe.target.value)}),a.jsx("div",{className:"publish__filelist",children:H.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):H.map(pe=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(pe))===!0,className:"publish__file",onClick:()=>Z(pe),children:[a.jsx("span",{className:"publish__box"+(M!=null&&M.has(pe)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(pe))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),r.truncated&&a.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Сообщение коммита"}),a.jsx("input",{className:"input",value:B,onChange:pe=>Y(pe.target.value)})]})]})]}),a.jsx(nc,{result:h,onDismiss:y})]})}function m_({title:n,desc:l,on:r,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[n,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:l})]})]})}function Vk({status:n,onRefreshStatus:l,onSaveToken:r}){const[c,o]=x.useState(""),[d,h]=x.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:n.login}),a.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&a.jsxs("p",{className:"modal__text",children:["В системе установлен ",a.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",a.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Личный токен GitHub"}),a.jsx(Qk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),a.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",a.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",a.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&a.jsx("p",{className:"modal__error",children:n.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Qk({value:n,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(Fk,{}):a.jsx(Kk,{})})]})}function Kk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Fk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),a.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),a.jsx("path",{d:"M2 14 14 2"})]})}function Zk({busy:n,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=x.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(Ns,{title:"Подключить существующий репозиторий",onClose:o,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||n!=="",onClick:()=>r(d.trim()),children:n||"Подключить"})]}),children:[a.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",a.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Адрес репозитория"}),a.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&n===""&&r(d.trim())}})]}),a.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",a.jsx("code",{children:"https://…"}),", ",a.jsx("code",{children:"ssh://…"}),", ",a.jsx("code",{children:"git://…"})," и"," ",a.jsx("code",{children:"git@host:path"}),"."]}),a.jsx(nc,{result:l,onDismiss:c})]})}function Jk({open:n,items:l,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onContextSearch:k,onCommand:C,onModel:A,onEffort:Q,onUltracode:V,onThinking:$,onSwitchOnFlag:B,onAsk:Y,onInterrupt:M,onReset:z,onClose:R,zoomed:K,onToggleZoom:ie}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(K?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:q=>{ie&&(q.target.closest("button")||ie())},children:[a.jsx(Wk,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),ie&&a.jsx("button",{className:"sidepane__btn",title:K?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":K?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":K,onClick:ie,children:a.jsx(_o,{active:K})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:R,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(Uy,{className:"select--compact",models:g,value:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onModel:A,onEffort:Q,onUltracode:V,onThinking:$,onSwitchOnFlag:B}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(am,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Dy,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:C,onSend:Y,onInterrupt:M,onEscape:r?M:R})]})}function Wk(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Pk=75,eS=90;function cm({usage:n,variant:l="topbar"}){if(!(n!=null&&n.available))return null;const r=n.buckets??[],c=r.length>0?r.map(d=>({key:d.id,label:d.label,window:d.window})):[...n.fiveHour?[{key:"five",label:"5 ч",window:n.fiveHour}]:[],...n.sevenDay?[{key:"week",label:"нед",window:n.sevenDay}]:[]];if(c.length===0)return null;const o=r.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:l==="card"?"usage usage--card":"usage",title:sS(n,r),role:"group","aria-label":o,children:c.map(d=>a.jsx(tS,{label:d.label,window:d.window},d.key))})}function tS({label:n,window:l}){const r=Math.round(l.utilization),c=aS(l.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:n}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${nS(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:om(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function nS(n){return n>=eS?" usage__fill--over":n>=Pk?" usage__fill--warn":""}function sS(n,l){if(l.length>0)return lS(l);const r=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=om(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),r.join(`
|
|
121
|
+
`)}function lS(n){const l=["Квота Antigravity"];for(const r of n){const c=om(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
122
|
+
`)}function By(n){if(!n)return null;const l=new Date(n);return Number.isNaN(l.getTime())?null:l}function Hy(n){return n.getTime()-Date.now()<1440*60*1e3}function aS(n){const l=By(n);return l?Hy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function om(n){const l=By(n);return l?`обнулится ${Hy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function $y(){const[n,l]=x.useState(()=>new Date);return x.useEffect(()=>{let r=0;const c=()=>{const d=new Date;l(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),a.jsxs("time",{className:"clock",dateTime:n.toISOString(),title:iS(n),children:[a.jsx("span",{className:"clock__time",children:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:n.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function iS(n){return n.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function rS({onClose:n,permission:l,model:r,account:c,usage:o,cwd:d,costLabel:h,onRefresh:m,refreshing:g,metersFetchedAt:b,onRename:y,onHandoff:j,onFreshSession:v,handoffWriting:S,handoffAccount:k,onStop:C}){const A=J_({onLongPress:()=>v==null?void 0:v(),onClick:()=>j==null?void 0:j(),disabled:S});return a.jsx(Ns,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:n,children:a.jsxs("div",{className:"sessionmenu",children:[l&&a.jsx(qr,{label:"Режим прав",children:l}),a.jsx(qr,{label:"Модель",children:r}),c&&a.jsx(qr,{label:"Аккаунт",children:c}),(o==null?void 0:o.available)&&(o.fiveHour||o.sevenDay||o.buckets&&o.buckets.length>0)&&a.jsx(qr,{label:"Лимиты плана",children:a.jsx(cm,{usage:o})}),a.jsxs("button",{type:"button",className:g?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":g,disabled:g,onClick:m,children:[a.jsx(cS,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",b&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(b).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(qr,{label:"Время",children:a.jsx($y,{})}),h&&a.jsx(qr,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:h})}),d&&a.jsx(qr,{label:"Каталог проекта",children:a.jsx(zy,{path:d})}),y&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:y,children:"Переименовать сессию"}),j&&a.jsxs("button",{type:"button",className:S?"sessionmenu__handoff is-busy":A.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${A.thresholdMs}ms`},"aria-busy":S,disabled:S,...A.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[S?"Пишется хэндофф…":"Хэндофф и новая сессия",!S&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),j&&k,C&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function qr({label:n,children:l}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:n}),l]})}function cS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function oS({tab:n,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,auth:h,remote:m,actions:g,onTab:b,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(Ns,{title:"Расширения",className:"modal--wide",onClose:y,children:[a.jsx("div",{className:"tabs",role:"tablist",children:j.map(v=>a.jsxs("button",{role:"tab","aria-selected":n===v.id,className:n===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>b(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),n==="mcp"&&a.jsx(uS,{servers:l,auth:h,remote:m,actions:g}),n==="plugins"&&a.jsx(gS,{plugins:r,marketplaces:c,actions:g}),n==="catalog"&&a.jsx(xS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>b("plugins")}),a.jsx(nc,{result:d})]})}function uS({servers:n,auth:l,remote:r,actions:c}){const[o,d]=x.useState(!1);return a.jsxs(a.Fragment,{children:[n.length===0&&!o&&a.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",a.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",a.jsx("code",{children:"claude mcp list"}),"."]}),a.jsx("ul",{className:"extlist",children:n.map(h=>{const m=(l==null?void 0:l.name)===h.name?l:null,g=m!==null&&m.active&&m.url==="",b=m!==null&&m.active&&m.url!=="";return a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:h.name}),a.jsx("span",{className:`chip chip--${hS(h.status)}`,children:fS[h.status]}),h.scope&&a.jsx("span",{className:"chip",children:h.scope}),h.transport&&a.jsx("span",{className:"chip",children:h.transport})]}),h.target&&a.jsx("div",{className:"extlist__meta",title:h.target,children:h.target}),h.error&&a.jsx("div",{className:"extlist__error",children:h.error}),h.tools.length>0&&a.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",h.tools.length," · ",h.tools.slice(0,6).join(", "),h.tools.length>6&&"…"]}),a.jsxs("div",{className:"extlist__actions",children:[h.status==="needs-auth"&&a.jsx("button",{className:b?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":b?"Начать заново":"Авторизовать"}),a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"reconnect"),children:"Переподключить"}),h.status==="disabled"?a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"enable"),children:"Включить"}):a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>c.mcpAction(h.name,"disable"),children:"Выключить"}),h.editable&&a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>c.mcpRemove(h.name),children:"Удалить"})]}),m&&a.jsx(dS,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(pS,{onCancel:()=>d(!1),onSubmit:(h,m)=>{c.mcpAdd(h,m),d(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>d(!0),children:"+ Сервер"})})]})}function dS({auth:n,remote:l,actions:r}){const[c,o]=x.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(n.name,g),o(""))}if(!n.active)return n.error?a.jsx("div",{className:"extlist__error",children:n.error}):n.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[l&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:d,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:l?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=n.callbackExpected&&(l?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[n.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!l&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,n.error&&a.jsx("div",{className:"extlist__error",children:n.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const fS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function hS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function pS({onSubmit:n,onCancel:l}){const[r,c]=x.useState(""),[o,d]=x.useState("stdio"),[h,m]=x.useState(""),[g,b]=x.useState(""),[y,j]=x.useState(""),v=o==="stdio",S=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function k(){if(S)if(v){const[C,...A]=mS(h);n(r.trim(),{transport:"stdio",command:C??"",args:A,env:g_(y)})}else n(r.trim(),{transport:o,url:g.trim(),headers:g_(y)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:C=>c(C.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Rl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:C=>d(C)}),v?a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),a.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:C=>m(C.target.value)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:C=>b(C.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:C=>j(C.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function g_(n){const l={};for(const r of n.split(`
|
|
123
|
+
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function mS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function gS({plugins:n,marketplaces:l,actions:r}){const[c,o]=x.useState("");return a.jsxs(a.Fragment,{children:[n.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:n.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:d.name}),a.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&a.jsx("span",{className:"chip",children:d.version}),d.scope&&a.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&a.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:l.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&a.jsx("div",{className:"extlist__meta",children:d.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const _u=30;function xS({catalog:n,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(_u),[y,j]=x.useState(""),v=x.useMemo(()=>[...new Set(n.map(C=>C.category).filter(Boolean))].sort(),[n]),S=x.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(C=>h&&C.category!==h?!1:k?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),b(_u)}}),a.jsx(Rl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{m(k),b(_u)}})]}),S.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:S.slice(0,g).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),S.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>b(k=>k+_u),children:["Ещё ",Math.min(_u,S.length-g)," из ",S.length-g]})}),a.jsxs("div",{className:"extform",children:[a.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||y.trim()===""||(k.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function bS({accounts:n,auth:l,logins:r,candidates:c,usage:o,actions:d,activeAccountId:h,error:m,onReconnect:g,reconnectBlocked:b,reconnectHint:y,onOpenLogin:j,onClose:v}){const S=n.length>1,[k,C]=x.useState(!1),A=n.find(H=>H.main)??n[0],Q=x.useRef(n.length);x.useEffect(()=>{n.length>Q.current&&C(!1),Q.current=n.length},[n.length]);const V=n.map(H=>`${H.id}:${H.dir}`).join("|"),$=x.useRef(d.discover);$.current=d.discover,x.useEffect(()=>{$.current()},[V]);const B=x.useRef(d.requestUsage);B.current=d.requestUsage;const[Y,M]=x.useState(!1);x.useEffect(()=>{B.current();const H=window.setInterval(()=>B.current(),9e4),fe=window.setTimeout(()=>M(!0),25e3);return()=>{window.clearInterval(H),window.clearTimeout(fe)}},[]);const[z,R]=x.useState(null),K=z!==null&&Object.values(o).some(H=>H!=null&&H.fetchedAt>=z),ie=z!==null&&!K;x.useEffect(()=>{if(z===null)return;if(K){R(null);return}const H=window.setTimeout(()=>R(null),25e3);return()=>window.clearTimeout(H)},[z,K]);const q=(c??[]).filter(H=>H.accountId===null&&!n.some(fe=>fe.dir===H.configDir));return a.jsxs(Ns,{title:S?"Аккаунты":"Аккаунт",className:"modal--accounts",onClose:v,children:[a.jsxs("div",{className:"acctlimits",children:[a.jsx("span",{className:"acctlimits__title",children:"Лимиты плана"}),a.jsxs("button",{type:"button",className:ie?"btn btn--ghost btn--sm acctlimits__btn is-busy":"btn btn--ghost btn--sm acctlimits__btn","aria-label":"Обновить лимиты","aria-busy":ie,disabled:ie,onClick:()=>{R(Date.now()),d.requestUsage()},children:[a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]}),a.jsx("span",{"aria-live":"polite",children:ie?"Обновляем…":"Обновить"})]})]}),n.map(H=>{var fe;return a.jsx(ES,{account:H,multi:S,status:l[H.id]??null,usage:o[H.id],usageSettled:Y,main:A,loginActive:((fe=r[H.id])==null?void 0:fe.active)===!0,actions:d,takenColors:n.filter(je=>je.id!==H.id).map(je=>je.color),onReconnect:H.id===h?g:null,reconnectBlocked:b,reconnectHint:y,onOpenLogin:()=>j(H.id)},H.id)}),m&&a.jsx("p",{className:"account__warn",role:"alert",children:m}),q.length>0&&A&&a.jsx(vS,{found:q,accounts:n,main:A,onConnect:(H,fe,je,Z)=>d.add(fe,je,H.configDir,Z),onMakeMain:H=>d.update(A.id,{configDir:H.configDir})}),k?a.jsx(AS,{accounts:n,onAdd:d.add,onCancel:()=>C(!1)}):a.jsx("button",{type:"button",className:"btn account__add",onClick:()=>C(!0),children:"+ Добавить аккаунт"})]})}function _S(n){const l=n.split(/[\\/]+/).filter(Boolean),r=l[l.length-1];return r&&(/^(users|home)$/i.test(l[0]??"")||/^(users|home)$/i.test(l[1]??""))&&l.length<=4?`~/${r}`:n}function yS(n){const l=n.split(/[\\/]+/).filter(Boolean);return(l[l.length-1]??"").replace(/^\.+/,"").slice(0,Cf)}function vS({found:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){return a.jsxs("section",{className:"found","aria-labelledby":"found-title",children:[a.jsx("h3",{className:"found__title",id:"found-title",children:"Найдено на этом компьютере"}),a.jsx("p",{className:"account__step found__lead",children:"Здесь уже есть вход Claude Code. Ничего не копируется: аккаунт просто указывает на эту папку, а вход остаётся у Claude Code."}),a.jsx("ul",{className:"found__list",children:n.map(d=>a.jsx(jS,{candidate:d,accounts:l,main:r,onConnect:c,onMakeMain:o},d.configDir))})]})}function jS({candidate:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){const[d,h]=x.useState(!1),[m,g]=x.useState(!1),[b,y]=x.useState(()=>yS(n.configDir)),[j,v]=x.useState(!0),S=b.trim(),k=l.some($=>$.name.toLowerCase()===S.toLowerCase()),C=yi.find($=>!l.some(B=>B.color===$))??yi[1],A=`found-${n.configDir.replace(/[^a-z0-9]/gi,"-")}`,Q=r.liveSessions>0;function V($){$.preventDefault(),S!==""&&c(n,S,C,j)}return a.jsxs("li",{className:"found__row",children:[a.jsxs("div",{className:"found__id",children:[a.jsx("span",{className:"found__email",children:n.email||"Вход выполнен"}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization}),a.jsx("div",{className:"acctcard__dir found__dir",title:n.configDir,children:_S(n.configDir)}),d?a.jsxs("form",{className:"found__form",onSubmit:V,children:[a.jsx("label",{className:"field",htmlFor:`${A}-name`,children:"Название аккаунта"}),a.jsx("input",{id:`${A}-name`,className:"input",value:b,maxLength:Cf,autoFocus:!0,autoComplete:"off","aria-describedby":k?`${A}-taken`:void 0,onChange:$=>y($.target.value)}),k&&a.jsx("p",{className:"account__note",id:`${A}-taken`,children:"Такое имя уже есть — хост откажет. Выберите другое."}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:j,onChange:$=>v($.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsx("span",{className:"account__step acctform__checkhint",children:"Что именно делится, задаётся в Настройках. Файлы, которые уже лежат в подключаемой папке, не перезаписываются. Если часть настроек и данных плагинов включена в общие, они станут общими с другими аккаунтами."})]})]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>h(!1),children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:S==="",children:"Подключить"})]})]}):a.jsxs("div",{className:"found__actions",children:[a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",onClick:()=>h(!0),children:"Подключить"}),a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm found__more","aria-expanded":m,"aria-controls":`${A}-more`,onClick:()=>g($=>!$),children:["Ещё",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:m?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),m&&!d&&a.jsxs("div",{className:"found__menu",id:`${A}-more`,children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:Q,onClick:()=>o(n),children:"Сделать основным"}),a.jsx("span",{className:"account__note found__why",children:Q?`Сначала закройте сессии основного аккаунта (${r.liveSessions}).`:`Основной аккаунт «${r.name}» будет брать вход из этой папки.`})]})]})}const NS="Вход выполняется в Настройках → Вход и выход Claude Code.",wS=120*1e3;function kS(n){const l=Math.max(1,Math.round((Date.now()-n)/6e4));if(l<60)return`${l} мин назад`;const r=Math.round(l/60);return r<48?`${r} ч назад`:`${Math.round(r/24)} дн. назад`}function SS({usage:n,settled:l}){if(!n)return a.jsx("p",{className:"account__note usage__state","aria-live":"polite",children:l?"Лимиты не получены — попробуем снова при следующем обновлении.":"Загружаем лимиты…"});if(!n.available)return a.jsx("p",{className:"account__note usage__state",children:"Лимиты недоступны: у этого способа входа нет окон плана."});const r=Date.now()-n.fetchedAt>wS;return a.jsxs("div",{className:"acctusage",children:[a.jsx(cm,{usage:n,variant:"card"}),r&&a.jsxs("p",{className:"account__step acctusage__age",children:["Показания от ",kS(n.fetchedAt)]})]})}function ES({account:n,multi:l,status:r,usage:c,usageSettled:o,main:d,loginActive:h,actions:m,takenColors:g,onReconnect:b,reconnectBlocked:y,reconnectHint:j,onOpenLogin:v}){const[S,k]=x.useState(!1),C=n.id,A=b!==null&&(r==null?void 0:r.loggedIn)===!0,Q=!l,V=!S&&a.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>k(!0),"aria-label":l?`Изменить аккаунт «${n.name}»`:"Изменить каталог аккаунта",children:l?"Изменить":"Изменить каталог"});return a.jsxs("section",{className:`acctcard acct--${n.color}${Q?" acctcard--single":""}`,"aria-label":l?`Аккаунт «${n.name}»`:void 0,children:[l&&a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Oa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),V]}),S?a.jsx(CS,{account:n,multi:l,main:d,takenColors:g,onSave:$=>{m.update(C,$),k(!1)},onMakeMain:()=>{m.makeMain(C),k(!1)},onRemove:()=>m.remove(C),onCancel:()=>k(!1)}):r===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):r.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:r.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:TS[r.method]??r.method}),r.plan&&a.jsx("span",{className:"chip",children:r.plan})]}),r.organization&&a.jsx("div",{className:"extlist__meta",children:r.organization}),a.jsx(SS,{usage:c,settled:o})]}):a.jsxs("div",{className:"account__signedout",children:[a.jsx("p",{className:"modal__text",children:l?"Вход не выполнен. Сессии этого аккаунта не запустятся, пока вы в него не войдёте.":"Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён."}),a.jsx("p",{className:"account__note",children:h?"Вход идёт — продолжите в Настройках.":NS}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:v,children:h?"Продолжить вход":"Открыть вход в Настройках"})]}),!S&&n.dir!==""&&a.jsxs("div",{className:"acctdir",children:[a.jsx("div",{className:"acctcard__dir",title:"Каталог конфигурации: вход, тариф, лимиты и транскрипты этого аккаунта",children:n.dir}),n.main&&n.configDir===null&&a.jsx("span",{className:"account__step",children:"унаследован из окружения"}),Q&&a.jsx("div",{className:"acctdir__edit",children:V})]}),A&&!S&&a.jsxs(a.Fragment,{children:[y&&a.jsx("p",{className:"account__note",children:j}),a.jsx("div",{className:"extbar account__bar",children:a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
124
|
+
${j}`,"aria-label":"Переподключить сессию",disabled:y,onClick:b??void 0,children:[a.jsx(MS,{}),"Переподключить"]})})]})]})}const TS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function qy({value:n,taken:l,onChange:r}){function c(o){const d=o.key==="ArrowRight"||o.key==="ArrowDown"?1:o.key==="ArrowLeft"||o.key==="ArrowUp"?-1:0;if(d===0)return;o.preventDefault();const h=yi.indexOf(n),m=yi[(h+d+yi.length)%yi.length];if(m){r(m);const g=o.currentTarget;window.requestAnimationFrame(()=>{var b;return(b=g.querySelector(`[data-color="${m}"]`))==null?void 0:b.focus()})}}return a.jsx("div",{className:"colorpick",role:"radiogroup","aria-label":"Цвет аккаунта",onKeyDown:c,children:yi.map(o=>{const d=o===n;return a.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":nf[o],title:l.includes(o)?`${nf[o]} — уже у другого аккаунта`:nf[o],"data-color":o,tabIndex:d?0:-1,className:`colorpick__item acct--${o}${d?" is-selected":""}`,onClick:()=>r(o),children:d&&a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.6 6.3 5 8.6l4.4-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},o)})})}const Cf=40;function CS({account:n,multi:l,main:r,takenColors:c,onSave:o,onMakeMain:d,onRemove:h,onCancel:m}){const[g,b]=x.useState(n.name),[y,j]=x.useState(n.color),[v,S]=x.useState(n.dir),[k,C]=x.useState(!1),[A,Q]=x.useState(!1),V=g.trim(),$=v.trim(),B=$!==""&&$!==n.dir,Y=V!==n.name||y!==n.color||B,M=n.liveSessions,z=M>0,R=`acct-edit-${n.id}`,K=!n.main&&r!==void 0,ie=M>0||((r==null?void 0:r.liveSessions)??0)>0,q=!n.main;function H(fe){fe.preventDefault(),!(l&&V===""||!Y)&&o({...V!==n.name?{name:V}:{},...y!==n.color?{color:y}:{},...B?{configDir:$}:{}})}return a.jsxs("div",{className:"acctform",children:[a.jsxs("form",{className:"extform acctform__fields",onSubmit:H,children:[l&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:`${R}-name`,children:"Имя"}),a.jsx("input",{id:`${R}-name`,className:"input",value:g,maxLength:Cf,autoFocus:!0,autoComplete:"off",onChange:fe=>b(fe.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(qy,{value:y,taken:c,onChange:j})]}),a.jsx("label",{className:"field",htmlFor:`${R}-dir`,children:"Каталог конфигурации"}),a.jsx("input",{id:`${R}-dir`,className:"input input--mono",value:v,disabled:z,spellCheck:!1,autoComplete:"off",autoFocus:!l,placeholder:"~/.claude","aria-describedby":`${R}-dirnote`,onChange:fe=>S(fe.target.value)}),a.jsx("p",{className:"account__step acctform__note",id:`${R}-dirnote`,children:z?`Каталог нельзя менять, пока у аккаунта есть живые сессии (${M}) — сначала закройте их.`:"Здесь лежат вход, тариф и история аккаунта. Файлы не переносятся: аккаунт начнёт брать вход из новой папки."}),n.main&&n.configDir!==null&&a.jsx("button",{type:"button",className:"btn btn--sm acctform__inherit",disabled:z,onClick:()=>o({configDir:null}),children:"Вернуть унаследованный"}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:m,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:l&&V===""||!Y,children:"Сохранить"})]})]}),K&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Основной аккаунт"}),a.jsx("p",{className:"account__note",children:`Аккаунты поменяются местами: «Основной» станет «${n.name}» и наоборот — каталог, имя и цвет. Файлы не переносятся.`}),ie?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:!0,children:"Сделать основным"}),a.jsx("p",{className:"account__note acctform__why",children:M>0&&((r==null?void 0:r.liveSessions)??0)>0?`Сначала закройте сессии обоих аккаунтов: этого (${M}) и основного (${r==null?void 0:r.liveSessions}).`:M>0?`Сначала закройте сессии этого аккаунта (${M}).`:`Сначала закройте сессии основного аккаунта (${r==null?void 0:r.liveSessions}).`})]}):k?a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>C(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",autoFocus:!0,onClick:d,children:"Поменять местами"})]}):a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>C(!0),children:"Сделать основным"})]}),q&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Убрать аккаунт"}),M>0?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",disabled:!0,children:"Убрать из списка"}),a.jsx("p",{className:"account__note acctform__why",children:`Сначала закройте сессии этого аккаунта (${M}).`})]}):A?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"account__note",role:"alert",children:`Убрать аккаунт «${n.name}» из списка? Его каталог ${n.dir} останется на диске, вход в нём сохранится.`}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>Q(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:h,children:"Убрать из списка"})]})]}):a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",onClick:()=>Q(!0),children:"Убрать из списка"})]})]})}function AS({accounts:n,onAdd:l,onCancel:r}){const c=n.map(k=>k.color),[o,d]=x.useState(""),[h,m]=x.useState(()=>yi.find(k=>!c.includes(k))??yi[1]),[g,b]=x.useState(""),[y,j]=x.useState(!0),v=o.trim();function S(k){k.preventDefault(),v!==""&&l(v,h,g.trim()===""?null:g.trim(),y)}return a.jsxs("form",{className:"extform extform--card acctform",onSubmit:S,children:[a.jsx("label",{className:"field",htmlFor:"acct-new-name",children:"Название аккаунта"}),a.jsx("input",{id:"acct-new-name",className:"input",value:o,maxLength:Cf,placeholder:"Например, Работа",autoFocus:!0,autoComplete:"off",onChange:k=>d(k.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(qy,{value:h,taken:c,onChange:m}),a.jsxs("details",{className:"account__fallback acctform__dir",children:[a.jsx("summary",{children:"Каталог конфигурации"}),a.jsx("label",{className:"field",htmlFor:"acct-new-dir",children:"Путь к каталогу"}),a.jsx("input",{id:"acct-new-dir",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"~/.claude-ccv-…",onChange:k=>b(k.target.value)}),a.jsxs("p",{className:"account__step",children:["Если оставить пустым, хост создаст отдельный каталог ",a.jsx("code",{children:"~/.claude-ccv-…"})," сам."]})]}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:y,onChange:k=>j(k.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsxs("span",{className:"account__step acctform__checkhint",children:["Аккаунт получит ссылки на общую папку, а не копии. Что именно делится, задаётся в Настройках. Вход, лимиты, переписка и ",a.jsx("code",{children:".claude.json"})," остаются отдельными. Если в общие включены настройки и плагины, их данные (в том числе токены плагинов) станут общими с другими аккаунтами."]})]})]}),a.jsxs("p",{className:"account__step",children:[y?"Новый аккаунт начнётся с общей конфигурации из Настроек.":"Новый аккаунт начнётся с чистого листа: своя конфигурация, плагины и CLAUDE.md."," ","Если в папке ещё нет входа, войдите в него отдельно — в Настройках, в разделе «Вход и выход Claude Code»."]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:r,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:v==="",children:"Добавить"})]})]})}function MS(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function RS({state:n,onPair:l,onUnpair:r,onClose:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(!1),y=x.useRef(null),j=(n==null?void 0:n.paired)===!0;x.useEffect(()=>{var S;j||(S=y.current)==null||S.focus()},[j]),x.useEffect(()=>{b(!1),j&&d("")},[j,n==null?void 0:n.error]);const v=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(Ns,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:x_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),a.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),a.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):a.jsxs("div",{className:"relay",children:[a.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),a.jsxs("ol",{className:"relay__steps",children:[a.jsxs("li",{children:["Откройте ",a.jsx("b",{children:x_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(b(!0),l(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:S=>d(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Как назвать этот компьютер"}),a.jsx("input",{className:"input",value:h,onChange:S=>m(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function x_(n){try{return new URL(n).host}catch{return n}}const DS={active:!1,url:"",awaitingCode:!1,output:"",error:null},OS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function LS({accounts:n,auth:l,logins:r,actions:c,remote:o,runningByAccount:d,focusAccountId:h}){return a.jsx("div",{className:"loginlist",children:n.map(m=>a.jsx(zS,{account:m,status:l[m.id]??null,login:r[m.id]??DS,actions:c,remote:o,running:d[m.id]??0,focused:m.id===h},m.id))})}function zS({account:n,status:l,login:r,actions:c,remote:o,running:d,focused:h}){const[m,g]=x.useState(""),[b,y]=x.useState(!1),[j,v]=x.useState(!1),S=x.useRef(null),k=n.id;x.useEffect(()=>{var $;h&&(($=S.current)==null||$.scrollIntoView({block:"nearest"}))},[h]);const C=x.useMemo(()=>{if(r.error)return{ok:!1,message:r.error};const $=r.output.trim();return $===""?null:{ok:!0,message:$}},[r.error,r.output]);function A($=m){const B=$.trim();B!==""&&(c.submitCode(k,B),g(""))}function Q(){if(d>0){y(!1),v(!0);return}c.login(k,"claudeai",!0)}const V=(l==null?void 0:l.loggedIn)===!0;return a.jsxs("section",{ref:S,className:`acctcard logincard acct--${n.color}${h?" is-focused":""}`,"aria-label":`Вход аккаунта «${n.name}»`,children:[a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Oa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),a.jsx("span",{className:`chip ${l===null?"chip--mute":V?"chip--ok":"chip--warn"}`,children:l===null?"проверяем":V?"вошёл":"не вошёл"})]}),V&&a.jsx("div",{className:"logincard__who",children:[l.email||"Вход выполнен",l.plan,OS[l.method]??l.method].filter(Boolean).join(" · ")}),r.active?a.jsx(IS,{login:r,remote:o,code:m,onCode:g,onSubmit:A,onCancel:()=>c.cancel(k),inputId:`auth-code-${k}`}):a.jsxs(a.Fragment,{children:[a.jsx(nc,{result:C}),(j||b)&&d>0&&a.jsx("p",{className:"account__warn",role:"alert",children:US(d)}),a.jsx("div",{className:"extbar logincard__bar",children:V?a.jsxs(a.Fragment,{children:[j?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>v(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--warn",autoFocus:!0,onClick:()=>{v(!1),c.login(k,"claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{type:"button",className:"btn",onClick:Q,children:"Сменить аккаунт"}),b?a.jsx("button",{type:"button",className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),c.logout(k)},children:"Точно выйти?"}):a.jsx("button",{type:"button",className:"btn",onClick:()=>{v(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>c.login(k,"console",!1),children:"Через Console"}),a.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>c.login(k,"claudeai",!1),children:"Войти"})]})})]})]})}function US(n){const l=n%10,r=n%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function IS({login:n,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d,inputId:h}){var C;const[m,g]=x.useState(null),b=x.useRef(""),y=x.useRef({code:r,onCode:c,onSubmit:o});y.current={code:r,onCode:c,onSubmit:o};const j=x.useCallback(async A=>{const{code:Q,onCode:V,onSubmit:$}=y.current;if(A&&Q.trim()!=="")return;const B=await zp();if(B===null){A||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const Y=B.trim();if(!b_(Y)){A||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(A){if(b.current===Y)return;b.current=Y}g(null),V(Y),$(Y)},[]);x.useEffect(()=>{if(!n.awaitingCode)return;const A=()=>{document.visibilityState==="visible"&&j(!0)};return document.addEventListener("visibilitychange",A),()=>document.removeEventListener("visibilitychange",A)},[n.awaitingCode,j]);const v=typeof((C=navigator.clipboard)==null?void 0:C.readText)=="function",S=r.trim()!==""&&!b_(r),k=m??(S?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?l?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),a.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),a.jsxs("div",{className:"account__raw",children:[a.jsx("span",{className:"account__rawurl",children:n.url}),a.jsx(xo,{text:n.url,hint:"ссылку входа"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),a.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),a.jsxs("details",{className:"account__fallback",children:[a.jsx("summary",{children:"Браузер не открылся"}),a.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),a.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:h,children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:h,className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:A=>{g(null),c(A.target.value)},onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),o())}}),v&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void j(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),k&&a.jsx("p",{className:"account__note account__note--code",children:k})]}),n.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:n.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function b_(n){const l=n.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}const __=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],BS=[{id:"skills",label:"Скиллы",hint:"Читаются Claude Code, безопасно делить."},{id:"agents",label:"Агенты",hint:"Читаются Claude Code, безопасно делить."},{id:"commands",label:"Команды",hint:"Читаются Claude Code, безопасно делить."},{id:"hooks",label:"Хуки",hint:"Читаются Claude Code, безопасно делить."},{id:"output-styles",label:"Стили вывода",hint:"Читаются Claude Code, безопасно делить."},{id:"plugins",label:"Плагины",hint:"Вместе с данными плагинов — в них могут лежать токены."},{id:"CLAUDE.md",label:"CLAUDE.md",hint:"Общие инструкции."},{id:"settings.json",label:"settings.json",hint:"Модель, права, хуки, список плагинов: изменение в одном аккаунте сразу видно в другом. Ссылку Claude Code может заменить обычным файлом."},{id:"keybindings.json",label:"keybindings.json",hint:"Сочетания клавиш."}],HS=[{label:"Вход и токены (.credentials.json)",why:"У каждого аккаунта свой."},{label:".claude.json",why:"В нём личность вошедшего и пользовательские MCP-серверы: общий файл смешал бы аккаунты."},{label:"История сессий и лимиты",why:"У каждого аккаунта своя."}],vp="",$S=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],qS=Q_.map(n=>({value:n.value,label:n.value,hint:n.hint})),Wd=3600*1e3,GS=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],no={"6h":6*Wd,"24h":24*Wd,"48h":48*Wd,"168h":168*Wd,never:0};function YS(n){return no[n]??no["48h"]}const XS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Pd=60*1e3,so={"5m":5*Pd,"10m":10*Pd,"30m":30*Pd,"60m":60*Pd,never:0};function VS(n){return so[n]??so["10m"]}function QS(n){const l=Object.entries(so).find(([,r])=>r===n);return l?l[0]:Object.keys(so).reduce((r,c)=>Math.abs(so[c]-n)<Math.abs(so[r]-n)?c:r)}function KS(n){const l=Object.entries(no).find(([,r])=>r===n);return l?l[0]:Object.keys(no).reduce((r,c)=>Math.abs(no[c]-n)<Math.abs(no[r]-n)?c:r)}const FS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],lo={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function ZS(n){return lo[n]??lo.off}function y_(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function JS(n){const l=Object.entries(lo).find(([,r])=>r===n);return l?l[0]:Object.keys(lo).reduce((r,c)=>Math.abs(lo[c]-n)<Math.abs(lo[r]-n)?c:r)}const WS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function PS({settings:n,models:l,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,claudeLogin:b,projectsRootHint:y,onClose:j}){const v=x.useRef(null),S=n===null,k=b.focusAccountId!==null;x.useEffect(()=>{var Z;k&&((Z=v.current)==null||Z.scrollIntoView({block:"start"}))},[k]);const C=(n==null?void 0:n.projectsRoot)??"",[A,Q]=x.useState(C);x.useEffect(()=>Q(C),[C]);function V(){const Z=A.trim();Z!==C&&d({projectsRoot:Z===""?null:Z})}const[$,B]=x.useState(""),[Y,M]=x.useState(null),z=!S&&n.networkGuardEnabled,R=(n==null?void 0:n.networkGuardBlockedCountries)??[];function K(){const Z=$.trim().toUpperCase();if(Z!==""){if(!/^[A-Z]{2}$/.test(Z)){M("Нужен код из двух латинских букв, например RU или CN.");return}if(R.includes(Z)){M(`Код ${Z} уже в списке.`);return}M(null),B(""),d({networkGuardBlockedCountries:[...R,Z]})}}const ie=!S&&n.terminalEnabled===!0,q=!S&&n.liveSessionsFirst===!0,H=!ie,fe=x.useMemo(()=>{const Z=[{value:vp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(L=>({value:L.value,label:L.displayName,hint:L.description})):$S];return n&&n.startModel!==null&&!Z.some(L=>L.value===n.startModel)&&Z.push({value:n.startModel,label:n.startModel}),Z},[l,n]);function je(){var Z,L;return(r==null?void 0:r.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:g,children:"Связать компьютер"})]}):(Z=r.shell)!=null&&Z.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:H,onClick:m,children:"Запретить"})]}):(L=r.shell)!=null&&L.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),o?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(Ns,{title:"Настройки",onClose:j,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Rl,{className:"settings__select",value:KS(n.autoArchiveAfterMs),options:GS,onChange:Z=>d({autoArchiveAfterMs:YS(Z)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Rl,{className:"settings__select",value:QS(n.autoStopAfterMs),options:XS,onChange:Z=>d({autoStopAfterMs:VS(Z)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Корень проектов"}),a.jsx("p",{className:"settings__hint",children:"Папки проектов в боковой панели — настоящие каталоги внутри этого корня, а перенос проекта в папку переносит его каталог на диске. Пусто — корень выбирается автоматически."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx("input",{className:"input input--mono",value:A,spellCheck:!1,autoComplete:"off",placeholder:y??"Автоматически","aria-label":"Корень проектов",onChange:Z=>Q(Z.target.value),onBlur:V,onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),V())}})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopFiveHourPct,onChange:Z=>d({limitStopFiveHourPct:y_(Z.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopSevenDayPct,onChange:Z=>d({limitStopSevenDayPct:y_(Z.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":z,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:z?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!z}),children:a.jsx("span",{className:"switch__knob"})})]}),z&&c&&a.jsx("p",{className:c.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:c.status==="blocked"?c.reason??"Маршрут не прошёл проверку.":c.country?`Сейчас: ${c.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:z?"settings__field":"settings__field settings__nested is-disabled",children:[a.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),a.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[R.map(Z=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:Z}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${Z} из списка`,disabled:!z,onClick:()=>d({networkGuardBlockedCountries:R.filter(L=>L!==Z)}),children:"×"})]},Z)),R.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:Z=>{Z.preventDefault(),K()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:$,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!z,"aria-label":"Код страны, две буквы","aria-invalid":Y!==null,onChange:Z=>{B(Z.target.value.toUpperCase()),M(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!z||$.trim()==="",children:"Добавить"})]}),Y&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:Y})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Rl,{className:"settings__select",value:JS(n.autoSaveAfterPauseMs),options:FS,onChange:Z=>d({autoSaveAfterPauseMs:ZS(Z)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),__.map(Z=>{const L=(n==null?void 0:n.enabledProviders)??["claude","antigravity"],U=!S&&L.includes(Z.id),oe=U&&L.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${Z.id}`,"aria-hidden":"true",children:Z.id==="antigravity"?a.jsx(nm,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:Z.label}),a.jsx("span",{className:"settings__hint",children:oe?"Хотя бы один агент должен остаться включённым":Z.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":U,"aria-label":Z.label,disabled:oe,title:oe?"Хотя бы один агент должен остаться включённым":void 0,className:U?"switch is-on":"switch",onClick:()=>{const pe=__.map(we=>we.id).filter(we=>we===Z.id?!U:L.includes(we));d({enabledProviders:pe})},children:a.jsx("span",{className:"switch__knob"})})]},Z.id)})]}),a.jsxs("section",{className:"settings__section","aria-labelledby":"settings-shared-title",children:[a.jsx("h3",{className:"settings__heading",id:"settings-shared-title",children:"Общая конфигурация аккаунтов"}),a.jsx("p",{className:"settings__hint",children:"Выбор действует, когда аккаунт добавляется или подключается с включённым общим доступом. Уже существующие аккаунты не меняются, ссылки не удаляются."}),BS.map(Z=>{const L=(n==null?void 0:n.sharedConfigItems)??Wx,U=!S&&L.includes(Z.id);return a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("span",{className:"settings__field-label",children:Z.label}),a.jsx("span",{className:"settings__hint",children:Z.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":U,"aria-label":Z.label,className:U?"switch is-on":"switch",onClick:()=>d({sharedConfigItems:Wx.filter(oe=>oe===Z.id?!U:L.includes(oe))}),children:a.jsx("span",{className:"switch__knob"})})]},Z.id)}),a.jsx("h4",{className:"settings__subheading",children:"Никогда не делится"}),a.jsx("ul",{className:"settings__never",children:HS.map(Z=>a.jsxs("li",{children:[a.jsx("span",{className:"settings__never-name",children:Z.label}),a.jsx("span",{className:"settings__hint",children:Z.why})]},Z.label))})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Модель"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Rl,{className:"settings__select",value:n.startModel??vp,options:fe,onChange:Z=>d({startModel:Z===vp?null:Z}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Rl,{className:"settings__select",value:n.startPermissionMode,options:qS,onChange:Z=>d({startPermissionMode:Z}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":q,"aria-label":"Запущенные сессии сверху",className:q?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!q}),children:a.jsx("span",{className:"switch__knob"})})]})}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),a.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),a.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:WS.map(Z=>{const L=!S&&n.folderAccess===Z.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:S,className:"access__card"+(L?" is-on":"")+(Z.risky?" access__card--risky":""),onClick:()=>d({folderAccess:Z.value}),children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[Z.title,Z.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:Z.description})]})]},Z.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":ie,"aria-label":"Терминал",className:ie?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!ie}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(H?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),S?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[H&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),je()]})]})]}),a.jsxs("details",{ref:v,className:"settings__section settings__advanced",open:k||void 0,children:[a.jsxs("summary",{className:"settings__advanced-summary",children:[a.jsx("h3",{className:"settings__heading",children:"Вход и выход Claude Code (расширенное)"}),a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"settings__advanced-chev",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a.jsxs("div",{className:"settings__advanced-body",children:[a.jsxs("p",{className:"settings__hint",children:["ccv не хранит ни паролей, ни токенов. Эти кнопки запускают собственные команды Claude Code — ",a.jsx("code",{children:"claude auth login"})," и ",a.jsx("code",{children:"claude auth logout"})," — для папки выбранного аккаунта."]}),a.jsxs("ul",{className:"settings__hint settings__advanced-list",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Войти"})," — входит в эту папку: откроется ссылка в браузере, и Claude Code попросит код."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Выйти"})," — убирает вход из этой папки для всех сессий аккаунта."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Сменить аккаунт"})," — выйти и войти заново."]})]}),a.jsx(LS,{...b})]})]})]})})}const Af="Новая сессия начнётся с нуля: на другой аккаунт переходит только текст хэндоффа, прежний разговор под ним не открыть.";function Gy({targets:n,selectedId:l,sourceId:r,onSelect:c,variant:o,className:d,disabled:h}){const{auth:m}=$p(),g=n.find(M=>M.id===l)??n[0],[b,y]=x.useState(!1),[j,v]=x.useState(0),[S,k]=x.useState({left:0,top:0}),C=x.useRef(null),A=x.useRef(null);function Q(){v(Math.max(0,n.findIndex(M=>M.id===l))),y(!0)}function V(M){var z;y(!1),M&&((z=C.current)==null||z.focus())}function $(M){c(M.id),V(!0)}x.useLayoutEffect(()=>{if(!b)return;const M=C.current,z=A.current;if(!M||!z)return;const R=M.getBoundingClientRect(),K=z.getBoundingClientRect(),ie=8,q=Math.max(ie,Math.min(R.right-K.width,window.innerWidth-K.width-ie));let H=R.bottom+6;H+K.height>window.innerHeight-ie&&(H=Math.max(ie,R.top-K.height-6)),k({left:q,top:H}),z.focus()},[b]),x.useLayoutEffect(()=>{if(!b)return;function M(z){var K,ie;const R=z.target;!((K=A.current)!=null&&K.contains(R))&&!((ie=C.current)!=null&&ie.contains(R))&&V(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[b]);function B(M){if(M.key==="Escape")M.preventDefault(),M.stopPropagation(),V(!0);else if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const z=M.key==="ArrowDown"?1:-1;v(R=>(R+z+n.length)%n.length)}else if(M.key==="Enter"||M.key===" "){M.preventDefault();const z=n[j];z&&$(z)}else M.key==="Tab"&&V(!1)}if(!g)return null;const Y=`Аккаунт новой сессии: «${g.name}». Сменить`;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:C,type:"button",className:`${o==="split"?"splitbtn__caret":"pane-btn pane-btn--target"}${d?` ${d}`:""}`,title:Y,"aria-label":Y,"aria-haspopup":"menu","aria-expanded":b,disabled:h,onClick:()=>b?V(!1):Q(),onKeyDown:M=>{(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),Q())},children:[o==="mark"&&a.jsx(Oa,{account:g,size:"sm",className:"pane-btn__mark"}),a.jsx("svg",{className:"splitbtn__icon",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),b&&a.jsxs("div",{ref:A,className:"newsession__menu targetmenu",style:{left:S.left,top:S.top},role:"menu","aria-label":"Аккаунт новой сессии",tabIndex:-1,onKeyDown:B,children:[a.jsx("p",{className:"targetmenu__note",children:Af}),n.map((M,z)=>{const R=z_(m[M.id]);return a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M.id===l,className:"newsession__item"+(z===j?" is-cursor":""),onMouseEnter:()=>v(z),onClick:()=>$(M),children:[a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Oa,{account:M,size:"md"})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:M.name}),R&&a.jsx("span",{className:"newsession__hint",children:R})]}),M.id===r&&a.jsx("span",{className:"newsession__tag",children:"прежняя"}),M.id===l&&a.jsx("svg",{className:"targetmenu__check",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m2.5 6.4 2.4 2.4 4.6-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]},M.id)})]})]})}function eE({targets:n,selectedId:l,onSelect:r}){return a.jsxs("div",{className:"targetchips",role:"radiogroup","aria-label":"Аккаунт новой сессии",children:[a.jsx("span",{className:"targetchips__label",children:"Новая сессия на аккаунте"}),a.jsx("div",{className:"targetchips__row",children:n.map(c=>a.jsxs("button",{type:"button",role:"radio","aria-checked":c.id===l,className:`targetchips__chip acct--${c.color}${c.id===l?" is-on":""}`,onClick:()=>r(c.id),children:[a.jsx(Oa,{account:c,size:"sm"}),a.jsx("span",{className:"targetchips__name",children:c.name})]},c.id))}),a.jsx("span",{className:"targetchips__note",children:Af})]})}const v_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function tE(n){if(!n)return"срок неизвестен";const l=new Date(n);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function j_({label:n,primary:l,choice:r,onContinue:c}){const o=`btn btn--sm${l?" btn--primary":""}`,d=r==null?void 0:r.targets.find(m=>m.id===r.selectedId);if(!r||!d)return a.jsx("button",{type:"button",className:o,onClick:c,children:n});const h=d.id!==r.sourceId;return a.jsxs("span",{className:`splitbtn${l?" splitbtn--primary":""}`,children:[a.jsxs("button",{type:"button",className:`${o} splitbtn__main`,title:h?Af:`Новая сессия на том же аккаунте «${d.name}»`,onClick:c,children:[a.jsx("span",{className:`newsession__acct acct--${d.color}`,"aria-hidden":"true"}),n," на «",d.name,"»"]}),a.jsx(Gy,{variant:"split",className:o,targets:r.targets,selectedId:r.selectedId,sourceId:r.sourceId,onSelect:r.onSelect})]})}function nE({handoff:n,onContinue:l,onShow:r,onDismiss:c,sourceAccount:o=null,accountChoice:d=null}){if(n.continuedAt!==void 0){const h=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${v_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return a.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",h,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx(j_,{label:"Продолжить ещё раз",primary:!1,choice:d,onContinue:l})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[n.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Oa,{account:o,size:"sm",className:"handoff__acct"})," ",a.jsxs("strong",{className:"handoff__acctname",children:["«",o.name,"»"]}),":"," "]}),v_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",tE(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),d&&d.selectedId!==d.sourceId&&a.jsx("p",{className:"handoff__hint",children:Af}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx(j_,{label:d?"Продолжить":"Продолжить в новой сессии",primary:!0,choice:d,onContinue:l}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function sE({handoff:n,onClose:l}){const[r,c]=x.useState("");return x.useEffect(()=>{let o=!1;return Ef(n.text).then(d=>{o||c(d)}),()=>{o=!0}},[n.text]),a.jsx(Ns,{title:"Хэндофф",className:"modal--wide",onClose:l,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function lE({state:n}){return a.jsxs("div",{className:"netguard",role:"alert",children:[a.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),a.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),a.jsxs("div",{className:"netguard__copy",children:[a.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const jf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},aE=12e3;function iE(n){const l=n%10,r=n%100;return l===1&&r!==11?"сессии":"сессиях"}function rE({notices:n,onDismiss:l}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(r=>a.jsx(cE,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function cE({notice:n,onDismiss:l}){return x.useEffect(()=>{const r=window.setTimeout(l,aE);return()=>window.clearTimeout(r)},[l]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:n.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",jf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",iE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",jf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}function oE(n,l,r=Date.now()){if(!n||!n.available||!l)return null;const c=[["fiveHour",n.fiveHour,l.limitStopFiveHourPct],["sevenDay",n.sevenDay,l.limitStopSevenDayPct]];for(const[o,d,h]of c){if(!d||h<=0||d.utilization<h)continue;const m=Date.parse(d.resetsAt);if(!(!Number.isFinite(m)||m<=r))return{limit:o,utilization:d.utilization,resetsAt:m}}return null}function uE(n,l=Date.now()){const r=new Date(n),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(l).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const dE=16;function fE({pane:n,width:l,onResize:r,onReset:c}){const o=Jr[n],d=x.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-Hv):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function b(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(l+j*dE*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const hE=16;function pE({height:n,onResize:l,onReset:r}){const c=x.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const y=b.getBoundingClientRect().height-Yv;return Math.round(n+Math.max(0,y))}function d(b){b.button===0&&(c.current={y:b.clientY,height:n,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const y=c.current;if(!y)return;const j=y.y-b.clientY;l(y.height+j,y.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const y=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;y!==0&&(b.preventDefault(),l(n+y*hE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":Z_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function N_(){const n=document.documentElement,l=getComputedStyle(n),r=V=>l.getPropertyValue(V).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),S=r("--cm-fn"),k=r("--cm-key"),C=r("--cm-type"),A=w_(o,c,55),Q=V=>w_(V,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:A,brightBlack:h,red:y,brightRed:Q(y),green:j,brightGreen:Q(j),yellow:v,brightYellow:Q(v),blue:S,brightBlue:Q(S),magenta:k,brightMagenta:Q(k),cyan:C,brightCyan:Q(C),white:d,brightWhite:o}}function mE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ka=null;function gE(n){return ka||(ka=document.createElement("span"),ka.style.position="fixed",ka.style.width="0",ka.style.height="0",ka.style.opacity="0",ka.style.pointerEvents="none",document.body.appendChild(ka)),ka.style.color=n,getComputedStyle(ka).color}function w_(n,l,r){return gE(`color-mix(in srgb, ${n} ${100-r}%, ${l} ${r}%)`)}let ef=null;function xE(){return ef||(ef=Promise.all([nt(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),nt(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),nt(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),nt(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,l,r])=>({Terminal:n.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(n=>{throw ef=null,n})),ef}function bE({terminals:n,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:y,onOpen:j,onClose:v,onInput:S,onResize:k,onAttach:C,onHide:A,registerSink:Q}){const[V,$]=x.useState(()=>N_());return x.useEffect(()=>{const B=new MutationObserver(()=>$(N_()));return B.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>B.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},children:[a.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:B=>{b&&(B.target.closest("button")||b())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(B=>a.jsxs("div",{role:"tab","aria-selected":B.id===l,className:"termtab"+(B.id===l?" is-on":"")+(B.exitCode!==null?" termtab--exited":""),onDoubleClick:Y=>{b&&(Y.target.closest(".termtab__close")||b())},children:[a.jsx("button",{className:"termtab__name",title:B.cwd,onClick:()=>y(B.id),children:B.title}),B.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${B.exitCode}`,children:B.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${B.title}»`,onClick:()=>v(B.id),children:"✕"})]},B.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),b&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:a.jsx(_o,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&n.length>0&&a.jsx(k_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(k_,{message:c,onRetry:r?null:j,onDismiss:o}):r?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),n.map(B=>a.jsx(yE,{id:B.id,exitCode:B.exitCode,active:B.id===l,theme:V,mobile:m,onInput:S,onResize:k,onAttach:C,registerSink:Q},B.id))]})]})}function k_({message:n,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=_E(n);return a.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),d&&a.jsx("p",{className:"termfail__hint",children:d}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[r&&a.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function _E(n){const[l="",...r]=n.trim().split(`
|
|
125
|
+
|
|
126
|
+
`),c=l.split(`
|
|
127
|
+
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
128
|
+
|
|
129
|
+
`).trim()}}function yE({id:n,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=x.useRef(null),y=x.useRef(null),j=x.useRef(!1),v=x.useRef(o);v.current=o;const S=x.useRef(c),k=x.useRef(l),[C,A]=x.useState("loading"),[Q,V]=x.useState(!1);return x.useEffect(()=>{if(!b.current)return;let B=!1,Y=null;A("loading"),V(!1);const M=window.setTimeout(()=>{B||V(!0)},200);return(async()=>{var we;let z;try{z=await xE()}catch{window.clearTimeout(M),B||A("error");return}if(B||!b.current)return;window.clearTimeout(M);const{Terminal:R,FitAddon:K,WebLinksAddon:ie}=z,q=new R({fontFamily:mE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),H=new K;q.loadAddon(H),q.loadAddon(new ie),q.open(b.current),y.current=q,q.attachCustomKeyEventHandler(E=>{if(E.type!=="keydown"||!(E.ctrlKey||E.metaKey))return!0;if(E.key==="`")return E.preventDefault(),!1;if(E.key==="c"||E.key==="C"){const me=q.getSelection();return me?(E.preventDefault(),Da(me),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),zp().then(me=>{me&&q.paste(me)}),!1):!0});const fe=E=>{E.preventDefault();const P=q.getSelection();if(P){Da(P),q.clearSelection();return}zp().then(me=>{me&&q.paste(me)})};(we=q.element)==null||we.addEventListener("contextmenu",fe);const je=q.onData(E=>d(n,E));let Z={cols:q.cols,rows:q.rows},L=null;const U=q.onResize(({cols:E,rows:P})=>{L!==null&&window.clearTimeout(L),L=window.setTimeout(()=>{L=null,!(E===Z.cols&&P===Z.rows)&&(Z={cols:E,rows:P},h(n,E,P))},100)}),oe=new ResizeObserver(()=>{try{H.fit()}catch{return}v.current&&q.scrollToBottom()});oe.observe(b.current);const pe=g(n,E=>{E.kind==="buffer"&&q.reset(),q.write(E.data)});m(n),k.current!==null&&!j.current&&(j.current=!0,q.write(`\r
|
|
130
|
+
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
131
|
+
`)),r&&q.focus(),Y=()=>{var E;L!==null&&window.clearTimeout(L),oe.disconnect(),(E=q.element)==null||E.removeEventListener("contextmenu",fe),je.dispose(),U.dispose(),pe(),q.dispose(),y.current=null},A("ready")})(),()=>{B=!0,window.clearTimeout(M),Y==null||Y(),Y=null}},[n]),x.useEffect(()=>{if(!o)return;const $=b.current;if(!$)return;let B=null,Y=0,M=!1;const z=q=>{q.pointerType==="mouse"||B!==null||(B=q.pointerId,Y=q.clientY,M=!1)},R=q=>{if(q.pointerId!==B)return;const H=Y-q.clientY;if(!M){if(Math.abs(H)<4)return;M=!0,$.setPointerCapture(q.pointerId)}Y=q.clientY;const fe=$.querySelector(".xterm-viewport");fe&&(fe.scrollTop+=H)},K=q=>{q.pointerId===B&&($.hasPointerCapture(q.pointerId)&&$.releasePointerCapture(q.pointerId),B=null,M=!1)},ie=q=>q.stopPropagation();return $.addEventListener("pointerdown",z),$.addEventListener("pointermove",R),$.addEventListener("pointerup",K),$.addEventListener("pointercancel",K),$.addEventListener("touchmove",ie,{capture:!0}),()=>{$.removeEventListener("pointerdown",z),$.removeEventListener("pointermove",R),$.removeEventListener("pointerup",K),$.removeEventListener("pointercancel",K),$.removeEventListener("touchmove",ie,{capture:!0}),B!==null&&$.hasPointerCapture(B)&&$.releasePointerCapture(B)}},[o]),x.useEffect(()=>{S.current=c,y.current&&(y.current.options.theme=c)},[c]),x.useEffect(()=>{var $;r&&(($=y.current)==null||$.focus())},[r]),x.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const $=y.current;$&&(j.current=!0,$.write(`\r
|
|
132
|
+
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
133
|
+
`))},[l]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:b,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&Q&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),C==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const vE=2e5,jE=75,NE=90;function wE({tokens:n,maxTokens:l,fetchedAt:r}){if(n===null)return null;const c=l??vE,o=Math.min(100,Math.round(n/c*100)),d=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
134
|
+
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[a.jsx("span",{className:"contextbar__label",children:"контекст"}),a.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`contextbar__fill${kE(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function kE(n){return n>=NE?" contextbar__fill--over":n>=jE?" contextbar__fill--warn":""}const Yy="ccv:last-session",SE=300*1e3,EE=1e4;function TE(){try{const n=localStorage.getItem(Yy);if(!n)return null;const l=JSON.parse(n);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function S_(n){const l=new Set;return n.filter(r=>l.has(r.id)?!1:(l.add(r.id),!0))}function CE(n,l){const r=n.find(o=>o.id===l);if(r)return r;const c=n.filter(o=>pv(o.path).includes(l));return c.length===1?c[0]:void 0}function AE(n,l){return n.id===l.sessionId?!0:l.claudeSessionId?n.id===l.claudeSessionId||n.claudeSessionId===l.claudeSessionId:!1}const ME={mcp:"mcp",plugins:"plugins",plugin:"plugins"},E_=[{name:"login",description:"Войти в аккаунт Claude — Настройки, раздел входа",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново (Настройки)",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude (Настройки)",argumentHint:"",aliases:["signout","выход"]}],T_=[{id:or,name:"Основной",color:"orange",configDir:null,dir:"",main:!0,liveSessions:0}];function C_(n,l,r){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return l;const o=r[c===-1?"":n.slice(0,c)];if(!o)return null;const d=n.slice(c+1).toLowerCase();return d===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>A_(h.name,d)-A_(m.name,d))}}function A_(n,l){return n.toLowerCase().startsWith(l)?0:1}function M_(n,l){const r=n.find(o=>o.value===l)??n.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(r==null?void 0:r.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function RE(){var nd,on;const n=x.useRef(null),[l,r]=x.useState(!1),[c,o]=x.useState("Нет связи с хостом"),[d,h]=x.useState(null),[m,g]=x.useState(null),b=(m==null?void 0:m.status)==="blocked",[y,j]=x.useState(!1),v=x.useMemo(()=>lf()==="relay",[]),[S,k]=x.useState([]),[C,A]=x.useState([]),[Q,V]=x.useState([]),[$,B]=x.useState([]),[Y,M]=x.useState([]),[z,R]=x.useState(!1),[K,ie]=x.useState([]),[q,H]=x.useState([]),[fe,je]=x.useState({}),[Z,L]=x.useState([]),[U,oe]=x.useState([]),[pe,we]=x.useState(null),[E,P]=x.useState(null),[me,ke]=x.useState(null),[G,Se]=x.useState(null),[le,Ge]=x.useState(null),[Re,qt]=x.useState(null),[Xe,nn]=x.useState(Ds),[Pe,dt]=x.useState(lp),[st,vt]=x.useState(!1),[gs,gt]=x.useState(!1),lt=wf("(max-width: 860px)"),[Te,et]=x.useState(!1);x.useEffect(()=>{lt||et(!1)},[lt]);const[jt,ot]=x.useState(!1),[Ze,zt]=x.useState([]),[rs,Tt]=x.useState(!1),[sn,Fn]=x.useState(Ds),[_n,An]=x.useState(null),[xs,ln]=x.useState(null),[St,Zn]=x.useState(null),[Gt,Jn]=x.useState(null),[ue,Ne]=x.useState(null),[Ve,at]=x.useState({}),[We,ft]=x.useState([]),[X,ge]=x.useState(null),[De,He]=x.useState(null),[Yt,ts]=x.useState([]),[Ls,el]=x.useState([]),[xl,Ol]=x.useState([]),[zs,bs]=x.useState([]),[ns,zn]=x.useState(null),[yn,rn]=x.useState(null),[Je,Mn]=x.useState({}),[tl,bl]=x.useState(null),[sa,Ll]=x.useState({}),[Us,cs]=x.useState(null),[Ss,nl]=x.useState({}),[zl,Un]=x.useState([]),[Xt,Rn]=x.useState(!1),[Dn,Es]=x.useState(T_),[os,La]=x.useState({}),[Ts,In]=x.useState(null),[_l,ss]=x.useState(null),[Bn,it]=x.useState(null),[Ut,vn]=x.useState(()=>xv()??or),[Sn,yl]=x.useState(null),sl=(Sn==null?void 0:Sn.enabledProviders)??["claude","antigravity"],[Wn,ll]=x.useState(!1),[Vt,Ul]=x.useState({}),[pn,_s]=x.useState(null),[Ct,ve]=x.useState(null),[T,W]=x.useState(!1),[_e,,Le]=Uv(),$e=Gv(),[Ie,At]=x.useState(!1),[xt,On]=x.useState(null),[Dt,mn]=x.useState(null),[jn,al]=x.useState(null),[Is,us]=x.useState(null),[la,Zt]=x.useState(null),[Il,Jt]=x.useState(""),[xr,za]=x.useState(null),[il,vi]=x.useState([]),[ji,aa]=x.useState(!1),[Ua,ia]=x.useState(null),[Ia,En]=x.useState(!1),[w,se]=x.useState(!1),[ye,ze]=x.useState({}),[bt,Hn]=x.useState([""]),[It,gn]=x.useState([]),[br,Ba]=x.useState(null),[Mf,ra]=x.useState(null),[Ha,sc]=x.useState(null),[_r,lc]=x.useState(null),[Rf,yo]=x.useState(null),[yr,Ru]=x.useState({}),[ac,Du]=x.useState({}),[$a,qa]=x.useState(!1),[Df,vo]=x.useState(null),[ic,rc]=x.useState(null),Ou=x.useRef(0),cc=x.useRef(null),[Ni,jo]=x.useState(!1),[oc,vr]=x.useState([]),[Of,uc]=x.useState(null),[Lf,wi]=x.useState(null),ca=Xv(),No=Fv(lt&&Ni),ki=x.useRef(new Map),oa=(Sn==null?void 0:Sn.terminalEnabled)===!0,jr=lf()==="relay"&&((nd=d==null?void 0:d.shell)==null?void 0:nd.enabled)!==!0,dc=x.useRef(!1),Lu=x.useCallback((p,O)=>(ki.current.set(p,O),()=>{ki.current.get(p)===O&&ki.current.delete(p)}),[]),[Bs,fc]=x.useState(!1),[zu,hc]=x.useState(null),[wo,Nr]=x.useState(Ds),[Cs,ua]=x.useState(null),[wr,vl]=x.useState({}),Si=x.useRef([]),[cn,kr]=x.useState(null);function ko(p){kr(O=>O===p?null:p)}x.useEffect(()=>{(lt||cn==="terminal"&&!Ni||cn==="files"&&!w||cn==="search"&&!$a||cn==="git"&&!Ie||cn==="ask"&&!Bs||cn==="main"&&It.length===0)&&kr(null)},[cn,lt,Ni,w,$a,Ie,Bs,It.length]);const[Uu]=x.useState(TE),pc=x.useRef(Uu),Sr=x.useRef(!1),$n=x.useRef(null),Er=x.useRef(null),Tr=x.useRef(null),da=x.useRef(null),Iu=x.useRef(0),Nt=x.useRef(null),Ei=x.useRef(0);$n.current=le,Nt.current=G,Ei.current=Xe.lastSeq;const So=x.useRef(Pe);So.current=Pe;const jl=x.useRef(null),Eo=x.useRef(0);Eo.current=wo.lastSeq;const Cr=x.useRef(null),Ti=x.useRef(""),Ar=x.useRef(null),Hs=x.useRef([]),mc=x.useRef([""]);Hs.current=It,mc.current=bt;const Bl=x.useRef(new Map),Ci=x.useRef(new Set),Ai=x.useRef(null),rl=x.useRef(null),Ga=x.useRef(0),Ya=x.useRef(new Set);x.useEffect(()=>{const p=kv();if(!p)return;n.current=p;const O=()=>{r(p.connected),o(p.statusText)};p.onStatus(O),p.onReconnect(()=>{O(),Ll({});const rt=$n.current;rt&&p.send({type:"session.sync",sessionId:rt,sinceSeq:Ei.current});const en=jl.current;en&&p.send({type:"session.sync",sessionId:en,sinceSeq:Eo.current})});const re=p.on(rt=>Bu(rt));p.connect();const Ce=window.setInterval(()=>{O(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{re(),window.clearInterval(Ce),p.close()}},[]);const Bu=x.useCallback(p=>{var O,re,Ce,rt,en,Ln,fl,Gn,an,ii,Zl;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{k(S_(p.workspaces)),A(S_(p.archived)),Ne(null),Se(Ae=>{var Yn;if(Ae)return Ae;const Qe=pc.current,ut=Qe&&CE(p.workspaces,Qe.workspaceId);return Qe&&ut&&ut.id!==Qe.workspaceId&&(pc.current={...Qe,workspaceId:ut.id}),(ut==null?void 0:ut.id)??((Yn=p.workspaces[0])==null?void 0:Yn.id)??null});const be=Ar.current;if(!be)break;const Ee=p.workspaces.find(Ae=>IE(Ae.path,be));if(!Ee)break;Ar.current=null,ot(!1),Se(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==Ti.current)break;zt(p.candidates),p.source==="host"&&Tt(!1);break;case"finder.opened":Cr.current=p.sessionId;break;case"workspace.roots":ft(p.roots);break;case"workspace.created":if(Se(p.workspace.id),p.warnings.length===0){ot(!1),ln(null);break}ge({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(je(be=>({...be,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==Nt.current)break;ie(p.sessions),H(p.archived);break;case"folder.list":V(p.workspaceFolders),R(!0),B(p.sessionFolders),M(p.pinnedFolders??[]),Zn(p.projectsRoot??null),Ne(null);break;case"session.pinned":L(p.sessions);break;case"session.live":oe(p.sessions);break;case"order.state":ke(p.order);break;case"session.summary":if(p.session.id===Cr.current){An(p.session);break}if(p.session.parentSessionId){p.session.id===jl.current&&ua(p.session);break}if(oe(be=>{const Ee=be.findIndex(Qe=>Qe.id===p.session.id);if(p.session.state==="closed")return Ee===-1?be:be.filter(Qe=>Qe.id!==p.session.id);if(Ee===-1)return[...be,p.session];const Ae=be.slice();return Ae[Ee]=p.session,Ae}),ie(be=>{const Ee=be.findIndex(Qe=>Qe.id===p.session.id);if(Ee===-1)return p.session.workspaceId!==Nt.current?be:[p.session,...be];const Ae=be.slice();return Ae[Ee]=p.session,Ae}),je(be=>{const Ee=be[p.session.workspaceId];if(!Ee)return be;const Ae=Ee.sessions.findIndex(ut=>ut.id===p.session.id);let Qe;if(Ae!==-1)Qe=Ee.sessions.slice(),Qe[Ae]=p.session;else{if(Ee.archived.some(ut=>ut.id===p.session.id))return be;Qe=[p.session,...Ee.sessions]}return{...be,[p.session.workspaceId]:{...Ee,sessions:Qe}}}),L(be=>{const Ee=be.findIndex(Qe=>Qe.id===p.session.id);if(Ee===-1)return be;const Ae=be.slice();return Ae[Ee]={...p.session,pinned:!0,...be[Ee].pinnedAt?{pinnedAt:be[Ee].pinnedAt}:{}},Ae}),$n.current===null&&Tr.current&&Tr.current.workspaceId===p.session.workspaceId&&(G_(p.session.id,Tr.current.text),Tr.current=null),da.current!==null&&da.current===p.session.workspaceId&&p.session.workspaceId===Nt.current&&(da.current=null,Ge(be=>be??p.session.id)),((O=Er.current)==null?void 0:O.sessionId)===p.session.id){const be=Er.current;p.session.state==="error"?Er.current=null:p.session.state!=="closed"&&(Er.current=null,(re=n.current)==null||re.send({type:"prompt.send",sessionId:be.sessionId,text:be.text,images:be.images}))}break;case"usage.state":p.sessionId===$n.current&&(_s(p.usage),W(!1));break;case"context.state":p.sessionId===$n.current&&(ve(p.context),W(!1));break;case"session.capabilities":p.sessionId===$n.current&&qt(p.capabilities);break;case"session.events":if(p.sessionId===jl.current){Nr(be=>af(be,p.entries));break}if(p.sessionId===Cr.current){Fn(be=>af(be,p.entries));break}if(p.sessionId!==$n.current)break;for(const be of p.entries){if(be.event.kind!=="rewound")continue;const Ee=be.event.toUserIndex,Ae=Lv(So.current.entries,Ee),Qe=Ae.reduce((ut,Yn)=>Yn.event.kind==="user.message"?ut+1:ut,0);dt(ut=>({...ut,entries:Ae})),nn(ut=>({...ut,items:zv(ut.items,Ee,Qe)}))}nn(be=>af(be,p.entries));break;case"session.history":if(p.sessionId!==$n.current)break;dt(be=>Rv(be,p));break;case"side.opened":{if(p.parentSessionId!==$n.current)break;jl.current=p.sessionId,hc(p.sessionId);const be=Si.current;Si.current=[];for(const Ee of be)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==$n.current)break;jl.current=null,hc(null),Nr(Ds),ua(null);break;case"git.state":if(p.workspaceId!==Nt.current)break;On(p.state);break;case"git.commit":if(p.workspaceId!==Nt.current)break;mn(p.detail);break;case"git.result":if(p.workspaceId!==Nt.current)break;us({ok:p.ok,message:p.message,url:p.url}),p.ok&&(mn(null),al(null),aa(!1),En(!1));break;case"git.busy":if(p.workspaceId!==Nt.current)break;Jt(p.label);break;case"git.files":if(p.workspaceId!==Nt.current)break;ia({files:p.files,truncated:p.truncated});break;case"github.status":za(p.status);break;case"github.owners":vi(p.owners);break;case"fs.dir":if(p.workspaceId!==Nt.current)break;ze(be=>({...be,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Nt.current)break;if(p.scope!=="tree"){const be=p.scope;Du(Ee=>({...Ee,[be]:{query:p.query,entries:p.entries}}));break}yo({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Nt.current)break;vo({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Nt.current)break;const be=Ci.current.delete(p.file.path);gn(Ae=>{const Qe=Ae.findIndex(sd=>sd.path===p.file.path);if(Qe===-1)return[...Ae,Bb(p.file,++Ga.current)];const ut=Ae[Qe],Yn=Ae.slice();return Yn[Qe]=ut.saved===p.file.content&&!gi(ut)?{...ut,mtime:p.file.mtime,size:p.file.size,stale:!1}:Bb(p.file,++Ga.current),Yn}),be&&Ba(p.file.path);const Ee=cc.current;Ee&&Ee.path===p.file.path&&(cc.current=null,rc({...Ee,token:++Ou.current}));break}case"fs.media":{if(p.workspaceId!==Nt.current)break;Ya.current.delete(p.path),gn(be=>be.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Nt.current)break;Ya.current.delete(p.path),gn(be=>be.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Nt.current)break;const be=Bl.current.get(p.path);Bl.current.delete(p.path);const Ee=be!==void 0;gn(Qe=>Qe.map(ut=>ut.path!==p.path?ut:Ee?{...ut,saved:be,mtime:p.mtime,size:p.size,stale:!1}:{...ut,stale:!0}));const Ae=Hs.current.find(Qe=>Qe.path===p.path);!Ee&&Ae&&!gi(Ae)&&((Ce=n.current)==null||Ce.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(rt=n.current)==null||rt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Nt.current)break;if(ra({ok:p.ok,message:p.message}),p.ok||Bl.current.delete(p.path),p.conflict&&gn(Ee=>Ee.map(Ae=>Ae.path===p.path?{...Ae,stale:!0}:Ae)),rl.current===p.path){const Ee=rl.current;rl.current=null,p.ok&&(Ci.current.add(Ee),(en=n.current)==null||en.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const be=Ai.current;if(p.ok&&be&&be.to===p.path){Ai.current=null;const Ee=Ae=>Ae===be.from?be.to:Ae.startsWith(`${be.from}/`)?be.to+Ae.slice(be.from.length):Ae;gn(Ae=>Ae.map(Qe=>({...Qe,path:Ee(Qe.path)}))),Ba(Ae=>Ae===null?null:Ee(Ae)),Hn(Ae=>Ae.map(Ee)),ze(Ae=>{const Qe={};for(const[ut,Yn]of Object.entries(Ae))ut===be.from||ut.startsWith(`${be.from}/`)||(Qe[ut]=Yn);return Qe})}p.ok&&((Ln=n.current)==null||Ln.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Nt.current)break;vr(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Nt.current)break;wi(null),vr(be=>{const Ee=be.findIndex(Qe=>Qe.id===p.terminal.id);if(Ee===-1)return[...be,p.terminal];const Ae=be.slice();return Ae[Ee]=p.terminal,Ae}),dc.current&&(dc.current=!1,uc(p.terminal.id));break;case"term.buffer":(fl=ki.current.get(p.id))==null||fl({kind:"buffer",data:p.data});break;case"term.data":(Gn=ki.current.get(p.id))==null||Gn({kind:"data",data:p.data});break;case"term.exit":vr(be=>be.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":vr(be=>be.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===$n.current&&ts(p.servers);break;case"mcp.auth":p.sessionId===$n.current&&rn(p.state);break;case"plugin.list":if(p.sessionId!==$n.current)break;el(p.plugins),Ol(p.marketplaces),bs(p.catalog);break;case"operation.result":p.sessionId===$n.current&&zn(p.result);break;case"auth.status":La(be=>({...be,[p.accountId]:p.status}));break;case"accounts.candidates":ss(p.candidates);break;case"accounts.usage":at(be=>{const Ee={...be};for(const[Ae,Qe]of Object.entries(p.usage))(Qe!==null||!(Ae in Ee))&&(Ee[Ae]=Qe);return Ee});break;case"accounts.state":Es(p.accounts.length>0?p.accounts:T_),In(null),La(be=>{const Ee={};for(const Ae of p.accounts)Ee[Ae.id]=p.auth[Ae.id]??be[Ae.id]??null;return Ee});break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":yl(p.settings);break;case"handoff.state":Mn(be=>{if(!p.handoff){if(!(p.sessionId in be))return be;const Ee={...be};return delete Ee[p.sessionId],Ee}return{...be,[p.sessionId]:p.handoff}});break;case"handoff.written":Ll(be=>{if(!(p.sessionId in be))return be;const Ee={...be};return delete Ee[p.sessionId],Ee}),p.handoff&&$n.current===p.sessionId?cs(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Iu.current+=1,Un(be=>[...be,{id:Iu.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Ul(be=>({...be,[p.accountId]:p.state})),p.state.active&&Rn(!0);break;case"session.closed":oe(be=>be.filter(Ee=>Ee.id!==p.sessionId)),ie(be=>be.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee)),je(be=>{let Ee=!1;const Ae={};for(const[Qe,ut]of Object.entries(be))ut.sessions.some(Yn=>Yn.id===p.sessionId&&Yn.state!=="closed")?(Ee=!0,Ae[Qe]={...ut,sessions:ut.sessions.map(Yn=>Yn.id===p.sessionId?{...Yn,state:"closed"}:Yn)}):Ae[Qe]=ut;return Ee?Ae:be});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(Ar.current=null,ln(p.message)),(an=p.context)!=null&&an.startsWith("term.")&&wi(p.message),(ii=p.context)!=null&&ii.startsWith("folder.")&&(Ne(null),Jn(`${p.message} Ничего не изменилось.`)),(Zl=p.context)!=null&&Zl.startsWith("accounts.")&&In(p.message);break}},[]),te=x.useCallback(p=>{var O;(O=n.current)==null||O.send(p)},[]);x.useEffect(()=>{G&&te({type:"session.list",workspaceId:G})},[G,te]),x.useEffect(()=>{l&&te({type:"session.pins"})},[l,te]),x.useEffect(()=>{l&&te({type:"settings.get"})},[l,te]),x.useEffect(()=>{if(l)return te({type:"session.drafts",sessionIds:Y_()}),Cv(p=>te({type:"session.drafts",sessionIds:p}))},[l,te]),x.useEffect(()=>{if(Sr.current)return;const p=pc.current;if(!p||!G)return;if(G!==p.workspaceId){Sr.current=!0;return}if(le){Sr.current=!0;return}if(K.length===0)return;const O=K.find(re=>AE(re,p));Sr.current=!0,O&&O.state!=="closed"&&wl(O)},[K,G,le]),x.useEffect(()=>{!G||jr||!oa||te({type:"term.list",workspaceId:G})},[G,jr,oa,te]),x.useEffect(()=>{uc(p=>{var O;return p&&oc.some(re=>re.id===p)?p:((O=oc[0])==null?void 0:O.id)??null})},[oc]),x.useEffect(()=>{jt&&te({type:"workspace.roots"})},[jt,te]);const Xa=x.useCallback(()=>{const p=$n.current;p&&(W(!0),te({type:"usage.get",sessionId:p}),te({type:"context.get",sessionId:p}))},[te]);x.useEffect(()=>{if(!T)return;const p=window.setTimeout(()=>W(!1),EE);return()=>window.clearTimeout(p)},[T]);const gc=x.useMemo(()=>{const p=Math.max((pn==null?void 0:pn.fetchedAt)??0,(Ct==null?void 0:Ct.fetchedAt)??0);return p>0?p:null},[pn==null?void 0:pn.fetchedAt,Ct==null?void 0:Ct.fetchedAt]);x.useEffect(()=>{if(ve(null),!le)return;Xa();const p=()=>{document.hidden||Xa()},O=window.setInterval(p,SE),re=()=>{document.hidden||Xa()};return document.addEventListener("visibilitychange",re),()=>{window.clearInterval(O),document.removeEventListener("visibilitychange",re)}},[le,Xa]),x.useEffect(()=>{if(!le){dt(lp);return}dt({...lp,loading:!0}),te({type:"session.history",sessionId:le})},[le,te]);const Hu=x.useCallback(()=>{!le||Pe.loading||!tb(Pe)||(dt(p=>({...p,loading:!0})),te({type:"session.history",sessionId:le,before:V_(Pe)}))},[le,Pe,te]),zf=x.useMemo(()=>Dv(Pe.entries),[Pe.entries]),J=x.useMemo(()=>K.find(p=>p.id===le)??null,[K,le]),Hl=le?(J==null?void 0:J.claudeSessionId)??le:null,$s=Hl?Je[Hl]??null:null;x.useEffect(()=>{Hl&&te({type:"handoff.get",sessionId:Hl})},[Hl,te]),x.useEffect(()=>{tl&&!(tl.sessionId in Je)&&bl(null)},[Je,tl]);const To=x.useMemo(()=>{var re;if(!pn)return null;const p=(((re=pn.buckets)==null?void 0:re.length)??0)>0,O=(J==null?void 0:J.provider)==="antigravity";return p===O?pn:null},[pn,J==null?void 0:J.provider]),Mi=Dn.length>1;function qs(p){return Dn.some(O=>O.id===p)?p:or}const xc=x.useMemo(()=>({accounts:Dn,auth:os,multi:Dn.length>1}),[Dn,os]),xn=Mi&&J&&J.provider!=="antigravity"?Dn.find(p=>p.id===J.accountId)??null:null,Ri=x.useMemo(()=>{const p={};for(const O of K)O.provider!=="antigravity"&&(O.state!=="running"&&O.state!=="waiting_permission"||(p[O.accountId]=(p[O.accountId]??0)+1));return p},[K]),bc="Обновить лимиты и контекст",_c=bc+(gc?`
|
|
135
|
+
обновлено в ${new Date(gc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");x.useEffect(()=>{document.documentElement.dataset.provider=(J==null?void 0:J.provider)??"claude"},[J==null?void 0:J.provider]),x.useEffect(()=>{(J==null?void 0:J.provider)==="antigravity"&&fc(!1)},[J==null?void 0:J.provider]);const $l=S.find(p=>p.id===G)??C.find(p=>p.id===G)??null;x.useEffect(()=>{if(!G||!le)return;const p={workspaceId:G,sessionId:le,claudeSessionId:(J==null?void 0:J.claudeSessionId)??null};try{localStorage.setItem(Yy,JSON.stringify(p))}catch{}},[G,le,J==null?void 0:J.claudeSessionId]),x.useEffect(()=>{if(!ue)return;const p=window.setTimeout(()=>Ne(null),6e4);return()=>window.clearTimeout(p)},[ue]);function yc(p){Ar.current=p,ln(null),te({type:"workspace.open",path:p})}function Va(p,O,re,Ce){ln(null),te({type:"workspace.create",parent:p,name:O,init:re,...Ce?{folderId:Ce}:{}})}function $u(p){if(Ti.current=p,!p){zt([]),Tt(!1);return}Tt(!0),te({type:"workspace.find",query:p})}function vc(p){Ti.current=p,Fn(Ds),te({type:"workspace.find.agent",query:p})}function Di(){ot(!1),ln(null),ge(null),zt([]),Fn(Ds),An(null),Ti.current="",Ar.current=null}function Oi(){const p=$n.current;p&&jl.current&&te({type:"side.reset",sessionId:p}),jl.current=null,hc(null),Nr(Ds),ua(null),vl({}),Si.current=[]}function As(p){te({type:"workspace.close",workspaceIds:p}),Nl(p)}function Co(p){te({type:"workspace.unmark",workspaceIds:p}),Nl(p)}function Nl(p){!G||!p.includes(G)||(Oi(),Se(null),Ge(null),ie([]),H([]),nn(Ds),qt(null),gt(!1))}function qu(p,O){te({type:"session.archive",workspaceId:p,sessionIds:O}),le&&(O.includes(le)||J!=null&&J.claudeSessionId&&O.includes(J.claudeSessionId))&&(Oi(),Ge(null),nn(Ds),qt(null),gt(!1))}function jc(p){te({type:"workspace.restore",workspaceIds:p})}function Qa(p,O,re){Jn(null),te({type:"folder.create",scope:p,name:O,workspaceId:re})}function Ao(p,O){Jn(null),te({type:"folder.rename",folderId:p,name:O})}function Gu(p,O){te({type:"folder.setColor",folderId:p,color:O})}function Mo(p){Jn(null),te({type:"folder.delete",folderId:p})}function Yu(p,O,re,Ce){Jn(null),p==="workspace"&&Ne(O),te({type:"folder.assign",scope:p,itemId:O,folderId:re,workspaceId:Ce})}function Gs(p=sl[0]??"claude",O){if(!G)return;let re;p==="claude"&&Mi&&(re=O??qs(Ut),vn(re),bv(re)),Oi(),Ge(null),qt(null),nn(Ds),gt(!1),da.current=G,te({type:"session.start",workspaceId:G,provider:p,...re?{accountId:re}:{}}),vt(!1)}function fa(p){da.current=null,Oi(),Mc(),Se(p),Ge(null),nn(Ds),qt(null),gt(!1),On(null),mn(null),al(null),us(null),Jt(""),aa(!1),ia(null),En(!1),vr([]),uc(null)}function Li(p,O,re){te({type:"session.pin",workspaceId:p,sessionIds:O,pinned:re})}function Nc(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Ka(p){if(Nc(p)){we(p);return}te({type:"session.close",sessionId:p.id})}function Ys(p,O,re){ke(Ce=>{const rt=Ce??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!re)return Ce;const en={...rt.sessions};return O&&O.length>0?en[re]=O:delete en[re],{...rt,sessions:en}}return{...rt,[p]:O??[]}}),te({type:"order.set",scope:p,ids:O,...re?{workspaceId:re}:{}})}function Xs(p){p.workspaceId!==G&&fa(p.workspaceId),wl(p)}function wl(p){if(vt(!1),Oi(),nn(Ds),qt(null),gt(!1),p.state==="closed"){Ge(null),da.current=p.workspaceId,te({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}da.current=null,Ge(p.id),te({type:"session.sync",sessionId:p.id,sinceSeq:0})}function kl(p,O){if(!le||b)return!1;const re=le,Ce=J;return cl(()=>{if((Ce==null?void 0:Ce.state)==="closed"){Er.current={sessionId:Ce.id,text:p,images:O},wl(Ce);return}te({type:"prompt.send",sessionId:re,text:p,images:O})})}function cl(p){const O=(J==null?void 0:J.provider)==="antigravity"?null:oE(pn,Sn);return O?new Promise(re=>{P(Ce=>(Ce==null||Ce.resolve(!1),{warning:O,resolve:re}))}).then(re=>(re&&p(),re)):(p(),!0)}function ol(p){E&&(E.resolve(p),P(null))}function Ro(p){const O=U.find(rt=>(rt.claudeSessionId??rt.id)===p.sessionId&&rt.state!=="closed"),re=Mr(p.sessionId,p.workspaceId,p.limit!==null),Ce=re!=null&&re.canChoose?re.selectedId:(re==null?void 0:re.sourceId)??(O==null?void 0:O.accountId);Do(p.workspaceId,p.sessionId,p.text,Ce),O&&te({type:"session.close",sessionId:O.id})}function Mr(p,O,re){var Zl,be,Ee;if(!Mi)return null;const Ce=Ae=>Ae.id===p||Ae.claudeSessionId===p,rt=U.find(Ce)??K.find(Ce)??((Zl=fe[O])==null?void 0:Zl.sessions.find(Ce));if((rt==null?void 0:rt.provider)==="antigravity")return null;const en=rt==null?void 0:rt.accountId,Ln=Dn.filter(Ae=>{var Qe;return((Qe=os[Ae.id])==null?void 0:Qe.loggedIn)!==!1}),fl=Ae=>Ae&&Ln.some(Qe=>Qe.id===Ae)?Ae:void 0,Gn=fl(Ss[p]),an=en?(be=Ln.find(Ae=>Ae.id!==en))==null?void 0:be.id:void 0,ii=Gn??(re?an:void 0)??fl(en)??fl(or)??((Ee=Ln[0])==null?void 0:Ee.id)??or;return{source:Dn.find(Ae=>Ae.id===en)??null,sourceId:en,targets:Ln,selectedId:ii,canChoose:Ln.length>1}}function wc(p){Do(p.workspaceId,p.claudeSessionId??p.id,null,p.accountId)}function Do(p,O,re,Ce){Tr.current=re===null?null:{workspaceId:p,text:re},p!==G?fa(p):(Oi(),Ge(null),qt(null),nn(Ds),gt(!1)),da.current=p,te({type:"session.start",workspaceId:p,provider:"claude",...Mi&&Ce?{accountId:Ce}:{},continuesFrom:O,...re===null?{}:{fromHandoff:!0}}),vt(!1)}x.useEffect(()=>{Us&&(cs(null),Ro(Us))},[Us]);function qn(p){sa[p.id]||(Ll(O=>({...O,[p.id]:!0})),te({type:"session.handoff",sessionId:p.id}))}function Wt(p){te({type:"handoff.dismiss",sessionId:p})}function ht(p,O){te({type:"session.rename",sessionId:p.id,title:O,workspaceId:p.workspaceId}),ie(re=>re.map(Ce=>Ce.id===p.id?{...Ce,title:O}:Ce)),je(re=>{const Ce=re[p.workspaceId];return Ce?{...re,[p.workspaceId]:{...Ce,sessions:Ce.sessions.map(rt=>rt.id===p.id?{...rt,title:O}:rt)}}:re})}function ql(p){le&&(vt(!1),zn(null),rn(null),He(p),te({type:"mcp.list",sessionId:le}),te({type:"plugin.list",sessionId:le}))}const Vs={mcpAction:(p,O)=>{le&&(zn(null),te({type:"mcp.action",sessionId:le,name:p,action:O}))},mcpAuth:p=>{le&&(zn(null),rn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),te({type:"mcp.auth",sessionId:le,name:p}))},mcpAuthCallback:(p,O)=>{le&&te({type:"mcp.auth_callback",sessionId:le,name:p,callbackUrl:O})},mcpAdd:(p,O)=>{le&&te({type:"mcp.add",sessionId:le,name:p,draft:O})},mcpRemove:p=>{le&&te({type:"mcp.remove",sessionId:le,name:p})},pluginInstall:p=>{le&&te({type:"plugin.install",sessionId:le,spec:p})},pluginUninstall:p=>{le&&te({type:"plugin.uninstall",sessionId:le,id:p})},pluginToggle:(p,O)=>{le&&te({type:"plugin.toggle",sessionId:le,id:p,enabled:O})},marketplaceAdd:p=>{le&&te({type:"marketplace.add",sessionId:le,source:p})},marketplaceRemove:p=>{le&&te({type:"marketplace.remove",sessionId:le,name:p})}};function kc(){vt(!1),Rn(!0),In(null);for(const p of Dn)te({type:"auth.status",accountId:p.id})}const Sl={login:(p,O,re)=>te({type:"auth.login",mode:O,switchAccount:re,accountId:p}),submitCode:(p,O)=>te({type:"auth.code",code:O,accountId:p}),cancel:p=>te({type:"auth.cancel",accountId:p}),logout:p=>te({type:"auth.logout",accountId:p})},Xu={discover:()=>te({type:"accounts.discover"}),requestUsage:()=>te({type:"accounts.usage"}),add:(p,O,re,Ce)=>{In(null),te({type:"accounts.add",name:p,color:O,...re?{configDir:re}:{},...Ce?{shareConfig:!0}:{}})},update:(p,O)=>{In(null),te({type:"accounts.update",accountId:p,...O})},remove:p=>{In(null),te({type:"accounts.remove",accountId:p})},makeMain:p=>{In(null),te({type:"accounts.makeMain",accountId:p})}};function Sc(p){Rn(!1),vt(!1),it(p),ll(!0),te({type:"settings.get"});for(const O of Dn)te({type:"auth.status",accountId:O.id})}function zi(){vt(!1),it(null),ll(!0),te({type:"settings.get"});for(const p of Dn)te({type:"auth.status",accountId:p.id})}function Fa(p){yl(O=>O&&{...O,...p}),te({type:"settings.update",settings:p})}function Oo(p){!le||b||te({type:"side.ask",sessionId:le,text:p})}function Rr(){le&&(te({type:"side.reset",sessionId:le}),jl.current=null,hc(null),Nr(Ds),ua(null),vl({}),Si.current=[])}function Za(p){const O=jl.current;if(O){p(O);return}const re=$n.current;re&&(Si.current.push(p),te({type:"side.open",sessionId:re}))}function ha(){G&&te({type:"git.state",workspaceId:G})}function Gl(p){G&&(al(p),te({type:"git.show",workspaceId:G,ref:p}))}function Yl(p,O){us(null),Zt({target:p,label:O})}function Xl(){!G||!la||(te({type:"git.checkout",workspaceId:G,target:la.target}),Zt(null))}function Lo(){G&&(us(null),te({type:"git.push",workspaceId:G}))}function zo(p){G&&(us(null),te({type:"git.pull",workspaceId:G,merge:p}))}function Ui(){G&&(us(null),ia(null),aa(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:G}))}function Ec(p){G&&(us(null),te({type:"git.publish",workspaceId:G,...p}))}function Ja(p){G&&(us(null),te({type:"git.remote",workspaceId:G,url:p}))}function Pn(){us(null),En(!0)}function Tc(p){te({type:"github.token",token:p}),te({type:"github.owners"})}function Vu(){te({type:"github.status"}),te({type:"github.owners"})}x.useEffect(()=>{if(!(!w||!G))for(const p of bt)p in ye||te({type:"fs.list",workspaceId:G,path:p})},[w,bt,ye,G,te]);function Uf(p){Hn(O=>O.includes(p)?O.filter(re=>re!==p):[...O,p])}function If(p){if(!p){yo(null);return}G&&te({type:"fs.search",workspaceId:G,query:p})}function Bf(p){if(!p){vo(null);return}G&&te({type:"fs.grep",workspaceId:G,query:p})}const Nn=x.useCallback((p,O)=>{Ru(rt=>({...rt,[p]:O}));const re=Nt.current;if(O===null||!re)return;const Ce=O.lastIndexOf("/");if(Ce!==-1){te({type:"fs.list",workspaceId:re,path:O.slice(0,Ce)});return}if(O===""){te({type:"fs.list",workspaceId:re,path:""});return}te({type:"fs.search",workspaceId:re,query:O,scope:p})},[te]),Uo=x.useMemo(()=>C_(yr.mention??null,ac.mention??null,ye),[yr.mention,ac.mention,ye]),Dr=x.useMemo(()=>C_(yr.side??null,ac.side??null,ye),[yr.side,ac.side,ye]);function Or(p){pa(p.path,{line:p.line,column:p.column})}function Io(p){const O=[];let re=Wr(p.path);for(;O.push(re),!!re;)re=Wr(re);Hn(Ce=>{const rt=new Set(Ce);for(const en of O)rt.add(en);return p.kind==="dir"&&rt.add(p.path),[...rt]}),p.kind==="file"&&pa(p.path)}function pa(p,O){if(Hs.current.find(Ce=>Ce.path===p)){Ba(p),O&&rc({path:p,...O,token:++Ou.current});return}G&&(O&&(cc.current={path:p,...O}),Ci.current.add(p),te({type:"fs.read",workspaceId:G,path:p}))}function ma(p,O=!1){const re=Hs.current,Ce=re.find(Ln=>Ln.path===p);if(Ce&&gi(Ce)&&!O){lc(p);return}lc(null);const rt=re.findIndex(Ln=>Ln.path===p),en=re.filter(Ln=>Ln.path!==p);gn(en),Ba(Ln=>{var fl;return Ln===p?((fl=en[Math.min(rt,en.length-1)])==null?void 0:fl.path)??null:Ln})}function Cc(p,O=!1){const re=Hs.current.find(Ce=>Ce.path===p);!re||!G||!O&&!gi(re)||(Bl.current.set(p,re.text),te({type:"fs.write",workspaceId:G,path:p,content:re.text,eol:re.eol,encoding:re.encoding,baseMtime:re.mtime,...O?{force:!0}:{}}))}function Qu(p){G&&te({type:"fs.read",workspaceId:G,path:p})}function Hf(p){G&&(Ya.current.has(p)||(Ya.current.add(p),te({type:"fs.readMedia",workspaceId:G,path:p})))}const Ku=x.useRef(new Map);function Wa(p){const O=Ku.current,re=O.get(p);re&&clearTimeout(re);const Ce=(Sn==null?void 0:Sn.autoSaveAfterPauseMs)??0;Ce<=0||O.set(p,setTimeout(()=>{O.delete(p);const rt=Hs.current.find(en=>en.path===p);rt&&gi(rt)&&!rt.stale&&Cc(p)},Ce))}function Bo(p,O,re){if(!G)return;const Ce=p?`${p}/${re}`:re;ra(null),O==="file"&&(rl.current=Ce),te({type:"fs.create",workspaceId:G,path:Ce,kind:O})}function Ac(p,O){if(!G)return;const re=Wr(p),Ce=re?`${re}/${O}`:O;ra(null),Ai.current={from:p,to:Ce},te({type:"fs.rename",workspaceId:G,path:p,to:Ce})}function Fu(p,O){if(!G)return;const re=p.slice(p.lastIndexOf("/")+1),Ce=O?`${O}/${re}`:re;Ce!==p&&(ra(null),Ai.current={from:p,to:Ce},te({type:"fs.rename",workspaceId:G,path:p,to:Ce}))}function Ii(p,O){G&&(ra(null),te({type:"fs.copy",workspaceId:G,path:p,toDir:O}))}function Ho(p){G&&(ra(null),sc(null),te({type:"fs.delete",workspaceId:G,path:p.path}),gn(O=>O.filter(re=>re.path!==p.path&&!re.path.startsWith(`${p.path}/`))),Ba(O=>O&&(O===p.path||O.startsWith(`${p.path}/`))?null:O))}function Mc(){ze({}),Hn([""]),gn([]),Ba(null),ra(null),yo(null),vo(null),Ru({}),Du({}),rc(null),Ci.current.clear(),Bl.current.clear(),Ya.current.clear(),cc.current=null,Ai.current=null,rl.current=null}function Rc(){!G||jr||!oa||(wi(null),dc.current=!0,te({type:"term.open",workspaceId:G,cols:80,rows:24}))}function Zu(p){te({type:"term.close",id:p})}function Ju(p,O){le&&te({type:"permission.respond",sessionId:le,requestId:p,decision:O})}function Pa(p,O){le&&te({type:"permission.respond",sessionId:le,requestId:p,decision:"allow",answers:O})}function ei(p){le&&te({type:"permission.respond",sessionId:le,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Wu(p,O){le&&te({type:"permission.respond",sessionId:le,requestId:p,decision:"allow",plan:O})}function Pu(p){le&&te({type:"permission.respond",sessionId:le,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}x.useEffect(()=>{function p(O){if(O.key!=="Escape")return;if(cn!==null){const Ce=O.target;if(!(Ce instanceof HTMLElement&&Ce.closest(".termview, .editor, .sidepane"))){kr(null);return}}if(!le||Xe.pending.length>0)return;const re=O.target;re instanceof HTMLElement&&re.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:le})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[le,Xe.pending.length,te,cn]),x.useEffect(()=>{function p(O){O.key!=="`"||!(O.ctrlKey||O.metaKey)||oa&&(O.preventDefault(),jo(re=>!re))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[oa]);const ti=x.useMemo(()=>{const p=(Re==null?void 0:Re.commands)??[];return p.length===0||(J==null?void 0:J.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...E_]},[Re,J==null?void 0:J.provider]);function Bi(p){const O=ME[p];if(O&&(J==null?void 0:J.provider)!=="antigravity")return ql(O),!0;if((J==null?void 0:J.provider)==="antigravity"||!E_.some(Ce=>Ce.name===p))return!1;const re=(J==null?void 0:J.accountId)??or;return Sc(re),p==="logout"&&Sl.logout(re),p==="switch-account"&&Sl.login(re,"claudeai",!0),!0}const ni=(J==null?void 0:J.state)==="waiting_permission",ds=(J==null?void 0:J.state)==="reconnecting",ys=(J==null?void 0:J.state)==="running"||ds||ni,Pt=Xe.pending[0]??null,Vl=Pt?pk(Pt.toolName,Pt.input):null,[ed,ga]=x.useState(()=>new Set),Hi=Pt?ed.has(Pt.requestId):!1,Dc=Pt?Pt.questions&&Pt.questions.length>0?"question":Vl!==null?"plan":"permission":null;function ul(p,O){ga(re=>{if(re.has(p)===O)return re;const Ce=new Set(re);return O?Ce.add(p):Ce.delete(p),Ce})}x.useEffect(()=>{!Ie&&!w||!G||ys||te({type:"git.state",workspaceId:G})},[Ie,w,G,ys,te]),x.useEffect(()=>{if(!(ys||!G)){w&&ze(p=>{const O={};for(const[re,Ce]of Object.entries(p))mc.current.includes(re)||(O[re]=Ce);return O});for(const p of Hs.current)gi(p)||te({type:"fs.read",workspaceId:G,path:p.path})}},[ys,G,w,te]);const El=(J==null?void 0:J.cwd)??(Re==null?void 0:Re.cwd)??null,$i=(Re==null?void 0:Re.models)??[],qi=(J==null?void 0:J.model)??(Re==null?void 0:Re.model)??null,{rows:Oc,selected:Lr}=M_($i,qi),Ql=Cs?{model:Cs.model,effort:Cs.effort,ultracode:Cs.ultracode,thinking:Cs.thinking,switchOnFlag:Cs.switchModelsOnFlag}:{model:wr.model??qi,effort:wr.effort??(J==null?void 0:J.effort)??null,ultracode:wr.ultracode??(J==null?void 0:J.ultracode)??!1,thinking:wr.thinking??(J==null?void 0:J.thinking)??!0,switchOnFlag:wr.switchOnFlag??(J==null?void 0:J.switchModelsOnFlag)??!0},$o=M_($i,Ql.model),td=(Cs==null?void 0:Cs.state)==="running",xa=br?It.find(p=>p.path===br)??null:null,Lc=new Set(It.filter(gi).map(p=>p.path)),Gi=p=>a.jsx(fE,{pane:p,width:$e.widths[p],onResize:O=>$e.setWidth(p,O),onReset:()=>$e.reset(p)}),ba=p=>lt?null:()=>ko(p),qo=(J==null?void 0:J.provider)==="antigravity"?Bv:Q_,vs=Re&&a.jsx(Rl,{title:"Режим прав",value:(J==null?void 0:J.permissionMode)??"default",options:qo.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{le&&te({type:"control.set_mode",sessionId:le,mode:p})}}),Ms=Oc.length>0?a.jsx(Uy,{models:Oc,value:Lr,effort:(J==null?void 0:J.effort)??null,ultracode:(J==null?void 0:J.ultracode)??!1,thinking:(J==null?void 0:J.thinking)??!0,switchOnFlag:(J==null?void 0:J.switchModelsOnFlag)??!0,showSwitchOnFlag:(J==null?void 0:J.provider)!=="antigravity",onModel:p=>{!le||!p||te({type:"control.set_model",sessionId:le,model:p})},onEffort:p=>{le&&te({type:"control.set_effort",sessionId:le,effort:p})},onUltracode:p=>{le&&te({type:"control.set_ultracode",sessionId:le,enabled:p})},onThinking:p=>{le&&te({type:"control.set_thinking",sessionId:le,enabled:p})},onSwitchOnFlag:p=>{le&&te({type:"control.set_flag_switch",sessionId:le,enabled:p})}}):qi&&a.jsx("span",{className:"badge",children:qi}),_a=ys&&a.jsx("span",{className:ni?"badge badge--wait":"badge badge--live",children:ni?"ждёт":ds?"переподключается":"работает"}),Go=(J==null?void 0:J.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Yo=_a||Go,Kl=()=>{le&&te({type:"session.reconnect",sessionId:le})},Rs=ds?"Сессия уже поднимает новый процесс":ys?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",wn=le&&(ds||(J==null?void 0:J.state)==="error")?a.jsxs("div",{className:ds?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),ds?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:ds?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Kl,children:ds?"Переподключить сейчас":"Переподключить"})]}):null,Qs=$s?Mr($s.sessionId,$s.workspaceId,$s.limit!==null):null,Fl=$s&&(Qs!=null&&Qs.canChoose)?{targets:Qs.targets,selectedId:Qs.selectedId,sourceId:Qs.sourceId,onSelect:p=>nl(O=>({...O,[$s.sessionId]:p}))}:null,Ye=J&&J.state!=="closed"&&J.provider!=="antigravity"&&Hl?Mr(Hl,J.workspaceId,!1):null,Et=Ye!=null&&Ye.canChoose&&Hl?p=>nl(O=>({...O,[Hl]:p})):null,Tn=$s?a.jsx(nE,{handoff:$s,sourceAccount:(Qs==null?void 0:Qs.source)??null,accountChoice:Fl,onContinue:()=>Ro($s),onShow:()=>bl($s),onDismiss:()=>Wt($s.sessionId)}):null,Yi=J&&J.totalCostUsd>0?`$${J.totalCostUsd.toFixed(3)}`:null,si=(J==null?void 0:J.provider)!=="antigravity"&&a.jsx("button",{className:Bs?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Bs,onClick:()=>fc(p=>!p),children:a.jsx(HE,{})}),li=J&&J.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Ka(J),children:a.jsx(zE,{})}),dl=J?sa[J.id]===!0:!1,ai=J_({onLongPress:()=>{J&&wc(J)},onClick:()=>{J&&qn(J)},disabled:dl}),Xi=J&&J.state!=="closed"&&J.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:dl?"pane-btn pane-btn--handoff is-busy":ai.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ai.thresholdMs}ms`},title:dl?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":dl,disabled:dl,...ai.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(UE,{})]});return a.jsx(Hp.Provider,{value:xc,children:a.jsxs("div",{className:"app",style:$e.style,children:[a.jsx(GN,{open:st,connected:l,status:c,workspaces:S,archivedWorkspaces:C,workspaceFolders:Q,sessionFolders:$,pinnedFolders:Y,projectSessions:fe,onRequestSessions:p=>te({type:"session.list",workspaceId:p}),pinned:Z,live:U,listOrder:me,liveSessionsFirst:(Sn==null?void 0:Sn.liveSessionsFirst)===!0,onReorder:Ys,activeWorkspaceId:G,activeSessionId:le,onPinSessions:Li,onSelectPinned:Xs,onCloseWorkspaces:As,onRestoreWorkspaces:jc,onUnmarkWorkspaces:Co,onArchiveSessions:qu,onUnarchiveSessions:(p,O)=>{te({type:"session.unarchive",workspaceId:p,sessionIds:O})},onCreateFolder:Qa,onRenameFolder:Ao,onSetFolderColor:Gu,onDeleteFolder:Mo,onAssignToFolder:Yu,folderNotice:Gt,onDismissFolderNotice:()=>Jn(null),movingProjectId:ue,foldersReady:z,onSelectWorkspace:fa,onRenameSession:ht,onStopSession:Ka,onOpenWorkspace:()=>ot(!0),onOpenUnopened:yc,onNewSession:Gs,enabledProviders:sl,lastAccountId:qs(Ut),onSignInAccount:Sc,onOpenExtensions:le&&(J==null?void 0:J.provider)!=="antigravity"?()=>ql("mcp"):null,account:os[or]??null,onOpenAccount:kc,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:zi,themeMode:_e,onCycleTheme:Le}),Gi("sidebar"),st&&a.jsx("div",{className:"scrim",onClick:()=>vt(!1)}),a.jsx(eN,{open:w,tree:ye,expanded:new Set(bt),activePath:br,dirty:Lc,gitChanges:(xt==null?void 0:xt.changed)??[],result:Mf,searchResult:Rf,onSearch:If,onReveal:Io,onToggle:Uf,onOpen:pa,onCreate:Bo,onRename:Ac,onMove:Fu,onCopy:Ii,onDelete:sc,onRefresh:()=>{ra(null),ze({}),ha()},onClose:()=>se(!1),zoomed:cn==="files",onToggleZoom:ba("files")}),w&&cn!=="files"&&Gi("files"),a.jsx(uN,{open:$a,result:Df,onSearch:Bf,onOpenMatch:Or,onClose:()=>qa(!1),zoomed:cn==="search",onToggleZoom:ba("search")}),$a&&cn!=="search"&&Gi("search"),a.jsx(Tk,{open:Ie,state:xt,result:Is,selected:jn,busy:Il,onRefresh:ha,onShow:Gl,onCheckout:Yl,onPush:Lo,onPull:zo,onPublish:Ui,onConnectRemote:Pn,onDismissResult:()=>us(null),onClose:()=>At(!1),zoomed:cn==="git",onToggleZoom:ba("git")}),Ie&&cn!=="git"&&Gi("git"),a.jsxs("main",{className:(cn==="main"||cn==="terminal"?"main main--zoomed":"main")+(xn?` main--acct acct--${xn.color}`:""),children:[m&&b&&a.jsx(lE,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>vt(!0),children:"☰"}),a.jsx("button",{className:w?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":w,onClick:()=>{se(p=>!p),At(!1),qa(!1)},children:a.jsx(DE,{})}),a.jsx("button",{className:$a?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":$a,onClick:()=>{qa(p=>!p),se(!1),At(!1)},children:a.jsx(OE,{})}),a.jsx("button",{className:Ie?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Ie,onClick:()=>{At(p=>!p),se(!1),qa(!1)},children:a.jsx(LE,{})}),oa&&a.jsx("button",{className:Ni?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":Ni,onClick:()=>jo(p=>!p),children:a.jsx(BE,{})}),lt&&si,lt&&a.jsx("button",{className:Te?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Te,onClick:()=>et(!0),children:a.jsx($E,{})}),a.jsxs("div",{className:"topbar__id",children:[gs&&J?a.jsx(Ra,{className:"rename--title",value:J.title??"",onCommit:p=>{ht(J,p),gt(!1)},onCancel:()=>gt(!1)}):a.jsxs("div",{className:"topbar__head",children:[lt&&xn&&a.jsx(Oa,{account:xn}),a.jsx("button",{className:"topbar__title",disabled:!J||lt,title:J&&!lt?"Переименовать сессию":void 0,onClick:()=>gt(!0),children:(J==null?void 0:J.title)??"Claude Code Visual"}),$l&&a.jsx("span",{className:"topbar__project",title:$l.path,children:$l.name})]}),lt?Yo:El&&a.jsx(zy,{path:El})]}),!lt&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:T?"meters-refresh is-busy":"meters-refresh",title:_c,"aria-label":bc,"aria-busy":T,disabled:!le||T,onClick:Xa,children:a.jsx(qE,{})}),xn&&a.jsx(Px,{account:xn,onClick:kc}),a.jsx(cm,{usage:To}),a.jsx($y,{}),vs,Ms,Yo,Yi&&a.jsx("span",{className:"badge badge--cost",children:Yi}),Xi,Ye&&Et&&!dl&&a.jsx(Gy,{variant:"mark",targets:Ye.targets,selectedId:Ye.selectedId,sourceId:Ye.sourceId,onSelect:Et}),li,si]})]}),a.jsx(wE,{tokens:(Ct==null?void 0:Ct.tokens)??Xe.contextTokens,maxTokens:(Ct==null?void 0:Ct.maxTokens)??null,fetchedAt:(Ct==null?void 0:Ct.fetchedAt)??null}),lt&&Te&&a.jsx(rS,{onClose:()=>et(!1),permission:vs,model:Ms,account:xn&&a.jsx(Px,{account:xn}),usage:To,cwd:El,costLabel:Yi,onRefresh:Xa,refreshing:T,metersFetchedAt:gc,onRename:J?()=>{gt(!0),et(!1)}:null,onHandoff:J&&J.state!=="closed"&&J.provider!=="antigravity"?()=>{qn(J),et(!1)}:null,onFreshSession:J&&J.state!=="closed"&&J.provider!=="antigravity"?()=>{wc(J),et(!1)}:null,handoffWriting:dl,handoffAccount:Ye&&Et&&!dl?a.jsx(eE,{targets:Ye.targets,selectedId:Ye.selectedId,onSelect:Et}):null,onStop:J&&J.state!=="closed"?()=>{Ka(J),et(!1)}:null}),It.length>0&&a.jsx(CN,{files:It,activePath:br,busy:ys,onSelect:Ba,onClose:p=>ma(p),zoomed:cn==="main",onToggleZoom:ba("main")}),xa?a.jsx(EN,{file:xa,goto:(ic==null?void 0:ic.path)===xa.path?ic:null,onChange:(p,O)=>{gn(re=>re.map(Ce=>Ce.path===p?{...Ce,text:O}:Ce)),Wa(p)},onSave:p=>Cc(p),onReload:Qu,onOverwrite:p=>Cc(p,!0),onRequestMedia:Hf,onTogglePreview:p=>gn(O=>O.map(re=>re.path===p?{...re,previewMode:!re.previewMode}:re))}):a.jsxs(a.Fragment,{children:[a.jsx(am,{items:Xe.items,busy:ys&&!ds,waiting:ni,empty:(J==null?void 0:J.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:zf,historyHasMore:tb(Pe),historyLoading:Pe.loading,onLoadHistory:Hu,sessionId:le??void 0,onEditMessage:(J==null?void 0:J.provider)==="antigravity"?void 0:(p,O,re)=>{if(!le||b)return!1;const Ce=le;return cl(()=>te({type:"prompt.edit",sessionId:Ce,userIndex:p,text:O,images:re}))}}),wn,Tn,le&&((on=J==null?void 0:J.tasks)!=null&&on.length)?a.jsx(ON,{tasks:J.tasks,onStop:p=>te({type:"task.stop",sessionId:le,taskId:p})}):null,Pt&&Dc&&Hi&&a.jsx(ok,{kind:Dc,toolName:Pt.toolName,queued:Xe.pending.length-1,onExpand:()=>ul(Pt.requestId,!1)}),a.jsx(Dy,{disabled:!le,busy:ys&&!ds,sendBlocked:b,placeholder:ds?"Промпт уйдёт, как только связь вернётся":(J==null?void 0:J.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:ti,sessionTitle:(J==null?void 0:J.title)??null,contextResult:Uo,draftKey:le,onContextSearch:p=>Nn("mention",p),onCommand:Bi,onSend:kl,onInterrupt:()=>{le&&te({type:"control.interrupt",sessionId:le})}})]}),Ni&&oa&&a.jsxs(a.Fragment,{children:[!lt&&cn!=="terminal"&&a.jsx(pE,{height:ca.height,onResize:ca.setHeight,onReset:ca.reset}),a.jsx(bE,{mobile:lt,zoomed:cn==="terminal",onToggleZoom:ba("terminal"),terminals:oc,activeId:Of,blocked:jr,error:Lf,onDismissError:()=>wi(null),height:lt?No.height:ca.height,offset:lt?{top:No.offsetTop,left:No.offsetLeft}:void 0,onSelect:uc,onOpen:Rc,onClose:Zu,onInput:(p,O)=>te({type:"term.input",id:p,data:O}),onResize:(p,O,re)=>te({type:"term.resize",id:p,cols:O,rows:re}),onAttach:p=>te({type:"term.attach",id:p}),onHide:()=>jo(!1),registerSink:Lu})]})]}),a.jsx(Jk,{open:Bs,items:wo.items,busy:td,ready:le!==null,sendBlocked:b,commands:ti,contextResult:Dr,draftKey:le,models:$o.rows,model:$o.selected,effort:Ql.effort,ultracode:Ql.ultracode,thinking:Ql.thinking,switchOnFlag:Ql.switchOnFlag,onContextSearch:p=>Nn("side",p),onCommand:Bi,onModel:p=>{p&&(vl(O=>({...O,model:p})),Za(O=>te({type:"control.set_model",sessionId:O,model:p})))},onEffort:p=>{vl(O=>({...O,effort:p,ultracode:!1})),Za(O=>te({type:"control.set_effort",sessionId:O,effort:p}))},onUltracode:p=>{vl(O=>({...O,ultracode:p,...p?{effort:"xhigh"}:{}})),Za(O=>te({type:"control.set_ultracode",sessionId:O,enabled:p}))},onThinking:p=>{vl(O=>({...O,thinking:p})),Za(O=>te({type:"control.set_thinking",sessionId:O,enabled:p}))},onSwitchOnFlag:p=>{vl(O=>({...O,switchOnFlag:p})),Za(O=>te({type:"control.set_flag_switch",sessionId:O,enabled:p}))},onAsk:Oo,onInterrupt:()=>{zu&&te({type:"control.interrupt",sessionId:zu})},onReset:Rr,onClose:()=>fc(!1),zoomed:cn==="ask",onToggleZoom:ba("ask")}),Bs&&cn!=="ask"&&Gi("ask"),(Ie||Bs||w||$a)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{At(!1),fc(!1),se(!1),qa(!1)}}),Dt&&a.jsx(Rk,{detail:Dt,local:((xt==null?void 0:xt.hasRemote)??!1)&&(xt==null?void 0:xt.commits.some(p=>p.hash===Dt.hash&&!p.pushed))===!0,onCheckout:Yl,onClose:()=>{mn(null),al(null)}}),E&&a.jsxs(Ns,{title:"Лимит плана почти исчерпан",onClose:()=>ol(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>ol(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>ol(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[jf[E.warning.limit][0].toUpperCase(),jf[E.warning.limit].slice(1)," использован на"," ",Math.round(E.warning.utilization)," %, сброс в"," ",uE(E.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),pe&&a.jsx(Ns,{title:"Остановить сессию?",onClose:()=>we(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>we(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:pe.id}),we(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),la&&a.jsxs(Ns,{title:"Переключить рабочее дерево?",onClose:()=>Zt(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Zt(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Xl,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",la.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),ys&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),xt&&xt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",xt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),ji&&a.jsx(Xk,{status:xr,owners:il,files:Ua,defaultName:($l==null?void 0:$l.name)??"",hasCommits:xt===null||xt.head!=="",busy:Il,result:Is,onRefreshStatus:Vu,onSaveToken:Tc,onPublish:Ec,onDismissResult:()=>us(null),onClose:()=>aa(!1)}),Ia&&a.jsx(Zk,{busy:Il,result:Is,onSubmit:Ja,onDismissResult:()=>us(null),onClose:()=>En(!1)}),Ha&&a.jsx(Ns,{title:Ha.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>sc(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>sc(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Ho(Ha),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[Ha.path," будет удалён с диска",Ha.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),_r&&a.jsx(Ns,{title:"Закрыть без сохранения?",onClose:()=>lc(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>lc(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>ma(_r,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Cc(_r),ma(_r,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",_r," есть несохранённые правки."]})}),De&&a.jsx(oS,{tab:De,servers:Yt,plugins:Ls,marketplaces:xl,catalog:zs,result:ns,auth:yn,remote:v,actions:Vs,onTab:He,onClose:()=>He(null)}),Xt&&a.jsx(bS,{accounts:Dn,auth:os,logins:Vt,candidates:_l,usage:Ve,actions:Xu,onOpenLogin:Sc,activeAccountId:(xn==null?void 0:xn.id)??null,error:Ts,onReconnect:le?()=>{Kl(),Rn(!1)}:null,reconnectBlocked:ys,reconnectHint:Rs,onClose:()=>Rn(!1)}),y&&a.jsx(RS,{state:d,onPair:(p,O)=>te({type:"relay.pair",code:p,...O?{name:O}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>j(!1)}),Wn&&a.jsx(PS,{settings:Sn,projectsRootHint:St,models:(Re==null?void 0:Re.models)??[],relayState:d,networkState:m,local:lf()==="local",onChange:Fa,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{ll(!1),j(!0)},claudeLogin:{accounts:Dn,auth:os,logins:Vt,actions:Sl,remote:v,runningByAccount:Ri,focusAccountId:Bn},onClose:()=>{ll(!1),it(null)}}),jt&&a.jsx(bk,{candidates:Ze,searching:rs,agentItems:sn.items,agentBusy:(_n==null?void 0:_n.state)==="running",error:xs,roots:We,folders:Q,projectsRoot:St,created:X,onSearch:$u,onAskAgent:vc,onInterrupt:()=>{const p=Cr.current;p&&te({type:"control.interrupt",sessionId:p})},onSubmit:yc,onCreate:Va,onClose:Di}),Pt!=null&&Pt.questions&&Pt.questions.length>0?a.jsx(dk,{request:{...Pt,questions:Pt.questions},queued:Xe.pending.length-1,collapsed:Hi,onCollapse:()=>ul(Pt.requestId,!0),onAnswer:Pa,onDecline:ei}):Pt&&Vl!==null?a.jsx(rk,{request:Pt,plan:Vl,queued:Xe.pending.length-1,collapsed:Hi,onCollapse:()=>ul(Pt.requestId,!0),onAccept:Wu,onDecline:Pu}):Pt&&a.jsx(uk,{request:Pt,queued:Xe.pending.length-1,collapsed:Hi,onCollapse:()=>ul(Pt.requestId,!0),onDecide:Ju}),tl&&a.jsx(sE,{handoff:tl,onClose:()=>bl(null)}),a.jsx(rE,{notices:zl,onDismiss:p=>Un(O=>O.filter(re=>re.id!==p))})]})})}function DE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function OE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function LE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),a.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),a.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),a.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function zE(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:a.jsx("rect",{x:"3.6",y:"3.6",width:"8.8",height:"8.8",rx:"1.8"})})}function UE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.8",y:"2.4",width:"7",height:"11.2",rx:"1.5"}),a.jsx("path",{d:"M4.1 5.7h2.4M4.1 10.3h2.4"}),a.jsx("path",{d:"M8.8 8h5.4M11.9 5.6 14.2 8l-2.3 2.4"})]})}function IE(n,l){return R_(n)===R_(l)}function R_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function BE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),a.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),a.jsx("path",{d:"M8.2 10h3.1"})]})}function HE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.6 9.4a1.6 1.6 0 0 1-1.6 1.6H6.2L3.2 13.4V4.2a1.6 1.6 0 0 1 1.6-1.6h7.2a1.6 1.6 0 0 1 1.6 1.6Z"}),a.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function $E(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function qE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),a.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Xy=document.getElementById("root");if(!Xy)throw new Error("#root not found");fv.createRoot(Xy).render(a.jsx(x.StrictMode,{children:a.jsx(RE,{})}));export{b1 as D,dn as I,hn as N,XE as P,Ml as T,na as a,dy as b,Ps as c,YE as d,gy as e,Tu as f,U1 as h,VE as p,QE as s,Oe as t};
|