@i14ks/ccv 0.35.0 → 0.36.0

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.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/web/assets/{codemirror-CHw8zyKh.js → codemirror-FNniEeOo.js} +1 -1
  3. package/web/assets/{index-Bnnn92II.js → index--pVrBrRP.js} +1 -1
  4. package/web/assets/{index-CszNh_rE.js → index-43NV4wp5.js} +1 -1
  5. package/web/assets/{index-Bmwi1hyg.js → index-9YABvRbq.js} +1 -1
  6. package/web/assets/index-BQr3Km5w.css +1 -0
  7. package/web/assets/{index-VwBy7Jbn.js → index-BTva2T09.js} +1 -1
  8. package/web/assets/{index-DqkqUYxR.js → index-BUZiX0ln.js} +1 -1
  9. package/web/assets/{index-CBo-Zjlj.js → index-BV2gK4r0.js} +1 -1
  10. package/web/assets/{index-Bzu9Q3cY.js → index-Bs9mX4lO.js} +1 -1
  11. package/web/assets/{index-DNUvScMr.js → index-BsMjV8iw.js} +1 -1
  12. package/web/assets/{index-Hx8xY5so.js → index-CEKH2iEH.js} +1 -1
  13. package/web/assets/{index-ua0K8YOJ.js → index-CS2PrFoe.js} +1 -1
  14. package/web/assets/{index-DI-Q91A_.js → index-CVZPnaKi.js} +1 -1
  15. package/web/assets/{index-CqsQgCoQ.js → index-Cum77H6O.js} +1 -1
  16. package/web/assets/{index-C8B1PkLL.js → index-DRxOnO8W.js} +1 -1
  17. package/web/assets/{index-BTQ15CqO.js → index-DZMtE1jR.js} +1 -1
  18. package/web/assets/{index-CN82xtMN.js → index-Da32Ee32.js} +1 -1
  19. package/web/assets/{index-CoS8eTbV.js → index-DjaXZKWB.js} +1 -1
  20. package/web/assets/{index-DUJErNwM.js → index-DrXBBXUh.js} +1 -1
  21. package/web/assets/index-G1vSAvGZ.js +134 -0
  22. package/web/assets/{index-Bpr-s9We.js → index-LuXGRs0T.js} +1 -1
  23. package/web/assets/{index-BofmrRh8.js → index-x12EvaoW.js} +1 -1
  24. package/web/index.html +2 -2
  25. package/web/assets/index-BmeJVywf.css +0 -1
  26. package/web/assets/index-CbzA3ZUH.js +0 -134
@@ -1,134 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Bzu9Q3cY.js","./index-Bpr-s9We.js","./index-Hx8xY5so.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-DI-Q91A_.js","./index-C8B1PkLL.js","./index-VwBy7Jbn.js","./index-BofmrRh8.js","./index-CqsQgCoQ.js","./index-Bmwi1hyg.js","./index-DUJErNwM.js","./index-CszNh_rE.js","./index-CN82xtMN.js","./index-BTQ15CqO.js","./index-DqkqUYxR.js","./index-DNUvScMr.js","./index-Bnnn92II.js","./index-CoS8eTbV.js","./index-CBo-Zjlj.js","./index-ua0K8YOJ.js","./codemirror-CHw8zyKh.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 C0=Object.defineProperty;var Cx=l=>{throw TypeError(l)};var A0=(l,s,r)=>s in l?C0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Zt=(l,s,r)=>A0(l,typeof s!="symbol"?s+"":s,r),Uh=(l,s,r)=>s.has(l)||Cx("Cannot "+r);var Qe=(l,s,r)=>(Uh(l,s,"read from private field"),r?r.call(l):s.get(l)),mn=(l,s,r)=>s.has(l)?Cx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),Ot=(l,s,r,c)=>(Uh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),Hn=(l,s,r)=>(Uh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.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 Hh={exports:{}},Go={};/**
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 Ax;function M0(){if(Ax)return Go;Ax=1;var l=Symbol.for("react.transitional.element"),s=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:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Go.Fragment=s,Go.jsx=r,Go.jsxs=r,Go}var Mx;function R0(){return Mx||(Mx=1,Hh.exports=M0()),Hh.exports}var a=R0(),Bh={exports:{}},Je={};/**
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 Rx;function D0(){if(Rx)return Je;Rx=1;var l=Symbol.for("react.transitional.element"),s=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"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function T(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function P(k,te,q){this.props=k,this.context=te,this.refs=A,this.updater=q||w}P.prototype.isReactComponent={},P.prototype.setState=function(k,te){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,te,"setState")},P.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function W(){}W.prototype=P.prototype;function K(k,te,q){this.props=k,this.context=te,this.refs=A,this.updater=q||w}var I=K.prototype=new W;I.constructor=K,C(I,P.prototype),I.isPureReactComponent=!0;var V=Array.isArray;function U(){}var D={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function O(k,te,q){var _e=q.ref;return{$$typeof:l,type:k,key:te,ref:_e!==void 0?_e:null,props:q}}function ee(k,te){return O(k.type,te,k.props)}function B(k){return typeof k=="object"&&k!==null&&k.$$typeof===l}function Q(k){var te={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(q){return te[q]})}var pe=/\/+/g;function Se(k,te){return typeof k=="object"&&k!==null&&k.key!=null?Q(""+k.key):te.toString(36)}function be(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(U,U):(k.status="pending",k.then(function(te){k.status==="pending"&&(k.status="fulfilled",k.value=te)},function(te){k.status==="pending"&&(k.status="rejected",k.reason=te)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function H(k,te,q,_e,Y){var Ae=typeof k;(Ae==="undefined"||Ae==="boolean")&&(k=null);var Me=!1;if(k===null)Me=!0;else switch(Ae){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(k.$$typeof){case l:case s:Me=!0;break;case y:return Me=k._init,H(Me(k._payload),te,q,_e,Y)}}if(Me)return Y=Y(k),Me=_e===""?"."+Se(k,0):_e,V(Y)?(q="",Me!=null&&(q=Me.replace(pe,"$&/")+"/"),H(Y,te,q,"",function(bt){return bt})):Y!=null&&(B(Y)&&(Y=ee(Y,q+(Y.key==null||k&&k.key===Y.key?"":(""+Y.key).replace(pe,"$&/")+"/")+Me)),te.push(Y)),1;Me=0;var Xe=_e===""?".":_e+":";if(V(k))for(var Ue=0;Ue<k.length;Ue++)_e=k[Ue],Ae=Xe+Se(_e,Ue),Me+=H(_e,te,q,Ae,Y);else if(Ue=T(k),typeof Ue=="function")for(k=Ue.call(k),Ue=0;!(_e=k.next()).done;)_e=_e.value,Ae=Xe+Se(_e,Ue++),Me+=H(_e,te,q,Ae,Y);else if(Ae==="object"){if(typeof k.then=="function")return H(be(k),te,q,_e,Y);throw te=String(k),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return Me}function ue(k,te,q){if(k==null)return k;var _e=[],Y=0;return H(k,_e,"","",function(Ae){return te.call(q,Ae,Y++)}),_e}function ie(k){if(k._status===-1){var te=k._result;te=te(),te.then(function(q){(k._status===0||k._status===-1)&&(k._status=1,k._result=q)},function(q){(k._status===0||k._status===-1)&&(k._status=2,k._result=q)}),k._status===-1&&(k._status=0,k._result=te)}if(k._status===1)return k._result.default;throw k._result}var xe=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Ce={map:ue,forEach:function(k,te,q){ue(k,function(){te.apply(this,arguments)},q)},count:function(k){var te=0;return ue(k,function(){te++}),te},toArray:function(k){return ue(k,function(te){return te})||[]},only:function(k){if(!B(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Je.Activity=j,Je.Children=Ce,Je.Component=P,Je.Fragment=r,Je.Profiler=o,Je.PureComponent=K,Je.StrictMode=c,Je.Suspense=g,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Je.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Je.cache=function(k){return function(){return k.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(k,te,q){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var _e=C({},k.props),Y=k.key;if(te!=null)for(Ae in te.key!==void 0&&(Y=""+te.key),te)!R.call(te,Ae)||Ae==="key"||Ae==="__self"||Ae==="__source"||Ae==="ref"&&te.ref===void 0||(_e[Ae]=te[Ae]);var Ae=arguments.length-2;if(Ae===1)_e.children=q;else if(1<Ae){for(var Me=Array(Ae),Xe=0;Xe<Ae;Xe++)Me[Xe]=arguments[Xe+2];_e.children=Me}return O(k.type,Y,_e)},Je.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Je.createElement=function(k,te,q){var _e,Y={},Ae=null;if(te!=null)for(_e in te.key!==void 0&&(Ae=""+te.key),te)R.call(te,_e)&&_e!=="key"&&_e!=="__self"&&_e!=="__source"&&(Y[_e]=te[_e]);var Me=arguments.length-2;if(Me===1)Y.children=q;else if(1<Me){for(var Xe=Array(Me),Ue=0;Ue<Me;Ue++)Xe[Ue]=arguments[Ue+2];Y.children=Xe}if(k&&k.defaultProps)for(_e in Me=k.defaultProps,Me)Y[_e]===void 0&&(Y[_e]=Me[_e]);return O(k,Ae,Y)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(k){return{$$typeof:m,render:k}},Je.isValidElement=B,Je.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:ie}},Je.memo=function(k,te){return{$$typeof:x,type:k,compare:te===void 0?null:te}},Je.startTransition=function(k){var te=D.T,q={};D.T=q;try{var _e=k(),Y=D.S;Y!==null&&Y(q,_e),typeof _e=="object"&&_e!==null&&typeof _e.then=="function"&&_e.then(U,xe)}catch(Ae){xe(Ae)}finally{te!==null&&q.types!==null&&(te.types=q.types),D.T=te}},Je.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Je.use=function(k){return D.H.use(k)},Je.useActionState=function(k,te,q){return D.H.useActionState(k,te,q)},Je.useCallback=function(k,te){return D.H.useCallback(k,te)},Je.useContext=function(k){return D.H.useContext(k)},Je.useDebugValue=function(){},Je.useDeferredValue=function(k,te){return D.H.useDeferredValue(k,te)},Je.useEffect=function(k,te){return D.H.useEffect(k,te)},Je.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Je.useId=function(){return D.H.useId()},Je.useImperativeHandle=function(k,te,q){return D.H.useImperativeHandle(k,te,q)},Je.useInsertionEffect=function(k,te){return D.H.useInsertionEffect(k,te)},Je.useLayoutEffect=function(k,te){return D.H.useLayoutEffect(k,te)},Je.useMemo=function(k,te){return D.H.useMemo(k,te)},Je.useOptimistic=function(k,te){return D.H.useOptimistic(k,te)},Je.useReducer=function(k,te,q){return D.H.useReducer(k,te,q)},Je.useRef=function(k){return D.H.useRef(k)},Je.useState=function(k){return D.H.useState(k)},Je.useSyncExternalStore=function(k,te,q){return D.H.useSyncExternalStore(k,te,q)},Je.useTransition=function(){return D.H.useTransition()},Je.version="19.2.8",Je}var Dx;function kp(){return Dx||(Dx=1,Bh.exports=D0()),Bh.exports}var b=kp(),Ih={exports:{}},Yo={},qh={exports:{}},Gh={};/**
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 Ox;function O0(){return Ox||(Ox=1,(function(l){function s(H,ue){var ie=H.length;H.push(ue);e:for(;0<ie;){var xe=ie-1>>>1,Ce=H[xe];if(0<o(Ce,ue))H[xe]=ue,H[ie]=Ce,ie=xe;else break e}}function r(H){return H.length===0?null:H[0]}function c(H){if(H.length===0)return null;var ue=H[0],ie=H.pop();if(ie!==ue){H[0]=ie;e:for(var xe=0,Ce=H.length,k=Ce>>>1;xe<k;){var te=2*(xe+1)-1,q=H[te],_e=te+1,Y=H[_e];if(0>o(q,ie))_e<Ce&&0>o(Y,q)?(H[xe]=Y,H[_e]=ie,xe=_e):(H[xe]=q,H[te]=ie,xe=te);else if(_e<Ce&&0>o(Y,ie))H[xe]=Y,H[_e]=ie,xe=_e;else break e}}return ue}function o(H,ue){var ie=H.sortIndex-ue.sortIndex;return ie!==0?ie:H.id-ue.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],x=[],y=1,j=null,v=3,T=!1,w=!1,C=!1,A=!1,P=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function I(H){for(var ue=r(x);ue!==null;){if(ue.callback===null)c(x);else if(ue.startTime<=H)c(x),ue.sortIndex=ue.expirationTime,s(g,ue);else break;ue=r(x)}}function V(H){if(C=!1,I(H),!w)if(r(g)!==null)w=!0,U||(U=!0,Q());else{var ue=r(x);ue!==null&&be(V,ue.startTime-H)}}var U=!1,D=-1,R=5,O=-1;function ee(){return A?!0:!(l.unstable_now()-O<R)}function B(){if(A=!1,U){var H=l.unstable_now();O=H;var ue=!0;try{e:{w=!1,C&&(C=!1,W(D),D=-1),T=!0;var ie=v;try{t:{for(I(H),j=r(g);j!==null&&!(j.expirationTime>H&&ee());){var xe=j.callback;if(typeof xe=="function"){j.callback=null,v=j.priorityLevel;var Ce=xe(j.expirationTime<=H);if(H=l.unstable_now(),typeof Ce=="function"){j.callback=Ce,I(H),ue=!0;break t}j===r(g)&&c(g),I(H)}else c(g);j=r(g)}if(j!==null)ue=!0;else{var k=r(x);k!==null&&be(V,k.startTime-H),ue=!1}}break e}finally{j=null,v=ie,T=!1}ue=void 0}}finally{ue?Q():U=!1}}}var Q;if(typeof K=="function")Q=function(){K(B)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Se=pe.port2;pe.port1.onmessage=B,Q=function(){Se.postMessage(null)}}else Q=function(){P(B,0)};function be(H,ue){D=P(function(){H(l.unstable_now())},ue)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(H){H.callback=null},l.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<H?Math.floor(1e3/H):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(H){switch(v){case 1:case 2:case 3:var ue=3;break;default:ue=v}var ie=v;v=ue;try{return H()}finally{v=ie}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(H,ue){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ie=v;v=H;try{return ue()}finally{v=ie}},l.unstable_scheduleCallback=function(H,ue,ie){var xe=l.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?xe+ie:xe):ie=xe,H){case 1:var Ce=-1;break;case 2:Ce=250;break;case 5:Ce=1073741823;break;case 4:Ce=1e4;break;default:Ce=5e3}return Ce=ie+Ce,H={id:y++,callback:ue,priorityLevel:H,startTime:ie,expirationTime:Ce,sortIndex:-1},ie>xe?(H.sortIndex=ie,s(x,H),r(g)===null&&H===r(x)&&(C?(W(D),D=-1):C=!0,be(V,ie-xe))):(H.sortIndex=Ce,s(g,H),w||T||(w=!0,U||(U=!0,Q()))),H},l.unstable_shouldYield=ee,l.unstable_wrapCallback=function(H){var ue=v;return function(){var ie=v;v=ue;try{return H.apply(this,arguments)}finally{v=ie}}}})(Gh)),Gh}var Lx;function L0(){return Lx||(Lx=1,qh.exports=O0()),qh.exports}var Yh={exports:{}},ol={};/**
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 zx;function z0(){if(zx)return ol;zx=1;var l=kp();function s(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+x+" 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(s(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,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:x,implementation:y}}var h=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return ol.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ol.createPortal=function(g,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(s(299));return d(g,x,null,y)},ol.flushSync=function(g){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=y,c.d.f()}},ol.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},ol.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},ol.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,T=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:T}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:T,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},ol.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=m(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},ol.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin);c.d.L(g,y,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},ol.preloadModule=function(g,x){if(typeof g=="string")if(x){var y=m(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},ol.requestFormReset=function(g){c.d.r(g)},ol.unstable_batchedUpdates=function(g,x){return g(x)},ol.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},ol.useFormStatus=function(){return h.H.useHostTransitionStatus()},ol.version="19.2.8",ol}var Ux;function U0(){if(Ux)return Yh.exports;Ux=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Yh.exports=z0(),Yh.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 Hx;function H0(){if(Hx)return Yo;Hx=1;var l=L0(),s=kp(),r=U0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,i=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){n=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==i.return)n=u,i=f;else{for(var _=!1,S=u.child;S;){if(S===n){_=!0,n=u,i=f;break}if(S===i){_=!0,i=u,n=f;break}S=S.sibling}if(!_){for(S=f.child;S;){if(S===n){_=!0,n=f,i=u;break}if(S===i){_=!0,i=f,n=u;break}S=S.sibling}if(!_)throw Error(c(189))}}if(n.alternate!==i)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?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"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),K=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=B&&e[B]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case P:return"Profiler";case A:return"StrictMode";case V:return"Suspense";case U:return"SuspenseList";case O:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case K:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var be=Array.isArray,H=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},xe=[],Ce=-1;function k(e){return{current:e}}function te(e){0>Ce||(e.current=xe[Ce],xe[Ce]=null,Ce--)}function q(e,t){Ce++,xe[Ce]=e.current,e.current=t}var _e=k(null),Y=k(null),Ae=k(null),Me=k(null);function Xe(e,t){switch(q(Ae,t),q(Y,e),q(_e,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pg(t),e=Wg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}te(_e),q(_e,e)}function Ue(){te(_e),te(Y),te(Ae)}function bt(e){e.memoizedState!==null&&q(Me,e);var t=_e.current,n=Wg(t,e.type);t!==n&&(q(Y,e),q(_e,n))}function Ge(e){Y.current===e&&(te(_e),te(Y)),Me.current===e&&(te(Me),Ho._currentValue=ie)}var gn,Ke;function dt(e){if(gn===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);gn=t&&t[1]||"",Ke=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+gn+e+Ke}var rt=!1;function ct(e,t){if(!e||rt)return"";rt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ae){var ne=ae}Reflect.construct(e,[],he)}else{try{he.call()}catch(ae){ne=ae}e.call(he.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.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],S=f[1];if(_&&S){var M=_.split(`
45
- `),J=S.split(`
46
- `);for(u=i=0;i<M.length&&!M[i].includes("DetermineComponentFrameRoot");)i++;for(;u<J.length&&!J[u].includes("DetermineComponentFrameRoot");)u++;if(i===M.length||u===J.length)for(i=M.length-1,u=J.length-1;1<=i&&0<=u&&M[i]!==J[u];)u--;for(;1<=i&&0<=u;i--,u--)if(M[i]!==J[u]){if(i!==1||u!==1)do if(i--,u--,0>u||M[i]!==J[u]){var oe=`
47
- `+M[i].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=i&&0<=u);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?dt(n):""}function kt(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 ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return dt("Activity");default:return""}}function Lt(e){try{var t="",n=null;do t+=kt(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
48
- Error generating stack: `+i.message+`
49
- `+i.stack}}var je=Object.prototype.hasOwnProperty,ht=l.unstable_scheduleCallback,_t=l.unstable_cancelCallback,rn=l.unstable_shouldYield,pt=l.unstable_requestPaint,lt=l.unstable_now,Bt=l.unstable_getCurrentPriorityLevel,Jn=l.unstable_ImmediatePriority,Mt=l.unstable_UserBlockingPriority,Wt=l.unstable_NormalPriority,rl=l.unstable_LowPriority,wn=l.unstable_IdlePriority,cn=l.log,Pn=l.unstable_setDisableYieldValue,on=null,st=null;function ot(e){if(typeof cn=="function"&&Pn(e),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(on,e)}catch{}}var It=Math.clz32?Math.clz32:ve,Yn=Math.log,re=Math.LN2;function ve(e){return e>>>=0,e===0?32:31-(Yn(e)/re|0)|0}var Be=256,Fe=262144,Ze=4194304;function hn(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,n){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~f,i!==0?u=hn(i):(_&=S,_!==0?u=hn(_):n||(n=S&~e,n!==0&&(u=hn(n))))):(S=i&~f,S!==0?u=hn(S):_!==0?u=hn(_):n||(n=i&~e,n!==0&&(u=hn(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function de(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ke(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 Le(){var e=Ze;return Ze<<=1,(Ze&62914560)===0&&(Ze=4194304),e}function yt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function $n(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hl(e,t,n,i,u,f){var _=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,M=e.expirationTimes,J=e.hiddenUpdates;for(n=_&~n;0<n;){var oe=31-It(n),he=1<<oe;S[oe]=0,M[oe]=-1;var ne=J[oe];if(ne!==null)for(J[oe]=null,oe=0;oe<ne.length;oe++){var ae=ne[oe];ae!==null&&(ae.lane&=-536870913)}n&=~he}i!==0&&as(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(_&~t))}function as(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-It(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function ql(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-It(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function Sl(e,t){var n=t&-t;return n=(n&42)!==0?1:xs(n),(n&(e.suspendedLanes|t))!==0?0:n}function xs(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 Gl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yl(){var e=ue.p;return e!==0?e:(e=window.event,e===void 0?32:jx(e.type))}function wl(e,t){var n=ue.p;try{return ue.p=e,t()}finally{ue.p=n}}var Wn=Math.random().toString(36).slice(2),en="__reactFiber$"+Wn,We="__reactProps$"+Wn,Mn="__reactContainer$"+Wn,qs="__reactEvents$"+Wn,Nl="__reactListeners$"+Wn,tn="__reactHandles$"+Wn,$l="__reactResources$"+Wn,Xn="__reactMarker$"+Wn;function kl(e){delete e[en],delete e[We],delete e[qs],delete e[Nl],delete e[tn]}function Et(e){var t=e[en];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mn]||n[en]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ix(e);e!==null;){if(n=e[en])return n;e=ix(e)}return t}e=n,n=e.parentNode}return null}function El(e){if(e=e[en]||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 un(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Rt(e){var t=e[$l];return t||(t=e[$l]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function mt(e){e[Xn]=!0}var zt=new Set,Vn={};function xn(e,t){Rn(e,t),Rn(e+"Capture",t)}function Rn(e,t){for(Vn[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var is=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]*$"),Xl={},bn={};function pn(e){return je.call(bn,e)?!0:je.call(Xl,e)?!1:is.test(e)?bn[e]=!0:(Xl[e]=!0,!1)}function el(e,t,n){if(pn(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Dn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function Gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qi(e,t,n){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(_){n=""+_,f.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(_){n=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vl(e){if(!e._valueTracker){var t=bs(e)?"checked":"value";e._valueTracker=qi(e,t,""+e[t])}}function _s(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=bs(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function _n(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 Ql=/[\n"\\]/g;function Nn(e){return e.replace(Ql,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ys(e,t,n,i,u,f,_,S){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=""+Gt(t)):e.value!==""+Gt(t)&&(e.value=""+Gt(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?cs(e,_,Gt(t)):n!=null?cs(e,_,Gt(n)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Gt(S):e.removeAttribute("name")}function rs(e,t,n,i,u,f,_,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Vl(e);return}n=n!=null?""+Gt(n):"",t=t!=null?""+Gt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Vl(e)}function cs(e,t,n){t==="number"&&_n(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Tl(e,t,n,i){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&i&&(e[n].defaultSelected=!0)}else{for(n=""+Gt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function me(e,t,n){if(t!=null&&(t=""+Gt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Gt(n):""}function E(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(be(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Gt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Vl(e)}function $(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ge=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 De(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||ge.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function He(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var i in n)!n.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)&&n[u]!==i&&De(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&De(e,f,t[f])}function $e(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 Tt=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"]]),jt=/^[\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 Ft(e){return jt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function vt(){}var N=null;function le(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var we=null,Ie=null;function Ut(e){var t=El(e);if(t&&(e=t.stateNode)){var n=e[We]||null;e:switch(e=t.stateNode,t.type){case"input":if(ys(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Nn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var u=i[We]||null;if(!u)throw Error(c(90));ys(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&_s(i)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Tl(e,!!n.multiple,t,!1)}}}var Kl=!1;function pl(e,t,n){if(Kl)return e(t,n);Kl=!0;try{var i=e(t);return i}finally{if(Kl=!1,(we!==null||Ie!==null)&&(ef(),we&&(t=we,e=Ie,Ie=we=null,Ut(t),e)))for(t=0;t<e.length;t++)Ut(e[t])}}function Zl(e,t){var n=e.stateNode;if(n===null)return null;var i=n[We]||null;if(i===null)return null;n=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(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),pa=!1;if(Qn)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){pa=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{pa=!1}var Cl=null,Qa=null,Rr=null;function Dr(){if(Rr)return Rr;var e,t=Qa,n=t.length,i,u="value"in Cl?Cl.value:Cl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var _=n-e;for(i=1;i<=_&&t[n-i]===u[f-i];i++);return Rr=u.slice(e,1<i?1-i:void 0)}function ma(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 Gi(){return!0}function Yi(){return!1}function tl(e){function t(n,i,u,f,_){this._reactName=n,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=_,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Gi:Yi,this.isPropagationStopped=Yi,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Gi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gi)},persist:function(){},isPersistent:Gi}),t}var ml={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ys=tl(ml),$i=j({},ml,{view:0,detail:0}),Ic=tl($i),Ka,Xi,Za,ga=j({},$i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vs,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!==Za&&(Za&&e.type==="mousemove"?(Ka=e.screenX-Za.screenX,Xi=e.screenY-Za.screenY):Xi=Ka=0,Za=e),Ka)},movementY:function(e){return"movementY"in e?e.movementY:Xi}}),xa=tl(ga),qc=j({},ga,{dataTransfer:0}),Or=tl(qc),Vi=j({},$i,{relatedTarget:0}),Gc=tl(Vi),Lr=j({},ml,{animationName:0,elapsedTime:0,pseudoElement:0}),ud=tl(Lr),zr=j({},ml,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ur=tl(zr),Yc=j({},ml,{data:0}),Fa=tl(Yc),ba={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hr={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"},$c={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$c[e])?!!t[e]:!1}function vs(){return fd}var Br=j({},$i,{key:function(e){if(e.key){var t=ba[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ma(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vs,charCode:function(e){return e.type==="keypress"?ma(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ma(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ou=tl(Br),Ir=j({},ga,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xc=tl(Ir),qr=j({},$i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vs}),js=tl(qr),Gr=j({},ml,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qi=tl(Gr),_a=j({},ga,{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}),Ki=tl(_a),fn=j({},ml,{newState:0,oldState:0}),Vc=tl(fn),dd=[9,13,27,32],Qc=Qn&&"CompositionEvent"in window,ya=null;Qn&&"documentMode"in document&&(ya=document.documentMode);var Yr=Qn&&"TextEvent"in window&&!ya,kn=Qn&&(!Qc||ya&&8<ya&&11>=ya),Ja=" ",Pa=!1;function Kc(e,t){switch(e){case"keyup":return dd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function En(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function uu(e,t){switch(e){case"compositionend":return En(t);case"keypress":return t.which!==32?null:(Pa=!0,Ja);case"textInput":return e=t.data,e===Ja&&Pa?null:e;default:return null}}function Ss(e,t){if(va)return e==="compositionend"||!Qc&&Kc(e,t)?(e=Dr(),Rr=Qa=Cl=null,va=!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 kn&&t.locale!=="ko"?null:t.data;default:return null}}var fu={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 Zi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fu[e.type]:t==="textarea"}function Fi(e,t,n,i){we?Ie?Ie.push(i):Ie=[i]:we=i,t=cf(t,"onChange"),0<t.length&&(n=new Ys("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ws=null,Fl=null;function du(e){Vg(e,0)}function $s(e){var t=un(e);if(_s(t))return e}function Ji(e,t){if(e==="change")return t}var Wa=!1;if(Qn){var ja;if(Qn){var $r="oninput"in document;if(!$r){var ei=document.createElement("div");ei.setAttribute("oninput","return;"),$r=typeof ei.oninput=="function"}ja=$r}else ja=!1;Wa=ja&&(!document.documentMode||9<document.documentMode)}function hu(){ws&&(ws.detachEvent("onpropertychange",se),Fl=ws=null)}function se(e){if(e.propertyName==="value"&&$s(Fl)){var t=[];Fi(t,Fl,e,le(e)),pl(du,t)}}function ti(e,t,n){e==="focusin"?(hu(),ws=t,Fl=n,ws.attachEvent("onpropertychange",se)):e==="focusout"&&hu()}function Zc(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $s(Fl)}function hd(e,t){if(e==="click")return $s(t)}function pd(e,t){if(e==="input"||e==="change")return $s(t)}function Z(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var In=typeof Object.is=="function"?Object.is:Z;function Ns(e,t){if(In(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var u=n[i];if(!je.call(t,u)||!In(e[u],t[u]))return!1}return!0}function Fc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jc(e,t){var n=Fc(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Fc(n)}}function pu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sa(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_n(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_n(e.document)}return t}function Pc(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 md=Qn&&"documentMode"in document&&11>=document.documentMode,ni=null,Wc=null,Pi=null,Xs=!1;function mu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xs||ni==null||ni!==_n(i)||(i=ni,"selectionStart"in i&&Pc(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}),Pi&&Ns(Pi,i)||(Pi=i,i=cf(Wc,"onSelect"),0<i.length&&(t=new Ys("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ni)))}function wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var li={animationend:wa("Animation","AnimationEnd"),animationiteration:wa("Animation","AnimationIteration"),animationstart:wa("Animation","AnimationStart"),transitionrun:wa("Transition","TransitionRun"),transitionstart:wa("Transition","TransitionStart"),transitioncancel:wa("Transition","TransitionCancel"),transitionend:wa("Transition","TransitionEnd")},eo={},gu={};Qn&&(gu=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function Na(e){if(eo[e])return eo[e];if(!li[e])return e;var t=li[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gu)return eo[e]=t[n];return e}var xu=Na("animationend"),bu=Na("animationiteration"),_u=Na("animationstart"),to=Na("transitionrun"),gd=Na("transitionstart"),xd=Na("transitioncancel"),Xr=Na("transitionend"),yu=new Map,no="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(" ");no.push("scrollEnd");function gl(e,t){yu.set(e,t),xn(t,[e])}var Vr=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)},xl=[],Vs=0,Qr=0;function Wi(){for(var e=Vs,t=Qr=Vs=0;t<e;){var n=xl[t];xl[t++]=null;var i=xl[t];xl[t++]=null;var u=xl[t];xl[t++]=null;var f=xl[t];if(xl[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}f!==0&&lo(n,u,f)}}function er(e,t,n,i){xl[Vs++]=e,xl[Vs++]=t,xl[Vs++]=n,xl[Vs++]=i,Qr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Kr(e,t,n,i){return er(e,t,n,i),tr(e)}function ka(e,t){return er(e,null,null,t),tr(e)}function lo(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,i=f.alternate,i!==null&&(i.childLanes|=n),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-It(n),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),f):null}function tr(e){if(50<Mo)throw Mo=0,rh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function vu(e,t,n,i){this.tag=e,this.key=n,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 nl(e,t,n,i){return new vu(e,t,n,i)}function so(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ks(e,t){var n=e.alternate;return n===null?(n=nl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ju(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zr(e,t,n,i,u,f){var _=0;if(i=e,typeof e=="function")so(e)&&(_=1);else if(typeof e=="string")_=x0(e,n,_e.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case O:return e=nl(31,n,t,u),e.elementType=O,e.lanes=f,e;case C:return Jl(n.children,u,f,t);case A:_=8,u|=24;break;case P:return e=nl(12,n,t,u|2),e.elementType=P,e.lanes=f,e;case V:return e=nl(13,n,t,u),e.elementType=V,e.lanes=f,e;case U:return e=nl(19,n,t,u),e.elementType=U,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:_=10;break e;case W:_=9;break e;case I:_=11;break e;case D:_=14;break e;case R:_=16,i=null;break e}_=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=nl(_,n,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Jl(e,t,n,i){return e=nl(7,e,i,t),e.lanes=n,e}function Fr(e,t,n){return e=nl(6,e,null,t),e.lanes=n,e}function Su(e){var t=nl(18,null,null,0);return t.stateNode=e,t}function Jr(e,t,n){return t=nl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var wu=new WeakMap;function Al(e,t){if(typeof e=="object"&&e!==null){var n=wu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Lt(t)},wu.set(e,t),t)}return{value:e,source:t,stack:Lt(t)}}var ai=[],ii=0,Pr=null,nr=0,Ml=[],Rl=0,Qs=null,os=1,us="";function Es(e,t){ai[ii++]=nr,ai[ii++]=Pr,Pr=e,nr=t}function ao(e,t,n){Ml[Rl++]=os,Ml[Rl++]=us,Ml[Rl++]=Qs,Qs=e;var i=os;e=us;var u=32-It(i)-1;i&=~(1<<u),n+=1;var f=32-It(t)+u;if(30<f){var _=u-u%5;f=(i&(1<<_)-1).toString(32),i>>=_,u-=_,os=1<<32-It(t)+u|n<<u|i,us=f+e}else os=1<<f|n<<u|i,us=e}function io(e){e.return!==null&&(Es(e,1),ao(e,1,0))}function ro(e){for(;e===Pr;)Pr=ai[--ii],ai[ii]=null,nr=ai[--ii],ai[ii]=null;for(;e===Qs;)Qs=Ml[--Rl],Ml[Rl]=null,us=Ml[--Rl],Ml[Rl]=null,os=Ml[--Rl],Ml[Rl]=null}function Nu(e,t){Ml[Rl++]=os,Ml[Rl++]=us,Ml[Rl++]=Qs,os=t.id,us=t.overflow,Qs=e}var qn=null,Yt=null,it=!1,Pl=null,Dl=!1,co=Error(c(519));function Ks(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lr(Al(t,e)),co}function ku(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[en]=e,t[We]=i,n){case"dialog":ft("cancel",t),ft("close",t);break;case"iframe":case"object":case"embed":ft("load",t);break;case"video":case"audio":for(n=0;n<Do.length;n++)ft(Do[n],t);break;case"source":ft("error",t);break;case"img":case"image":case"link":ft("error",t),ft("load",t);break;case"details":ft("toggle",t);break;case"input":ft("invalid",t),rs(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ft("invalid",t);break;case"textarea":ft("invalid",t),E(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Fg(t.textContent,n)?(i.popover!=null&&(ft("beforetoggle",t),ft("toggle",t)),i.onScroll!=null&&ft("scroll",t),i.onScrollEnd!=null&&ft("scrollend",t),i.onClick!=null&&(t.onclick=vt),t=!0):t=!1,t||Ks(e,!0)}function Eu(e){for(qn=e.return;qn;)switch(qn.tag){case 5:case 31:case 13:Dl=!1;return;case 27:case 3:Dl=!0;return;default:qn=qn.return}}function ri(e){if(e!==qn)return!1;if(!it)return Eu(e),it=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||jh(e.type,e.memoizedProps)),n=!n),n&&Yt&&Ks(e),Eu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Yt=ax(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Yt=ax(e)}else t===27?(t=Yt,Si(e.type)?(e=Eh,Eh=null,Yt=e):Yt=t):Yt=qn?ds(e.stateNode.nextSibling):null;return!0}function Ea(){Yt=qn=null,it=!1}function oo(){var e=Pl;return e!==null&&(Hl===null?Hl=e:Hl.push.apply(Hl,e),Pl=null),e}function lr(e){Pl===null?Pl=[e]:Pl.push(e)}var uo=k(null),Ta=null,Ts=null;function Zs(e,t,n){q(uo,t._currentValue),t._currentValue=n}function Cs(e){e._currentValue=uo.current,te(uo)}function fo(e,t,n){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===n)break;e=e.return}}function ho(e,t,n,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 S=f;f=u;for(var M=0;M<t.length;M++)if(S.context===t[M]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),fo(f.return,n,e),i||(_=null);break e}f=S.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=n,f=_.alternate,f!==null&&(f.lanes|=n),fo(_,n,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 ci(e,t,n,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 S=u.type;In(u.pendingProps.value,_.value)||(e!==null?e.push(S):e=[S])}}else if(u===Me.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ho):e=[Ho])}u=u.return}e!==null&&ho(t,e,n,i),t.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!In(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fs(e){Ta=e,Ts=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function yn(e){return Ol(Ta,e)}function cl(e,t){return Ta===null&&Fs(e),Ol(e,t)}function Ol(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ts===null){if(e===null)throw Error(c(308));Ts=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ts=Ts.next=t;return n}var Pt=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},po=l.unstable_scheduleCallback,bd=l.unstable_NormalPriority,vn={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oi(){return{controller:new Pt,data:new Map,refCount:0}}function ui(e){e.refCount--,e.refCount===0&&po(bd,function(){e.controller.abort()})}var Js=null,ar=0,Ca=0,As=null;function Tu(e,t){if(Js===null){var n=Js=[];ar=0,Ca=hh(),As={status:"pending",value:void 0,then:function(i){n.push(i)}}}return ar++,t.then(Cu,Cu),t}function Cu(){if(--ar===0&&Js!==null){As!==null&&(As.status="fulfilled");var e=Js;Js=null,Ca=0,As=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ir(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),i}var mo=H.S;H.S=function(e,t){yg=lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Tu(e,t),mo!==null&&mo(e,t)};var Aa=k(null);function rr(){var e=Aa.current;return e!==null?e:Jt.pooledCache}function Wr(e,t){t===null?q(Aa,Aa.current):q(Aa,t.pool)}function fi(){var e=rr();return e===null?null:{parent:vn._currentValue,pool:e}}var Wl=Error(c(460)),go=Error(c(474)),cr=Error(c(542)),or={then:function(){}};function Au(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vt,vt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Du(e),e;default:if(typeof t.status=="string")t.then(vt,vt);else{if(e=Jt,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,Du(e),e}throw Ws=t,Wl}}function Ps(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ws=n,Wl):n}}var Ws=null;function Ru(){if(Ws===null)throw Error(c(459));var e=Ws;return Ws=null,e}function Du(e){if(e===Wl||e===cr)throw Error(c(483))}var di=null,Ma=0;function ur(e){var t=Ma;return Ma+=1,di===null&&(di=[]),Mu(di,e,t)}function fr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ms(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 ec(e){function t(G,L){if(e){var F=G.deletions;F===null?(G.deletions=[L],G.flags|=16):F.push(L)}}function n(G,L){if(!e)return null;for(;L!==null;)t(G,L),L=L.sibling;return null}function i(G){for(var L=new Map;G!==null;)G.key!==null?L.set(G.key,G):L.set(G.index,G),G=G.sibling;return L}function u(G,L){return G=ks(G,L),G.index=0,G.sibling=null,G}function f(G,L,F){return G.index=F,e?(F=G.alternate,F!==null?(F=F.index,F<L?(G.flags|=67108866,L):F):(G.flags|=67108866,L)):(G.flags|=1048576,L)}function _(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function S(G,L,F,fe){return L===null||L.tag!==6?(L=Fr(F,G.mode,fe),L.return=G,L):(L=u(L,F),L.return=G,L)}function M(G,L,F,fe){var Ye=F.type;return Ye===C?oe(G,L,F.props.children,fe,F.key):L!==null&&(L.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===R&&Ps(Ye)===L.type)?(L=u(L,F.props),fr(L,F),L.return=G,L):(L=Zr(F.type,F.key,F.props,null,G.mode,fe),fr(L,F),L.return=G,L)}function J(G,L,F,fe){return L===null||L.tag!==4||L.stateNode.containerInfo!==F.containerInfo||L.stateNode.implementation!==F.implementation?(L=Jr(F,G.mode,fe),L.return=G,L):(L=u(L,F.children||[]),L.return=G,L)}function oe(G,L,F,fe,Ye){return L===null||L.tag!==7?(L=Jl(F,G.mode,fe,Ye),L.return=G,L):(L=u(L,F),L.return=G,L)}function he(G,L,F){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Fr(""+L,G.mode,F),L.return=G,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case T:return F=Zr(L.type,L.key,L.props,null,G.mode,F),fr(F,L),F.return=G,F;case w:return L=Jr(L,G.mode,F),L.return=G,L;case R:return L=Ps(L),he(G,L,F)}if(be(L)||Q(L))return L=Jl(L,G.mode,F,null),L.return=G,L;if(typeof L.then=="function")return he(G,ur(L),F);if(L.$$typeof===K)return he(G,cl(G,L),F);Ms(G,L)}return null}function ne(G,L,F,fe){var Ye=L!==null?L.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ye!==null?null:S(G,L,""+F,fe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case T:return F.key===Ye?M(G,L,F,fe):null;case w:return F.key===Ye?J(G,L,F,fe):null;case R:return F=Ps(F),ne(G,L,F,fe)}if(be(F)||Q(F))return Ye!==null?null:oe(G,L,F,fe,null);if(typeof F.then=="function")return ne(G,L,ur(F),fe);if(F.$$typeof===K)return ne(G,L,cl(G,F),fe);Ms(G,F)}return null}function ae(G,L,F,fe,Ye){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return G=G.get(F)||null,S(L,G,""+fe,Ye);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case T:return G=G.get(fe.key===null?F:fe.key)||null,M(L,G,fe,Ye);case w:return G=G.get(fe.key===null?F:fe.key)||null,J(L,G,fe,Ye);case R:return fe=Ps(fe),ae(G,L,F,fe,Ye)}if(be(fe)||Q(fe))return G=G.get(F)||null,oe(L,G,fe,Ye,null);if(typeof fe.then=="function")return ae(G,L,F,ur(fe),Ye);if(fe.$$typeof===K)return ae(G,L,F,cl(L,fe),Ye);Ms(L,fe)}return null}function Oe(G,L,F,fe){for(var Ye=null,Ct=null,ze=L,nt=L=0,xt=null;ze!==null&&nt<F.length;nt++){ze.index>nt?(xt=ze,ze=null):xt=ze.sibling;var At=ne(G,ze,F[nt],fe);if(At===null){ze===null&&(ze=xt);break}e&&ze&&At.alternate===null&&t(G,ze),L=f(At,L,nt),Ct===null?Ye=At:Ct.sibling=At,Ct=At,ze=xt}if(nt===F.length)return n(G,ze),it&&Es(G,nt),Ye;if(ze===null){for(;nt<F.length;nt++)ze=he(G,F[nt],fe),ze!==null&&(L=f(ze,L,nt),Ct===null?Ye=ze:Ct.sibling=ze,Ct=ze);return it&&Es(G,nt),Ye}for(ze=i(ze);nt<F.length;nt++)xt=ae(ze,G,nt,F[nt],fe),xt!==null&&(e&&xt.alternate!==null&&ze.delete(xt.key===null?nt:xt.key),L=f(xt,L,nt),Ct===null?Ye=xt:Ct.sibling=xt,Ct=xt);return e&&ze.forEach(function(Ti){return t(G,Ti)}),it&&Es(G,nt),Ye}function Ve(G,L,F,fe){if(F==null)throw Error(c(151));for(var Ye=null,Ct=null,ze=L,nt=L=0,xt=null,At=F.next();ze!==null&&!At.done;nt++,At=F.next()){ze.index>nt?(xt=ze,ze=null):xt=ze.sibling;var Ti=ne(G,ze,At.value,fe);if(Ti===null){ze===null&&(ze=xt);break}e&&ze&&Ti.alternate===null&&t(G,ze),L=f(Ti,L,nt),Ct===null?Ye=Ti:Ct.sibling=Ti,Ct=Ti,ze=xt}if(At.done)return n(G,ze),it&&Es(G,nt),Ye;if(ze===null){for(;!At.done;nt++,At=F.next())At=he(G,At.value,fe),At!==null&&(L=f(At,L,nt),Ct===null?Ye=At:Ct.sibling=At,Ct=At);return it&&Es(G,nt),Ye}for(ze=i(ze);!At.done;nt++,At=F.next())At=ae(ze,G,nt,At.value,fe),At!==null&&(e&&At.alternate!==null&&ze.delete(At.key===null?nt:At.key),L=f(At,L,nt),Ct===null?Ye=At:Ct.sibling=At,Ct=At);return e&&ze.forEach(function(T0){return t(G,T0)}),it&&Es(G,nt),Ye}function Kt(G,L,F,fe){if(typeof F=="object"&&F!==null&&F.type===C&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case T:e:{for(var Ye=F.key;L!==null;){if(L.key===Ye){if(Ye=F.type,Ye===C){if(L.tag===7){n(G,L.sibling),fe=u(L,F.props.children),fe.return=G,G=fe;break e}}else if(L.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===R&&Ps(Ye)===L.type){n(G,L.sibling),fe=u(L,F.props),fr(fe,F),fe.return=G,G=fe;break e}n(G,L);break}else t(G,L);L=L.sibling}F.type===C?(fe=Jl(F.props.children,G.mode,fe,F.key),fe.return=G,G=fe):(fe=Zr(F.type,F.key,F.props,null,G.mode,fe),fr(fe,F),fe.return=G,G=fe)}return _(G);case w:e:{for(Ye=F.key;L!==null;){if(L.key===Ye)if(L.tag===4&&L.stateNode.containerInfo===F.containerInfo&&L.stateNode.implementation===F.implementation){n(G,L.sibling),fe=u(L,F.children||[]),fe.return=G,G=fe;break e}else{n(G,L);break}else t(G,L);L=L.sibling}fe=Jr(F,G.mode,fe),fe.return=G,G=fe}return _(G);case R:return F=Ps(F),Kt(G,L,F,fe)}if(be(F))return Oe(G,L,F,fe);if(Q(F)){if(Ye=Q(F),typeof Ye!="function")throw Error(c(150));return F=Ye.call(F),Ve(G,L,F,fe)}if(typeof F.then=="function")return Kt(G,L,ur(F),fe);if(F.$$typeof===K)return Kt(G,L,cl(G,F),fe);Ms(G,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,L!==null&&L.tag===6?(n(G,L.sibling),fe=u(L,F),fe.return=G,G=fe):(n(G,L),fe=Fr(F,G.mode,fe),fe.return=G,G=fe),_(G)):n(G,L)}return function(G,L,F,fe){try{Ma=0;var Ye=Kt(G,L,F,fe);return di=null,Ye}catch(ze){if(ze===Wl||ze===cr)throw ze;var Ct=nl(29,ze,null,G.mode);return Ct.lanes=fe,Ct.return=G,Ct}finally{}}}var Ra=ec(!0),xo=ec(!1),Rs=!1;function p(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function z(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 ce(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Te(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Dt&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=tr(e),lo(e,null,n),t}return er(e,i,t,n),tr(e)}function St(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ql(e,n)}}function Tn(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var _={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=_:f=f.next=_,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bl=!1;function Ds(){if(bl){var e=As;if(e!==null)throw e}}function hi(e,t,n,i){bl=!1;var u=e.updateQueue;Rs=!1;var f=u.firstBaseUpdate,_=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var M=S,J=M.next;M.next=null,_===null?f=J:_.next=J,_=M;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,S=oe.lastBaseUpdate,S!==_&&(S===null?oe.firstBaseUpdate=J:S.next=J,oe.lastBaseUpdate=M))}if(f!==null){var he=u.baseState;_=0,oe=J=M=null,S=f;do{var ne=S.lane&-536870913,ae=ne!==S.lane;if(ae?(gt&ne)===ne:(i&ne)===ne){ne!==0&&ne===Ca&&(bl=!0),oe!==null&&(oe=oe.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Oe=e,Ve=S;ne=t;var Kt=n;switch(Ve.tag){case 1:if(Oe=Ve.payload,typeof Oe=="function"){he=Oe.call(Kt,he,ne);break e}he=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ve.payload,ne=typeof Oe=="function"?Oe.call(Kt,he,ne):Oe,ne==null)break e;he=j({},he,ne);break e;case 2:Rs=!0}}ne=S.callback,ne!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=u.callbacks,ae===null?u.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:S.tag,payload:S.payload,callback:S.callback,next:null},oe===null?(J=oe=ae,M=he):oe=oe.next=ae,_|=ne;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;ae=S,S=ae.next,ae.next=null,u.lastBaseUpdate=ae,u.shared.pending=null}}while(!0);oe===null&&(M=he),u.baseState=M,u.firstBaseUpdate=J,u.lastBaseUpdate=oe,f===null&&(u.shared.lanes=0),bi|=_,e.lanes=_,e.memoizedState=he}}function bo(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ye(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bo(n[e],t)}var Ne=k(null),qe=k(0);function et(e,t){e=qa,q(qe,e),q(Ne,t),qa=e|t.baseLanes}function at(){q(qe,qa),q(Ne,Ne.current)}function On(){qa=qe.current,te(Ne),te(qe)}var _l=k(null),fs=null;function pi(e){var t=e.alternate;q(Cn,Cn.current&1),q(_l,e),fs===null&&(t===null||Ne.current!==null||t.memoizedState!==null)&&(fs=e)}function _d(e){q(Cn,Cn.current),q(_l,e),fs===null&&(fs=e)}function Kp(e){e.tag===22?(q(Cn,Cn.current),q(_l,e),fs===null&&(fs=e)):mi()}function mi(){q(Cn,Cn.current),q(_l,_l.current)}function es(e){te(_l),fs===e&&(fs=null),te(Cn)}var Cn=k(0);function Ou(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Nh(n)||kh(n)))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 Da=0,tt=null,Vt=null,Ln=null,Lu=!1,tc=!1,dr=!1,zu=0,_o=0,nc=null,by=0;function jn(){throw Error(c(321))}function yd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!In(e[n],t[n]))return!1;return!0}function vd(e,t,n,i,u,f){return Da=f,tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Mm:zd,dr=!1,f=n(i,u),dr=!1,tc&&(f=Fp(t,n,i,u)),Zp(e),f}function Zp(e){H.H=jo;var t=Vt!==null&&Vt.next!==null;if(Da=0,Ln=Vt=tt=null,Lu=!1,_o=0,nc=null,t)throw Error(c(300));e===null||zn||(e=e.dependencies,e!==null&&sr(e)&&(zn=!0))}function Fp(e,t,n,i){tt=e;var u=0;do{if(tc&&(nc=null),_o=0,tc=!1,25<=u)throw Error(c(301));if(u+=1,Ln=Vt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}H.H=Rm,f=t(n,i)}while(tc);return f}function _y(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?yo(t):t,e=e.useState()[0],(Vt!==null?Vt.memoizedState:null)!==e&&(tt.flags|=1024),t}function jd(){var e=zu!==0;return zu=0,e}function Sd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wd(e){if(Lu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lu=!1}Da=0,Ln=Vt=tt=null,tc=!1,_o=zu=0,nc=null}function yl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?tt.memoizedState=Ln=e:Ln=Ln.next=e,Ln}function An(){if(Vt===null){var e=tt.alternate;e=e!==null?e.memoizedState:null}else e=Vt.next;var t=Ln===null?tt.memoizedState:Ln.next;if(t!==null)Ln=t,Vt=e;else{if(e===null)throw tt.alternate===null?Error(c(467)):Error(c(310));Vt=e,e={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Ln===null?tt.memoizedState=Ln=e:Ln=Ln.next=e}return Ln}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(e){var t=_o;return _o+=1,nc===null&&(nc=[]),e=Mu(nc,e,t),t=tt,(Ln===null?t.memoizedState:Ln.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Mm:zd),e}function Hu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return yo(e);if(e.$$typeof===K)return yn(e)}throw Error(c(438,String(e)))}function Nd(e){var t=null,n=tt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=tt.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}),n===null&&(n=Uu(),tt.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=ee;return t.index++,n}function Oa(e,t){return typeof t=="function"?t(e):t}function Bu(e){var t=An();return kd(t,Vt,e)}function kd(e,t,n){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=n;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 S=_=null,M=null,J=t,oe=!1;do{var he=J.lane&-536870913;if(he!==J.lane?(gt&he)===he:(Da&he)===he){var ne=J.revertLane;if(ne===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),he===Ca&&(oe=!0);else if((Da&ne)===ne){J=J.next,ne===Ca&&(oe=!0);continue}else he={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},M===null?(S=M=he,_=f):M=M.next=he,tt.lanes|=ne,bi|=ne;he=J.action,dr&&n(f,he),f=J.hasEagerState?J.eagerState:n(f,he)}else ne={lane:he,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},M===null?(S=M=ne,_=f):M=M.next=ne,tt.lanes|=he,bi|=he;J=J.next}while(J!==null&&J!==t);if(M===null?_=f:M.next=S,!In(f,e.memoizedState)&&(zn=!0,oe&&(n=As,n!==null)))throw n;e.memoizedState=f,e.baseState=_,e.baseQueue=M,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Ed(e){var t=An(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var i=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var _=u=u.next;do f=e(f,_.action),_=_.next;while(_!==u);In(f,t.memoizedState)||(zn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,i]}function Jp(e,t,n){var i=tt,u=An(),f=it;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var _=!In((Vt||u).memoizedState,n);if(_&&(u.memoizedState=n,zn=!0),u=u.queue,Ad(em.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||Ln!==null&&Ln.memoizedState.tag&1){if(i.flags|=2048,lc(9,{destroy:void 0},Wp.bind(null,i,u,n,t),null),Jt===null)throw Error(c(349));f||(Da&127)!==0||Pp(i,t,n)}return n}function Pp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=tt.updateQueue,t===null?(t=Uu(),tt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wp(e,t,n,i){t.value=n,t.getSnapshot=i,tm(t)&&nm(e)}function em(e,t,n){return n(function(){tm(t)&&nm(e)})}function tm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!In(e,n)}catch{return!0}}function nm(e){var t=ka(e,2);t!==null&&Bl(t,e,2)}function Td(e){var t=yl();if(typeof e=="function"){var n=e;if(e=n(),dr){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e},t}function lm(e,t,n,i){return e.baseState=n,kd(e,Vt,typeof i=="function"?i:Oa)}function yy(e,t,n,i,u){if(Gu(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(_)}};H.T!==null?n(!0):f.isTransition=!1,i(f),n=t.pending,n===null?(f.next=t.pending=f,sm(t,f)):(f.next=n.next,t.pending=n.next=f)}}function sm(e,t){var n=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=H.T,_={};H.T=_;try{var S=n(u,i),M=H.S;M!==null&&M(_,S),am(e,t,S)}catch(J){Cd(e,t,J)}finally{f!==null&&_.types!==null&&(f.types=_.types),H.T=f}}else try{f=n(u,i),am(e,t,f)}catch(J){Cd(e,t,J)}}function am(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){im(e,t,i)},function(i){return Cd(e,t,i)}):im(e,t,n)}function im(e,t,n){t.status="fulfilled",t.value=n,rm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,sm(e,n)))}function Cd(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,rm(t),t=t.next;while(t!==i)}e.action=null}function rm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function cm(e,t){return t}function om(e,t){if(it){var n=Jt.formState;if(n!==null){e:{var i=tt;if(it){if(Yt){t:{for(var u=Yt,f=Dl;u.nodeType!==8;){if(!f){u=null;break t}if(u=ds(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Yt=ds(u.nextSibling),i=u.data==="F!";break e}}Ks(i)}i=!1}i&&(t=n[0])}}return n=yl(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cm,lastRenderedState:t},n.queue=i,n=Tm.bind(null,tt,i),i.dispatch=n,i=Td(!1),f=Ld.bind(null,tt,!1,i.queue),i=yl(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=yy.bind(null,tt,u,f,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function um(e){var t=An();return fm(t,Vt,e)}function fm(e,t,n){if(t=kd(e,t,cm)[0],e=Bu(Oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=yo(t)}catch(_){throw _===Wl?cr:_}else i=t;t=An();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(tt.flags|=2048,lc(9,{destroy:void 0},vy.bind(null,u,n),null)),[i,f,e]}function vy(e,t){e.action=t}function dm(e){var t=An(),n=Vt;if(n!==null)return fm(t,n,e);An(),t=t.memoizedState,n=An();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function lc(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=tt.updateQueue,t===null&&(t=Uu(),tt.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function hm(){return An().memoizedState}function Iu(e,t,n,i){var u=yl();tt.flags|=e,u.memoizedState=lc(1|t,{destroy:void 0},n,i===void 0?null:i)}function qu(e,t,n,i){var u=An();i=i===void 0?null:i;var f=u.memoizedState.inst;Vt!==null&&i!==null&&yd(i,Vt.memoizedState.deps)?u.memoizedState=lc(t,f,n,i):(tt.flags|=e,u.memoizedState=lc(1|t,f,n,i))}function pm(e,t){Iu(8390656,8,e,t)}function Ad(e,t){qu(2048,8,e,t)}function jy(e){tt.flags|=4;var t=tt.updateQueue;if(t===null)t=Uu(),tt.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function mm(e){var t=An().memoizedState;return jy({ref:t,nextImpl:e}),function(){if((Dt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function gm(e,t){return qu(4,2,e,t)}function xm(e,t){return qu(4,4,e,t)}function bm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _m(e,t,n){n=n!=null?n.concat([e]):null,qu(4,4,bm.bind(null,t,e),n)}function Md(){}function ym(e,t){var n=An();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&yd(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function vm(e,t){var n=An();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&yd(t,i[1]))return i[0];if(i=e(),dr){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[i,t],i}function Rd(e,t,n){return n===void 0||(Da&1073741824)!==0&&(gt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=jg(),tt.lanes|=e,bi|=e,n)}function jm(e,t,n,i){return In(n,t)?n:Ne.current!==null?(e=Rd(e,n,i),In(e,t)||(zn=!0),e):(Da&42)===0||(Da&1073741824)!==0&&(gt&261930)===0?(zn=!0,e.memoizedState=n):(e=jg(),tt.lanes|=e,bi|=e,t)}function Sm(e,t,n,i,u){var f=ue.p;ue.p=f!==0&&8>f?f:8;var _=H.T,S={};H.T=S,Ld(e,!1,t,n);try{var M=u(),J=H.S;if(J!==null&&J(S,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var oe=ir(M,i);vo(e,t,oe,ls(e))}else vo(e,t,i,ls(e))}catch(he){vo(e,t,{then:function(){},status:"rejected",reason:he},ls())}finally{ue.p=f,_!==null&&S.types!==null&&(_.types=S.types),H.T=_}}function Sy(){}function Dd(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=wm(e).queue;Sm(e,u,t,ie,n===null?Sy:function(){return Nm(e),n(i)})}function wm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:ie},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Nm(e){var t=wm(e);t.next===null&&(t=e.alternate.memoizedState),vo(e,t.next.queue,{},ls())}function Od(){return yn(Ho)}function km(){return An().memoizedState}function Em(){return An().memoizedState}function wy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=ls();e=ce(n);var i=Te(t,e,n);i!==null&&(Bl(i,t,n),St(i,t,n)),t={cache:oi()},e.payload=t;return}t=t.return}}function Ny(e,t,n){var i=ls();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gu(e)?Cm(t,n):(n=Kr(e,t,n,i),n!==null&&(Bl(n,e,i),Am(n,t,i)))}function Tm(e,t,n){var i=ls();vo(e,t,n,i)}function vo(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gu(e))Cm(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,S=f(_,n);if(u.hasEagerState=!0,u.eagerState=S,In(S,_))return er(e,t,u,0),Jt===null&&Wi(),!1}catch{}finally{}if(n=Kr(e,t,u,i),n!==null)return Bl(n,e,i),Am(n,t,i),!0}return!1}function Ld(e,t,n,i){if(i={lane:2,revertLane:hh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Gu(e)){if(t)throw Error(c(479))}else t=Kr(e,n,i,2),t!==null&&Bl(t,e,2)}function Gu(e){var t=e.alternate;return e===tt||t!==null&&t===tt}function Cm(e,t){tc=Lu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Am(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ql(e,n)}}var jo={readContext:yn,use:Hu,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useLayoutEffect:jn,useInsertionEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useSyncExternalStore:jn,useId:jn,useHostTransitionStatus:jn,useFormState:jn,useActionState:jn,useOptimistic:jn,useMemoCache:jn,useCacheRefresh:jn};jo.useEffectEvent=jn;var Mm={readContext:yn,use:Hu,useCallback:function(e,t){return yl().memoizedState=[e,t===void 0?null:t],e},useContext:yn,useEffect:pm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Iu(4194308,4,bm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Iu(4194308,4,e,t)},useInsertionEffect:function(e,t){Iu(4,2,e,t)},useMemo:function(e,t){var n=yl();t=t===void 0?null:t;var i=e();if(dr){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=yl();if(n!==void 0){var u=n(t);if(dr){ot(!0);try{n(t)}finally{ot(!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=Ny.bind(null,tt,e),[i.memoizedState,e]},useRef:function(e){var t=yl();return e={current:e},t.memoizedState=e},useState:function(e){e=Td(e);var t=e.queue,n=Tm.bind(null,tt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Md,useDeferredValue:function(e,t){var n=yl();return Rd(n,e,t)},useTransition:function(){var e=Td(!1);return e=Sm.bind(null,tt,e.queue,!0,!1),yl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=tt,u=yl();if(it){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Jt===null)throw Error(c(349));(gt&127)!==0||Pp(i,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,pm(em.bind(null,i,f,e),[e]),i.flags|=2048,lc(9,{destroy:void 0},Wp.bind(null,i,f,n,t),null),n},useId:function(){var e=yl(),t=Jt.identifierPrefix;if(it){var n=us,i=os;n=(i&~(1<<32-It(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=zu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=by++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Od,useFormState:om,useActionState:om,useOptimistic:function(e){var t=yl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ld.bind(null,tt,!0,n),n.dispatch=t,[e,t]},useMemoCache:Nd,useCacheRefresh:function(){return yl().memoizedState=wy.bind(null,tt)},useEffectEvent:function(e){var t=yl(),n={impl:e};return t.memoizedState=n,function(){if((Dt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},zd={readContext:yn,use:Hu,useCallback:ym,useContext:yn,useEffect:Ad,useImperativeHandle:_m,useInsertionEffect:gm,useLayoutEffect:xm,useMemo:vm,useReducer:Bu,useRef:hm,useState:function(){return Bu(Oa)},useDebugValue:Md,useDeferredValue:function(e,t){var n=An();return jm(n,Vt.memoizedState,e,t)},useTransition:function(){var e=Bu(Oa)[0],t=An().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:Jp,useId:km,useHostTransitionStatus:Od,useFormState:um,useActionState:um,useOptimistic:function(e,t){var n=An();return lm(n,Vt,e,t)},useMemoCache:Nd,useCacheRefresh:Em};zd.useEffectEvent=mm;var Rm={readContext:yn,use:Hu,useCallback:ym,useContext:yn,useEffect:Ad,useImperativeHandle:_m,useInsertionEffect:gm,useLayoutEffect:xm,useMemo:vm,useReducer:Ed,useRef:hm,useState:function(){return Ed(Oa)},useDebugValue:Md,useDeferredValue:function(e,t){var n=An();return Vt===null?Rd(n,e,t):jm(n,Vt.memoizedState,e,t)},useTransition:function(){var e=Ed(Oa)[0],t=An().memoizedState;return[typeof e=="boolean"?e:yo(e),t]},useSyncExternalStore:Jp,useId:km,useHostTransitionStatus:Od,useFormState:dm,useActionState:dm,useOptimistic:function(e,t){var n=An();return Vt!==null?lm(n,Vt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Nd,useCacheRefresh:Em};Rm.useEffectEvent=mm;function Ud(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hd={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ls(),u=ce(i);u.payload=t,n!=null&&(u.callback=n),t=Te(e,u,i),t!==null&&(Bl(t,e,i),St(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ls(),u=ce(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Te(e,u,i),t!==null&&(Bl(t,e,i),St(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ls(),i=ce(n);i.tag=2,t!=null&&(i.callback=t),t=Te(e,i,n),t!==null&&(Bl(t,e,n),St(t,e,n))}};function Dm(e,t,n,i,u,f,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,_):t.prototype&&t.prototype.isPureReactComponent?!Ns(n,i)||!Ns(u,f):!0}function Om(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Hd.enqueueReplaceState(t,t.state,null)}function hr(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Lm(e){Vr(e)}function zm(e){console.error(e)}function Um(e){Vr(e)}function Yu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Hm(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Bd(e,t,n){return n=ce(n),n.tag=3,n.payload={element:null},n.callback=function(){Yu(e,t)},n}function Bm(e){return e=ce(e),e.tag=3,e}function Im(e,t,n,i){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Hm(t,n,i)}}var _=n.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Hm(t,n,i),typeof u!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function ky(e,t,n,i,u){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ci(t,n,u,!0),n=_l.current,n!==null){switch(n.tag){case 31:case 13:return fs===null?tf():n.alternate===null&&Sn===0&&(Sn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===or?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),uh(e,i,u)),!1;case 22:return n.flags|=65536,i===or?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),uh(e,i,u)),!1}throw Error(c(435,n.tag))}return uh(e,i,u),tf(),!1}if(it)return t=_l.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==co&&(e=Error(c(422),{cause:i}),lr(Al(e,n)))):(i!==co&&(t=Error(c(423),{cause:i}),lr(Al(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Al(i,n),u=Bd(e.stateNode,i,u),Tn(e,u),Sn!==4&&(Sn=2)),!1;var f=Error(c(520),{cause:i});if(f=Al(f,n),Ao===null?Ao=[f]:Ao.push(f),Sn!==4&&(Sn=2),t===null)return!0;i=Al(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Bd(n.stateNode,i,e),Tn(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(_i===null||!_i.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Bm(u),Im(u,e,n,i),Tn(n,u),!1}n=n.return}while(n!==null);return!1}var Id=Error(c(461)),zn=!1;function ll(e,t,n,i){t.child=e===null?xo(t,null,n,i):Ra(t,e.child,n,i)}function qm(e,t,n,i,u){n=n.render;var f=t.ref;if("ref"in i){var _={};for(var S in i)S!=="ref"&&(_[S]=i[S])}else _=i;return Fs(t),i=vd(e,t,n,_,f,u),S=jd(),e!==null&&!zn?(Sd(e,t,u),La(e,t,u)):(it&&S&&io(t),t.flags|=1,ll(e,t,i,u),t.child)}function Gm(e,t,n,i,u){if(e===null){var f=n.type;return typeof f=="function"&&!so(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Ym(e,t,f,i,u)):(e=Zr(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Kd(e,u)){var _=f.memoizedProps;if(n=n.compare,n=n!==null?n:Ns,n(_,i)&&e.ref===t.ref)return La(e,t,u)}return t.flags|=1,e=ks(f,i),e.ref=t.ref,e.return=t,t.child=e}function Ym(e,t,n,i,u){if(e!==null){var f=e.memoizedProps;if(Ns(f,i)&&e.ref===t.ref)if(zn=!1,t.pendingProps=i=f,Kd(e,u))(e.flags&131072)!==0&&(zn=!0);else return t.lanes=e.lanes,La(e,t,u)}return qd(e,t,n,i,u)}function $m(e,t,n,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|n:n,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 Xm(e,t,f,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wr(t,f!==null?f.cachePool:null),f!==null?et(t,f):at(),Kp(t);else return i=t.lanes=536870912,Xm(e,t,f!==null?f.baseLanes|n:n,n,i)}else f!==null?(Wr(t,f.cachePool),et(t,f),mi(),t.memoizedState=null):(e!==null&&Wr(t,null),at(),mi());return ll(e,t,u,n),t.child}function So(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xm(e,t,n,i,u){var f=rr();return f=f===null?null:{parent:vn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Wr(t,null),at(),Kp(t),e!==null&&ci(e,t,i,!0),t.childLanes=u,null}function $u(e,t){return t=Vu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vm(e,t,n){return Ra(t,e.child,null,n),e=$u(t,t.pendingProps),e.flags|=2,es(t),t.memoizedState=null,e}function Ey(e,t,n){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(it){if(i.mode==="hidden")return e=$u(t,i),t.lanes=536870912,So(null,e);if(_d(t),(e=Yt)?(e=sx(e,Dl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qs!==null?{id:os,overflow:us}:null,retryLane:536870912,hydrationErrors:null},n=Su(e),n.return=t,t.child=n,qn=t,Yt=null)):e=null,e===null)throw Ks(t);return t.lanes=536870912,null}return $u(t,i)}var f=e.memoizedState;if(f!==null){var _=f.dehydrated;if(_d(t),u)if(t.flags&256)t.flags&=-257,t=Vm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(zn||ci(e,t,n,!1),u=(n&e.childLanes)!==0,zn||u){if(i=Jt,i!==null&&(_=Sl(i,n),_!==0&&_!==f.retryLane))throw f.retryLane=_,ka(e,_),Bl(i,e,_),Id;tf(),t=Vm(e,t,n)}else e=f.treeContext,Yt=ds(_.nextSibling),qn=t,it=!0,Pl=null,Dl=!1,e!==null&&Nu(t,e),t=$u(t,i),t.flags|=4096;return t}return e=ks(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qd(e,t,n,i,u){return Fs(t),n=vd(e,t,n,i,void 0,u),i=jd(),e!==null&&!zn?(Sd(e,t,u),La(e,t,u)):(it&&i&&io(t),t.flags|=1,ll(e,t,n,u),t.child)}function Qm(e,t,n,i,u,f){return Fs(t),t.updateQueue=null,n=Fp(t,i,n,u),Zp(e),i=jd(),e!==null&&!zn?(Sd(e,t,f),La(e,t,f)):(it&&i&&io(t),t.flags|=1,ll(e,t,n,f),t.child)}function Km(e,t,n,i,u){if(Fs(t),t.stateNode===null){var f=si,_=n.contextType;typeof _=="object"&&_!==null&&(f=yn(_)),f=new n(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Hd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},p(t),_=n.contextType,f.context=typeof _=="object"&&_!==null?yn(_):si,f.state=t.memoizedState,_=n.getDerivedStateFromProps,typeof _=="function"&&(Ud(t,n,_,i),f.state=t.memoizedState),typeof n.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&&Hd.enqueueReplaceState(f,f.state,null),hi(t,i,f,u),Ds(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,M=hr(n,S);f.props=M;var J=f.context,oe=n.contextType;_=si,typeof oe=="object"&&oe!==null&&(_=yn(oe));var he=n.getDerivedStateFromProps;oe=typeof he=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,oe||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||J!==_)&&Om(t,f,i,_),Rs=!1;var ne=t.memoizedState;f.state=ne,hi(t,i,f,u),Ds(),J=t.memoizedState,S||ne!==J||Rs?(typeof he=="function"&&(Ud(t,n,he,i),J=t.memoizedState),(M=Rs||Dm(t,n,M,i,ne,J,_))?(oe||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=J),f.props=i,f.state=J,f.context=_,i=M):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,z(e,t),_=t.memoizedProps,oe=hr(n,_),f.props=oe,he=t.pendingProps,ne=f.context,J=n.contextType,M=si,typeof J=="object"&&J!==null&&(M=yn(J)),S=n.getDerivedStateFromProps,(J=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_!==he||ne!==M)&&Om(t,f,i,M),Rs=!1,ne=t.memoizedState,f.state=ne,hi(t,i,f,u),Ds();var ae=t.memoizedState;_!==he||ne!==ae||Rs||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof S=="function"&&(Ud(t,n,S,i),ae=t.memoizedState),(oe=Rs||Dm(t,n,oe,i,ne,ae,M)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(J||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ae,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ae,M)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ae),f.props=i,f.state=ae,f.context=M,i=oe):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ne===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ne===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Xu(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Ra(t,e.child,null,u),t.child=Ra(t,null,n,u)):ll(e,t,n,u),t.memoizedState=f.state,e=t.child):e=La(e,t,u),e}function Zm(e,t,n,i){return Ea(),t.flags|=256,ll(e,t,n,i),t.child}var Gd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yd(e){return{baseLanes:e,cachePool:fi()}}function $d(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ns),e}function Fm(e,t,n){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,_;if((_=f)||(_=e!==null&&e.memoizedState===null?!1:(Cn.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(it){if(u?pi(t):mi(),(e=Yt)?(e=sx(e,Dl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qs!==null?{id:os,overflow:us}:null,retryLane:536870912,hydrationErrors:null},n=Su(e),n.return=t,t.child=n,qn=t,Yt=null)):e=null,e===null)throw Ks(t);return kh(e)?t.lanes=32:t.lanes=536870912,null}var S=i.children;return i=i.fallback,u?(mi(),u=t.mode,S=Vu({mode:"hidden",children:S},u),i=Jl(i,u,n,null),S.return=t,i.return=t,S.sibling=i,t.child=S,i=t.child,i.memoizedState=Yd(n),i.childLanes=$d(e,_,n),t.memoizedState=Gd,So(null,i)):(pi(t),Xd(t,S))}var M=e.memoizedState;if(M!==null&&(S=M.dehydrated,S!==null)){if(f)t.flags&256?(pi(t),t.flags&=-257,t=Vd(e,t,n)):t.memoizedState!==null?(mi(),t.child=e.child,t.flags|=128,t=null):(mi(),S=i.fallback,u=t.mode,i=Vu({mode:"visible",children:i.children},u),S=Jl(S,u,n,null),S.flags|=2,i.return=t,S.return=t,i.sibling=S,t.child=i,Ra(t,e.child,null,n),i=t.child,i.memoizedState=Yd(n),i.childLanes=$d(e,_,n),t.memoizedState=Gd,t=So(null,i));else if(pi(t),kh(S)){if(_=S.nextSibling&&S.nextSibling.dataset,_)var J=_.dgst;_=J,i=Error(c(419)),i.stack="",i.digest=_,lr({value:i,source:null,stack:null}),t=Vd(e,t,n)}else if(zn||ci(e,t,n,!1),_=(n&e.childLanes)!==0,zn||_){if(_=Jt,_!==null&&(i=Sl(_,n),i!==0&&i!==M.retryLane))throw M.retryLane=i,ka(e,i),Bl(_,e,i),Id;Nh(S)||tf(),t=Vd(e,t,n)}else Nh(S)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Yt=ds(S.nextSibling),qn=t,it=!0,Pl=null,Dl=!1,e!==null&&Nu(t,e),t=Xd(t,i.children),t.flags|=4096);return t}return u?(mi(),S=i.fallback,u=t.mode,M=e.child,J=M.sibling,i=ks(M,{mode:"hidden",children:i.children}),i.subtreeFlags=M.subtreeFlags&65011712,J!==null?S=ks(J,S):(S=Jl(S,u,n,null),S.flags|=2),S.return=t,i.return=t,i.sibling=S,t.child=i,So(null,i),i=t.child,S=e.child.memoizedState,S===null?S=Yd(n):(u=S.cachePool,u!==null?(M=vn._currentValue,u=u.parent!==M?{parent:M,pool:M}:u):u=fi(),S={baseLanes:S.baseLanes|n,cachePool:u}),i.memoizedState=S,i.childLanes=$d(e,_,n),t.memoizedState=Gd,So(e.child,i)):(pi(t),n=e.child,e=n.sibling,n=ks(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=n,t.memoizedState=null,n)}function Xd(e,t){return t=Vu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vu(e,t){return e=nl(22,e,null,t),e.lanes=0,e}function Vd(e,t,n){return Ra(t,e.child,null,n),e=Xd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Jm(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),fo(e.return,t,n)}function Qd(e,t,n,i,u,f){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:u,treeForkCount:f}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=n,_.tailMode=u,_.treeForkCount=f)}function Pm(e,t,n){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var _=Cn.current,S=(_&2)!==0;if(S?(_=_&1|2,t.flags|=128):_&=1,q(Cn,_),ll(e,t,i,n),i=it?nr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jm(e,n,t);else if(e.tag===19)Jm(e,n,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(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&Ou(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Qd(t,!1,u,n,f,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ou(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Qd(t,!0,n,null,f,i);break;case"together":Qd(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function La(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ci(e,t,n,!1),(n&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,n=ks(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ks(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Kd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&sr(e)))}function Ty(e,t,n){switch(t.tag){case 3:Xe(t,t.stateNode.containerInfo),Zs(t,vn,e.memoizedState.cache),Ea();break;case 27:case 5:bt(t);break;case 4:Xe(t,t.stateNode.containerInfo);break;case 10:Zs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,_d(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(pi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Fm(e,t,n):(pi(t),e=La(e,t,n),e!==null?e.sibling:null);pi(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ci(e,t,n,!1),i=(n&t.childLanes)!==0),u){if(i)return Pm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),q(Cn,Cn.current),i)break;return null;case 22:return t.lanes=0,$m(e,t,n,t.pendingProps);case 24:Zs(t,vn,e.memoizedState.cache)}return La(e,t,n)}function Wm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)zn=!0;else{if(!Kd(e,n)&&(t.flags&128)===0)return zn=!1,Ty(e,t,n);zn=(e.flags&131072)!==0}else zn=!1,it&&(t.flags&1048576)!==0&&ao(t,nr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ps(t.elementType),t.type=e,typeof e=="function")so(e)?(i=hr(e,i),t.tag=1,t=Km(null,t,e,i,n)):(t.tag=0,t=qd(null,t,e,i,n));else{if(e!=null){var u=e.$$typeof;if(u===I){t.tag=11,t=qm(null,t,e,i,n);break e}else if(u===D){t.tag=14,t=Gm(null,t,e,i,n);break e}}throw t=Se(e)||e,Error(c(306,t,""))}}return t;case 0:return qd(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=hr(i,t.pendingProps),Km(e,t,i,u,n);case 3:e:{if(Xe(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,z(e,t),hi(t,i,null,n);var _=t.memoizedState;if(i=_.cache,Zs(t,vn,i),i!==f.cache&&ho(t,[vn],n,!0),Ds(),i=_.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Zm(e,t,i,n);break e}else if(i!==u){u=Al(Error(c(424)),t),lr(u),t=Zm(e,t,i,n);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(Yt=ds(e.firstChild),qn=t,it=!0,Pl=null,Dl=!0,n=xo(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ea(),i===u){t=La(e,t,n);break e}ll(e,t,i,n)}t=t.child}return t;case 26:return Xu(e,t),e===null?(n=ux(t.type,null,t.pendingProps,null))?t.memoizedState=n:it||(n=t.type,e=t.pendingProps,i=of(Ae.current).createElement(n),i[en]=t,i[We]=e,sl(i,n,e),mt(i),t.stateNode=i):t.memoizedState=ux(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bt(t),e===null&&it&&(i=t.stateNode=rx(t.type,t.pendingProps,Ae.current),qn=t,Dl=!0,u=Yt,Si(t.type)?(Eh=u,Yt=ds(i.firstChild)):Yt=u),ll(e,t,t.pendingProps.children,n),Xu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&it&&((u=i=Yt)&&(i=s0(i,t.type,t.pendingProps,Dl),i!==null?(t.stateNode=i,qn=t,Yt=ds(i.firstChild),Dl=!1,u=!0):u=!1),u||Ks(t)),bt(t),u=t.type,f=t.pendingProps,_=e!==null?e.memoizedProps:null,i=f.children,jh(u,f)?i=null:_!==null&&jh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=vd(e,t,_y,null,null,n),Ho._currentValue=u),Xu(e,t),ll(e,t,i,n),t.child;case 6:return e===null&&it&&((e=n=Yt)&&(n=a0(n,t.pendingProps,Dl),n!==null?(t.stateNode=n,qn=t,Yt=null,e=!0):e=!1),e||Ks(t)),null;case 13:return Fm(e,t,n);case 4:return Xe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ra(t,null,i,n):ll(e,t,i,n),t.child;case 11:return qm(e,t,t.type,t.pendingProps,n);case 7:return ll(e,t,t.pendingProps,n),t.child;case 8:return ll(e,t,t.pendingProps.children,n),t.child;case 12:return ll(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Zs(t,t.type,i.value),ll(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Fs(t),u=yn(u),i=i(u),t.flags|=1,ll(e,t,i,n),t.child;case 14:return Gm(e,t,t.type,t.pendingProps,n);case 15:return Ym(e,t,t.type,t.pendingProps,n);case 19:return Pm(e,t,n);case 31:return Ey(e,t,n);case 22:return $m(e,t,n,t.pendingProps);case 24:return Fs(t),i=yn(vn),e===null?(u=rr(),u===null&&(u=Jt,f=oi(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:i,cache:u},p(t),Zs(t,vn,u)):((e.lanes&n)!==0&&(z(e,t),hi(t,null,null,n),Ds()),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),Zs(t,vn,i)):(i=f.cache,Zs(t,vn,i),i!==u.cache&&ho(t,[vn],n,!0))),ll(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function za(e){e.flags|=4}function Zd(e,t,n,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(kg())e.flags|=8192;else throw Ws=or,go}else e.flags&=-16777217}function eg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mx(t))if(kg())e.flags|=8192;else throw Ws=or,go}function Qu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Le():536870912,e.lanes|=t,rc|=t)}function wo(e,t){if(!it)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function nn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var u=e.child;u!==null;)n|=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;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Cy(e,t,n){var i=t.pendingProps;switch(ro(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(t),null;case 1:return nn(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cs(vn),Ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ri(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,oo())),nn(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(za(t),f!==null?(nn(t),eg(t,f)):(nn(t),Zd(t,u,null,i,n))):f?f!==e.memoizedState?(za(t),nn(t),eg(t,f)):(nn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&za(t),nn(t),Zd(t,u,e,i,n)),null;case 27:if(Ge(t),n=Ae.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&za(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return nn(t),null}e=_e.current,ri(t)?ku(t):(e=rx(u,i,n),t.stateNode=e,za(t))}return nn(t),null;case 5:if(Ge(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&za(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return nn(t),null}if(f=_e.current,ri(t))ku(t);else{var _=of(Ae.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[en]=t,f[We]=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(sl(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&&za(t)}}return nn(t),Zd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&za(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ae.current,ri(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,u=qn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[en]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Fg(e.nodeValue,n)),e||Ks(t,!0)}else e=of(e).createTextNode(i),e[en]=t,t.stateNode=e}return nn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=ri(t),n!==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[en]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nn(t),e=!1}else n=oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(es(t),t):(es(t),null);if((t.flags&128)!==0)throw Error(c(558))}return nn(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ri(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[en]=t}else Ea(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nn(t),u=!1}else u=oo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(es(t),t):(es(t),null)}return es(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(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)),n!==e&&n&&(t.child.flags|=8192),Qu(t,t.updateQueue),nn(t),null);case 4:return Ue(),e===null&&xh(t.stateNode.containerInfo),nn(t),null;case 10:return Cs(t.type),nn(t),null;case 19:if(te(Cn),i=t.memoizedState,i===null)return nn(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)wo(i,!1);else{if(Sn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ou(e),f!==null){for(t.flags|=128,wo(i,!1),e=f.updateQueue,t.updateQueue=e,Qu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ju(n,e),n=n.sibling;return q(Cn,Cn.current&1|2),it&&Es(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&lt()>Pu&&(t.flags|=128,u=!0,wo(i,!1),t.lanes=4194304)}else{if(!u)if(e=Ou(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Qu(t,e),wo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!it)return nn(t),null}else 2*lt()-i.renderingStartTime>Pu&&n!==536870912&&(t.flags|=128,u=!0,wo(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=lt(),e.sibling=null,n=Cn.current,q(Cn,u?n&1|2:n&1),it&&Es(t,i.treeForkCount),e):(nn(t),null);case 22:case 23:return es(t),On(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(nn(t),t.subtreeFlags&6&&(t.flags|=8192)):nn(t),n=t.updateQueue,n!==null&&Qu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&te(Aa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Cs(vn),nn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Ay(e,t){switch(ro(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cs(vn),Ue(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ge(t),null;case 31:if(t.memoizedState!==null){if(es(t),t.alternate===null)throw Error(c(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(es(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return te(Cn),null;case 4:return Ue(),null;case 10:return Cs(t.type),null;case 22:case 23:return es(t),On(),e!==null&&te(Aa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cs(vn),null;case 25:return null;default:return null}}function tg(e,t){switch(ro(t),t.tag){case 3:Cs(vn),Ue();break;case 26:case 27:case 5:Ge(t);break;case 4:Ue();break;case 31:t.memoizedState!==null&&es(t);break;case 13:es(t);break;case 19:te(Cn);break;case 10:Cs(t.type);break;case 22:case 23:es(t),On(),e!==null&&te(Aa);break;case 24:Cs(vn)}}function No(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&e)===e){i=void 0;var f=n.create,_=n.inst;i=f(),_.destroy=i}n=n.next}while(n!==u)}}catch(S){Xt(t,t.return,S)}}function gi(e,t,n){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,S=_.destroy;if(S!==void 0){_.destroy=void 0,u=t;var M=n,J=S;try{J()}catch(oe){Xt(u,M,oe)}}}i=i.next}while(i!==f)}}catch(oe){Xt(t,t.return,oe)}}function ng(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ye(t,n)}catch(i){Xt(e,e.return,i)}}}function lg(e,t,n){n.props=hr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Xt(e,t,i)}}function ko(e,t){try{var n=e.ref;if(n!==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 n=="function"?e.refCleanup=n(i):n.current=i}}catch(u){Xt(e,t,u)}}function ea(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(u){Xt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){Xt(e,t,u)}else n.current=null}function sg(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(u){Xt(e,e.return,u)}}function Fd(e,t,n){try{var i=e.stateNode;Py(i,e.type,n,t),i[We]=t}catch(u){Xt(e,e.return,u)}}function ag(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Si(e.type)||e.tag===4}function Jd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ag(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&&Si(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 Pd(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vt));else if(i!==4&&(i===27&&Si(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Pd(e,t,n),e=e.sibling;e!==null;)Pd(e,t,n),e=e.sibling}function Ku(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Si(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ku(e,t,n),e=e.sibling;e!==null;)Ku(e,t,n),e=e.sibling}function ig(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);sl(t,i,n),t[en]=e,t[We]=n}catch(f){Xt(e,e.return,f)}}var Ua=!1,Un=!1,Wd=!1,rg=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function My(e,t){if(e=e.containerInfo,yh=gf,e=Sa(e),Pc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var _=0,S=-1,M=-1,J=0,oe=0,he=e,ne=null;t:for(;;){for(var ae;he!==n||u!==0&&he.nodeType!==3||(S=_+u),he!==f||i!==0&&he.nodeType!==3||(M=_+i),he.nodeType===3&&(_+=he.nodeValue.length),(ae=he.firstChild)!==null;)ne=he,he=ae;for(;;){if(he===e)break t;if(ne===n&&++J===u&&(S=_),ne===f&&++oe===i&&(M=_),(ae=he.nextSibling)!==null)break;he=ne,ne=he.parentNode}he=ae}n=S===-1||M===-1?null:{start:S,end:M}}else n=null}n=n||{start:0,end:0}}else n=null;for(vh={focusedElem:e,selectionRange:n},gf=!1,Kn=t;Kn!==null;)if(t=Kn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Kn=e;else for(;Kn!==null;){switch(t=Kn,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(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,i=n.stateNode;try{var Oe=hr(n.type,u);e=i.getSnapshotBeforeUpdate(Oe,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ve){Xt(n,n.return,Ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)wh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":wh(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,Kn=e;break}Kn=t.return}}function cg(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Ba(e,n),i&4&&No(5,n);break;case 1:if(Ba(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(_){Xt(n,n.return,_)}else{var u=hr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){Xt(n,n.return,_)}}i&64&&ng(n),i&512&&ko(n,n.return);break;case 3:if(Ba(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ye(e,t)}catch(_){Xt(n,n.return,_)}}break;case 27:t===null&&i&4&&ig(n);case 26:case 5:Ba(e,n),t===null&&i&4&&sg(n),i&512&&ko(n,n.return);break;case 12:Ba(e,n);break;case 31:Ba(e,n),i&4&&fg(e,n);break;case 13:Ba(e,n),i&4&&dg(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Iy.bind(null,n),i0(e,n))));break;case 22:if(i=n.memoizedState!==null||Ua,!i){t=t!==null&&t.memoizedState!==null||Un,u=Ua;var f=Un;Ua=i,(Un=t)&&!f?Ia(e,n,(n.subtreeFlags&8772)!==0):Ba(e,n),Ua=u,Un=f}break;case 30:break;default:Ba(e,n)}}function og(e){var t=e.alternate;t!==null&&(e.alternate=null,og(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&kl(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 dn=null,Ll=!1;function Ha(e,t,n){for(n=n.child;n!==null;)ug(e,t,n),n=n.sibling}function ug(e,t,n){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(on,n)}catch{}switch(n.tag){case 26:Un||ea(n,t),Ha(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Un||ea(n,t);var i=dn,u=Ll;Si(n.type)&&(dn=n.stateNode,Ll=!1),Ha(e,t,n),Lo(n.stateNode),dn=i,Ll=u;break;case 5:Un||ea(n,t);case 6:if(i=dn,u=Ll,dn=null,Ha(e,t,n),dn=i,Ll=u,dn!==null)if(Ll)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(n.stateNode)}catch(f){Xt(n,t,f)}else try{dn.removeChild(n.stateNode)}catch(f){Xt(n,t,f)}break;case 18:dn!==null&&(Ll?(e=dn,nx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),mc(e)):nx(dn,n.stateNode));break;case 4:i=dn,u=Ll,dn=n.stateNode.containerInfo,Ll=!0,Ha(e,t,n),dn=i,Ll=u;break;case 0:case 11:case 14:case 15:gi(2,n,t),Un||gi(4,n,t),Ha(e,t,n);break;case 1:Un||(ea(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&lg(n,t,i)),Ha(e,t,n);break;case 21:Ha(e,t,n);break;case 22:Un=(i=Un)||n.memoizedState!==null,Ha(e,t,n),Un=i;break;default:Ha(e,t,n)}}function fg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{mc(e)}catch(n){Xt(t,t.return,n)}}}function dg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{mc(e)}catch(n){Xt(t,t.return,n)}}function Ry(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rg),t;default:throw Error(c(435,e.tag))}}function Zu(e,t){var n=Ry(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var u=qy.bind(null,e,i);i.then(u,u)}})}function zl(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var u=n[i],f=e,_=t,S=_;e:for(;S!==null;){switch(S.tag){case 27:if(Si(S.type)){dn=S.stateNode,Ll=!1;break e}break;case 5:dn=S.stateNode,Ll=!1;break e;case 3:case 4:dn=S.stateNode.containerInfo,Ll=!0;break e}S=S.return}if(dn===null)throw Error(c(160));ug(f,_,u),dn=null,Ll=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hg(t,e),t=t.sibling}var Os=null;function hg(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zl(t,e),Ul(e),i&4&&(gi(3,e,e.return),No(3,e),gi(5,e,e.return));break;case 1:zl(t,e),Ul(e),i&512&&(Un||n===null||ea(n,n.return)),i&64&&Ua&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var u=Os;if(zl(t,e),Ul(e),i&512&&(Un||n===null||ea(n,n.return)),i&4){var f=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Xn]||f[en]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),sl(f,i,n),f[en]=e,mt(f),i=f;break e;case"link":var _=hx("link","href",u).get(i+(n.href||""));if(_){for(var S=0;S<_.length;S++)if(f=_[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){_.splice(S,1);break t}}f=u.createElement(i),sl(f,i,n),u.head.appendChild(f);break;case"meta":if(_=hx("meta","content",u).get(i+(n.content||""))){for(S=0;S<_.length;S++)if(f=_[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){_.splice(S,1);break t}}f=u.createElement(i),sl(f,i,n),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[en]=e,mt(f),i=f}e.stateNode=i}else px(u,e.type,e.stateNode);else e.stateNode=dx(u,i,e.memoizedProps);else f!==i?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,i===null?px(u,e.type,e.stateNode):dx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Fd(e,e.memoizedProps,n.memoizedProps)}break;case 27:zl(t,e),Ul(e),i&512&&(Un||n===null||ea(n,n.return)),n!==null&&i&4&&Fd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(zl(t,e),Ul(e),i&512&&(Un||n===null||ea(n,n.return)),e.flags&32){u=e.stateNode;try{$(u,"")}catch(Oe){Xt(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Fd(e,u,n!==null?n.memoizedProps:u)),i&1024&&(Wd=!0);break;case 6:if(zl(t,e),Ul(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(Oe){Xt(e,e.return,Oe)}}break;case 3:if(df=null,u=Os,Os=uf(t.containerInfo),zl(t,e),Os=u,Ul(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{mc(t.containerInfo)}catch(Oe){Xt(e,e.return,Oe)}Wd&&(Wd=!1,pg(e));break;case 4:i=Os,Os=uf(e.stateNode.containerInfo),zl(t,e),Ul(e),Os=i;break;case 12:zl(t,e),Ul(e);break;case 31:zl(t,e),Ul(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Zu(e,i)));break;case 13:zl(t,e),Ul(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ju=lt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Zu(e,i)));break;case 22:u=e.memoizedState!==null;var M=n!==null&&n.memoizedState!==null,J=Ua,oe=Un;if(Ua=J||u,Un=oe||M,zl(t,e),Un=oe,Ua=J,Ul(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||M||Ua||Un||pr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){M=n=t;try{if(f=M.stateNode,u)_=f.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{S=M.stateNode;var he=M.memoizedProps.style,ne=he!=null&&he.hasOwnProperty("display")?he.display:null;S.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Oe){Xt(M,M.return,Oe)}}}else if(t.tag===6){if(n===null){M=t;try{M.stateNode.nodeValue=u?"":M.memoizedProps}catch(Oe){Xt(M,M.return,Oe)}}}else if(t.tag===18){if(n===null){M=t;try{var ae=M.stateNode;u?lx(ae,!0):lx(M.stateNode,!1)}catch(Oe){Xt(M,M.return,Oe)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Zu(e,n))));break;case 19:zl(t,e),Ul(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Zu(e,i)));break;case 30:break;case 21:break;default:zl(t,e),Ul(e)}}function Ul(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(ag(i)){n=i;break}i=i.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Jd(e);Ku(e,f,u);break;case 5:var _=n.stateNode;n.flags&32&&($(_,""),n.flags&=-33);var S=Jd(e);Ku(e,S,_);break;case 3:case 4:var M=n.stateNode.containerInfo,J=Jd(e);Pd(e,J,M);break;default:throw Error(c(161))}}catch(oe){Xt(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ba(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cg(e,t.alternate,t),t=t.sibling}function pr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:gi(4,t,t.return),pr(t);break;case 1:ea(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&lg(t,t.return,n),pr(t);break;case 27:Lo(t.stateNode);case 26:case 5:ea(t,t.return),pr(t);break;case 22:t.memoizedState===null&&pr(t);break;case 30:pr(t);break;default:pr(t)}e=e.sibling}}function Ia(e,t,n){for(n=n&&(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:Ia(u,f,n),No(4,f);break;case 1:if(Ia(u,f,n),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(J){Xt(i,i.return,J)}if(i=f,u=i.updateQueue,u!==null){var S=i.stateNode;try{var M=u.shared.hiddenCallbacks;if(M!==null)for(u.shared.hiddenCallbacks=null,u=0;u<M.length;u++)bo(M[u],S)}catch(J){Xt(i,i.return,J)}}n&&_&64&&ng(f),ko(f,f.return);break;case 27:ig(f);case 26:case 5:Ia(u,f,n),n&&i===null&&_&4&&sg(f),ko(f,f.return);break;case 12:Ia(u,f,n);break;case 31:Ia(u,f,n),n&&_&4&&fg(u,f);break;case 13:Ia(u,f,n),n&&_&4&&dg(u,f);break;case 22:f.memoizedState===null&&Ia(u,f,n),ko(f,f.return);break;case 30:break;default:Ia(u,f,n)}t=t.sibling}}function eh(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ui(n))}function th(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ui(e))}function Ls(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mg(e,t,n,i),t=t.sibling}function mg(e,t,n,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Ls(e,t,n,i),u&2048&&No(9,t);break;case 1:Ls(e,t,n,i);break;case 3:Ls(e,t,n,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ui(e)));break;case 12:if(u&2048){Ls(e,t,n,i),e=t.stateNode;try{var f=t.memoizedProps,_=f.id,S=f.onPostCommit;typeof S=="function"&&S(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Xt(t,t.return,M)}}else Ls(e,t,n,i);break;case 31:Ls(e,t,n,i);break;case 13:Ls(e,t,n,i);break;case 23:break;case 22:f=t.stateNode,_=t.alternate,t.memoizedState!==null?f._visibility&2?Ls(e,t,n,i):Eo(e,t):f._visibility&2?Ls(e,t,n,i):(f._visibility|=2,sc(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&eh(_,t);break;case 24:Ls(e,t,n,i),u&2048&&th(t.alternate,t);break;default:Ls(e,t,n,i)}}function sc(e,t,n,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,_=t,S=n,M=i,J=_.flags;switch(_.tag){case 0:case 11:case 15:sc(f,_,S,M,u),No(8,_);break;case 23:break;case 22:var oe=_.stateNode;_.memoizedState!==null?oe._visibility&2?sc(f,_,S,M,u):Eo(f,_):(oe._visibility|=2,sc(f,_,S,M,u)),u&&J&2048&&eh(_.alternate,_);break;case 24:sc(f,_,S,M,u),u&&J&2048&&th(_.alternate,_);break;default:sc(f,_,S,M,u)}t=t.sibling}}function Eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,u=i.flags;switch(i.tag){case 22:Eo(n,i),u&2048&&eh(i.alternate,i);break;case 24:Eo(n,i),u&2048&&th(i.alternate,i);break;default:Eo(n,i)}t=t.sibling}}var To=8192;function ac(e,t,n){if(e.subtreeFlags&To)for(e=e.child;e!==null;)gg(e,t,n),e=e.sibling}function gg(e,t,n){switch(e.tag){case 26:ac(e,t,n),e.flags&To&&e.memoizedState!==null&&b0(n,Os,e.memoizedState,e.memoizedProps);break;case 5:ac(e,t,n);break;case 3:case 4:var i=Os;Os=uf(e.stateNode.containerInfo),ac(e,t,n),Os=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=To,To=16777216,ac(e,t,n),To=i):ac(e,t,n));break;default:ac(e,t,n)}}function xg(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 Co(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Kn=i,_g(i,e)}xg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bg(e),e=e.sibling}function bg(e){switch(e.tag){case 0:case 11:case 15:Co(e),e.flags&2048&&gi(9,e,e.return);break;case 3:Co(e);break;case 12:Co(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fu(e)):Co(e);break;default:Co(e)}}function Fu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Kn=i,_g(i,e)}xg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:gi(8,t,t.return),Fu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fu(t));break;default:Fu(t)}e=e.sibling}}function _g(e,t){for(;Kn!==null;){var n=Kn;switch(n.tag){case 0:case 11:case 15:gi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:ui(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Kn=i;else e:for(n=e;Kn!==null;){i=Kn;var u=i.sibling,f=i.return;if(og(i),i===n){Kn=null;break e}if(u!==null){u.return=f,Kn=u;break e}Kn=f}}}var Dy={getCacheForType:function(e){var t=yn(vn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return yn(vn).controller.signal}},Oy=typeof WeakMap=="function"?WeakMap:Map,Dt=0,Jt=null,ut=null,gt=0,$t=0,ts=null,xi=!1,ic=!1,nh=!1,qa=0,Sn=0,bi=0,mr=0,lh=0,ns=0,rc=0,Ao=null,Hl=null,sh=!1,Ju=0,yg=0,Pu=1/0,Wu=null,_i=null,Gn=0,yi=null,cc=null,Ga=0,ah=0,ih=null,vg=null,Mo=0,rh=null;function ls(){return(Dt&2)!==0&&gt!==0?gt&-gt:H.T!==null?hh():Yl()}function jg(){if(ns===0)if((gt&536870912)===0||it){var e=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),ns=e}else ns=536870912;return e=_l.current,e!==null&&(e.flags|=32),ns}function Bl(e,t,n){(e===Jt&&($t===2||$t===9)||e.cancelPendingCommit!==null)&&(oc(e,0),vi(e,gt,ns,!1)),$n(e,n),((Dt&2)===0||e!==Jt)&&(e===Jt&&((Dt&2)===0&&(mr|=n),Sn===4&&vi(e,gt,ns,!1)),ta(e))}function Sg(e,t,n){if((Dt&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||de(e,t),u=i?Uy(e,t):oh(e,t,!0),f=i;do{if(u===0){ic&&!i&&vi(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Ly(n)){u=oh(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 S=e;u=Ao;var M=S.current.memoizedState.isDehydrated;if(M&&(oc(S,_).flags|=256),_=oh(S,_,!1),_!==2){if(nh&&!M){S.errorRecoveryDisabledLanes|=f,mr|=f,u=4;break e}f=Hl,Hl=u,f!==null&&(Hl===null?Hl=f:Hl.push.apply(Hl,f))}u=_}if(f=!1,u!==2)continue}}if(u===1){oc(e,0),vi(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:vi(i,t,ns,!xi);break e;case 2:Hl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Ju+300-lt(),10<u)){if(vi(i,t,ns,!xi),X(i,0,!0)!==0)break e;Ga=t,i.timeoutHandle=ex(wg.bind(null,i,n,Hl,Wu,sh,t,ns,mr,rc,xi,f,"Throttled",-0,0),u);break e}wg(i,n,Hl,Wu,sh,t,ns,mr,rc,xi,f,null,-0,0)}}break}while(!0);ta(e)}function wg(e,t,n,i,u,f,_,S,M,J,oe,he,ne,ae){if(e.timeoutHandle=-1,he=t.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vt},gg(t,f,he);var Oe=(f&62914560)===f?Ju-lt():(f&4194048)===f?yg-lt():0;if(Oe=_0(he,Oe),Oe!==null){Ga=f,e.cancelPendingCommit=Oe(Rg.bind(null,e,t,f,n,i,u,_,S,M,oe,he,null,ne,ae)),vi(e,f,_,!J);return}}Rg(e,t,f,n,i,u,_,S,M)}function Ly(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var u=n[i],f=u.getSnapshot;u=u.value;try{if(!In(f(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 vi(e,t,n,i){t&=~lh,t&=~mr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-It(u),_=1<<f;i[f]=-1,u&=~_}n!==0&&as(e,n,t)}function ef(){return(Dt&6)===0?(Ro(0),!1):!0}function ch(){if(ut!==null){if($t===0)var e=ut.return;else e=ut,Ts=Ta=null,wd(e),di=null,Ma=0,e=ut;for(;e!==null;)tg(e.alternate,e),e=e.return;ut=null}}function oc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,t0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ga=0,ch(),Jt=e,ut=n=ks(e.current,null),gt=t,$t=0,ts=null,xi=!1,ic=de(e,t),nh=!1,rc=ns=lh=mr=bi=Sn=0,Hl=Ao=null,sh=!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-It(i),f=1<<u;t|=e[u],i&=~f}return qa=t,Wi(),n}function Ng(e,t){tt=null,H.H=jo,t===Wl||t===cr?(t=Ru(),$t=3):t===go?(t=Ru(),$t=4):$t=t===Id?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ts=t,ut===null&&(Sn=1,Yu(e,Al(t,e.current)))}function kg(){var e=_l.current;return e===null?!0:(gt&4194048)===gt?fs===null:(gt&62914560)===gt||(gt&536870912)!==0?e===fs:!1}function Eg(){var e=H.H;return H.H=jo,e===null?jo:e}function Tg(){var e=H.A;return H.A=Dy,e}function tf(){Sn=4,xi||(gt&4194048)!==gt&&_l.current!==null||(ic=!0),(bi&134217727)===0&&(mr&134217727)===0||Jt===null||vi(Jt,gt,ns,!1)}function oh(e,t,n){var i=Dt;Dt|=2;var u=Eg(),f=Tg();(Jt!==e||gt!==t)&&(Wu=null,oc(e,t)),t=!1;var _=Sn;e:do try{if($t!==0&&ut!==null){var S=ut,M=ts;switch($t){case 8:ch(),_=6;break e;case 3:case 2:case 9:case 6:_l.current===null&&(t=!0);var J=$t;if($t=0,ts=null,uc(e,S,M,J),n&&ic){_=0;break e}break;default:J=$t,$t=0,ts=null,uc(e,S,M,J)}}zy(),_=Sn;break}catch(oe){Ng(e,oe)}while(!0);return t&&e.shellSuspendCounter++,Ts=Ta=null,Dt=i,H.H=u,H.A=f,ut===null&&(Jt=null,gt=0,Wi()),_}function zy(){for(;ut!==null;)Cg(ut)}function Uy(e,t){var n=Dt;Dt|=2;var i=Eg(),u=Tg();Jt!==e||gt!==t?(Wu=null,Pu=lt()+500,oc(e,t)):ic=de(e,t);e:do try{if($t!==0&&ut!==null){t=ut;var f=ts;t:switch($t){case 1:$t=0,ts=null,uc(e,t,f,1);break;case 2:case 9:if(Au(f)){$t=0,ts=null,Ag(t);break}t=function(){$t!==2&&$t!==9||Jt!==e||($t=7),ta(e)},f.then(t,t);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:Au(f)?($t=0,ts=null,Ag(t)):($t=0,ts=null,uc(e,t,f,7));break;case 5:var _=null;switch(ut.tag){case 26:_=ut.memoizedState;case 5:case 27:var S=ut;if(_?mx(_):S.stateNode.complete){$t=0,ts=null;var M=S.sibling;if(M!==null)ut=M;else{var J=S.return;J!==null?(ut=J,nf(J)):ut=null}break t}}$t=0,ts=null,uc(e,t,f,5);break;case 6:$t=0,ts=null,uc(e,t,f,6);break;case 8:ch(),Sn=6;break e;default:throw Error(c(462))}}Hy();break}catch(oe){Ng(e,oe)}while(!0);return Ts=Ta=null,H.H=i,H.A=u,Dt=n,ut!==null?0:(Jt=null,gt=0,Wi(),Sn)}function Hy(){for(;ut!==null&&!rn();)Cg(ut)}function Cg(e){var t=Wm(e.alternate,e,qa);e.memoizedProps=e.pendingProps,t===null?nf(e):ut=t}function Ag(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qm(n,t,t.pendingProps,t.type,void 0,gt);break;case 11:t=Qm(n,t,t.pendingProps,t.type.render,t.ref,gt);break;case 5:wd(t);default:tg(n,t),t=ut=ju(t,qa),t=Wm(n,t,qa)}e.memoizedProps=e.pendingProps,t===null?nf(e):ut=t}function uc(e,t,n,i){Ts=Ta=null,wd(t),di=null,Ma=0;var u=t.return;try{if(ky(e,u,t,n,gt)){Sn=1,Yu(e,Al(n,e.current)),ut=null;return}}catch(f){if(u!==null)throw ut=u,f;Sn=1,Yu(e,Al(n,e.current)),ut=null;return}t.flags&32768?(it||i===1?e=!0:ic||(gt&536870912)!==0?e=!1:(xi=e=!0,(i===2||i===9||i===3||i===6)&&(i=_l.current,i!==null&&i.tag===13&&(i.flags|=16384))),Mg(t,e)):nf(t)}function nf(e){var t=e;do{if((t.flags&32768)!==0){Mg(t,xi);return}e=t.return;var n=Cy(t.alternate,t,qa);if(n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);Sn===0&&(Sn=5)}function Mg(e,t){do{var n=Ay(e.alternate,e);if(n!==null){n.flags&=32767,ut=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ut=e;return}ut=e=n}while(e!==null);Sn=6,ut=null}function Rg(e,t,n,i,u,f,_,S,M){e.cancelPendingCommit=null;do lf();while(Gn!==0);if((Dt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Qr,hl(e,n,f,_,S,M),e===Jt&&(ut=Jt=null,gt=0),cc=t,yi=e,Ga=n,ah=f,ih=u,vg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gy(Wt,function(){return Ug(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=H.T,H.T=null,u=ue.p,ue.p=2,_=Dt,Dt|=4;try{My(e,t,n)}finally{Dt=_,ue.p=u,H.T=i}}Gn=1,Dg(),Og(),Lg()}}function Dg(){if(Gn===1){Gn=0;var e=yi,t=cc,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=H.T,H.T=null;var i=ue.p;ue.p=2;var u=Dt;Dt|=4;try{hg(t,e);var f=vh,_=Sa(e.containerInfo),S=f.focusedElem,M=f.selectionRange;if(_!==S&&S&&S.ownerDocument&&pu(S.ownerDocument.documentElement,S)){if(M!==null&&Pc(S)){var J=M.start,oe=M.end;if(oe===void 0&&(oe=J),"selectionStart"in S)S.selectionStart=J,S.selectionEnd=Math.min(oe,S.value.length);else{var he=S.ownerDocument||document,ne=he&&he.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),Oe=S.textContent.length,Ve=Math.min(M.start,Oe),Kt=M.end===void 0?Ve:Math.min(M.end,Oe);!ae.extend&&Ve>Kt&&(_=Kt,Kt=Ve,Ve=_);var G=Jc(S,Ve),L=Jc(S,Kt);if(G&&L&&(ae.rangeCount!==1||ae.anchorNode!==G.node||ae.anchorOffset!==G.offset||ae.focusNode!==L.node||ae.focusOffset!==L.offset)){var F=he.createRange();F.setStart(G.node,G.offset),ae.removeAllRanges(),Ve>Kt?(ae.addRange(F),ae.extend(L.node,L.offset)):(F.setEnd(L.node,L.offset),ae.addRange(F))}}}}for(he=[],ae=S;ae=ae.parentNode;)ae.nodeType===1&&he.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<he.length;S++){var fe=he[S];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}gf=!!yh,vh=yh=null}finally{Dt=u,ue.p=i,H.T=n}}e.current=t,Gn=2}}function Og(){if(Gn===2){Gn=0;var e=yi,t=cc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=H.T,H.T=null;var i=ue.p;ue.p=2;var u=Dt;Dt|=4;try{cg(e,t.alternate,t)}finally{Dt=u,ue.p=i,H.T=n}}Gn=3}}function Lg(){if(Gn===4||Gn===3){Gn=0,pt();var e=yi,t=cc,n=Ga,i=vg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Gn=5:(Gn=0,cc=yi=null,zg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(_i=null),Gl(n),t=t.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=H.T,u=ue.p,ue.p=2,H.T=null;try{for(var f=e.onRecoverableError,_=0;_<i.length;_++){var S=i[_];f(S.value,{componentStack:S.stack})}}finally{H.T=t,ue.p=u}}(Ga&3)!==0&&lf(),ta(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===rh?Mo++:(Mo=0,rh=e):Mo=0,Ro(0)}}function zg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ui(t)))}function lf(){return Dg(),Og(),Lg(),Ug()}function Ug(){if(Gn!==5)return!1;var e=yi,t=ah;ah=0;var n=Gl(Ga),i=H.T,u=ue.p;try{ue.p=32>n?32:n,H.T=null,n=ih,ih=null;var f=yi,_=Ga;if(Gn=0,cc=yi=null,Ga=0,(Dt&6)!==0)throw Error(c(331));var S=Dt;if(Dt|=4,bg(f.current),mg(f,f.current,_,n),Dt=S,Ro(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(on,f)}catch{}return!0}finally{ue.p=u,H.T=i,zg(e,t)}}function Hg(e,t,n){t=Al(n,t),t=Bd(e.stateNode,t,2),e=Te(e,t,2),e!==null&&($n(e,2),ta(e))}function Xt(e,t,n){if(e.tag===3)Hg(e,e,n);else for(;t!==null;){if(t.tag===3){Hg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(_i===null||!_i.has(i))){e=Al(n,e),n=Bm(2),i=Te(t,n,2),i!==null&&(Im(n,i,t,e),$n(i,2),ta(i));break}}t=t.return}}function uh(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Oy;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(n)||(nh=!0,u.add(n),e=By.bind(null,e,t,n),t.then(e,e))}function By(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Jt===e&&(gt&n)===n&&(Sn===4||Sn===3&&(gt&62914560)===gt&&300>lt()-Ju?(Dt&2)===0&&oc(e,0):lh|=n,rc===gt&&(rc=0)),ta(e)}function Bg(e,t){t===0&&(t=Le()),e=ka(e,t),e!==null&&($n(e,t),ta(e))}function Iy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bg(e,n)}function qy(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(n=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),Bg(e,n)}function Gy(e,t){return ht(e,t)}var sf=null,fc=null,fh=!1,af=!1,dh=!1,ji=0;function ta(e){e!==fc&&e.next===null&&(fc===null?sf=fc=e:fc=fc.next=e),af=!0,fh||(fh=!0,$y())}function Ro(e,t){if(!dh&&af){dh=!0;do for(var n=!1,i=sf;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var _=i.suspendedLanes,S=i.pingedLanes;f=(1<<31-It(42|e)+1)-1,f&=u&~(_&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Yg(i,f))}else f=gt,f=X(i,i===Jt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||de(i,f)||(n=!0,Yg(i,f));i=i.next}while(n);dh=!1}}function Yy(){Ig()}function Ig(){af=fh=!1;var e=0;ji!==0&&e0()&&(e=ji);for(var t=lt(),n=null,i=sf;i!==null;){var u=i.next,f=qg(i,t);f===0?(i.next=null,n===null?sf=u:n.next=u,u===null&&(fc=n)):(n=i,(e!==0||(f&3)!==0)&&(af=!0)),i=u}Gn!==0&&Gn!==5||Ro(e),ji!==0&&(ji=0)}function qg(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var _=31-It(f),S=1<<_,M=u[_];M===-1?((S&n)===0||(S&i)!==0)&&(u[_]=ke(S,t)):M<=t&&(e.expiredLanes|=S),f&=~S}if(t=Jt,n=gt,n=X(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&($t===2||$t===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&_t(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||de(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&_t(i),Gl(n)){case 2:case 8:n=Mt;break;case 32:n=Wt;break;case 268435456:n=wn;break;default:n=Wt}return i=Gg.bind(null,e),n=ht(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&_t(i),e.callbackPriority=2,e.callbackNode=null,2}function Gg(e,t){if(Gn!==0&&Gn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var i=gt;return i=X(e,e===Jt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Sg(e,i,t),qg(e,lt()),e.callbackNode!=null&&e.callbackNode===n?Gg.bind(null,e):null)}function Yg(e,t){if(lf())return null;Sg(e,t,!0)}function $y(){n0(function(){(Dt&6)!==0?ht(Jn,Yy):Ig()})}function hh(){if(ji===0){var e=Ca;e===0&&(e=Be,Be<<=1,(Be&261888)===0&&(Be=256)),ji=e}return ji}function $g(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ft(""+e)}function Xg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Xy(e,t,n,i,u){if(t==="submit"&&n&&n.stateNode===u){var f=$g((u[We]||null).action),_=i.submitter;_&&(t=(t=_[We]||null)?$g(t.formAction):_.getAttribute("formAction"),t!==null&&(f=t,_=null));var S=new Ys("action","action",null,i,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ji!==0){var M=_?Xg(u,_):new FormData(u);Dd(n,{pending:!0,data:M,method:u.method,action:f},null,M)}}else typeof f=="function"&&(S.preventDefault(),M=_?Xg(u,_):new FormData(u),Dd(n,{pending:!0,data:M,method:u.method,action:f},f,M))},currentTarget:u}]})}}for(var ph=0;ph<no.length;ph++){var mh=no[ph],Vy=mh.toLowerCase(),Qy=mh[0].toUpperCase()+mh.slice(1);gl(Vy,"on"+Qy)}gl(xu,"onAnimationEnd"),gl(bu,"onAnimationIteration"),gl(_u,"onAnimationStart"),gl("dblclick","onDoubleClick"),gl("focusin","onFocus"),gl("focusout","onBlur"),gl(to,"onTransitionRun"),gl(gd,"onTransitionStart"),gl(xd,"onTransitionCancel"),gl(Xr,"onTransitionEnd"),Rn("onMouseEnter",["mouseout","mouseover"]),Rn("onMouseLeave",["mouseout","mouseover"]),Rn("onPointerEnter",["pointerout","pointerover"]),Rn("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="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(" "),Ky=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Vg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var _=i.length-1;0<=_;_--){var S=i[_],M=S.instance,J=S.currentTarget;if(S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=J;try{f(u)}catch(oe){Vr(oe)}u.currentTarget=null,f=M}else for(_=0;_<i.length;_++){if(S=i[_],M=S.instance,J=S.currentTarget,S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=J;try{f(u)}catch(oe){Vr(oe)}u.currentTarget=null,f=M}}}}function ft(e,t){var n=t[qs];n===void 0&&(n=t[qs]=new Set);var i=e+"__bubble";n.has(i)||(Qg(t,e,2,!1),n.add(i))}function gh(e,t,n){var i=0;t&&(i|=4),Qg(n,e,i,t)}var rf="_reactListening"+Math.random().toString(36).slice(2);function xh(e){if(!e[rf]){e[rf]=!0,zt.forEach(function(n){n!=="selectionchange"&&(Ky.has(n)||gh(n,!1,e),gh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rf]||(t[rf]=!0,gh("selectionchange",!1,t))}}function Qg(e,t,n,i){switch(jx(t)){case 2:var u=j0;break;case 8:u=S0;break;default:u=Rh}n=u.bind(null,t,n,e),u=void 0,!pa||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function bh(e,t,n,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 S=i.stateNode.containerInfo;if(S===u)break;if(_===4)for(_=i.return;_!==null;){var M=_.tag;if((M===3||M===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;S!==null;){if(_=Et(S),_===null)return;if(M=_.tag,M===5||M===6||M===26||M===27){i=f=_;continue e}S=S.parentNode}}i=i.return}pl(function(){var J=f,oe=le(n),he=[];e:{var ne=yu.get(e);if(ne!==void 0){var ae=Ys,Oe=e;switch(e){case"keypress":if(ma(n)===0)break e;case"keydown":case"keyup":ae=ou;break;case"focusin":Oe="focus",ae=Gc;break;case"focusout":Oe="blur",ae=Gc;break;case"beforeblur":case"afterblur":ae=Gc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=xa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Or;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=js;break;case xu:case bu:case _u:ae=ud;break;case Xr:ae=Qi;break;case"scroll":case"scrollend":ae=Ic;break;case"wheel":ae=Ki;break;case"copy":case"cut":case"paste":ae=Ur;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Xc;break;case"toggle":case"beforetoggle":ae=Vc}var Ve=(t&4)!==0,Kt=!Ve&&(e==="scroll"||e==="scrollend"),G=Ve?ne!==null?ne+"Capture":null:ne;Ve=[];for(var L=J,F;L!==null;){var fe=L;if(F=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||F===null||G===null||(fe=Zl(L,G),fe!=null&&Ve.push(Oo(L,fe,F))),Kt)break;L=L.return}0<Ve.length&&(ne=new ae(ne,Oe,null,n,oe),he.push({event:ne,listeners:Ve}))}}if((t&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",ne&&n!==N&&(Oe=n.relatedTarget||n.fromElement)&&(Et(Oe)||Oe[Mn]))break e;if((ae||ne)&&(ne=oe.window===oe?oe:(ne=oe.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(Oe=n.relatedTarget||n.toElement,ae=J,Oe=Oe?Et(Oe):null,Oe!==null&&(Kt=d(Oe),Ve=Oe.tag,Oe!==Kt||Ve!==5&&Ve!==27&&Ve!==6)&&(Oe=null)):(ae=null,Oe=J),ae!==Oe)){if(Ve=xa,fe="onMouseLeave",G="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ve=Xc,fe="onPointerLeave",G="onPointerEnter",L="pointer"),Kt=ae==null?ne:un(ae),F=Oe==null?ne:un(Oe),ne=new Ve(fe,L+"leave",ae,n,oe),ne.target=Kt,ne.relatedTarget=F,fe=null,Et(oe)===J&&(Ve=new Ve(G,L+"enter",Oe,n,oe),Ve.target=F,Ve.relatedTarget=Kt,fe=Ve),Kt=fe,ae&&Oe)t:{for(Ve=Zy,G=ae,L=Oe,F=0,fe=G;fe;fe=Ve(fe))F++;fe=0;for(var Ye=L;Ye;Ye=Ve(Ye))fe++;for(;0<F-fe;)G=Ve(G),F--;for(;0<fe-F;)L=Ve(L),fe--;for(;F--;){if(G===L||L!==null&&G===L.alternate){Ve=G;break t}G=Ve(G),L=Ve(L)}Ve=null}else Ve=null;ae!==null&&Kg(he,ne,ae,Ve,!1),Oe!==null&&Kt!==null&&Kg(he,Kt,Oe,Ve,!0)}}e:{if(ne=J?un(J):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var Ct=Ji;else if(Zi(ne))if(Wa)Ct=pd;else{Ct=Zc;var ze=ti}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?J&&$e(J.elementType)&&(Ct=Ji):Ct=hd;if(Ct&&(Ct=Ct(e,J))){Fi(he,Ct,n,oe);break e}ze&&ze(e,ne,J),e==="focusout"&&J&&ne.type==="number"&&J.memoizedProps.value!=null&&cs(ne,"number",ne.value)}switch(ze=J?un(J):window,e){case"focusin":(Zi(ze)||ze.contentEditable==="true")&&(ni=ze,Wc=J,Pi=null);break;case"focusout":Pi=Wc=ni=null;break;case"mousedown":Xs=!0;break;case"contextmenu":case"mouseup":case"dragend":Xs=!1,mu(he,n,oe);break;case"selectionchange":if(md)break;case"keydown":case"keyup":mu(he,n,oe)}var nt;if(Qc)e:{switch(e){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else va?Kc(e,n)&&(xt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(xt="onCompositionStart");xt&&(kn&&n.locale!=="ko"&&(va||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&va&&(nt=Dr()):(Cl=oe,Qa="value"in Cl?Cl.value:Cl.textContent,va=!0)),ze=cf(J,xt),0<ze.length&&(xt=new Fa(xt,e,null,n,oe),he.push({event:xt,listeners:ze}),nt?xt.data=nt:(nt=En(n),nt!==null&&(xt.data=nt)))),(nt=Yr?uu(e,n):Ss(e,n))&&(xt=cf(J,"onBeforeInput"),0<xt.length&&(ze=new Fa("onBeforeInput","beforeinput",null,n,oe),he.push({event:ze,listeners:xt}),ze.data=nt)),Xy(he,e,J,n,oe)}Vg(he,t)})}function Oo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cf(e,t){for(var n=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Zl(e,n),u!=null&&i.unshift(Oo(e,u,f)),u=Zl(e,t),u!=null&&i.push(Oo(e,u,f))),e.tag===3)return i;e=e.return}return[]}function Zy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Kg(e,t,n,i,u){for(var f=t._reactName,_=[];n!==null&&n!==i;){var S=n,M=S.alternate,J=S.stateNode;if(S=S.tag,M!==null&&M===i)break;S!==5&&S!==26&&S!==27||J===null||(M=J,u?(J=Zl(n,f),J!=null&&_.unshift(Oo(n,J,M))):u||(J=Zl(n,f),J!=null&&_.push(Oo(n,J,M)))),n=n.return}_.length!==0&&e.push({event:t,listeners:_})}var Fy=/\r\n?/g,Jy=/\u0000|\uFFFD/g;function Zg(e){return(typeof e=="string"?e:""+e).replace(Fy,`
50
- `).replace(Jy,"")}function Fg(e,t){return t=Zg(t),Zg(e)===t}function Qt(e,t,n,i,u,f){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||$(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&$(e,""+i);break;case"className":qt(e,"class",i);break;case"tabIndex":qt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":qt(e,n,i);break;case"style":He(e,i,f);break;case"data":if(t!=="object"){qt(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Ft(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"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"&&(n==="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(n);break}i=Ft(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=vt);break;case"onScroll":i!=null&&ft("scroll",e);break;case"onScrollEnd":i!=null&&ft("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}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}n=Ft(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);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(n,""+i):e.removeAttribute(n);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(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":ft("beforetoggle",e),ft("toggle",e),el(e,"popover",i);break;case"xlinkActuate":Dn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Dn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Dn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Dn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Dn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Dn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Dn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Dn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Dn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":el(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Tt.get(n)||n,el(e,n,i))}}function _h(e,t,n,i,u,f){switch(n){case"style":He(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof i=="string"?$(e,i):(typeof i=="number"||typeof i=="bigint")&&$(e,""+i);break;case"onScroll":i!=null&&ft("scroll",e);break;case"onScrollEnd":i!=null&&ft("scrollend",e);break;case"onClick":i!=null&&(e.onclick=vt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vn.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[We]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,u);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):el(e,n,i)}}}function sl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",e),ft("load",e);var i=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var _=n[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,_,n,null)}}u&&Qt(e,t,"srcSet",n.srcSet,n,null),i&&Qt(e,t,"src",n.src,n,null);return;case"input":ft("invalid",e);var S=f=_=u=null,M=null,J=null;for(i in n)if(n.hasOwnProperty(i)){var oe=n[i];if(oe!=null)switch(i){case"name":u=oe;break;case"type":_=oe;break;case"checked":M=oe;break;case"defaultChecked":J=oe;break;case"value":f=oe;break;case"defaultValue":S=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(c(137,t));break;default:Qt(e,t,i,oe,n,null)}}rs(e,f,S,M,J,_,u,!1);return;case"select":ft("invalid",e),i=_=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":_=S;break;case"multiple":i=S;default:Qt(e,t,u,S,n,null)}t=f,n=_,e.multiple=!!i,t!=null?Tl(e,!!i,t,!1):n!=null&&Tl(e,!!i,n,!0);return;case"textarea":ft("invalid",e),f=u=i=null;for(_ in n)if(n.hasOwnProperty(_)&&(S=n[_],S!=null))switch(_){case"value":i=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Qt(e,t,_,S,n,null)}E(e,i,u,f);return;case"option":for(M in n)if(n.hasOwnProperty(M)&&(i=n[M],i!=null))switch(M){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Qt(e,t,M,i,n,null)}return;case"dialog":ft("beforetoggle",e),ft("toggle",e),ft("cancel",e),ft("close",e);break;case"iframe":case"object":ft("load",e);break;case"video":case"audio":for(i=0;i<Do.length;i++)ft(Do[i],e);break;case"image":ft("error",e),ft("load",e);break;case"details":ft("toggle",e);break;case"embed":case"source":case"link":ft("error",e),ft("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(J in n)if(n.hasOwnProperty(J)&&(i=n[J],i!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,J,i,n,null)}return;default:if($e(t)){for(oe in n)n.hasOwnProperty(oe)&&(i=n[oe],i!==void 0&&_h(e,t,oe,i,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(i=n[S],i!=null&&Qt(e,t,S,i,n,null))}function Py(e,t,n,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,S=null,M=null,J=null,oe=null;for(ae in n){var he=n[ae];if(n.hasOwnProperty(ae)&&he!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":M=he;default:i.hasOwnProperty(ae)||Qt(e,t,ae,null,i,he)}}for(var ne in i){var ae=i[ne];if(he=n[ne],i.hasOwnProperty(ne)&&(ae!=null||he!=null))switch(ne){case"type":f=ae;break;case"name":u=ae;break;case"checked":J=ae;break;case"defaultChecked":oe=ae;break;case"value":_=ae;break;case"defaultValue":S=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(c(137,t));break;default:ae!==he&&Qt(e,t,ne,ae,i,he)}}ys(e,_,S,M,J,oe,f,u);return;case"select":ae=_=S=ne=null;for(f in n)if(M=n[f],n.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":ae=M;default:i.hasOwnProperty(f)||Qt(e,t,f,null,i,M)}for(u in i)if(f=i[u],M=n[u],i.hasOwnProperty(u)&&(f!=null||M!=null))switch(u){case"value":ne=f;break;case"defaultValue":S=f;break;case"multiple":_=f;default:f!==M&&Qt(e,t,u,f,i,M)}t=S,n=_,i=ae,ne!=null?Tl(e,!!n,ne,!1):!!i!=!!n&&(t!=null?Tl(e,!!n,t,!0):Tl(e,!!n,n?[]:"",!1));return;case"textarea":ae=ne=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Qt(e,t,S,null,i,u)}for(_ in i)if(u=i[_],f=n[_],i.hasOwnProperty(_)&&(u!=null||f!=null))switch(_){case"value":ne=u;break;case"defaultValue":ae=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Qt(e,t,_,u,i,f)}me(e,ne,ae);return;case"option":for(var Oe in n)if(ne=n[Oe],n.hasOwnProperty(Oe)&&ne!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:Qt(e,t,Oe,null,i,ne)}for(M in i)if(ne=i[M],ae=n[M],i.hasOwnProperty(M)&&ne!==ae&&(ne!=null||ae!=null))switch(M){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Qt(e,t,M,ne,i,ae)}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 Ve in n)ne=n[Ve],n.hasOwnProperty(Ve)&&ne!=null&&!i.hasOwnProperty(Ve)&&Qt(e,t,Ve,null,i,ne);for(J in i)if(ne=i[J],ae=n[J],i.hasOwnProperty(J)&&ne!==ae&&(ne!=null||ae!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,t));break;default:Qt(e,t,J,ne,i,ae)}return;default:if($e(t)){for(var Kt in n)ne=n[Kt],n.hasOwnProperty(Kt)&&ne!==void 0&&!i.hasOwnProperty(Kt)&&_h(e,t,Kt,void 0,i,ne);for(oe in i)ne=i[oe],ae=n[oe],!i.hasOwnProperty(oe)||ne===ae||ne===void 0&&ae===void 0||_h(e,t,oe,ne,i,ae);return}}for(var G in n)ne=n[G],n.hasOwnProperty(G)&&ne!=null&&!i.hasOwnProperty(G)&&Qt(e,t,G,null,i,ne);for(he in i)ne=i[he],ae=n[he],!i.hasOwnProperty(he)||ne===ae||ne==null&&ae==null||Qt(e,t,he,ne,i,ae)}function Jg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Wy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var u=n[i],f=u.transferSize,_=u.initiatorType,S=u.duration;if(f&&S&&Jg(_)){for(_=0,S=u.responseEnd,i+=1;i<n.length;i++){var M=n[i],J=M.startTime;if(J>S)break;var oe=M.transferSize,he=M.initiatorType;oe&&Jg(he)&&(M=M.responseEnd,_+=oe*(M<S?1:(S-J)/(M-J)))}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 yh=null,vh=null;function of(e){return e.nodeType===9?e:e.ownerDocument}function Pg(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 Wg(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 jh(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 Sh=null;function e0(){var e=window.event;return e&&e.type==="popstate"?e===Sh?!1:(Sh=e,!0):(Sh=null,!1)}var ex=typeof setTimeout=="function"?setTimeout:void 0,t0=typeof clearTimeout=="function"?clearTimeout:void 0,tx=typeof Promise=="function"?Promise:void 0,n0=typeof queueMicrotask=="function"?queueMicrotask:typeof tx<"u"?function(e){return tx.resolve(null).then(e).catch(l0)}:ex;function l0(e){setTimeout(function(){throw e})}function Si(e){return e==="head"}function nx(e,t){var n=t,i=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(u),mc(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Lo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Lo(n);for(var f=n.firstChild;f;){var _=f.nextSibling,S=f.nodeName;f[Xn]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=_}}else n==="body"&&Lo(e.ownerDocument.body);n=u}while(n);mc(t)}function lx(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function wh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":wh(n),kl(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function s0(e,t,n,i){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Xn])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=ds(e.nextSibling),e===null)break}return null}function a0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ds(e.nextSibling),e===null))return null;return e}function sx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ds(e.nextSibling),e===null))return null;return e}function Nh(e){return e.data==="$?"||e.data==="$~"}function kh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ds(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 Eh=null;function ax(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ds(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function ix(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function rx(e,t,n){switch(t=of(n),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 Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);kl(e)}var hs=new Map,cx=new Set;function uf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ya=ue.d;ue.d={f:r0,r:c0,D:o0,C:u0,L:f0,m:d0,X:p0,S:h0,M:m0};function r0(){var e=Ya.f(),t=ef();return e||t}function c0(e){var t=El(e);t!==null&&t.tag===5&&t.type==="form"?Nm(t):Ya.r(e)}var dc=typeof document>"u"?null:document;function ox(e,t,n){var i=dc;if(i&&typeof t=="string"&&t){var u=Nn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),cx.has(u)||(cx.add(u),e={rel:e,crossOrigin:n,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),sl(t,"link",e),mt(t),i.head.appendChild(t)))}}function o0(e){Ya.D(e),ox("dns-prefetch",e,null)}function u0(e,t){Ya.C(e,t),ox("preconnect",e,t)}function f0(e,t,n){Ya.L(e,t,n);var i=dc;if(i&&e&&t){var u='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Nn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Nn(n.imageSizes)+'"]')):u+='[href="'+Nn(e)+'"]';var f=u;switch(t){case"style":f=hc(e);break;case"script":f=pc(e)}hs.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),hs.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(zo(f))||t==="script"&&i.querySelector(Uo(f))||(t=i.createElement("link"),sl(t,"link",e),mt(t),i.head.appendChild(t)))}}function d0(e,t){Ya.m(e,t);var n=dc;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Nn(i)+'"][href="'+Nn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=pc(e)}if(!hs.has(f)&&(e=j({rel:"modulepreload",href:e},t),hs.set(f,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Uo(f)))return}i=n.createElement("link"),sl(i,"link",e),mt(i),n.head.appendChild(i)}}}function h0(e,t,n){Ya.S(e,t,n);var i=dc;if(i&&e){var u=Rt(i).hoistableStyles,f=hc(e);t=t||"default";var _=u.get(f);if(!_){var S={loading:0,preload:null};if(_=i.querySelector(zo(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=hs.get(f))&&Th(e,n);var M=_=i.createElement("link");mt(M),sl(M,"link",e),M._p=new Promise(function(J,oe){M.onload=J,M.onerror=oe}),M.addEventListener("load",function(){S.loading|=1}),M.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ff(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:S},u.set(f,_)}}}function p0(e,t){Ya.X(e,t);var n=dc;if(n&&e){var i=Rt(n).hoistableScripts,u=pc(e),f=i.get(u);f||(f=n.querySelector(Uo(u)),f||(e=j({src:e,async:!0},t),(t=hs.get(u))&&Ch(e,t),f=n.createElement("script"),mt(f),sl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function m0(e,t){Ya.M(e,t);var n=dc;if(n&&e){var i=Rt(n).hoistableScripts,u=pc(e),f=i.get(u);f||(f=n.querySelector(Uo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=hs.get(u))&&Ch(e,t),f=n.createElement("script"),mt(f),sl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function ux(e,t,n,i){var u=(u=Ae.current)?uf(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=hc(n.href),n=Rt(u).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=hc(n.href);var f=Rt(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(zo(e)))&&!f._p&&(_.instance=f,_.state.loading=5),hs.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hs.set(e,n),f||g0(u,e,n,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=pc(n),n=Rt(u).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function hc(e){return'href="'+Nn(e)+'"'}function zo(e){return'link[rel="stylesheet"]['+e+"]"}function fx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function g0(e,t,n,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}),sl(t,"link",n),mt(t),e.head.appendChild(t))}function pc(e){return'[src="'+Nn(e)+'"]'}function Uo(e){return"script[async]"+e}function dx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Nn(n.href)+'"]');if(i)return t.instance=i,mt(i),i;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),mt(i),sl(i,"style",u),ff(i,n.precedence,e),t.instance=i;case"stylesheet":u=hc(n.href);var f=e.querySelector(zo(u));if(f)return t.state.loading|=4,t.instance=f,mt(f),f;i=fx(n),(u=hs.get(u))&&Th(i,u),f=(e.ownerDocument||e).createElement("link"),mt(f);var _=f;return _._p=new Promise(function(S,M){_.onload=S,_.onerror=M}),sl(f,"link",i),t.state.loading|=4,ff(f,n.precedence,e),t.instance=f;case"script":return f=pc(n.src),(u=e.querySelector(Uo(f)))?(t.instance=u,mt(u),u):(i=n,(u=hs.get(f))&&(i=j({},n),Ch(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),mt(u),sl(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,ff(i,n.precedence,e));return t.instance}function ff(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,_=0;_<i.length;_++){var S=i[_];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Th(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ch(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var df=null;function hx(e,t,n){if(df===null){var i=new Map,u=df=new Map;u.set(n,i)}else u=df,i=u.get(n),i||(i=new Map,u.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Xn]||f[en]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var _=f.getAttribute(t)||"";_=e+_;var S=i.get(_);S?S.push(f):i.set(_,[f])}}return i}function px(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function x0(e,t,n){if(n===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 mx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b0(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=hc(i.href),f=t.querySelector(zo(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=hf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,mt(f);return}f=t.ownerDocument||t,i=fx(i),(u=hs.get(u))&&Th(i,u),f=f.createElement("link"),mt(f);var _=f;_._p=new Promise(function(S,M){_.onload=S,_.onerror=M}),sl(f,"link",i),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=hf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ah=0;function _0(e,t){return e.stylesheets&&e.count===0&&mf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&mf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Ah===0&&(Ah=62500*Wy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function hf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var pf=null;function mf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,pf=new Map,t.forEach(y0,e),pf=null,hf.call(e))}function y0(e,t){if(!(t.state.loading&4)){var n=pf.get(e);if(n)var i=n.get(null);else{n=new Map,pf.set(e,n);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")&&(n.set(_.dataset.precedence,_),i=_)}i&&n.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),f=n.get(_)||i,f===i&&n.set(null,u),n.set(_,u),this.count++,i=hf.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 Ho={$$typeof:K,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function v0(e,t,n,i,u,f,_,S,M){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=M,this.incompleteTransitions=new Map}function gx(e,t,n,i,u,f,_,S,M,J,oe,he){return e=new v0(e,t,n,_,M,J,oe,he,S),t=1,f===!0&&(t|=24),f=nl(3,null,null,t),e.current=f,f.stateNode=e,t=oi(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:n,cache:t},p(f),e}function xx(e){return e?(e=si,e):si}function bx(e,t,n,i,u,f){u=xx(u),i.context===null?i.context=u:i.pendingContext=u,i=ce(t),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=Te(e,i,t),n!==null&&(Bl(n,e,t),St(n,e,t))}function _x(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Mh(e,t){_x(e,t),(e=e.alternate)&&_x(e,t)}function yx(e){if(e.tag===13||e.tag===31){var t=ka(e,67108864);t!==null&&Bl(t,e,67108864),Mh(e,67108864)}}function vx(e){if(e.tag===13||e.tag===31){var t=ls();t=xs(t);var n=ka(e,t);n!==null&&Bl(n,e,t),Mh(e,t)}}var gf=!0;function j0(e,t,n,i){var u=H.T;H.T=null;var f=ue.p;try{ue.p=2,Rh(e,t,n,i)}finally{ue.p=f,H.T=u}}function S0(e,t,n,i){var u=H.T;H.T=null;var f=ue.p;try{ue.p=8,Rh(e,t,n,i)}finally{ue.p=f,H.T=u}}function Rh(e,t,n,i){if(gf){var u=Dh(i);if(u===null)bh(e,t,i,xf,n),Sx(e,i);else if(N0(u,e,t,n,i))i.stopPropagation();else if(Sx(e,i),t&4&&-1<w0.indexOf(e)){for(;u!==null;){var f=El(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var _=hn(f.pendingLanes);if(_!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;_;){var M=1<<31-It(_);S.entanglements[1]|=M,_&=~M}ta(f),(Dt&6)===0&&(Pu=lt()+500,Ro(0))}}break;case 31:case 13:S=ka(f,2),S!==null&&Bl(S,f,2),ef(),Mh(f,2)}if(f=Dh(i),f===null&&bh(e,t,i,xf,n),f===u)break;u=f}u!==null&&i.stopPropagation()}else bh(e,t,i,null,n)}}function Dh(e){return e=le(e),Oh(e)}var xf=null;function Oh(e){if(xf=null,e=Et(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xf=e,null}function jx(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(Bt()){case Jn:return 2;case Mt:return 8;case Wt:case rl:return 32;case wn:return 268435456;default:return 32}default:return 32}}var Lh=!1,wi=null,Ni=null,ki=null,Bo=new Map,Io=new Map,Ei=[],w0="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 Sx(e,t){switch(e){case"focusin":case"focusout":wi=null;break;case"dragenter":case"dragleave":Ni=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":Bo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(t.pointerId)}}function qo(e,t,n,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=El(t),t!==null&&yx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function N0(e,t,n,i,u){switch(t){case"focusin":return wi=qo(wi,e,t,n,i,u),!0;case"dragenter":return Ni=qo(Ni,e,t,n,i,u),!0;case"mouseover":return ki=qo(ki,e,t,n,i,u),!0;case"pointerover":var f=u.pointerId;return Bo.set(f,qo(Bo.get(f)||null,e,t,n,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Io.set(f,qo(Io.get(f)||null,e,t,n,i,u)),!0}return!1}function wx(e){var t=Et(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,wl(e.priority,function(){vx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,wl(e.priority,function(){vx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function bf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);N=i,n.target.dispatchEvent(i),N=null}else return t=El(n),t!==null&&yx(t),e.blockedOn=n,!1;t.shift()}return!0}function Nx(e,t,n){bf(e)&&n.delete(t)}function k0(){Lh=!1,wi!==null&&bf(wi)&&(wi=null),Ni!==null&&bf(Ni)&&(Ni=null),ki!==null&&bf(ki)&&(ki=null),Bo.forEach(Nx),Io.forEach(Nx)}function _f(e,t){e.blockedOn===t&&(e.blockedOn=null,Lh||(Lh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,k0)))}var yf=null;function kx(e){yf!==e&&(yf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){yf===e&&(yf=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Oh(i||n)===null)continue;break}var f=El(n);f!==null&&(e.splice(t,3),t-=3,Dd(f,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function mc(e){function t(M){return _f(M,e)}wi!==null&&_f(wi,e),Ni!==null&&_f(Ni,e),ki!==null&&_f(ki,e),Bo.forEach(t),Io.forEach(t);for(var n=0;n<Ei.length;n++){var i=Ei[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ei.length&&(n=Ei[0],n.blockedOn===null);)wx(n),n.blockedOn===null&&Ei.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var u=n[i],f=n[i+1],_=u[We]||null;if(typeof f=="function")_||kx(n);else if(_){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,_=f[We]||null)S=_.formAction;else if(Oh(u)!==null)continue}else S=_.action;typeof S=="function"?n[i+1]=S:(n.splice(i,3),i-=3),kx(n)}}}function Ex(){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(n,20)}function n(){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(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function zh(e){this._internalRoot=e}vf.prototype.render=zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=ls();bx(n,i,e,t,null,null)},vf.prototype.unmount=zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bx(e.current,2,null,e,null,null),ef(),t[Mn]=null}};function vf(e){this._internalRoot=e}vf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yl();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ei.length&&t!==0&&t<Ei[n].priority;n++);Ei.splice(n,0,e),n===0&&wx(e)}};var Tx=s.version;if(Tx!=="19.2.8")throw Error(c(527,Tx,"19.2.8"));ue.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=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var E0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jf.isDisabled&&jf.supportsFiber)try{on=jf.inject(E0),st=jf}catch{}}return Yo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,i="",u=Lm,f=zm,_=Um;return t!=null&&(t.unstable_strictMode===!0&&(n=!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=gx(e,1,!1,null,null,n,i,null,u,f,_,Ex),e[Mn]=t.current,xh(e),new zh(t)},Yo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",f=Lm,_=zm,S=Um,M=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(_=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(M=n.formState)),t=gx(e,1,!0,t,n??null,i,u,M,f,_,S,Ex),t.context=xx(null),n=t.current,i=ls(),i=xs(i),u=ce(i),u.callback=null,Te(n,u,i),n=i,t.current.lanes=n,$n(t,n),ta(t),e[Mn]=t.current,xh(e),new vf(t)},Yo.version="19.2.8",Yo}var Bx;function B0(){if(Bx)return Ih.exports;Bx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Ih.exports=H0(),Ih.exports}var I0=B0();const d_=1;function q0(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${h_(l)}`}function G0(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${h_(l)}`,c=q0(l);return[s,r].filter(o=>o!==c)}function h_(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return Y0(s?l.toLowerCase():l)}function Y0(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}var Va,Tc,Cc,Ac,Mc,ru,Rc,sd,p_;class $0{constructor(s){mn(this,sd);mn(this,Va,null);mn(this,Tc,new Set);mn(this,Cc,500);mn(this,Ac,null);mn(this,Mc,!1);mn(this,ru,null);mn(this,Rc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Ot(this,Rc,s)}connect(){if(Qe(this,Mc))return;const s=new WebSocket(this.url);Ot(this,Va,s),s.addEventListener("open",()=>{var r,c;Ot(this,Cc,500),this.send({type:"hello",protocol:d_,clientName:"ccv-web"}),(r=Qe(this,ru))==null||r.call(this),(c=Qe(this,Rc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Qe(this,Tc))o(c)}),s.addEventListener("close",()=>{var r;Ot(this,Va,null),(r=Qe(this,Rc))==null||r.call(this),Hn(this,sd,p_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Ot(this,ru,s)}on(s){return Qe(this,Tc).add(s),()=>Qe(this,Tc).delete(s)}send(s){var r;((r=Qe(this,Va))==null?void 0:r.readyState)===WebSocket.OPEN&&Qe(this,Va).send(JSON.stringify(s))}get connected(){var s;return((s=Qe(this,Va))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Ot(this,Mc,!0),(s=Qe(this,Va))==null||s.close()}}Va=new WeakMap,Tc=new WeakMap,Cc=new WeakMap,Ac=new WeakMap,Mc=new WeakMap,ru=new WeakMap,Rc=new WeakMap,sd=new WeakSet,p_=function(){if(Qe(this,Mc)||Qe(this,Ac)!==null)return;const s=Qe(this,Cc);Ot(this,Cc,Math.min(s*2,1e4)),Ot(this,Ac,window.setTimeout(()=>{Ot(this,Ac,null),this.connect()},s))};const X0=1,m_="ccv:relay",Bf="ccv:relay.host";function V0(){try{const l=localStorage.getItem(m_);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function g_(){localStorage.removeItem(m_)}var oa,Dc,ua,Oc,Lc,Ui,vr,jr,Hi,Sr,zc,wr,Nr,sn,Mi,rp,x_,_r,cp;class Q0{constructor(s){mn(this,sn);mn(this,oa,null);mn(this,Dc,new Set);mn(this,ua,null);mn(this,Oc,null);mn(this,Lc,500);mn(this,Ui,null);mn(this,vr,!1);mn(this,jr,!1);mn(this,Hi,!1);mn(this,Sr,null);mn(this,zc,"Подключаемся…");mn(this,wr,0);mn(this,Nr,[]);this.session=s}get connected(){return Qe(this,jr)&&Qe(this,Hi)}get statusText(){return Qe(this,zc)}get hostId(){return Qe(this,Sr)}on(s){return Qe(this,Dc).add(s),()=>Qe(this,Dc).delete(s)}onReconnect(s){Ot(this,Oc,s)}onStatus(s){Ot(this,ua,s)}connect(){Qe(this,vr)||Hn(this,sn,rp).call(this)}send(s){if(!Qe(this,jr)){Qe(this,Nr).length<64&&Qe(this,Nr).push(s);return}Hn(this,sn,_r).call(this,{t:"client.frame",body:s})}close(){var s;Ot(this,vr,!0),Qe(this,Ui)!==null&&window.clearTimeout(Qe(this,Ui)),(s=Qe(this,oa))==null||s.close()}}oa=new WeakMap,Dc=new WeakMap,ua=new WeakMap,Oc=new WeakMap,Lc=new WeakMap,Ui=new WeakMap,vr=new WeakMap,jr=new WeakMap,Hi=new WeakMap,Sr=new WeakMap,zc=new WeakMap,wr=new WeakMap,Nr=new WeakMap,sn=new WeakSet,Mi=function(s){var r;Qe(this,zc)!==s&&(Ot(this,zc,s),(r=Qe(this,ua))==null||r.call(this))},rp=async function(){if(Qe(this,oa))return;if(!Qe(this,Sr))try{Ot(this,Sr,await K0(this.session.token))}catch(c){Hn(this,sn,Mi).call(this,c instanceof Error?c.message:String(c)),Hn(this,sn,cp).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);Ot(this,oa,r),r.addEventListener("open",()=>{Hn(this,sn,_r).call(this,{t:"client.hello",protocol:X0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Hn(this,sn,x_).call(this,o)}),r.addEventListener("close",()=>{var c;Ot(this,oa,null),Ot(this,jr,!1),Ot(this,Hi,!1),Hn(this,sn,Mi).call(this,"Нет связи с сервером"),(c=Qe(this,ua))==null||c.call(this),Hn(this,sn,cp).call(this)}),r.addEventListener("error",()=>r.close())},x_=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":Ot(this,Lc,500),Hn(this,sn,_r).call(this,{t:"client.attach",hostId:Qe(this,Sr)??"",...Qe(this,wr)>0?{sinceRseq:Qe(this,wr)}:{}});return;case"client.attached":Ot(this,jr,!0),Ot(this,Hi,s.online),Ot(this,wr,s.rseq),Hn(this,sn,Mi).call(this,s.online?"Хост на связи":"Компьютер не на связи"),Hn(this,sn,_r).call(this,{t:"client.frame",body:{type:"hello",protocol:d_,clientName:"ccv-web-relay"}});const x=Qe(this,Nr);Ot(this,Nr,[]);for(const y of x)Hn(this,sn,_r).call(this,{t:"client.frame",body:y});(r=Qe(this,Oc))==null||r.call(this),(c=Qe(this,ua))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Ot(this,wr,s.rseq);const y=s.body;for(const j of Qe(this,Dc))j(y);return}case"host.online":Ot(this,Hi,!0),Hn(this,sn,Mi).call(this,"Хост на связи"),(o=Qe(this,Oc))==null||o.call(this),(d=Qe(this,ua))==null||d.call(this);return;case"host.offline":Ot(this,Hi,!1),Hn(this,sn,Mi).call(this,"Компьютер не на связи"),(h=Qe(this,ua))==null||h.call(this);return;case"ping":Hn(this,sn,_r).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){g_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Bf),Hn(this,sn,Mi).call(this,"Этот компьютер отвязан от аккаунта"),Ot(this,vr,!0),(m=Qe(this,oa))==null||m.close();return}s.code!=="offline"&&Hn(this,sn,Mi).call(this,s.message),(g=Qe(this,ua))==null||g.call(this);return}},_r=function(s){var r;((r=Qe(this,oa))==null?void 0:r.readyState)===WebSocket.OPEN&&Qe(this,oa).send(JSON.stringify(s))},cp=function(){if(Qe(this,vr)||Qe(this,Ui)!==null)return;const s=Qe(this,Lc);Ot(this,Lc,Math.min(s*2,1e4)),Ot(this,Ui,window.setTimeout(()=>{Ot(this,Ui,null),Hn(this,sn,rp).call(this)},s))};async function K0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Bf,s),s;const r=localStorage.getItem(Bf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw g_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Bf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function If(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const Z0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function F0(){if(If()==="local")return new $0(Z0);const l=V0();return l?new Q0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const b_="ccv:drafts",J0=40,P0=2e4,W0=500;let Wo=null,eu=null;function Ep(){if(Wo)return Wo;const l=new Map;try{const s=localStorage.getItem(b_);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return Wo=l,window.addEventListener("pagehide",v_),l}function $h(l){return Ep().get(l)??""}function __(l,s){const r=Ep(),c=s.slice(0,P0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>J0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}nv(),tv()}function y_(){const l=new Set;for(const s of Ep().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const op=new Set;let Ix="";function ev(l){return op.add(l),()=>op.delete(l)}function tv(){const l=y_(),s=l.join(`
51
- `);if(s!==Ix){Ix=s;for(const r of op)r(l)}}function nv(){eu===null&&(eu=window.setTimeout(v_,W0))}function v_(){if(eu!==null&&window.clearTimeout(eu),eu=null,!!Wo)try{localStorage.setItem(b_,JSON.stringify(Object.fromEntries(Wo)))}catch{}}const vl={items:[],pending:[],lastSeq:0,contextTokens:null},Xh={entries:[],total:0,loading:!1};function j_(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function qx(l){return l.total>0&&j_(l)>1}function lv(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function sv(l){return qf(vl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function qf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...av(r,c.event,c.seq),lastSeq:c.seq});return r}function av(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return na(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return na(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return gc(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?na(l,m):gc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return na(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return gc(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?na(l,m):gc(l,h,m)}case"tool.use":return na(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return gc(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return gc({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:na({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return na({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:na(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return na(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function iv(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function rv(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function na(l,s){return{...l,items:[...l.items,s]}}function gc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const up="ccv:theme",Vh=["system","light","dark"];function cv(){const[l,s]=b.useState(ov);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=b.useCallback(o=>{try{localStorage.setItem(up,o)}catch{}s(o)},[]),c=b.useCallback(()=>{s(o=>{const d=Vh[(Vh.indexOf(o)+1)%Vh.length];try{localStorage.setItem(up,d)}catch{}return d})},[]);return[l,r,c]}function ov(){try{const l=localStorage.getItem(up);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const S_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],uv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],kr={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:"вопроса"}},fv=320,w_="ccv:panes";function dv(l){return`--${l}-w`}function N_(l,s){const r=kr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function hv(){const l={};for(const s of Object.keys(kr))l[s]=kr[s].width;try{const s=localStorage.getItem(w_);if(s){const r=JSON.parse(s);for(const c of Object.keys(kr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=N_(c,o))}}}catch{}return l}function pv(){const[l,s]=b.useState(hv),r=b.useCallback(h=>{try{localStorage.setItem(w_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,m)=>{s(g=>{const x=N_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=b.useCallback(h=>{s(m=>{const g={...m,[h]:kr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(kr))d[dv(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Qh=260,k_=120,mv=200,Gx="ccv:terminal-h";function Yx(l,s){return Math.round(Math.min(s,Math.max(k_,l)))}function gv(){const[l,s]=b.useState(()=>{try{const d=localStorage.getItem(Gx);if(d){const h=Number(d);if(Number.isFinite(h))return Yx(h,1/0)}}catch{}return Qh}),r=b.useCallback(d=>{try{localStorage.setItem(Gx,String(d))}catch{}},[]),c=b.useCallback((d,h)=>{const m=Yx(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=b.useCallback(()=>{s(Qh),r(Qh)},[r]);return{height:l,setHeight:c,reset:o}}function ad(l){const[s,r]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return b.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const xv=500,bv=6;function E_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=xv,moveCancelPx:o=bv}){const d=b.useRef(null),[h,m]=b.useState(!1),g=b.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=b.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),l()},c),d.current=A,m(!0)},[r,c,l]),y=b.useCallback(C=>{const A=d.current;!A||A.fired||Math.hypot(C.clientX-A.x,C.clientY-A.y)>o&&g()},[o,g]),j=b.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=b.useCallback(C=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,C.preventDefault();return}if(!r){if(C.shiftKey){l();return}s()}},[r,s,l]),T=b.useCallback(C=>{C.preventDefault()},[]),w=b.useCallback(C=>{r||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:T,onKeyDown:w}}}const _v={height:0,offsetTop:0,offsetLeft:0};function $x(){if(typeof window>"u")return _v;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function yv(l){const[s,r]=b.useState($x);return b.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=$x();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))},[l]),s}function Tp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ar=Tp();function T_(l){Ar=l}var yr={exec:()=>null};function xc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function Nt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(fl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var vv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),fl={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:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:xc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:xc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:xc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:xc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:xc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:xc(l=>new RegExp(`^ {0,${l}}>`))},jv=/^(?:[ \t]*(?:\n|$))+/,Sv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Nv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Cp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,C_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,A_=Nt(C_).replace(/bull/g,Cp).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(),kv=Nt(C_).replace(/bull/g,Cp).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(),Ap=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ev=/^[^\n]+/,Mp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Tv=Nt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Mp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Cv=Nt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Cp).getRegex(),id="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",Rp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Av=Nt("^ {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",Rp).replace("tag",id).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M_=l=>Nt(Ap).replace("hr",cu).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",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",id).getRegex(),Mv=M_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Rv=M_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Dv=Nt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Rv).getRegex(),Dp={blockquote:Dv,code:Sv,def:Tv,fences:wv,heading:Nv,hr:cu,html:Av,lheading:A_,list:Cv,newline:jv,paragraph:Mv,table:yr,text:Ev},Xx=Nt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",cu).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",id).getRegex(),Ov={...Dp,lheading:kv,table:Xx,paragraph:Nt(Ap).replace("hr",cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xx).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",id).getRegex()},Lv={...Dp,html:Nt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rp).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:Nt(Ap).replace("hr",cu).replace("heading",` *#{1,6} *[^
52
- ]`).replace("lheading",A_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Uv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,R_=/^( {2,}|\\)\n(?!\s*$)/,Hv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hc=/[\p{P}\p{S}]/u,rd=/[\s\p{P}\p{S}]/u,Op=/[^\s\p{P}\p{S}]/u,Bv=Nt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,rd).getRegex(),D_=/(?!~)[\p{P}\p{S}]/u,Iv=/(?!~)[\s\p{P}\p{S}]/u,qv=/(?:[^\s\p{P}\p{S}]|~)/u,Gv=Nt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",vv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),O_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Yv=Nt(O_,"u").replace(/punct/g,Hc).getRegex(),$v=Nt(O_,"u").replace(/punct/g,D_).getRegex(),L_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xv=Nt(L_,"gu").replace(/notPunctSpace/g,Op).replace(/punctSpace/g,rd).replace(/punct/g,Hc).getRegex(),Vv=Nt(L_,"gu").replace(/notPunctSpace/g,qv).replace(/punctSpace/g,Iv).replace(/punct/g,D_).getRegex(),Qv=Nt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Op).replace(/punctSpace/g,rd).replace(/punct/g,Hc).getRegex(),Kv=Nt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Hc).getRegex(),Zv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Fv=Nt(Zv,"gu").replace(/notPunctSpace/g,Op).replace(/punctSpace/g,rd).replace(/punct/g,Hc).getRegex(),Jv=Nt(/\\(punct)/,"gu").replace(/punct/g,Hc).getRegex(),Pv=Nt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wv=Nt(Rp).replace("(?:-->|$)","-->").getRegex(),e1=Nt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Wv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,t1=Nt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),z_=Nt(/^!?\[(label)\]\[(ref)\]/).replace("label",Kf).replace("ref",Mp).getRegex(),U_=Nt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Mp).getRegex(),n1=Nt("reflink|nolink(?!\\()","g").replace("reflink",z_).replace("nolink",U_).getRegex(),Vx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Lp={_backpedal:yr,anyPunctuation:Jv,autolink:Pv,blockSkip:Gv,br:R_,code:Uv,del:yr,delLDelim:yr,delRDelim:yr,emStrongLDelim:Yv,emStrongRDelimAst:Xv,emStrongRDelimUnd:Qv,escape:zv,link:t1,nolink:U_,punctuation:Bv,reflink:z_,reflinkSearch:n1,tag:e1,text:Hv,url:yr},l1={...Lp,link:Nt(/^!?\[(label)\]\((.*?)\)/).replace("label",Kf).getRegex(),reflink:Nt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kf).getRegex()},fp={...Lp,emStrongRDelimAst:Vv,emStrongLDelim:$v,delLDelim:Kv,delRDelim:Fv,url:Nt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Vx).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:Nt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Vx).getRegex()},s1={...fp,br:Nt(R_).replace("{2,}","*").getRegex(),text:Nt(fp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Sf={normal:Dp,gfm:Ov,pedantic:Lv},$o={normal:Lp,gfm:fp,breaks:s1,pedantic:l1},a1={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qx=l=>a1[l];function ia(l,s){if(s){if(fl.escapeTest.test(l))return l.replace(fl.escapeReplace,Qx)}else if(fl.escapeTestNoEncode.test(l))return l.replace(fl.escapeReplaceNoEncode,Qx);return l}function Kx(l){try{l=encodeURI(l).replace(fl.percentDecode,"%")}catch{return null}return l}function Zx(l,s){var d;let r=l.replace(fl.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(fl.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(fl.slashPipe,"|");return c}function Ci(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function Fx(l){let s=l.split(`
53
- `),r=s.length-1;for(;r>=0&&fl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
- `)}function i1(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function r1(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Jx(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function c1(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.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 Zf=class{constructor(l){Zt(this,"options");Zt(this,"rules");Zt(this,"lexer");this.options=l||Ar}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:Fx(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=c1(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Ci(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ci(s[0],`
57
- `),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Ci(s[0],`
58
- `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ci(s[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 x=m.join(`
61
- `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
62
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
63
- ${x}`:x,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 T=v,w=T.raw+`
65
- `+r.join(`
66
- `),C=this.blockquote(w);d[d.length-1]=C,c=c.substring(0,c.length-T.raw.length)+C.raw,o=o.substring(0,o.length-T.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){let T=v,w=T.raw+`
67
- `+r.join(`
68
- `),C=this.list(w);d[d.length-1]=C,c=c.substring(0,c.length-v.raw.length)+C.raw,o=o.substring(0,o.length-T.raw.length)+C.raw,r=w.substring(d.at(-1).raw.length).split(`
69
- `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[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(;l;){let g=!1,x="",y="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;x=s[0],l=l.substring(x.length);let j=r1(s[2].split(`
70
- `,1)[0],s[1].length),v=l.split(`
71
- `,1)[0],T=!j.trim(),w=0;if(this.options.pedantic?(w=2,y=j.trimStart()):T?w=s[1].length+1:(w=j.search(this.rules.other.nonSpaceChar),w=w>4?1:w,y=j.slice(w),w+=s[1].length),T&&this.rules.other.blankLine.test(v)&&(x+=v+`
72
- `,l=l.substring(v.length+1),g=!0),!g){let C=this.rules.other.nextBulletRegex(w),A=this.rules.other.hrRegex(w),P=this.rules.other.fencesBeginRegex(w),W=this.rules.other.headingBeginRegex(w),K=this.rules.other.htmlBeginRegex(w),I=this.rules.other.blockquoteBeginRegex(w);for(;l;){let V=l.split(`
73
- `,1)[0],U;if(v=V,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),U=v):U=v.replace(this.rules.other.tabCharGlobal," "),P.test(v)||W.test(v)||K.test(v)||I.test(v)||C.test(v)||A.test(v))break;if(U.search(this.rules.other.nonSpaceChar)>=w||!v.trim())y+=`
74
- `+U.slice(w);else{if(T||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(j)||W.test(j)||A.test(j))break;y+=`
75
- `+v}T=!v.trim(),x+=V+`
76
- `,l=l.substring(V.length+1),j=U.slice(w)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=x}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 x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.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 x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=Fx(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Ci(s[0],`
77
- `),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=Zx(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
78
- `):[],d={type:"table",raw:Ci(s[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(Zx(m,d.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[x]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Ci(s[0],`
80
- `),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
81
- `?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Ci(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=i1(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[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)),Jx(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Jx(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);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,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*l.length+o);(c=x.exec(s))!==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=l.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let T=j.slice(1,-1);return{type:"em",raw:j,text:T,tokens:this.lexer.inlineTokens(T)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[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:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);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,s=s.slice(-1*l.length+o);(c=g.exec(s))!==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 x=[...c[0]][0].length,y=l.slice(0,o+c.index+x+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Us=class dp{constructor(s){Zt(this,"tokens");Zt(this,"options");Zt(this,"state");Zt(this,"inlineQueue");Zt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Ar,this.options.tokenizer=this.options.tokenizer||new Zf,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:fl,block:Sf.normal,inline:$o.normal};this.options.pedantic?(r.block=Sf.pedantic,r.inline=$o.pedantic):this.options.gfm&&(r.block=Sf.gfm,this.options.breaks?r.inline=$o.breaks:r.inline=$o.gfm),this.tokenizer.rules=r}static get rules(){return{block:Sf,inline:$o}}static lex(s,r){return new dp(r).lex(s)}static lexInline(s,r){return new dp(r).inlineTokens(s)}lex(s){s=s.replace(fl.carriageReturn,`
82
- `),this.blockTokens(s,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(s,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(fl.tabCharGlobal," ").replace(fl.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.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},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.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(s)){s=s.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(s)){s=s.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),r.push(g);continue}let x=s;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=s.slice(1),v;this.options.extensions.startBlock.forEach(T=>{v=T.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=s.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){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=x.length!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.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(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,x,y,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,T=>v.includes(T.slice(T.lastIndexOf("[")+1,-1))?"["+"a".repeat(T.length-2)+"]":T))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,T,w)=>{let C=w?w.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(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(w=>(v=w.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let w=r.at(-1);v.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=v.raw,w.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let T=s;if((j=this.options.extensions)!=null&&j.startInline){let w=1/0,C=s.slice(1),A;this.options.extensions.startInline.forEach(P=>{A=P.call({lexer:this},C),typeof A=="number"&&A>=0&&(w=Math.min(w,A))}),w<1/0&&w>=0&&(T=s.substring(0,w+1))}if(v=this.tokenizer.inlineText(T)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let w=r.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=v.raw,w.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},Ff=class{constructor(l){Zt(this,"options");Zt(this,"parser");this.options=l||Ar}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(fl.notSpaceStart))==null?void 0:d[0],o=l.replace(fl.endingNewline,"")+`
96
- `;return c?'<pre><code class="language-'+ia(c)+'">'+(r?o:ia(o,!0))+`</code></pre>
97
- `:"<pre><code>"+(r?o:ia(o,!0))+`</code></pre>
98
- `}blockquote({tokens:l}){return`<blockquote>
99
- ${this.parser.parse(l)}</blockquote>
100
- `}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:s}){return`<h${s}>${this.parser.parseInline(l)}</h${s}>
101
- `}hr(l){return`<hr>
102
- `}list(l){let s=l.ordered,r=l.start,c="";for(let h=0;h<l.items.length;h++){let m=l.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",d=s&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
103
- `+c+"</"+o+`>
104
- `}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
105
- `}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
106
- `}table(l){let s="",r="";for(let o=0;o<l.header.length;o++)r+=this.tablecell(l.header[o]);s+=this.tablerow({text:r});let c="";for(let o=0;o<l.rows.length;o++){let d=l.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
- `+s+`</thead>
109
- `+c+`</table>
110
- `}tablerow({text:l}){return`<tr>
111
- ${l}</tr>
112
- `}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
113
- `}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${ia(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Kx(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+ia(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Kx(l);if(o===null)return ia(r);l=o;let d=`<img src="${l}" alt="${ia(r)}"`;return s&&(d+=` title="${ia(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ia(l.text)}},zp=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Hs=class hp{constructor(s){Zt(this,"options");Zt(this,"renderer");Zt(this,"textRenderer");this.options=s||Ar,this.options.renderer=this.options.renderer||new Ff,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zp}static parse(s,r){return new hp(r).parse(s)}static parseInline(s,r){return new hp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=x||"";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(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=x||"";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 x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Hf,Fo=(Hf=class{constructor(l){Zt(this,"options");Zt(this,"block");this.options=l||Ar}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Us.lex:Us.lexInline}provideParser(l=this.block){return l?Hs.parse:Hs.parseInline}},Zt(Hf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Zt(Hf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Hf),o1=class{constructor(...l){Zt(this,"defaults",Tp());Zt(this,"options",this.setOptions);Zt(this,"parse",this.parseMarkdown(!0));Zt(this,"parseInline",this.parseMarkdown(!1));Zt(this,"Parser",Hs);Zt(this,"Renderer",Ff);Zt(this,"TextRenderer",zp);Zt(this,"Lexer",Us);Zt(this,"Tokenizer",Zf);Zt(this,"Hooks",Fo);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));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,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.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=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.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=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new Ff(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]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new Zf(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]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Fo;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];Fo.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Fo.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,x);return g.call(o,j)})();let y=m.call(o,x);return g.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,x);return j===!1&&(j=await g.apply(o,x)),j})();let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),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(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return Us.lex(l,s??this.defaults)}parser(l,s){return Hs.parse(l,s??this.defaults)}parseMarkdown(l){return(s,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 s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?Us.lex:Us.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(l):l?Hs.parse:Hs.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Us.lex:Us.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Hs.parse:Hs.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
114
- Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+ia(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},Cr=new o1;function Ht(l,s){return Cr.parse(l,s)}Ht.options=Ht.setOptions=function(l){return Cr.setOptions(l),Ht.defaults=Cr.defaults,T_(Ht.defaults),Ht};Ht.getDefaults=Tp;Ht.defaults=Ar;Ht.use=function(...l){return Cr.use(...l),Ht.defaults=Cr.defaults,T_(Ht.defaults),Ht};Ht.walkTokens=function(l,s){return Cr.walkTokens(l,s)};Ht.parseInline=Cr.parseInline;Ht.Parser=Hs;Ht.parser=Hs.parse;Ht.Renderer=Ff;Ht.TextRenderer=zp;Ht.Lexer=Us;Ht.lexer=Us.lex;Ht.Tokenizer=Zf;Ht.Hooks=Fo;Ht.parse=Ht;Ht.options;Ht.setOptions;Ht.use;Ht.walkTokens;Ht.parseInline;Hs.parse;Us.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 Px(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function u1(l){if(Array.isArray(l))return l}function f1(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,x=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(y){x=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function d1(){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 h1(l,s){return u1(l)||f1(l,s)||p1(l,s)||d1()}function p1(l,s){if(l){if(typeof l=="string")return Px(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Px(l,s):void 0}}const H_=Object.entries,Wx=Object.setPrototypeOf,m1=Object.isFrozen,g1=Object.getPrototypeOf,x1=Object.getOwnPropertyDescriptor;let al=Object.freeze,il=Object.seal,vc=Object.create,B_=typeof Reflect<"u"&&Reflect,pp=B_.apply,mp=B_.construct;al||(al=function(s){return s});il||(il=function(s){return s});pp||(pp=function(s,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 s.apply(r,o)});mp||(mp=function(s){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 s(...c)});const bc=Bn(Array.prototype.forEach),b1=Bn(Array.prototype.lastIndexOf),eb=Bn(Array.prototype.pop),_c=Bn(Array.prototype.push),_1=Bn(Array.prototype.splice),zi=Array.isArray,Jo=Bn(String.prototype.toLowerCase),Kh=Bn(String.prototype.toString),tb=Bn(String.prototype.match),Xo=Bn(String.prototype.replace),nb=Bn(String.prototype.indexOf),y1=Bn(String.prototype.trim),v1=Bn(Number.prototype.toString),j1=Bn(Boolean.prototype.toString),lb=typeof BigInt>"u"?null:Bn(BigInt.prototype.toString),sb=typeof Symbol>"u"?null:Bn(Symbol.prototype.toString),Fn=Bn(Object.prototype.hasOwnProperty),Vo=Bn(Object.prototype.toString),Zn=Bn(RegExp.prototype.test),gr=S1(TypeError);function Bn(l){return function(s){s instanceof RegExp&&(s.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 pp(l,s,c)}}function S1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return mp(l,r)}}function wt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jo;if(Wx&&Wx(l,null),!zi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(m1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function w1(l){for(let s=0;s<l.length;s++)Fn(l,s)||(l[s]=null);return l}function jl(l){const s=vc(null);for(const c of H_(l)){var r=h1(c,2);const o=r[0],d=r[1];Fn(l,o)&&(zi(d)?s[o]=w1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=jl(d):s[o]=d)}return s}function N1(l){switch(typeof l){case"string":return l;case"number":return v1(l);case"boolean":return j1(l);case"bigint":return lb?lb(l):"0";case"symbol":return sb?sb(l):"Symbol()";case"undefined":return Vo(l);case"function":case"object":{if(l===null)return Vo(l);const s=l,r=ra(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Vo(c)}return Vo(l)}default:return Vo(l)}}function ra(l,s){for(;l!==null;){const c=x1(l,s);if(c){if(c.get)return Bn(c.get);if(typeof c.value=="function")return Bn(c.value)}l=g1(l)}function r(){return null}return r}function k1(l){try{return Zn(l,""),!0}catch{return!1}}const ab=al(["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"]),Zh=al(["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"]),Fh=al(["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"]),E1=al(["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"]),Jh=al(["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"]),T1=al(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ib=al(["#text"]),rb=al(["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"]),Ph=al(["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"]),cb=al(["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"]),wf=al(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C1=il(/{{[\w\W]*|^[\w\W]*}}/g),A1=il(/<%[\w\W]*|^[\w\W]*%>/g),M1=il(/\${[\w\W]*/g),R1=il(/^data-[\-\w.\u00B7-\uFFFF]+$/),D1=il(/^aria-[\-\w]+$/),ob=il(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),O1=il(/^(?:\w+script|data):/i),L1=il(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),z1=il(/^html$/i),U1=il(/^[a-z][.\w]*(-[.\w]+)+$/i),ub=il(/<[/\w!]/g),fb=il(/<[/\w]/g),H1=il(/<\/no(script|embed|frames)/i),B1=il(/\/>/i),ss={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},I1=function(){return typeof window>"u"?null:window},q1=function(s,r){if(typeof s!="object"||typeof s.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 s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},db=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ai=function(s,r,c,o){return Fn(s,r)&&zi(s[r])?wt(o.base?jl(o.base):{},s[r],o.transform):c};function I_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I1();const s=me=>I_(me);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==ss.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,x=l.NamedNodeMap;x===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const y=l.DOMParser,j=l.trustedTypes,v=m.prototype,T=ra(v,"cloneNode"),w=ra(v,"remove"),C=ra(v,"nextSibling"),A=ra(v,"childNodes"),P=ra(v,"parentNode"),W=ra(v,"shadowRoot"),K=ra(v,"attributes"),I=h&&h.prototype?ra(h.prototype,"nodeType"):null,V=h&&h.prototype?ra(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let U,D="",R,O=!1,ee=0;const B=function(){if(ee>0)throw gr('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.')},Q=function(E){B(),ee++;try{return U.createHTML(E)}finally{ee--}},pe=function(E){B(),ee++;try{return U.createScriptURL(E)}finally{ee--}},Se=function(){return O||(R=q1(j,o),O=!0),R},be=r,H=be.implementation,ue=be.createNodeIterator,ie=be.createDocumentFragment,xe=be.getElementsByTagName,Ce=c.importNode;let k=db();s.isSupported=typeof H_=="function"&&typeof P=="function"&&H&&H.createHTMLDocument!==void 0;const te=C1,q=A1,_e=M1,Y=R1,Ae=D1,Me=O1,Xe=L1,Ue=U1;let bt=ob,Ge=null;const gn=wt({},[...ab,...Zh,...Fh,...Jh,...ib]);let Ke=null;const dt=wt({},[...rb,...Ph,...cb,...wf]);let rt=Object.seal(vc(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}})),ct=null,kt=null;const Lt=Object.seal(vc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let je=!0,ht=!0,_t=!1,rn=!0,pt=!1,lt=!0,Bt=!1,Jn=!1,Mt=null,Wt=null,rl=!1,wn=!1,cn=!1,Pn=!1,on=!0,st=!1;const ot="user-content-";let It=!0,Yn=!1,re={},ve=null;const Be=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 Fe=null;const Ze=wt({},["audio","video","img","source","image","track"]);let hn=null;const X=wt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),de="http://www.w3.org/1998/Math/MathML",ke="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let yt=Le,$n=!1,hl=null;const as=wt({},[de,ke,Le],Kh),ql=al(["mi","mo","mn","ms","mtext"]);let Sl=wt({},ql);const xs=al(["annotation-xml"]);let Gl=wt({},xs);const Yl=wt({},["title","style","font","a","script"]);let wl=null;const Wn=["application/xhtml+xml","text/html"],en="text/html";let We=null,Mn=null;const qs=r.createElement("form"),Nl=function(E){return E instanceof RegExp||E instanceof Function},tn=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Mn&&Mn===E)return;(!E||typeof E!="object")&&(E={}),E=jl(E),wl=Wn.indexOf(E.PARSER_MEDIA_TYPE)===-1?en:E.PARSER_MEDIA_TYPE,We=wl==="application/xhtml+xml"?Kh:Jo,Ge=Ai(E,"ALLOWED_TAGS",gn,{transform:We}),Ke=Ai(E,"ALLOWED_ATTR",dt,{transform:We}),hl=Ai(E,"ALLOWED_NAMESPACES",as,{transform:Kh}),hn=Ai(E,"ADD_URI_SAFE_ATTR",X,{transform:We,base:X}),Fe=Ai(E,"ADD_DATA_URI_TAGS",Ze,{transform:We,base:Ze}),ve=Ai(E,"FORBID_CONTENTS",Be,{transform:We}),ct=Ai(E,"FORBID_TAGS",jl({}),{transform:We}),kt=Ai(E,"FORBID_ATTR",jl({}),{transform:We}),re=Fn(E,"USE_PROFILES")?E.USE_PROFILES&&typeof E.USE_PROFILES=="object"?jl(E.USE_PROFILES):E.USE_PROFILES:!1,je=E.ALLOW_ARIA_ATTR!==!1,ht=E.ALLOW_DATA_ATTR!==!1,_t=E.ALLOW_UNKNOWN_PROTOCOLS||!1,rn=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pt=E.SAFE_FOR_TEMPLATES||!1,lt=E.SAFE_FOR_XML!==!1,Bt=E.WHOLE_DOCUMENT||!1,wn=E.RETURN_DOM||!1,cn=E.RETURN_DOM_FRAGMENT||!1,Pn=E.RETURN_TRUSTED_TYPE||!1,rl=E.FORCE_BODY||!1,on=E.SANITIZE_DOM!==!1,st=E.SANITIZE_NAMED_PROPS||!1,It=E.KEEP_CONTENT!==!1,Yn=E.IN_PLACE||!1,bt=k1(E.ALLOWED_URI_REGEXP)?E.ALLOWED_URI_REGEXP:ob,yt=typeof E.NAMESPACE=="string"?E.NAMESPACE:Le,Sl=Fn(E,"MATHML_TEXT_INTEGRATION_POINTS")&&E.MATHML_TEXT_INTEGRATION_POINTS&&typeof E.MATHML_TEXT_INTEGRATION_POINTS=="object"?jl(E.MATHML_TEXT_INTEGRATION_POINTS):wt({},ql),Gl=Fn(E,"HTML_INTEGRATION_POINTS")&&E.HTML_INTEGRATION_POINTS&&typeof E.HTML_INTEGRATION_POINTS=="object"?jl(E.HTML_INTEGRATION_POINTS):wt({},xs);const $=Fn(E,"CUSTOM_ELEMENT_HANDLING")&&E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING=="object"?jl(E.CUSTOM_ELEMENT_HANDLING):vc(null);if(rt=vc(null),Fn($,"tagNameCheck")&&Nl($.tagNameCheck)&&(rt.tagNameCheck=$.tagNameCheck),Fn($,"attributeNameCheck")&&Nl($.attributeNameCheck)&&(rt.attributeNameCheck=$.attributeNameCheck),Fn($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(rt.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),il(rt),pt&&(ht=!1),cn&&(wn=!0),re&&(Ge=wt({},ib),Ke=vc(null),re.html===!0&&(wt(Ge,ab),wt(Ke,rb)),re.svg===!0&&(wt(Ge,Zh),wt(Ke,Ph),wt(Ke,wf)),re.svgFilters===!0&&(wt(Ge,Fh),wt(Ke,Ph),wt(Ke,wf)),re.mathMl===!0&&(wt(Ge,Jh),wt(Ke,cb),wt(Ke,wf))),Lt.tagCheck=null,Lt.attributeCheck=null,Fn(E,"ADD_TAGS")&&(typeof E.ADD_TAGS=="function"?Lt.tagCheck=E.ADD_TAGS:zi(E.ADD_TAGS)&&(Ge===gn&&(Ge=jl(Ge)),wt(Ge,E.ADD_TAGS,We))),Fn(E,"ADD_ATTR")&&(typeof E.ADD_ATTR=="function"?Lt.attributeCheck=E.ADD_ATTR:zi(E.ADD_ATTR)&&(Ke===dt&&(Ke=jl(Ke)),wt(Ke,E.ADD_ATTR,We))),Fn(E,"ADD_URI_SAFE_ATTR")&&zi(E.ADD_URI_SAFE_ATTR)&&wt(hn,E.ADD_URI_SAFE_ATTR,We),Fn(E,"FORBID_CONTENTS")&&zi(E.FORBID_CONTENTS)&&(ve===Be&&(ve=jl(ve)),wt(ve,E.FORBID_CONTENTS,We)),Fn(E,"ADD_FORBID_CONTENTS")&&zi(E.ADD_FORBID_CONTENTS)&&(ve===Be&&(ve=jl(ve)),wt(ve,E.ADD_FORBID_CONTENTS,We)),It&&(Ge["#text"]=!0),Bt&&wt(Ge,["html","head","body"]),Ge.table&&(wt(Ge,["tbody"]),delete ct.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ge=U;U=E.TRUSTED_TYPES_POLICY;try{D=Q("")}catch(De){throw U=ge,De}}else E.TRUSTED_TYPES_POLICY===null?(U=void 0,D=""):(U===void 0&&(U=Se()),U&&typeof D=="string"&&(D=Q("")));al&&al(E),Mn=E},$l=wt({},[...Zh,...Fh,...E1]),Xn=wt({},[...Jh,...T1]),kl=function(E,$,ge){return $.namespaceURI===Le?E==="svg":$.namespaceURI===de?E==="svg"&&(ge==="annotation-xml"||Sl[ge]):!!$l[E]},Et=function(E,$,ge){return $.namespaceURI===Le?E==="math":$.namespaceURI===ke?E==="math"&&Gl[ge]:!!Xn[E]},El=function(E,$,ge){return $.namespaceURI===ke&&!Gl[ge]||$.namespaceURI===de&&!Sl[ge]?!1:!Xn[E]&&(Yl[E]||!$l[E])},un=function(E){let $=P(E);(!$||!$.tagName)&&($={namespaceURI:yt,tagName:"template"});const ge=Jo(E.tagName),De=Jo($.tagName);return hl[E.namespaceURI]?E.namespaceURI===ke?kl(ge,$,De):E.namespaceURI===de?Et(ge,$,De):E.namespaceURI===Le?El(ge,$,De):!!(wl==="application/xhtml+xml"&&hl[E.namespaceURI]):!1},Rt=function(E){_c(s.removed,{element:E});try{P(E).removeChild(E)}catch{if(w(E),!P(E))throw gr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},mt=function(E){xn(E);const $=A(E);if($){const De=[];bc($,He=>{_c(De,He)}),bc(De,He=>{try{w(He)}catch{}})}const ge=K(E);if(ge)for(let De=ge.length-1;De>=0;--De){const He=ge[De],$e=He&&He.name;if(typeof $e=="string")try{E.removeAttribute($e)}catch{}}},zt=function(E,$){try{_c(s.removed,{attribute:$.getAttributeNode(E),from:$})}catch{_c(s.removed,{attribute:null,from:$})}if($.removeAttribute(E),E==="is")if(wn||cn)try{Rt($)}catch{}else try{$.setAttribute(E,"")}catch{}},Vn=function(E){const $=K(E);if($)for(let ge=$.length-1;ge>=0;--ge){const De=$[ge],He=De&&De.name;if(!(typeof He!="string"||Ke[We(He)]))try{E.removeAttribute(He)}catch{}}},xn=function(E){const $=[E];for(;$.length>0;){const ge=$.pop();(I?I(ge):ge.nodeType)===ss.element&&Vn(ge);const He=A(ge);if(He)for(let $e=He.length-1;$e>=0;--$e)$.push(He[$e])}},Rn=function(E){if(!lt)return;const $=[E];for(;$.length>0;){const ge=$.pop(),De=I?I(ge):ge.nodeType;if(De===ss.processingInstruction||De===ss.comment&&Zn(fb,ge.data)){try{w(ge)}catch{}continue}if(De===ss.element){const $e=ge,Tt=We(V?V(ge):ge.nodeName);try{$e.hasAttribute&&$e.hasAttribute("patchsrc")&&$e.removeAttribute("patchsrc"),$e.hasAttribute&&$e.hasAttribute("for")&&Tt!=="label"&&Tt!=="output"&&$e.removeAttribute("for")}catch{}}const He=A(ge);if(He)for(let $e=He.length-1;$e>=0;--$e)$.push(He[$e])}},is=function(E){let $=null,ge=null;if(rl)E="<remove></remove>"+E;else{const $e=tb(E,/^[\r\n\t ]+/);ge=$e&&$e[0]}wl==="application/xhtml+xml"&&yt===Le&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");const De=U?Q(E):E;if(yt===Le)try{$=new y().parseFromString(De,wl)}catch{}if(!$||!$.documentElement){$=H.createDocument(yt,"template",null);try{$.documentElement.innerHTML=$n?D:De}catch{}}const He=$.body||$.documentElement;return E&&ge&&He.insertBefore(r.createTextNode(ge),He.childNodes[0]||null),yt===Le?xe.call($,Bt?"html":"body")[0]:Bt?$.documentElement:He},Xl=function(E){return ue.call(E.ownerDocument||E,E,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},bn=function(E){return E=Xo(E,te," "),E=Xo(E,q," "),E=Xo(E,_e," "),E},pn=function(E){var $;E.normalize();const ge=ue.call(E.ownerDocument||E,E,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let De=ge.nextNode();for(;De;)De.data=bn(De.data),De=ge.nextNode();const He=($=E.querySelectorAll)===null||$===void 0?void 0:$.call(E,"template");He&&bc(He,$e=>{qt($e.content)&&pn($e.content)})},el=function(E){const $=V?V(E):null;return typeof $!="string"||We($)!=="form"?!1:typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||E.attributes!==K(E)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function"||E.nodeType!==I(E)||E.childNodes!==A(E)},qt=function(E){if(!I||typeof E!="object"||E===null)return!1;try{return I(E)===ss.documentFragment}catch{return!1}},Dn=function(E){if(!I||typeof E!="object"||E===null)return!1;try{return typeof I(E)=="number"}catch{return!1}};function Gt(me,E,$){me.length!==0&&bc(me,ge=>{ge.call(s,E,$,Mn)})}const bs=function(E,$){return!!(lt&&E.hasChildNodes()&&!Dn(E.firstElementChild)&&Zn(ub,E.textContent)&&Zn(ub,E.innerHTML)||lt&&E.namespaceURI===Le&&$==="style"&&Dn(E.firstElementChild)||E.nodeType===ss.processingInstruction||lt&&E.nodeType===ss.comment&&Zn(fb,E.data))},qi=function(E,$){if(!ct[$]&&Ql($)&&(rt.tagNameCheck instanceof RegExp&&Zn(rt.tagNameCheck,$)||rt.tagNameCheck instanceof Function&&rt.tagNameCheck($)))return!1;if(It&&!ve[$]){const ge=P(E),De=A(E);if(De&&ge){const He=De.length;for(let $e=He-1;$e>=0;--$e){const Tt=Yn?De[$e]:T(De[$e],!0);ge.insertBefore(Tt,C(E))}}}return Rt(E),!0},Vl=function(E,$){if(Gt(k.beforeSanitizeElements,E,null),E!==$&&P(E)===null)return!0;if(el(E))return Rt(E),!0;const ge=We(V?V(E):E.nodeName);if(Gt(k.uponSanitizeElement,E,{tagName:ge,allowedTags:Ge}),E!==$&&P(E)===null)return!0;if(bs(E,ge))return Rt(E),!0;if(ct[ge]||!(Lt.tagCheck instanceof Function&&Lt.tagCheck(ge))&&!Ge[ge]){const He=qi(E,ge);return He===!1&&Gt(k.afterSanitizeElements,E,null),He}if((I?I(E):E.nodeType)===ss.element&&!un(E)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Zn(H1,E.innerHTML))return Rt(E),!0;if(pt&&E.nodeType===ss.text){const He=bn(E.textContent);E.textContent!==He&&(_c(s.removed,{element:E.cloneNode()}),E.textContent=He)}return Gt(k.afterSanitizeElements,E,null),!1},_s=function(E,$,ge){if(kt[$]||lt&&$==="patchsrc"||lt&&$==="for"&&E!=="label"&&E!=="output"||on&&($==="id"||$==="name")&&(ge in r||ge in qs))return!1;const De=Ke[$]||Lt.attributeCheck instanceof Function&&Lt.attributeCheck($,E);if(!(ht&&Zn(Y,$))){if(!(je&&Zn(Ae,$))){if(De){if(!hn[$]){if(!Zn(bt,Xo(ge,Xe,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&E!=="script"&&nb(ge,"data:")===0&&Fe[E])){if(!(_t&&!Zn(Me,Xo(ge,Xe,"")))){if(ge)return!1}}}}}else if(!(Ql(E)&&(rt.tagNameCheck instanceof RegExp&&Zn(rt.tagNameCheck,E)||rt.tagNameCheck instanceof Function&&rt.tagNameCheck(E))&&(rt.attributeNameCheck instanceof RegExp&&Zn(rt.attributeNameCheck,$)||rt.attributeNameCheck instanceof Function&&rt.attributeNameCheck($,E))||$==="is"&&rt.allowCustomizedBuiltInElements&&(rt.tagNameCheck instanceof RegExp&&Zn(rt.tagNameCheck,ge)||rt.tagNameCheck instanceof Function&&rt.tagNameCheck(ge))))return!1}}return!0},_n=wt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ql=function(E){return!_n[Jo(E)]&&Zn(Ue,E)},Nn=function(E,$,ge,De){if(U&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ge)switch(j.getAttributeType(E,$)){case"TrustedHTML":return Q(De);case"TrustedScriptURL":return pe(De)}return De},ys=function(E,$,ge,De){try{ge?E.setAttributeNS(ge,$,De):E.setAttribute($,De),el(E)?Rt(E):eb(s.removed)}catch{zt($,E)}},rs=function(E){Gt(k.beforeSanitizeAttributes,E,null);const $=E.attributes;if(!$||el(E))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ke,forceKeepAttr:void 0};let De=$.length;const He=We(E.nodeName);for(;De--;){const $e=$[De],Tt=$e.name,jt=$e.namespaceURI,Ft=$e.value,vt=We(Tt),N=Ft;let le=Tt==="value"?N:y1(N);if(ge.attrName=vt,ge.attrValue=le,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Gt(k.uponSanitizeAttribute,E,ge),le=ge.attrValue,st&&(vt==="id"||vt==="name")&&nb(le,ot)!==0&&(zt(Tt,E),le=ot+le),lt&&Zn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,le)){zt(Tt,E);continue}if(vt==="attributename"&&tb(le,"href")){zt(Tt,E);continue}if(!ge.forceKeepAttr){if(!ge.keepAttr){zt(Tt,E);continue}if(!rn&&Zn(B1,le)){zt(Tt,E);continue}if(pt&&(le=bn(le)),!_s(He,vt,le)){zt(Tt,E);continue}le=Nn(He,vt,jt,le),le!==N&&ys(E,Tt,jt,le)}}Gt(k.afterSanitizeAttributes,E,null)},cs=function(E){let $=null;const ge=Xl(E);for(Gt(k.beforeSanitizeShadowDOM,E,null);$=ge.nextNode();)if(Gt(k.uponSanitizeShadowNode,$,null),Vl($,E),rs($),qt($.content)&&cs($.content),(I?I($):$.nodeType)===ss.element){const He=W($);qt(He)&&(Tl(He),cs(He))}Gt(k.afterSanitizeShadowDOM,E,null)},Tl=function(E){const $=[{node:E,shadow:null}];for(;$.length>0;){const ge=$.pop();if(ge.shadow){cs(ge.shadow);continue}const De=ge.node,$e=(I?I(De):De.nodeType)===ss.element,Tt=A(De);if(Tt)for(let jt=Tt.length-1;jt>=0;--jt)$.push({node:Tt[jt],shadow:null});if($e){const jt=V?V(De):null;if(typeof jt=="string"&&We(jt)==="template"){const Ft=De.content;qt(Ft)&&$.push({node:Ft,shadow:null})}}if($e){const jt=W(De);qt(jt)&&$.push({node:null,shadow:jt},{node:jt,shadow:null})}}};return s.sanitize=function(me){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,ge=null,De=null,He=null;if($n=!me,$n&&(me="<!-->"),typeof me!="string"&&!Dn(me)&&(me=N1(me),typeof me!="string"))throw gr("dirty is not a string, aborting");if(!s.isSupported)return me;Jn?(Ge=Mt,Ke=Wt):tn(E),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(Ge=jl(Ge)),k.uponSanitizeAttribute.length>0&&(Ke=jl(Ke)),s.removed=[];const $e=Yn&&typeof me!="string"&&Dn(me);if($e){Rn(me);const vt=V?V(me):me.nodeName;if(typeof vt=="string"){const N=We(vt);if(!Ge[N]||ct[N])throw mt(me),gr("root node is forbidden and cannot be sanitized in-place")}if(el(me))throw mt(me),gr("root node is clobbered and cannot be sanitized in-place");try{Tl(me)}catch(N){throw mt(me),N}}else if(Dn(me))$=is("<!---->"),ge=$.ownerDocument.importNode(me,!0),ge.nodeType===ss.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?$=ge:$.appendChild(ge),Tl(ge);else{if(!wn&&!pt&&!Bt&&me.indexOf("<")===-1)return U&&Pn?Q(me):me;if($=is(me),!$)return wn?null:Pn?D:""}$&&rl&&Rt($.firstChild);const Tt=$e?me:$,jt=Xl(Tt);try{for(;De=jt.nextNode();)Vl(De,Tt),rs(De),qt(De.content)&&cs(De.content)}catch(vt){throw $e&&(mt(me),bc(s.removed,N=>{N.element&&xn(N.element)})),vt}if($e)return bc(s.removed,vt=>{vt.element&&xn(vt.element)}),pt&&pn(me),me;if(wn){if(pt&&pn($),cn)for(He=ie.call($.ownerDocument);$.firstChild;)He.appendChild($.firstChild);else He=$;return(Ke.shadowroot||Ke.shadowrootmode)&&(He=Ce.call(c,He,!0)),He}let Ft=Bt?$.outerHTML:$.innerHTML;return Bt&&Ge["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Zn(z1,$.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
116
- `+Ft),pt&&(Ft=bn(Ft)),U&&Pn?Q(Ft):Ft},s.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};tn(me),Jn=!0,Mt=Ge,Wt=Ke},s.clearConfig=function(){Mn=null,Jn=!1,Mt=null,Wt=null,U=R,D=""},s.isValidAttribute=function(me,E,$){Mn||tn({});const ge=We(me),De=We(E);return _s(ge,De,$)},s.addHook=function(me,E){typeof E=="function"&&Fn(k,me)&&_c(k[me],E)},s.removeHook=function(me,E){if(Fn(k,me)){if(E!==void 0){const $=b1(k[me],E);return $===-1?void 0:_1(k[me],$,1)[0]}return eb(k[me])}},s.removeHooks=function(me){Fn(k,me)&&(k[me]=[])},s.removeAllHooks=function(){k=db()},s}var G1=I_();const Y1=1024;let $1=0;class gs{constructor(s,r){this.from=s,this.to=r}}class an{constructor(s={}){this.id=$1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=Is.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}an.closedBy=new an({deserialize:l=>l.split(" ")});an.openedBy=new an({deserialize:l=>l.split(" ")});an.group=new an({deserialize:l=>l.split(" ")});an.isolate=new an({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});an.contextHash=new an({perNode:!0});an.lookAhead=new an({perNode:!0});an.mounted=new an({perNode:!0});class kc{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[an.mounted.id]}}const X1=Object.create(null);class Is{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):X1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Is(s.name||"",r,s.id,c);if(s.props){for(let d of s.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(s){return this.props[s.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(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(an.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(an.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Is.none=new Is("",Object.create(null),0,8);class q_{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){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 Is(c.name,o,c.id,c.flags):c)}return new q_(r)}}const Nf=new WeakMap,hb=new WeakMap;var ln;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(ln||(ln={}));class Il{constructor(s,r,c,o,d){if(this.type=s,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 s=kc.get(this);if(s&&!s.overlay)return s.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(s=0){return new Jf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=Nf.get(this)||this.topNode,d=new Jf(o);return d.moveTo(s,r),Nf.set(this,d._tree),d}get topNode(){return new dl(this,0,0,null)}resolve(s,r=0){let c=su(Nf.get(this)||this.topNode,s,r,!1);return Nf.set(this,c),c}resolveInner(s,r=0){let c=su(hb.get(this)||this.topNode,s,r,!0);return hb.set(this,c),c}resolveStack(s,r=0){return K1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&ln.IncludeAnonymous)>0;for(let g=this.cursor(h|ln.IncludeAnonymous);;){let x=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Bp(Is.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Il(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Il(Is.none,r,c,o)))}static build(s){return Z1(s)}}Il.empty=new Il(Is.none,[],[],0);class Up{constructor(s,r){this.buffer=s,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 Up(this.buffer,this.index)}}class Ii{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return Is.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(G_(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let x=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,x)}return new Ii(d,h,this.set)}}function G_(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function su(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof dl&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:ln.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof dl&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class Y_{cursor(s=0){return new Jf(this,s)}getChild(s,r=null,c=null){let o=pb(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return pb(this,s,r,c)}resolve(s,r=0){return su(this,s,r,!1)}resolveInner(s,r=0){return su(this,s,r,!0)}matchContext(s){return gp(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),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 dl extends Y_{constructor(s,r,c,o){super(),this._tree=s,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(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=r>0?m.length:-1;s!=x;s+=r){let y=m[s],j=g[s]+h.from,v;if(!(!(d&ln.EnterBracketed&&y instanceof Il&&(v=kc.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!G_(o,c,j,j+y.length))){if(y instanceof Ii){if(d&ln.ExcludeBuffers)continue;let T=y.findChild(0,y.buffer.length,r,c-j,o);if(T>-1)return new fa(new V1(h,y,s,j),null,T)}else if(d&ln.IncludeAnonymous||!y.type.isAnonymous||Hp(y)){let T;if(!(d&ln.IgnoreMounts)&&(T=kc.get(y))&&!T.overlay)return new dl(T.tree,j,s,h);let w=new dl(y,j,s,h);return d&ln.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&ln.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=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(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&ln.IgnoreOverlays)&&(o=kc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&ln.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 dl(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}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 pb(l,s,r,c){let o=l.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(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function gp(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class V1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class fa extends Y_{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(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new fa(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&ln.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new fa(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new fa(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new fa(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],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];s.push(c.slice(o,d,h)),r.push(0)}return new Il(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function $_(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof dl&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new Q1(o,r)}class Q1{constructor(s,r){this.heads=s,this.node=r}get next(){return $_(this.heads)}}function K1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof dl?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=kc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new dl(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(su(m,s,r,!1))}}return o?$_(o):c}class Jf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~ln.EnterBracketed,s instanceof dl)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof dl?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,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(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&ln.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ln.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&ln.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<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+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>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+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&ln.IncludeAnonymous||m instanceof Ii||!m.type.isAnonymous||Hp(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;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 fa(this.buffer,r,this.stack[o]);return this.bufferNode=new fa(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(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(s){if(!this.buffer)return gp(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return gp(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Hp(l){return l.children.some(s=>s instanceof Ii||!s.type.isAnonymous||Hp(s))}function Z1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=Y1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Up(r,r.length):r,g=c.types,x=0,y=0;function j(V,U,D,R,O,ee){let{id:B,start:Q,end:pe,size:Se}=m,be=y,H=x;if(Se<0)if(m.next(),Se==-1){let k=d[B];D.push(k),R.push(Q-V);return}else if(Se==-3){x=B;return}else if(Se==-4){y=B;return}else throw new RangeError(`Unrecognized record size: ${Se}`);let ue=g[B],ie,xe,Ce=Q-V;if(pe-Q<=o&&(xe=A(m.pos-U,O))){let k=new Uint16Array(xe.size-xe.skip),te=m.pos-xe.size,q=k.length;for(;m.pos>te;)q=P(xe.start,k,q);ie=new Ii(k,pe-xe.start,c),Ce=xe.start-V}else{let k=m.pos-Se;m.next();let te=[],q=[],_e=B>=h?B:-1,Y=0,Ae=pe;for(;m.pos>k;)_e>=0&&m.id==_e&&m.size>=0?(m.end<=Ae-o&&(w(te,q,Q,Y,m.end,Ae,_e,be,H),Y=te.length,Ae=m.end),m.next()):ee>2500?v(Q,k,te,q):j(Q,k,te,q,_e,ee+1);if(_e>=0&&Y>0&&Y<te.length&&w(te,q,Q,Y,Q,Ae,_e,be,H),te.reverse(),q.reverse(),_e>-1&&Y>0){let Me=T(ue,H);ie=Bp(ue,te,q,0,te.length,0,pe-Q,Me,Me)}else ie=C(ue,te,q,pe-Q,be-pe,H)}D.push(ie),R.push(Ce)}function v(V,U,D,R){let O=[],ee=0,B=-1;for(;m.pos>U;){let{id:Q,start:pe,end:Se,size:be}=m;if(be>4)m.next();else{if(B>-1&&pe<B)break;B<0&&(B=Se-o),O.push(Q,pe,Se),ee++,m.next()}}if(ee){let Q=new Uint16Array(ee*4),pe=O[O.length-2];for(let Se=O.length-3,be=0;Se>=0;Se-=3)Q[be++]=O[Se],Q[be++]=O[Se+1]-pe,Q[be++]=O[Se+2]-pe,Q[be++]=be;D.push(new Ii(Q,O[2]-pe,c)),R.push(pe-V)}}function T(V,U){return(D,R,O)=>{let ee=0,B=D.length-1,Q,pe;if(B>=0&&(Q=D[B])instanceof Il){if(!B&&Q.type==V&&Q.length==O)return Q;(pe=Q.prop(an.lookAhead))&&(ee=R[B]+Q.length+pe)}return C(V,D,R,O,ee,U)}}function w(V,U,D,R,O,ee,B,Q,pe){let Se=[],be=[];for(;V.length>R;)Se.push(V.pop()),be.push(U.pop()+D-O);V.push(C(c.types[B],Se,be,ee-O,Q-ee,pe)),U.push(O-D)}function C(V,U,D,R,O,ee,B){if(ee){let Q=[an.contextHash,ee];B=B?[Q].concat(B):[Q]}if(O>25){let Q=[an.lookAhead,O];B=B?[Q].concat(B):[Q]}return new Il(V,U,D,R,B)}function A(V,U){let D=m.fork(),R=0,O=0,ee=0,B=D.end-o,Q={size:0,start:0,skip:0};e:for(let pe=D.pos-V;D.pos>pe;){let Se=D.size;if(D.id==U&&Se>=0){Q.size=R,Q.start=O,Q.skip=ee,ee+=4,R+=4,D.next();continue}let be=D.pos-Se;if(Se<0||be<pe||D.start<B)break;let H=D.id>=h?4:0,ue=D.start;for(D.next();D.pos>be;){if(D.size<0)if(D.size==-3||D.size==-4)H+=4;else break e;else D.id>=h&&(H+=4);D.next()}O=ue,R+=Se,ee+=H}return(U<0||R==V)&&(Q.size=R,Q.start=O,Q.skip=ee),Q.size>4?Q:void 0}function P(V,U,D){let{id:R,start:O,end:ee,size:B}=m;if(m.next(),B>=0&&R<h){let Q=D;if(B>4){let pe=m.pos-(B-4);for(;m.pos>pe;)D=P(V,U,D)}U[--D]=Q,U[--D]=ee-V,U[--D]=O-V,U[--D]=R}else B==-3?x=R:B==-4&&(y=R);return D}let W=[],K=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,W,K,-1,0);let I=(s=l.length)!==null&&s!==void 0?s:W.length?K[0]+W[0].length:0;return new Il(g[l.topID],W.reverse(),K.reverse(),I)}const mb=new WeakMap;function Gf(l,s){if(!l.isAnonymous||s instanceof Ii||s.type!=l)return 1;let r=mb.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof Il)){r=1;break}r+=Gf(l,c)}mb.set(s,r)}return r}function Bp(l,s,r,c,o,d,h,m,g){let x=0;for(let w=c;w<o;w++)x+=Gf(l,s[w]);let y=Math.ceil(x*1.5/8),j=[],v=[];function T(w,C,A,P,W){for(let K=A;K<P;){let I=K,V=C[K],U=Gf(l,w[K]);for(K++;K<P;K++){let D=Gf(l,w[K]);if(U+D>=y)break;U+=D}if(K==I+1){if(U>y){let D=w[I];T(D.children,D.positions,0,D.children.length,C[I]+W);continue}j.push(w[I])}else{let D=C[K-1]+w[K-1].length-V;j.push(Bp(l,w,C,I,K,V,D,null,g))}v.push(V+W-d)}}return T(s,r,c,o,0),(m||g)(j,v,h)}class Wk{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof fa?this.setBuffer(s.context.buffer,s.index,r):s instanceof dl&&this.map.set(s.tree,r)}get(s){return s instanceof fa?this.getBuffer(s.context.buffer,s.index):s instanceof dl?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class au{constructor(s,r,c,o,d=!1,h=!1){this.from=s,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(s,r=[],c=!1){let o=[new au(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[0]:null;for(let m=0,g=0,x=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||x){let T=Math.max(v.from,g)-x,w=Math.min(v.to,j)-x;v=T>=w?null:new au(T,w,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class eE{startParse(s,r,c){return typeof s=="string"&&(s=new F1(s)),c=c?c.length?c.map(o=>new gs(o.from,o.to)):[new gs(0,0)]:[new gs(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class F1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function tE(l){return(s,r,c,o)=>new P1(s,l,r,c,o)}class gb{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function xb(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class J1{constructor(s,r,c,o,d,h,m,g){this.parser=s,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 xp=new an({perNode:!0});class P1{constructor(s,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=s}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 Il(c.type,c.children,c.positions,c.length,c.propValues.concat([[xp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[an.mounted.id]=new kc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new tj(this.fragments),r=null,c=null,o=new Jf(new dl(this.baseTree,this.ranges[0].from,0,null),ln.IncludeAnonymous|ln.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.hasNode(o)){if(r){let x=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(x)for(let y of x.mount.overlay){let j=y.from+x.pos,v=y.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(T=>T.from<v&&T.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=W1(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||(ej(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new J1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=yb(this.ranges,d.overlay||(o.from<o.to?[new gs(o.from,o.to)]:[]));y.length&&xb(y),(y.length||!d.overlay)&&this.inner.push(new gb(d.parser,y.length?d.parser.startParse(this.input,vb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new gs(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 gs(o.from,o.to)),g.from<g.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==g.from?r.ranges[x]={from:r.ranges[x].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 x=yb(this.ranges,r.ranges);x.length&&(xb(x),this.inner.splice(r.index,0,new gb(r.parser,r.parser.startParse(this.input,vb(r.mounts,x),x),r.ranges.map(y=>new gs(y.from-r.start,y.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function W1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function bb(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function ej(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function x(y,j,v,T,w,C){let A=r[C],P=[],W=[];bb(h,y,A,P,W,T);let K=m[A+1],I=m[A+2];g.push(P.length);let V=C?x(A+4,m[A+3],h.set.types[m[A]],K,I-K,C-1):s.toTree();return P.push(V),W.push(K-T),bb(h,m[A+3],j,P,W,T),new Il(v,P,W,w)}o.children[d]=x(0,m.length,Is.none,0,h.length,r.length-1);for(let y of g){let j=l.tree.children[y],v=l.tree.positions[y];l.yield(new dl(j,v+l.from,y,l._tree))}}class _b{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(ln.IncludeAnonymous|ln.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,ln.IgnoreOverlays|ln.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Il)r=r.children[0];else break}return!1}}class tj{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(xp))!==null&&r!==void 0?r:c.to,this.inner=new _b(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(xp))!==null&&s!==void 0?s:r.to,this.inner=new _b(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,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(an.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 yb(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new gs(g.from,h),g.to>m&&r.splice(d+1,0,new gs(m,g.to))):g.to>m?r[d--]=new gs(m,g.to):r.splice(d--,1))}}return c}function nj(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),T=Math.min(y,j,c);v<T&&x.push(new gs(v,T))}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 x}function vb(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),x=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new gs(v.from+c,v.to+c)),j=nj(s,y,g,x);for(let v=0,T=g;;v++){let w=v==j.length,C=w?x:j[v].from;if(C>T&&r.push(new au(T,C,o.tree,-h,d.from>=T||d.openStart,d.to<=C||d.openEnd)),w)break;T=j[v].to}}else r.push(new au(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let lj=0;class ms{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=lj++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof ms&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ms(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new Pf(s);return c=>c.modified.indexOf(r)>-1?c:Pf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let sj=0;class Pf{constructor(s){this.name=s,this.instances=[],this.id=sj++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&aj(r,m.modified));if(c)return c;let o=[],d=new ms(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=ij(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Pf.get(m,g));return d}}function aj(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function ij(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function nE(l){let s=Object.create(null);for(let r in l){let c=l[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 T=o[j++];if(j==o.length&&T=="!"){h=0;break}if(T!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,x=d[g];if(!x)throw new RangeError("Invalid path: "+o);let y=new iu(c,h,g>0?d.slice(0,g):null);s[x]=y.sort(s[x])}}return X_.add(s)}const X_=new an({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new iu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class iu{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}iu.empty=new iu([],2,null);function V_(l,s){let r=Object.create(null);for(let d of l)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}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function rj(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function cj(l,s,r,c=0,o=l.length){let d=new uj(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function oj(l,s,r,c,o,d=0,h=l.length){let m=d;function g(x,y){if(!(x<=m)){for(let j=l.slice(m,x),v=0;;){let T=j.indexOf(`
117
- `,v),w=T<0?j.length:T;if(w>v&&c(j.slice(v,w),y),T<0)break;o(),v=T+1}m=x}}cj(s,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class uj{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(T=>!T.scope||T.scope(h)));let x=o,y=fj(s)||iu.empty,j=rj(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),x),y.opaque)return;let v=s.tree&&s.tree.prop(an.mounted);if(v&&v.overlay){let T=s.node.enter(v.overlay[0].from+m,1),w=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),C=s.firstChild();for(let A=0,P=m;;A++){let W=A<v.overlay.length?v.overlay[A]:null,K=W?W.from+m:g,I=Math.max(r,P),V=Math.min(c,K);if(I<V&&C)for(;s.from<V&&(this.highlightRange(s,I,V,o,d),this.startSpan(Math.min(V,s.to),x),!(s.to>=K||!s.nextSibling())););if(!W||K>c)break;P=W.to+m,P>r&&(this.highlightRange(T.cursor(),Math.max(r,W.from+m),Math.min(c,P),"",w),this.startSpan(Math.min(c,P),x))}C&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function fj(l){let s=l.type.prop(X_);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const Ee=ms.define,kf=Ee(),Di=Ee(),jb=Ee(Di),Sb=Ee(Di),Oi=Ee(),Ef=Ee(Oi),Wh=Ee(Oi),ca=Ee(),xr=Ee(ca),la=Ee(),sa=Ee(),bp=Ee(),Qo=Ee(bp),Tf=Ee(),Re={comment:kf,lineComment:Ee(kf),blockComment:Ee(kf),docComment:Ee(kf),name:Di,variableName:Ee(Di),typeName:jb,tagName:Ee(jb),propertyName:Sb,attributeName:Ee(Sb),className:Ee(Di),labelName:Ee(Di),namespace:Ee(Di),macroName:Ee(Di),literal:Oi,string:Ef,docString:Ee(Ef),character:Ee(Ef),attributeValue:Ee(Ef),number:Wh,integer:Ee(Wh),float:Ee(Wh),bool:Ee(Oi),regexp:Ee(Oi),escape:Ee(Oi),color:Ee(Oi),url:Ee(Oi),keyword:la,self:Ee(la),null:Ee(la),atom:Ee(la),unit:Ee(la),modifier:Ee(la),operatorKeyword:Ee(la),controlKeyword:Ee(la),definitionKeyword:Ee(la),moduleKeyword:Ee(la),operator:sa,derefOperator:Ee(sa),arithmeticOperator:Ee(sa),logicOperator:Ee(sa),bitwiseOperator:Ee(sa),compareOperator:Ee(sa),updateOperator:Ee(sa),definitionOperator:Ee(sa),typeOperator:Ee(sa),controlOperator:Ee(sa),punctuation:bp,separator:Ee(bp),bracket:Qo,angleBracket:Ee(Qo),squareBracket:Ee(Qo),paren:Ee(Qo),brace:Ee(Qo),content:ca,heading:xr,heading1:Ee(xr),heading2:Ee(xr),heading3:Ee(xr),heading4:Ee(xr),heading5:Ee(xr),heading6:Ee(xr),contentSeparator:Ee(ca),list:Ee(ca),quote:Ee(ca),emphasis:Ee(ca),strong:Ee(ca),link:Ee(ca),monospace:Ee(ca),strikethrough:Ee(ca),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:Tf,documentMeta:Ee(Tf),annotation:Ee(Tf),processingInstruction:Ee(Tf),definition:ms.defineModifier("definition"),constant:ms.defineModifier("constant"),function:ms.defineModifier("function"),standard:ms.defineModifier("standard"),local:ms.defineModifier("local"),special:ms.defineModifier("special")};for(let l in Re){let s=Re[l];s instanceof ms&&(s.name=l)}V_([{tag:Re.link,class:"tok-link"},{tag:Re.heading,class:"tok-heading"},{tag:Re.emphasis,class:"tok-emphasis"},{tag:Re.strong,class:"tok-strong"},{tag:Re.keyword,class:"tok-keyword"},{tag:Re.atom,class:"tok-atom"},{tag:Re.bool,class:"tok-bool"},{tag:Re.url,class:"tok-url"},{tag:Re.labelName,class:"tok-labelName"},{tag:Re.inserted,class:"tok-inserted"},{tag:Re.deleted,class:"tok-deleted"},{tag:Re.literal,class:"tok-literal"},{tag:Re.string,class:"tok-string"},{tag:Re.number,class:"tok-number"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],class:"tok-string2"},{tag:Re.variableName,class:"tok-variableName"},{tag:Re.local(Re.variableName),class:"tok-variableName tok-local"},{tag:Re.definition(Re.variableName),class:"tok-variableName tok-definition"},{tag:Re.special(Re.variableName),class:"tok-variableName2"},{tag:Re.definition(Re.propertyName),class:"tok-propertyName tok-definition"},{tag:Re.typeName,class:"tok-typeName"},{tag:Re.namespace,class:"tok-namespace"},{tag:Re.className,class:"tok-className"},{tag:Re.macroName,class:"tok-macroName"},{tag:Re.propertyName,class:"tok-propertyName"},{tag:Re.operator,class:"tok-operator"},{tag:Re.comment,class:"tok-comment"},{tag:Re.meta,class:"tok-meta"},{tag:Re.invalid,class:"tok-invalid"},{tag:Re.punctuation,class:"tok-punctuation"}]);const dj="modulepreload",hj=function(l,s){return new URL(l,s).href},wb={},Pe=function(s,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]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=hj(y,c),y in wb)return;wb[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 w=document.createElement("link");if(w.rel=j?"stylesheet":dj,j||(w.as="script"),w.crossOrigin="",w.href=y,x&&w.setAttribute("nonce",x),document.head.appendChild(w),j)return new Promise((C,A)=>{w.addEventListener("load",C),w.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 s().catch(d)})},Q_={js:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-Bzu9Q3cY.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Pe(async()=>{const{json:l}=await import("./index-C8B1PkLL.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Pe(async()=>{const{json:l}=await import("./index-C8B1PkLL.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Pe(async()=>{const{css:l}=await import("./index-VwBy7Jbn.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Pe(async()=>{const{css:l}=await import("./index-VwBy7Jbn.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Pe(async()=>{const{css:l}=await import("./index-VwBy7Jbn.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Pe(async()=>{const{html:l}=await import("./index-BofmrRh8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Pe(async()=>{const{html:l}=await import("./index-BofmrRh8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Pe(async()=>{const{html:l}=await import("./index-BofmrRh8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Pe(async()=>{const{html:l}=await import("./index-BofmrRh8.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Pe(async()=>{const{markdown:l}=await import("./index-CqsQgCoQ.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Pe(async()=>{const{markdown:l}=await import("./index-CqsQgCoQ.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Pe(async()=>{const{python:l}=await import("./index-Bmwi1hyg.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Pe(async()=>{const{python:l}=await import("./index-Bmwi1hyg.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Pe(async()=>{const{yaml:l}=await import("./index-DUJErNwM.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Pe(async()=>{const{yaml:l}=await import("./index-DUJErNwM.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Pe(async()=>{const{rust:l}=await import("./index-CszNh_rE.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CN82xtMN.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CN82xtMN.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CN82xtMN.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CN82xtMN.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CN82xtMN.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Pe(async()=>{const{java:l}=await import("./index-BTQ15CqO.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Pe(async()=>{const{go:l}=await import("./index-DqkqUYxR.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Pe(async()=>{const{php:l}=await import("./index-DNUvScMr.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Pe(async()=>{const{sql:l}=await import("./index-Bnnn92II.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Pe(async()=>{const{xml:l}=await import("./index-CoS8eTbV.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Pe(async()=>{const{xml:l}=await import("./index-CoS8eTbV.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},pj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},mj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function gj(l){const s=mj[l.toLowerCase()]??l.toLowerCase(),r=Q_[s];return r?r().catch(()=>null):null}async function xj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=pj[s]??s.split(".").pop()??"",c=Q_[r];return c?c().catch(()=>null):null}const bj=V_([{tag:[Re.keyword,Re.modifier,Re.controlKeyword,Re.moduleKeyword],class:"cmh-key"},{tag:[Re.propertyName],class:"cmh-prop"},{tag:[Re.function(Re.variableName),Re.labelName],class:"cmh-fn"},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name),Re.bool],class:"cmh-const"},{tag:[Re.typeName,Re.className,Re.changed,Re.annotation,Re.self,Re.namespace],class:"cmh-type"},{tag:[Re.number,Re.integer,Re.float],class:"cmh-num"},{tag:[Re.string,Re.special(Re.string),Re.regexp],class:"cmh-str"},{tag:[Re.operator,Re.operatorKeyword,Re.escape],class:"cmh-op"},{tag:[Re.meta,Re.comment],class:"cmh-comment"},{tag:Re.invalid,class:"cmh-invalid"}]);function Cf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function _j(l,s){const r=s?await gj(s):null;if(!r)return Cf(l);try{const c=r.language.parser.parse(l);let o="";return oj(l,c,bj,(d,h)=>{o+=h?`<span class="${h}">${Cf(d)}</span>`:Cf(d)},()=>{o+=`
118
- `}),o}catch{return Cf(l)}}Ht.setOptions({gfm:!0,breaks:!1});function K_(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function cd(l){const s=await Ht.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await _j(c.text,c.lang??""),c.escaped=!0}});return G1.sanitize(s)}function Nb(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:K_(l.path)}}function $a(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function yj(l){return l.split("/").pop()??l}function Er(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Yf(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function Bi({x:l,y:s,items:r,note:c,onClose:o}){const d=b.useRef(null),[h,m]=b.useState({left:l,top:s}),[g,x]=b.useState(()=>{const v=r.findIndex(T=>!T.disabled);return v===-1?0:v});b.useLayoutEffect(()=>{const v=d.current;if(!v)return;const T=v.getBoundingClientRect(),w=8,C=Math.max(w,Math.min(l,window.innerWidth-T.width-w)),A=Math.max(w,Math.min(s,window.innerHeight-T.height-w));m({left:C,top:A})},[l,s]),b.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),b.useLayoutEffect(()=>{function v(w){var C;(C=d.current)!=null&&C.contains(w.target)||o()}function T(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",T,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",T,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const T=r.map((w,C)=>({item:w,index:C})).filter(w=>!w.item.disabled);if(T.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const w=v.key==="ArrowDown"?1:-1,C=T.findIndex(P=>P.index===g),A=T[(((C===-1?0:C)+w)%T.length+T.length)%T.length];A&&x(A.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const w=r[g];w&&y(w)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,T)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(T===g?" is-cursor":""),onMouseEnter:()=>x(T),onClick:()=>y(v),children:[a.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&a.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const vj=3500,jj=9e3,kb=220;function Mr({result:l,onDismiss:s}){const[r,c]=b.useState(l),[o,d]=b.useState(!1);if(b.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?vj:jj,g=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+kb);return()=>{clearTimeout(g),clearTimeout(x)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},kb)};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&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function da({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=b.useState(l),m=b.useRef(null);b.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=d.trim();if(!x||x===l)return o();c(x)}return a.jsx("input",{ref:m,className:s?`rename ${s}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Bc({active:l}){return l?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 Sj=500,br="application/x-ccv-fs-path",wj=200;function Nj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:T,onMove:w,onCopy:C,onDelete:A,onRefresh:P,onClose:W,zoomed:K,onToggleZoom:I}){const[V,U]=b.useState(""),[D,R]=b.useState(null),[O,ee]=b.useState(null),[B,Q]=b.useState(null),[pe,Se]=b.useState(null),[be,H]=b.useState(null),[ue,ie]=b.useState(null),xe=ad("(hover: hover)"),Ce=b.useRef(null),k=b.useMemo(()=>Tj(d),[d]);function te(re){return!(!B||re===B.path||B.kind==="dir"&&re.startsWith(`${B.path}/`)||re===Er(B.path))}function q(re){return!(!be||re===be.path||be.kind==="dir"&&re.startsWith(`${be.path}/`)||be.mode==="cut"&&re===Er(be.path))}function _e(re){H({path:re.path,kind:re.kind,mode:"copy"})}function Y(re){H({path:re.path,kind:re.kind,mode:"cut"})}function Ae(re){!be||!q(re)||(re&&!r.has(re)&&y(re),be.mode==="cut"?(w(be.path,re),H(null)):C(be.path,re))}function Me(re,ve){const Be=re.touches[0];if(!Be)return;const Fe={timer:0,x:Be.clientX,y:Be.clientY,el:re.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,ve(Fe.x,Fe.y,Fe.el)},Sj),Ce.current=Fe}function Xe(re){const ve=Ce.current,Be=re.touches[0];!ve||!Be||Math.hypot(Be.clientX-ve.x,Be.clientY-ve.y)>10&&(window.clearTimeout(ve.timer),Ce.current=null)}function Ue(re){const ve=Ce.current;ve&&(window.clearTimeout(ve.timer),ve.fired&&re.preventDefault())}function bt(){var re;return(re=Ce.current)!=null&&re.fired?(Ce.current=null,!0):!1}function Ge(re,ve,Be,Fe){U((Fe==null?void 0:Fe.path)??""),ie({x:re,y:ve,opener:Be,entry:Fe})}function gn(){const re=ue==null?void 0:ue.opener;ie(null),re!=null&&re.isConnected&&re.focus()}function Ke(re){return{onContextMenu:ve=>{ve.preventDefault(),Ge(ve.clientX,ve.clientY,ve.currentTarget,re)},onTouchStart:ve=>Me(ve,(Be,Fe,Ze)=>Ge(Be,Fe,Ze,re)),onTouchMove:Xe,onTouchEnd:Ue,onTouchCancel:Ue}}function dt(re){re.target===re.currentTarget&&(re.preventDefault(),Ge(re.clientX,re.clientY,re.currentTarget,null))}function rt(re){re.target===re.currentTarget&&Me(re,(ve,Be,Fe)=>Ge(ve,Be,Fe,null))}function ct(re){if(!(re.ctrlKey||re.metaKey)||re.target instanceof HTMLInputElement)return;const ve=re.key.toLowerCase();if(ve==="v"){re.preventDefault(),Ae(Pn());return}if(!V)return;const Be=Eb(s,V);Be&&(ve==="c"?(re.preventDefault(),_e(Be)):ve==="x"&&(re.preventDefault(),Y(Be)))}function kt(re){return ve=>{ve.dataTransfer.effectAllowed="move",ve.dataTransfer.setData(br,re.path),Q({path:re.path,kind:re.kind})}}function Lt(){Q(null),Se(null)}function je(re){return ve=>{ve.dataTransfer.types.includes(br)&&(ve.stopPropagation(),!(re.kind!=="dir"||!te(re.path))&&(ve.preventDefault(),Se(re.path)))}}function ht(re){return ve=>{if(!ve.dataTransfer.types.includes(br)||(ve.stopPropagation(),re.kind!=="dir"||!te(re.path)))return;ve.preventDefault();const Be=ve.dataTransfer.getData(br);Se(null),Be&&w(Be,re.path)}}function _t(re){!re.dataTransfer.types.includes(br)||!te("")||(re.preventDefault(),Se(""))}function rn(re){if(!re.dataTransfer.types.includes(br)||!te(""))return;re.preventDefault();const ve=re.dataTransfer.getData(br);Se(null),ve&&w(ve,"")}const[pt,lt]=b.useState(""),Bt=pt.trim(),Jn=Bt.length>0,Mt=b.useRef(null),Wt=b.useRef(g);Wt.current=g;function rl(re){lt(re),Mt.current&&clearTimeout(Mt.current);const ve=re.trim();if(!ve){Wt.current("");return}Mt.current=setTimeout(()=>Wt.current(ve),wj)}function wn(re){Mt.current&&clearTimeout(Mt.current),lt(""),Wt.current(""),U(re.path),x(re)}const cn=Jn&&(m==null?void 0:m.query)===Bt?m:null;function Pn(){if(V==="")return"";const re=Eb(s,V);if((re==null?void 0:re.kind)==="dir")return V;const ve=V.lastIndexOf("/");return ve===-1?"":V.slice(0,ve)}function on(re,ve){const Be=ve??Pn();Be&&!r.has(Be)&&y(Be),ee({parent:Be,kind:re})}function st(){if(!ue)return[];const re=Fe=>xe?Fe:void 0;if(!ue.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:re("Ctrl+V"),disabled:!q(""),onSelect:()=>Ae("")},{id:"new-file",label:"Создать файл",onSelect:()=>on("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>on("dir","")}];const ve=ue.entry,Be=[ve.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ve.path)}:{id:"toggle",label:r.has(ve.path)?"Свернуть":"Развернуть",onSelect:()=>y(ve.path)},{id:"copy",label:"Копировать",hint:re("Ctrl+C"),onSelect:()=>_e(ve)},{id:"cut",label:"Вырезать",hint:re("Ctrl+X"),onSelect:()=>Y(ve)}];return ve.kind==="dir"&&(Be.push({id:"paste",label:"Вставить",hint:re("Ctrl+V"),disabled:!q(ve.path),onSelect:()=>Ae(ve.path)}),Be.push({id:"new-file",label:"Создать файл",onSelect:()=>on("file",ve.path)}),Be.push({id:"new-dir",label:"Создать каталог",onSelect:()=>on("dir",ve.path)})),Be.push({id:"rename",label:"Переименовать",onSelect:()=>R(ve.path)}),Be.push({id:"delete",label:"Удалить",onSelect:()=>A(ve)}),Be}const ot=Jn?[]:It("",0);function It(re,ve){const Be=s[re],Fe=[];if(O&&O.parent===re&&Fe.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Xa(ve),children:[a.jsx("span",{className:"fsrow__icon",children:O.kind==="dir"?a.jsx(ed,{}):a.jsx(td,{})}),a.jsx(da,{className:"rename--file",value:"",placeholder:O.kind==="dir"?"имя каталога":"имя файла",onCommit:Ze=>{ee(null),v(re,O.kind,Ze)},onCancel:()=>ee(null)})]},`draft:${re}`)),!Be)return Fe.push(a.jsx("p",{className:"fsrow__pending",style:Xa(ve),children:"читаем…"},`wait:${re}`)),Fe;Be.length===0&&!O&&Fe.push(a.jsx("p",{className:"fsrow__pending",style:Xa(ve),children:"пусто"},`empty:${re}`));for(const Ze of Be){const hn=Ze.kind==="dir"&&r.has(Ze.path);Fe.push(D===Ze.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Xa(ve),children:[a.jsx("span",{className:"fsrow__icon",children:Ze.kind==="dir"?a.jsx(ed,{open:hn}):a.jsx(td,{})}),a.jsx(da,{className:"rename--file",value:Ze.name,placeholder:"новое имя",onCommit:X=>{R(null),T(Ze.path,X)},onCancel:()=>R(null)})]},Ze.path):a.jsx(kj,{entry:Ze,depth:ve,open:hn,active:Ze.path===c,selected:Ze.path===V,dirty:o.has(Ze.path),gitStatus:k.get(Ze.path),dragging:(B==null?void 0:B.path)===Ze.path,dropTarget:pe===Ze.path,cut:(be==null?void 0:be.mode)==="cut"&&be.path===Ze.path,onClick:()=>{bt()||(U(Ze.path),Ze.kind==="dir"?y(Ze.path):j(Ze.path))},onRename:()=>R(Ze.path),onDelete:()=>A(Ze),onDragStart:kt(Ze),onDragEnd:Lt,onDragOver:je(Ze),onDrop:ht(Ze),...Ke(Ze)},Ze.path)),hn&&Fe.push(...It(Ze.path,ve+1))}return Fe}function Yn(){if(!cn)return[a.jsx("p",{className:"fsrow__pending",style:Xa(0),children:"ищем…"},"search:wait")];if(cn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Xa(0),children:"ничего не найдено"},"search:empty")];const re=cn.entries.map(ve=>a.jsx(Ej,{entry:ve,gitStatus:k.get(ve.path),onClick:()=>wn(ve)},ve.path));return cn.truncated&&re.push(a.jsxs("p",{className:"fsrow__pending",style:Xa(0),children:["показаны первые ",cn.entries.length," — уточните запрос"]},"search:truncated")),re}return a.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(K?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:ct,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:re=>{I&&(re.target.closest("button")||I())},children:[a.jsx(Rj,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>on("file"),children:a.jsx(Aj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>on("dir"),children:a.jsx(Mj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:P,children:"↻"}),I&&a.jsx("button",{className:"sidepane__btn",title:K?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":K?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":K,onClick:I,children:a.jsx(Bc,{active:K})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:W,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Dj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:pt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:re=>rl(re.target.value),onKeyDown:re=>{re.stopPropagation(),re.key==="Escape"&&(re.preventDefault(),pt?rl(""):re.currentTarget.blur())}}),pt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>rl(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(pe===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:_t,onDrop:rn,onContextMenu:dt,onTouchStart:rt,onTouchMove:Xe,onTouchEnd:Ue,onTouchCancel:Ue,children:Jn?Yn():ot}),a.jsx(Mr,{result:h}),ue&&a.jsx(Bi,{x:ue.x,y:ue.y,items:st(),onClose:gn})]})}function kj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:T,onDragEnd:w,onDragOver:C,onDrop:A,onContextMenu:P,onTouchStart:W,onTouchMove:K,onTouchEnd:I,onTouchCancel:V}){const U="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:U,style:Xa(s),draggable:!0,onDragStart:T,onDragEnd:w,onDragOver:C,onDrop:A,onContextMenu:P,onTouchStart:W,onTouchMove:K,onTouchEnd:I,onTouchCancel:V,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:Z_(l),children:[a.jsx("span",{className:"fsrow__icon"+Wf("fsrow__icon",h),children:l.kind==="dir"?a.jsx(ed,{open:r}):a.jsx(td,{})}),a.jsx("span",{className:"fsrow__name"+Wf("fsrow__name",h),children:l.name}),l.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":`Переименовать ${l.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function Ej({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Xa(0),onClick:r,title:Z_(l),children:[a.jsx("span",{className:"fsrow__icon"+Wf("fsrow__icon",s),children:l.kind==="dir"?a.jsx(ed,{}):a.jsx(td,{})}),a.jsx("span",{className:"fsrow__name"+Wf("fsrow__name",s),children:l.name}),l.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function Z_(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Xa(l){return{"--depth":l}}function Eb(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function Tj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=Cj(o.status);if(!d)continue;c(o.path,d);let h=Er(o.path);for(;c(h,d),!!h;)h=Er(h)}return s}function Cj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function Wf(l,s){return s?` ${l}--git-${s}`:""}function ed({open:l=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?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 td(){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 Aj(){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 Mj(){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 Rj(){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 Dj(){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 Oj=200;function Lj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=b.useState(""),x=m.trim(),y=x.length>0,j=b.useRef(null),v=b.useRef(r);v.current=r;function T(A){g(A),j.current&&clearTimeout(j.current);const P=A.trim();if(!P){v.current("");return}j.current=setTimeout(()=>v.current(P),Oj)}const w=y&&(s==null?void 0:s.query)===x?s:null;function C(){if(!w)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(w.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let P="";for(const W of w.matches)W.path!==P&&(P=W.path,A.push(a.jsx("p",{className:"searchgroup__path",title:W.path,children:W.path},`path:${W.path}`))),A.push(a.jsx(zj,{match:W,onClick:()=>c(W)},`${W.path}:${W.line}:${W.column}`));return w.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",w.matches.length," — уточните запрос"]},"grep:truncated")),A}return a.jsxs("aside",{className:(l?"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(Uj,{}),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(Bc,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Hj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>T(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?T(""):A.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>T(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?C():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function zj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:l.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function Uj(){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 Hj(){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 Af=null;function Bj(){return Af||(Af=Promise.all([Pe(()=>import("./index-CBo-Zjlj.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Pe(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Pe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Pe(()=>import("./index-ua0K8YOJ.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Pe(()=>import("./codemirror-CHw8zyKh.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw Af=null,l})),Af}function Ij({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=b.useRef(null),m=b.useRef(null),g=b.useRef(null),x=b.useRef(new Map),y=b.useRef(new Map),j=b.useRef(new Set),v=b.useRef(null),T=b.useRef(o),w=b.useRef(d),C=b.useRef(l),A=b.useRef(r),P=b.useRef(s);T.current=o,w.current=d,C.current=l,A.current=r,P.current=s;const[W,K]=b.useState("loading"),[I,V]=b.useState(!1);function U(R,O,ee,B,Q){const pe=x.current.get(B),Se=y.current.get(B)===Q;if(pe&&Se)ee.setState(pe);else{const H=R.EditorState.create({doc:P.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(w.current(C.current),!0)}])),R.keymap.of([R.indentWithTab]),O.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(ue=>{ue.docChanged&&T.current(C.current,ue.state.doc.toString())})]});x.current.set(B,H),y.current.set(B,Q),ee.setState(H),j.current.delete(B)}if(j.current.has(B))return()=>{};let be=!1;return xj(B).then(H=>{be||!H||C.current!==B||(ee.dispatch({effects:O.reconfigure(H)}),x.current.set(B,ee.state),j.current.add(B))}),()=>{be=!0}}b.useEffect(()=>{if(!h.current)return;let O=!1,ee=null,B=null;K("loading"),V(!1);const Q=window.setTimeout(()=>{O||V(!0)},200);return(async()=>{let pe;try{pe=await Bj()}catch{window.clearTimeout(Q),O||K("error");return}if(O||!h.current)return;window.clearTimeout(Q);const Se=new pe.Compartment;v.current=Se,g.current=pe,B=new pe.EditorView({parent:h.current}),m.current=B,ee=U(pe,Se,B,C.current,A.current),K("ready")})(),()=>{O=!0,window.clearTimeout(Q),ee==null||ee(),B==null||B.destroy(),m.current===B&&(m.current=null),g.current=null,v.current=null}},[]),b.useEffect(()=>{const R=g.current,O=m.current,ee=v.current;if(!(!R||!O||!ee))return U(R,ee,O,l,r)},[l,r]);const D=b.useRef(0);return b.useEffect(()=>{const R=m.current,O=g.current;if(!R||!O||!c||c.token===D.current)return;D.current=c.token;const ee=R.state.doc.lines,B=Math.min(Math.max(c.line,1),ee),Q=R.state.doc.line(B),pe=Math.min(Q.from+Math.max(c.column-1,0),Q.to);R.dispatch({selection:O.EditorSelection.cursor(pe),effects:O.EditorView.scrollIntoView(pe,{y:"center"})}),R.focus()},[c]),b.useEffect(()=>()=>{const R=m.current;R&&x.current.set(l,R.state)},[l]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(W==="ready"?"":" is-hidden")}),W==="loading"&&I&&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:"Загружается редактор…"})]}),W==="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:s})]})]})}function Bs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=b.useState(!1),[x,y]=b.useState(0),j=b.useRef(null),v=b.useRef(null),T=s.find(A=>A.value===l)??null;b.useEffect(()=>{if(!m)return;const A=s.findIndex(P=>P.value===l);y(A===-1?0:A)},[m]),b.useEffect(()=>{if(!m)return;function A(P){var W;(W=j.current)!=null&&W.contains(P.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),b.useEffect(()=>{var A,P;m&&((P=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||P.scrollIntoView({block:"nearest"}))},[m,x]),b.useEffect(()=>{if(!m)return;const A=v.current,P=qj(j.current);if(!A||!P)return;const W=A.getBoundingClientRect().bottom-P.getBoundingClientRect().bottom;W>0&&(P.scrollTop+=Math.min(W+8,A.offsetHeight))},[m]);function w(A){g(!1),A.value!==l&&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 P=A.key==="ArrowDown"?1:s.length-1;return y(W=>(W+P)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const P=s[x];P&&w(P)}}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:(T==null?void 0:T.label)??h}),a.jsx(Gj,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((A,P)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===l,className:"select__option"+(P===x?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>y(P),onClick:()=>w(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function qj(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Gj(){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 Yj(){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 $j(){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 Xj(){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 Vj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){b.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=Qj(r,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Yf(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(l),children:"Повторить"})]}):m?s.startsWith("image/")?a.jsx(Zj,{url:m}):s.startsWith("video/")?a.jsx(Jj,{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 Qj(l,s){const[r,c]=b.useState(null);return b.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),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:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Ri=1,F_=8,Mf=1.25;function Kj(l){return Math.min(F_,Math.max(Ri,l))}function Zj({url:l}){const[s,r]=b.useState({scale:Ri,x:0,y:0}),[c,o]=b.useState(!1),d=b.useRef(null),h=b.useRef(null);function m(T,w,C){r(A=>{const P=Kj(A.scale*T);if(P===A.scale)return A;if(P<=Ri)return{scale:Ri,x:0,y:0};const W=(w-A.x)/A.scale,K=(C-A.y)/A.scale;return{scale:P,x:w-P*W,y:C-P*K}})}b.useEffect(()=>{const T=d.current;if(!T)return;function w(C){C.preventDefault();const A=T.getBoundingClientRect(),P=C.clientX-A.left-A.width/2,W=C.clientY-A.top-A.height/2;m(C.deltaY<0?Mf:1/Mf,P,W)}return T.addEventListener("wheel",w,{passive:!1}),()=>T.removeEventListener("wheel",w)},[]);function g(T){s.scale<=Ri||(T.currentTarget.setPointerCapture(T.pointerId),h.current={pointerId:T.pointerId,startX:T.clientX,startY:T.clientY,origX:s.x,origY:s.y},o(!0))}function x(T){const w=h.current;!w||w.pointerId!==T.pointerId||r(C=>({...C,x:w.origX+(T.clientX-w.startX),y:w.origY+(T.clientY-w.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>Ri,v=!j&&s.x===0&&s.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:x,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Ri,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Mf,0,0),children:a.jsx($j,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=F_,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Mf,0,0),children:a.jsx(Yj,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ri,x:0,y:0}),children:a.jsx(Xj,{})})]})]})}const Fj=[{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 Jj({url:l}){const s=b.useRef(null),[r,c]=b.useState("1");return b.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Bs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Fj})]})]})}function Pj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=$a(l),x=K_(l.path)&&!l.binary&&!l.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:l.path,children:l.path}),a.jsxs("span",{className:"editor__meta",children:[Yf(l.size),l.eol==="crlf"&&" · CRLF"]}),x&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?a.jsx(Vj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Yf(l.size)," на диске."]}):l.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Yf(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?a.jsx(Wj,{text:l.text}):a.jsx(Ij,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Wj({text:l}){const[s,r]=b.useState("");return b.useEffect(()=>{let c=!1;return cd(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function eS({files:l,activePath:s,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"+(s===null?" is-on":""),role:"tab","aria-selected":s===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:"Агент работает"})]}),l.map(m=>a.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,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:yj(m.path)}),$a(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(Bc,{active:d})})]})}function ps(l){return l.claudeSessionId??l.id}function $f(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(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 Tb(l){return l.state!=="closed"}function J_(l){return[...l.filter(Tb),...l.filter(s=>!Tb(s))]}function Rf(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Ip(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function P_(l){return`${l} ${Ip(l,"агент","агента","агентов")}`}function tS(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(P_(s)),r>0&&c.push(`${r} ${Ip(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function nS(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function lS(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function sS(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function aS({tasks:l,onStop:s}){const[r,c]=b.useState(!1),[o,d]=b.useState(()=>Date.now()),[h,m]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{m(x=>{const y=new Set(l.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[l]);const g=x=>{m(y=>new Set(y).add(x)),s(x),window.setTimeout(()=>{m(y=>{if(!y.has(x))return y;const j=new Set(y);return j.delete(x),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(x=>!x),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:tS(l)}),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:l.map(x=>{const y=h.has(x.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:nS(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:lS(o-x.startedAt)})]}),a.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&a.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),a.jsxs("div",{className:"task__stats",children:[sS(x.tokens)," · ",x.toolUses," ",Ip(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:y?"Останавливается":"Стоп"})]},x.id)})})]})}const iS=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function qp({className:l}){return a.jsx("img",{src:iS,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const rS=450,cS=6,oS=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function uS({disabled:l,providers:s,onStart:r}){const c=oS.filter(O=>s.includes(O.id)),o=c.length>1,[d,h]=b.useState(!1),[m,g]=b.useState(0),[x,y]=b.useState({left:0,top:0}),j=b.useRef(null),v=b.useRef(null),T=b.useRef(null);function w(){T.current&&window.clearTimeout(T.current.timer),T.current=null}function C(){w(),g(0),h(!0)}function A(O){var ee;h(!1),O&&((ee=j.current)==null||ee.focus())}function P(O){if(l||!o||O.button!==0)return;const ee={timer:0,x:O.clientX,y:O.clientY,fired:!1};ee.timer=window.setTimeout(()=>{ee.fired=!0,C()},rS),T.current=ee}function W(O){const ee=T.current;!ee||ee.fired||Math.hypot(O.clientX-ee.x,O.clientY-ee.y)>cS&&w()}function K(){T.current&&!T.current.fired&&w()}function I(O){var B;if((B=T.current)!=null&&B.fired){T.current=null,O.preventDefault();return}if(l)return;const ee=c[0];ee&&r(ee.id)}function V(O){o&&(O.preventDefault(),!l&&C())}function U(O){if(l||!o)return;(O.key==="ArrowDown"||O.key==="ArrowUp"||O.key==="Enter"&&O.shiftKey)&&(O.preventDefault(),C())}b.useLayoutEffect(()=>{if(!d)return;const O=j.current,ee=v.current;if(!O||!ee)return;const B=O.getBoundingClientRect(),Q=ee.getBoundingClientRect(),pe=8,Se=Math.max(pe,Math.min(B.right-Q.width,window.innerWidth-Q.width-pe));let be=B.top-Q.height-8;be<pe&&(be=Math.min(B.bottom+8,window.innerHeight-Q.height-pe)),y({left:Se,top:be})},[d]),b.useLayoutEffect(()=>{var O;d&&((O=v.current)==null||O.focus())},[d]),b.useLayoutEffect(()=>{if(!d)return;function O(ee){var Q,pe;const B=ee.target;!((Q=v.current)!=null&&Q.contains(B))&&!((pe=j.current)!=null&&pe.contains(B))&&A(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[d]);function D(O){A(!1),r(O.id)}function R(O){if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),A(!0);return}if(O.key==="ArrowDown"||O.key==="ArrowUp"){O.preventDefault();const ee=O.key==="ArrowDown"?1:-1;g(B=>(B+ee+c.length)%c.length);return}if(O.key==="Enter"||O.key===" "){O.preventDefault();const ee=c[m];ee&&D(ee);return}O.key==="Tab"&&A(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:j,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?d:void 0,onClick:I,onContextMenu:V,onPointerDown:P,onPointerMove:W,onPointerUp:K,onPointerCancel:K,onPointerLeave:K,onKeyDown:U,children:["+ Сессия",o&&a.jsx(fS,{})]}),d&&o&&a.jsx("div",{ref:v,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:R,children:c.map((O,ee)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(ee===m?" is-cursor":""),onMouseEnter:()=>g(ee),onClick:()=>D(O),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${O.id}`,"aria-hidden":"true",children:O.id==="antigravity"?a.jsx(qp,{className:"newsession__mark-logo"}):a.jsx(dS,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:O.label}),a.jsx("span",{className:"newsession__hint",children:O.hint})]})]},O.id))})]})}function fS(){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 dS(){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 W_="ccv:sidebar.collapsed",ey="ccv:sidebar.mode",ty="ccv:sidebar.foldersCollapsed",Cb="ccv:sidebar.expandedProjects",Ab="ccv:sidebar.expandedProjectArchives",hS=500,_p="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function pS({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:x,pinned:y,live:j,listOrder:v,liveSessionsFirst:T,onReorder:w,activeWorkspaceId:C,activeSessionId:A,onSelectWorkspace:P,onRenameSession:W,onStopSession:K,onPinSessions:I,onSelectPinned:V,onCloseWorkspaces:U,onRestoreWorkspaces:D,onArchiveSessions:R,onUnarchiveSessions:O,onCreateFolder:ee,onRenameFolder:B,onSetFolderColor:Q,onDeleteFolder:pe,onAssignToFolder:Se,onOpenWorkspace:be,onNewSession:H,enabledProviders:ue,onOpenExtensions:ie,account:xe,onOpenAccount:Ce,relay:k,onOpenRelay:te,onOpenSettings:q,themeMode:_e,onCycleTheme:Y}){var vt;const[Ae,Me]=b.useState(null),[Xe,Ue]=b.useState(null),[bt,Ge]=b.useState(null);function gn(N){return(bt==null?void 0:bt.folderId)===N.id?bt.color??void 0:N.color}function Ke(N){const le=N&&gn(N);return le?{"--folder-color":le}:void 0}const dt=b.useRef(void 0),[rt,ct]=b.useState(null),[kt,Lt]=b.useState(null),[je,ht]=b.useState(""),[_t,rn]=b.useState(TS),[pt,lt]=b.useState(CS),[Bt,Jn]=b.useState(AS),[Mt,Wt]=b.useState(()=>Rb(Cb)),[rl,wn]=b.useState(()=>Rb(Ab)),[cn,Pn]=b.useState([]);function on(N){Jn(N);try{localStorage.setItem(ey,N)}catch{}}const st=je.trim().toLowerCase(),ot=st!=="",It=b.useMemo(()=>$f(c,v==null?void 0:v.workspaces,N=>N.id,"bottom"),[c,v]),Yn=b.useMemo(()=>{const N=$f(y,v==null?void 0:v.pinned,ps,"bottom");return T?J_(N):N},[y,v,T]),re=b.useMemo(()=>$f(j,v==null?void 0:v.live,ps,"bottom"),[j,v]),ve=N=>N.name.toLowerCase().includes(st)||N.path.toLowerCase().includes(st),Be=b.useMemo(()=>ot?It.filter(N=>{if(ve(N))return!0;const le=g[N.id];return!!le&&(le.sessions.some(we=>tu(we,st))||le.archived.some(we=>tu(we,st)))}):It,[It,g,st,ot]),Fe=b.useMemo(()=>ot?o.filter(ve):o,[o,st,ot]),Ze=N=>{var le;return((le=c.find(we=>we.id===N))==null?void 0:le.name)??"—"},hn=N=>{var le;return(le=c.find(we=>we.id===N))==null?void 0:le.path},X=b.useMemo(()=>ot?Yn.filter(N=>(N.title??"").toLowerCase().includes(st)||Ze(N.workspaceId).toLowerCase().includes(st)):Yn,[Yn,c,st,ot]),de=b.useMemo(()=>ot?re.filter(N=>(N.title??"").toLowerCase().includes(st)||Ze(N.workspaceId).toLowerCase().includes(st)):re,[re,c,st,ot]),ke=!ot;function Le(N){rn(le=>{const we=le.includes(N)?le.filter(Ie=>Ie!==N):[...le,N];try{localStorage.setItem(W_,JSON.stringify(we))}catch{}return we})}const yt=N=>!_t.includes(N);function $n(N){lt(le=>{const we=le.includes(N)?le.filter(Ie=>Ie!==N):[...le,N];try{localStorage.setItem(ty,JSON.stringify(we))}catch{}return we})}const hl=N=>!pt.includes(N);function as(N,le){Wt(we=>{if(we.includes(N)===le)return we;const Ie=le?[...we,N]:we.filter(Ut=>Ut!==N);return Db(Cb,Ie),Ie})}function ql(N){wn(le=>{const we=le.includes(N)?le.filter(Ie=>Ie!==N):[...le,N];return Db(Ab,we),we})}b.useEffect(()=>{C&&as(C,!0)},[C]),b.useEffect(()=>Pn(N=>N.length?[]:N),[st]);const Sl=b.useRef(new Set);b.useEffect(()=>{if(!s){Sl.current.clear();return}for(const N of Mt)Sl.current.has(N)||!c.some(le=>le.id===N)||(Sl.current.add(N),N!==C&&x(N))},[s,Mt,c,C]);function xs(N){const le=g[N.id],we=!ot||ve(N),Ie=!we,Ut=Ie?!cn.includes(N.id):Mt.includes(N.id),Kl=le?we?le.sessions.length:le.sessions.filter(pl=>tu(pl,st)).length:void 0;return{entry:le,showAll:we,forced:Ie,open:Ut,count:Kl}}function Gl(N,le){if(le.forced){Pn(we=>we.includes(N.id)?we.filter(Ie=>Ie!==N.id):[...we,N.id]);return}as(N.id,!le.open)}const Yl=b.useMemo(()=>lu(Be,d,void 0,!ot),[Be,d,ot]),wl=b.useMemo(()=>lu(Fe,d),[Fe,d]),Wn=b.useMemo(()=>lu(X,m,N=>N.pinnedFolderId,!ot),[X,m,ot]),en=b.useMemo(()=>({groups:[],ungrouped:de}),[de]),We=((v==null?void 0:v.workspaces.length)??0)>0,Mn=((v==null?void 0:v.pinned.length)??0)>0,qs=((v==null?void 0:v.live.length)??0)>0,Nl=Vf({enabled:ke,scope:"workspaces",itemKey:N=>N.id,groups:Yl.groups,ungrouped:Yl.ungrouped,onReorder:w,onMoveToGroup:(N,le)=>{Se("workspace",N,le.folderId),le.order&&w("workspaces",le.order)}}),tn=Vf({enabled:ke,scope:"pinned",itemKey:ps,groups:Wn.groups,ungrouped:Wn.ungrouped,onReorder:w}),$l=Vf({enabled:ke,scope:"live",itemKey:ps,groups:en.groups,ungrouped:en.ungrouped,onReorder:w});b.useEffect(()=>{if(!bt)return;const N=[...m,...d,...h].find(le=>le.id===bt.folderId);N&&N.color===(bt.color??void 0)&&Ge(null)},[bt,m,d,h]),b.useEffect(()=>()=>window.clearTimeout(dt.current),[]);const Xn=yp(Be),kl=yp(Fe),[Et,El]=b.useState(null),[un,Rt]=b.useState(null),[mt,zt]=b.useState(null),[Vn,xn]=b.useState(null),Rn=b.useRef(null);function is(N,le){const we=N.touches[0];if(!we)return;const Ie={timer:0,x:we.clientX,y:we.clientY,el:N.currentTarget,fired:!1};Ie.timer=window.setTimeout(()=>{Ie.fired=!0,le(Ie.x,Ie.y,Ie.el)},hS),Rn.current=Ie}function Xl(N){const le=Rn.current,we=N.touches[0];!le||!we||Math.hypot(we.clientX-le.x,we.clientY-le.y)>10&&(window.clearTimeout(le.timer),Rn.current=null)}function bn(N){const le=Rn.current;le&&(window.clearTimeout(le.timer),le.fired&&N.preventDefault())}function pn(){var N;return(N=Rn.current)!=null&&N.fired?(Rn.current=null,!0):!1}function el(){const N=Et==null?void 0:Et.opener;El(null),N!=null&&N.isConnected&&N.focus()}function qt(){const N=un==null?void 0:un.opener;Rt(null),N!=null&&N.isConnected&&N.focus()}function Dn(){const N=mt==null?void 0:mt.opener;zt(null),N!=null&&N.isConnected&&N.focus()}function Gt(){const N=Vn==null?void 0:Vn.opener;xn(null),N!=null&&N.isConnected&&N.focus()}function bs(N){return{onContextMenu:le=>{le.preventDefault(),El({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:Xn.targetsFor(N)})},onTouchStart:le=>is(le,(we,Ie,Ut)=>El({x:we,y:Ie,opener:Ut,ids:Xn.targetsFor(N)})),onTouchMove:Xl,onTouchEnd:bn,onTouchCancel:bn}}function qi(N){return{onContextMenu:le=>{le.preventDefault(),Rt({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:kl.targetsFor(N)})},onTouchStart:le=>is(le,(we,Ie,Ut)=>Rt({x:we,y:Ie,opener:Ut,ids:kl.targetsFor(N)})),onTouchMove:Xl,onTouchEnd:bn,onTouchCancel:bn}}function Vl(N){return{onContextMenu:le=>{le.preventDefault(),zt({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:[N.id]})},onTouchStart:le=>is(le,(we,Ie,Ut)=>zt({x:we,y:Ie,opener:Ut,ids:[N.id]})),onTouchMove:Xl,onTouchEnd:bn,onTouchCancel:bn}}function _s(N){return{onContextMenu:le=>{le.preventDefault(),xn({x:le.clientX,y:le.clientY,opener:le.currentTarget,ids:[N.id]})},onTouchStart:le=>is(le,(we,Ie,Ut)=>xn({x:we,y:Ie,opener:Ut,ids:[N.id]})),onTouchMove:Xl,onTouchEnd:bn,onTouchCancel:bn}}const _n=((C?(vt=g[C])==null?void 0:vt.sessions:void 0)??[]).filter(N=>N.state!=="closed").length,Ql=Et?Be.find(N=>N.id===Et.ids[0]):void 0,Nn=Et?[{id:"close",label:Et.ids.length>1?`Закрыть проекты (${Et.ids.length})`:"Закрыть проект",onSelect:()=>{U(Et.ids),Xn.clear()}},...Et.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const N=Et.ids[0];as(N,!0),Lt(N)}}]:[],...Po({folders:d,ids:Et.ids,hasFolder:(Ql==null?void 0:Ql.folderId)!=null,assign:(N,le)=>Se("workspace",N,le),onClear:()=>Xn.clear(),onNewFolder:()=>ct("workspace")}),...Et.ids.length===1&&ke?Nl.menuItems(Et.ids[0],We):[]]:[],ys=Et?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&Et.ids.includes(C)&&_n>0?` в нём сейчас незавершённых сессий: ${_n} — при закрытии они остановятся на хосте.`:""):void 0,rs=un?Fe.find(N=>N.id===un.ids[0]):void 0,cs=un?[{id:"restore",label:un.ids.length>1?`Вернуть проекты (${un.ids.length})`:"Вернуть проект",onSelect:()=>{D(un.ids),kl.clear()}},...Po({folders:d,ids:un.ids,hasFolder:(rs==null?void 0:rs.folderId)!=null,assign:(N,le)=>Se("workspace",N,le),onClear:()=>kl.clear(),onNewFolder:()=>ct("workspace")})]:[],Tl=un?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,me=mt?X.find(N=>N.id===mt.ids[0]):void 0,E=mt?[{id:"rename",label:"Переименовать",onSelect:()=>Me(mt.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{me&&I(me.workspaceId,[me.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{me&&R(me.workspaceId,[me.id])}},...me&&me.workspaceId===C?Po({folders:h.filter(N=>N.workspaceId===me.workspaceId),ids:[me.id],hasFolder:me.folderId!=null,assign:(N,le)=>Se("session",N,le,me.workspaceId),onClear:()=>{},onNewFolder:()=>{as(me.workspaceId,!0),Lt(me.workspaceId)}}):[],..._S(me?Po({folders:m,ids:[me.id],hasFolder:me.pinnedFolderId!=null,assign:(N,le)=>Se("pinned",N,le),onClear:()=>{},onNewFolder:()=>ct("pinned")}):[]),...ke&&me?tn.menuItems(ps(me),Mn):[]]:[],$=Vn?de.find(N=>N.id===Vn.ids[0]):void 0,ge=Vn?[{id:"stop",label:"Остановить",onSelect:()=>{$&&K($)}},{id:"rename",label:"Переименовать",onSelect:()=>Me(Vn.ids[0])},{id:"pin",label:($==null?void 0:$.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{$&&I($.workspaceId,[$.id],$.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{$&&R($.workspaceId,[$.id])}},...ke&&$?$l.menuItems(ps($),qs):[]]:[],De={start:is,move:Xl,end:bn,consumed:pn};function He(N,le){var Kl,pl;const we=xs(N),Ie=`ws-branch-${N.id}`,Ut=le?1:0;return a.jsxs(b.Fragment,{children:[a.jsxs("div",{"data-row-key":N.id,"data-row-scope":"workspaces",className:jc(N.id===C,Xn.selected.includes(N.id),!1,!!le)+" row--project"+Nl.dropClass(N.id),style:Li(Ut,Ke(le)),...bs(N),children:[nu(le),ke&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в другую папку или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...Nl.gripHandlers(N.id),children:a.jsx(Qf,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":we.open,"aria-controls":Ie,"aria-label":`${we.open?"Свернуть":"Развернуть"} проект «${N.name}»`,title:we.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{pn()||Gl(N,we)},children:a.jsx(od,{open:we.open})}),a.jsxs("button",{className:"row__main",onClick:Zl=>{pn()||Xn.click(Zl,N,()=>{P(N.id),as(N.id,!0)})},onKeyDown:Zl=>Nl.onKeyDown(N.id,Zl),children:[a.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:N.path,children:N.path})]}),we.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Сессий в проекте",children:we.count})]}),we.open&&a.jsx("div",{id:Ie,role:"group","aria-label":`Сессии проекта «${N.name}»`,className:le?"tree__branch tree__branch--railed":"tree__branch",style:Li(Ut,Ke(le)),children:a.jsx(mS,{workspace:N,baseDepth:Ut+1,loaded:we.entry!==void 0,sessions:((Kl=we.entry)==null?void 0:Kl.sessions)??Mb,archived:((pl=we.entry)==null?void 0:pl.archived)??Mb,folders:h.filter(Zl=>Zl.workspaceId===N.id),needle:st,showAll:we.showAll,reorderEnabled:ke,listOrder:v,liveSessionsFirst:T,activeSessionId:A,archiveExpanded:rl.includes(N.id),onToggleArchive:()=>ql(N.id),creatingFolder:kt===N.id,onStartCreateFolder:()=>Lt(N.id),onFinishCreateFolder:()=>Lt(null),renamingId:Ae,setRenamingId:Me,renderFolderHead:Ft,isFolderOpen:hl,folderRowStyle:Ke,longPress:De,onOpenSession:V,onRenameSession:W,onPinSessions:I,onArchiveSessions:R,onUnarchiveSessions:O,onCreateFolder:ee,onAssignToFolder:Se,onReorder:w})})]},N.id)}function $e(N,le){return a.jsxs("div",{className:jc(N.id===C,kl.selected.includes(N.id),!1,!!le),style:Ke(le),...qi(N),children:[nu(le),a.jsxs("button",{className:"row__main",onClick:we=>{pn()||kl.click(we,N,()=>P(N.id))},children:[a.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:HS(N)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>D([N.id]),children:"Вернуть"})]},N.id)}function Tt(N,le){const we=ps(N);return a.jsxs("div",{"data-row-key":we,"data-row-scope":"pinned",className:jc(N.id===A,!1,N.provider==="antigravity",!!le)+tn.dropClass(we),style:Ke(le),...Ae===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Vl(N)},children:[nu(le),Ae===N.id?a.jsx("div",{className:"row__main",children:a.jsx(da,{value:N.title??"",onCommit:Ie=>{W(N,Ie),Me(null)},onCancel:()=>Me(null)})}):a.jsxs(a.Fragment,{children:[ke&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...tn.gripHandlers(we),children:a.jsx(Qf,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{pn()||V(N)},onKeyDown:Ie=>tn.onKeyDown(we,Ie),children:[a.jsx(nd,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:Ze(N.workspaceId),projectPath:hn(N.workspaceId)}),a.jsx(jp,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]})]})]},N.id)}function jt(N){const le=ps(N);return a.jsx("div",{"data-row-key":le,"data-row-scope":"live",className:jc(N.id===A,!1,N.provider==="antigravity")+$l.dropClass(le),...Ae===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",..._s(N)},children:Ae===N.id?a.jsx("div",{className:"row__main",children:a.jsx(da,{value:N.title??"",onCommit:we=>{W(N,we),Me(null)},onCancel:()=>Me(null)})}):a.jsxs(a.Fragment,{children:[ke&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...$l.gripHandlers(le),children:a.jsx(Qf,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{pn()||V(N)},onKeyDown:we=>$l.onKeyDown(le,we),children:[a.jsx(nd,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:Ze(N.workspaceId),projectPath:hn(N.workspaceId)}),a.jsx(jp,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:we=>{we.stopPropagation(),!pn()&&K(N)},children:a.jsx(wS,{})})]})},N.id)}function Ft(N,le,we={}){return a.jsx(jS,{folder:N,count:le,depth:we.depth??0,droppable:we.droppable===!0,dropActive:we.droppable===!0&&Nl.isDropFolder(N.id),open:hl(N.id),renaming:Xe===N.id,onToggle:()=>$n(N.id),onStartRename:()=>Ue(N.id),onCommitRename:Ie=>{B(N.id,Ie),Ue(null)},onCancelRename:()=>Ue(null),onDelete:()=>pe(N.id),color:gn(N),onPreviewColor:Ie=>{window.clearTimeout(dt.current),Ge({folderId:N.id,color:Ie})},onCommitColor:Ie=>{Ge({folderId:N.id,color:Ie}),Q(N.id,Ie),window.clearTimeout(dt.current),dt.current=window.setTimeout(()=>Ge(null),4e3)},onResetColor:()=>{window.clearTimeout(dt.current),Ge(null),Q(N.id,null)}},N.id)}return a.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:s?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Ob[_e]}`,"aria-label":`Тема: ${Ob[_e]}. Переключить`,onClick:Y,children:a.jsx(MS,{mode:_e})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Bt==="default",className:Bt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>on("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Bt==="pinned",className:Bt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>on("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Bt==="live",className:Bt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>on("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(kS,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:je,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:N=>ht(N.target.value),onKeyDown:N=>{N.stopPropagation(),N.key==="Escape"&&(N.preventDefault(),je?ht(""):N.currentTarget.blur())}}),je&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>ht(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Bt==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Df,{title:"Закреплённые",count:X.length,open:yt("pinned"),onToggle:()=>Le("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{ct("pinned"),yt("pinned")||Le("pinned")}}}),yt("pinned")&&a.jsxs(a.Fragment,{children:[rt==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(da,{value:"",placeholder:"Название папки",onCommit:N=>{ee("pinned",N),ct(null)},onCancel:()=>ct(null)})})}),X.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ot?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Wn.groups.map(N=>a.jsxs(b.Fragment,{children:[Ft(N.folder,N.items.length),hl(N.folder.id)&&N.items.map(le=>Tt(le,N.folder))]},N.folder.id)),Wn.ungrouped.map(N=>Tt(N))]})]}):Bt==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Df,{title:"Запущенные",count:de.length,open:yt("live"),onToggle:()=>Le("live")}),yt("live")&&a.jsxs(a.Fragment,{children:[de.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ot?"Ничего не найдено":"Нет запущенных сессий"})}),de.map(N=>jt(N))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Df,{title:"Проекты",count:Be.length,open:yt("workspaces"),onToggle:()=>Le("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{ct("workspace"),yt("workspaces")||Le("workspaces")}}}),yt("workspaces")&&a.jsxs(a.Fragment,{children:[rt==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(da,{value:"",placeholder:"Название папки",onCommit:N=>{ee("workspace",N),ct(null)},onCancel:()=>ct(null)})})}),Be.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ot?"Ничего не найдено":"Пока ни одного"})}),Yl.groups.map(N=>a.jsxs(b.Fragment,{children:[Ft(N.folder,N.items.length,{droppable:ke}),hl(N.folder.id)&&N.items.map(le=>He(le,N.folder))]},N.folder.id)),Yl.ungrouped.map(N=>He(N)),Nl.canUngroup&&a.jsx("div",{className:Nl.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Df,{title:"Архив проектов",count:Fe.length,open:yt("workspacesArchive"),onToggle:()=>Le("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),yt("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Fe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:ot?"Ничего не найдено":"Пока пусто"})}),wl.groups.map(N=>a.jsxs(b.Fragment,{children:[Ft(N.folder,N.items.length),hl(N.folder.id)&&N.items.map(le=>$e(le,N.folder))]},N.folder.id)),wl.ungrouped.map(N=>$e(N))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:Ce,children:[a.jsx("span",{className:xe!=null&&xe.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:xe===null?"Аккаунт":xe.loggedIn?xe.email||"Вход выполнен":"Войти в аккаунт"}),(xe==null?void 0:xe.plan)&&a.jsx("span",{className:"chip",children:xe.plan})]}),te&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:te,children:[a.jsx("span",{className:k!=null&&k.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:k===null?"Удалённый доступ":k.paired?k.connected?k.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(k==null?void 0:k.connected)&&k.clients>0&&a.jsx("span",{className:"chip",children:k.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!ie,title:"MCP-серверы и плагины",onClick:()=>ie==null?void 0:ie(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:q,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:be,children:"+ Проект"}),a.jsx(uS,{disabled:!C,providers:ue,onStart:H})]})]}),Et&&a.jsx(Bi,{x:Et.x,y:Et.y,items:Nn,note:ys,onClose:el}),un&&a.jsx(Bi,{x:un.x,y:un.y,items:cs,note:Tl,onClose:qt}),mt&&a.jsx(Bi,{x:mt.x,y:mt.y,items:E,note:_p,onClose:Dn}),Vn&&a.jsx(Bi,{x:Vn.x,y:Vn.y,items:ge,note:_p,onClose:Gt})]})}const Mb=[];function tu(l,s){return(l.title??"").toLowerCase().includes(s)}function nu(l){return l?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function Li(l,s){return{"--depth":l,...s}}function mS({workspace:l,baseDepth:s,loaded:r,sessions:c,archived:o,folders:d,needle:h,showAll:m,reorderEnabled:g,listOrder:x,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:T,creatingFolder:w,onStartCreateFolder:C,onFinishCreateFolder:A,renamingId:P,setRenamingId:W,renderFolderHead:K,isFolderOpen:I,folderRowStyle:V,longPress:U,onOpenSession:D,onRenameSession:R,onPinSessions:O,onArchiveSessions:ee,onUnarchiveSessions:B,onCreateFolder:Q,onAssignToFolder:pe,onReorder:Se}){var Lt;const be=l.id,H=h!=="",ue=b.useMemo(()=>{const je=$f(c,x==null?void 0:x.sessions[be],ps,"top");return y?J_(je):je},[c,x,be,y]),ie=b.useMemo(()=>m?ue:ue.filter(je=>tu(je,h)),[ue,m,h]),xe=b.useMemo(()=>m?o:o.filter(je=>tu(je,h)),[o,m,h]),Ce=b.useMemo(()=>lu(ie,d,void 0,!H),[ie,d,H]),k=b.useMemo(()=>lu(xe,d),[xe,d]),te=(((Lt=x==null?void 0:x.sessions[be])==null?void 0:Lt.length)??0)>0,q=Vf({enabled:g,scope:"sessions",workspaceId:be,itemKey:ps,groups:Ce.groups,ungrouped:Ce.ungrouped,onReorder:Se}),_e=yp(ie),[Y,Ae]=b.useState(null),[Me,Xe]=b.useState(!1);b.useEffect(()=>Xe(!1),[h]);const Ue=H&&xe.length>0,bt=Ue?!Me:v;function Ge(){const je=Y==null?void 0:Y.opener;Ae(null),je!=null&&je.isConnected&&je.focus()}function gn(je){return{onContextMenu:ht=>{ht.preventDefault(),Ae({x:ht.clientX,y:ht.clientY,opener:ht.currentTarget,ids:_e.targetsFor(je)})},onTouchStart:ht=>U.start(ht,(_t,rn,pt)=>Ae({x:_t,y:rn,opener:pt,ids:_e.targetsFor(je)})),onTouchMove:U.move,onTouchEnd:U.end,onTouchCancel:U.end}}const Ke=Y?ie.find(je=>je.id===Y.ids[0]):void 0,dt=(Ke==null?void 0:Ke.pinned)!==!0,rt=Y?[...Y.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>W(Y.ids[0])}]:[],{id:"pin",label:dt?Y.ids.length>1?`Закрепить (${Y.ids.length})`:"Закрепить":Y.ids.length>1?`Открепить (${Y.ids.length})`:"Открепить",onSelect:()=>{O(be,Y.ids,dt),_e.clear()}},{id:"archive",label:Y.ids.length>1?`Убрать в архив (${Y.ids.length})`:"Убрать в архив",onSelect:()=>{ee(be,Y.ids),_e.clear()}},...Po({folders:d,ids:Y.ids,hasFolder:(Ke==null?void 0:Ke.folderId)!=null,assign:(je,ht)=>pe("session",je,ht,be),onClear:()=>_e.clear(),onNewFolder:C}),...Y.ids.length===1&&g&&Ke?q.menuItems(ps(Ke),te):[]]:[];function ct(je,ht,_t){const rn=ps(je);return a.jsxs("div",{"data-row-key":rn,"data-row-scope":"sessions",className:jc(je.id===j,_e.selected.includes(je.id),je.provider==="antigravity",!!_t)+q.dropClass(rn),style:Li(ht,V(_t)),...P===je.id?{}:gn(je),children:[nu(_t),P===je.id?a.jsx("div",{className:"row__main",children:a.jsx(da,{value:je.title??"",onCommit:pt=>{R(je,pt),W(null)},onCancel:()=>W(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...q.gripHandlers(rn),children:a.jsx(Qf,{})}),a.jsxs("button",{className:"row__main",onClick:pt=>{U.consumed()||_e.click(pt,je,()=>D(je))},onKeyDown:pt=>q.onKeyDown(rn,pt),children:[a.jsx(nd,{title:je.title??"Без названия",pinned:je.pinned===!0,provider:je.provider}),a.jsx(jp,{session:je,tail:new Date(je.updatedAt).toLocaleString()})]}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{U.consumed()||W(je.id)},children:"✎"})]})]},je.id)}function kt(je,ht,_t){return a.jsxs("div",{className:jc(je.id===j,!1,je.provider==="antigravity",!!_t),style:Li(ht,V(_t)),children:[nu(_t),a.jsxs("button",{className:"row__main",onClick:()=>D(je),children:[a.jsx(nd,{title:je.title??"Без названия",pinned:!1,provider:je.provider}),a.jsx("span",{className:"row__meta",children:US(je)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>B(be,[je.id]),children:"Вернуть"})]},je.id)}return a.jsxs(a.Fragment,{children:[w&&a.jsx("div",{className:"row row--hint",style:Li(s,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(da,{value:"",placeholder:"Название папки",onCommit:je=>{Q("session",je,be),A()},onCancel:A})})}),r?ie.length===0&&a.jsx("div",{className:"row row--hint",style:Li(s,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:Li(s,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),Ce.groups.map(je=>a.jsxs(b.Fragment,{children:[K(je.folder,je.items.length,{depth:s}),I(je.folder.id)&&je.items.map(ht=>ct(ht,s+1,je.folder))]},je.folder.id)),Ce.ungrouped.map(je=>ct(je,s)),r&&o.length>0&&(!H||xe.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(gS,{title:"Архив",count:xe.length,open:bt,depth:s,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>Ue?Xe(je=>!je):T()}),bt&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:Li(s,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),k.groups.map(je=>a.jsxs(b.Fragment,{children:[K(je.folder,je.items.length,{depth:s}),I(je.folder.id)&&je.items.map(ht=>kt(ht,s+1,je.folder))]},je.folder.id)),k.ungrouped.map(je=>kt(je,s))]})]}),Y&&a.jsx(Bi,{x:Y.x,y:Y.y,items:rt,note:_p,onClose:Ge})]})}function gS({title:l,count:s,open:r,depth:c,hint:o,onToggle:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return a.jsx("div",{className:"row",style:vp(c),children:a.jsxs("button",{className:"row__main",style:ny,"aria-expanded":r,title:`${h} — ${o}`,onClick:d,children:[a.jsx(od,{open:r}),a.jsx("span",{style:ly,children:l}),a.jsx("span",{className:"sidebar__count",children:s})]})})}function jc(l,s,r,c){const o=["row"];return c&&o.push("row--foldered"),l&&o.push("row--active"),s&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function lu(l,s,r=o=>o.folderId,c=!1){const o=new Map(s.map(g=>[g.id,g])),d=new Map,h=[];for(const g of l){const x=r(g),y=x?o.get(x):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 s)d.has(g.id)||d.set(g.id,[]);return{groups:[...d.entries()].map(([g,x])=>({folder:o.get(g),items:x})).sort((g,x)=>g.folder.name.localeCompare(x.folder.name,"ru")),ungrouped:h}}function xS(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const Xf="\0ungrouped";function bS(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),Xf);return c}function ep(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);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 Vf(l){const[s,r]=b.useState(null),[c,o]=b.useState(null),[d,h]=b.useState(null),m=l.onMoveToGroup,g=b.useMemo(()=>xS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),x=b.useMemo(()=>bS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),y=b.useRef({raf:0,el:null,x:0,y:0}),j=b.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function T(B){v();const Q=y.current;if(Q.el=B.closest(".sidebar__scroll"),!Q.el)return;const pe=56,Se=16,be=()=>{const H=Q.el;if(!H)return;const ue=H.getBoundingClientRect();let ie=0;if(Q.y<ue.top+pe?ie=-Se*Math.min(1,(ue.top+pe-Q.y)/pe):Q.y>ue.bottom-pe&&(ie=Se*Math.min(1,(Q.y-(ue.bottom-pe))/pe)),ie!==0){const xe=H.scrollTop;H.scrollTop=xe+ie,H.scrollTop!==xe&&j.current(Q.x,Q.y)}Q.raf=window.requestAnimationFrame(be)};Q.raf=window.requestAnimationFrame(be)}b.useEffect(()=>v,[]);function w(){v(),r(null),o(null),h(null)}function C(B,Q){l.enabled&&(Q.preventDefault(),Q.currentTarget.setPointerCapture(Q.pointerId),y.current.x=Q.clientX,y.current.y=Q.clientY,T(Q.currentTarget),r(B),o(null),h(null))}function A(B,Q){if(!s)return;const pe=document.elementFromPoint(B,Q),Se=x.get(s);if(m){const Ce=pe==null?void 0:pe.closest("[data-drop-folder]"),k=Ce?null:pe==null?void 0:pe.closest("[data-drop-zone]");if(Ce||k){const te=Ce?Ce.dataset.dropFolder:null,q=te??Xf;o(null),h(q===Se?null:{folderId:te});return}}const be=pe==null?void 0:pe.closest("[data-row-key]"),H=(be==null?void 0:be.dataset.rowScope)===l.scope?be.dataset.rowKey:void 0,ue=H?x.get(H):void 0;if(h(null),!H||H===s||ue===void 0||!m&&ue!==Se){o(null);return}const ie=be.getBoundingClientRect(),xe=Q-ie.top<ie.height/2?"before":"after";o(Ce=>(Ce==null?void 0:Ce.key)===H&&Ce.position===xe?Ce:{key:H,position:xe})}j.current=A;function P(B){y.current.x=B.clientX,y.current.y=B.clientY,A(B.clientX,B.clientY)}function W(){if(s&&d&&m)m(s,{folderId:d.folderId,order:null});else if(s&&c){const B=Rf(g,s,c.key,c.position),Q=x.get(c.key);m&&Q!==x.get(s)?m(s,{folderId:Q===Xf?null:Q??null,order:B}):B&&l.onReorder(l.scope,B,l.workspaceId)}w()}function K(B,Q){if(!l.enabled)return;const pe=ep(B,l.groups,l.ungrouped,l.itemKey,Q);if(!pe)return;const Se=Rf(g,B,pe.target,pe.position);Se&&l.onReorder(l.scope,Se,l.workspaceId)}function I(B,Q){const pe=ep(B,l.groups,l.ungrouped,l.itemKey,"up"),Se=ep(B,l.groups,l.ungrouped,l.itemKey,"down"),be=[{id:"move-up",label:"Переместить выше",disabled:!pe,onSelect:()=>{if(!pe)return;const H=Rf(g,B,pe.target,pe.position);H&&l.onReorder(l.scope,H,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!Se,onSelect:()=>{if(!Se)return;const H=Rf(g,B,Se.target,Se.position);H&&l.onReorder(l.scope,H,l.workspaceId)}}];return Q&&be.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),be}function V(B){return s===B?" row--dragging":(c==null?void 0:c.key)===B?c.position==="before"?" row--drop-before":" row--drop-after":""}function U(B){return{onPointerDown:Q=>C(B,Q),onPointerMove:P,onPointerUp:W,onPointerCancel:w,onLostPointerCapture:w}}function D(B,Q){!Q.altKey||Q.key!=="ArrowUp"&&Q.key!=="ArrowDown"||(Q.preventDefault(),K(B,Q.key==="ArrowUp"?"up":"down"))}const R=B=>(d==null?void 0:d.folderId)===B,O=!!m&&s!==null&&x.get(s)!==Xf,ee=d!==null&&d.folderId===null;return{dragging:s!==null,dropClass:V,gripHandlers:U,onKeyDown:D,menuItems:I,isDropFolder:R,canUngroup:O,zoneActive:ee}}function Po(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function _S(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function yp(l){const[s,r]=b.useState([]),c=b.useRef(null);function o(){r([]),c.current=null}function d(m,g,x){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=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,T]=y<j?[y,j]:[j,y];r(l.slice(v,T+1).map(w=>w.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const yS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},vS={width:22,height:22,borderRadius:6};function Df({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:yS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(od,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:l}),a.jsx("span",{className:"sidebar__count",children:s})]}),d&&a.jsx("button",{className:"theme-btn",style:vS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(ES,{})})]})}function vp(l){return{paddingLeft:`calc(37px + ${l} * var(--tree-indent, 24px))`}}const ny={display:"flex",alignItems:"center",gap:6,width:"100%"},ly={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function jS({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:x,onPreviewColor:y,onCommitColor:j,onResetColor:v,depth:T,droppable:w,dropActive:C}){const A=b.useRef(null),P=b.useRef(j);return P.current=j,b.useEffect(()=>{const W=A.current;if(!W)return;const K=()=>P.current(W.value);return W.addEventListener("change",K),()=>W.removeEventListener("change",K)},[c]),c?a.jsx("div",{className:"row",style:vp(T),children:a.jsx("div",{className:"row__main",children:a.jsx(da,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):a.jsxs("div",{className:C?"row row--drop-target":"row",style:vp(T),"data-drop-folder":w?l.id:void 0,children:[a.jsxs("button",{className:"row__main",style:ny,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[a.jsx(od,{open:r}),a.jsx("span",{style:ly,children:l.name}),a.jsx("span",{className:"sidebar__count",children:s})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),a.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),a.jsx("input",{ref:A,type:"color",value:x??SS(),"aria-label":`Цвет папки «${l.name}»`,onChange:W=>y(W.target.value)})]}),l.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:v,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function SS(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function od({open:l}){return a.jsx("svg",{className:l?"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 Qf(){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 wS(){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 NS({className:l}){return a.jsxs("svg",{className:l,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 kS(){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 ES(){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 TS(){try{const l=localStorage.getItem(W_);if(l===null)return["workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Rb(l){try{const s=localStorage.getItem(l);if(s===null)return[];const r=JSON.parse(s);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Db(l,s){try{localStorage.setItem(l,JSON.stringify(s))}catch{}}function CS(){try{const l=localStorage.getItem(ty);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function AS(){try{const l=localStorage.getItem(ey);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Ob={system:"как в системе",light:"светлая",dark:"тёмная"};function MS({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?a.jsx("svg",{...s,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"})}):l==="light"?a.jsxs("svg",{...s,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",{...s,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 RS(l){const s=DS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${P_(r)}`:s}function DS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":OS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function OS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function LS(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":zS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function zS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function jp({session:l,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${LS(l)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),RS(l)]})," · ",s]})}function nd({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[s&&a.jsx(NS,{className:"row__pin"}),r==="antigravity"&&a.jsx(qp,{className:"row__provider"}),l]}),c!==void 0&&a.jsx("span",{className:"row__project",title:o,children:c})]})}function US(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function HS(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const Lb=3,BS=15e5;function sy(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=tp(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=YS(IS(tp(r.old_string),tp(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 tp(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function IS(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...qS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function qS(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(y=>({type:"add",text:y}));if(s.length===0)return l.map(y=>({type:"del",text:y}));if((l.length+1)*(s.length+1)>BS)return[...l.map(y=>({type:"del",text:y})),...s.map(y=>({type:"add",text:y}))];const r=l.length,c=s.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]=l[y]===s[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,x=0;for(;g<r&&x<c;){const y=l[g],j=s[x];y===j?(m.push({type:"ctx",text:y}),g++,x++):h(g+1,x)>=h(g,x+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),x++)}for(;g<r;)m.push({type:"del",text:l[g++]});for(;x<c;)m.push({type:"add",text:s[x++]});return GS(m)}function GS(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function YS(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Lb);m<=Math.min(l.length-1,h+Lb);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${$S(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function $S(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function ha(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function Sp(){try{return await navigator.clipboard.readText()}catch{return null}}const Gp=1600,Tr="Копировать",Ec="Скопировано";function Uc({text:l,hint:s,className:r}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Gp);return()=>clearTimeout(d)},[c]),b.useEffect(()=>o(!1),[l]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Ec:`${Tr} ${s}`,title:c?Ec:`${Tr} ${s}`,onClick:()=>{ha(l).then(d=>{d&&o(!0)})},children:c?Ec:Tr})}function Yp({diff:l}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&a.jsx("div",{className:"diff__note",children:l.note}),a.jsx("div",{className:"diff__body",children:l.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>a.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function XS({waiting:l}){const[s,r]=b.useState(0);return b.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:l?"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:l?"ждёт разрешения":"думает"}),!l&&a.jsxs("span",{className:"work__time",children:[s," с"]})]})}function $p({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=b.useRef(null),j=b.useRef(null),v=b.useRef(!0),T=b.useRef(null),w=b.useRef(null),C=b.useRef(!1);b.useEffect(()=>{v.current=!0,T.current=null,C.current=!1,w.current!==null&&(clearTimeout(w.current),w.current=null)},[m]),b.useEffect(()=>{const I=y.current,V=j.current;if(!I||!V)return;function U(O){!I||O===I.scrollTop||(C.current=!0,I.scrollTop=O)}function D(){if(!I)return;const O=T.current;if(O){const ee=Ub(I,O.id);if(ee){const B=ee.getBoundingClientRect().top-I.getBoundingClientRect().top;U(I.scrollTop+(B-O.top))}w.current!==null&&clearTimeout(w.current),w.current=setTimeout(()=>{T.current=null},500);return}v.current&&U(I.scrollHeight)}const R=new ResizeObserver(D);return R.observe(V),()=>{R.disconnect(),w.current!==null&&clearTimeout(w.current)}},[]);function A(){const I=y.current;if(I){if(C.current){C.current=!1;return}v.current=I.scrollHeight-I.scrollTop-I.clientHeight<80}}function P(){if(d)return;const I=y.current,V=c[0];if(I&&V){const U=Ub(I,V.id);U&&(T.current={id:V.id,top:U.getBoundingClientRect().top-I.getBoundingClientRect().top})}h==null||h()}let W=0;function K(I){return I.kind==="user"?W++:-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:P,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(I=>a.jsx(zb,{item:I,userIndex:K(I),onEditMessage:g},I.id)),c.length>0&&l.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&a.jsx("p",{className:"empty",children:x}),l.map(I=>a.jsx(zb,{item:I,userIndex:K(I),onEditMessage:g},I.id)),s&&a.jsx(XS,{waiting:r})]})})}function zb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return a.jsx(QS,{item:l,userIndex:s,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[a.jsx(KS,{text:l.text}),l.streaming&&a.jsx("span",{className:"caret"}),l.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(Uc,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return a.jsx(FS,{item:l});case"result":return a.jsxs("div",{className:"result-line","data-item-id":l.id,children:[a.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),a.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&a.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",Bb(l.inputTokens)," ↓",Bb(l.outputTokens)]})]});case"notice":return a.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const VS=500;function QS({item:l,userIndex:s,onEditMessage:r}){const[c,o]=b.useState(null),[d,h]=b.useState(!1),[m,g]=b.useState(l.text),x=b.useRef(null),y=b.useRef(!1),j=ad("(max-width: 860px)"),v=b.useRef(null);function T(R,O){o({x:R,y:O})}function w(R){R.preventDefault(),T(R.clientX,R.clientY)}function C(R){const O=R.touches[0];if(!O)return;const ee={timer:0,x:O.clientX,y:O.clientY,fired:!1};ee.timer=window.setTimeout(()=>{ee.fired=!0,T(ee.x,ee.y)},VS),v.current=ee}function A(R){const O=v.current,ee=R.touches[0];!O||!ee||Math.hypot(ee.clientX-O.x,ee.clientY-O.y)>10&&(window.clearTimeout(O.timer),v.current=null)}function P(R){const O=v.current;O&&(window.clearTimeout(O.timer),O.fired&&R.preventDefault())}function W(){g(l.text),h(!0)}function K(){h(!1)}function I(){const R=m.trim();if(R===""&&!(l.images&&l.images.length>0))return;const O=r==null?void 0:r(s,R,l.images);if(O instanceof Promise){if(y.current)return;y.current=!0,O.then(ee=>{y.current=!1,ee&&h(!1)},()=>{y.current=!1});return}O!==!1&&h(!1)}b.useEffect(()=>{const R=x.current;!R||!d||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,d]),b.useEffect(()=>{if(!d)return;const R=x.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[d]);function V(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),K();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),I())}const U=l.images&&l.images.length>0&&a.jsx("div",{className:"msg--user__images",children:l.images.map((R,O)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},O))});if(d){const R=m.trim()!==""||!!(l.images&&l.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[U,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:O=>g(O.target.value),onKeyDown:V,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:K,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:I,disabled:!R,children:"Сохранить"})]})]})]})}const D=[{id:"copy",label:"Копировать",onSelect:()=>void ha(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:W}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:w,onTouchStart:C,onTouchMove:A,onTouchEnd:P,onTouchCancel:P,children:[U,l.text,c&&a.jsx(Bi,{x:c.x,y:c.y,items:D,onClose:()=>o(null)})]})}function Ub(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function KS({text:l}){const[s,r]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let d=!1;return cd(l).then(h=>{d||r(ZS(h))}),()=>{d=!0}},[l]),b.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&ha(m).then(y=>{if(!y)return;h.textContent=Ec,h.setAttribute("aria-label",Ec),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Tr,h.setAttribute("aria-label",wp),h.classList.remove("copybtn--done"))},Gp);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const wp=`${Tr} блок кода`;function ZS(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",wp),o.title=wp,o.textContent=Tr,c.append(o)}return s.body.innerHTML}function FS({item:l}){const[s,r]=b.useState(!1),c=l.result===null,o=sy(l.name,l.input),d=l.name==="AskUserQuestion"?WS(l.input):null;return a.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:l.name}),a.jsx("span",{className:"tool__arg",children:d?PS(d):JS(l.input)}),a.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(ew,{questions:d,answers:l.answers}):o?a.jsx(Yp,{diff:o}):a.jsx(Hb,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&a.jsx(Hb,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Hb({text:l,hint:s,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:l}),a.jsx(Uc,{text:l,hint:s,className:"codeblock__copy"})]})}function JS(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function PS(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function WS(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){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 x of h){if(typeof x!="object"||x===null)return null;const{label:y,description:j,preview:v}=x;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 ew({questions:l,answers:s}){return a.jsx("div",{className:"tool__questions",children:l.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:s!=null&&s[r.question]?a.jsx("span",{className:"tool__answer-value",children:s[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Bb(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const tw="ccv.dictation.lang",Ib="ru-RU";function nw(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function qb(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(nw);return!r&&s.length>0&&zs("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function ay(){var l;try{return((l=localStorage.getItem(tw))==null?void 0:l.trim())||Ib}catch{return Ib}}function zs(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const lw=3,sw=400,aw=5,iw=250,rw=2e3,cw=2e4;async function ow(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const uw={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${ay()}`};function fw(l){const[s]=b.useState(()=>qb()!==null),[r,c]=b.useState(!1),[o,d]=b.useState(null),h=b.useRef(null),m=b.useRef(!1),g=b.useRef(!1),x=b.useRef(l),y=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=b.useRef(null),v=b.useRef(!1),T=b.useRef(null),w=b.useCallback(()=>{T.current&&clearTimeout(T.current),T.current=null},[]),C=b.useCallback(()=>{w();const I=async V=>{if(T.current=null,!(!m.current||v.current)){if(!V&&!await ow()){if(zs("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;T.current=setTimeout(()=>void I(!0),cw);return}zs("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};T.current=setTimeout(()=>void I(!1),rw)},[w]);b.useEffect(()=>{x.current=l}),b.useEffect(()=>{const I=qb();if(!I)return;const V=new I;return V.lang=ay(),V.continuous=!0,V.interimResults=!0,V.onstart=()=>{zs("сессия открыта"),v.current=!0,w(),c(!0)},V.onaudiostart=()=>{zs("пошёл звук с микрофона"),y.current.audio=!0},V.onresult=U=>{var ee;if(g.current)return;let D="",R="";for(let B=U.resultIndex;B<U.results.length;B++){const Q=U.results[B];if(!Q)continue;const pe=((ee=Q[0])==null?void 0:ee.transcript)??"";Q.isFinal?D+=pe:R+=pe}const O=y.current;O.heard=!0,O.everHeard=!0,zs("распознано",{final:D,interim:R}),x.current(D,R)},V.onerror=U=>{y.current.lastError=U.error,zs("ошибка движка",U.error),!(U.error==="no-speech"||U.error==="aborted")&&(m.current=!1,c(!1),d(uw[U.error]??`Распознавание не работает: ${U.error}`))},V.onend=()=>{g.current=!1,v.current=!1;const U=y.current,D=Date.now()-U.openedAt;if(zs("сессия закрыта",{мс:D,звук:U.audio,слова:U.heard,ошибка:U.lastError||null}),!m.current){c(!1);return}if(U.dead=!U.audio&&D<sw?U.dead+1:0,U.dead>=aw){m.current=!1,c(!1),d(U.lastError?`Распознавание не работает: ${U.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}U.silent=U.heard?0:U.silent+1,!U.everHeard&&!U.warned&&U.silent>=lw&&(U.warned=!0,d(U.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){U.openedAt=Date.now(),U.audio=!1,U.heard=!1,U.lastError="",C();try{V.start()}catch{}}},iw)},h.current=V,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,w(),V.onend=null,V.onresult=null,V.onerror=null,V.onstart=null,V.onaudiostart=null,V.abort(),h.current=null}},[]);const A=b.useCallback(()=>{var I;if(m.current){if(m.current=!1,zs("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,w(),!v.current){c(!1);return}(I=h.current)==null||I.stop()}},[]),P=b.useCallback(()=>{const I=h.current;if(I){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),zs("включение микрофона",{язык:I.lang}),C();try{I.start()}catch(V){zs("start() не прошёл",V)}}},[C]),W=b.useCallback(()=>{m.current?A():P()},[P,A]),K=b.useCallback(()=>{var I;m.current&&v.current&&(g.current=!0,(I=h.current)==null||I.abort())},[]);return{supported:s,listening:r,error:o,toggle:W,stop:A,drop:K}}const dw="(max-width: 860px)",Gb=/^\/(\S*)$/,hw=new Set(["model","permissions"]);function pw(l){return hw.has(l.name)||l.name.startsWith("__")}const mw=new Set(["clear","rename"]),Yb=/(?:^|\s)@([^\s@]*)$/,gw=200,xw=100,bw=190,_w=5,yw=20*1024*1024,vw=1568,jw=.85;let $b=0;async function Sw(l){var j,v;if(!l.type.startsWith("image/")||l.size>yw)return null;const s=await ww(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,vw/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(s.image,0,0,d.width,d.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",x=d.toDataURL(g,m?void 0:jw),y=x.slice(x.indexOf(",")+1);return y?($b+=1,{id:`att${$b}`,mediaType:g,data:y,previewUrl:x}):null}async function ww(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function iy({disabled:l,busy:s,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:T,onSend:w,onInterrupt:C,onEscape:A}){var hn;const P=ad(dw),[W,K]=b.useState(()=>m?$h(m):""),[I,V]=b.useState(!1),[U,D]=b.useState(0),R=b.useRef(null),O=b.useRef(null),ee=b.useRef(!1),B=b.useRef(null),[Q,pe]=b.useState(()=>m?$h(m).length:0),[Se,be]=b.useState([]),H=b.useRef(null),ue=b.useCallback(X=>{!y||X.length===0||Promise.all(X.map(Sw)).then(de=>{const ke=de.filter(Le=>Le!==null);ke.length!==0&&be(Le=>[...Le,...ke].slice(0,_w))})},[y]);function ie(X){be(de=>de.filter(ke=>ke.id!==X))}function xe(X){var Le;if(!y)return;const de=(Le=X.clipboardData)==null?void 0:Le.items;if(!de)return;const ke=[];for(const yt of de){if(!yt.type.startsWith("image/"))continue;const $n=yt.getAsFile();$n&&ke.push($n)}ke.length!==0&&(X.preventDefault(),ue(ke))}function Ce(X){const de=X.target.files?Array.from(X.target.files):[];X.target.value="",ue(de)}b.useEffect(()=>{y||be([])},[y]);const[k,te]=b.useState([]),[q,_e]=b.useState(-1),Y=b.useRef(""),[Ae,Me]=b.useState(""),Xe=fw(b.useCallback((X,de)=>{X&&K(ke=>np(ke,X)),Me(de.trim())},[])),Ue=Ae?np(W,Ae):W;b.useEffect(()=>{Xe.listening||Ae===""||(K(X=>np(X,Ae)),Me(""))},[Xe.listening,Ae]),b.useEffect(()=>{var X;x&&((X=R.current)==null||X.focus())},[x]);const bt=b.useRef(new Map),Ge=b.useRef(new Map),gn=b.useRef(m),Ke=b.useRef({text:W,caret:Q});Ke.current={text:W,caret:Q};const dt=b.useCallback((X,de,ke)=>{de===""?(bt.current.delete(X),Ge.current.delete(X)):(bt.current.set(X,de),Ge.current.set(X,ke)),__(X,de)},[]),rt=Xe.drop;b.useLayoutEffect(()=>{const X=gn.current;if(X===m)return;gn.current=m,X&&dt(X,Ke.current.text,Ke.current.caret);const de=m?bt.current.get(m)??$h(m):"",ke=m?Ge.current.get(m):void 0,Le=Math.min(ke??de.length,de.length);K(de),pe(Le),B.current=[Le,Le],Me(""),D(0),V(!1),_e(-1),Y.current="",be([]),rt()},[m,dt,rt]),b.useEffect(()=>{m&&dt(m,W,Q)},[m,W,Q,dt]);const ct=l?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",kt=b.useRef(0),Lt=b.useCallback(X=>{const de=parseFloat(getComputedStyle(X).maxHeight),ke=Number.isFinite(de)&&de>0?de:bw;X.style.height="auto";const Le=X.scrollHeight;X.style.height=`${Math.min(Le,ke)}px`,X.style.overflowY=Le>ke?"auto":"hidden"},[]);b.useEffect(()=>{const X=R.current;X&&Lt(X)},[Ue,ct,l,Lt]),b.useLayoutEffect(()=>{const X=R.current,de=B.current;!X||!de||(B.current=null,X.setSelectionRange(de[0],de[1]))}),b.useEffect(()=>{const X=R.current;if(!X)return;const de=new ResizeObserver(([ke])=>{const Le=ke==null?void 0:ke.contentRect.width;Le===void 0||Math.abs(Le-kt.current)<1||(kt.current=Le,Lt(X))});return de.observe(X),()=>de.disconnect()},[Lt]);const je=Xe.stop;b.useEffect(()=>{l&&je()},[l,je]);const ht=b.useMemo(()=>Xe.error?{ok:!1,message:Xe.error}:null,[Xe.error]),_t=b.useMemo(()=>{var ke;const X=(ke=Gb.exec(W))==null?void 0:ke[1];if(X===void 0)return[];const de=X.toLowerCase();return r.filter(Le=>!pw(Le)&&lp(Le,de)<ry).sort((Le,yt)=>lp(Le,de)-lp(yt,de))},[W,r]),rn=!I&&_t.length>0,pt=Math.min(U,_t.length-1),lt=I?null:((hn=Yb.exec(Ue.slice(0,Q)))==null?void 0:hn[1])??null,Bt=b.useRef(v);Bt.current=v,b.useEffect(()=>{if(lt===null||lt===""||lt.endsWith("/")){Bt.current(lt);return}const X=setTimeout(()=>Bt.current(lt),gw);return()=>clearTimeout(X)},[lt]);const Jn=lt!==null&&(o==null?void 0:o.query)===lt,Mt=Jn?o.entries:[],Wt=lt!==null,rl=Wt&&!Jn,wn=Math.min(U,Math.max(Mt.length-1,0));b.useEffect(()=>{var de,ke;if(!rn&&!Wt)return;const X=rn?pt:wn;(ke=(de=O.current)==null?void 0:de.children[X])==null||ke.scrollIntoView({block:"nearest"})},[rn,Wt,pt,wn]);function cn(X,de){var ke;K(X),pe(de),B.current=[de,de],D(0),V(!1),Ae!==""&&(Me(""),Xe.drop()),(ke=R.current)==null||ke.focus()}function Pn(){K(""),Me(""),D(0),pe(0),V(!1),_e(-1),Y.current="",be([]),Xe.drop(),m&&dt(m,"",0)}function on(X){const de=X.trim();if(de===""&&Se.length===0||l||j||ee.current)return;const ke=w(de,Se.length>0?Se.map(Le=>({mediaType:Le.mediaType,data:Le.data})):void 0);if(ke instanceof Promise){ee.current=!0,ke.then(Le=>{ee.current=!1,Le&&st(de)},()=>{ee.current=!1});return}ke!==!1&&st(de)}function st(X){X!==""&&te(de=>[X,...de.filter(ke=>ke!==X)].slice(0,xw)),Pn()}function ot(X){if(X<-1||X>=k.length)return;q===-1&&(Y.current=W);const de=X===-1?Y.current:k[X]??"";_e(X),cn(de,de.length)}function It(){var Le;const X=((Le=R.current)==null?void 0:Le.selectionStart)??Ue.length,ke=`${X>0&&!/\s$/.test(Ue.slice(0,X))?" ":""}@`;cn(Ue.slice(0,X)+ke+Ue.slice(X),X+ke.length)}function Yn(X){var yt;const de=(yt=Yb.exec(Ue.slice(0,Q)))==null?void 0:yt[1];if(de===void 0)return;const ke=Q-de.length-1,Le=X.kind==="dir"?`@${X.path}/`:`@${X.path} `;cn(Ue.slice(0,ke)+Le+Ue.slice(Q),ke+Le.length)}function re(){var de;if(j)return;const X=(de=Gb.exec(Ue.trim()))==null?void 0:de[1];if(X&&T(X)){Pn();return}on(Ue)}function ve(X,de){K(X),pe(de),D(0),V(!1),_e(-1),Ae!==""&&(Me(""),Xe.drop())}function Be(X){var Le;const de=mw.has(X.name)?c:null,ke=`/${X.name} `;K(ke+(de??"")),pe(ke.length+((de==null?void 0:de.length)??0)),de&&(B.current=[ke.length,ke.length+de.length]),D(0),(Le=R.current)==null||Le.focus()}function Fe(X){if(T(X.name)){K(""),D(0),V(!1);return}X.argumentHint?Be(X):on(`/${X.name}`)}function Ze(X){if(rn){if(X.key==="ArrowDown")return X.preventDefault(),D(de=>(Math.min(de,_t.length-1)+1)%_t.length);if(X.key==="ArrowUp"){X.preventDefault();const de=_t.length-1;return D(ke=>(Math.min(ke,de)+de)%_t.length)}if(X.key==="Enter"&&!X.shiftKey){X.preventDefault();const de=_t[pt];de&&Fe(de);return}if(X.key==="Tab"){X.preventDefault();const de=_t[pt];de&&Be(de);return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),V(!0);return}}if(Wt){if(X.key==="ArrowDown"&&Mt.length>0)return X.preventDefault(),D(de=>(Math.min(de,Mt.length-1)+1)%Mt.length);if(X.key==="ArrowUp"&&Mt.length>0){X.preventDefault();const de=Mt.length-1;return D(ke=>(Math.min(ke,de)+de)%Mt.length)}if(X.key==="Enter"&&!X.shiftKey||X.key==="Tab"){const de=Mt[wn];if(de){X.preventDefault(),Yn(de);return}if(X.key==="Tab")return}if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),V(!0);return}}if((X.key==="ArrowUp"||X.key==="ArrowDown")&&!X.shiftKey){const de=X.currentTarget,ke=de.selectionStart;if(de.selectionEnd===ke){const yt=X.key==="ArrowUp"?q+1:q-1;yt>=-1&&yt<k.length&&requestAnimationFrame(()=>{de.selectionStart===ke&&de.selectionEnd===ke&&ot(yt)})}}if(X.key==="Escape"&&A){X.preventDefault(),X.stopPropagation(),A();return}X.key==="Enter"&&!X.shiftKey&&!P&&(X.preventDefault(),re())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Mr,{result:ht}),Wt&&!rn&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:O,children:[Mt.map((X,de)=>a.jsxs("button",{role:"option","aria-selected":de===wn,className:de===wn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>D(de),onMouseDown:ke=>{ke.preventDefault(),Yn(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)),Mt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:rl?"ищем…":lt?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),rn&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:O,children:_t.map((X,de)=>a.jsxs("button",{role:"option","aria-selected":de===pt,className:de===pt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>D(de),onMouseDown:ke=>{ke.preventDefault(),Fe(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))}),Se.length>0&&a.jsx("div",{className:"composer__attachments",children:Se.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:()=>ie(X.id),children:a.jsx(Aw,{})})]},X.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:It,children:a.jsx(Ew,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:H,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Ce}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var X;return(X=H.current)==null?void 0:X.click()},children:a.jsx(Cw,{})})]}),a.jsx("textarea",{ref:R,value:Ue,disabled:l,placeholder:ct,onChange:X=>ve(X.target.value,X.target.selectionStart),onSelect:X=>pe(X.currentTarget.selectionStart),onKeyDown:Ze,onPaste:xe}),Xe.supported&&a.jsx("button",{type:"button",className:Xe.listening?"micbtn is-on":"micbtn",title:Xe.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Xe.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Xe.listening,disabled:l,onClick:Xe.toggle,children:a.jsx(Mw,{on:Xe.listening})}),s?a.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:re,disabled:l||j||Ue.trim()===""&&Se.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(Tw,{})]})]})]})})}function np(l,s){const r=s.trim();if(r==="")return l;const c=Np(r).slice(Nw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function Nw(l,s){const r=Np(l),c=Np(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>kw(d,c[h]??"")))return o;return 0}function Np(l){return l.split(/\s+/).filter(s=>s!=="")}function kw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function Ew(){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 Tw(){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 Cw(){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 Aw(){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 Mw({on:l}){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:l?"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 ry=4;function lp(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:ry}function Rw({request:l,plan:s,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=b.useState(s),[x,y]=b.useState("preview");b.useEffect(()=>{g(s),y("preview")},[l.requestId,s]);const j=m.trim().length>0;function v(){j&&d(l.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(cy,{})}),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"+(x==="preview"?" is-on":""),role:"tab","aria-selected":x==="preview",onClick:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(Xp,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[l.reason&&a.jsx("p",{className:"plansheet__reason",children:l.reason}),a.jsx("div",{className:"plansheet__content",children:x==="preview"?a.jsx(Dw,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:T=>g(T.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(l.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function Dw({text:l}){const[s,r]=b.useState("");return b.useEffect(()=>{let c=!1;return cd(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function cy(){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 Ow({kind:l,toolName:s,queued:r,onExpand:c}){const o=l==="question"?"Уточняющий вопрос":l==="plan"?"План на согласование":`Разрешить действие: ${s}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${l}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:l==="question"?"?":l==="plan"?a.jsx(cy,{}):"!"}),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 Xp({onClick:l}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:l,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 Lw({request:l,queued:s,collapsed:r,onCollapse:c,onDecide:o}){const d=sy(l.toolName,l.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:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),a.jsx(Xp,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&a.jsx("p",{className:"sheet__reason",children:l.reason}),d?a.jsx(Yp,{diff:d}):a.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(l.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(l.requestId,"allow"),children:"Разрешить"})]})]})})}function zw({request:l,queued:s,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=l,[m,g]=b.useState(()=>h.map(()=>new Set)),[x,y]=b.useState(()=>h.map(()=>"")),[j,v]=b.useState(()=>Xb(h));b.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(Xb(h))},[l.requestId]);const T=b.useMemo(()=>Hw(h,m,x),[h,m,x]),w=T!==null;function C(V,U){var D,R;(R=(D=h[V])==null?void 0:D.options[U])!=null&&R.preview&&v(O=>{const ee=O.slice();return ee[V]=U,ee})}function A(V,U,D){g(R=>{const O=R.slice(),ee=new Set(O[V]);return D?ee.has(U)?ee.delete(U):ee.add(U):ee.has(U)||(ee.clear(),ee.add(U)),O[V]=ee,O}),U!=="other"&&C(V,U)}function P(V,U){y(D=>{const R=D.slice();return R[V]=U,R})}function W(){T&&o(l.requestId,T)}function K(V){V.key==="Enter"&&(V.target.closest("button")||w&&(V.preventDefault(),W()))}function I(V){var O;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(V.key))return;const U=Array.from(V.currentTarget.querySelectorAll("button.qsheet__option")),D=U.indexOf(document.activeElement);if(D===-1)return;V.preventDefault();const R=V.key==="ArrowDown"||V.key==="ArrowRight"?1:-1;(O=U[(D+R+U.length)%U.length])==null||O.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:K,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})`,s>0&&` — ещё ${s} в очереди`]}),a.jsx(Xp,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[l.reason&&a.jsx("p",{className:"qsheet__reason",children:l.reason}),h.map((V,U)=>a.jsx(Uw,{q:V,qi:U,selected:m[U]??new Set,otherText:x[U]??"",previewIndex:j[U]??null,onToggle:A,onFocusOption:C,onOtherText:P,onOptionsKeyDown:I},U))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(l.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!w,onClick:W,children:"Ответить"})]})]})})}function Uw({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var T;const x=l.options.some(w=>w.preview),y=o!==null?(T=l.options[o])==null?void 0:T.preview:void 0,j=r.has("other"),v=l.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:l.header}),a.jsx("span",{className:"qsheet__qtext",children:l.question})]}),a.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((w,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(s,C,l.multiSelect),onFocus:()=>h(s,C),onMouseEnter:()=>h(s,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:w.label}),a.jsx("span",{className:"qsheet__opt-desc",children:w.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(s,"other",l.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":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:w=>m(s,w.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function Xb(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function Hw(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const x=d.options[g];x&&h.has(g)&&m.push(x.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 Bw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function oy({path:l}){const[s,r]=b.useState(!1),[c,o]=b.useState(!1),d=b.useRef(null);b.useEffect(()=>{if(!s)return;function m(g){var x;(x=d.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),b.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Gp);return()=>clearTimeout(m)},[c]),b.useEffect(()=>r(!1),[l]);async function h(){await ha(l)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(Iw,{open:s}),a.jsx("span",{className:"cwd__short",children:l})]}),s&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:l}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?Ec:Tr})]})]})}function Iw({open:l}){return a.jsx("svg",{className:l?"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 qw=["low","medium","high"];function uy({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[T,w]=b.useState(!1),[C,A]=b.useState(0),P=b.useRef(null),W=b.useRef(null),K=l.find(R=>R.value===s)??null,I=K&&K.supportsEffort?K.effortLevels.length>0?K.effortLevels:qw:[],V=I.includes("xhigh");b.useEffect(()=>{if(!T)return;const R=l.findIndex(O=>O.value===s);A(R===-1?0:R)},[T]),b.useEffect(()=>{if(!T)return;function R(O){var ee;(ee=P.current)!=null&&ee.contains(O.target)||w(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[T]),b.useEffect(()=>{var R,O;T&&((O=(R=W.current)==null?void 0:R.querySelector(".is-cursor"))==null||O.scrollIntoView({block:"nearest"}))},[T,C]);function U(R){w(!1),R.value!==s&&g(R.value)}function D(R){if(R.key==="Escape"){if(!T)return;R.preventDefault(),R.stopPropagation(),w(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!T)return w(!0);if(l.length===0)return;const O=R.key==="ArrowDown"?1:l.length-1;return A(ee=>(ee+O)%l.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!T)return w(!0);const O=l[C];O&&U(O)}}return a.jsxs("div",{ref:P,className:"select"+(T?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":T,onClick:()=>w(R=>!R),onKeyDown:D,children:[(K==null?void 0:K.displayName)??s?a.jsx("span",{className:"select__value",children:(K==null?void 0:K.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):I.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(Gw,{})]}),T&&a.jsxs("div",{ref:W,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((R,O)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===s,className:"select__option"+(O===C?" is-cursor":"")+(R.value===s?" is-on":""),onMouseEnter:()=>A(O),onClick:()=>U(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),I.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:I.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(R),children:R},R))})]}),V&&a.jsx(sp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(K==null?void 0:K.supportsThinking)!==!1&&a.jsx(sp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(sp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function sp({label:l,desc:s,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:[l,a.jsx("span",{className:"modelmenu__desc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function Gw(){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 ul({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=b.useRef(null);return b.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const y=x.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":l,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:l}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:s}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function Yw({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[T,w]=b.useState("open"),[C,A]=b.useState(""),[P,W]=b.useState(!1),[K,I]=b.useState(""),[V,U]=b.useState(""),[D,R]=b.useState({git:!0,claudeMd:!0,readme:!0}),O=C.trim(),ee=O!=="",B=K.trim(),Q=V.trim(),pe=B!==""&&Q!=="";b.useEffect(()=>{K===""&&d.length>0&&I(d[0])},[d]);const Se=b.useRef(m);Se.current=m,b.useEffect(()=>{if(T!=="open")return;const ie=C.trim(),xe=setTimeout(()=>Se.current(ie),200);return()=>clearTimeout(xe)},[C,T]);function be(){ee&&y(O)}function H(){pe&&j(B,Q,D)}function ue(){ee&&(W(!0),g(O))}return h?a.jsxs(ul,{title:"Новый проект",onClose:v,actions:a.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:h.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(ie=>a.jsx("li",{children:ie},ie))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(ul,{title:"Новый проект",className:P&&T==="open"?"modal--wide":void 0,onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),T==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!ee,onClick:ue,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!ee,onClick:be,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!pe,onClick:H,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(Vb,{label:"Открыть",on:T==="open",onClick:()=>w("open")}),a.jsx(Vb,{label:"Создать",on:T==="create",onClick:()=>w("create")})]}),T==="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:C,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:ie=>A(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),be())}}),o&&a.jsx("p",{className:"modal__error",children:o}),l.length>0&&a.jsx("ul",{className:"finds",children:l.map(ie=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:ie.open,title:ie.open?"Этот проект уже открыт":ie.path,onClick:()=>A(ie.path),onDoubleClick:()=>y(ie.path),children:[a.jsx("span",{className:"find__name",children:ie.name}),a.jsx("span",{className:"find__path",children:ie.path}),a.jsx("span",{className:"find__note",children:Vw(ie)})]})},ie.path))}),l.length===0&&ee&&!s&&!P&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),P&&a.jsx("div",{className:"finds__agent",children:a.jsx($p,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:K,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:ie=>I(ie.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(ie=>a.jsx("button",{type:"button",className:ie===B?"newproj__root is-on":"newproj__root",title:ie,onClick:()=>I(ie),children:Xw(ie)},ie))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:V,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:ie=>U(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),H())}}),a.jsx("p",{className:"newproj__preview",children:pe?$w(B,Q):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(ap,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>R(ie=>({...ie,git:!ie.git}))}),a.jsx(ap,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>R(ie=>({...ie,claudeMd:!ie.claudeMd}))}),a.jsx(ap,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>R(ie=>({...ie,readme:!ie.readme}))})]})]})]})}function Vb({label:l,on:s,onClick:r}){return a.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function ap({label:l,desc:s,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:[l,a.jsx("span",{className:"newproj__optdesc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function $w(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Xw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function Vw(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Qw(l.sessions)}${Kw(l.lastUsedAt)}`}function Qw(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Kw(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Vp=7;function Zw(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=Qb(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of g){let T=s.indexOf(v);T===-1&&(T=Qb(s),s[T]=v),x.push({from:h,to:T})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<d.length;v++){const T=d[v];!T||T===o.hash||v===h||s[v]===T&&j.push(v)}Fw(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:r,columns:Math.min(c,Vp)}}function Qb(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Fw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const fy=1500;function Jw(l){const s=[];let r=!1;for(const c of l.patch.split(`
119
- `)){if(s.length>=fy){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:Pw(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:Ww(l,r)}}function Pw(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Ww(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${fy} строк`),r.length>0?r.join(" · "):null}function eN({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:T,zoomed:w,onToggleZoom:C}){const A=Zw((s==null?void 0:s.commits)??[]),P=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(W=>({value:W.name,label:W.name,hint:W.hash.slice(0,8)}))];return a.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(w?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:W=>{C&&(W.target.closest("button")||C())},children:[a.jsx(iN,{}),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:w?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":w?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":w,onClick:C,children:a.jsx(Bc,{active:w})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:T,children:"✕"})]}),s===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Bs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:P,onChange:W=>{W&&m(W,`ветку ${W}`)}}),a.jsx(Uc,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.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(uN,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(rN,{}),"Отправить",s.ahead>0&&a.jsx("span",{className:"gitbar__count",children:s.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[a.jsx(cN,{}),"Забрать",s.behind>0&&a.jsx("span",{className:"gitbar__count",children:s.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:a.jsx(oN,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(Zb,{}),"Опубликовать на 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:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${pN(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(W=>hN(W.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(W=>a.jsx(nN,{row:W,columns:A.columns,head:W.commit.hash===s.head,local:s.hasRemote&&!W.commit.pushed,active:c===W.commit.hash,onOpen:()=>h(W.commit.hash)},W.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:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(Zb,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Mr,{result:r,onDismiss:v})]})}const Ko=50,Kb=13,tN=500;function nN({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(fN).filter(Boolean),[g,x]=b.useState(null),y=b.useRef(null);function j(C){const A=C.touches[0];if(!A)return;const P={timer:0,x:A.clientX,y:A.clientY,fired:!1};P.timer=window.setTimeout(()=>{P.fired=!0,x({x:P.x,y:P.y})},tN),y.current=P}function v(C){const A=y.current,P=C.touches[0];!A||!P||Math.hypot(P.clientX-A.x,P.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function T(C){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&C.preventDefault())}function w(){const C=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void ha(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void ha(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void ha(h.subject)}],A=new Set;for(const P of h.refs){const W=P.startsWith("tag: "),K=dN(P);!K||A.has(K)||(A.add(K),C.push({id:`ref:${K}`,label:W?"Копировать тег":"Копировать ветку",hint:K,onSelect:()=>void ha(K)}))}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(),x({x:C.clientX,y:C.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:T,onTouchCancel:T,children:[a.jsx(lN,{row:l,columns:s,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," · ",mN(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Bi,{x:g.x,y:g.y,items:w(),onClose:()=>x(null)})]})}function lN({row:l,columns:s,head:r,local:c}){const o=s*Kb+6,d=Ko/2,h=x=>8+Math.min(x,Vp-1)*Kb,m=c?"3.5 2.5":void 0,g=Of(l.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:Ko,viewBox:`0 0 ${o} ${Ko}`,"aria-hidden":"true",children:[l.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Ko,style:{stroke:Of(x)}},`t${x}`)),l.up.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Of(x.from),strokeDasharray:m}},`u${y}`)),l.down.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Ko}`,fill:"none",style:{stroke:Of(x.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Of(l){return`var(--lane-${l%Vp})`}function sN({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return a.jsxs(ul,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.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:l.subject}),a.jsx(Uc,{text:l.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",gN(l.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:l.hash}),a.jsx(Uc,{text:l.hash,hint:"хеш коммита"})]}),s&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&a.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>a.jsx(aN,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function aN({file:l,defaultOpen:s}){const[r,c]=b.useState(s);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:l.path||l.oldPath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(Yp,{diff:Jw(l)})]})}function iN(){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 rN(){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 cN(){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 oN(){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 Zb(){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 uN(){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 fN(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function dN(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function hN(l){const s=l.split("/");return s[s.length-1]??l}function pN(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function mN(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/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(s).toLocaleDateString()}function gN(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function Fb(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function xN({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:y,onClose:j}){var ie;const[v,T]=b.useState(()=>Fb(c)),[w,C]=b.useState(""),[A,P]=b.useState(""),[W,K]=b.useState(!0),[I,V]=b.useState("Первый коммит"),[U,D]=b.useState(null),[R,O]=b.useState("");b.useEffect(()=>{!w&&s.length>0&&C(s[0].login)},[w,s]),b.useEffect(()=>{r&&U===null&&D(new Set(r.files))},[r,U]);const ee=(l==null?void 0:l.connected)===!0,B=s.map(xe=>({value:xe.login,label:xe.login,hint:xe.kind==="org"?"организация":void 0})),Q=b.useMemo(()=>{if(!r)return[];const xe=R.trim().toLowerCase();return xe?r.files.filter(Ce=>Ce.toLowerCase().includes(xe)):r.files},[r,R]),pe=(U==null?void 0:U.size)??0,Se=ee&&v.trim()!==""&&w!==""&&d===""&&(o||pe>0);function be(xe){D(Ce=>{const k=new Set(Ce??[]);return k.has(xe)?k.delete(xe):k.add(xe),k})}function H(xe){D(Ce=>{const k=new Set(Ce??[]);for(const te of Q)xe?k.add(te):k.delete(te);return k})}function ue(){if(!Se)return;const xe=(r==null?void 0:r.files)??[];x({owner:w,name:v.trim(),description:A.trim(),private:W,include:o?[]:xe.filter(Ce=>U==null?void 0:U.has(Ce)),ignore:o?[]:xe.filter(Ce=>!(U!=null&&U.has(Ce))),message:o?"":I.trim()||"Первый коммит"})}return a.jsxs(ul,{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:!Se,onClick:ue,children:d||"Опубликовать"})]}),children:[a.jsx(bN,{status:l,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:xe=>T(Fb(xe.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),s.length>1?a.jsx(Bs,{className:"settings__select",value:w,options:B,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((ie=s[0])==null?void 0:ie.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:xe=>P(xe.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(Jb,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:W,onClick:()=>K(!0)}),a.jsx(Jb,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!W,onClick:()=>K(!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:[pe," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>H(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>H(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:xe=>O(xe.target.value)}),a.jsx("div",{className:"publish__filelist",children:Q.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):Q.map(xe=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(U==null?void 0:U.has(xe))===!0,className:"publish__file",onClick:()=>be(xe),children:[a.jsx("span",{className:"publish__box"+(U!=null&&U.has(xe)?" is-on":""),"aria-hidden":"true",children:(U==null?void 0:U.has(xe))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:xe})]},xe))}),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:I,onChange:xe=>V(xe.target.value)})]})]})]}),a.jsx(Mr,{result:h,onDismiss:y})]})}function Jb({title:l,desc:s,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:[l,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:s})]})]})}function bN({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=b.useState(""),[d,h]=b.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:l.login}),a.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[l.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(_N,{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 ↗"})]}),l.message&&a.jsx("p",{className:"modal__error",children:l.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function _N({value:l,onChange:s,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:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(vN,{}):a.jsx(yN,{})})]})}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:"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 vN(){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 jN({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=b.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(ul,{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||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),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&&l===""&&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(Mr,{result:s,onDismiss:c})]})}function SN({open:l,items:s,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onContextSearch:w,onCommand:C,onModel:A,onEffort:P,onUltracode:W,onThinking:K,onSwitchOnFlag:I,onAsk:V,onInterrupt:U,onReset:D,onClose:R,zoomed:O,onToggleZoom:ee}){return a.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(O?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:B=>{ee&&(B.target.closest("button")||ee())},children:[a.jsx(wN,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:D,children:"↻"}),ee&&a.jsx("button",{className:"sidepane__btn",title:O?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":O?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":O,onClick:ee,children:a.jsx(Bc,{active:O})}),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:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onModel:A,onEffort:P,onUltracode:W,onThinking:K,onSwitchOnFlag:I}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx($p,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(iy,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:w,onCommand:C,onSend:V,onInterrupt:U,onEscape:r?U:R})]})}function wN(){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 NN=75,kN=90;function dy({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return a.jsx("div",{className:"usage",title:CN(l,s),"aria-label":c,children:r.map(o=>a.jsx(EN,{label:o.label,window:o.window},o.key))})}function EN({label:l,window:s}){const r=Math.round(s.utilization),c=MN(s.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:l}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${TN(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:Qp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function TN(l){return l>=kN?" usage__fill--over":l>=NN?" usage__fill--warn":""}function CN(l,s){if(s.length>0)return AN(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=Qp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
120
- `)}function AN(l){const s=["Квота Antigravity"];for(const r of l){const c=Qp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
121
- `)}function hy(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function py(l){return l.getTime()-Date.now()<1440*60*1e3}function MN(l){const s=hy(l);return s?py(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function Qp(l){const s=hy(l);return s?`обнулится ${py(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function my(){const[l,s]=b.useState(()=>new Date);return b.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(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:l.toISOString(),title:RN(l),children:[a.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function RN(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function DN({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:x,onHandoff:y,onFreshSession:j,handoffWriting:v,onStop:T}){const w=E_({onLongPress:()=>j==null?void 0:j(),onClick:()=>y==null?void 0:y(),disabled:v});return a.jsx(ul,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:a.jsxs("div",{className:"sessionmenu",children:[s&&a.jsx(yc,{label:"Режим прав",children:s}),a.jsx(yc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&a.jsx(yc,{label:"Лимиты плана",children:a.jsx(dy,{usage:c})}),a.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[a.jsx(ON,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(yc,{label:"Время",children:a.jsx(my,{})}),d&&a.jsx(yc,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:d})}),o&&a.jsx(yc,{label:"Каталог проекта",children:a.jsx(oy,{path:o})}),x&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),y&&a.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":w.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${w.thresholdMs}ms`},"aria-busy":v,disabled:v,...w.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),T&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:T,children:"Остановить сессию"})]})})}function yc({label:l,children:s}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function ON(){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 LN({tab:l,servers:s,plugins:r,marketplaces:c,catalog:o,result:d,auth:h,remote:m,actions:g,onTab:x,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(ul,{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":l===v.id,className:l===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),l==="mcp"&&a.jsx(zN,{servers:s,auth:h,remote:m,actions:g}),l==="plugins"&&a.jsx(GN,{plugins:r,marketplaces:c,actions:g}),l==="catalog"&&a.jsx(YN,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Mr,{result:d})]})}function zN({servers:l,auth:s,remote:r,actions:c}){const[o,d]=b.useState(!1);return a.jsxs(a.Fragment,{children:[l.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:l.map(h=>{const m=(s==null?void 0:s.name)===h.name?s:null,g=m!==null&&m.active&&m.url==="",x=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--${BN(h.status)}`,children:HN[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:x?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":x?"Начать заново":"Авторизовать"}),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(UN,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(IN,{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 UN({auth:l,remote:s,actions:r}){const[c,o]=b.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(l.name,g),o(""))}if(!l.active)return l.error?a.jsx("div",{className:"extlist__error",children:l.error}):l.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:[s&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${l.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${l.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:s?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=l.callbackExpected&&(s?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[l.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:l.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!s&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,l.error&&a.jsx("div",{className:"extlist__error",children:l.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const HN={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function BN(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function IN({onSubmit:l,onCancel:s}){const[r,c]=b.useState(""),[o,d]=b.useState("stdio"),[h,m]=b.useState(""),[g,x]=b.useState(""),[y,j]=b.useState(""),v=o==="stdio",T=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function w(){if(T)if(v){const[C,...A]=qN(h);l(r.trim(),{transport:"stdio",command:C??"",args:A,env:Pb(y)})}else l(r.trim(),{transport:o,url:g.trim(),headers:Pb(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(Bs,{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=>x(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:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!T,onClick:w,children:"Подключить"})]})]})}function Pb(l){const s={};for(const r of l.split(`
122
- `)){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||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function qN(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function GN({plugins:l,marketplaces:s,actions:r}){const[c,o]=b.useState("");return a.jsxs(a.Fragment,{children:[l.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:l.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:s.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 Zo=30;function YN({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(Zo),[y,j]=b.useState(""),v=b.useMemo(()=>[...new Set(l.map(C=>C.category).filter(Boolean))].sort(),[l]),T=b.useMemo(()=>{const w=o.trim().toLowerCase();return l.filter(C=>h&&C.category!==h?!1:w?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(w):!0)},[l,o,h]);return l.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",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:w=>{d(w.target.value),x(Zo)}}),a.jsx(Bs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(w=>({value:w,label:w}))],onChange:w=>{m(w),x(Zo)}})]}),T.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:T.slice(0,g).map(w=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:w.name}),w.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),w.version&&a.jsx("span",{className:"chip",children:w.version}),w.category&&a.jsx("span",{className:"chip",children:w.category})]}),w.description&&a.jsx("div",{className:"catalog__desc",children:w.description}),a.jsxs("div",{className:"extlist__meta",children:[w.author&&`${w.author} · `,w.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:w.installed,onClick:()=>r.pluginInstall(w.id),children:w.installed?"Уже стоит":"Установить"}),w.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:w.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},w.id))}),T.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(w=>w+Zo),children:["Ещё ",Math.min(Zo,T.length-g)," из ",T.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:w=>j(w.target.value),onKeyDown:w=>{w.key!=="Enter"||y.trim()===""||(w.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function $N({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[x,y]=b.useState(""),[j,v]=b.useState(!1),[T,w]=b.useState(!1),C=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!T&&!j,A=b.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const K=s.output.trim();return K===""?null:{ok:!0,message:K}},[s.error,s.output]);function P(K=x){const I=K.trim();I!==""&&(r.submitCode(I),y(""))}function W(){if(o>0){v(!1),w(!0);return}r.login("claudeai",!0)}return a.jsxs(ul,{title:"Аккаунт",onClose:g,children:[l===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:QN[l.method]??l.method}),l.plan&&a.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&a.jsx("div",{className:"extlist__meta",children:l.organization})]}):a.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",a.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?a.jsx(KN,{login:s,remote:c,code:x,onCode:y,onSubmit:P,onCancel:r.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Mr,{result:A}),T&&a.jsx("p",{className:"account__warn",role:"alert",children:XN(o)}),C&&h&&a.jsx("p",{className:"account__note",children:m}),a.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?a.jsxs(a.Fragment,{children:[C&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
- ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[a.jsx(VN,{}),"Переподключить"]}),T?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>w(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{w(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:W,children:"Сменить аккаунт"}),j?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{w(!1),v(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function XN(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function VN(){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 QN={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function KN({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var w;const[h,m]=b.useState(null),g=b.useRef(""),x=b.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const y=b.useCallback(async C=>{const{code:A,onCode:P,onSubmit:W}=x.current;if(C&&A.trim()!=="")return;const K=await Sp();if(K===null){C||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const I=K.trim();if(!Wb(I)){C||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(g.current===I)return;g.current=I}m(null),P(I),W(I)},[]);b.useEffect(()=>{if(!l.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[l.awaitingCode,y]);const j=typeof((w=navigator.clipboard)==null?void 0:w.readText)=="function",v=r.trim()!==""&&!Wb(r),T=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[l.url?s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:l.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:l.url}),a.jsx(Uc,{text:l.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:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{m(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),o())}}),j&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),T&&a.jsx("p",{className:"account__note account__note--code",children:T})]}),l.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:l.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function Wb(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function ZN({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(!1),y=b.useRef(null),j=(l==null?void 0:l.paired)===!0;b.useEffect(()=>{var T;j||(T=y.current)==null||T.focus()},[j]),b.useEffect(()=>{x(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return a.jsx(ul,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:e_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.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:e_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:T=>{T.preventDefault(),o.trim()&&(x(!0),s(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:T=>d(T.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:T=>m(T.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function e_(l){try{return new URL(l).host}catch{return l}}const t_=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],ip="",FN=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],JN=S_.map(l=>({value:l.value,label:l.value,hint:l.hint})),Lf=3600*1e3,PN=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Sc={"6h":6*Lf,"24h":24*Lf,"48h":48*Lf,"168h":168*Lf,never:0};function WN(l){return Sc[l]??Sc["48h"]}const ek=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],zf=60*1e3,wc={"5m":5*zf,"10m":10*zf,"30m":30*zf,"60m":60*zf,never:0};function tk(l){return wc[l]??wc["10m"]}function nk(l){const s=Object.entries(wc).find(([,r])=>r===l);return s?s[0]:Object.keys(wc).reduce((r,c)=>Math.abs(wc[c]-l)<Math.abs(wc[r]-l)?c:r)}function lk(l){const s=Object.entries(Sc).find(([,r])=>r===l);return s?s[0]:Object.keys(Sc).reduce((r,c)=>Math.abs(Sc[c]-l)<Math.abs(Sc[r]-l)?c:r)}const sk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Nc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function ak(l){return Nc[l]??Nc.off}function n_(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function ik(l){const s=Object.entries(Nc).find(([,r])=>r===l);return s?s[0]:Object.keys(Nc).reduce((r,c)=>Math.abs(Nc[c]-l)<Math.abs(Nc[r]-l)?c:r)}const rk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function ck({settings:l,models:s,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,onClose:x}){const y=l===null,[j,v]=b.useState(""),[T,w]=b.useState(null),C=!y&&l.networkGuardEnabled,A=(l==null?void 0:l.networkGuardBlockedCountries)??[];function P(){const D=j.trim().toUpperCase();if(D!==""){if(!/^[A-Z]{2}$/.test(D)){w("Нужен код из двух латинских букв, например RU или CN.");return}if(A.includes(D)){w(`Код ${D} уже в списке.`);return}w(null),v(""),d({networkGuardBlockedCountries:[...A,D]})}}const W=!y&&l.terminalEnabled===!0,K=!y&&l.liveSessionsFirst===!0,I=!W,V=b.useMemo(()=>{const D=[{value:ip,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(R=>({value:R.value,label:R.displayName,hint:R.description})):FN];return l&&l.startModel!==null&&!D.some(R=>R.value===l.startModel)&&D.push({value:l.startModel,label:l.startModel}),D},[s,l]);function U(){var D,R;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:I,onClick:g,children:"Связать компьютер"})]}):(D=r.shell)!=null&&D.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:I,onClick:m,children:"Запретить"})]}):(R=r.shell)!=null&&R.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:I,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:I,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:I,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(ul,{title:"Настройки",onClose:x,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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Bs,{className:"settings__select",value:lk(l.autoArchiveAfterMs),options:PN,onChange:D=>d({autoArchiveAfterMs:WN(D)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Bs,{className:"settings__select",value:nk(l.autoStopAfterMs),options:ek,onChange:D=>d({autoStopAfterMs:tk(D)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),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-часового лимита, %"}),y?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:l.limitStopFiveHourPct,onChange:D=>d({limitStopFiveHourPct:n_(D.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:"Остановка у недельного лимита, %"}),y?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:l.limitStopSevenDayPct,onChange:D=>d({limitStopSevenDayPct:n_(D.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-клиента это не заменяет — его тоже стоит включить."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":C,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:C?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!C}),children:a.jsx("span",{className:"switch__knob"})})]}),C&&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:C?"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:[A.map(D=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:D}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${D} из списка`,disabled:!C,onClick:()=>d({networkGuardBlockedCountries:A.filter(R=>R!==D)}),children:"×"})]},D)),A.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:D=>{D.preventDefault(),P()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:j,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!C,"aria-label":"Код страны, две буквы","aria-invalid":T!==null,onChange:D=>{v(D.target.value.toUpperCase()),w(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!C||j.trim()==="",children:"Добавить"})]}),T&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:T})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Bs,{className:"settings__select",value:ik(l.autoSaveAfterPauseMs),options:sk,onChange:D=>d({autoSaveAfterPauseMs:ak(D)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),t_.map(D=>{const R=(l==null?void 0:l.enabledProviders)??["claude","antigravity"],O=!y&&R.includes(D.id),ee=O&&R.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${D.id}`,"aria-hidden":"true",children:D.id==="antigravity"?a.jsx(qp,{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:D.label}),a.jsx("span",{className:"settings__hint",children:ee?"Хотя бы один агент должен остаться включённым":D.hint})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":O,"aria-label":D.label,disabled:ee,title:ee?"Хотя бы один агент должен остаться включённым":void 0,className:O?"switch is-on":"switch",onClick:()=>{const B=t_.map(Q=>Q.id).filter(Q=>Q===D.id?!O:R.includes(Q));d({enabledProviders:B})},children:a.jsx("span",{className:"switch__knob"})})]},D.id)})]}),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:"Модель"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Bs,{className:"settings__select",value:l.startModel??ip,options:V,onChange:D=>d({startModel:D===ip?null:D}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Bs,{className:"settings__select",value:l.startPermissionMode,options:JN,onChange:D=>d({startPermissionMode:D}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":K,"aria-label":"Запущенные сессии сверху",className:K?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!K}),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:rk.map(D=>{const R=!y&&l.folderAccess===D.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":R,disabled:y,className:"access__card"+(R?" is-on":"")+(D.risky?" access__card--risky":""),onClick:()=>d({folderAccess:D.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:[D.title,D.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:D.description})]})]},D.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":W,"aria-label":"Терминал",className:W?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!W}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(I?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),y?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[I&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),U()]})]})]})]})})}const l_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function ok(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function uk({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${l_[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.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(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.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("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}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:[l.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[l_[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",ok(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,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:"Скрыть"})]})]})}function fk({handoff:l,onClose:s}){const[r,c]=b.useState("");return b.useEffect(()=>{let o=!1;return cd(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),a.jsx(ul,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function dk({state:l}){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:l.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const ld={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},hk=12e3;function pk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function mk({notices:l,onDismiss:s}){return l.length===0?null:a.jsx("div",{className:"limittoasts",children:l.map(r=>a.jsx(gk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function gk({notice:l,onDismiss:s}){return b.useEffect(()=>{const r=window.setTimeout(s,hk);return()=>window.clearTimeout(r)},[s]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:l.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",ld[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",pk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",ld[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function xk(l,s,r=Date.now()){if(!l||!l.available||!s)return null;const c=[["fiveHour",l.fiveHour,s.limitStopFiveHourPct],["sevenDay",l.sevenDay,s.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 bk(l,s=Date.now()){const r=new Date(l),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(s).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const _k=16;function yk({pane:l,width:s,onResize:r,onReset:c}){const o=kr[l],d=b.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-fv):0;d.current={x:y.clientX,width:s,max:Math.min(o.max,s+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 x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(s+j*_k*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const vk=16;function jk({height:l,onResize:s,onReset:r}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-mv;return Math.round(l+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:l,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const y=c.current;if(!y)return;const j=y.y-x.clientY;s(y.height+j,y.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),s(l+y*vk,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":k_,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 s_(){const l=document.documentElement,s=getComputedStyle(l),r=W=>s.getPropertyValue(W).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),x=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),T=r("--cm-fn"),w=r("--cm-key"),C=r("--cm-type"),A=a_(o,c,55),P=W=>a_(W,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:A,brightBlack:h,red:y,brightRed:P(y),green:j,brightGreen:P(j),yellow:v,brightYellow:P(v),blue:T,brightBlue:P(T),magenta:w,brightMagenta:P(w),cyan:C,brightCyan:P(C),white:d,brightWhite:o}}function Sk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let aa=null;function wk(l){return aa||(aa=document.createElement("span"),aa.style.position="fixed",aa.style.width="0",aa.style.height="0",aa.style.opacity="0",aa.style.pointerEvents="none",document.body.appendChild(aa)),aa.style.color=l,getComputedStyle(aa).color}function a_(l,s,r){return wk(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Uf=null;function Nk(){return Uf||(Uf=Promise.all([Pe(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Pe(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Pe(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Pe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Uf=null,l})),Uf}function kk({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:T,onResize:w,onAttach:C,onHide:A,registerSink:P}){const[W,K]=b.useState(()=>s_());return b.useEffect(()=>{const I=new MutationObserver(()=>K(s_()));return I.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>I.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:I=>{x&&(I.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(I=>a.jsxs("div",{role:"tab","aria-selected":I.id===s,className:"termtab"+(I.id===s?" is-on":"")+(I.exitCode!==null?" termtab--exited":""),onDoubleClick:V=>{x&&(V.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:I.cwd,onClick:()=>y(I.id),children:I.title}),I.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${I.exitCode}`,children:I.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${I.title}»`,onClick:()=>v(I.id),children:"✕"})]},I.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),x&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:a.jsx(Bc,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&l.length>0&&a.jsx(i_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?a.jsx(i_,{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:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(I=>a.jsx(Tk,{id:I.id,exitCode:I.exitCode,active:I.id===s,theme:W,mobile:m,onInput:T,onResize:w,onAttach:C,registerSink:P},I.id))]})]})}function i_({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=Ek(l);return a.jsxs("div",{className:s?"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 Ek(l){const[s="",...r]=l.trim().split(`
124
-
125
- `),c=s.split(`
126
- `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
127
-
128
- `).trim()}}function Tk({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const x=b.useRef(null),y=b.useRef(null),j=b.useRef(!1),v=b.useRef(o);v.current=o;const T=b.useRef(c),w=b.useRef(s),[C,A]=b.useState("loading"),[P,W]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let I=!1,V=null;A("loading"),W(!1);const U=window.setTimeout(()=>{I||W(!0)},200);return(async()=>{var Ce;let D;try{D=await Nk()}catch{window.clearTimeout(U),I||A("error");return}if(I||!x.current)return;window.clearTimeout(U);const{Terminal:R,FitAddon:O,WebLinksAddon:ee}=D,B=new R({fontFamily:Sk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:T.current}),Q=new O;B.loadAddon(Q),B.loadAddon(new ee),B.open(x.current),y.current=B,B.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const q=B.getSelection();return q?(k.preventDefault(),ha(q),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),Sp().then(q=>{q&&B.paste(q)}),!1):!0});const pe=k=>{k.preventDefault();const te=B.getSelection();if(te){ha(te),B.clearSelection();return}Sp().then(q=>{q&&B.paste(q)})};(Ce=B.element)==null||Ce.addEventListener("contextmenu",pe);const Se=B.onData(k=>d(l,k));let be={cols:B.cols,rows:B.rows},H=null;const ue=B.onResize(({cols:k,rows:te})=>{H!==null&&window.clearTimeout(H),H=window.setTimeout(()=>{H=null,!(k===be.cols&&te===be.rows)&&(be={cols:k,rows:te},h(l,k,te))},100)}),ie=new ResizeObserver(()=>{try{Q.fit()}catch{return}v.current&&B.scrollToBottom()});ie.observe(x.current);const xe=g(l,k=>{k.kind==="buffer"&&B.reset(),B.write(k.data)});m(l),w.current!==null&&!j.current&&(j.current=!0,B.write(`\r
129
- \x1B[2m— Процесс завершён (код ${w.current}) —\x1B[0m\r
130
- `)),r&&B.focus(),V=()=>{var k;H!==null&&window.clearTimeout(H),ie.disconnect(),(k=B.element)==null||k.removeEventListener("contextmenu",pe),Se.dispose(),ue.dispose(),xe(),B.dispose(),y.current=null},A("ready")})(),()=>{I=!0,window.clearTimeout(U),V==null||V(),V=null}},[l]),b.useEffect(()=>{if(!o)return;const K=x.current;if(!K)return;let I=null,V=0,U=!1;const D=B=>{B.pointerType==="mouse"||I!==null||(I=B.pointerId,V=B.clientY,U=!1)},R=B=>{if(B.pointerId!==I)return;const Q=V-B.clientY;if(!U){if(Math.abs(Q)<4)return;U=!0,K.setPointerCapture(B.pointerId)}V=B.clientY;const pe=K.querySelector(".xterm-viewport");pe&&(pe.scrollTop+=Q)},O=B=>{B.pointerId===I&&(K.hasPointerCapture(B.pointerId)&&K.releasePointerCapture(B.pointerId),I=null,U=!1)},ee=B=>B.stopPropagation();return K.addEventListener("pointerdown",D),K.addEventListener("pointermove",R),K.addEventListener("pointerup",O),K.addEventListener("pointercancel",O),K.addEventListener("touchmove",ee,{capture:!0}),()=>{K.removeEventListener("pointerdown",D),K.removeEventListener("pointermove",R),K.removeEventListener("pointerup",O),K.removeEventListener("pointercancel",O),K.removeEventListener("touchmove",ee,{capture:!0}),I!==null&&K.hasPointerCapture(I)&&K.releasePointerCapture(I)}},[o]),b.useEffect(()=>{T.current=c,y.current&&(y.current.options.theme=c)},[c]),b.useEffect(()=>{var K;r&&((K=y.current)==null||K.focus())},[r]),b.useEffect(()=>{if(w.current=s,s===null){j.current=!1;return}if(j.current)return;const K=y.current;K&&(j.current=!0,K.write(`\r
131
- \x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
132
- `))},[s]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&P&&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 Ck=2e5,Ak=75,Mk=90;function Rk({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??Ck,o=Math.min(100,Math.round(l/c*100)),d=`${l.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
133
- обновлено в ${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${Dk(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Dk(l){return l>=Mk?" contextbar__fill--over":l>=Ak?" contextbar__fill--warn":""}const gy="ccv:last-session",Ok=300*1e3,Lk=1e4;function zk(){try{const l=localStorage.getItem(gy);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function Uk(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>G0(o.path).includes(s));return c.length===1?c[0]:void 0}function Hk(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const Bk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},r_=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Ik={active:!1,url:"",awaitingCode:!1,output:"",error:null};function c_(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>o_(h.name,d)-o_(m.name,d))}}function o_(l,s){return l.toLowerCase().startsWith(s)?0:1}function u_(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function qk(){var xo,Rs;const l=b.useRef(null),[s,r]=b.useState(!1),[c,o]=b.useState("Нет связи с хостом"),[d,h]=b.useState(null),[m,g]=b.useState(null),x=(m==null?void 0:m.status)==="blocked",[y,j]=b.useState(!1),v=b.useMemo(()=>If()==="relay",[]),[T,w]=b.useState([]),[C,A]=b.useState([]),[P,W]=b.useState([]),[K,I]=b.useState([]),[V,U]=b.useState([]),[D,R]=b.useState([]),[O,ee]=b.useState([]),[B,Q]=b.useState({}),[pe,Se]=b.useState([]),[be,H]=b.useState([]),[ue,ie]=b.useState(null),[xe,Ce]=b.useState(null),[k,te]=b.useState(null),[q,_e]=b.useState(null),[Y,Ae]=b.useState(null),[Me,Xe]=b.useState(null),[Ue,bt]=b.useState(vl),[Ge,gn]=b.useState(Xh),[Ke,dt]=b.useState(!1),[rt,ct]=b.useState(!1),kt=ad("(max-width: 860px)"),[Lt,je]=b.useState(!1);b.useEffect(()=>{kt||je(!1)},[kt]);const[ht,_t]=b.useState(!1),[rn,pt]=b.useState([]),[lt,Bt]=b.useState(!1),[Jn,Mt]=b.useState(vl),[Wt,rl]=b.useState(null),[wn,cn]=b.useState(null),[Pn,on]=b.useState([]),[st,ot]=b.useState(null),[It,Yn]=b.useState(null),[re,ve]=b.useState([]),[Be,Fe]=b.useState([]),[Ze,hn]=b.useState([]),[X,de]=b.useState([]),[ke,Le]=b.useState(null),[yt,$n]=b.useState(null),[hl,as]=b.useState({}),[ql,Sl]=b.useState(null),[xs,Gl]=b.useState({}),[Yl,wl]=b.useState(null),[Wn,en]=b.useState([]),[We,Mn]=b.useState(!1),[qs,Nl]=b.useState(null),[tn,$l]=b.useState(null),Xn=(tn==null?void 0:tn.enabledProviders)??["claude","antigravity"],[kl,Et]=b.useState(!1),[El,un]=b.useState(Ik),[Rt,mt]=b.useState(null),[zt,Vn]=b.useState(null),[xn,Rn]=b.useState(!1),[is,,Xl]=cv(),bn=pv(),[pn,el]=b.useState(!1),[qt,Dn]=b.useState(null),[Gt,bs]=b.useState(null),[qi,Vl]=b.useState(null),[_s,_n]=b.useState(null),[Ql,Nn]=b.useState(null),[ys,rs]=b.useState(""),[cs,Tl]=b.useState(null),[me,E]=b.useState([]),[$,ge]=b.useState(!1),[De,He]=b.useState(null),[$e,Tt]=b.useState(!1),[jt,Ft]=b.useState(!1),[vt,N]=b.useState({}),[le,we]=b.useState([""]),[Ie,Ut]=b.useState([]),[Kl,pl]=b.useState(null),[Zl,Qn]=b.useState(null),[pa,Gs]=b.useState(null),[Cl,Qa]=b.useState(null),[Rr,Dr]=b.useState(null),[ma,Gi]=b.useState({}),[Yi,tl]=b.useState({}),[ml,Ys]=b.useState(!1),[$i,Ic]=b.useState(null),[Ka,Xi]=b.useState(null),Za=b.useRef(0),ga=b.useRef(null),[xa,qc]=b.useState(!1),[Or,Vi]=b.useState([]),[Gc,Lr]=b.useState(null),[ud,zr]=b.useState(null),Ur=gv(),Yc=yv(kt&&xa),Fa=b.useRef(new Map),ba=(tn==null?void 0:tn.terminalEnabled)===!0,Hr=If()==="relay"&&((xo=d==null?void 0:d.shell)==null?void 0:xo.enabled)!==!0,$c=b.useRef(!1),fd=b.useCallback((p,z)=>(Fa.current.set(p,z),()=>{Fa.current.get(p)===z&&Fa.current.delete(p)}),[]),[vs,Br]=b.useState(!1),[ou,Ir]=b.useState(null),[Xc,qr]=b.useState(vl),[js,Gr]=b.useState(null),[Qi,_a]=b.useState({}),Ki=b.useRef([]),[fn,Vc]=b.useState(null);function dd(p){Vc(z=>z===p?null:p)}b.useEffect(()=>{(kt||fn==="terminal"&&!xa||fn==="files"&&!jt||fn==="search"&&!ml||fn==="git"&&!pn||fn==="ask"&&!vs||fn==="main"&&Ie.length===0)&&Vc(null)},[fn,kt,xa,jt,ml,pn,vs,Ie.length]);const[Qc]=b.useState(zk),ya=b.useRef(Qc),Yr=b.useRef(!1),kn=b.useRef(null),Ja=b.useRef(null),Pa=b.useRef(null),Kc=b.useRef(0),En=b.useRef(null),va=b.useRef(0);kn.current=Y,En.current=q,va.current=Ue.lastSeq;const uu=b.useRef(Ge);uu.current=Ge;const Ss=b.useRef(null),fu=b.useRef(0);fu.current=Xc.lastSeq;const Zi=b.useRef(null),Fi=b.useRef(""),ws=b.useRef(null),Fl=b.useRef([]),du=b.useRef([""]);Fl.current=Ie,du.current=le;const $s=b.useRef(new Map),Ji=b.useRef(new Set),Wa=b.useRef(null),ja=b.useRef(null),$r=b.useRef(0),ei=b.useRef(new Set);b.useEffect(()=>{const p=F0();if(!p)return;l.current=p;const z=()=>{r(p.connected),o(p.statusText)};p.onStatus(z),p.onReconnect(()=>{z(),Gl({});const St=kn.current;St&&p.send({type:"session.sync",sessionId:St,sinceSeq:va.current});const Tn=Ss.current;Tn&&p.send({type:"session.sync",sessionId:Tn,sinceSeq:fu.current})});const ce=p.on(St=>hu(St));p.connect();const Te=window.setInterval(()=>{z(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Te),p.close()}},[]);const hu=b.useCallback(p=>{var z,ce,Te,St,Tn,bl,Ds,hi,bo;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{w(p.workspaces),A(p.archived),_e(qe=>{var On;if(qe)return qe;const et=ya.current,at=et&&Uk(p.workspaces,et.workspaceId);return et&&at&&at.id!==et.workspaceId&&(ya.current={...et,workspaceId:at.id}),(at==null?void 0:at.id)??((On=p.workspaces[0])==null?void 0:On.id)??null});const ye=ws.current;if(!ye)break;const Ne=p.workspaces.find(qe=>Qk(qe.path,ye));if(!Ne)break;ws.current=null,_t(!1),_e(Ne.id);break}case"workspace.candidates":if(p.query.trim()!==Fi.current)break;pt(p.candidates),p.source==="host"&&Bt(!1);break;case"finder.opened":Zi.current=p.sessionId;break;case"workspace.roots":on(p.roots);break;case"workspace.created":if(_e(p.workspace.id),p.warnings.length===0){_t(!1),cn(null);break}ot({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(Q(ye=>({...ye,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==En.current)break;R(p.sessions),ee(p.archived);break;case"folder.list":W(p.workspaceFolders),I(p.sessionFolders),U(p.pinnedFolders??[]);break;case"session.pinned":Se(p.sessions);break;case"session.live":H(p.sessions);break;case"order.state":te(p.order);break;case"session.summary":if(p.session.id===Zi.current){rl(p.session);break}if(p.session.parentSessionId){p.session.id===Ss.current&&Gr(p.session);break}if(H(ye=>{const Ne=ye.findIndex(et=>et.id===p.session.id);if(p.session.state==="closed")return Ne===-1?ye:ye.filter(et=>et.id!==p.session.id);if(Ne===-1)return[...ye,p.session];const qe=ye.slice();return qe[Ne]=p.session,qe}),R(ye=>{const Ne=ye.findIndex(et=>et.id===p.session.id);if(Ne===-1)return[p.session,...ye];const qe=ye.slice();return qe[Ne]=p.session,qe}),Q(ye=>{const Ne=ye[p.session.workspaceId];if(!Ne)return ye;const qe=Ne.sessions.findIndex(at=>at.id===p.session.id);let et;if(qe!==-1)et=Ne.sessions.slice(),et[qe]=p.session;else{if(Ne.archived.some(at=>at.id===p.session.id))return ye;et=[p.session,...Ne.sessions]}return{...ye,[p.session.workspaceId]:{...Ne,sessions:et}}}),Se(ye=>{const Ne=ye.findIndex(et=>et.id===p.session.id);if(Ne===-1)return ye;const qe=ye.slice();return qe[Ne]={...p.session,pinned:!0,...ye[Ne].pinnedAt?{pinnedAt:ye[Ne].pinnedAt}:{}},qe}),kn.current===null&&Pa.current&&Pa.current.workspaceId===p.session.workspaceId&&(__(p.session.id,Pa.current.text),Pa.current=null),Ae(ye=>ye??p.session.id),((z=Ja.current)==null?void 0:z.sessionId)===p.session.id){const ye=Ja.current;p.session.state==="error"?Ja.current=null:p.session.state!=="closed"&&(Ja.current=null,(ce=l.current)==null||ce.send({type:"prompt.send",sessionId:ye.sessionId,text:ye.text,images:ye.images}))}break;case"usage.state":p.sessionId===kn.current&&(mt(p.usage),Rn(!1));break;case"context.state":p.sessionId===kn.current&&(Vn(p.context),Rn(!1));break;case"session.capabilities":p.sessionId===kn.current&&Xe(p.capabilities);break;case"session.events":if(p.sessionId===Ss.current){qr(ye=>qf(ye,p.entries));break}if(p.sessionId===Zi.current){Mt(ye=>qf(ye,p.entries));break}if(p.sessionId!==kn.current)break;for(const ye of p.entries){if(ye.event.kind!=="rewound")continue;const Ne=ye.event.toUserIndex,qe=iv(uu.current.entries,Ne),et=qe.reduce((at,On)=>On.event.kind==="user.message"?at+1:at,0);gn(at=>({...at,entries:qe})),bt(at=>({...at,items:rv(at.items,Ne,et)}))}bt(ye=>qf(ye,p.entries));break;case"session.history":if(p.sessionId!==kn.current)break;gn(ye=>lv(ye,p));break;case"side.opened":{if(p.parentSessionId!==kn.current)break;Ss.current=p.sessionId,Ir(p.sessionId);const ye=Ki.current;Ki.current=[];for(const Ne of ye)Ne(p.sessionId);break}case"side.closed":if(p.parentSessionId!==kn.current)break;Ss.current=null,Ir(null),qr(vl),Gr(null);break;case"git.state":if(p.workspaceId!==En.current)break;Dn(p.state);break;case"git.commit":if(p.workspaceId!==En.current)break;bs(p.detail);break;case"git.result":if(p.workspaceId!==En.current)break;_n({ok:p.ok,message:p.message,url:p.url}),p.ok&&(bs(null),Vl(null),ge(!1),Tt(!1));break;case"git.busy":if(p.workspaceId!==En.current)break;rs(p.label);break;case"git.files":if(p.workspaceId!==En.current)break;He({files:p.files,truncated:p.truncated});break;case"github.status":Tl(p.status);break;case"github.owners":E(p.owners);break;case"fs.dir":if(p.workspaceId!==En.current)break;N(ye=>({...ye,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==En.current)break;if(p.scope!=="tree"){const ye=p.scope;tl(Ne=>({...Ne,[ye]:{query:p.query,entries:p.entries}}));break}Dr({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==En.current)break;Ic({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==En.current)break;const ye=Ji.current.delete(p.file.path);Ut(qe=>{const et=qe.findIndex(_l=>_l.path===p.file.path);if(et===-1)return[...qe,Nb(p.file,++$r.current)];const at=qe[et],On=qe.slice();return On[et]=at.saved===p.file.content&&!$a(at)?{...at,mtime:p.file.mtime,size:p.file.size,stale:!1}:Nb(p.file,++$r.current),On}),ye&&pl(p.file.path);const Ne=ga.current;Ne&&Ne.path===p.file.path&&(ga.current=null,Xi({...Ne,token:++Za.current}));break}case"fs.media":{if(p.workspaceId!==En.current)break;ei.current.delete(p.path),Ut(ye=>ye.map(Ne=>Ne.path===p.path?{...Ne,mediaBase64:p.base64,mediaError:void 0}:Ne));break}case"fs.mediaFailed":{if(p.workspaceId!==En.current)break;ei.current.delete(p.path),Ut(ye=>ye.map(Ne=>Ne.path===p.path?{...Ne,mediaError:p.message}:Ne));break}case"fs.saved":{if(p.workspaceId!==En.current)break;const ye=$s.current.get(p.path);$s.current.delete(p.path);const Ne=ye!==void 0;Ut(et=>et.map(at=>at.path!==p.path?at:Ne?{...at,saved:ye,mtime:p.mtime,size:p.size,stale:!1}:{...at,stale:!0}));const qe=Fl.current.find(et=>et.path===p.path);!Ne&&qe&&!$a(qe)&&((Te=l.current)==null||Te.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(St=l.current)==null||St.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==En.current)break;if(Qn({ok:p.ok,message:p.message}),p.ok||$s.current.delete(p.path),p.conflict&&Ut(Ne=>Ne.map(qe=>qe.path===p.path?{...qe,stale:!0}:qe)),ja.current===p.path){const Ne=ja.current;ja.current=null,p.ok&&(Ji.current.add(Ne),(Tn=l.current)==null||Tn.send({type:"fs.read",workspaceId:p.workspaceId,path:Ne}))}const ye=Wa.current;if(p.ok&&ye&&ye.to===p.path){Wa.current=null;const Ne=qe=>qe===ye.from?ye.to:qe.startsWith(`${ye.from}/`)?ye.to+qe.slice(ye.from.length):qe;Ut(qe=>qe.map(et=>({...et,path:Ne(et.path)}))),pl(qe=>qe===null?null:Ne(qe)),we(qe=>qe.map(Ne)),N(qe=>{const et={};for(const[at,On]of Object.entries(qe))at===ye.from||at.startsWith(`${ye.from}/`)||(et[at]=On);return et})}p.ok&&((bl=l.current)==null||bl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==En.current)break;Vi(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==En.current)break;zr(null),Vi(ye=>{const Ne=ye.findIndex(et=>et.id===p.terminal.id);if(Ne===-1)return[...ye,p.terminal];const qe=ye.slice();return qe[Ne]=p.terminal,qe}),$c.current&&($c.current=!1,Lr(p.terminal.id));break;case"term.buffer":(Ds=Fa.current.get(p.id))==null||Ds({kind:"buffer",data:p.data});break;case"term.data":(hi=Fa.current.get(p.id))==null||hi({kind:"data",data:p.data});break;case"term.exit":Vi(ye=>ye.map(Ne=>Ne.id===p.id?{...Ne,exitCode:p.exitCode}:Ne));break;case"term.closed":Vi(ye=>ye.filter(Ne=>Ne.id!==p.id));break;case"mcp.list":p.sessionId===kn.current&&ve(p.servers);break;case"mcp.auth":p.sessionId===kn.current&&$n(p.state);break;case"plugin.list":if(p.sessionId!==kn.current)break;Fe(p.plugins),hn(p.marketplaces),de(p.catalog);break;case"operation.result":p.sessionId===kn.current&&Le(p.result);break;case"auth.status":Nl(p.status);break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":$l(p.settings);break;case"handoff.state":as(ye=>{if(!p.handoff){if(!(p.sessionId in ye))return ye;const Ne={...ye};return delete Ne[p.sessionId],Ne}return{...ye,[p.sessionId]:p.handoff}});break;case"handoff.written":Gl(ye=>{if(!(p.sessionId in ye))return ye;const Ne={...ye};return delete Ne[p.sessionId],Ne}),p.handoff&&kn.current===p.sessionId?wl(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Kc.current+=1,en(ye=>[...ye,{id:Kc.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":un(p.state),p.state.active&&Mn(!0);break;case"session.closed":H(ye=>ye.filter(Ne=>Ne.id!==p.sessionId)),R(ye=>ye.map(Ne=>Ne.id===p.sessionId?{...Ne,state:"closed"}:Ne)),Q(ye=>{let Ne=!1;const qe={};for(const[et,at]of Object.entries(ye))at.sessions.some(On=>On.id===p.sessionId&&On.state!=="closed")?(Ne=!0,qe[et]={...at,sessions:at.sessions.map(On=>On.id===p.sessionId?{...On,state:"closed"}:On)}):qe[et]=at;return Ne?qe:ye});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(ws.current=null,cn(p.message)),(bo=p.context)!=null&&bo.startsWith("term.")&&zr(p.message);break}},[]),se=b.useCallback(p=>{var z;(z=l.current)==null||z.send(p)},[]);b.useEffect(()=>{q&&se({type:"session.list",workspaceId:q})},[q,se]),b.useEffect(()=>{s&&se({type:"session.pins"})},[s,se]),b.useEffect(()=>{s&&se({type:"settings.get"})},[s,se]),b.useEffect(()=>{if(s)return se({type:"session.drafts",sessionIds:y_()}),ev(p=>se({type:"session.drafts",sessionIds:p}))},[s,se]),b.useEffect(()=>{if(Yr.current)return;const p=ya.current;if(!p||!q)return;if(q!==p.workspaceId){Yr.current=!0;return}if(Y){Yr.current=!0;return}if(D.length===0)return;const z=D.find(ce=>Hk(ce,p));Yr.current=!0,z&&z.state!=="closed"&&gl(z)},[D,q,Y]),b.useEffect(()=>{!q||Hr||!ba||se({type:"term.list",workspaceId:q})},[q,Hr,ba,se]),b.useEffect(()=>{Lr(p=>{var z;return p&&Or.some(ce=>ce.id===p)?p:((z=Or[0])==null?void 0:z.id)??null})},[Or]),b.useEffect(()=>{ht&&se({type:"workspace.roots"})},[ht,se]);const ti=b.useCallback(()=>{const p=kn.current;p&&(Rn(!0),se({type:"usage.get",sessionId:p}),se({type:"context.get",sessionId:p}))},[se]);b.useEffect(()=>{if(!xn)return;const p=window.setTimeout(()=>Rn(!1),Lk);return()=>window.clearTimeout(p)},[xn]);const Zc=b.useMemo(()=>{const p=Math.max((Rt==null?void 0:Rt.fetchedAt)??0,(zt==null?void 0:zt.fetchedAt)??0);return p>0?p:null},[Rt==null?void 0:Rt.fetchedAt,zt==null?void 0:zt.fetchedAt]);b.useEffect(()=>{if(Vn(null),!Y)return;ti();const p=()=>{document.hidden||ti()},z=window.setInterval(p,Ok),ce=()=>{document.hidden||ti()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(z),document.removeEventListener("visibilitychange",ce)}},[Y,ti]),b.useEffect(()=>{if(!Y){gn(Xh);return}gn({...Xh,loading:!0}),se({type:"session.history",sessionId:Y})},[Y,se]);const hd=b.useCallback(()=>{!Y||Ge.loading||!qx(Ge)||(gn(p=>({...p,loading:!0})),se({type:"session.history",sessionId:Y,before:j_(Ge)}))},[Y,Ge,se]),pd=b.useMemo(()=>sv(Ge.entries),[Ge.entries]),Z=b.useMemo(()=>D.find(p=>p.id===Y)??null,[D,Y]),In=Y?(Z==null?void 0:Z.claudeSessionId)??Y:null,Ns=In?hl[In]??null:null;b.useEffect(()=>{In&&se({type:"handoff.get",sessionId:In})},[In,se]),b.useEffect(()=>{ql&&!(ql.sessionId in hl)&&Sl(null)},[hl,ql]);const Fc=b.useMemo(()=>{var ce;if(!Rt)return null;const p=(((ce=Rt.buckets)==null?void 0:ce.length)??0)>0,z=(Z==null?void 0:Z.provider)==="antigravity";return p===z?Rt:null},[Rt,Z==null?void 0:Z.provider]),Jc="Обновить лимиты и контекст",pu=Jc+(Zc?`
134
- обновлено в ${new Date(Zc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");b.useEffect(()=>{document.documentElement.dataset.provider=(Z==null?void 0:Z.provider)??"claude"},[Z==null?void 0:Z.provider]),b.useEffect(()=>{(Z==null?void 0:Z.provider)==="antigravity"&&Br(!1)},[Z==null?void 0:Z.provider]);const Sa=T.find(p=>p.id===q)??C.find(p=>p.id===q)??null;b.useEffect(()=>{if(!q||!Y)return;const p={workspaceId:q,sessionId:Y,claudeSessionId:(Z==null?void 0:Z.claudeSessionId)??null};try{localStorage.setItem(gy,JSON.stringify(p))}catch{}},[q,Y,Z==null?void 0:Z.claudeSessionId]);function Pc(p){ws.current=p,cn(null),se({type:"workspace.open",path:p})}function md(p,z,ce){cn(null),se({type:"workspace.create",parent:p,name:z,init:ce})}function ni(p){if(Fi.current=p,!p){pt([]),Bt(!1);return}Bt(!0),se({type:"workspace.find",query:p})}function Wc(p){Fi.current=p,Mt(vl),se({type:"workspace.find.agent",query:p})}function Pi(){_t(!1),cn(null),ot(null),pt([]),Mt(vl),rl(null),Fi.current="",ws.current=null}function Xs(){const p=kn.current;p&&Ss.current&&se({type:"side.reset",sessionId:p}),Ss.current=null,Ir(null),qr(vl),Gr(null),_a({}),Ki.current=[]}function mu(p){se({type:"workspace.close",workspaceIds:p}),!(!q||!p.includes(q))&&(Xs(),_e(null),Ae(null),R([]),ee([]),bt(vl),Xe(null),ct(!1))}function wa(p,z){se({type:"session.archive",workspaceId:p,sessionIds:z}),Y&&(z.includes(Y)||Z!=null&&Z.claudeSessionId&&z.includes(Z.claudeSessionId))&&(Xs(),Ae(null),bt(vl),Xe(null),ct(!1))}function li(p){se({type:"workspace.restore",workspaceIds:p})}function eo(p,z,ce){se({type:"folder.create",scope:p,name:z,workspaceId:ce})}function gu(p,z){se({type:"folder.rename",folderId:p,name:z})}function Na(p,z){se({type:"folder.setColor",folderId:p,color:z})}function xu(p){se({type:"folder.delete",folderId:p})}function bu(p,z,ce,Te){se({type:"folder.assign",scope:p,itemId:z,folderId:ce,workspaceId:Te})}function _u(p=Xn[0]??"claude"){q&&(Xs(),Ae(null),Xe(null),bt(vl),ct(!1),se({type:"session.start",workspaceId:q,provider:p}),dt(!1))}function to(p){Xs(),uo(),_e(p),Ae(null),bt(vl),Xe(null),ct(!1),Dn(null),bs(null),Vl(null),_n(null),rs(""),ge(!1),He(null),Tt(!1),Vi([]),Lr(null)}function gd(p,z,ce){se({type:"session.pin",workspaceId:p,sessionIds:z,pinned:ce})}function xd(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Xr(p){if(xd(p)){ie(p);return}se({type:"session.close",sessionId:p.id})}function yu(p,z,ce){te(Te=>{const St=Te??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!ce)return Te;const Tn={...St.sessions};return z&&z.length>0?Tn[ce]=z:delete Tn[ce],{...St,sessions:Tn}}return{...St,[p]:z??[]}}),se({type:"order.set",scope:p,ids:z,...ce?{workspaceId:ce}:{}})}function no(p){p.workspaceId!==q&&to(p.workspaceId),gl(p)}function gl(p){if(dt(!1),Xs(),bt(vl),Xe(null),ct(!1),p.state==="closed"){Ae(null),se({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}Ae(p.id),se({type:"session.sync",sessionId:p.id,sinceSeq:0})}function Vr(p,z){if(!Y||x)return!1;const ce=Y,Te=Z;return xl(()=>{if((Te==null?void 0:Te.state)==="closed"){Ja.current={sessionId:Te.id,text:p,images:z},gl(Te);return}se({type:"prompt.send",sessionId:ce,text:p,images:z})})}function xl(p){const z=(Z==null?void 0:Z.provider)==="antigravity"?null:xk(Rt,tn);return z?new Promise(ce=>{Ce(Te=>(Te==null||Te.resolve(!1),{warning:z,resolve:ce}))}).then(ce=>(ce&&p(),ce)):(p(),!0)}function Vs(p){xe&&(xe.resolve(p),Ce(null))}function Qr(p){const z=be.find(ce=>(ce.claudeSessionId??ce.id)===p.sessionId&&ce.state!=="closed");er(p.workspaceId,p.sessionId,p.text),z&&se({type:"session.close",sessionId:z.id})}function Wi(p){er(p.workspaceId,p.claudeSessionId??p.id,null)}function er(p,z,ce){Pa.current=ce===null?null:{workspaceId:p,text:ce},p!==q?to(p):(Xs(),Ae(null),Xe(null),bt(vl),ct(!1)),se({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:z,...ce===null?{}:{fromHandoff:!0}}),dt(!1)}b.useEffect(()=>{Yl&&(wl(null),Qr(Yl))},[Yl]);function Kr(p){xs[p.id]||(Gl(z=>({...z,[p.id]:!0})),se({type:"session.handoff",sessionId:p.id}))}function ka(p){se({type:"handoff.dismiss",sessionId:p})}function lo(p,z){se({type:"session.rename",sessionId:p.id,title:z,workspaceId:p.workspaceId}),R(ce=>ce.map(Te=>Te.id===p.id?{...Te,title:z}:Te)),Q(ce=>{const Te=ce[p.workspaceId];return Te?{...ce,[p.workspaceId]:{...Te,sessions:Te.sessions.map(St=>St.id===p.id?{...St,title:z}:St)}}:ce})}function tr(p){Y&&(dt(!1),Le(null),$n(null),Yn(p),se({type:"mcp.list",sessionId:Y}),se({type:"plugin.list",sessionId:Y}))}const si={mcpAction:(p,z)=>{Y&&(Le(null),se({type:"mcp.action",sessionId:Y,name:p,action:z}))},mcpAuth:p=>{Y&&(Le(null),$n({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),se({type:"mcp.auth",sessionId:Y,name:p}))},mcpAuthCallback:(p,z)=>{Y&&se({type:"mcp.auth_callback",sessionId:Y,name:p,callbackUrl:z})},mcpAdd:(p,z)=>{Y&&se({type:"mcp.add",sessionId:Y,name:p,draft:z})},mcpRemove:p=>{Y&&se({type:"mcp.remove",sessionId:Y,name:p})},pluginInstall:p=>{Y&&se({type:"plugin.install",sessionId:Y,spec:p})},pluginUninstall:p=>{Y&&se({type:"plugin.uninstall",sessionId:Y,id:p})},pluginToggle:(p,z)=>{Y&&se({type:"plugin.toggle",sessionId:Y,id:p,enabled:z})},marketplaceAdd:p=>{Y&&se({type:"marketplace.add",sessionId:Y,source:p})},marketplaceRemove:p=>{Y&&se({type:"marketplace.remove",sessionId:Y,name:p})}};function vu(){dt(!1),Mn(!0),se({type:"auth.status"})}const nl={login:(p,z)=>se({type:"auth.login",mode:p,switchAccount:z}),submitCode:p=>se({type:"auth.code",code:p}),cancel:()=>se({type:"auth.cancel"}),logout:()=>se({type:"auth.logout"})};function so(){dt(!1),Et(!0),se({type:"settings.get"})}function ks(p){$l(z=>z&&{...z,...p}),se({type:"settings.update",settings:p})}function ju(p){!Y||x||se({type:"side.ask",sessionId:Y,text:p})}function Zr(){Y&&(se({type:"side.reset",sessionId:Y}),Ss.current=null,Ir(null),qr(vl),Gr(null),_a({}),Ki.current=[])}function Jl(p){const z=Ss.current;if(z){p(z);return}const ce=kn.current;ce&&(Ki.current.push(p),se({type:"side.open",sessionId:ce}))}function Fr(){q&&se({type:"git.state",workspaceId:q})}function Su(p){q&&(Vl(p),se({type:"git.show",workspaceId:q,ref:p}))}function Jr(p,z){_n(null),Nn({target:p,label:z})}function wu(){!q||!Ql||(se({type:"git.checkout",workspaceId:q,target:Ql.target}),Nn(null))}function Al(){q&&(_n(null),se({type:"git.push",workspaceId:q}))}function ai(p){q&&(_n(null),se({type:"git.pull",workspaceId:q,merge:p}))}function ii(){q&&(_n(null),He(null),ge(!0),se({type:"github.status"}),se({type:"github.owners"}),se({type:"git.files",workspaceId:q}))}function Pr(p){q&&(_n(null),se({type:"git.publish",workspaceId:q,...p}))}function nr(p){q&&(_n(null),se({type:"git.remote",workspaceId:q,url:p}))}function Ml(){_n(null),Tt(!0)}function Rl(p){se({type:"github.token",token:p}),se({type:"github.owners"})}function Qs(){se({type:"github.status"}),se({type:"github.owners"})}b.useEffect(()=>{if(!(!jt||!q))for(const p of le)p in vt||se({type:"fs.list",workspaceId:q,path:p})},[jt,le,vt,q,se]);function os(p){we(z=>z.includes(p)?z.filter(ce=>ce!==p):[...z,p])}function us(p){if(!p){Dr(null);return}q&&se({type:"fs.search",workspaceId:q,query:p})}function Es(p){if(!p){Ic(null);return}q&&se({type:"fs.grep",workspaceId:q,query:p})}const ao=b.useCallback((p,z)=>{Gi(St=>({...St,[p]:z}));const ce=En.current;if(z===null||!ce)return;const Te=z.lastIndexOf("/");if(Te!==-1){se({type:"fs.list",workspaceId:ce,path:z.slice(0,Te)});return}if(z===""){se({type:"fs.list",workspaceId:ce,path:""});return}se({type:"fs.search",workspaceId:ce,query:z,scope:p})},[se]),io=b.useMemo(()=>c_(ma.mention??null,Yi.mention??null,vt),[ma.mention,Yi.mention,vt]),ro=b.useMemo(()=>c_(ma.side??null,Yi.side??null,vt),[ma.side,Yi.side,vt]);function Nu(p){Yt(p.path,{line:p.line,column:p.column})}function qn(p){const z=[];let ce=Er(p.path);for(;z.push(ce),!!ce;)ce=Er(ce);we(Te=>{const St=new Set(Te);for(const Tn of z)St.add(Tn);return p.kind==="dir"&&St.add(p.path),[...St]}),p.kind==="file"&&Yt(p.path)}function Yt(p,z){if(Fl.current.find(Te=>Te.path===p)){pl(p),z&&Xi({path:p,...z,token:++Za.current});return}q&&(z&&(ga.current={path:p,...z}),Ji.current.add(p),se({type:"fs.read",workspaceId:q,path:p}))}function it(p,z=!1){const ce=Fl.current,Te=ce.find(bl=>bl.path===p);if(Te&&$a(Te)&&!z){Qa(p);return}Qa(null);const St=ce.findIndex(bl=>bl.path===p),Tn=ce.filter(bl=>bl.path!==p);Ut(Tn),pl(bl=>{var Ds;return bl===p?((Ds=Tn[Math.min(St,Tn.length-1)])==null?void 0:Ds.path)??null:bl})}function Pl(p,z=!1){const ce=Fl.current.find(Te=>Te.path===p);!ce||!q||!z&&!$a(ce)||($s.current.set(p,ce.text),se({type:"fs.write",workspaceId:q,path:p,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...z?{force:!0}:{}}))}function Dl(p){q&&se({type:"fs.read",workspaceId:q,path:p})}function co(p){q&&(ei.current.has(p)||(ei.current.add(p),se({type:"fs.readMedia",workspaceId:q,path:p})))}const Ks=b.useRef(new Map);function ku(p){const z=Ks.current,ce=z.get(p);ce&&clearTimeout(ce);const Te=(tn==null?void 0:tn.autoSaveAfterPauseMs)??0;Te<=0||z.set(p,setTimeout(()=>{z.delete(p);const St=Fl.current.find(Tn=>Tn.path===p);St&&$a(St)&&!St.stale&&Pl(p)},Te))}function Eu(p,z,ce){if(!q)return;const Te=p?`${p}/${ce}`:ce;Qn(null),z==="file"&&(ja.current=Te),se({type:"fs.create",workspaceId:q,path:Te,kind:z})}function ri(p,z){if(!q)return;const ce=Er(p),Te=ce?`${ce}/${z}`:z;Qn(null),Wa.current={from:p,to:Te},se({type:"fs.rename",workspaceId:q,path:p,to:Te})}function Ea(p,z){if(!q)return;const ce=p.slice(p.lastIndexOf("/")+1),Te=z?`${z}/${ce}`:ce;Te!==p&&(Qn(null),Wa.current={from:p,to:Te},se({type:"fs.rename",workspaceId:q,path:p,to:Te}))}function oo(p,z){q&&(Qn(null),se({type:"fs.copy",workspaceId:q,path:p,toDir:z}))}function lr(p){q&&(Qn(null),Gs(null),se({type:"fs.delete",workspaceId:q,path:p.path}),Ut(z=>z.filter(ce=>ce.path!==p.path&&!ce.path.startsWith(`${p.path}/`))),pl(z=>z&&(z===p.path||z.startsWith(`${p.path}/`))?null:z))}function uo(){N({}),we([""]),Ut([]),pl(null),Qn(null),Dr(null),Ic(null),Gi({}),tl({}),Xi(null),Ji.current.clear(),$s.current.clear(),ei.current.clear(),ga.current=null,Wa.current=null,ja.current=null}function Ta(){!q||Hr||!ba||(zr(null),$c.current=!0,se({type:"term.open",workspaceId:q,cols:80,rows:24}))}function Ts(p){se({type:"term.close",id:p})}function Zs(p,z){Y&&se({type:"permission.respond",sessionId:Y,requestId:p,decision:z})}function Cs(p,z){Y&&se({type:"permission.respond",sessionId:Y,requestId:p,decision:"allow",answers:z})}function fo(p){Y&&se({type:"permission.respond",sessionId:Y,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function ho(p,z){Y&&se({type:"permission.respond",sessionId:Y,requestId:p,decision:"allow",plan:z})}function ci(p){Y&&se({type:"permission.respond",sessionId:Y,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}b.useEffect(()=>{function p(z){if(z.key!=="Escape")return;if(fn!==null){const Te=z.target;if(!(Te instanceof HTMLElement&&Te.closest(".termview, .editor, .sidepane"))){Vc(null);return}}if(!Y||Ue.pending.length>0)return;const ce=z.target;ce instanceof HTMLElement&&ce.closest(".sidepane, .editor")||se({type:"control.interrupt",sessionId:Y})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Y,Ue.pending.length,se,fn]),b.useEffect(()=>{function p(z){z.key!=="`"||!(z.ctrlKey||z.metaKey)||ba&&(z.preventDefault(),qc(ce=>!ce))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ba]);const sr=b.useMemo(()=>{const p=(Me==null?void 0:Me.commands)??[];return p.length===0||(Z==null?void 0:Z.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...r_]},[Me,Z==null?void 0:Z.provider]);function Fs(p){const z=Bk[p];return z&&(Z==null?void 0:Z.provider)!=="antigravity"?(tr(z),!0):(Z==null?void 0:Z.provider)==="antigravity"||!r_.some(ce=>ce.name===p)?!1:(vu(),p==="logout"&&nl.logout(),p==="switch-account"&&nl.login("claudeai",!0),!0)}const yn=(Z==null?void 0:Z.state)==="waiting_permission",cl=(Z==null?void 0:Z.state)==="reconnecting",Ol=(Z==null?void 0:Z.state)==="running"||cl||yn,Pt=Ue.pending[0]??null,po=Pt?Bw(Pt.toolName,Pt.input):null,[bd,vn]=b.useState(()=>new Set),oi=Pt?bd.has(Pt.requestId):!1,ui=Pt?Pt.questions&&Pt.questions.length>0?"question":po!==null?"plan":"permission":null;function Js(p,z){vn(ce=>{if(ce.has(p)===z)return ce;const Te=new Set(ce);return z?Te.add(p):Te.delete(p),Te})}b.useEffect(()=>{!pn&&!jt||!q||Ol||se({type:"git.state",workspaceId:q})},[pn,jt,q,Ol,se]),b.useEffect(()=>{if(!(Ol||!q)){jt&&N(p=>{const z={};for(const[ce,Te]of Object.entries(p))du.current.includes(ce)||(z[ce]=Te);return z});for(const p of Fl.current)$a(p)||se({type:"fs.read",workspaceId:q,path:p.path})}},[Ol,q,jt,se]);const ar=(Z==null?void 0:Z.cwd)??(Me==null?void 0:Me.cwd)??null,Ca=(Me==null?void 0:Me.models)??[],As=(Z==null?void 0:Z.model)??(Me==null?void 0:Me.model)??null,{rows:Tu,selected:Cu}=u_(Ca,As),ir=js?{model:js.model,effort:js.effort,ultracode:js.ultracode,thinking:js.thinking,switchOnFlag:js.switchModelsOnFlag}:{model:Qi.model??As,effort:Qi.effort??(Z==null?void 0:Z.effort)??null,ultracode:Qi.ultracode??(Z==null?void 0:Z.ultracode)??!1,thinking:Qi.thinking??(Z==null?void 0:Z.thinking)??!0,switchOnFlag:Qi.switchOnFlag??(Z==null?void 0:Z.switchModelsOnFlag)??!0},mo=u_(Ca,ir.model),Aa=(js==null?void 0:js.state)==="running",rr=Kl?Ie.find(p=>p.path===Kl)??null:null,Wr=new Set(Ie.filter($a).map(p=>p.path)),fi=p=>a.jsx(yk,{pane:p,width:bn.widths[p],onResize:z=>bn.setWidth(p,z),onReset:()=>bn.reset(p)}),Wl=p=>kt?null:()=>dd(p),go=(Z==null?void 0:Z.provider)==="antigravity"?uv:S_,cr=Me&&a.jsx(Bs,{title:"Режим прав",value:(Z==null?void 0:Z.permissionMode)??"default",options:go.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{Y&&se({type:"control.set_mode",sessionId:Y,mode:p})}}),or=Tu.length>0?a.jsx(uy,{models:Tu,value:Cu,effort:(Z==null?void 0:Z.effort)??null,ultracode:(Z==null?void 0:Z.ultracode)??!1,thinking:(Z==null?void 0:Z.thinking)??!0,switchOnFlag:(Z==null?void 0:Z.switchModelsOnFlag)??!0,showSwitchOnFlag:(Z==null?void 0:Z.provider)!=="antigravity",onModel:p=>{!Y||!p||se({type:"control.set_model",sessionId:Y,model:p})},onEffort:p=>{Y&&se({type:"control.set_effort",sessionId:Y,effort:p})},onUltracode:p=>{Y&&se({type:"control.set_ultracode",sessionId:Y,enabled:p})},onThinking:p=>{Y&&se({type:"control.set_thinking",sessionId:Y,enabled:p})},onSwitchOnFlag:p=>{Y&&se({type:"control.set_flag_switch",sessionId:Y,enabled:p})}}):As&&a.jsx("span",{className:"badge",children:As}),Au=Ol&&a.jsx("span",{className:yn?"badge badge--wait":"badge badge--live",children:yn?"ждёт":cl?"переподключается":"работает"}),Mu=(Z==null?void 0:Z.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Ps=Au||Mu,Ws=()=>{Y&&se({type:"session.reconnect",sessionId:Y})},Ru=cl?"Сессия уже поднимает новый процесс":Ol?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Du=Y&&(cl||(Z==null?void 0:Z.state)==="error")?a.jsxs("div",{className:cl?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),cl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:cl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Ws,children:cl?"Переподключить сейчас":"Переподключить"})]}):null,di=Ns?a.jsx(uk,{handoff:Ns,onContinue:()=>Qr(Ns),onShow:()=>Sl(Ns),onDismiss:()=>ka(Ns.sessionId)}):null,Ma=Z&&Z.totalCostUsd>0?`$${Z.totalCostUsd.toFixed(3)}`:null,ur=(Z==null?void 0:Z.provider)!=="antigravity"&&a.jsx("button",{className:vs?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":vs,onClick:()=>Br(p=>!p),children:a.jsx(Zk,{})}),fr=Z&&Z.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Xr(Z),children:a.jsx(Xk,{})}),Ms=Z?xs[Z.id]===!0:!1,ec=E_({onLongPress:()=>{Z&&Wi(Z)},onClick:()=>{Z&&Kr(Z)},disabled:Ms}),Ra=Z&&Z.state!=="closed"&&Z.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:Ms?"pane-btn pane-btn--handoff is-busy":ec.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ec.thresholdMs}ms`},title:Ms?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Ms,disabled:Ms,...ec.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(Vk,{})]});return a.jsxs("div",{className:"app",style:bn.style,children:[a.jsx(pS,{open:Ke,connected:s,status:c,workspaces:T,archivedWorkspaces:C,workspaceFolders:P,sessionFolders:K,pinnedFolders:V,projectSessions:B,onRequestSessions:p=>se({type:"session.list",workspaceId:p}),pinned:pe,live:be,listOrder:k,liveSessionsFirst:(tn==null?void 0:tn.liveSessionsFirst)===!0,onReorder:yu,activeWorkspaceId:q,activeSessionId:Y,onPinSessions:gd,onSelectPinned:no,onCloseWorkspaces:mu,onRestoreWorkspaces:li,onArchiveSessions:wa,onUnarchiveSessions:(p,z)=>{se({type:"session.unarchive",workspaceId:p,sessionIds:z})},onCreateFolder:eo,onRenameFolder:gu,onSetFolderColor:Na,onDeleteFolder:xu,onAssignToFolder:bu,onSelectWorkspace:to,onRenameSession:lo,onStopSession:Xr,onOpenWorkspace:()=>_t(!0),onNewSession:_u,enabledProviders:Xn,onOpenExtensions:Y&&(Z==null?void 0:Z.provider)!=="antigravity"?()=>tr("mcp"):null,account:qs,onOpenAccount:vu,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:so,themeMode:is,onCycleTheme:Xl}),fi("sidebar"),Ke&&a.jsx("div",{className:"scrim",onClick:()=>dt(!1)}),a.jsx(Nj,{open:jt,tree:vt,expanded:new Set(le),activePath:Kl,dirty:Wr,gitChanges:(qt==null?void 0:qt.changed)??[],result:Zl,searchResult:Rr,onSearch:us,onReveal:qn,onToggle:os,onOpen:Yt,onCreate:Eu,onRename:ri,onMove:Ea,onCopy:oo,onDelete:Gs,onRefresh:()=>{Qn(null),N({}),Fr()},onClose:()=>Ft(!1),zoomed:fn==="files",onToggleZoom:Wl("files")}),jt&&fn!=="files"&&fi("files"),a.jsx(Lj,{open:ml,result:$i,onSearch:Es,onOpenMatch:Nu,onClose:()=>Ys(!1),zoomed:fn==="search",onToggleZoom:Wl("search")}),ml&&fn!=="search"&&fi("search"),a.jsx(eN,{open:pn,state:qt,result:_s,selected:qi,busy:ys,onRefresh:Fr,onShow:Su,onCheckout:Jr,onPush:Al,onPull:ai,onPublish:ii,onConnectRemote:Ml,onDismissResult:()=>_n(null),onClose:()=>el(!1),zoomed:fn==="git",onToggleZoom:Wl("git")}),pn&&fn!=="git"&&fi("git"),a.jsxs("main",{className:fn==="main"||fn==="terminal"?"main main--zoomed":"main",children:[m&&x&&a.jsx(dk,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>dt(!0),children:"☰"}),a.jsx("button",{className:jt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":jt,onClick:()=>{Ft(p=>!p),el(!1),Ys(!1)},children:a.jsx(Gk,{})}),a.jsx("button",{className:ml?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":ml,onClick:()=>{Ys(p=>!p),Ft(!1),el(!1)},children:a.jsx(Yk,{})}),a.jsx("button",{className:pn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":pn,onClick:()=>{el(p=>!p),Ft(!1),Ys(!1)},children:a.jsx($k,{})}),ba&&a.jsx("button",{className:xa?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":xa,onClick:()=>qc(p=>!p),children:a.jsx(Kk,{})}),kt&&ur,kt&&a.jsx("button",{className:Lt?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Lt,onClick:()=>je(!0),children:a.jsx(Fk,{})}),a.jsxs("div",{className:"topbar__id",children:[rt&&Z?a.jsx(da,{className:"rename--title",value:Z.title??"",onCommit:p=>{lo(Z,p),ct(!1)},onCancel:()=>ct(!1)}):a.jsxs("div",{className:"topbar__head",children:[a.jsx("button",{className:"topbar__title",disabled:!Z||kt,title:Z&&!kt?"Переименовать сессию":void 0,onClick:()=>ct(!0),children:(Z==null?void 0:Z.title)??"Claude Code Visual"}),Sa&&a.jsx("span",{className:"topbar__project",title:Sa.path,children:Sa.name})]}),kt?Ps:ar&&a.jsx(oy,{path:ar})]}),!kt&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:xn?"meters-refresh is-busy":"meters-refresh",title:pu,"aria-label":Jc,"aria-busy":xn,disabled:!Y||xn,onClick:ti,children:a.jsx(Jk,{})}),a.jsx(dy,{usage:Fc}),a.jsx(my,{}),cr,or,Ps,Ma&&a.jsx("span",{className:"badge badge--cost",children:Ma}),Ra,fr,ur]})]}),a.jsx(Rk,{tokens:(zt==null?void 0:zt.tokens)??Ue.contextTokens,maxTokens:(zt==null?void 0:zt.maxTokens)??null,fetchedAt:(zt==null?void 0:zt.fetchedAt)??null}),kt&&Lt&&a.jsx(DN,{onClose:()=>je(!1),permission:cr,model:or,usage:Fc,cwd:ar,costLabel:Ma,onRefresh:ti,refreshing:xn,metersFetchedAt:Zc,onRename:Z?()=>{ct(!0),je(!1)}:null,onHandoff:Z&&Z.state!=="closed"&&Z.provider!=="antigravity"?()=>{Kr(Z),je(!1)}:null,onFreshSession:Z&&Z.state!=="closed"&&Z.provider!=="antigravity"?()=>{Wi(Z),je(!1)}:null,handoffWriting:Ms,onStop:Z&&Z.state!=="closed"?()=>{Xr(Z),je(!1)}:null}),Ie.length>0&&a.jsx(eS,{files:Ie,activePath:Kl,busy:Ol,onSelect:pl,onClose:p=>it(p),zoomed:fn==="main",onToggleZoom:Wl("main")}),rr?a.jsx(Pj,{file:rr,goto:(Ka==null?void 0:Ka.path)===rr.path?Ka:null,onChange:(p,z)=>{Ut(ce=>ce.map(Te=>Te.path===p?{...Te,text:z}:Te)),ku(p)},onSave:p=>Pl(p),onReload:Dl,onOverwrite:p=>Pl(p,!0),onRequestMedia:co,onTogglePreview:p=>Ut(z=>z.map(ce=>ce.path===p?{...ce,previewMode:!ce.previewMode}:ce))}):a.jsxs(a.Fragment,{children:[a.jsx($p,{items:Ue.items,busy:Ol&&!cl,waiting:yn,empty:(Z==null?void 0:Z.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:pd,historyHasMore:qx(Ge),historyLoading:Ge.loading,onLoadHistory:hd,sessionId:Y??void 0,onEditMessage:(Z==null?void 0:Z.provider)==="antigravity"?void 0:(p,z,ce)=>{if(!Y||x)return!1;const Te=Y;return xl(()=>se({type:"prompt.edit",sessionId:Te,userIndex:p,text:z,images:ce}))}}),Du,di,Y&&((Rs=Z==null?void 0:Z.tasks)!=null&&Rs.length)?a.jsx(aS,{tasks:Z.tasks,onStop:p=>se({type:"task.stop",sessionId:Y,taskId:p})}):null,Pt&&ui&&oi&&a.jsx(Ow,{kind:ui,toolName:Pt.toolName,queued:Ue.pending.length-1,onExpand:()=>Js(Pt.requestId,!1)}),a.jsx(iy,{disabled:!Y,busy:Ol&&!cl,sendBlocked:x,placeholder:cl?"Промпт уйдёт, как только связь вернётся":(Z==null?void 0:Z.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:sr,sessionTitle:(Z==null?void 0:Z.title)??null,contextResult:io,draftKey:Y,onContextSearch:p=>ao("mention",p),onCommand:Fs,onSend:Vr,onInterrupt:()=>{Y&&se({type:"control.interrupt",sessionId:Y})}})]}),xa&&ba&&a.jsxs(a.Fragment,{children:[!kt&&fn!=="terminal"&&a.jsx(jk,{height:Ur.height,onResize:Ur.setHeight,onReset:Ur.reset}),a.jsx(kk,{mobile:kt,zoomed:fn==="terminal",onToggleZoom:Wl("terminal"),terminals:Or,activeId:Gc,blocked:Hr,error:ud,onDismissError:()=>zr(null),height:kt?Yc.height:Ur.height,offset:kt?{top:Yc.offsetTop,left:Yc.offsetLeft}:void 0,onSelect:Lr,onOpen:Ta,onClose:Ts,onInput:(p,z)=>se({type:"term.input",id:p,data:z}),onResize:(p,z,ce)=>se({type:"term.resize",id:p,cols:z,rows:ce}),onAttach:p=>se({type:"term.attach",id:p}),onHide:()=>qc(!1),registerSink:fd})]})]}),a.jsx(SN,{open:vs,items:Xc.items,busy:Aa,ready:Y!==null,sendBlocked:x,commands:sr,contextResult:ro,draftKey:Y,models:mo.rows,model:mo.selected,effort:ir.effort,ultracode:ir.ultracode,thinking:ir.thinking,switchOnFlag:ir.switchOnFlag,onContextSearch:p=>ao("side",p),onCommand:Fs,onModel:p=>{p&&(_a(z=>({...z,model:p})),Jl(z=>se({type:"control.set_model",sessionId:z,model:p})))},onEffort:p=>{_a(z=>({...z,effort:p,ultracode:!1})),Jl(z=>se({type:"control.set_effort",sessionId:z,effort:p}))},onUltracode:p=>{_a(z=>({...z,ultracode:p,...p?{effort:"xhigh"}:{}})),Jl(z=>se({type:"control.set_ultracode",sessionId:z,enabled:p}))},onThinking:p=>{_a(z=>({...z,thinking:p})),Jl(z=>se({type:"control.set_thinking",sessionId:z,enabled:p}))},onSwitchOnFlag:p=>{_a(z=>({...z,switchOnFlag:p})),Jl(z=>se({type:"control.set_flag_switch",sessionId:z,enabled:p}))},onAsk:ju,onInterrupt:()=>{ou&&se({type:"control.interrupt",sessionId:ou})},onReset:Zr,onClose:()=>Br(!1),zoomed:fn==="ask",onToggleZoom:Wl("ask")}),vs&&fn!=="ask"&&fi("ask"),(pn||vs||jt||ml)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{el(!1),Br(!1),Ft(!1),Ys(!1)}}),Gt&&a.jsx(sN,{detail:Gt,local:((qt==null?void 0:qt.hasRemote)??!1)&&(qt==null?void 0:qt.commits.some(p=>p.hash===Gt.hash&&!p.pushed))===!0,onCheckout:Jr,onClose:()=>{bs(null),Vl(null)}}),xe&&a.jsxs(ul,{title:"Лимит плана почти исчерпан",onClose:()=>Vs(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>Vs(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>Vs(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[ld[xe.warning.limit][0].toUpperCase(),ld[xe.warning.limit].slice(1)," использован на"," ",Math.round(xe.warning.utilization)," %, сброс в"," ",bk(xe.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),ue&&a.jsx(ul,{title:"Остановить сессию?",onClose:()=>ie(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>ie(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{se({type:"session.close",sessionId:ue.id}),ie(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Ql&&a.jsxs(ul,{title:"Переключить рабочее дерево?",onClose:()=>Nn(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Nn(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:wu,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Ql.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Ol&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),qt&&qt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",qt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),$&&a.jsx(xN,{status:cs,owners:me,files:De,defaultName:(Sa==null?void 0:Sa.name)??"",hasCommits:qt===null||qt.head!=="",busy:ys,result:_s,onRefreshStatus:Qs,onSaveToken:Rl,onPublish:Pr,onDismissResult:()=>_n(null),onClose:()=>ge(!1)}),$e&&a.jsx(jN,{busy:ys,result:_s,onSubmit:nr,onDismissResult:()=>_n(null),onClose:()=>Tt(!1)}),pa&&a.jsx(ul,{title:pa.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Gs(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Gs(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>lr(pa),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[pa.path," будет удалён с диска",pa.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Cl&&a.jsx(ul,{title:"Закрыть без сохранения?",onClose:()=>Qa(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Qa(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>it(Cl,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Pl(Cl),it(Cl,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Cl," есть несохранённые правки."]})}),It&&a.jsx(LN,{tab:It,servers:re,plugins:Be,marketplaces:Ze,catalog:X,result:ke,auth:yt,remote:v,actions:si,onTab:Yn,onClose:()=>Yn(null)}),We&&a.jsx($N,{status:qs,login:El,actions:nl,remote:v,runningSessions:D.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:Y?()=>{Ws(),Mn(!1)}:null,reconnectBlocked:Ol,reconnectHint:Ru,onClose:()=>Mn(!1)}),y&&a.jsx(ZN,{state:d,onPair:(p,z)=>se({type:"relay.pair",code:p,...z?{name:z}:{}}),onUnpair:()=>se({type:"relay.unpair"}),onClose:()=>j(!1)}),kl&&a.jsx(ck,{settings:tn,models:(Me==null?void 0:Me.models)??[],relayState:d,networkState:m,local:If()==="local",onChange:ks,onEnableShell:()=>se({type:"relay.shell.enable"}),onDisableShell:()=>se({type:"relay.shell.disable"}),onOpenRelay:()=>{Et(!1),j(!0)},onClose:()=>Et(!1)}),ht&&a.jsx(Yw,{candidates:rn,searching:lt,agentItems:Jn.items,agentBusy:(Wt==null?void 0:Wt.state)==="running",error:wn,roots:Pn,created:st,onSearch:ni,onAskAgent:Wc,onInterrupt:()=>{const p=Zi.current;p&&se({type:"control.interrupt",sessionId:p})},onSubmit:Pc,onCreate:md,onClose:Pi}),Pt!=null&&Pt.questions&&Pt.questions.length>0?a.jsx(zw,{request:{...Pt,questions:Pt.questions},queued:Ue.pending.length-1,collapsed:oi,onCollapse:()=>Js(Pt.requestId,!0),onAnswer:Cs,onDecline:fo}):Pt&&po!==null?a.jsx(Rw,{request:Pt,plan:po,queued:Ue.pending.length-1,collapsed:oi,onCollapse:()=>Js(Pt.requestId,!0),onAccept:ho,onDecline:ci}):Pt&&a.jsx(Lw,{request:Pt,queued:Ue.pending.length-1,collapsed:oi,onCollapse:()=>Js(Pt.requestId,!0),onDecide:Zs}),ql&&a.jsx(fk,{handoff:ql,onClose:()=>Sl(null)}),a.jsx(mk,{notices:Wn,onDismiss:p=>en(z=>z.filter(ce=>ce.id!==p))})]})}function Gk(){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 Yk(){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 $k(){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 Xk(){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 Vk(){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 Qk(l,s){return f_(l)===f_(s)}function f_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}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("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 Zk(){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 Fk(){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 Jk(){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");I0.createRoot(xy).render(a.jsx(b.StrictMode,{children:a.jsx(qk,{})}));export{Y1 as D,ln as I,an as N,eE as P,ms as T,Is as a,q_ as b,Il as c,Wk as d,V_ as e,au as f,cj as h,tE as p,nE as s,Re as t};