@i14ks/ccv 0.7.0 → 0.7.2

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 (25) hide show
  1. package/bundle/ccv.mjs +64 -3
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-4gviWJRD.js → codemirror-CT_I9W8V.js} +1 -1
  4. package/web/assets/{index-CrX9ldma.js → index-BJxrsvYI.js} +1 -1
  5. package/web/assets/{index-DmEjP2AP.js → index-BUPafoiW.js} +1 -1
  6. package/web/assets/{index-DklW2LtN.js → index-BWCkRrtJ.js} +1 -1
  7. package/web/assets/{index-Bv8vIAVO.js → index-BXGO38V0.js} +1 -1
  8. package/web/assets/{index-CKz5fHXP.js → index-BfEIguB2.js} +1 -1
  9. package/web/assets/{index-CYwf9t3p.js → index-BhbDxjJk.js} +1 -1
  10. package/web/assets/{index-CkSGxu2i.js → index-BsWsF3Fl.js} +1 -1
  11. package/web/assets/{index-BiBGEAPz.js → index-BypqjF8L.js} +1 -1
  12. package/web/assets/{index-kMdLDVpb.js → index-C37A4Z6a.js} +1 -1
  13. package/web/assets/{index-Cid3pp7b.js → index-C73L6h-_.js} +1 -1
  14. package/web/assets/{index-B-8FWzpe.js → index-C7BowCu_.js} +1 -1
  15. package/web/assets/{index-BleqvvQk.js → index-CGu7N9dH.js} +1 -1
  16. package/web/assets/{index-C_LuD9HT.js → index-D6dXU68i.js} +1 -1
  17. package/web/assets/{index-hElc3lLb.js → index-DK3fr1-H.js} +1 -1
  18. package/web/assets/{index-CJo5aeRL.js → index-DQd5QKK5.js} +1 -1
  19. package/web/assets/{index-fWVyTiSX.js → index-DZONC7G0.js} +1 -1
  20. package/web/assets/{index-CE1G7QxT.css → index-DecijLh5.css} +1 -1
  21. package/web/assets/{index-Depy6k3N.js → index-Ds7Lfmpa.js} +1 -1
  22. package/web/assets/{index-CR_zbJ-Z.js → index-NSr-7K-t.js} +1 -1
  23. package/web/assets/{index-Bzq-v0Dg.js → index-P6iAB9yV.js} +55 -55
  24. package/web/assets/{index-BjCwOpLW.js → index-orsieMzN.js} +1 -1
  25. package/web/index.html +2 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B-8FWzpe.js","./index-BiBGEAPz.js","./index-CYwf9t3p.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-BjCwOpLW.js","./index-Depy6k3N.js","./index-Bv8vIAVO.js","./index-Cid3pp7b.js","./index-BleqvvQk.js","./index-CkSGxu2i.js","./index-CJo5aeRL.js","./index-CKz5fHXP.js","./index-CR_zbJ-Z.js","./index-hElc3lLb.js","./index-DklW2LtN.js","./index-DmEjP2AP.js","./index-fWVyTiSX.js","./index-kMdLDVpb.js","./index-C_LuD9HT.js","./index-CrX9ldma.js","./codemirror-4gviWJRD.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 U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in a?U_(a,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[l]=i;var Nt=(a,l,i)=>H_(a,typeof l!="symbol"?l+"":l,i),Qd=(a,l,i)=>l.has(a)||$g("Cannot "+i);var Be=(a,l,i)=>(Qd(a,l,"read from private field"),i?i.call(a):l.get(a)),Vt=(a,l,i)=>l.has(a)?$g("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,i),ft=(a,l,i,c)=>(Qd(a,l,"write to private field"),c?c.call(a,i):l.set(a,i),i),bn=(a,l,i)=>(Qd(a,l,"access private method"),i);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(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=i(o);fetch(o.href,d)}})();var $d={exports:{}},Oc={};/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-C7BowCu_.js","./index-BypqjF8L.js","./index-BhbDxjJk.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-orsieMzN.js","./index-Ds7Lfmpa.js","./index-BXGO38V0.js","./index-C73L6h-_.js","./index-CGu7N9dH.js","./index-BsWsF3Fl.js","./index-DQd5QKK5.js","./index-BfEIguB2.js","./index-NSr-7K-t.js","./index-DK3fr1-H.js","./index-BWCkRrtJ.js","./index-BUPafoiW.js","./index-DZONC7G0.js","./index-C37A4Z6a.js","./index-D6dXU68i.js","./index-BJxrsvYI.js","./codemirror-CT_I9W8V.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 H_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var B_=(a,l,i)=>l in a?H_(a,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[l]=i;var Nt=(a,l,i)=>B_(a,typeof l!="symbol"?l+"":l,i),Qd=(a,l,i)=>l.has(a)||$g("Cannot "+i);var Be=(a,l,i)=>(Qd(a,l,"read from private field"),i?i.call(a):l.get(a)),Vt=(a,l,i)=>l.has(a)?$g("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,i),ft=(a,l,i,c)=>(Qd(a,l,"write to private field"),c?c.call(a,i):l.set(a,i),i),xn=(a,l,i)=>(Qd(a,l,"access private method"),i);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function i(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=i(o);fetch(o.href,d)}})();var $d={exports:{}},Oc={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@ var U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var Zg;function B_(){if(Zg)return Oc;Zg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(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 p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:a,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Oc.Fragment=l,Oc.jsx=i,Oc.jsxs=i,Oc}var Kg;function q_(){return Kg||(Kg=1,$d.exports=B_()),$d.exports}var r=q_(),Zd={exports:{}},Ve={};/**
10
+ */var Zg;function q_(){if(Zg)return Oc;Zg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(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:a,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Oc.Fragment=l,Oc.jsx=i,Oc.jsxs=i,Oc}var Kg;function G_(){return Kg||(Kg=1,$d.exports=q_()),$d.exports}var r=G_(),Zd={exports:{}},Ve={};/**
11
11
  * @license React
12
12
  * react.production.js
13
13
  *
@@ -15,7 +15,7 @@ var U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Jg;function G_(){if(Jg)return Ve;Jg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=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"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,B={};function q(w,J,ue){this.props=w,this.context=J,this.refs=B,this.updater=ue||N}q.prototype.isReactComponent={},q.prototype.setState=function(w,J){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,J,"setState")},q.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function z(){}z.prototype=q.prototype;function X(w,J,ue){this.props=w,this.context=J,this.refs=B,this.updater=ue||N}var E=X.prototype=new z;E.constructor=X,D(E,q.prototype),E.isPureReactComponent=!0;var H=Array.isArray;function U(){}var M={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function ie(w,J,ue){var he=ue.ref;return{$$typeof:a,type:w,key:J,ref:he!==void 0?he:null,props:ue}}function de(w,J){return ie(w.type,J,w.props)}function W(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function se(w){var J={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(ue){return J[ue]})}var ge=/\/+/g;function je(w,J){return typeof w=="object"&&w!==null&&w.key!=null?se(""+w.key):J.toString(36)}function me(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(U,U):(w.status="pending",w.then(function(J){w.status==="pending"&&(w.status="fulfilled",w.value=J)},function(J){w.status==="pending"&&(w.status="rejected",w.reason=J)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function O(w,J,ue,he,Ne){var Ae=typeof w;(Ae==="undefined"||Ae==="boolean")&&(w=null);var qe=!1;if(w===null)qe=!0;else switch(Ae){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(w.$$typeof){case a:case l:qe=!0;break;case y:return qe=w._init,O(qe(w._payload),J,ue,he,Ne)}}if(qe)return Ne=Ne(w),qe=he===""?"."+je(w,0):he,H(Ne)?(ue="",qe!=null&&(ue=qe.replace(ge,"$&/")+"/"),O(Ne,J,ue,"",function(Ut){return Ut})):Ne!=null&&(W(Ne)&&(Ne=de(Ne,ue+(Ne.key==null||w&&w.key===Ne.key?"":(""+Ne.key).replace(ge,"$&/")+"/")+qe)),J.push(Ne)),1;qe=0;var st=he===""?".":he+":";if(H(w))for(var Ze=0;Ze<w.length;Ze++)he=w[Ze],Ae=st+je(he,Ze),qe+=O(he,J,ue,Ae,Ne);else if(Ze=C(w),typeof Ze=="function")for(w=Ze.call(w),Ze=0;!(he=w.next()).done;)he=he.value,Ae=st+je(he,Ze++),qe+=O(he,J,ue,Ae,Ne);else if(Ae==="object"){if(typeof w.then=="function")return O(me(w),J,ue,he,Ne);throw J=String(w),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return qe}function te(w,J,ue){if(w==null)return w;var he=[],Ne=0;return O(w,he,"","",function(Ae){return J.call(ue,Ae,Ne++)}),he}function Y(w){if(w._status===-1){var J=w._result;J=J(),J.then(function(ue){(w._status===0||w._status===-1)&&(w._status=1,w._result=ue)},function(ue){(w._status===0||w._status===-1)&&(w._status=2,w._result=ue)}),w._status===-1&&(w._status=0,w._result=J)}if(w._status===1)return w._result.default;throw w._result}var oe=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},xe={map:te,forEach:function(w,J,ue){te(w,function(){J.apply(this,arguments)},ue)},count:function(w){var J=0;return te(w,function(){J++}),J},toArray:function(w){return te(w,function(J){return J})||[]},only:function(w){if(!W(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ve.Activity=j,Ve.Children=xe,Ve.Component=q,Ve.Fragment=i,Ve.Profiler=o,Ve.PureComponent=X,Ve.StrictMode=c,Ve.Suspense=m,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(w){return M.H.useMemoCache(w)}},Ve.cache=function(w){return function(){return w.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(w,J,ue){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var he=D({},w.props),Ne=w.key;if(J!=null)for(Ae in J.key!==void 0&&(Ne=""+J.key),J)!P.call(J,Ae)||Ae==="key"||Ae==="__self"||Ae==="__source"||Ae==="ref"&&J.ref===void 0||(he[Ae]=J[Ae]);var Ae=arguments.length-2;if(Ae===1)he.children=ue;else if(1<Ae){for(var qe=Array(Ae),st=0;st<Ae;st++)qe[st]=arguments[st+2];he.children=qe}return ie(w.type,Ne,he)},Ve.createContext=function(w){return w={$$typeof:h,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Ve.createElement=function(w,J,ue){var he,Ne={},Ae=null;if(J!=null)for(he in J.key!==void 0&&(Ae=""+J.key),J)P.call(J,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ne[he]=J[he]);var qe=arguments.length-2;if(qe===1)Ne.children=ue;else if(1<qe){for(var st=Array(qe),Ze=0;Ze<qe;Ze++)st[Ze]=arguments[Ze+2];Ne.children=st}if(w&&w.defaultProps)for(he in qe=w.defaultProps,qe)Ne[he]===void 0&&(Ne[he]=qe[he]);return ie(w,Ae,Ne)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(w){return{$$typeof:p,render:w}},Ve.isValidElement=W,Ve.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:Y}},Ve.memo=function(w,J){return{$$typeof:x,type:w,compare:J===void 0?null:J}},Ve.startTransition=function(w){var J=M.T,ue={};M.T=ue;try{var he=w(),Ne=M.S;Ne!==null&&Ne(ue,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(U,oe)}catch(Ae){oe(Ae)}finally{J!==null&&ue.types!==null&&(J.types=ue.types),M.T=J}},Ve.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ve.use=function(w){return M.H.use(w)},Ve.useActionState=function(w,J,ue){return M.H.useActionState(w,J,ue)},Ve.useCallback=function(w,J){return M.H.useCallback(w,J)},Ve.useContext=function(w){return M.H.useContext(w)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(w,J){return M.H.useDeferredValue(w,J)},Ve.useEffect=function(w,J){return M.H.useEffect(w,J)},Ve.useEffectEvent=function(w){return M.H.useEffectEvent(w)},Ve.useId=function(){return M.H.useId()},Ve.useImperativeHandle=function(w,J,ue){return M.H.useImperativeHandle(w,J,ue)},Ve.useInsertionEffect=function(w,J){return M.H.useInsertionEffect(w,J)},Ve.useLayoutEffect=function(w,J){return M.H.useLayoutEffect(w,J)},Ve.useMemo=function(w,J){return M.H.useMemo(w,J)},Ve.useOptimistic=function(w,J){return M.H.useOptimistic(w,J)},Ve.useReducer=function(w,J,ue){return M.H.useReducer(w,J,ue)},Ve.useRef=function(w){return M.H.useRef(w)},Ve.useState=function(w){return M.H.useState(w)},Ve.useSyncExternalStore=function(w,J,ue){return M.H.useSyncExternalStore(w,J,ue)},Ve.useTransition=function(){return M.H.useTransition()},Ve.version="19.2.8",Ve}var Fg;function Rh(){return Fg||(Fg=1,Zd.exports=G_()),Zd.exports}var _=Rh(),Kd={exports:{}},Dc={},Jd={exports:{}},Fd={};/**
18
+ */var Jg;function I_(){if(Jg)return Ve;Jg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=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"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function C(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,H={};function $(w,K,oe){this.props=w,this.context=K,this.refs=H,this.updater=oe||N}$.prototype.isReactComponent={},$.prototype.setState=function(w,K){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,K,"setState")},$.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function M(){}M.prototype=$.prototype;function I(w,K,oe){this.props=w,this.context=K,this.refs=H,this.updater=oe||N}var E=I.prototype=new M;E.constructor=I,L(E,$.prototype),E.isPureReactComponent=!0;var X=Array.isArray;function O(){}var D={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function re(w,K,oe){var he=oe.ref;return{$$typeof:a,type:w,key:K,ref:he!==void 0?he:null,props:oe}}function de(w,K){return re(w.type,K,w.props)}function W(w){return typeof w=="object"&&w!==null&&w.$$typeof===a}function ie(w){var K={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(oe){return K[oe]})}var me=/\/+/g;function je(w,K){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):K.toString(36)}function ge(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(O,O):(w.status="pending",w.then(function(K){w.status==="pending"&&(w.status="fulfilled",w.value=K)},function(K){w.status==="pending"&&(w.status="rejected",w.reason=K)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function z(w,K,oe,he,Ne){var Ae=typeof w;(Ae==="undefined"||Ae==="boolean")&&(w=null);var qe=!1;if(w===null)qe=!0;else switch(Ae){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(w.$$typeof){case a:case l:qe=!0;break;case y:return qe=w._init,z(qe(w._payload),K,oe,he,Ne)}}if(qe)return Ne=Ne(w),qe=he===""?"."+je(w,0):he,X(Ne)?(oe="",qe!=null&&(oe=qe.replace(me,"$&/")+"/"),z(Ne,K,oe,"",function(Ut){return Ut})):Ne!=null&&(W(Ne)&&(Ne=de(Ne,oe+(Ne.key==null||w&&w.key===Ne.key?"":(""+Ne.key).replace(me,"$&/")+"/")+qe)),K.push(Ne)),1;qe=0;var st=he===""?".":he+":";if(X(w))for(var Ze=0;Ze<w.length;Ze++)he=w[Ze],Ae=st+je(he,Ze),qe+=z(he,K,oe,Ae,Ne);else if(Ze=C(w),typeof Ze=="function")for(w=Ze.call(w),Ze=0;!(he=w.next()).done;)he=he.value,Ae=st+je(he,Ze++),qe+=z(he,K,oe,Ae,Ne);else if(Ae==="object"){if(typeof w.then=="function")return z(ge(w),K,oe,he,Ne);throw K=String(w),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return qe}function te(w,K,oe){if(w==null)return w;var he=[],Ne=0;return z(w,he,"","",function(Ae){return K.call(oe,Ae,Ne++)}),he}function P(w){if(w._status===-1){var K=w._result;K=K(),K.then(function(oe){(w._status===0||w._status===-1)&&(w._status=1,w._result=oe)},function(oe){(w._status===0||w._status===-1)&&(w._status=2,w._result=oe)}),w._status===-1&&(w._status=0,w._result=K)}if(w._status===1)return w._result.default;throw w._result}var ae=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},xe={map:te,forEach:function(w,K,oe){te(w,function(){K.apply(this,arguments)},oe)},count:function(w){var K=0;return te(w,function(){K++}),K},toArray:function(w){return te(w,function(K){return K})||[]},only:function(w){if(!W(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Ve.Activity=j,Ve.Children=xe,Ve.Component=$,Ve.Fragment=i,Ve.Profiler=o,Ve.PureComponent=I,Ve.StrictMode=c,Ve.Suspense=p,Ve.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ve.__COMPILER_RUNTIME={__proto__:null,c:function(w){return D.H.useMemoCache(w)}},Ve.cache=function(w){return function(){return w.apply(null,arguments)}},Ve.cacheSignal=function(){return null},Ve.cloneElement=function(w,K,oe){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var he=L({},w.props),Ne=w.key;if(K!=null)for(Ae in K.key!==void 0&&(Ne=""+K.key),K)!F.call(K,Ae)||Ae==="key"||Ae==="__self"||Ae==="__source"||Ae==="ref"&&K.ref===void 0||(he[Ae]=K[Ae]);var Ae=arguments.length-2;if(Ae===1)he.children=oe;else if(1<Ae){for(var qe=Array(Ae),st=0;st<Ae;st++)qe[st]=arguments[st+2];he.children=qe}return re(w.type,Ne,he)},Ve.createContext=function(w){return w={$$typeof:h,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Ve.createElement=function(w,K,oe){var he,Ne={},Ae=null;if(K!=null)for(he in K.key!==void 0&&(Ae=""+K.key),K)F.call(K,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ne[he]=K[he]);var qe=arguments.length-2;if(qe===1)Ne.children=oe;else if(1<qe){for(var st=Array(qe),Ze=0;Ze<qe;Ze++)st[Ze]=arguments[Ze+2];Ne.children=st}if(w&&w.defaultProps)for(he in qe=w.defaultProps,qe)Ne[he]===void 0&&(Ne[he]=qe[he]);return re(w,Ae,Ne)},Ve.createRef=function(){return{current:null}},Ve.forwardRef=function(w){return{$$typeof:m,render:w}},Ve.isValidElement=W,Ve.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:P}},Ve.memo=function(w,K){return{$$typeof:x,type:w,compare:K===void 0?null:K}},Ve.startTransition=function(w){var K=D.T,oe={};D.T=oe;try{var he=w(),Ne=D.S;Ne!==null&&Ne(oe,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(O,ae)}catch(Ae){ae(Ae)}finally{K!==null&&oe.types!==null&&(K.types=oe.types),D.T=K}},Ve.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ve.use=function(w){return D.H.use(w)},Ve.useActionState=function(w,K,oe){return D.H.useActionState(w,K,oe)},Ve.useCallback=function(w,K){return D.H.useCallback(w,K)},Ve.useContext=function(w){return D.H.useContext(w)},Ve.useDebugValue=function(){},Ve.useDeferredValue=function(w,K){return D.H.useDeferredValue(w,K)},Ve.useEffect=function(w,K){return D.H.useEffect(w,K)},Ve.useEffectEvent=function(w){return D.H.useEffectEvent(w)},Ve.useId=function(){return D.H.useId()},Ve.useImperativeHandle=function(w,K,oe){return D.H.useImperativeHandle(w,K,oe)},Ve.useInsertionEffect=function(w,K){return D.H.useInsertionEffect(w,K)},Ve.useLayoutEffect=function(w,K){return D.H.useLayoutEffect(w,K)},Ve.useMemo=function(w,K){return D.H.useMemo(w,K)},Ve.useOptimistic=function(w,K){return D.H.useOptimistic(w,K)},Ve.useReducer=function(w,K,oe){return D.H.useReducer(w,K,oe)},Ve.useRef=function(w){return D.H.useRef(w)},Ve.useState=function(w){return D.H.useState(w)},Ve.useSyncExternalStore=function(w,K,oe){return D.H.useSyncExternalStore(w,K,oe)},Ve.useTransition=function(){return D.H.useTransition()},Ve.version="19.2.8",Ve}var Fg;function Rh(){return Fg||(Fg=1,Zd.exports=I_()),Zd.exports}var _=Rh(),Kd={exports:{}},Dc={},Jd={exports:{}},Fd={};/**
19
19
  * @license React
20
20
  * scheduler.production.js
21
21
  *
@@ -23,7 +23,7 @@ var U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var Wg;function I_(){return Wg||(Wg=1,(function(a){function l(O,te){var Y=O.length;O.push(te);e:for(;0<Y;){var oe=Y-1>>>1,xe=O[oe];if(0<o(xe,te))O[oe]=te,O[Y]=xe,Y=oe;else break e}}function i(O){return O.length===0?null:O[0]}function c(O){if(O.length===0)return null;var te=O[0],Y=O.pop();if(Y!==te){O[0]=Y;e:for(var oe=0,xe=O.length,w=xe>>>1;oe<w;){var J=2*(oe+1)-1,ue=O[J],he=J+1,Ne=O[he];if(0>o(ue,Y))he<xe&&0>o(Ne,ue)?(O[oe]=Ne,O[he]=Y,oe=he):(O[oe]=ue,O[J]=Y,oe=J);else if(he<xe&&0>o(Ne,Y))O[oe]=Ne,O[he]=Y,oe=he;else break e}}return te}function o(O,te){var Y=O.sortIndex-te.sortIndex;return Y!==0?Y:O.id-te.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var m=[],x=[],y=1,j=null,v=3,C=!1,N=!1,D=!1,B=!1,q=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function E(O){for(var te=i(x);te!==null;){if(te.callback===null)c(x);else if(te.startTime<=O)c(x),te.sortIndex=te.expirationTime,l(m,te);else break;te=i(x)}}function H(O){if(D=!1,E(O),!N)if(i(m)!==null)N=!0,U||(U=!0,se());else{var te=i(x);te!==null&&me(H,te.startTime-O)}}var U=!1,M=-1,P=5,ie=-1;function de(){return B?!0:!(a.unstable_now()-ie<P)}function W(){if(B=!1,U){var O=a.unstable_now();ie=O;var te=!0;try{e:{N=!1,D&&(D=!1,z(M),M=-1),C=!0;var Y=v;try{t:{for(E(O),j=i(m);j!==null&&!(j.expirationTime>O&&de());){var oe=j.callback;if(typeof oe=="function"){j.callback=null,v=j.priorityLevel;var xe=oe(j.expirationTime<=O);if(O=a.unstable_now(),typeof xe=="function"){j.callback=xe,E(O),te=!0;break t}j===i(m)&&c(m),E(O)}else c(m);j=i(m)}if(j!==null)te=!0;else{var w=i(x);w!==null&&me(H,w.startTime-O),te=!1}}break e}finally{j=null,v=Y,C=!1}te=void 0}}finally{te?se():U=!1}}}var se;if(typeof X=="function")se=function(){X(W)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,je=ge.port2;ge.port1.onmessage=W,se=function(){je.postMessage(null)}}else se=function(){q(W,0)};function me(O,te){M=q(function(){O(a.unstable_now())},te)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(O){O.callback=null},a.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},a.unstable_getCurrentPriorityLevel=function(){return v},a.unstable_next=function(O){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var Y=v;v=te;try{return O()}finally{v=Y}},a.unstable_requestPaint=function(){B=!0},a.unstable_runWithPriority=function(O,te){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Y=v;v=O;try{return te()}finally{v=Y}},a.unstable_scheduleCallback=function(O,te,Y){var oe=a.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?oe+Y:oe):Y=oe,O){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=Y+xe,O={id:y++,callback:te,priorityLevel:O,startTime:Y,expirationTime:xe,sortIndex:-1},Y>oe?(O.sortIndex=Y,l(x,O),i(m)===null&&O===i(x)&&(D?(z(M),M=-1):D=!0,me(H,Y-oe))):(O.sortIndex=xe,l(m,O),N||C||(N=!0,U||(U=!0,se()))),O},a.unstable_shouldYield=de,a.unstable_wrapCallback=function(O){var te=v;return function(){var Y=v;v=te;try{return O.apply(this,arguments)}finally{v=Y}}}})(Fd)),Fd}var Pg;function Y_(){return Pg||(Pg=1,Jd.exports=I_()),Jd.exports}var Wd={exports:{}},Zn={};/**
26
+ */var Wg;function Y_(){return Wg||(Wg=1,(function(a){function l(z,te){var P=z.length;z.push(te);e:for(;0<P;){var ae=P-1>>>1,xe=z[ae];if(0<o(xe,te))z[ae]=te,z[P]=xe,P=ae;else break e}}function i(z){return z.length===0?null:z[0]}function c(z){if(z.length===0)return null;var te=z[0],P=z.pop();if(P!==te){z[0]=P;e:for(var ae=0,xe=z.length,w=xe>>>1;ae<w;){var K=2*(ae+1)-1,oe=z[K],he=K+1,Ne=z[he];if(0>o(oe,P))he<xe&&0>o(Ne,oe)?(z[ae]=Ne,z[he]=P,ae=he):(z[ae]=oe,z[K]=P,ae=K);else if(he<xe&&0>o(Ne,P))z[ae]=Ne,z[he]=P,ae=he;else break e}}return te}function o(z,te){var P=z.sortIndex-te.sortIndex;return P!==0?P:z.id-te.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var p=[],x=[],y=1,j=null,v=3,C=!1,N=!1,L=!1,H=!1,$=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function E(z){for(var te=i(x);te!==null;){if(te.callback===null)c(x);else if(te.startTime<=z)c(x),te.sortIndex=te.expirationTime,l(p,te);else break;te=i(x)}}function X(z){if(L=!1,E(z),!N)if(i(p)!==null)N=!0,O||(O=!0,ie());else{var te=i(x);te!==null&&ge(X,te.startTime-z)}}var O=!1,D=-1,F=5,re=-1;function de(){return H?!0:!(a.unstable_now()-re<F)}function W(){if(H=!1,O){var z=a.unstable_now();re=z;var te=!0;try{e:{N=!1,L&&(L=!1,M(D),D=-1),C=!0;var P=v;try{t:{for(E(z),j=i(p);j!==null&&!(j.expirationTime>z&&de());){var ae=j.callback;if(typeof ae=="function"){j.callback=null,v=j.priorityLevel;var xe=ae(j.expirationTime<=z);if(z=a.unstable_now(),typeof xe=="function"){j.callback=xe,E(z),te=!0;break t}j===i(p)&&c(p),E(z)}else c(p);j=i(p)}if(j!==null)te=!0;else{var w=i(x);w!==null&&ge(X,w.startTime-z),te=!1}}break e}finally{j=null,v=P,C=!1}te=void 0}}finally{te?ie():O=!1}}}var ie;if(typeof I=="function")ie=function(){I(W)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,je=me.port2;me.port1.onmessage=W,ie=function(){je.postMessage(null)}}else ie=function(){$(W,0)};function ge(z,te){D=$(function(){z(a.unstable_now())},te)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return v},a.unstable_next=function(z){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var P=v;v=te;try{return z()}finally{v=P}},a.unstable_requestPaint=function(){H=!0},a.unstable_runWithPriority=function(z,te){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var P=v;v=z;try{return te()}finally{v=P}},a.unstable_scheduleCallback=function(z,te,P){var ae=a.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?ae+P:ae):P=ae,z){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=P+xe,z={id:y++,callback:te,priorityLevel:z,startTime:P,expirationTime:xe,sortIndex:-1},P>ae?(z.sortIndex=P,l(x,z),i(p)===null&&z===i(x)&&(L?(M(D),D=-1):L=!0,ge(X,P-ae))):(z.sortIndex=xe,l(p,z),N||C||(N=!0,O||(O=!0,ie()))),z},a.unstable_shouldYield=de,a.unstable_wrapCallback=function(z){var te=v;return function(){var P=v;v=te;try{return z.apply(this,arguments)}finally{v=P}}}})(Fd)),Fd}var Pg;function V_(){return Pg||(Pg=1,Jd.exports=Y_()),Jd.exports}var Wd={exports:{}},Zn={};/**
27
27
  * @license React
28
28
  * react-dom.production.js
29
29
  *
@@ -31,7 +31,7 @@ var U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var eb;function V_(){if(eb)return Zn;eb=1;var a=Rh();function l(m){var x="https://react.dev/errors/"+m;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 #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(m,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:m,containerInfo:x,implementation:y}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,x){if(m==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Zn.createPortal=function(m,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(l(299));return d(m,x,null,y)},Zn.flushSync=function(m){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=y,c.d.f()}},Zn.preconnect=function(m,x){typeof m=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(m,x))},Zn.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},Zn.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,C=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):y==="script"&&c.d.X(m,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Zn.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=p(x.as,x.crossOrigin);c.d.M(m,{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(m)},Zn.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin);c.d.L(m,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})}},Zn.preloadModule=function(m,x){if(typeof m=="string")if(x){var y=p(x.as,x.crossOrigin);c.d.m(m,{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(m)},Zn.requestFormReset=function(m){c.d.r(m)},Zn.unstable_batchedUpdates=function(m,x){return m(x)},Zn.useFormState=function(m,x,y){return h.H.useFormState(m,x,y)},Zn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Zn.version="19.2.8",Zn}var tb;function X_(){if(tb)return Wd.exports;tb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Wd.exports=V_(),Wd.exports}/**
34
+ */var eb;function X_(){if(eb)return Zn;eb=1;var a=Rh();function l(p){var x="https://react.dev/errors/"+p;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 #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(p,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:p,containerInfo:x,implementation:y}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Zn.createPortal=function(p,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(l(299));return d(p,x,null,y)},Zn.flushSync=function(p){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=x,c.p=y,c.d.f()}},Zn.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(p,x))},Zn.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},Zn.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,C=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:C}):y==="script"&&c.d.X(p,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Zn.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=m(x.as,x.crossOrigin);c.d.M(p,{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(p)},Zn.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin);c.d.L(p,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})}},Zn.preloadModule=function(p,x){if(typeof p=="string")if(x){var y=m(x.as,x.crossOrigin);c.d.m(p,{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(p)},Zn.requestFormReset=function(p){c.d.r(p)},Zn.unstable_batchedUpdates=function(p,x){return p(x)},Zn.useFormState=function(p,x,y){return h.H.useFormState(p,x,y)},Zn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Zn.version="19.2.8",Zn}var tb;function Q_(){if(tb)return Wd.exports;tb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Wd.exports=X_(),Wd.exports}/**
35
35
  * @license React
36
36
  * react-dom-client.production.js
37
37
  *
@@ -39,66 +39,66 @@ var U_=Object.defineProperty;var $g=a=>{throw TypeError(a)};var H_=(a,l,i)=>l in
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var nb;function Q_(){if(nb)return Dc;nb=1;var a=Y_(),l=Rh(),i=X_();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 p(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 m(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,s=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){n=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return m(u),e;if(f===s)return m(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==s.return)n=u,s=f;else{for(var g=!1,S=u.child;S;){if(S===n){g=!0,n=u,s=f;break}if(S===s){g=!0,s=u,n=f;break}S=S.sibling}if(!g){for(S=f.child;S;){if(S===n){g=!0,n=f,s=u;break}if(S===s){g=!0,s=f,n=u;break}S=S.sibling}if(!g)throw Error(c(189))}}if(n.alternate!==s)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"),C=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),X=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case q:return"Profiler";case B:return"StrictMode";case H:return"Suspense";case U:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case X:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case E:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:je(e.type)||"Memo";case P:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var me=Array.isArray,O=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},oe=[],xe=-1;function w(e){return{current:e}}function J(e){0>xe||(e.current=oe[xe],oe[xe]=null,xe--)}function ue(e,t){xe++,oe[xe]=e.current,e.current=t}var he=w(null),Ne=w(null),Ae=w(null),qe=w(null);function st(e,t){switch(ue(Ae,t),ue(Ne,e),ue(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gg(t),e=bg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}J(he),ue(he,e)}function Ze(){J(he),J(Ne),J(Ae)}function Ut(e){e.memoizedState!==null&&ue(qe,e);var t=he.current,n=bg(t,e.type);t!==n&&(ue(Ne,e),ue(he,n))}function Le(e){Ne.current===e&&(J(he),J(Ne)),qe.current===e&&(J(qe),Ac._currentValue=Y)}var dt,Ke;function Ie(e){if(dt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dt=t&&t[1]||"",Ke=-1<n.stack.indexOf(`
42
+ */var nb;function $_(){if(nb)return Dc;nb=1;var a=V_(),l=Rh(),i=Q_();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 p(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,s=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){n=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return p(u),e;if(f===s)return p(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==s.return)n=u,s=f;else{for(var g=!1,S=u.child;S;){if(S===n){g=!0,n=u,s=f;break}if(S===s){g=!0,s=u,n=f;break}S=S.sibling}if(!g){for(S=f.child;S;){if(S===n){g=!0,n=f,s=u;break}if(S===s){g=!0,s=f,n=u;break}S=S.sibling}if(!g)throw Error(c(189))}}if(n.alternate!==s)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"),C=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),I=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function je(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case $:return"Profiler";case H:return"StrictMode";case X:return"Suspense";case O:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case I:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case E: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:je(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return je(e(t))}catch{}}return null}var ge=Array.isArray,z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},ae=[],xe=-1;function w(e){return{current:e}}function K(e){0>xe||(e.current=ae[xe],ae[xe]=null,xe--)}function oe(e,t){xe++,ae[xe]=e.current,e.current=t}var he=w(null),Ne=w(null),Ae=w(null),qe=w(null);function st(e,t){switch(oe(Ae,t),oe(Ne,e),oe(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gg(t),e=bg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}K(he),oe(he,e)}function Ze(){K(he),K(Ne),K(Ae)}function Ut(e){e.memoizedState!==null&&oe(qe,e);var t=he.current,n=bg(t,e.type);t!==n&&(oe(Ne,e),oe(he,n))}function Le(e){Ne.current===e&&(K(he),K(Ne)),qe.current===e&&(K(qe),Ac._currentValue=P)}var dt,Ke;function Ie(e){if(dt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dt=t&&t[1]||"",Ke=-1<n.stack.indexOf(`
43
43
  at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+dt+e+Ke}var Fe=!1;function ht(e,t){if(!e||Fe)return"";Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(F){var Z=F}Reflect.construct(e,[],le)}else{try{le.call()}catch(F){Z=F}e.call(le.prototype)}}else{try{throw Error()}catch(F){Z=F}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(F){if(F&&Z&&typeof F.stack=="string")return[F.stack,Z.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),g=f[0],S=f[1];if(g&&S){var A=g.split(`
45
- `),V=S.split(`
46
- `);for(u=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;u<V.length&&!V[u].includes("DetermineComponentFrameRoot");)u++;if(s===A.length||u===V.length)for(s=A.length-1,u=V.length-1;1<=s&&0<=u&&A[s]!==V[u];)u--;for(;1<=s&&0<=u;s--,u--)if(A[s]!==V[u]){if(s!==1||u!==1)do if(s--,u--,0>u||A[s]!==V[u]){var ee=`
44
+ `+dt+e+Ke}var Fe=!1;function ht(e,t){if(!e||Fe)return"";Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(J){var Q=J}Reflect.construct(e,[],se)}else{try{se.call()}catch(J){Q=J}e.call(se.prototype)}}else{try{throw Error()}catch(J){Q=J}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(J){if(J&&Q&&typeof J.stack=="string")return[J.stack,Q.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),g=f[0],S=f[1];if(g&&S){var A=g.split(`
45
+ `),G=S.split(`
46
+ `);for(u=s=0;s<A.length&&!A[s].includes("DetermineComponentFrameRoot");)s++;for(;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;if(s===A.length||u===G.length)for(s=A.length-1,u=G.length-1;1<=s&&0<=u&&A[s]!==G[u];)u--;for(;1<=s&&0<=u;s--,u--)if(A[s]!==G[u]){if(s!==1||u!==1)do if(s--,u--,0>u||A[s]!==G[u]){var ee=`
47
47
  `+A[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=u);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ie(n):""}function It(e,t){switch(e.tag){case 26:case 27:case 5:return Ie(e.type);case 16:return Ie("Lazy");case 13:return e.child!==t&&t!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return ht(e.type,!1);case 11:return ht(e.type.render,!1);case 1:return ht(e.type,!0);case 31:return Ie("Activity");default:return""}}function vt(e){try{var t="",n=null;do t+=It(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
48
48
  Error generating stack: `+s.message+`
49
- `+s.stack}}var Gn=Object.prototype.hasOwnProperty,Jt=a.unstable_scheduleCallback,Ft=a.unstable_cancelCallback,In=a.unstable_shouldYield,Xt=a.unstable_requestPaint,ct=a.unstable_now,Sn=a.unstable_getCurrentPriorityLevel,jn=a.unstable_ImmediatePriority,yn=a.unstable_UserBlockingPriority,Qt=a.unstable_NormalPriority,kn=a.unstable_LowPriority,Nn=a.unstable_IdlePriority,Ht=a.log,Wt=a.unstable_setDisableYieldValue,K=null,ce=null;function we(e){if(typeof Ht=="function"&&Wt(e),ce&&typeof ce.setStrictMode=="function")try{ce.setStrictMode(K,e)}catch{}}var Ce=Math.clz32?Math.clz32:Q,bt=Math.log,T=Math.LN2;function Q(e){return e>>>=0,e===0?32:31-(bt(e)/T|0)|0}var Se=256,Me=262144,He=4194304;function Cn(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 Ul(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~f,s!==0?u=Cn(s):(g&=S,g!==0?u=Cn(g):n||(n=S&~e,n!==0&&(u=Cn(n))))):(S=s&~f,S!==0?u=Cn(S):g!==0?u=Cn(g):n||(n=s&~e,n!==0&&(u=Cn(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 Fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Yn(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 _n(){var e=He;return He<<=1,(He&62914560)===0&&(He=4194304),e}function Tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sa(e,t,n,s,u,f){var g=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,A=e.expirationTimes,V=e.hiddenUpdates;for(n=g&~n;0<n;){var ee=31-Ce(n),le=1<<ee;S[ee]=0,A[ee]=-1;var Z=V[ee];if(Z!==null)for(V[ee]=null,ee=0;ee<Z.length;ee++){var F=Z[ee];F!==null&&(F.lane&=-536870913)}n&=~le}s!==0&&ja(e,s,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(g&~t))}function ja(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ce(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Vs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ce(n),u=1<<s;u&t|e[s]&t&&(e[s]|=t),n&=~u}}function Hl(e,t){var n=t&-t;return n=(n&42)!==0?1:Jl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Jl(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 Rn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ka(){var e=te.p;return e!==0?e:(e=window.event,e===void 0?32:qg(e.type))}function ml(e,t){var n=te.p;try{return te.p=e,t()}finally{te.p=n}}var al=Math.random().toString(36).slice(2),$t="__reactFiber$"+al,Je="__reactProps$"+al,Wn="__reactContainer$"+al,Xs="__reactEvents$"+al,Li="__reactListeners$"+al,Qs="__reactHandles$"+al,Fl="__reactResources$"+al,Wl="__reactMarker$"+al;function Na(e){delete e[$t],delete e[Je],delete e[Xs],delete e[Li],delete e[Qs]}function Pl(e){var t=e[$t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[$t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kg(e);e!==null;){if(n=e[$t])return n;e=kg(e)}return t}e=n,n=e.parentNode}return null}function gl(e){if(e=e[$t]||e[Wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function en(e){var t=e[Fl];return t||(t=e[Fl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[Wl]=!0}var Vn=new Set,wa={};function Xn(e,t){Qn(e,t),Qn(e+"Capture",t)}function Qn(e,t){for(wa[e]=t,e=0;e<t.length;e++)Vn.add(t[e])}var sl=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]*$"),ea={},Pn={};function $s(e){return Gn.call(Pn,e)?!0:Gn.call(ea,e)?!1:sl.test(e)?Pn[e]=!0:(ea[e]=!0,!1)}function wn(e,t,n){if($s(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Mn(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 rn(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ta(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hr(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(g){n=""+g,f.call(this,g)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ta(e){if(!e._valueTracker){var t=Ta(e)?"checked":"value";e._valueTracker=Hr(e,t,""+e[t])}}function na(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Ta(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ea(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 Aa=/[\n"\\]/g;function On(e){return e.replace(Aa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bl(e,t,n,s,u,f,g,S){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?la(e,g,xt(t)):n!=null?la(e,g,xt(n)):s!=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=""+xt(S):e.removeAttribute("name")}function Bl(e,t,n,s,u,f,g,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)){ta(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ta(e)}function la(e,t,n){t==="number"&&Ea(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function il(e,t,n,s){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&&s&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function fe(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function k(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(c(92));if(me(s)){if(1<s.length)throw Error(c(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),ta(e)}function G(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var re=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 ye(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||re.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Re(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in t)s=t[u],t.hasOwnProperty(u)&&n[u]!==s&&ye(e,u,s)}else for(var f in t)t.hasOwnProperty(f)&&ye(e,f,t[f])}function De(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 pt=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"]]),cn=/^[\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 tn(e){return cn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Et(){}var un=null;function Bt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var aa=null,El=null;function sa(e){var t=gl(e);if(t&&(e=t.stateNode)){var n=e[Je]||null;e:switch(e=t.stateNode,t.type){case"input":if(bl(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="'+On(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var u=s[Je]||null;if(!u)throw Error(c(90));bl(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&na(s)}break e;case"textarea":fe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&il(e,!!n.multiple,t,!1)}}}var ts=!1;function Ui(e,t,n){if(ts)return e(t,n);ts=!0;try{var s=e(t);return s}finally{if(ts=!1,(aa!==null||El!==null)&&(Fu(),aa&&(t=aa,e=El,El=aa=null,sa(t),e)))for(t=0;t<e.length;t++)sa(e[t])}}function Zs(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Je]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ks=!1;if(Dn)try{var ns={};Object.defineProperty(ns,"passive",{get:function(){Ks=!0}}),window.addEventListener("test",ns,ns),window.removeEventListener("test",ns,ns)}catch{Ks=!1}var xl=null,Hi=null,Ca=null;function Al(){if(Ca)return Ca;var e,t=Hi,n=t.length,s,u="value"in xl?xl.value:xl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var g=n-e;for(s=1;s<=g&&t[n-s]===u[f-s];s++);return Ca=u.slice(e,1<s?1-s:void 0)}function Ra(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ia(){return!0}function ra(){return!1}function on(e){function t(n,s,u,f,g){this._reactName=n,this._targetInst=u,this.type=s,this.nativeEvent=f,this.target=g,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)?ia:ra,this.isPropagationStopped=ra,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=ia)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ia)},persist:function(){},isPersistent:ia}),t}var mt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ls=on(mt),Js=j({},mt,{view:0,detail:0}),Zo=on(Js),Bi,as,nn,ln=j({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ca,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&e.type==="mousemove"?(Bi=e.screenX-nn.screenX,as=e.screenY-nn.screenY):as=Bi=0,nn=e),Bi)},movementY:function(e){return"movementY"in e?e.movementY:as}}),Br=on(ln),ql=j({},ln,{dataTransfer:0}),Fc=on(ql),qi=j({},Js,{relatedTarget:0}),ss=on(qi),Fs=j({},mt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ma=on(Fs),Wc=j({},mt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ws=on(Wc),Gi=j({},mt,{data:0}),is=on(Gi),Ps={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pc={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"},Ko={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ae(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ko[e])?!!t[e]:!1}function ca(){return ae}var qr=j({},Js,{key:function(e){if(e.key){var t=Ps[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ra(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ca,charCode:function(e){return e.type==="keypress"?Ra(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ra(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jo=on(qr),Fo=j({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eu=on(Fo),_e=j({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ca}),rs=on(_e),Wo=j({},mt,{propertyName:0,elapsedTime:0,pseudoElement:0}),Po=on(Wo),ef=j({},ln,{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}),tf=on(ef),nf=j({},mt,{newState:0,oldState:0}),ei=on(nf),lf=[9,13,27,32],Gr=Dn&&"CompositionEvent"in window,ti=null;Dn&&"documentMode"in document&&(ti=document.documentMode);var tu=Dn&&"TextEvent"in window&&!ti,nu=Dn&&(!Gr||ti&&8<ti&&11>=ti),lu=" ",Ii=!1;function Ir(e,t){switch(e){case"keyup":return lf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function au(e,t){switch(e){case"compositionend":return Yr(t);case"keypress":return t.which!==32?null:(Ii=!0,lu);case"textInput":return e=t.data,e===lu&&Ii?null:e;default:return null}}function Vr(e,t){if(cs)return e==="compositionend"||!Gr&&Ir(e,t)?(e=Al(),Ca=Hi=xl=null,cs=!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 nu&&t.locale!=="ko"?null:t.data;default:return null}}var af={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 su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!af[e.type]:t==="textarea"}function iu(e,t,n,s){aa?El?El.push(s):El=[s]:aa=s,t=ao(t,"onChange"),0<t.length&&(n=new ls("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ni=null,Gl=null;function ru(e){og(e,0)}function Yi(e){var t=Pt(e);if(na(t))return e}function Xr(e,t){if(e==="change")return t}var cu=!1;if(Dn){var Qr;if(Dn){var $r="oninput"in document;if(!$r){var uu=document.createElement("div");uu.setAttribute("oninput","return;"),$r=typeof uu.oninput=="function"}Qr=$r}else Qr=!1;cu=Qr&&(!document.documentMode||9<document.documentMode)}function ou(){ni&&(ni.detachEvent("onpropertychange",fu),Gl=ni=null)}function fu(e){if(e.propertyName==="value"&&Yi(Gl)){var t=[];iu(t,Gl,e,Bt(e)),Ui(ru,t)}}function sf(e,t,n){e==="focusin"?(ou(),ni=t,Gl=n,ni.attachEvent("onpropertychange",fu)):e==="focusout"&&ou()}function rf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yi(Gl)}function cf(e,t){if(e==="click")return Yi(t)}function uf(e,t){if(e==="input"||e==="change")return Yi(t)}function of(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var el=typeof Object.is=="function"?Object.is:of;function us(e,t){if(el(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var u=n[s];if(!Gn.call(t,u)||!el(e[u],t[u]))return!1}return!0}function du(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hu(e,t){var n=du(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=du(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 mu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ea(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=Ea(e.document)}return t}function li(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 Zr=Dn&&"documentMode"in document&&11>=document.documentMode,Il=null,Kr=null,ai=null,Jr=!1;function gu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Il==null||Il!==Ea(s)||(s=Il,"selectionStart"in s&&li(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ai&&us(ai,s)||(ai=s,s=ao(Kr,"onSelect"),0<s.length&&(t=new ls("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Il)))}function Oa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var os={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},Fr={},bu={};Dn&&(bu=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Da(e){if(Fr[e])return Fr[e];if(!os[e])return e;var t=os[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in bu)return Fr[e]=t[n];return e}var xu=Da("animationend"),yu=Da("animationiteration"),_u=Da("animationstart"),ff=Da("transitionrun"),df=Da("transitionstart"),vu=Da("transitioncancel"),Wr=Da("transitionend"),si=new Map,tl="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(" ");tl.push("scrollEnd");function Yt(e,t){si.set(e,t),Xn(t,[e])}var yl=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)},$n=[],za=0,fs=0;function ii(){for(var e=za,t=fs=za=0;t<e;){var n=$n[t];$n[t++]=null;var s=$n[t];$n[t++]=null;var u=$n[t];$n[t++]=null;var f=$n[t];if($n[t++]=null,s!==null&&u!==null){var g=s.pending;g===null?u.next=u:(u.next=g.next,g.next=u),s.pending=u}f!==0&&Su(n,u,f)}}function Vi(e,t,n,s){$n[za++]=e,$n[za++]=t,$n[za++]=n,$n[za++]=s,fs|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function La(e,t,n,s){return Vi(e,t,n,s),ds(e)}function ua(e,t){return Vi(e,null,null,t),ds(e)}function Su(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,s=f.alternate,s!==null&&(s.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-Ce(n),e=f.hiddenUpdates,s=e[u],s===null?e[u]=[t]:s.push(t),t.lane=n|536870912),f):null}function ds(e){if(50<Sc)throw Sc=0,gd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hs={};function ri(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,s){return new ri(e,t,n,s)}function Xi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cl(e,t){var n=e.alternate;return n===null?(n=fn(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 Pr(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 ci(e,t,n,s,u,f){var g=0;if(s=e,typeof e=="function")Xi(e)&&(g=1);else if(typeof e=="string")g=N_(e,n,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ie:return e=fn(31,n,t,u),e.elementType=ie,e.lanes=f,e;case D:return Ua(n.children,u,f,t);case B:g=8,u|=24;break;case q:return e=fn(12,n,t,u|2),e.elementType=q,e.lanes=f,e;case H:return e=fn(13,n,t,u),e.elementType=H,e.lanes=f,e;case U:return e=fn(19,n,t,u),e.elementType=U,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:g=10;break e;case z:g=9;break e;case E:g=11;break e;case M:g=14;break e;case P:g=16,s=null;break e}g=29,n=Error(c(130,e===null?"null":typeof e,"")),s=null}return t=fn(g,n,t,u),t.elementType=e,t.type=s,t.lanes=f,t}function Ua(e,t,n,s){return e=fn(7,e,s,t),e.lanes=n,e}function ec(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Qi(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function $i(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var tc=new WeakMap;function b(e,t){if(typeof e=="object"&&e!==null){var n=tc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:vt(t)},tc.set(e,t),t)}return{value:e,source:t,stack:vt(t)}}var $=[],pe=0,Ye=null,At=0,Ct=[],qt=0,rl=null,Te=1,ze="";function Ge(e,t){$[pe++]=At,$[pe++]=Ye,Ye=e,At=t}function Rt(e,t,n){Ct[qt++]=Te,Ct[qt++]=ze,Ct[qt++]=rl,rl=e;var s=Te;e=ze;var u=32-Ce(s)-1;s&=~(1<<u),n+=1;var f=32-Ce(t)+u;if(30<f){var g=u-u%5;f=(s&(1<<g)-1).toString(32),s>>=g,u-=g,Te=1<<32-Ce(t)+u|n<<u|s,ze=f+e}else Te=1<<f|n<<u|s,ze=e}function dn(e){e.return!==null&&(Ge(e,1),Rt(e,1,0))}function Yl(e){for(;e===Ye;)Ye=$[--pe],$[pe]=null,At=$[--pe],$[pe]=null;for(;e===rl;)rl=Ct[--qt],Ct[qt]=null,ze=Ct[--qt],Ct[qt]=null,Te=Ct[--qt],Ct[qt]=null}function Zi(e,t){Ct[qt++]=Te,Ct[qt++]=ze,Ct[qt++]=rl,Te=t.id,ze=t.overflow,rl=e}var zn=null,Mt=null,nt=!1,ps=null,Rl=!1,hf=Error(c(519));function ms(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nc(b(t,e)),hf}function Fh(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[$t]=e,t[Je]=s,n){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(n=0;n<kc.length;n++)Pe(kc[n],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),Bl(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),k(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||pg(t.textContent,n)?(s.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),s.onScroll!=null&&Pe("scroll",t),s.onScrollEnd!=null&&Pe("scrollend",t),s.onClick!=null&&(t.onclick=Et),t=!0):t=!1,t||ms(e,!0)}function Wh(e){for(zn=e.return;zn;)switch(zn.tag){case 5:case 31:case 13:Rl=!1;return;case 27:case 3:Rl=!0;return;default:zn=zn.return}}function Ki(e){if(e!==zn)return!1;if(!nt)return Wh(e),nt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Rd(e.type,e.memoizedProps)),n=!n),n&&Mt&&ms(e),Wh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Mt=jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Mt=jg(e)}else t===27?(t=Mt,As(e.type)?(e=Ld,Ld=null,Mt=e):Mt=t):Mt=zn?Ol(e.stateNode.nextSibling):null;return!0}function ui(){Mt=zn=null,nt=!1}function pf(){var e=ps;return e!==null&&(fl===null?fl=e:fl.push.apply(fl,e),ps=null),e}function nc(e){ps===null?ps=[e]:ps.push(e)}var mf=w(null),oi=null,Ha=null;function gs(e,t,n){ue(mf,t._currentValue),t._currentValue=n}function Ba(e){e._currentValue=mf.current,J(mf)}function gf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function bf(e,t,n,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var g=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var A=0;A<t.length;A++)if(S.context===t[A]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),gf(f.return,n,e),s||(g=null);break e}f=S.next}}else if(u.tag===18){if(g=u.return,g===null)throw Error(c(341));g.lanes|=n,f=g.alternate,f!==null&&(f.lanes|=n),gf(g,n,e),g=null}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===e){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}}function Ji(e,t,n,s){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 g=u.alternate;if(g===null)throw Error(c(387));if(g=g.memoizedProps,g!==null){var S=u.type;el(u.pendingProps.value,g.value)||(e!==null?e.push(S):e=[S])}}else if(u===qe.current){if(g=u.alternate,g===null)throw Error(c(387));g.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ac):e=[Ac])}u=u.return}e!==null&&bf(t,e,n,s),t.flags|=262144}function ju(e){for(e=e.firstContext;e!==null;){if(!el(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fi(e){oi=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ln(e){return Ph(oi,e)}function ku(e,t){return oi===null&&fi(e),Ph(e,t)}function Ph(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ha===null){if(e===null)throw Error(c(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return n}var vy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Sy=a.unstable_scheduleCallback,jy=a.unstable_NormalPriority,hn={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xf(){return{controller:new vy,data:new Map,refCount:0}}function lc(e){e.refCount--,e.refCount===0&&Sy(jy,function(){e.controller.abort()})}var ac=null,yf=0,Fi=0,Wi=null;function ky(e,t){if(ac===null){var n=ac=[];yf=0,Fi=Sd(),Wi={status:"pending",value:void 0,then:function(s){n.push(s)}}}return yf++,t.then(ep,ep),t}function ep(){if(--yf===0&&ac!==null){Wi!==null&&(Wi.status="fulfilled");var e=ac;ac=null,Fi=0,Wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ny(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(s.status="rejected",s.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),s}var tp=O.S;O.S=function(e,t){Hm=ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ky(e,t),tp!==null&&tp(e,t)};var di=w(null);function _f(){var e=di.current;return e!==null?e:wt.pooledCache}function Nu(e,t){t===null?ue(di,di.current):ue(di,t.pool)}function np(){var e=_f();return e===null?null:{parent:hn._currentValue,pool:e}}var Pi=Error(c(460)),vf=Error(c(474)),wu=Error(c(542)),Tu={then:function(){}};function lp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ap(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Et,Et),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e;default:if(typeof t.status=="string")t.then(Et,Et);else{if(e=wt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=s}},function(s){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e}throw pi=t,Pi}}function hi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(pi=n,Pi):n}}var pi=null;function sp(){if(pi===null)throw Error(c(459));var e=pi;return pi=null,e}function ip(e){if(e===Pi||e===wu)throw Error(c(483))}var er=null,sc=0;function Eu(e){var t=sc;return sc+=1,er===null&&(er=[]),ap(er,e,t)}function ic(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Au(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 rp(e){function t(L,R){if(e){var I=L.deletions;I===null?(L.deletions=[R],L.flags|=16):I.push(R)}}function n(L,R){if(!e)return null;for(;R!==null;)t(L,R),R=R.sibling;return null}function s(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function u(L,R){return L=Cl(L,R),L.index=0,L.sibling=null,L}function f(L,R,I){return L.index=I,e?(I=L.alternate,I!==null?(I=I.index,I<R?(L.flags|=67108866,R):I):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function g(L){return e&&L.alternate===null&&(L.flags|=67108866),L}function S(L,R,I,ne){return R===null||R.tag!==6?(R=ec(I,L.mode,ne),R.return=L,R):(R=u(R,I),R.return=L,R)}function A(L,R,I,ne){var Oe=I.type;return Oe===D?ee(L,R,I.props.children,ne,I.key):R!==null&&(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&hi(Oe)===R.type)?(R=u(R,I.props),ic(R,I),R.return=L,R):(R=ci(I.type,I.key,I.props,null,L.mode,ne),ic(R,I),R.return=L,R)}function V(L,R,I,ne){return R===null||R.tag!==4||R.stateNode.containerInfo!==I.containerInfo||R.stateNode.implementation!==I.implementation?(R=$i(I,L.mode,ne),R.return=L,R):(R=u(R,I.children||[]),R.return=L,R)}function ee(L,R,I,ne,Oe){return R===null||R.tag!==7?(R=Ua(I,L.mode,ne,Oe),R.return=L,R):(R=u(R,I),R.return=L,R)}function le(L,R,I){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=ec(""+R,L.mode,I),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return I=ci(R.type,R.key,R.props,null,L.mode,I),ic(I,R),I.return=L,I;case N:return R=$i(R,L.mode,I),R.return=L,R;case P:return R=hi(R),le(L,R,I)}if(me(R)||se(R))return R=Ua(R,L.mode,I,null),R.return=L,R;if(typeof R.then=="function")return le(L,Eu(R),I);if(R.$$typeof===X)return le(L,ku(L,R),I);Au(L,R)}return null}function Z(L,R,I,ne){var Oe=R!==null?R.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return Oe!==null?null:S(L,R,""+I,ne);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case C:return I.key===Oe?A(L,R,I,ne):null;case N:return I.key===Oe?V(L,R,I,ne):null;case P:return I=hi(I),Z(L,R,I,ne)}if(me(I)||se(I))return Oe!==null?null:ee(L,R,I,ne,null);if(typeof I.then=="function")return Z(L,R,Eu(I),ne);if(I.$$typeof===X)return Z(L,R,ku(L,I),ne);Au(L,I)}return null}function F(L,R,I,ne,Oe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return L=L.get(I)||null,S(R,L,""+ne,Oe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case C:return L=L.get(ne.key===null?I:ne.key)||null,A(R,L,ne,Oe);case N:return L=L.get(ne.key===null?I:ne.key)||null,V(R,L,ne,Oe);case P:return ne=hi(ne),F(L,R,I,ne,Oe)}if(me(ne)||se(ne))return L=L.get(I)||null,ee(R,L,ne,Oe,null);if(typeof ne.then=="function")return F(L,R,I,Eu(ne),Oe);if(ne.$$typeof===X)return F(L,R,I,ku(R,ne),Oe);Au(R,ne)}return null}function ke(L,R,I,ne){for(var Oe=null,it=null,Ee=R,$e=R=0,tt=null;Ee!==null&&$e<I.length;$e++){Ee.index>$e?(tt=Ee,Ee=null):tt=Ee.sibling;var rt=Z(L,Ee,I[$e],ne);if(rt===null){Ee===null&&(Ee=tt);break}e&&Ee&&rt.alternate===null&&t(L,Ee),R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt,Ee=tt}if($e===I.length)return n(L,Ee),nt&&Ge(L,$e),Oe;if(Ee===null){for(;$e<I.length;$e++)Ee=le(L,I[$e],ne),Ee!==null&&(R=f(Ee,R,$e),it===null?Oe=Ee:it.sibling=Ee,it=Ee);return nt&&Ge(L,$e),Oe}for(Ee=s(Ee);$e<I.length;$e++)tt=F(Ee,L,$e,I[$e],ne),tt!==null&&(e&&tt.alternate!==null&&Ee.delete(tt.key===null?$e:tt.key),R=f(tt,R,$e),it===null?Oe=tt:it.sibling=tt,it=tt);return e&&Ee.forEach(function(Ds){return t(L,Ds)}),nt&&Ge(L,$e),Oe}function Ue(L,R,I,ne){if(I==null)throw Error(c(151));for(var Oe=null,it=null,Ee=R,$e=R=0,tt=null,rt=I.next();Ee!==null&&!rt.done;$e++,rt=I.next()){Ee.index>$e?(tt=Ee,Ee=null):tt=Ee.sibling;var Ds=Z(L,Ee,rt.value,ne);if(Ds===null){Ee===null&&(Ee=tt);break}e&&Ee&&Ds.alternate===null&&t(L,Ee),R=f(Ds,R,$e),it===null?Oe=Ds:it.sibling=Ds,it=Ds,Ee=tt}if(rt.done)return n(L,Ee),nt&&Ge(L,$e),Oe;if(Ee===null){for(;!rt.done;$e++,rt=I.next())rt=le(L,rt.value,ne),rt!==null&&(R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt);return nt&&Ge(L,$e),Oe}for(Ee=s(Ee);!rt.done;$e++,rt=I.next())rt=F(Ee,L,$e,rt.value,ne),rt!==null&&(e&&rt.alternate!==null&&Ee.delete(rt.key===null?$e:rt.key),R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt);return e&&Ee.forEach(function(L_){return t(L,L_)}),nt&&Ge(L,$e),Oe}function kt(L,R,I,ne){if(typeof I=="object"&&I!==null&&I.type===D&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case C:e:{for(var Oe=I.key;R!==null;){if(R.key===Oe){if(Oe=I.type,Oe===D){if(R.tag===7){n(L,R.sibling),ne=u(R,I.props.children),ne.return=L,L=ne;break e}}else if(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&hi(Oe)===R.type){n(L,R.sibling),ne=u(R,I.props),ic(ne,I),ne.return=L,L=ne;break e}n(L,R);break}else t(L,R);R=R.sibling}I.type===D?(ne=Ua(I.props.children,L.mode,ne,I.key),ne.return=L,L=ne):(ne=ci(I.type,I.key,I.props,null,L.mode,ne),ic(ne,I),ne.return=L,L=ne)}return g(L);case N:e:{for(Oe=I.key;R!==null;){if(R.key===Oe)if(R.tag===4&&R.stateNode.containerInfo===I.containerInfo&&R.stateNode.implementation===I.implementation){n(L,R.sibling),ne=u(R,I.children||[]),ne.return=L,L=ne;break e}else{n(L,R);break}else t(L,R);R=R.sibling}ne=$i(I,L.mode,ne),ne.return=L,L=ne}return g(L);case P:return I=hi(I),kt(L,R,I,ne)}if(me(I))return ke(L,R,I,ne);if(se(I)){if(Oe=se(I),typeof Oe!="function")throw Error(c(150));return I=Oe.call(I),Ue(L,R,I,ne)}if(typeof I.then=="function")return kt(L,R,Eu(I),ne);if(I.$$typeof===X)return kt(L,R,ku(L,I),ne);Au(L,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,R!==null&&R.tag===6?(n(L,R.sibling),ne=u(R,I),ne.return=L,L=ne):(n(L,R),ne=ec(I,L.mode,ne),ne.return=L,L=ne),g(L)):n(L,R)}return function(L,R,I,ne){try{sc=0;var Oe=kt(L,R,I,ne);return er=null,Oe}catch(Ee){if(Ee===Pi||Ee===wu)throw Ee;var it=fn(29,Ee,null,L.mode);return it.lanes=ne,it.return=L,it}finally{}}}var mi=rp(!0),cp=rp(!1),bs=!1;function Sf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jf(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 xs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ys(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ot&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=ds(e),Su(e,null,n),t}return Vi(e,s,t,n),ds(e)}function rc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Vs(e,n)}}function kf(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var g={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=g:f=f.next=g,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Nf=!1;function cc(){if(Nf){var e=Wi;if(e!==null)throw e}}function uc(e,t,n,s){Nf=!1;var u=e.updateQueue;bs=!1;var f=u.firstBaseUpdate,g=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var A=S,V=A.next;A.next=null,g===null?f=V:g.next=V,g=A;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,S=ee.lastBaseUpdate,S!==g&&(S===null?ee.firstBaseUpdate=V:S.next=V,ee.lastBaseUpdate=A))}if(f!==null){var le=u.baseState;g=0,ee=V=A=null,S=f;do{var Z=S.lane&-536870913,F=Z!==S.lane;if(F?(et&Z)===Z:(s&Z)===Z){Z!==0&&Z===Fi&&(Nf=!0),ee!==null&&(ee=ee.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ke=e,Ue=S;Z=t;var kt=n;switch(Ue.tag){case 1:if(ke=Ue.payload,typeof ke=="function"){le=ke.call(kt,le,Z);break e}le=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ue.payload,Z=typeof ke=="function"?ke.call(kt,le,Z):ke,Z==null)break e;le=j({},le,Z);break e;case 2:bs=!0}}Z=S.callback,Z!==null&&(e.flags|=64,F&&(e.flags|=8192),F=u.callbacks,F===null?u.callbacks=[Z]:F.push(Z))}else F={lane:Z,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ee===null?(V=ee=F,A=le):ee=ee.next=F,g|=Z;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;F=S,S=F.next,F.next=null,u.lastBaseUpdate=F,u.shared.pending=null}}while(!0);ee===null&&(A=le),u.baseState=A,u.firstBaseUpdate=V,u.lastBaseUpdate=ee,f===null&&(u.shared.lanes=0),ks|=g,e.lanes=g,e.memoizedState=le}}function up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function op(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)up(n[e],t)}var tr=w(null),Cu=w(0);function fp(e,t){e=Za,ue(Cu,e),ue(tr,t),Za=e|t.baseLanes}function wf(){ue(Cu,Za),ue(tr,tr.current)}function Tf(){Za=Cu.current,J(tr),J(Cu)}var _l=w(null),Ml=null;function _s(e){var t=e.alternate;ue(an,an.current&1),ue(_l,e),Ml===null&&(t===null||tr.current!==null||t.memoizedState!==null)&&(Ml=e)}function Ef(e){ue(an,an.current),ue(_l,e),Ml===null&&(Ml=e)}function dp(e){e.tag===22?(ue(an,an.current),ue(_l,e),Ml===null&&(Ml=e)):vs()}function vs(){ue(an,an.current),ue(_l,_l.current)}function vl(e){J(_l),Ml===e&&(Ml=null),J(an)}var an=w(0);function Ru(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Dd(n)||zd(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 qa=0,Qe=null,St=null,pn=null,Mu=!1,nr=!1,gi=!1,Ou=0,oc=0,lr=null,wy=0;function Zt(){throw Error(c(321))}function Af(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!el(e[n],t[n]))return!1;return!0}function Cf(e,t,n,s,u,f){return qa=f,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?Kp:Xf,gi=!1,f=n(s,u),gi=!1,nr&&(f=pp(t,n,s,u)),hp(e),f}function hp(e){O.H=hc;var t=St!==null&&St.next!==null;if(qa=0,pn=St=Qe=null,Mu=!1,oc=0,lr=null,t)throw Error(c(300));e===null||mn||(e=e.dependencies,e!==null&&ju(e)&&(mn=!0))}function pp(e,t,n,s){Qe=e;var u=0;do{if(nr&&(lr=null),oc=0,nr=!1,25<=u)throw Error(c(301));if(u+=1,pn=St=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}O.H=Jp,f=t(n,s)}while(nr);return f}function Ty(){var e=O.H,t=e.useState()[0];return t=typeof t.then=="function"?fc(t):t,e=e.useState()[0],(St!==null?St.memoizedState:null)!==e&&(Qe.flags|=1024),t}function Rf(){var e=Ou!==0;return Ou=0,e}function Mf(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Of(e){if(Mu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Mu=!1}qa=0,pn=St=Qe=null,nr=!1,oc=Ou=0,lr=null}function nl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Qe.memoizedState=pn=e:pn=pn.next=e,pn}function sn(){if(St===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=pn===null?Qe.memoizedState:pn.next;if(t!==null)pn=t,St=e;else{if(e===null)throw Qe.alternate===null?Error(c(467)):Error(c(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},pn===null?Qe.memoizedState=pn=e:pn=pn.next=e}return pn}function Du(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fc(e){var t=oc;return oc+=1,lr===null&&(lr=[]),e=ap(lr,e,t),t=Qe,(pn===null?t.memoizedState:pn.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?Kp:Xf),e}function zu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fc(e);if(e.$$typeof===X)return Ln(e)}throw Error(c(438,String(e)))}function Df(e){var t=null,n=Qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Du(),Qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=de;return t.index++,n}function Ga(e,t){return typeof t=="function"?t(e):t}function Lu(e){var t=sn();return zf(t,St,e)}function zf(e,t,n){var s=e.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=n;var u=e.baseQueue,f=s.pending;if(f!==null){if(u!==null){var g=u.next;u.next=f.next,f.next=g}t.baseQueue=u=f,s.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=g=null,A=null,V=t,ee=!1;do{var le=V.lane&-536870913;if(le!==V.lane?(et&le)===le:(qa&le)===le){var Z=V.revertLane;if(Z===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),le===Fi&&(ee=!0);else if((qa&Z)===Z){V=V.next,Z===Fi&&(ee=!0);continue}else le={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},A===null?(S=A=le,g=f):A=A.next=le,Qe.lanes|=Z,ks|=Z;le=V.action,gi&&n(f,le),f=V.hasEagerState?V.eagerState:n(f,le)}else Z={lane:le,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},A===null?(S=A=Z,g=f):A=A.next=Z,Qe.lanes|=le,ks|=le;V=V.next}while(V!==null&&V!==t);if(A===null?g=f:A.next=S,!el(f,e.memoizedState)&&(mn=!0,ee&&(n=Wi,n!==null)))throw n;e.memoizedState=f,e.baseState=g,e.baseQueue=A,s.lastRenderedState=f}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Lf(e){var t=sn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var s=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var g=u=u.next;do f=e(f,g.action),g=g.next;while(g!==u);el(f,t.memoizedState)||(mn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,s]}function mp(e,t,n){var s=Qe,u=sn(),f=nt;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var g=!el((St||u).memoizedState,n);if(g&&(u.memoizedState=n,mn=!0),u=u.queue,Bf(xp.bind(null,s,u,e),[e]),u.getSnapshot!==t||g||pn!==null&&pn.memoizedState.tag&1){if(s.flags|=2048,ar(9,{destroy:void 0},bp.bind(null,s,u,n,t),null),wt===null)throw Error(c(349));f||(qa&127)!==0||gp(s,t,n)}return n}function gp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t=Du(),Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bp(e,t,n,s){t.value=n,t.getSnapshot=s,yp(t)&&_p(e)}function xp(e,t,n){return n(function(){yp(t)&&_p(e)})}function yp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!el(e,n)}catch{return!0}}function _p(e){var t=ua(e,2);t!==null&&dl(t,e,2)}function Uf(e){var t=nl();if(typeof e=="function"){var n=e;if(e=n(),gi){we(!0);try{n()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:e},t}function vp(e,t,n,s){return e.baseState=n,zf(e,St,typeof s=="function"?s:Ga)}function Ey(e,t,n,s,u){if(Bu(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(g){f.listeners.push(g)}};O.T!==null?n(!0):f.isTransition=!1,s(f),n=t.pending,n===null?(f.next=t.pending=f,Sp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Sp(e,t){var n=t.action,s=t.payload,u=e.state;if(t.isTransition){var f=O.T,g={};O.T=g;try{var S=n(u,s),A=O.S;A!==null&&A(g,S),jp(e,t,S)}catch(V){Hf(e,t,V)}finally{f!==null&&g.types!==null&&(f.types=g.types),O.T=f}}else try{f=n(u,s),jp(e,t,f)}catch(V){Hf(e,t,V)}}function jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){kp(e,t,s)},function(s){return Hf(e,t,s)}):kp(e,t,n)}function kp(e,t,n){t.status="fulfilled",t.value=n,Np(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sp(e,n)))}function Hf(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Np(t),t=t.next;while(t!==s)}e.action=null}function Np(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function wp(e,t){return t}function Tp(e,t){if(nt){var n=wt.formState;if(n!==null){e:{var s=Qe;if(nt){if(Mt){t:{for(var u=Mt,f=Rl;u.nodeType!==8;){if(!f){u=null;break t}if(u=Ol(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Mt=Ol(u.nextSibling),s=u.data==="F!";break e}}ms(s)}s=!1}s&&(t=n[0])}}return n=nl(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wp,lastRenderedState:t},n.queue=s,n=Qp.bind(null,Qe,s),s.dispatch=n,s=Uf(!1),f=Vf.bind(null,Qe,!1,s.queue),s=nl(),u={state:t,dispatch:null,action:e,pending:null},s.queue=u,n=Ey.bind(null,Qe,u,f,n),u.dispatch=n,s.memoizedState=e,[t,n,!1]}function Ep(e){var t=sn();return Ap(t,St,e)}function Ap(e,t,n){if(t=zf(e,t,wp)[0],e=Lu(Ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=fc(t)}catch(g){throw g===Pi?wu:g}else s=t;t=sn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Qe.flags|=2048,ar(9,{destroy:void 0},Ay.bind(null,u,n),null)),[s,f,e]}function Ay(e,t){e.action=t}function Cp(e){var t=sn(),n=St;if(n!==null)return Ap(t,n,e);sn(),t=t.memoizedState,n=sn();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function ar(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=Du(),Qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Rp(){return sn().memoizedState}function Uu(e,t,n,s){var u=nl();Qe.flags|=e,u.memoizedState=ar(1|t,{destroy:void 0},n,s===void 0?null:s)}function Hu(e,t,n,s){var u=sn();s=s===void 0?null:s;var f=u.memoizedState.inst;St!==null&&s!==null&&Af(s,St.memoizedState.deps)?u.memoizedState=ar(t,f,n,s):(Qe.flags|=e,u.memoizedState=ar(1|t,f,n,s))}function Mp(e,t){Uu(8390656,8,e,t)}function Bf(e,t){Hu(2048,8,e,t)}function Cy(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=Du(),Qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Op(e){var t=sn().memoizedState;return Cy({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Dp(e,t){return Hu(4,2,e,t)}function zp(e,t){return Hu(4,4,e,t)}function Lp(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 Up(e,t,n){n=n!=null?n.concat([e]):null,Hu(4,4,Lp.bind(null,t,e),n)}function qf(){}function Hp(e,t){var n=sn();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Af(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Bp(e,t){var n=sn();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Af(t,s[1]))return s[0];if(s=e(),gi){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[s,t],s}function Gf(e,t,n){return n===void 0||(qa&1073741824)!==0&&(et&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=qm(),Qe.lanes|=e,ks|=e,n)}function qp(e,t,n,s){return el(n,t)?n:tr.current!==null?(e=Gf(e,n,s),el(e,t)||(mn=!0),e):(qa&42)===0||(qa&1073741824)!==0&&(et&261930)===0?(mn=!0,e.memoizedState=n):(e=qm(),Qe.lanes|=e,ks|=e,t)}function Gp(e,t,n,s,u){var f=te.p;te.p=f!==0&&8>f?f:8;var g=O.T,S={};O.T=S,Vf(e,!1,t,n);try{var A=u(),V=O.S;if(V!==null&&V(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var ee=Ny(A,s);dc(e,t,ee,kl(e))}else dc(e,t,s,kl(e))}catch(le){dc(e,t,{then:function(){},status:"rejected",reason:le},kl())}finally{te.p=f,g!==null&&S.types!==null&&(g.types=S.types),O.T=g}}function Ry(){}function If(e,t,n,s){if(e.tag!==5)throw Error(c(476));var u=Ip(e).queue;Gp(e,u,t,Y,n===null?Ry:function(){return Yp(e),n(s)})}function Ip(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:Y},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Yp(e){var t=Ip(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},kl())}function Yf(){return Ln(Ac)}function Vp(){return sn().memoizedState}function Xp(){return sn().memoizedState}function My(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kl();e=xs(n);var s=ys(t,e,n);s!==null&&(dl(s,t,n),rc(s,t,n)),t={cache:xf()},e.payload=t;return}t=t.return}}function Oy(e,t,n){var s=kl();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bu(e)?$p(t,n):(n=La(e,t,n,s),n!==null&&(dl(n,e,s),Zp(n,t,s)))}function Qp(e,t,n){var s=kl();dc(e,t,n,s)}function dc(e,t,n,s){var u={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bu(e))$p(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,S=f(g,n);if(u.hasEagerState=!0,u.eagerState=S,el(S,g))return Vi(e,t,u,0),wt===null&&ii(),!1}catch{}finally{}if(n=La(e,t,u,s),n!==null)return dl(n,e,s),Zp(n,t,s),!0}return!1}function Vf(e,t,n,s){if(s={lane:2,revertLane:Sd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bu(e)){if(t)throw Error(c(479))}else t=La(e,n,s,2),t!==null&&dl(t,e,2)}function Bu(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function $p(e,t){nr=Mu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zp(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Vs(e,n)}}var hc={readContext:Ln,use:zu,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};hc.useEffectEvent=Zt;var Kp={readContext:Ln,use:zu,useCallback:function(e,t){return nl().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:Mp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Uu(4194308,4,Lp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uu(4194308,4,e,t)},useInsertionEffect:function(e,t){Uu(4,2,e,t)},useMemo:function(e,t){var n=nl();t=t===void 0?null:t;var s=e();if(gi){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=nl();if(n!==void 0){var u=n(t);if(gi){we(!0);try{n(t)}finally{we(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=Oy.bind(null,Qe,e),[s.memoizedState,e]},useRef:function(e){var t=nl();return e={current:e},t.memoizedState=e},useState:function(e){e=Uf(e);var t=e.queue,n=Qp.bind(null,Qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qf,useDeferredValue:function(e,t){var n=nl();return Gf(n,e,t)},useTransition:function(){var e=Uf(!1);return e=Gp.bind(null,Qe,e.queue,!0,!1),nl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Qe,u=nl();if(nt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),wt===null)throw Error(c(349));(et&127)!==0||gp(s,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Mp(xp.bind(null,s,f,e),[e]),s.flags|=2048,ar(9,{destroy:void 0},bp.bind(null,s,f,n,t),null),n},useId:function(){var e=nl(),t=wt.identifierPrefix;if(nt){var n=ze,s=Te;n=(s&~(1<<32-Ce(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ou++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=wy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yf,useFormState:Tp,useActionState:Tp,useOptimistic:function(e){var t=nl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vf.bind(null,Qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Df,useCacheRefresh:function(){return nl().memoizedState=My.bind(null,Qe)},useEffectEvent:function(e){var t=nl(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Xf={readContext:Ln,use:zu,useCallback:Hp,useContext:Ln,useEffect:Bf,useImperativeHandle:Up,useInsertionEffect:Dp,useLayoutEffect:zp,useMemo:Bp,useReducer:Lu,useRef:Rp,useState:function(){return Lu(Ga)},useDebugValue:qf,useDeferredValue:function(e,t){var n=sn();return qp(n,St.memoizedState,e,t)},useTransition:function(){var e=Lu(Ga)[0],t=sn().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:mp,useId:Vp,useHostTransitionStatus:Yf,useFormState:Ep,useActionState:Ep,useOptimistic:function(e,t){var n=sn();return vp(n,St,e,t)},useMemoCache:Df,useCacheRefresh:Xp};Xf.useEffectEvent=Op;var Jp={readContext:Ln,use:zu,useCallback:Hp,useContext:Ln,useEffect:Bf,useImperativeHandle:Up,useInsertionEffect:Dp,useLayoutEffect:zp,useMemo:Bp,useReducer:Lf,useRef:Rp,useState:function(){return Lf(Ga)},useDebugValue:qf,useDeferredValue:function(e,t){var n=sn();return St===null?Gf(n,e,t):qp(n,St.memoizedState,e,t)},useTransition:function(){var e=Lf(Ga)[0],t=sn().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:mp,useId:Vp,useHostTransitionStatus:Yf,useFormState:Cp,useActionState:Cp,useOptimistic:function(e,t){var n=sn();return St!==null?vp(n,St,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Df,useCacheRefresh:Xp};Jp.useEffectEvent=Op;function Qf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $f={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=kl(),u=xs(s);u.payload=t,n!=null&&(u.callback=n),t=ys(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=kl(),u=xs(s);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ys(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kl(),s=xs(n);s.tag=2,t!=null&&(s.callback=t),t=ys(e,s,n),t!==null&&(dl(t,e,n),rc(t,e,n))}};function Fp(e,t,n,s,u,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,g):t.prototype&&t.prototype.isPureReactComponent?!us(n,s)||!us(u,f):!0}function Wp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&$f.enqueueReplaceState(t,t.state,null)}function bi(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}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 Pp(e){yl(e)}function em(e){console.error(e)}function tm(e){yl(e)}function qu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function nm(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Zf(e,t,n){return n=xs(n),n.tag=3,n.payload={element:null},n.callback=function(){qu(e,t)},n}function lm(e){return e=xs(e),e.tag=3,e}function am(e,t,n,s){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;e.payload=function(){return u(f)},e.callback=function(){nm(t,n,s)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){nm(t,n,s),typeof u!="function"&&(Ns===null?Ns=new Set([this]):Ns.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function Dy(e,t,n,s,u){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Ji(t,n,u,!0),n=_l.current,n!==null){switch(n.tag){case 31:case 13:return Ml===null?Wu():n.alternate===null&&Kt===0&&(Kt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,s===Tu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),yd(e,s,u)),!1;case 22:return n.flags|=65536,s===Tu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),yd(e,s,u)),!1}throw Error(c(435,n.tag))}return yd(e,s,u),Wu(),!1}if(nt)return t=_l.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,s!==hf&&(e=Error(c(422),{cause:s}),nc(b(e,n)))):(s!==hf&&(t=Error(c(423),{cause:s}),nc(b(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=b(s,n),u=Zf(e.stateNode,s,u),kf(e,u),Kt!==4&&(Kt=2)),!1;var f=Error(c(520),{cause:s});if(f=b(f,n),vc===null?vc=[f]:vc.push(f),Kt!==4&&(Kt=2),t===null)return!0;s=b(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Zf(n.stateNode,s,e),kf(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"&&(Ns===null||!Ns.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=lm(u),am(u,e,n,s),kf(n,u),!1}n=n.return}while(n!==null);return!1}var Kf=Error(c(461)),mn=!1;function Un(e,t,n,s){t.child=e===null?cp(t,null,n,s):mi(t,e.child,n,s)}function sm(e,t,n,s,u){n=n.render;var f=t.ref;if("ref"in s){var g={};for(var S in s)S!=="ref"&&(g[S]=s[S])}else g=s;return fi(t),s=Cf(e,t,n,g,f,u),S=Rf(),e!==null&&!mn?(Mf(e,t,u),Ia(e,t,u)):(nt&&S&&dn(t),t.flags|=1,Un(e,t,s,u),t.child)}function im(e,t,n,s,u){if(e===null){var f=n.type;return typeof f=="function"&&!Xi(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,rm(e,t,f,s,u)):(e=ci(n.type,null,s,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!ld(e,u)){var g=f.memoizedProps;if(n=n.compare,n=n!==null?n:us,n(g,s)&&e.ref===t.ref)return Ia(e,t,u)}return t.flags|=1,e=Cl(f,s),e.ref=t.ref,e.return=t,t.child=e}function rm(e,t,n,s,u){if(e!==null){var f=e.memoizedProps;if(us(f,s)&&e.ref===t.ref)if(mn=!1,t.pendingProps=s=f,ld(e,u))(e.flags&131072)!==0&&(mn=!0);else return t.lanes=e.lanes,Ia(e,t,u)}return Jf(e,t,n,s,u)}function cm(e,t,n,s){var u=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(s=t.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~f}else s=0,t.child=null;return um(e,t,f,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Nu(t,f!==null?f.cachePool:null),f!==null?fp(t,f):wf(),dp(t);else return s=t.lanes=536870912,um(e,t,f!==null?f.baseLanes|n:n,n,s)}else f!==null?(Nu(t,f.cachePool),fp(t,f),vs(),t.memoizedState=null):(e!==null&&Nu(t,null),wf(),vs());return Un(e,t,u,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function um(e,t,n,s,u){var f=_f();return f=f===null?null:{parent:hn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Nu(t,null),wf(),dp(t),e!==null&&Ji(e,t,s,!0),t.childLanes=u,null}function Gu(e,t){return t=Yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function om(e,t,n){return mi(t,e.child,null,n),e=Gu(t,t.pendingProps),e.flags|=2,vl(t),t.memoizedState=null,e}function zy(e,t,n){var s=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(s.mode==="hidden")return e=Gu(t,s),t.lanes=536870912,pc(null,e);if(Ef(t),(e=Mt)?(e=Sg(e,Rl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:Te,overflow:ze}:null,retryLane:536870912,hydrationErrors:null},n=Qi(e),n.return=t,t.child=n,zn=t,Mt=null)):e=null,e===null)throw ms(t);return t.lanes=536870912,null}return Gu(t,s)}var f=e.memoizedState;if(f!==null){var g=f.dehydrated;if(Ef(t),u)if(t.flags&256)t.flags&=-257,t=om(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(mn||Ji(e,t,n,!1),u=(n&e.childLanes)!==0,mn||u){if(s=wt,s!==null&&(g=Hl(s,n),g!==0&&g!==f.retryLane))throw f.retryLane=g,ua(e,g),dl(s,e,g),Kf;Wu(),t=om(e,t,n)}else e=f.treeContext,Mt=Ol(g.nextSibling),zn=t,nt=!0,ps=null,Rl=!1,e!==null&&Zi(t,e),t=Gu(t,s),t.flags|=4096;return t}return e=Cl(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Iu(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 Jf(e,t,n,s,u){return fi(t),n=Cf(e,t,n,s,void 0,u),s=Rf(),e!==null&&!mn?(Mf(e,t,u),Ia(e,t,u)):(nt&&s&&dn(t),t.flags|=1,Un(e,t,n,u),t.child)}function fm(e,t,n,s,u,f){return fi(t),t.updateQueue=null,n=pp(t,s,n,u),hp(e),s=Rf(),e!==null&&!mn?(Mf(e,t,f),Ia(e,t,f)):(nt&&s&&dn(t),t.flags|=1,Un(e,t,n,f),t.child)}function dm(e,t,n,s,u){if(fi(t),t.stateNode===null){var f=hs,g=n.contextType;typeof g=="object"&&g!==null&&(f=Ln(g)),f=new n(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=$f,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},Sf(t),g=n.contextType,f.context=typeof g=="object"&&g!==null?Ln(g):hs,f.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(Qf(t,n,g,s),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&$f.enqueueReplaceState(f,f.state,null),uc(t,s,f,u),cc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,A=bi(n,S);f.props=A;var V=f.context,ee=n.contextType;g=hs,typeof ee=="object"&&ee!==null&&(g=Ln(ee));var le=n.getDerivedStateFromProps;ee=typeof le=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ee||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||V!==g)&&Wp(t,f,s,g),bs=!1;var Z=t.memoizedState;f.state=Z,uc(t,s,f,u),cc(),V=t.memoizedState,S||Z!==V||bs?(typeof le=="function"&&(Qf(t,n,le,s),V=t.memoizedState),(A=bs||Fp(t,n,A,s,Z,V,g))?(ee||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=s,t.memoizedState=V),f.props=s,f.state=V,f.context=g,s=A):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,jf(e,t),g=t.memoizedProps,ee=bi(n,g),f.props=ee,le=t.pendingProps,Z=f.context,V=n.contextType,A=hs,typeof V=="object"&&V!==null&&(A=Ln(V)),S=n.getDerivedStateFromProps,(V=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==le||Z!==A)&&Wp(t,f,s,A),bs=!1,Z=t.memoizedState,f.state=Z,uc(t,s,f,u),cc();var F=t.memoizedState;g!==le||Z!==F||bs||e!==null&&e.dependencies!==null&&ju(e.dependencies)?(typeof S=="function"&&(Qf(t,n,S,s),F=t.memoizedState),(ee=bs||Fp(t,n,ee,s,Z,F,A)||e!==null&&e.dependencies!==null&&ju(e.dependencies))?(V||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,F,A),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,F,A)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=F),f.props=s,f.state=F,f.context=A,s=ee):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,Iu(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=mi(t,e.child,null,u),t.child=mi(t,null,n,u)):Un(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ia(e,t,u),e}function hm(e,t,n,s){return ui(),t.flags|=256,Un(e,t,n,s),t.child}var Ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wf(e){return{baseLanes:e,cachePool:np()}}function Pf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=jl),e}function pm(e,t,n){var s=t.pendingProps,u=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(an.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(u?_s(t):vs(),(e=Mt)?(e=Sg(e,Rl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:Te,overflow:ze}:null,retryLane:536870912,hydrationErrors:null},n=Qi(e),n.return=t,t.child=n,zn=t,Mt=null)):e=null,e===null)throw ms(t);return zd(e)?t.lanes=32:t.lanes=536870912,null}var S=s.children;return s=s.fallback,u?(vs(),u=t.mode,S=Yu({mode:"hidden",children:S},u),s=Ua(s,u,n,null),S.return=t,s.return=t,S.sibling=s,t.child=S,s=t.child,s.memoizedState=Wf(n),s.childLanes=Pf(e,g,n),t.memoizedState=Ff,pc(null,s)):(_s(t),ed(t,S))}var A=e.memoizedState;if(A!==null&&(S=A.dehydrated,S!==null)){if(f)t.flags&256?(_s(t),t.flags&=-257,t=td(e,t,n)):t.memoizedState!==null?(vs(),t.child=e.child,t.flags|=128,t=null):(vs(),S=s.fallback,u=t.mode,s=Yu({mode:"visible",children:s.children},u),S=Ua(S,u,n,null),S.flags|=2,s.return=t,S.return=t,s.sibling=S,t.child=s,mi(t,e.child,null,n),s=t.child,s.memoizedState=Wf(n),s.childLanes=Pf(e,g,n),t.memoizedState=Ff,t=pc(null,s));else if(_s(t),zd(S)){if(g=S.nextSibling&&S.nextSibling.dataset,g)var V=g.dgst;g=V,s=Error(c(419)),s.stack="",s.digest=g,nc({value:s,source:null,stack:null}),t=td(e,t,n)}else if(mn||Ji(e,t,n,!1),g=(n&e.childLanes)!==0,mn||g){if(g=wt,g!==null&&(s=Hl(g,n),s!==0&&s!==A.retryLane))throw A.retryLane=s,ua(e,s),dl(g,e,s),Kf;Dd(S)||Wu(),t=td(e,t,n)}else Dd(S)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,Mt=Ol(S.nextSibling),zn=t,nt=!0,ps=null,Rl=!1,e!==null&&Zi(t,e),t=ed(t,s.children),t.flags|=4096);return t}return u?(vs(),S=s.fallback,u=t.mode,A=e.child,V=A.sibling,s=Cl(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,V!==null?S=Cl(V,S):(S=Ua(S,u,n,null),S.flags|=2),S.return=t,s.return=t,s.sibling=S,t.child=s,pc(null,s),s=t.child,S=e.child.memoizedState,S===null?S=Wf(n):(u=S.cachePool,u!==null?(A=hn._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=np(),S={baseLanes:S.baseLanes|n,cachePool:u}),s.memoizedState=S,s.childLanes=Pf(e,g,n),t.memoizedState=Ff,pc(e.child,s)):(_s(t),n=e.child,e=n.sibling,n=Cl(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=n,t.memoizedState=null,n)}function ed(e,t){return t=Yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yu(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function td(e,t,n){return mi(t,e.child,null,n),e=ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),gf(e.return,t,n)}function nd(e,t,n,s,u,f){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:u,treeForkCount:f}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=s,g.tail=n,g.tailMode=u,g.treeForkCount=f)}function gm(e,t,n){var s=t.pendingProps,u=s.revealOrder,f=s.tail;s=s.children;var g=an.current,S=(g&2)!==0;if(S?(g=g&1|2,t.flags|=128):g&=1,ue(an,g),Un(e,t,s,n),s=nt?At:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mm(e,n,t);else if(e.tag===19)mm(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&&Ru(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),nd(t,!1,u,n,f,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ru(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}nd(t,!0,n,null,f,s);break;case"together":nd(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ia(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ks|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(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=Cl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ld(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ju(e)))}function Ly(e,t,n){switch(t.tag){case 3:st(t,t.stateNode.containerInfo),gs(t,hn,e.memoizedState.cache),ui();break;case 27:case 5:Ut(t);break;case 4:st(t,t.stateNode.containerInfo);break;case 10:gs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ef(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(_s(t),t.flags|=128,null):(n&t.child.childLanes)!==0?pm(e,t,n):(_s(t),e=Ia(e,t,n),e!==null?e.sibling:null);_s(t);break;case 19:var u=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Ji(e,t,n,!1),s=(n&t.childLanes)!==0),u){if(s)return gm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(an,an.current),s)break;return null;case 22:return t.lanes=0,cm(e,t,n,t.pendingProps);case 24:gs(t,hn,e.memoizedState.cache)}return Ia(e,t,n)}function bm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)mn=!0;else{if(!ld(e,n)&&(t.flags&128)===0)return mn=!1,Ly(e,t,n);mn=(e.flags&131072)!==0}else mn=!1,nt&&(t.flags&1048576)!==0&&Rt(t,At,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=hi(t.elementType),t.type=e,typeof e=="function")Xi(e)?(s=bi(e,s),t.tag=1,t=dm(null,t,e,s,n)):(t.tag=0,t=Jf(null,t,e,s,n));else{if(e!=null){var u=e.$$typeof;if(u===E){t.tag=11,t=sm(null,t,e,s,n);break e}else if(u===M){t.tag=14,t=im(null,t,e,s,n);break e}}throw t=je(e)||e,Error(c(306,t,""))}}return t;case 0:return Jf(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,u=bi(s,t.pendingProps),dm(e,t,s,u,n);case 3:e:{if(st(t,t.stateNode.containerInfo),e===null)throw Error(c(387));s=t.pendingProps;var f=t.memoizedState;u=f.element,jf(e,t),uc(t,s,null,n);var g=t.memoizedState;if(s=g.cache,gs(t,hn,s),s!==f.cache&&bf(t,[hn],n,!0),cc(),s=g.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=hm(e,t,s,n);break e}else if(s!==u){u=b(Error(c(424)),t),nc(u),t=hm(e,t,s,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(Mt=Ol(e.firstChild),zn=t,nt=!0,ps=null,Rl=!0,n=cp(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ui(),s===u){t=Ia(e,t,n);break e}Un(e,t,s,n)}t=t.child}return t;case 26:return Iu(e,t),e===null?(n=Eg(t.type,null,t.pendingProps,null))?t.memoizedState=n:nt||(n=t.type,e=t.pendingProps,s=so(Ae.current).createElement(n),s[$t]=t,s[Je]=e,Hn(s,n,e),ut(s),t.stateNode=s):t.memoizedState=Eg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ut(t),e===null&&nt&&(s=t.stateNode=Ng(t.type,t.pendingProps,Ae.current),zn=t,Rl=!0,u=Mt,As(t.type)?(Ld=u,Mt=Ol(s.firstChild)):Mt=u),Un(e,t,t.pendingProps.children,n),Iu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((u=s=Mt)&&(s=d_(s,t.type,t.pendingProps,Rl),s!==null?(t.stateNode=s,zn=t,Mt=Ol(s.firstChild),Rl=!1,u=!0):u=!1),u||ms(t)),Ut(t),u=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,s=f.children,Rd(u,f)?s=null:g!==null&&Rd(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=Cf(e,t,Ty,null,null,n),Ac._currentValue=u),Iu(e,t),Un(e,t,s,n),t.child;case 6:return e===null&&nt&&((e=n=Mt)&&(n=h_(n,t.pendingProps,Rl),n!==null?(t.stateNode=n,zn=t,Mt=null,e=!0):e=!1),e||ms(t)),null;case 13:return pm(e,t,n);case 4:return st(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=mi(t,null,s,n):Un(e,t,s,n),t.child;case 11:return sm(e,t,t.type,t.pendingProps,n);case 7:return Un(e,t,t.pendingProps,n),t.child;case 8:return Un(e,t,t.pendingProps.children,n),t.child;case 12:return Un(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,gs(t,t.type,s.value),Un(e,t,s.children,n),t.child;case 9:return u=t.type._context,s=t.pendingProps.children,fi(t),u=Ln(u),s=s(u),t.flags|=1,Un(e,t,s,n),t.child;case 14:return im(e,t,t.type,t.pendingProps,n);case 15:return rm(e,t,t.type,t.pendingProps,n);case 19:return gm(e,t,n);case 31:return zy(e,t,n);case 22:return cm(e,t,n,t.pendingProps);case 24:return fi(t),s=Ln(hn),e===null?(u=_f(),u===null&&(u=wt,f=xf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:s,cache:u},Sf(t),gs(t,hn,u)):((e.lanes&n)!==0&&(jf(e,t),uc(t,null,null,n),cc()),u=e.memoizedState,f=t.memoizedState,u.parent!==s?(u={parent:s,cache:s},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),gs(t,hn,s)):(s=f.cache,gs(t,hn,s),s!==u.cache&&bf(t,[hn],n,!0))),Un(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ya(e){e.flags|=4}function ad(e,t,n,s,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(Vm())e.flags|=8192;else throw pi=Tu,vf}else e.flags&=-16777217}function xm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Og(t))if(Vm())e.flags|=8192;else throw pi=Tu,vf}function Vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_n():536870912,e.lanes|=t,cr|=t)}function mc(e,t){if(!nt)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Uy(e,t,n){var s=t.pendingProps;switch(Yl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(t),null;case 1:return Ot(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ba(hn),Ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pf())),Ot(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ya(t),f!==null?(Ot(t),xm(t,f)):(Ot(t),ad(t,u,null,s,n))):f?f!==e.memoizedState?(Ya(t),Ot(t),xm(t,f)):(Ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ya(t),Ot(t),ad(t,u,e,s,n)),null;case 27:if(Le(t),n=Ae.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Ot(t),null}e=he.current,Ki(t)?Fh(t):(e=Ng(u,s,n),t.stateNode=e,Ya(t))}return Ot(t),null;case 5:if(Le(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Ot(t),null}if(f=he.current,Ki(t))Fh(t);else{var g=so(Ae.current);switch(f){case 1:f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=g.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?g.createElement("select",{is:s.is}):g.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?g.createElement(u,{is:s.is}):g.createElement(u)}}f[$t]=t,f[Je]=s;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)f.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=f;e:switch(Hn(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ya(t)}}return Ot(t),ad(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ae.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,u=zn,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[$t]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||pg(e.nodeValue,n)),e||ms(t,!0)}else e=so(e).createTextNode(s),e[$t]=t,t.stateNode=e}return Ot(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ki(t),n!==null){if(e===null){if(!s)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[$t]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ot(t),e=!1}else n=pf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(vl(t),t):(vl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ot(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ki(t),s!==null&&s.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[$t]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ot(t),u=!1}else u=pf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(vl(t),t):(vl(t),null)}return vl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vu(t,t.updateQueue),Ot(t),null);case 4:return Ze(),e===null&&wd(t.stateNode.containerInfo),Ot(t),null;case 10:return Ba(t.type),Ot(t),null;case 19:if(J(an),s=t.memoizedState,s===null)return Ot(t),null;if(u=(t.flags&128)!==0,f=s.rendering,f===null)if(u)mc(s,!1);else{if(Kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ru(e),f!==null){for(t.flags|=128,mc(s,!1),e=f.updateQueue,t.updateQueue=e,Vu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pr(n,e),n=n.sibling;return ue(an,an.current&1|2),nt&&Ge(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ct()>Ku&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304)}else{if(!u)if(e=Ru(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Vu(t,e),mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!nt)return Ot(t),null}else 2*ct()-s.renderingStartTime>Ku&&n!==536870912&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ct(),e.sibling=null,n=an.current,ue(an,u?n&1|2:n&1),nt&&Ge(t,s.treeForkCount),e):(Ot(t),null);case 22:case 23:return vl(t),Tf(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(Ot(t),t.subtreeFlags&6&&(t.flags|=8192)):Ot(t),n=t.updateQueue,n!==null&&Vu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&J(di),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ba(hn),Ot(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Hy(e,t){switch(Yl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ba(hn),Ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(vl(t),t.alternate===null)throw Error(c(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return J(an),null;case 4:return Ze(),null;case 10:return Ba(t.type),null;case 22:case 23:return vl(t),Tf(),e!==null&&J(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ba(hn),null;case 25:return null;default:return null}}function ym(e,t){switch(Yl(t),t.tag){case 3:Ba(hn),Ze();break;case 26:case 27:case 5:Le(t);break;case 4:Ze();break;case 31:t.memoizedState!==null&&vl(t);break;case 13:vl(t);break;case 19:J(an);break;case 10:Ba(t.type);break;case 22:case 23:vl(t),Tf(),e!==null&&J(di);break;case 24:Ba(hn)}}function gc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var u=s.next;n=u;do{if((n.tag&e)===e){s=void 0;var f=n.create,g=n.inst;s=f(),g.destroy=s}n=n.next}while(n!==u)}}catch(S){_t(t,t.return,S)}}function Ss(e,t,n){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){var g=s.inst,S=g.destroy;if(S!==void 0){g.destroy=void 0,u=t;var A=n,V=S;try{V()}catch(ee){_t(u,A,ee)}}}s=s.next}while(s!==f)}}catch(ee){_t(t,t.return,ee)}}function _m(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{op(t,n)}catch(s){_t(e,e.return,s)}}}function vm(e,t,n){n.props=bi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){_t(e,t,s)}}function bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(u){_t(e,t,u)}}function oa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(u){_t(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){_t(e,t,u)}else n.current=null}function Sm(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(u){_t(e,e.return,u)}}function sd(e,t,n){try{var s=e.stateNode;i_(s,e.type,n,t),s[Je]=t}catch(u){_t(e,e.return,u)}}function jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&As(e.type)||e.tag===4}function id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jm(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&&As(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 rd(e,t,n){var s=e.tag;if(s===5||s===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=Et));else if(s!==4&&(s===27&&As(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rd(e,t,n),e=e.sibling;e!==null;)rd(e,t,n),e=e.sibling}function Xu(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&As(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xu(e,t,n),e=e.sibling;e!==null;)Xu(e,t,n),e=e.sibling}function km(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Hn(t,s,n),t[$t]=e,t[Je]=n}catch(f){_t(e,e.return,f)}}var Va=!1,gn=!1,cd=!1,Nm=typeof WeakSet=="function"?WeakSet:Set,Tn=null;function By(e,t){if(e=e.containerInfo,Ad=ho,e=mu(e),li(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var g=0,S=-1,A=-1,V=0,ee=0,le=e,Z=null;t:for(;;){for(var F;le!==n||u!==0&&le.nodeType!==3||(S=g+u),le!==f||s!==0&&le.nodeType!==3||(A=g+s),le.nodeType===3&&(g+=le.nodeValue.length),(F=le.firstChild)!==null;)Z=le,le=F;for(;;){if(le===e)break t;if(Z===n&&++V===u&&(S=g),Z===f&&++ee===s&&(A=g),(F=le.nextSibling)!==null)break;le=Z,Z=le.parentNode}le=F}n=S===-1||A===-1?null:{start:S,end:A}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cd={focusedElem:e,selectionRange:n},ho=!1,Tn=t;Tn!==null;)if(t=Tn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Tn=e;else for(;Tn!==null;){switch(t=Tn,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,s=n.stateNode;try{var ke=bi(n.type,u);e=s.getSnapshotBeforeUpdate(ke,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ue){_t(n,n.return,Ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Od(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(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,Tn=e;break}Tn=t.return}}function wm(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Qa(e,n),s&4&&gc(5,n);break;case 1:if(Qa(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){_t(n,n.return,g)}else{var u=bi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){_t(n,n.return,g)}}s&64&&_m(n),s&512&&bc(n,n.return);break;case 3:if(Qa(e,n),s&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{op(e,t)}catch(g){_t(n,n.return,g)}}break;case 27:t===null&&s&4&&km(n);case 26:case 5:Qa(e,n),t===null&&s&4&&Sm(n),s&512&&bc(n,n.return);break;case 12:Qa(e,n);break;case 31:Qa(e,n),s&4&&Am(e,n);break;case 13:Qa(e,n),s&4&&Cm(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Zy.bind(null,n),p_(e,n))));break;case 22:if(s=n.memoizedState!==null||Va,!s){t=t!==null&&t.memoizedState!==null||gn,u=Va;var f=gn;Va=s,(gn=t)&&!f?$a(e,n,(n.subtreeFlags&8772)!==0):Qa(e,n),Va=u,gn=f}break;case 30:break;default:Qa(e,n)}}function Tm(e){var t=e.alternate;t!==null&&(e.alternate=null,Tm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Na(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 Gt=null,cl=!1;function Xa(e,t,n){for(n=n.child;n!==null;)Em(e,t,n),n=n.sibling}function Em(e,t,n){if(ce&&typeof ce.onCommitFiberUnmount=="function")try{ce.onCommitFiberUnmount(K,n)}catch{}switch(n.tag){case 26:gn||oa(n,t),Xa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:gn||oa(n,t);var s=Gt,u=cl;As(n.type)&&(Gt=n.stateNode,cl=!1),Xa(e,t,n),wc(n.stateNode),Gt=s,cl=u;break;case 5:gn||oa(n,t);case 6:if(s=Gt,u=cl,Gt=null,Xa(e,t,n),Gt=s,cl=u,Gt!==null)if(cl)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(n.stateNode)}catch(f){_t(n,t,f)}else try{Gt.removeChild(n.stateNode)}catch(f){_t(n,t,f)}break;case 18:Gt!==null&&(cl?(e=Gt,_g(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),gr(e)):_g(Gt,n.stateNode));break;case 4:s=Gt,u=cl,Gt=n.stateNode.containerInfo,cl=!0,Xa(e,t,n),Gt=s,cl=u;break;case 0:case 11:case 14:case 15:Ss(2,n,t),gn||Ss(4,n,t),Xa(e,t,n);break;case 1:gn||(oa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&vm(n,t,s)),Xa(e,t,n);break;case 21:Xa(e,t,n);break;case 22:gn=(s=gn)||n.memoizedState!==null,Xa(e,t,n),gn=s;break;default:Xa(e,t,n)}}function Am(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gr(e)}catch(n){_t(t,t.return,n)}}}function Cm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gr(e)}catch(n){_t(t,t.return,n)}}function qy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Nm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Nm),t;default:throw Error(c(435,e.tag))}}function Qu(e,t){var n=qy(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var u=Ky.bind(null,e,s);s.then(u,u)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var u=n[s],f=e,g=t,S=g;e:for(;S!==null;){switch(S.tag){case 27:if(As(S.type)){Gt=S.stateNode,cl=!1;break e}break;case 5:Gt=S.stateNode,cl=!1;break e;case 3:case 4:Gt=S.stateNode.containerInfo,cl=!0;break e}S=S.return}if(Gt===null)throw Error(c(160));Em(f,g,u),Gt=null,cl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rm(t,e),t=t.sibling}var Vl=null;function Rm(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),ol(e),s&4&&(Ss(3,e,e.return),gc(3,e),Ss(5,e,e.return));break;case 1:ul(t,e),ol(e),s&512&&(gn||n===null||oa(n,n.return)),s&64&&Va&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var u=Vl;if(ul(t,e),ol(e),s&512&&(gn||n===null||oa(n,n.return)),s&4){var f=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Wl]||f[$t]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(s),u.head.insertBefore(f,u.querySelector("head > title"))),Hn(f,s,n),f[$t]=e,ut(f),s=f;break e;case"link":var g=Rg("link","href",u).get(s+(n.href||""));if(g){for(var S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;case"meta":if(g=Rg("meta","content",u).get(s+(n.content||""))){for(S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;default:throw Error(c(468,s))}f[$t]=e,ut(f),s=f}e.stateNode=s}else Mg(u,e.type,e.stateNode);else e.stateNode=Cg(u,s,e.memoizedProps);else f!==s?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,s===null?Mg(u,e.type,e.stateNode):Cg(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&sd(e,e.memoizedProps,n.memoizedProps)}break;case 27:ul(t,e),ol(e),s&512&&(gn||n===null||oa(n,n.return)),n!==null&&s&4&&sd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),ol(e),s&512&&(gn||n===null||oa(n,n.return)),e.flags&32){u=e.stateNode;try{G(u,"")}catch(ke){_t(e,e.return,ke)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,sd(e,u,n!==null?n.memoizedProps:u)),s&1024&&(cd=!0);break;case 6:if(ul(t,e),ol(e),s&4){if(e.stateNode===null)throw Error(c(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ke){_t(e,e.return,ke)}}break;case 3:if(co=null,u=Vl,Vl=io(t.containerInfo),ul(t,e),Vl=u,ol(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{gr(t.containerInfo)}catch(ke){_t(e,e.return,ke)}cd&&(cd=!1,Mm(e));break;case 4:s=Vl,Vl=io(e.stateNode.containerInfo),ul(t,e),ol(e),Vl=s;break;case 12:ul(t,e),ol(e);break;case 31:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 13:ul(t,e),ol(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zu=ct()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 22:u=e.memoizedState!==null;var A=n!==null&&n.memoizedState!==null,V=Va,ee=gn;if(Va=V||u,gn=ee||A,ul(t,e),gn=ee,Va=V,ol(e),s&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||A||Va||gn||xi(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){A=n=t;try{if(f=A.stateNode,u)g=f.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{S=A.stateNode;var le=A.memoizedProps.style,Z=le!=null&&le.hasOwnProperty("display")?le.display:null;S.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ke){_t(A,A.return,ke)}}}else if(t.tag===6){if(n===null){A=t;try{A.stateNode.nodeValue=u?"":A.memoizedProps}catch(ke){_t(A,A.return,ke)}}}else if(t.tag===18){if(n===null){A=t;try{var F=A.stateNode;u?vg(F,!0):vg(A.stateNode,!1)}catch(ke){_t(A,A.return,ke)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Qu(e,n))));break;case 19:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 30:break;case 21:break;default:ul(t,e),ol(e)}}function ol(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(jm(s)){n=s;break}s=s.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=id(e);Xu(e,f,u);break;case 5:var g=n.stateNode;n.flags&32&&(G(g,""),n.flags&=-33);var S=id(e);Xu(e,S,g);break;case 3:case 4:var A=n.stateNode.containerInfo,V=id(e);rd(e,V,A);break;default:throw Error(c(161))}}catch(ee){_t(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Qa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wm(e,t.alternate,t),t=t.sibling}function xi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ss(4,t,t.return),xi(t);break;case 1:oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vm(t,t.return,n),xi(t);break;case 27:wc(t.stateNode);case 26:case 5:oa(t,t.return),xi(t);break;case 22:t.memoizedState===null&&xi(t);break;case 30:xi(t);break;default:xi(t)}e=e.sibling}}function $a(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,u=e,f=t,g=f.flags;switch(f.tag){case 0:case 11:case 15:$a(u,f,n),gc(4,f);break;case 1:if($a(u,f,n),s=f,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(V){_t(s,s.return,V)}if(s=f,u=s.updateQueue,u!==null){var S=s.stateNode;try{var A=u.shared.hiddenCallbacks;if(A!==null)for(u.shared.hiddenCallbacks=null,u=0;u<A.length;u++)up(A[u],S)}catch(V){_t(s,s.return,V)}}n&&g&64&&_m(f),bc(f,f.return);break;case 27:km(f);case 26:case 5:$a(u,f,n),n&&s===null&&g&4&&Sm(f),bc(f,f.return);break;case 12:$a(u,f,n);break;case 31:$a(u,f,n),n&&g&4&&Am(u,f);break;case 13:$a(u,f,n),n&&g&4&&Cm(u,f);break;case 22:f.memoizedState===null&&$a(u,f,n),bc(f,f.return);break;case 30:break;default:$a(u,f,n)}t=t.sibling}}function ud(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&&lc(n))}function od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e))}function Xl(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Om(e,t,n,s),t=t.sibling}function Om(e,t,n,s){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,n,s),u&2048&&gc(9,t);break;case 1:Xl(e,t,n,s);break;case 3:Xl(e,t,n,s),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e)));break;case 12:if(u&2048){Xl(e,t,n,s),e=t.stateNode;try{var f=t.memoizedProps,g=f.id,S=f.onPostCommit;typeof S=="function"&&S(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){_t(t,t.return,A)}}else Xl(e,t,n,s);break;case 31:Xl(e,t,n,s);break;case 13:Xl(e,t,n,s);break;case 23:break;case 22:f=t.stateNode,g=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,n,s):xc(e,t):f._visibility&2?Xl(e,t,n,s):(f._visibility|=2,sr(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),u&2048&&ud(g,t);break;case 24:Xl(e,t,n,s),u&2048&&od(t.alternate,t);break;default:Xl(e,t,n,s)}}function sr(e,t,n,s,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,g=t,S=n,A=s,V=g.flags;switch(g.tag){case 0:case 11:case 15:sr(f,g,S,A,u),gc(8,g);break;case 23:break;case 22:var ee=g.stateNode;g.memoizedState!==null?ee._visibility&2?sr(f,g,S,A,u):xc(f,g):(ee._visibility|=2,sr(f,g,S,A,u)),u&&V&2048&&ud(g.alternate,g);break;case 24:sr(f,g,S,A,u),u&&V&2048&&od(g.alternate,g);break;default:sr(f,g,S,A,u)}t=t.sibling}}function xc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,u=s.flags;switch(s.tag){case 22:xc(n,s),u&2048&&ud(s.alternate,s);break;case 24:xc(n,s),u&2048&&od(s.alternate,s);break;default:xc(n,s)}t=t.sibling}}var yc=8192;function ir(e,t,n){if(e.subtreeFlags&yc)for(e=e.child;e!==null;)Dm(e,t,n),e=e.sibling}function Dm(e,t,n){switch(e.tag){case 26:ir(e,t,n),e.flags&yc&&e.memoizedState!==null&&w_(n,Vl,e.memoizedState,e.memoizedProps);break;case 5:ir(e,t,n);break;case 3:case 4:var s=Vl;Vl=io(e.stateNode.containerInfo),ir(e,t,n),Vl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=yc,yc=16777216,ir(e,t,n),yc=s):ir(e,t,n));break;default:ir(e,t,n)}}function zm(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 _c(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Tn=s,Um(s,e)}zm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lm(e),e=e.sibling}function Lm(e){switch(e.tag){case 0:case 11:case 15:_c(e),e.flags&2048&&Ss(9,e,e.return);break;case 3:_c(e);break;case 12:_c(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):_c(e);break;default:_c(e)}}function $u(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Tn=s,Um(s,e)}zm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ss(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function Um(e,t){for(;Tn!==null;){var n=Tn;switch(n.tag){case 0:case 11:case 15:Ss(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:lc(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Tn=s;else e:for(n=e;Tn!==null;){s=Tn;var u=s.sibling,f=s.return;if(Tm(s),s===n){Tn=null;break e}if(u!==null){u.return=f,Tn=u;break e}Tn=f}}}var Gy={getCacheForType:function(e){var t=Ln(hn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ln(hn).controller.signal}},Iy=typeof WeakMap=="function"?WeakMap:Map,ot=0,wt=null,We=null,et=0,yt=0,Sl=null,js=!1,rr=!1,fd=!1,Za=0,Kt=0,ks=0,yi=0,dd=0,jl=0,cr=0,vc=null,fl=null,hd=!1,Zu=0,Hm=0,Ku=1/0,Ju=null,Ns=null,vn=0,ws=null,ur=null,Ka=0,pd=0,md=null,Bm=null,Sc=0,gd=null;function kl(){return(ot&2)!==0&&et!==0?et&-et:O.T!==null?Sd():ka()}function qm(){if(jl===0)if((et&536870912)===0||nt){var e=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),jl=e}else jl=536870912;return e=_l.current,e!==null&&(e.flags|=32),jl}function dl(e,t,n){(e===wt&&(yt===2||yt===9)||e.cancelPendingCommit!==null)&&(or(e,0),Ts(e,et,jl,!1)),Tl(e,n),((ot&2)===0||e!==wt)&&(e===wt&&((ot&2)===0&&(yi|=n),Kt===4&&Ts(e,et,jl,!1)),fa(e))}function Gm(e,t,n){if((ot&6)!==0)throw Error(c(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Fn(e,t),u=s?Xy(e,t):xd(e,t,!0),f=s;do{if(u===0){rr&&!s&&Ts(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Yy(n)){u=xd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var S=e;u=vc;var A=S.current.memoizedState.isDehydrated;if(A&&(or(S,g).flags|=256),g=xd(S,g,!1),g!==2){if(fd&&!A){S.errorRecoveryDisabledLanes|=f,yi|=f,u=4;break e}f=fl,fl=u,f!==null&&(fl===null?fl=f:fl.push.apply(fl,f))}u=g}if(f=!1,u!==2)continue}}if(u===1){or(e,0),Ts(e,t,0,!0);break}e:{switch(s=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ts(s,t,jl,!js);break e;case 2:fl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Zu+300-ct(),10<u)){if(Ts(s,t,jl,!js),Ul(s,0,!0)!==0)break e;Ka=t,s.timeoutHandle=xg(Im.bind(null,s,n,fl,Ju,hd,t,jl,yi,cr,js,f,"Throttled",-0,0),u);break e}Im(s,n,fl,Ju,hd,t,jl,yi,cr,js,f,null,-0,0)}}break}while(!0);fa(e)}function Im(e,t,n,s,u,f,g,S,A,V,ee,le,Z,F){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Et},Dm(t,f,le);var ke=(f&62914560)===f?Zu-ct():(f&4194048)===f?Hm-ct():0;if(ke=T_(le,ke),ke!==null){Ka=f,e.cancelPendingCommit=ke(Jm.bind(null,e,t,f,n,s,u,g,S,A,ee,le,null,Z,F)),Ts(e,f,g,!V);return}}Jm(e,t,f,n,s,u,g,S,A)}function Yy(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 s=0;s<n.length;s++){var u=n[s],f=u.getSnapshot;u=u.value;try{if(!el(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 Ts(e,t,n,s){t&=~dd,t&=~yi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var u=t;0<u;){var f=31-Ce(u),g=1<<f;s[f]=-1,u&=~g}n!==0&&ja(e,n,t)}function Fu(){return(ot&6)===0?(jc(0),!1):!0}function bd(){if(We!==null){if(yt===0)var e=We.return;else e=We,Ha=oi=null,Of(e),er=null,sc=0,e=We;for(;e!==null;)ym(e.alternate,e),e=e.return;We=null}}function or(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,u_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ka=0,bd(),wt=e,We=n=Cl(e.current,null),et=t,yt=0,Sl=null,js=!1,rr=Fn(e,t),fd=!1,cr=jl=dd=yi=ks=Kt=0,fl=vc=null,hd=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var u=31-Ce(s),f=1<<u;t|=e[u],s&=~f}return Za=t,ii(),n}function Ym(e,t){Qe=null,O.H=hc,t===Pi||t===wu?(t=sp(),yt=3):t===vf?(t=sp(),yt=4):yt=t===Kf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sl=t,We===null&&(Kt=1,qu(e,b(t,e.current)))}function Vm(){var e=_l.current;return e===null?!0:(et&4194048)===et?Ml===null:(et&62914560)===et||(et&536870912)!==0?e===Ml:!1}function Xm(){var e=O.H;return O.H=hc,e===null?hc:e}function Qm(){var e=O.A;return O.A=Gy,e}function Wu(){Kt=4,js||(et&4194048)!==et&&_l.current!==null||(rr=!0),(ks&134217727)===0&&(yi&134217727)===0||wt===null||Ts(wt,et,jl,!1)}function xd(e,t,n){var s=ot;ot|=2;var u=Xm(),f=Qm();(wt!==e||et!==t)&&(Ju=null,or(e,t)),t=!1;var g=Kt;e:do try{if(yt!==0&&We!==null){var S=We,A=Sl;switch(yt){case 8:bd(),g=6;break e;case 3:case 2:case 9:case 6:_l.current===null&&(t=!0);var V=yt;if(yt=0,Sl=null,fr(e,S,A,V),n&&rr){g=0;break e}break;default:V=yt,yt=0,Sl=null,fr(e,S,A,V)}}Vy(),g=Kt;break}catch(ee){Ym(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Ha=oi=null,ot=s,O.H=u,O.A=f,We===null&&(wt=null,et=0,ii()),g}function Vy(){for(;We!==null;)$m(We)}function Xy(e,t){var n=ot;ot|=2;var s=Xm(),u=Qm();wt!==e||et!==t?(Ju=null,Ku=ct()+500,or(e,t)):rr=Fn(e,t);e:do try{if(yt!==0&&We!==null){t=We;var f=Sl;t:switch(yt){case 1:yt=0,Sl=null,fr(e,t,f,1);break;case 2:case 9:if(lp(f)){yt=0,Sl=null,Zm(t);break}t=function(){yt!==2&&yt!==9||wt!==e||(yt=7),fa(e)},f.then(t,t);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:lp(f)?(yt=0,Sl=null,Zm(t)):(yt=0,Sl=null,fr(e,t,f,7));break;case 5:var g=null;switch(We.tag){case 26:g=We.memoizedState;case 5:case 27:var S=We;if(g?Og(g):S.stateNode.complete){yt=0,Sl=null;var A=S.sibling;if(A!==null)We=A;else{var V=S.return;V!==null?(We=V,Pu(V)):We=null}break t}}yt=0,Sl=null,fr(e,t,f,5);break;case 6:yt=0,Sl=null,fr(e,t,f,6);break;case 8:bd(),Kt=6;break e;default:throw Error(c(462))}}Qy();break}catch(ee){Ym(e,ee)}while(!0);return Ha=oi=null,O.H=s,O.A=u,ot=n,We!==null?0:(wt=null,et=0,ii(),Kt)}function Qy(){for(;We!==null&&!In();)$m(We)}function $m(e){var t=bm(e.alternate,e,Za);e.memoizedProps=e.pendingProps,t===null?Pu(e):We=t}function Zm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fm(n,t,t.pendingProps,t.type,void 0,et);break;case 11:t=fm(n,t,t.pendingProps,t.type.render,t.ref,et);break;case 5:Of(t);default:ym(n,t),t=We=Pr(t,Za),t=bm(n,t,Za)}e.memoizedProps=e.pendingProps,t===null?Pu(e):We=t}function fr(e,t,n,s){Ha=oi=null,Of(t),er=null,sc=0;var u=t.return;try{if(Dy(e,u,t,n,et)){Kt=1,qu(e,b(n,e.current)),We=null;return}}catch(f){if(u!==null)throw We=u,f;Kt=1,qu(e,b(n,e.current)),We=null;return}t.flags&32768?(nt||s===1?e=!0:rr||(et&536870912)!==0?e=!1:(js=e=!0,(s===2||s===9||s===3||s===6)&&(s=_l.current,s!==null&&s.tag===13&&(s.flags|=16384))),Km(t,e)):Pu(t)}function Pu(e){var t=e;do{if((t.flags&32768)!==0){Km(t,js);return}e=t.return;var n=Uy(t.alternate,t,Za);if(n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Kt===0&&(Kt=5)}function Km(e,t){do{var n=Hy(e.alternate,e);if(n!==null){n.flags&=32767,We=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){We=e;return}We=e=n}while(e!==null);Kt=6,We=null}function Jm(e,t,n,s,u,f,g,S,A){e.cancelPendingCommit=null;do eo();while(vn!==0);if((ot&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=fs,Sa(e,n,f,g,S,A),e===wt&&(We=wt=null,et=0),ur=t,ws=e,Ka=n,pd=f,md=u,Bm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Jy(Qt,function(){return tg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=O.T,O.T=null,u=te.p,te.p=2,g=ot,ot|=4;try{By(e,t,n)}finally{ot=g,te.p=u,O.T=s}}vn=1,Fm(),Wm(),Pm()}}function Fm(){if(vn===1){vn=0;var e=ws,t=ur,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=O.T,O.T=null;var s=te.p;te.p=2;var u=ot;ot|=4;try{Rm(t,e);var f=Cd,g=mu(e.containerInfo),S=f.focusedElem,A=f.selectionRange;if(g!==S&&S&&S.ownerDocument&&pu(S.ownerDocument.documentElement,S)){if(A!==null&&li(S)){var V=A.start,ee=A.end;if(ee===void 0&&(ee=V),"selectionStart"in S)S.selectionStart=V,S.selectionEnd=Math.min(ee,S.value.length);else{var le=S.ownerDocument||document,Z=le&&le.defaultView||window;if(Z.getSelection){var F=Z.getSelection(),ke=S.textContent.length,Ue=Math.min(A.start,ke),kt=A.end===void 0?Ue:Math.min(A.end,ke);!F.extend&&Ue>kt&&(g=kt,kt=Ue,Ue=g);var L=hu(S,Ue),R=hu(S,kt);if(L&&R&&(F.rangeCount!==1||F.anchorNode!==L.node||F.anchorOffset!==L.offset||F.focusNode!==R.node||F.focusOffset!==R.offset)){var I=le.createRange();I.setStart(L.node,L.offset),F.removeAllRanges(),Ue>kt?(F.addRange(I),F.extend(R.node,R.offset)):(I.setEnd(R.node,R.offset),F.addRange(I))}}}}for(le=[],F=S;F=F.parentNode;)F.nodeType===1&&le.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<le.length;S++){var ne=le[S];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}ho=!!Ad,Cd=Ad=null}finally{ot=u,te.p=s,O.T=n}}e.current=t,vn=2}}function Wm(){if(vn===2){vn=0;var e=ws,t=ur,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=O.T,O.T=null;var s=te.p;te.p=2;var u=ot;ot|=4;try{wm(e,t.alternate,t)}finally{ot=u,te.p=s,O.T=n}}vn=3}}function Pm(){if(vn===4||vn===3){vn=0,Xt();var e=ws,t=ur,n=Ka,s=Bm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?vn=5:(vn=0,ur=ws=null,eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ns=null),Rn(n),t=t.stateNode,ce&&typeof ce.onCommitFiberRoot=="function")try{ce.onCommitFiberRoot(K,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=O.T,u=te.p,te.p=2,O.T=null;try{for(var f=e.onRecoverableError,g=0;g<s.length;g++){var S=s[g];f(S.value,{componentStack:S.stack})}}finally{O.T=t,te.p=u}}(Ka&3)!==0&&eo(),fa(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===gd?Sc++:(Sc=0,gd=e):Sc=0,jc(0)}}function eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,lc(t)))}function eo(){return Fm(),Wm(),Pm(),tg()}function tg(){if(vn!==5)return!1;var e=ws,t=pd;pd=0;var n=Rn(Ka),s=O.T,u=te.p;try{te.p=32>n?32:n,O.T=null,n=md,md=null;var f=ws,g=Ka;if(vn=0,ur=ws=null,Ka=0,(ot&6)!==0)throw Error(c(331));var S=ot;if(ot|=4,Lm(f.current),Om(f,f.current,g,n),ot=S,jc(0,!1),ce&&typeof ce.onPostCommitFiberRoot=="function")try{ce.onPostCommitFiberRoot(K,f)}catch{}return!0}finally{te.p=u,O.T=s,eg(e,t)}}function ng(e,t,n){t=b(n,t),t=Zf(e.stateNode,t,2),e=ys(e,t,2),e!==null&&(Tl(e,2),fa(e))}function _t(e,t,n){if(e.tag===3)ng(e,e,n);else for(;t!==null;){if(t.tag===3){ng(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ns===null||!Ns.has(s))){e=b(n,e),n=lm(2),s=ys(t,n,2),s!==null&&(am(n,s,t,e),Tl(s,2),fa(s));break}}t=t.return}}function yd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Iy;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(n)||(fd=!0,u.add(n),e=$y.bind(null,e,t,n),t.then(e,e))}function $y(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,wt===e&&(et&n)===n&&(Kt===4||Kt===3&&(et&62914560)===et&&300>ct()-Zu?(ot&2)===0&&or(e,0):dd|=n,cr===et&&(cr=0)),fa(e)}function lg(e,t){t===0&&(t=_n()),e=ua(e,t),e!==null&&(Tl(e,t),fa(e))}function Zy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lg(e,n)}function Ky(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(c(314))}s!==null&&s.delete(t),lg(e,n)}function Jy(e,t){return Jt(e,t)}var to=null,dr=null,_d=!1,no=!1,vd=!1,Es=0;function fa(e){e!==dr&&e.next===null&&(dr===null?to=dr=e:dr=dr.next=e),no=!0,_d||(_d=!0,Wy())}function jc(e,t){if(!vd&&no){vd=!0;do for(var n=!1,s=to;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var g=s.suspendedLanes,S=s.pingedLanes;f=(1<<31-Ce(42|e)+1)-1,f&=u&~(g&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,rg(s,f))}else f=et,f=Ul(s,s===wt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Fn(s,f)||(n=!0,rg(s,f));s=s.next}while(n);vd=!1}}function Fy(){ag()}function ag(){no=_d=!1;var e=0;Es!==0&&c_()&&(e=Es);for(var t=ct(),n=null,s=to;s!==null;){var u=s.next,f=sg(s,t);f===0?(s.next=null,n===null?to=u:n.next=u,u===null&&(dr=n)):(n=s,(e!==0||(f&3)!==0)&&(no=!0)),s=u}vn!==0&&vn!==5||jc(e),Es!==0&&(Es=0)}function sg(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var g=31-Ce(f),S=1<<g,A=u[g];A===-1?((S&n)===0||(S&s)!==0)&&(u[g]=Yn(S,t)):A<=t&&(e.expiredLanes|=S),f&=~S}if(t=wt,n=et,n=Ul(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(yt===2||yt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ft(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Fn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Ft(s),Rn(n)){case 2:case 8:n=yn;break;case 32:n=Qt;break;case 268435456:n=Nn;break;default:n=Qt}return s=ig.bind(null,e),n=Jt(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Ft(s),e.callbackPriority=2,e.callbackNode=null,2}function ig(e,t){if(vn!==0&&vn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(eo()&&e.callbackNode!==n)return null;var s=et;return s=Ul(e,e===wt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Gm(e,s,t),sg(e,ct()),e.callbackNode!=null&&e.callbackNode===n?ig.bind(null,e):null)}function rg(e,t){if(eo())return null;Gm(e,t,!0)}function Wy(){o_(function(){(ot&6)!==0?Jt(jn,Fy):ag()})}function Sd(){if(Es===0){var e=Fi;e===0&&(e=Se,Se<<=1,(Se&261888)===0&&(Se=256)),Es=e}return Es}function cg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function ug(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 Py(e,t,n,s,u){if(t==="submit"&&n&&n.stateNode===u){var f=cg((u[Je]||null).action),g=s.submitter;g&&(t=(t=g[Je]||null)?cg(t.formAction):g.getAttribute("formAction"),t!==null&&(f=t,g=null));var S=new ls("action","action",null,s,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Es!==0){var A=g?ug(u,g):new FormData(u);If(n,{pending:!0,data:A,method:u.method,action:f},null,A)}}else typeof f=="function"&&(S.preventDefault(),A=g?ug(u,g):new FormData(u),If(n,{pending:!0,data:A,method:u.method,action:f},f,A))},currentTarget:u}]})}}for(var jd=0;jd<tl.length;jd++){var kd=tl[jd],e_=kd.toLowerCase(),t_=kd[0].toUpperCase()+kd.slice(1);Yt(e_,"on"+t_)}Yt(xu,"onAnimationEnd"),Yt(yu,"onAnimationIteration"),Yt(_u,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(ff,"onTransitionRun"),Yt(df,"onTransitionStart"),Yt(vu,"onTransitionCancel"),Yt(Wr,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("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 kc="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(" "),n_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function og(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],u=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var g=s.length-1;0<=g;g--){var S=s[g],A=S.instance,V=S.currentTarget;if(S=S.listener,A!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=V;try{f(u)}catch(ee){yl(ee)}u.currentTarget=null,f=A}else for(g=0;g<s.length;g++){if(S=s[g],A=S.instance,V=S.currentTarget,S=S.listener,A!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=V;try{f(u)}catch(ee){yl(ee)}u.currentTarget=null,f=A}}}}function Pe(e,t){var n=t[Xs];n===void 0&&(n=t[Xs]=new Set);var s=e+"__bubble";n.has(s)||(fg(t,e,2,!1),n.add(s))}function Nd(e,t,n){var s=0;t&&(s|=4),fg(n,e,s,t)}var lo="_reactListening"+Math.random().toString(36).slice(2);function wd(e){if(!e[lo]){e[lo]=!0,Vn.forEach(function(n){n!=="selectionchange"&&(n_.has(n)||Nd(n,!1,e),Nd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lo]||(t[lo]=!0,Nd("selectionchange",!1,t))}}function fg(e,t,n,s){switch(qg(t)){case 2:var u=C_;break;case 8:u=R_;break;default:u=Gd}n=u.bind(null,t,n,e),u=void 0,!Ks||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),s?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 Td(e,t,n,s,u){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var g=s.tag;if(g===3||g===4){var S=s.stateNode.containerInfo;if(S===u)break;if(g===4)for(g=s.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===u)return;g=g.return}for(;S!==null;){if(g=Pl(S),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){s=f=g;continue e}S=S.parentNode}}s=s.return}Ui(function(){var V=f,ee=Bt(n),le=[];e:{var Z=si.get(e);if(Z!==void 0){var F=ls,ke=e;switch(e){case"keypress":if(Ra(n)===0)break e;case"keydown":case"keyup":F=Jo;break;case"focusin":ke="focus",F=ss;break;case"focusout":ke="blur",F=ss;break;case"beforeblur":case"afterblur":F=ss;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":F=Br;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=Fc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=rs;break;case xu:case yu:case _u:F=Ma;break;case Wr:F=Po;break;case"scroll":case"scrollend":F=Zo;break;case"wheel":F=tf;break;case"copy":case"cut":case"paste":F=Ws;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=eu;break;case"toggle":case"beforetoggle":F=ei}var Ue=(t&4)!==0,kt=!Ue&&(e==="scroll"||e==="scrollend"),L=Ue?Z!==null?Z+"Capture":null:Z;Ue=[];for(var R=V,I;R!==null;){var ne=R;if(I=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||I===null||L===null||(ne=Zs(R,L),ne!=null&&Ue.push(Nc(R,ne,I))),kt)break;R=R.return}0<Ue.length&&(Z=new F(Z,ke,null,n,ee),le.push({event:Z,listeners:Ue}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",Z&&n!==un&&(ke=n.relatedTarget||n.fromElement)&&(Pl(ke)||ke[Wn]))break e;if((F||Z)&&(Z=ee.window===ee?ee:(Z=ee.ownerDocument)?Z.defaultView||Z.parentWindow:window,F?(ke=n.relatedTarget||n.toElement,F=V,ke=ke?Pl(ke):null,ke!==null&&(kt=d(ke),Ue=ke.tag,ke!==kt||Ue!==5&&Ue!==27&&Ue!==6)&&(ke=null)):(F=null,ke=V),F!==ke)){if(Ue=Br,ne="onMouseLeave",L="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ue=eu,ne="onPointerLeave",L="onPointerEnter",R="pointer"),kt=F==null?Z:Pt(F),I=ke==null?Z:Pt(ke),Z=new Ue(ne,R+"leave",F,n,ee),Z.target=kt,Z.relatedTarget=I,ne=null,Pl(ee)===V&&(Ue=new Ue(L,R+"enter",ke,n,ee),Ue.target=I,Ue.relatedTarget=kt,ne=Ue),kt=ne,F&&ke)t:{for(Ue=l_,L=F,R=ke,I=0,ne=L;ne;ne=Ue(ne))I++;ne=0;for(var Oe=R;Oe;Oe=Ue(Oe))ne++;for(;0<I-ne;)L=Ue(L),I--;for(;0<ne-I;)R=Ue(R),ne--;for(;I--;){if(L===R||R!==null&&L===R.alternate){Ue=L;break t}L=Ue(L),R=Ue(R)}Ue=null}else Ue=null;F!==null&&dg(le,Z,F,Ue,!1),ke!==null&&kt!==null&&dg(le,kt,ke,Ue,!0)}}e:{if(Z=V?Pt(V):window,F=Z.nodeName&&Z.nodeName.toLowerCase(),F==="select"||F==="input"&&Z.type==="file")var it=Xr;else if(su(Z))if(cu)it=uf;else{it=rf;var Ee=sf}else F=Z.nodeName,!F||F.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?V&&De(V.elementType)&&(it=Xr):it=cf;if(it&&(it=it(e,V))){iu(le,it,n,ee);break e}Ee&&Ee(e,Z,V),e==="focusout"&&V&&Z.type==="number"&&V.memoizedProps.value!=null&&la(Z,"number",Z.value)}switch(Ee=V?Pt(V):window,e){case"focusin":(su(Ee)||Ee.contentEditable==="true")&&(Il=Ee,Kr=V,ai=null);break;case"focusout":ai=Kr=Il=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,gu(le,n,ee);break;case"selectionchange":if(Zr)break;case"keydown":case"keyup":gu(le,n,ee)}var $e;if(Gr)e:{switch(e){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else cs?Ir(e,n)&&(tt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(tt="onCompositionStart");tt&&(nu&&n.locale!=="ko"&&(cs||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&cs&&($e=Al()):(xl=ee,Hi="value"in xl?xl.value:xl.textContent,cs=!0)),Ee=ao(V,tt),0<Ee.length&&(tt=new is(tt,e,null,n,ee),le.push({event:tt,listeners:Ee}),$e?tt.data=$e:($e=Yr(n),$e!==null&&(tt.data=$e)))),($e=tu?au(e,n):Vr(e,n))&&(tt=ao(V,"onBeforeInput"),0<tt.length&&(Ee=new is("onBeforeInput","beforeinput",null,n,ee),le.push({event:Ee,listeners:tt}),Ee.data=$e)),Py(le,e,V,n,ee)}og(le,t)})}function Nc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ao(e,t){for(var n=t+"Capture",s=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Zs(e,n),u!=null&&s.unshift(Nc(e,u,f)),u=Zs(e,t),u!=null&&s.push(Nc(e,u,f))),e.tag===3)return s;e=e.return}return[]}function l_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dg(e,t,n,s,u){for(var f=t._reactName,g=[];n!==null&&n!==s;){var S=n,A=S.alternate,V=S.stateNode;if(S=S.tag,A!==null&&A===s)break;S!==5&&S!==26&&S!==27||V===null||(A=V,u?(V=Zs(n,f),V!=null&&g.unshift(Nc(n,V,A))):u||(V=Zs(n,f),V!=null&&g.push(Nc(n,V,A)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var a_=/\r\n?/g,s_=/\u0000|\uFFFD/g;function hg(e){return(typeof e=="string"?e:""+e).replace(a_,`
50
- `).replace(s_,"")}function pg(e,t){return t=hg(t),hg(e)===t}function jt(e,t,n,s,u,f){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||G(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&G(e,""+s);break;case"className":Mn(e,"class",s);break;case"tabIndex":Mn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Mn(e,n,s);break;case"style":Re(e,s,f);break;case"data":if(t!=="object"){Mn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=tn(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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"&&jt(e,t,"name",u.name,u,null),jt(e,t,"formEncType",u.formEncType,u,null),jt(e,t,"formMethod",u.formMethod,u,null),jt(e,t,"formTarget",u.formTarget,u,null)):(jt(e,t,"encType",u.encType,u,null),jt(e,t,"method",u.method,u,null),jt(e,t,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=tn(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Et);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=tn(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),wn(e,"popover",s);break;case"xlinkActuate":rn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":rn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":rn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":rn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":rn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":rn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":rn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":rn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":rn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":wn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=pt.get(n)||n,wn(e,n,s))}}function Ed(e,t,n,s,u,f){switch(n){case"style":Re(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof s=="string"?G(e,s):(typeof s=="number"||typeof s=="bigint")&&G(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Et);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wa.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[Je]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof s=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,u);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):wn(e,n,s)}}}function Hn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var g=n[f];if(g!=null)switch(f){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,f,g,n,null)}}u&&jt(e,t,"srcSet",n.srcSet,n,null),s&&jt(e,t,"src",n.src,n,null);return;case"input":Pe("invalid",e);var S=f=g=u=null,A=null,V=null;for(s in n)if(n.hasOwnProperty(s)){var ee=n[s];if(ee!=null)switch(s){case"name":u=ee;break;case"type":g=ee;break;case"checked":A=ee;break;case"defaultChecked":V=ee;break;case"value":f=ee;break;case"defaultValue":S=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:jt(e,t,s,ee,n,null)}}Bl(e,f,S,A,V,g,u,!1);return;case"select":Pe("invalid",e),s=g=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":g=S;break;case"multiple":s=S;default:jt(e,t,u,S,n,null)}t=f,n=g,e.multiple=!!s,t!=null?il(e,!!s,t,!1):n!=null&&il(e,!!s,n,!0);return;case"textarea":Pe("invalid",e),f=u=s=null;for(g in n)if(n.hasOwnProperty(g)&&(S=n[g],S!=null))switch(g){case"value":s=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:jt(e,t,g,S,n,null)}k(e,s,u,f);return;case"option":for(A in n)if(n.hasOwnProperty(A)&&(s=n[A],s!=null))switch(A){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:jt(e,t,A,s,n,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<kc.length;s++)Pe(kc[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(V in n)if(n.hasOwnProperty(V)&&(s=n[V],s!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,V,s,n,null)}return;default:if(De(t)){for(ee in n)n.hasOwnProperty(ee)&&(s=n[ee],s!==void 0&&Ed(e,t,ee,s,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(s=n[S],s!=null&&jt(e,t,S,s,n,null))}function i_(e,t,n,s){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,g=null,S=null,A=null,V=null,ee=null;for(F in n){var le=n[F];if(n.hasOwnProperty(F)&&le!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":A=le;default:s.hasOwnProperty(F)||jt(e,t,F,null,s,le)}}for(var Z in s){var F=s[Z];if(le=n[Z],s.hasOwnProperty(Z)&&(F!=null||le!=null))switch(Z){case"type":f=F;break;case"name":u=F;break;case"checked":V=F;break;case"defaultChecked":ee=F;break;case"value":g=F;break;case"defaultValue":S=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(c(137,t));break;default:F!==le&&jt(e,t,Z,F,s,le)}}bl(e,g,S,A,V,ee,f,u);return;case"select":F=g=S=Z=null;for(f in n)if(A=n[f],n.hasOwnProperty(f)&&A!=null)switch(f){case"value":break;case"multiple":F=A;default:s.hasOwnProperty(f)||jt(e,t,f,null,s,A)}for(u in s)if(f=s[u],A=n[u],s.hasOwnProperty(u)&&(f!=null||A!=null))switch(u){case"value":Z=f;break;case"defaultValue":S=f;break;case"multiple":g=f;default:f!==A&&jt(e,t,u,f,s,A)}t=S,n=g,s=F,Z!=null?il(e,!!n,Z,!1):!!s!=!!n&&(t!=null?il(e,!!n,t,!0):il(e,!!n,n?[]:"",!1));return;case"textarea":F=Z=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:jt(e,t,S,null,s,u)}for(g in s)if(u=s[g],f=n[g],s.hasOwnProperty(g)&&(u!=null||f!=null))switch(g){case"value":Z=u;break;case"defaultValue":F=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&jt(e,t,g,u,s,f)}fe(e,Z,F);return;case"option":for(var ke in n)if(Z=n[ke],n.hasOwnProperty(ke)&&Z!=null&&!s.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:jt(e,t,ke,null,s,Z)}for(A in s)if(Z=s[A],F=n[A],s.hasOwnProperty(A)&&Z!==F&&(Z!=null||F!=null))switch(A){case"selected":e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol";break;default:jt(e,t,A,Z,s,F)}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 Ue in n)Z=n[Ue],n.hasOwnProperty(Ue)&&Z!=null&&!s.hasOwnProperty(Ue)&&jt(e,t,Ue,null,s,Z);for(V in s)if(Z=s[V],F=n[V],s.hasOwnProperty(V)&&Z!==F&&(Z!=null||F!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(c(137,t));break;default:jt(e,t,V,Z,s,F)}return;default:if(De(t)){for(var kt in n)Z=n[kt],n.hasOwnProperty(kt)&&Z!==void 0&&!s.hasOwnProperty(kt)&&Ed(e,t,kt,void 0,s,Z);for(ee in s)Z=s[ee],F=n[ee],!s.hasOwnProperty(ee)||Z===F||Z===void 0&&F===void 0||Ed(e,t,ee,Z,s,F);return}}for(var L in n)Z=n[L],n.hasOwnProperty(L)&&Z!=null&&!s.hasOwnProperty(L)&&jt(e,t,L,null,s,Z);for(le in s)Z=s[le],F=n[le],!s.hasOwnProperty(le)||Z===F||Z==null&&F==null||jt(e,t,le,Z,s,F)}function mg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function r_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var u=n[s],f=u.transferSize,g=u.initiatorType,S=u.duration;if(f&&S&&mg(g)){for(g=0,S=u.responseEnd,s+=1;s<n.length;s++){var A=n[s],V=A.startTime;if(V>S)break;var ee=A.transferSize,le=A.initiatorType;ee&&mg(le)&&(A=A.responseEnd,g+=ee*(A<S?1:(S-V)/(A-V)))}if(--s,t+=8*(f+g)/(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 Ad=null,Cd=null;function so(e){return e.nodeType===9?e:e.ownerDocument}function gg(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 bg(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 Rd(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 Md=null;function c_(){var e=window.event;return e&&e.type==="popstate"?e===Md?!1:(Md=e,!0):(Md=null,!1)}var xg=typeof setTimeout=="function"?setTimeout:void 0,u_=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,o_=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(e){return yg.resolve(null).then(e).catch(f_)}:xg;function f_(e){setTimeout(function(){throw e})}function As(e){return e==="head"}function _g(e,t){var n=t,s=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(u),gr(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")wc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,wc(n);for(var f=n.firstChild;f;){var g=f.nextSibling,S=f.nodeName;f[Wl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=g}}else n==="body"&&wc(e.ownerDocument.body);n=u}while(n);gr(t)}function vg(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Od(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":Od(n),Na(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function d_(e,t,n,s){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Wl])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=Ol(e.nextSibling),e===null)break}return null}function h_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ol(e.nextSibling),e===null))return null;return e}function Sg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ol(e.nextSibling),e===null))return null;return e}function Dd(e){return e.data==="$?"||e.data==="$~"}function zd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function p_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ol(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 Ld=null;function jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ol(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function kg(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 Ng(e,t,n){switch(t=so(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 wc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Na(e)}var Dl=new Map,wg=new Set;function io(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ja=te.d;te.d={f:m_,r:g_,D:b_,C:x_,L:y_,m:__,X:S_,S:v_,M:j_};function m_(){var e=Ja.f(),t=Fu();return e||t}function g_(e){var t=gl(e);t!==null&&t.tag===5&&t.type==="form"?Yp(t):Ja.r(e)}var hr=typeof document>"u"?null:document;function Tg(e,t,n){var s=hr;if(s&&typeof t=="string"&&t){var u=On(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),wg.has(u)||(wg.add(u),e={rel:e,crossOrigin:n,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),Hn(t,"link",e),ut(t),s.head.appendChild(t)))}}function b_(e){Ja.D(e),Tg("dns-prefetch",e,null)}function x_(e,t){Ja.C(e,t),Tg("preconnect",e,t)}function y_(e,t,n){Ja.L(e,t,n);var s=hr;if(s&&e&&t){var u='link[rel="preload"][as="'+On(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+On(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+On(n.imageSizes)+'"]')):u+='[href="'+On(e)+'"]';var f=u;switch(t){case"style":f=pr(e);break;case"script":f=mr(e)}Dl.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Dl.set(f,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(Tc(f))||t==="script"&&s.querySelector(Ec(f))||(t=s.createElement("link"),Hn(t,"link",e),ut(t),s.head.appendChild(t)))}}function __(e,t){Ja.m(e,t);var n=hr;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+On(s)+'"][href="'+On(e)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=mr(e)}if(!Dl.has(f)&&(e=j({rel:"modulepreload",href:e},t),Dl.set(f,e),n.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ec(f)))return}s=n.createElement("link"),Hn(s,"link",e),ut(s),n.head.appendChild(s)}}}function v_(e,t,n){Ja.S(e,t,n);var s=hr;if(s&&e){var u=en(s).hoistableStyles,f=pr(e);t=t||"default";var g=u.get(f);if(!g){var S={loading:0,preload:null};if(g=s.querySelector(Tc(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Dl.get(f))&&Ud(e,n);var A=g=s.createElement("link");ut(A),Hn(A,"link",e),A._p=new Promise(function(V,ee){A.onload=V,A.onerror=ee}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ro(g,t,s)}g={type:"stylesheet",instance:g,count:1,state:S},u.set(f,g)}}}function S_(e,t){Ja.X(e,t);var n=hr;if(n&&e){var s=en(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0},t),(t=Dl.get(u))&&Hd(e,t),f=n.createElement("script"),ut(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function j_(e,t){Ja.M(e,t);var n=hr;if(n&&e){var s=en(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=Dl.get(u))&&Hd(e,t),f=n.createElement("script"),ut(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function Eg(e,t,n,s){var u=(u=Ae.current)?io(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=pr(n.href),n=en(u).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=pr(n.href);var f=en(u).hoistableStyles,g=f.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,g),(f=u.querySelector(Tc(e)))&&!f._p&&(g.instance=f,g.state.loading=5),Dl.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},Dl.set(e,n),f||k_(u,e,n,g.state))),t&&s===null)throw Error(c(528,""));return g}if(t&&s!==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=mr(n),n=en(u).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function pr(e){return'href="'+On(e)+'"'}function Tc(e){return'link[rel="stylesheet"]['+e+"]"}function Ag(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function k_(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Hn(t,"link",n),ut(t),e.head.appendChild(t))}function mr(e){return'[src="'+On(e)+'"]'}function Ec(e){return"script[async]"+e}function Cg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+On(n.href)+'"]');if(s)return t.instance=s,ut(s),s;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ut(s),Hn(s,"style",u),ro(s,n.precedence,e),t.instance=s;case"stylesheet":u=pr(n.href);var f=e.querySelector(Tc(u));if(f)return t.state.loading|=4,t.instance=f,ut(f),f;s=Ag(n),(u=Dl.get(u))&&Ud(s,u),f=(e.ownerDocument||e).createElement("link"),ut(f);var g=f;return g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Hn(f,"link",s),t.state.loading|=4,ro(f,n.precedence,e),t.instance=f;case"script":return f=mr(n.src),(u=e.querySelector(Ec(f)))?(t.instance=u,ut(u),u):(s=n,(u=Dl.get(f))&&(s=j({},n),Hd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),ut(u),Hn(u,"link",s),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&&(s=t.instance,t.state.loading|=4,ro(s,n.precedence,e));return t.instance}function ro(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,g=0;g<s.length;g++){var S=s[g];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 Ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var co=null;function Rg(e,t,n){if(co===null){var s=new Map,u=co=new Map;u.set(n,s)}else u=co,s=u.get(n),s||(s=new Map,u.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Wl]||f[$t]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var g=f.getAttribute(t)||"";g=e+g;var S=s.get(g);S?S.push(f):s.set(g,[f])}}return s}function Mg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function N_(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 Og(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function w_(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=pr(s.href),f=t.querySelector(Tc(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=uo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,ut(f);return}f=t.ownerDocument||t,s=Ag(s),(u=Dl.get(u))&&Ud(s,u),f=f.createElement("link"),ut(f);var g=f;g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Hn(f,"link",s),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=uo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Bd=0;function T_(e,t){return e.stylesheets&&e.count===0&&fo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&fo(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Bd===0&&(Bd=62500*r_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fo(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Bd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oo=null;function fo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oo=new Map,t.forEach(E_,e),oo=null,uo.call(e))}function E_(e,t){if(!(t.state.loading&4)){var n=oo.get(e);if(n)var s=n.get(null);else{n=new Map,oo.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var g=u[f];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(n.set(g.dataset.precedence,g),s=g)}s&&n.set(null,s)}u=t.instance,g=u.getAttribute("data-precedence"),f=n.get(g)||s,f===s&&n.set(null,u),n.set(g,u),this.count++,s=uo.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Ac={$$typeof:X,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function A_(e,t,n,s,u,f,g,S,A){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=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Dg(e,t,n,s,u,f,g,S,A,V,ee,le){return e=new A_(e,t,n,g,A,V,ee,le,S),t=1,f===!0&&(t|=24),f=fn(3,null,null,t),e.current=f,f.stateNode=e,t=xf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:n,cache:t},Sf(f),e}function zg(e){return e?(e=hs,e):hs}function Lg(e,t,n,s,u,f){u=zg(u),s.context===null?s.context=u:s.pendingContext=u,s=xs(t),s.payload={element:n},f=f===void 0?null:f,f!==null&&(s.callback=f),n=ys(e,s,t),n!==null&&(dl(n,e,t),rc(n,e,t))}function Ug(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qd(e,t){Ug(e,t),(e=e.alternate)&&Ug(e,t)}function Hg(e){if(e.tag===13||e.tag===31){var t=ua(e,67108864);t!==null&&dl(t,e,67108864),qd(e,67108864)}}function Bg(e){if(e.tag===13||e.tag===31){var t=kl();t=Jl(t);var n=ua(e,t);n!==null&&dl(n,e,t),qd(e,t)}}var ho=!0;function C_(e,t,n,s){var u=O.T;O.T=null;var f=te.p;try{te.p=2,Gd(e,t,n,s)}finally{te.p=f,O.T=u}}function R_(e,t,n,s){var u=O.T;O.T=null;var f=te.p;try{te.p=8,Gd(e,t,n,s)}finally{te.p=f,O.T=u}}function Gd(e,t,n,s){if(ho){var u=Id(s);if(u===null)Td(e,t,s,po,n),Gg(e,s);else if(O_(u,e,t,n,s))s.stopPropagation();else if(Gg(e,s),t&4&&-1<M_.indexOf(e)){for(;u!==null;){var f=gl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var g=Cn(f.pendingLanes);if(g!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;g;){var A=1<<31-Ce(g);S.entanglements[1]|=A,g&=~A}fa(f),(ot&6)===0&&(Ku=ct()+500,jc(0))}}break;case 31:case 13:S=ua(f,2),S!==null&&dl(S,f,2),Fu(),qd(f,2)}if(f=Id(s),f===null&&Td(e,t,s,po,n),f===u)break;u=f}u!==null&&s.stopPropagation()}else Td(e,t,s,null,n)}}function Id(e){return e=Bt(e),Yd(e)}var po=null;function Yd(e){if(po=null,e=Pl(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=p(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 po=e,null}function qg(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(Sn()){case jn:return 2;case yn:return 8;case Qt:case kn:return 32;case Nn:return 268435456;default:return 32}default:return 32}}var Vd=!1,Cs=null,Rs=null,Ms=null,Cc=new Map,Rc=new Map,Os=[],M_="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 Gg(e,t){switch(e){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":Rs=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Cc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function Mc(e,t,n,s,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:f,targetContainers:[u]},t!==null&&(t=gl(t),t!==null&&Hg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function O_(e,t,n,s,u){switch(t){case"focusin":return Cs=Mc(Cs,e,t,n,s,u),!0;case"dragenter":return Rs=Mc(Rs,e,t,n,s,u),!0;case"mouseover":return Ms=Mc(Ms,e,t,n,s,u),!0;case"pointerover":var f=u.pointerId;return Cc.set(f,Mc(Cc.get(f)||null,e,t,n,s,u)),!0;case"gotpointercapture":return f=u.pointerId,Rc.set(f,Mc(Rc.get(f)||null,e,t,n,s,u)),!0}return!1}function Ig(e){var t=Pl(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,ml(e.priority,function(){Bg(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,ml(e.priority,function(){Bg(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 mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Id(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);un=s,n.target.dispatchEvent(s),un=null}else return t=gl(n),t!==null&&Hg(t),e.blockedOn=n,!1;t.shift()}return!0}function Yg(e,t,n){mo(e)&&n.delete(t)}function D_(){Vd=!1,Cs!==null&&mo(Cs)&&(Cs=null),Rs!==null&&mo(Rs)&&(Rs=null),Ms!==null&&mo(Ms)&&(Ms=null),Cc.forEach(Yg),Rc.forEach(Yg)}function go(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,D_)))}var bo=null;function Vg(e){bo!==e&&(bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){bo===e&&(bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],u=e[t+2];if(typeof s!="function"){if(Yd(s||n)===null)continue;break}var f=gl(n);f!==null&&(e.splice(t,3),t-=3,If(f,{pending:!0,data:u,method:n.method,action:s},s,u))}}))}function gr(e){function t(A){return go(A,e)}Cs!==null&&go(Cs,e),Rs!==null&&go(Rs,e),Ms!==null&&go(Ms,e),Cc.forEach(t),Rc.forEach(t);for(var n=0;n<Os.length;n++){var s=Os[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Os.length&&(n=Os[0],n.blockedOn===null);)Ig(n),n.blockedOn===null&&Os.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var u=n[s],f=n[s+1],g=u[Je]||null;if(typeof f=="function")g||Vg(n);else if(g){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,g=f[Je]||null)S=g.formAction;else if(Yd(u)!==null)continue}else S=g.action;typeof S=="function"?n[s+1]=S:(n.splice(s,3),s-=3),Vg(n)}}}function Xg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(g){return u=g})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),s||setTimeout(n,20)}function n(){if(!s&&!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 s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Xd(e){this._internalRoot=e}xo.prototype.render=Xd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,s=kl();Lg(n,s,e,t,null,null)},xo.prototype.unmount=Xd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lg(e.current,2,null,e,null,null),Fu(),t[Wn]=null}};function xo(e){this._internalRoot=e}xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ka();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Os.length&&t!==0&&t<Os[n].priority;n++);Os.splice(n,0,e),n===0&&Ig(e)}};var Qg=l.version;if(Qg!=="19.2.8")throw Error(c(527,Qg,"19.2.8"));te.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 z_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{K=yo.inject(z_),ce=yo}catch{}}return Dc.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,s="",u=Pp,f=em,g=tm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Dg(e,1,!1,null,null,n,s,null,u,f,g,Xg),e[Wn]=t.current,wd(e),new Xd(t)},Dc.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var s=!1,u="",f=Pp,g=em,S=tm,A=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(A=n.formState)),t=Dg(e,1,!0,t,n??null,s,u,A,f,g,S,Xg),t.context=zg(null),n=t.current,s=kl(),s=Jl(s),u=xs(s),u.callback=null,ys(n,u,s),n=s,t.current.lanes=n,Tl(t,n),fa(t),e[Wn]=t.current,wd(e),new xo(t)},Dc.version="19.2.8",Dc}var lb;function $_(){if(lb)return Kd.exports;lb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Kd.exports=Q_(),Kd.exports}var Z_=$_();const Sx=1;var Pa,Tr,Er,Ar,Cr,Kc,Rr,Xo,jx;class K_{constructor(l){Vt(this,Xo);Vt(this,Pa,null);Vt(this,Tr,new Set);Vt(this,Er,500);Vt(this,Ar,null);Vt(this,Cr,!1);Vt(this,Kc,null);Vt(this,Rr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){ft(this,Rr,l)}connect(){if(Be(this,Cr))return;const l=new WebSocket(this.url);ft(this,Pa,l),l.addEventListener("open",()=>{var i,c;ft(this,Er,500),this.send({type:"hello",protocol:Sx,clientName:"ccv-web"}),(i=Be(this,Kc))==null||i.call(this),(c=Be(this,Rr))==null||c.call(this)}),l.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of Be(this,Tr))o(c)}),l.addEventListener("close",()=>{var i;ft(this,Pa,null),(i=Be(this,Rr))==null||i.call(this),bn(this,Xo,jx).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){ft(this,Kc,l)}on(l){return Be(this,Tr).add(l),()=>Be(this,Tr).delete(l)}send(l){var i;((i=Be(this,Pa))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,Pa).send(JSON.stringify(l))}get connected(){var l;return((l=Be(this,Pa))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;ft(this,Cr,!0),(l=Be(this,Pa))==null||l.close()}}Pa=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,Cr=new WeakMap,Kc=new WeakMap,Rr=new WeakMap,Xo=new WeakSet,jx=function(){if(Be(this,Cr)||Be(this,Ar)!==null)return;const l=Be(this,Er);ft(this,Er,Math.min(l*2,1e4)),ft(this,Ar,window.setTimeout(()=>{ft(this,Ar,null),this.connect()},l))};const J_=1,kx="ccv:relay",Mo="ccv:relay.host";function F_(){try{const a=localStorage.getItem(kx);if(!a)return null;const l=JSON.parse(a);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function Nx(){localStorage.removeItem(kx)}var ya,Mr,_a,Or,Dr,Gs,Ni,wi,Is,Ti,zr,Ei,Ai,zt,Us,xh,wx,ji,yh;class W_{constructor(l){Vt(this,zt);Vt(this,ya,null);Vt(this,Mr,new Set);Vt(this,_a,null);Vt(this,Or,null);Vt(this,Dr,500);Vt(this,Gs,null);Vt(this,Ni,!1);Vt(this,wi,!1);Vt(this,Is,!1);Vt(this,Ti,null);Vt(this,zr,"Подключаемся…");Vt(this,Ei,0);Vt(this,Ai,[]);this.session=l}get connected(){return Be(this,wi)&&Be(this,Is)}get statusText(){return Be(this,zr)}get hostId(){return Be(this,Ti)}on(l){return Be(this,Mr).add(l),()=>Be(this,Mr).delete(l)}onReconnect(l){ft(this,Or,l)}onStatus(l){ft(this,_a,l)}connect(){Be(this,Ni)||bn(this,zt,xh).call(this)}send(l){if(!Be(this,wi)){Be(this,Ai).length<64&&Be(this,Ai).push(l);return}bn(this,zt,ji).call(this,{t:"client.frame",body:l})}close(){var l;ft(this,Ni,!0),Be(this,Gs)!==null&&window.clearTimeout(Be(this,Gs)),(l=Be(this,ya))==null||l.close()}}ya=new WeakMap,Mr=new WeakMap,_a=new WeakMap,Or=new WeakMap,Dr=new WeakMap,Gs=new WeakMap,Ni=new WeakMap,wi=new WeakMap,Is=new WeakMap,Ti=new WeakMap,zr=new WeakMap,Ei=new WeakMap,Ai=new WeakMap,zt=new WeakSet,Us=function(l){var i;Be(this,zr)!==l&&(ft(this,zr,l),(i=Be(this,_a))==null||i.call(this))},xh=async function(){if(Be(this,ya))return;if(!Be(this,Ti))try{ft(this,Ti,await P_(this.session.token))}catch(c){bn(this,zt,Us).call(this,c instanceof Error?c.message:String(c)),bn(this,zt,yh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${l}://${location.host}/relay/client`);ft(this,ya,i),i.addEventListener("open",()=>{bn(this,zt,ji).call(this,{t:"client.hello",protocol:J_,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}bn(this,zt,wx).call(this,o)}),i.addEventListener("close",()=>{var c;ft(this,ya,null),ft(this,wi,!1),ft(this,Is,!1),bn(this,zt,Us).call(this,"Нет связи с сервером"),(c=Be(this,_a))==null||c.call(this),bn(this,zt,yh).call(this)}),i.addEventListener("error",()=>i.close())},wx=function(l){var i,c,o,d,h,p,m;switch(l.t){case"client.ok":ft(this,Dr,500),bn(this,zt,ji).call(this,{t:"client.attach",hostId:Be(this,Ti)??"",...Be(this,Ei)>0?{sinceRseq:Be(this,Ei)}:{}});return;case"client.attached":ft(this,wi,!0),ft(this,Is,l.online),ft(this,Ei,l.rseq),bn(this,zt,Us).call(this,l.online?"Хост на связи":"Компьютер не на связи"),bn(this,zt,ji).call(this,{t:"client.frame",body:{type:"hello",protocol:Sx,clientName:"ccv-web-relay"}});const x=Be(this,Ai);ft(this,Ai,[]);for(const y of x)bn(this,zt,ji).call(this,{t:"client.frame",body:y});(i=Be(this,Or))==null||i.call(this),(c=Be(this,_a))==null||c.call(this);return;case"host.frame":{l.rseq>0&&ft(this,Ei,l.rseq);const y=l.body;for(const j of Be(this,Mr))j(y);return}case"host.online":ft(this,Is,!0),bn(this,zt,Us).call(this,"Хост на связи"),(o=Be(this,Or))==null||o.call(this),(d=Be(this,_a))==null||d.call(this);return;case"host.offline":ft(this,Is,!1),bn(this,zt,Us).call(this,"Компьютер не на связи"),(h=Be(this,_a))==null||h.call(this);return;case"ping":bn(this,zt,ji).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){Nx(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Mo),bn(this,zt,Us).call(this,"Этот компьютер отвязан от аккаунта"),ft(this,Ni,!0),(p=Be(this,ya))==null||p.close();return}l.code!=="offline"&&bn(this,zt,Us).call(this,l.message),(m=Be(this,_a))==null||m.call(this);return}},ji=function(l){var i;((i=Be(this,ya))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,ya).send(JSON.stringify(l))},yh=function(){if(Be(this,Ni)||Be(this,Gs)!==null)return;const l=Be(this,Dr);ft(this,Dr,Math.min(l*2,1e4)),ft(this,Gs,window.setTimeout(()=>{ft(this,Gs,null),bn(this,zt,xh).call(this)},l))};async function P_(a){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Mo,l),l;const i=localStorage.getItem(Mo);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${a}`}});if(c.status===401)throw Nx(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Mo,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Oo(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const e0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function t0(){if(Oo()==="local")return new K_(e0);const a=F_();return a?new W_(a):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const hl={items:[],pending:[],lastSeq:0,contextTokens:null},Pd={entries:[],total:0,loading:!1};function Tx(a){var l;return((l=a.entries[0])==null?void 0:l.seq)??1}function ab(a){return a.total>0&&Tx(a)>1}function n0(a,l){const i=new Set(a.entries.map(o=>o.seq));return{entries:[...a.entries,...l.entries.filter(o=>!i.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function l0(a){return Do(hl,a).items.map(l=>({...l,id:`h:${l.id}`}))}function Do(a,l){let i=a;for(const c of l)c.seq<=i.lastSeq||(i={...a0(i,c.event,c.seq),lastSeq:c.seq});return i}function a0(a,l,i){var o,d;const c=a.items;switch(l.kind){case"user.message":return da(a,{id:`u${i}`,kind:"user",text:l.text});case"assistant.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return br(a,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?da(a,p):br(a,h,p)}case"thinking.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return br(a,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?da(a,p):br(a,h,p)}case"tool.use":return da(a,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(m=>m.kind==="tool"&&m.toolUseId===l.toolUseId);if(h===-1)return a;const p=c[h];return br(a,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...a,pending:[...a.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=a.pending.find(m=>m.requestId===l.requestId),p=a.pending.filter(m=>m.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const m=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(m!==-1){const x=c[m];return br({...a,pending:p},m,{...x,answers:l.answers})}}return l.decision==="allow"?{...a,pending:p}:da({...a,pending:p},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=a.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),p=l.contextTokens??a.contextTokens;return da({...a,items:h,contextTokens:p},{id:`r${i}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?a:da(a,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return da(a,{id:`e${i}`,kind:"notice",tone:"error",text:l.message});case"state":return a;default:return a}}function da(a,l){return{...a,items:[...a.items,l]}}function br(a,l,i){const c=a.items.slice();return c[l]=i,{...a,items:c}}const _h="ccv:theme",eh=["system","light","dark"];function s0(){const[a,l]=_.useState(i0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=a==="dark"||a==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[a]);const i=_.useCallback(o=>{try{localStorage.setItem(_h,o)}catch{}l(o)},[]),c=_.useCallback(()=>{l(o=>{const d=eh[(eh.indexOf(o)+1)%eh.length];try{localStorage.setItem(_h,d)}catch{}return d})},[]);return[a,i,c]}function i0(){try{const a=localStorage.getItem(_h);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}const Ex=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Ci={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:"вопроса"}},r0=320,Ax="ccv:panes";function c0(a){return`--${a}-w`}function Cx(a,l){const i=Ci[a];return Math.round(Math.min(i.max,Math.max(i.min,l)))}function u0(){const a={};for(const l of Object.keys(Ci))a[l]=Ci[l].width;try{const l=localStorage.getItem(Ax);if(l){const i=JSON.parse(l);for(const c of Object.keys(Ci)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(a[c]=Cx(c,o))}}}catch{}return a}function o0(){const[a,l]=_.useState(u0),i=_.useCallback(h=>{try{localStorage.setItem(Ax,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,p)=>{l(m=>{const x=Cx(h,p);if(m[h]===x)return m;const y={...m,[h]:x};return i(y),y})},[i]),o=_.useCallback(h=>{l(p=>{const m={...p,[h]:Ci[h].width};return i(m),m})},[i]),d={};for(const h of Object.keys(Ci))d[c0(h)]=`${a[h]}px`;return{widths:a,style:d,setWidth:c,reset:o}}const th=260,Rx=120,f0=200,sb="ccv:terminal-h";function ib(a,l){return Math.round(Math.min(l,Math.max(Rx,a)))}function d0(){const[a,l]=_.useState(()=>{try{const d=localStorage.getItem(sb);if(d){const h=Number(d);if(Number.isFinite(h))return ib(h,1/0)}}catch{}return th}),i=_.useCallback(d=>{try{localStorage.setItem(sb,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const p=ib(d,h);l(m=>m===p?m:(i(p),p))},[i]),o=_.useCallback(()=>{l(th),i(th)},[i]);return{height:a,setHeight:c,reset:o}}function Mh(a){const[l,i]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(a).matches);return _.useEffect(()=>{const c=window.matchMedia(a),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[a]),l}const h0={height:0,offsetTop:0,offsetLeft:0};function rb(){if(typeof window>"u")return h0;const a=window.visualViewport;return a?{height:a.height,offsetTop:a.offsetTop,offsetLeft:a.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function p0(a){const[l,i]=_.useState(rb);return _.useEffect(()=>{if(!a)return;const c=window.visualViewport,o=()=>{const d=rb();i(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))},[a]),l}function Oh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Di=Oh();function Mx(a){Di=a}var ki={exec:()=>null};function xr(a){let l=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=l[c];return o||(o=a(c),l[c]=o),o}}function at(a,l=""){let i=typeof a=="string"?a:a.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(Kn.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,l)};return c}var m0=((a="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+a)}catch{return!1}})(),Kn={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:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:xr(a=>new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:xr(a=>new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:xr(a=>new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),headingBeginRegex:xr(a=>new RegExp(`^ {0,${a}}#`)),htmlBeginRegex:xr(a=>new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:xr(a=>new RegExp(`^ {0,${a}}>`))},g0=/^(?:[ \t]*(?:\n|$))+/,b0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Jc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,y0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Dh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ox=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dx=at(Ox).replace(/bull/g,Dh).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(),_0=at(Ox).replace(/bull/g,Dh).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(),zh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,v0=/^[^\n]+/,Lh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,S0=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),j0=at(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Dh).getRegex(),Qo="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",Uh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k0=at("^ {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",Uh).replace("tag",Qo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),zx=a=>at(zh).replace("hr",Jc).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",a).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex(),N0=zx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),w0=zx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),T0=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",w0).getRegex(),Hh={blockquote:T0,code:b0,def:S0,fences:x0,heading:y0,hr:Jc,html:k0,lheading:Dx,list:j0,newline:g0,paragraph:N0,table:ki,text:v0},cb=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jc).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",Qo).getRegex(),E0={...Hh,lheading:_0,table:cb,paragraph:at(zh).replace("hr",Jc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cb).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",Qo).getRegex()},A0={...Hh,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Uh).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:ki,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(zh).replace("hr",Jc).replace("heading",` *#{1,6} *[^
51
- ]`).replace("lheading",Dx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},C0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,R0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Lx=/^( {2,}|\\)\n(?!\s*$)/,M0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lr=/[\p{P}\p{S}]/u,$o=/[\s\p{P}\p{S}]/u,Bh=/[^\s\p{P}\p{S}]/u,O0=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,$o).getRegex(),Ux=/(?!~)[\p{P}\p{S}]/u,D0=/(?!~)[\s\p{P}\p{S}]/u,z0=/(?:[^\s\p{P}\p{S}]|~)/u,L0=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",m0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Hx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,U0=at(Hx,"u").replace(/punct/g,Lr).getRegex(),H0=at(Hx,"u").replace(/punct/g,Ux).getRegex(),Bx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",B0=at(Bx,"gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),q0=at(Bx,"gu").replace(/notPunctSpace/g,z0).replace(/punctSpace/g,D0).replace(/punct/g,Ux).getRegex(),G0=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),I0=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Lr).getRegex(),Y0="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",V0=at(Y0,"gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),X0=at(/\\(punct)/,"gu").replace(/punct/g,Lr).getRegex(),Q0=at(/^<(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(),$0=at(Uh).replace("(?:-->|$)","-->").getRegex(),Z0=at("^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",$0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Uo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,K0=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Uo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qx=at(/^!?\[(label)\]\[(ref)\]/).replace("label",Uo).replace("ref",Lh).getRegex(),Gx=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lh).getRegex(),J0=at("reflink|nolink(?!\\()","g").replace("reflink",qx).replace("nolink",Gx).getRegex(),ub=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qh={_backpedal:ki,anyPunctuation:X0,autolink:Q0,blockSkip:L0,br:Lx,code:R0,del:ki,delLDelim:ki,delRDelim:ki,emStrongLDelim:U0,emStrongRDelimAst:B0,emStrongRDelimUnd:G0,escape:C0,link:K0,nolink:Gx,punctuation:O0,reflink:qx,reflinkSearch:J0,tag:Z0,text:M0,url:ki},F0={...qh,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",Uo).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uo).getRegex()},vh={...qh,emStrongRDelimAst:q0,emStrongLDelim:H0,delLDelim:I0,delRDelim:V0,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ub).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:at(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ub).getRegex()},W0={...vh,br:at(Lx).replace("{2,}","*").getRegex(),text:at(vh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_o={normal:Hh,gfm:E0,pedantic:A0},zc={normal:qh,gfm:vh,breaks:W0,pedantic:F0},P0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ob=a=>P0[a];function ga(a,l){if(l){if(Kn.escapeTest.test(a))return a.replace(Kn.escapeReplace,ob)}else if(Kn.escapeTestNoEncode.test(a))return a.replace(Kn.escapeReplaceNoEncode,ob);return a}function fb(a){try{a=encodeURI(a).replace(Kn.percentDecode,"%")}catch{return null}return a}function db(a,l){var d;let i=a.replace(Kn.findPipe,(h,p,m)=>{let x=!1,y=p;for(;--y>=0&&m[y]==="\\";)x=!x;return x?"|":" |"}),c=i.split(Kn.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(Kn.slashPipe,"|");return c}function zs(a,l,i){let c=a.length;if(c===0)return"";let o=0;for(;o<c&&a.charAt(c-o-1)===l;)o++;return a.slice(0,c-o)}function hb(a){let l=a.split(`
49
+ `+s.stack}}var Gn=Object.prototype.hasOwnProperty,Jt=a.unstable_scheduleCallback,Ft=a.unstable_cancelCallback,In=a.unstable_shouldYield,Xt=a.unstable_requestPaint,ct=a.unstable_now,jn=a.unstable_getCurrentPriorityLevel,kn=a.unstable_ImmediatePriority,_n=a.unstable_UserBlockingPriority,Qt=a.unstable_NormalPriority,Nn=a.unstable_LowPriority,wn=a.unstable_IdlePriority,Ht=a.log,Wt=a.unstable_setDisableYieldValue,Z=null,ue=null;function we(e){if(typeof Ht=="function"&&Wt(e),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(Z,e)}catch{}}var Ce=Math.clz32?Math.clz32:Y,bt=Math.log,T=Math.LN2;function Y(e){return e>>>=0,e===0?32:31-(bt(e)/T|0)|0}var Se=256,Me=262144,He=4194304;function Rn(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 Ul(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~f,s!==0?u=Rn(s):(g&=S,g!==0?u=Rn(g):n||(n=S&~e,n!==0&&(u=Rn(n))))):(S=s&~f,S!==0?u=Rn(S):g!==0?u=Rn(g):n||(n=s&~e,n!==0&&(u=Rn(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 Fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Yn(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 vn(){var e=He;return He<<=1,(He&62914560)===0&&(He=4194304),e}function Tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sa(e,t,n,s,u,f){var g=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,A=e.expirationTimes,G=e.hiddenUpdates;for(n=g&~n;0<n;){var ee=31-Ce(n),se=1<<ee;S[ee]=0,A[ee]=-1;var Q=G[ee];if(Q!==null)for(G[ee]=null,ee=0;ee<Q.length;ee++){var J=Q[ee];J!==null&&(J.lane&=-536870913)}n&=~se}s!==0&&ja(e,s,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(g&~t))}function ja(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ce(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Vs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-Ce(n),u=1<<s;u&t|e[s]&t&&(e[s]|=t),n&=~u}}function Hl(e,t){var n=t&-t;return n=(n&42)!==0?1:Jl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Jl(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 rn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ka(){var e=te.p;return e!==0?e:(e=window.event,e===void 0?32:qg(e.type))}function ml(e,t){var n=te.p;try{return te.p=e,t()}finally{te.p=n}}var al=Math.random().toString(36).slice(2),$t="__reactFiber$"+al,Je="__reactProps$"+al,Wn="__reactContainer$"+al,Xs="__reactEvents$"+al,Li="__reactListeners$"+al,Qs="__reactHandles$"+al,Fl="__reactResources$"+al,Wl="__reactMarker$"+al;function Na(e){delete e[$t],delete e[Je],delete e[Xs],delete e[Li],delete e[Qs]}function Pl(e){var t=e[$t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Wn]||n[$t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kg(e);e!==null;){if(n=e[$t])return n;e=kg(e)}return t}e=n,n=e.parentNode}return null}function gl(e){if(e=e[$t]||e[Wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function en(e){var t=e[Fl];return t||(t=e[Fl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[Wl]=!0}var Vn=new Set,wa={};function Xn(e,t){Qn(e,t),Qn(e+"Capture",t)}function Qn(e,t){for(wa[e]=t,e=0;e<t.length;e++)Vn.add(t[e])}var sl=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]*$"),ea={},Pn={};function $s(e){return Gn.call(Pn,e)?!0:Gn.call(ea,e)?!1:sl.test(e)?Pn[e]=!0:(ea[e]=!0,!1)}function Tn(e,t,n){if($s(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Mn(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 cn(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ta(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hr(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(g){n=""+g,f.call(this,g)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ta(e){if(!e._valueTracker){var t=Ta(e)?"checked":"value";e._valueTracker=Hr(e,t,""+e[t])}}function na(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Ta(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ea(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 Aa=/[\n"\\]/g;function On(e){return e.replace(Aa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bl(e,t,n,s,u,f,g,S){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?la(e,g,xt(t)):n!=null?la(e,g,xt(n)):s!=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=""+xt(S):e.removeAttribute("name")}function Bl(e,t,n,s,u,f,g,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)){ta(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ta(e)}function la(e,t,n){t==="number"&&Ea(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function il(e,t,n,s){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&&s&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function fe(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function k(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(c(92));if(ge(s)){if(1<s.length)throw Error(c(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),ta(e)}function B(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ce=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 ye(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||ce.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Re(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in t)s=t[u],t.hasOwnProperty(u)&&n[u]!==s&&ye(e,u,s)}else for(var f in t)t.hasOwnProperty(f)&&ye(e,f,t[f])}function De(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 pt=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"]]),un=/^[\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 tn(e){return un.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Et(){}var on=null;function Bt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var aa=null,El=null;function sa(e){var t=gl(e);if(t&&(e=t.stateNode)){var n=e[Je]||null;e:switch(e=t.stateNode,t.type){case"input":if(bl(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="'+On(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var u=s[Je]||null;if(!u)throw Error(c(90));bl(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&na(s)}break e;case"textarea":fe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&il(e,!!n.multiple,t,!1)}}}var ts=!1;function Ui(e,t,n){if(ts)return e(t,n);ts=!0;try{var s=e(t);return s}finally{if(ts=!1,(aa!==null||El!==null)&&(Fu(),aa&&(t=aa,e=El,El=aa=null,sa(t),e)))for(t=0;t<e.length;t++)sa(e[t])}}function Zs(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Je]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ks=!1;if(Dn)try{var ns={};Object.defineProperty(ns,"passive",{get:function(){Ks=!0}}),window.addEventListener("test",ns,ns),window.removeEventListener("test",ns,ns)}catch{Ks=!1}var xl=null,Hi=null,Ca=null;function Al(){if(Ca)return Ca;var e,t=Hi,n=t.length,s,u="value"in xl?xl.value:xl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var g=n-e;for(s=1;s<=g&&t[n-s]===u[f-s];s++);return Ca=u.slice(e,1<s?1-s:void 0)}function Ra(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ia(){return!0}function ra(){return!1}function fn(e){function t(n,s,u,f,g){this._reactName=n,this._targetInst=u,this.type=s,this.nativeEvent=f,this.target=g,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)?ia:ra,this.isPropagationStopped=ra,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=ia)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ia)},persist:function(){},isPersistent:ia}),t}var mt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ls=fn(mt),Js=j({},mt,{view:0,detail:0}),Zo=fn(Js),Bi,as,nn,ln=j({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ca,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nn&&(nn&&e.type==="mousemove"?(Bi=e.screenX-nn.screenX,as=e.screenY-nn.screenY):as=Bi=0,nn=e),Bi)},movementY:function(e){return"movementY"in e?e.movementY:as}}),Br=fn(ln),ql=j({},ln,{dataTransfer:0}),Fc=fn(ql),qi=j({},Js,{relatedTarget:0}),ss=fn(qi),Fs=j({},mt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ma=fn(Fs),Wc=j({},mt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ws=fn(Wc),Gi=j({},mt,{data:0}),is=fn(Gi),Ps={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pc={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"},Ko={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function le(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ko[e])?!!t[e]:!1}function ca(){return le}var qr=j({},Js,{key:function(e){if(e.key){var t=Ps[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ra(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ca,charCode:function(e){return e.type==="keypress"?Ra(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ra(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jo=fn(qr),Fo=j({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eu=fn(Fo),_e=j({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ca}),rs=fn(_e),Wo=j({},mt,{propertyName:0,elapsedTime:0,pseudoElement:0}),Po=fn(Wo),ef=j({},ln,{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}),tf=fn(ef),nf=j({},mt,{newState:0,oldState:0}),ei=fn(nf),lf=[9,13,27,32],Gr=Dn&&"CompositionEvent"in window,ti=null;Dn&&"documentMode"in document&&(ti=document.documentMode);var tu=Dn&&"TextEvent"in window&&!ti,nu=Dn&&(!Gr||ti&&8<ti&&11>=ti),lu=" ",Ii=!1;function Ir(e,t){switch(e){case"keyup":return lf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function au(e,t){switch(e){case"compositionend":return Yr(t);case"keypress":return t.which!==32?null:(Ii=!0,lu);case"textInput":return e=t.data,e===lu&&Ii?null:e;default:return null}}function Vr(e,t){if(cs)return e==="compositionend"||!Gr&&Ir(e,t)?(e=Al(),Ca=Hi=xl=null,cs=!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 nu&&t.locale!=="ko"?null:t.data;default:return null}}var af={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 su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!af[e.type]:t==="textarea"}function iu(e,t,n,s){aa?El?El.push(s):El=[s]:aa=s,t=ao(t,"onChange"),0<t.length&&(n=new ls("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ni=null,Gl=null;function ru(e){og(e,0)}function Yi(e){var t=Pt(e);if(na(t))return e}function Xr(e,t){if(e==="change")return t}var cu=!1;if(Dn){var Qr;if(Dn){var $r="oninput"in document;if(!$r){var uu=document.createElement("div");uu.setAttribute("oninput","return;"),$r=typeof uu.oninput=="function"}Qr=$r}else Qr=!1;cu=Qr&&(!document.documentMode||9<document.documentMode)}function ou(){ni&&(ni.detachEvent("onpropertychange",fu),Gl=ni=null)}function fu(e){if(e.propertyName==="value"&&Yi(Gl)){var t=[];iu(t,Gl,e,Bt(e)),Ui(ru,t)}}function sf(e,t,n){e==="focusin"?(ou(),ni=t,Gl=n,ni.attachEvent("onpropertychange",fu)):e==="focusout"&&ou()}function rf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yi(Gl)}function cf(e,t){if(e==="click")return Yi(t)}function uf(e,t){if(e==="input"||e==="change")return Yi(t)}function of(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var el=typeof Object.is=="function"?Object.is:of;function us(e,t){if(el(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var u=n[s];if(!Gn.call(t,u)||!el(e[u],t[u]))return!1}return!0}function du(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hu(e,t){var n=du(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=du(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 mu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ea(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=Ea(e.document)}return t}function li(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 Zr=Dn&&"documentMode"in document&&11>=document.documentMode,Il=null,Kr=null,ai=null,Jr=!1;function gu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Il==null||Il!==Ea(s)||(s=Il,"selectionStart"in s&&li(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ai&&us(ai,s)||(ai=s,s=ao(Kr,"onSelect"),0<s.length&&(t=new ls("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Il)))}function Oa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var os={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},Fr={},bu={};Dn&&(bu=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Da(e){if(Fr[e])return Fr[e];if(!os[e])return e;var t=os[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in bu)return Fr[e]=t[n];return e}var xu=Da("animationend"),yu=Da("animationiteration"),_u=Da("animationstart"),ff=Da("transitionrun"),df=Da("transitionstart"),vu=Da("transitioncancel"),Wr=Da("transitionend"),si=new Map,tl="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(" ");tl.push("scrollEnd");function Yt(e,t){si.set(e,t),Xn(t,[e])}var yl=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)},$n=[],za=0,fs=0;function ii(){for(var e=za,t=fs=za=0;t<e;){var n=$n[t];$n[t++]=null;var s=$n[t];$n[t++]=null;var u=$n[t];$n[t++]=null;var f=$n[t];if($n[t++]=null,s!==null&&u!==null){var g=s.pending;g===null?u.next=u:(u.next=g.next,g.next=u),s.pending=u}f!==0&&Su(n,u,f)}}function Vi(e,t,n,s){$n[za++]=e,$n[za++]=t,$n[za++]=n,$n[za++]=s,fs|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function La(e,t,n,s){return Vi(e,t,n,s),ds(e)}function ua(e,t){return Vi(e,null,null,t),ds(e)}function Su(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,s=f.alternate,s!==null&&(s.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-Ce(n),e=f.hiddenUpdates,s=e[u],s===null?e[u]=[t]:s.push(t),t.lane=n|536870912),f):null}function ds(e){if(50<Sc)throw Sc=0,gd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hs={};function ri(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,n,s){return new ri(e,t,n,s)}function Xi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cl(e,t){var n=e.alternate;return n===null?(n=dn(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 Pr(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 ci(e,t,n,s,u,f){var g=0;if(s=e,typeof e=="function")Xi(e)&&(g=1);else if(typeof e=="string")g=w_(e,n,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case re:return e=dn(31,n,t,u),e.elementType=re,e.lanes=f,e;case L:return Ua(n.children,u,f,t);case H:g=8,u|=24;break;case $:return e=dn(12,n,t,u|2),e.elementType=$,e.lanes=f,e;case X:return e=dn(13,n,t,u),e.elementType=X,e.lanes=f,e;case O:return e=dn(19,n,t,u),e.elementType=O,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:g=10;break e;case M:g=9;break e;case E:g=11;break e;case D:g=14;break e;case F:g=16,s=null;break e}g=29,n=Error(c(130,e===null?"null":typeof e,"")),s=null}return t=dn(g,n,t,u),t.elementType=e,t.type=s,t.lanes=f,t}function Ua(e,t,n,s){return e=dn(7,e,s,t),e.lanes=n,e}function ec(e,t,n){return e=dn(6,e,null,t),e.lanes=n,e}function Qi(e){var t=dn(18,null,null,0);return t.stateNode=e,t}function $i(e,t,n){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var tc=new WeakMap;function b(e,t){if(typeof e=="object"&&e!==null){var n=tc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:vt(t)},tc.set(e,t),t)}return{value:e,source:t,stack:vt(t)}}var V=[],pe=0,Ye=null,At=0,Ct=[],qt=0,rl=null,Te=1,ze="";function Ge(e,t){V[pe++]=At,V[pe++]=Ye,Ye=e,At=t}function Rt(e,t,n){Ct[qt++]=Te,Ct[qt++]=ze,Ct[qt++]=rl,rl=e;var s=Te;e=ze;var u=32-Ce(s)-1;s&=~(1<<u),n+=1;var f=32-Ce(t)+u;if(30<f){var g=u-u%5;f=(s&(1<<g)-1).toString(32),s>>=g,u-=g,Te=1<<32-Ce(t)+u|n<<u|s,ze=f+e}else Te=1<<f|n<<u|s,ze=e}function hn(e){e.return!==null&&(Ge(e,1),Rt(e,1,0))}function Yl(e){for(;e===Ye;)Ye=V[--pe],V[pe]=null,At=V[--pe],V[pe]=null;for(;e===rl;)rl=Ct[--qt],Ct[qt]=null,ze=Ct[--qt],Ct[qt]=null,Te=Ct[--qt],Ct[qt]=null}function Zi(e,t){Ct[qt++]=Te,Ct[qt++]=ze,Ct[qt++]=rl,Te=t.id,ze=t.overflow,rl=e}var zn=null,Mt=null,nt=!1,ps=null,Rl=!1,hf=Error(c(519));function ms(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nc(b(t,e)),hf}function Fh(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[$t]=e,t[Je]=s,n){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(n=0;n<kc.length;n++)Pe(kc[n],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),Bl(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),k(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||pg(t.textContent,n)?(s.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),s.onScroll!=null&&Pe("scroll",t),s.onScrollEnd!=null&&Pe("scrollend",t),s.onClick!=null&&(t.onclick=Et),t=!0):t=!1,t||ms(e,!0)}function Wh(e){for(zn=e.return;zn;)switch(zn.tag){case 5:case 31:case 13:Rl=!1;return;case 27:case 3:Rl=!0;return;default:zn=zn.return}}function Ki(e){if(e!==zn)return!1;if(!nt)return Wh(e),nt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Rd(e.type,e.memoizedProps)),n=!n),n&&Mt&&ms(e),Wh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Mt=jg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Mt=jg(e)}else t===27?(t=Mt,As(e.type)?(e=Ld,Ld=null,Mt=e):Mt=t):Mt=zn?Ol(e.stateNode.nextSibling):null;return!0}function ui(){Mt=zn=null,nt=!1}function pf(){var e=ps;return e!==null&&(fl===null?fl=e:fl.push.apply(fl,e),ps=null),e}function nc(e){ps===null?ps=[e]:ps.push(e)}var mf=w(null),oi=null,Ha=null;function gs(e,t,n){oe(mf,t._currentValue),t._currentValue=n}function Ba(e){e._currentValue=mf.current,K(mf)}function gf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function bf(e,t,n,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var g=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var A=0;A<t.length;A++)if(S.context===t[A]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),gf(f.return,n,e),s||(g=null);break e}f=S.next}}else if(u.tag===18){if(g=u.return,g===null)throw Error(c(341));g.lanes|=n,f=g.alternate,f!==null&&(f.lanes|=n),gf(g,n,e),g=null}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===e){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}}function Ji(e,t,n,s){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 g=u.alternate;if(g===null)throw Error(c(387));if(g=g.memoizedProps,g!==null){var S=u.type;el(u.pendingProps.value,g.value)||(e!==null?e.push(S):e=[S])}}else if(u===qe.current){if(g=u.alternate,g===null)throw Error(c(387));g.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ac):e=[Ac])}u=u.return}e!==null&&bf(t,e,n,s),t.flags|=262144}function ju(e){for(e=e.firstContext;e!==null;){if(!el(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fi(e){oi=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ln(e){return Ph(oi,e)}function ku(e,t){return oi===null&&fi(e),Ph(e,t)}function Ph(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ha===null){if(e===null)throw Error(c(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return n}var Sy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},jy=a.unstable_scheduleCallback,ky=a.unstable_NormalPriority,pn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xf(){return{controller:new Sy,data:new Map,refCount:0}}function lc(e){e.refCount--,e.refCount===0&&jy(ky,function(){e.controller.abort()})}var ac=null,yf=0,Fi=0,Wi=null;function Ny(e,t){if(ac===null){var n=ac=[];yf=0,Fi=Sd(),Wi={status:"pending",value:void 0,then:function(s){n.push(s)}}}return yf++,t.then(ep,ep),t}function ep(){if(--yf===0&&ac!==null){Wi!==null&&(Wi.status="fulfilled");var e=ac;ac=null,Fi=0,Wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wy(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(s.status="rejected",s.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),s}var tp=z.S;z.S=function(e,t){Hm=ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ny(e,t),tp!==null&&tp(e,t)};var di=w(null);function _f(){var e=di.current;return e!==null?e:wt.pooledCache}function Nu(e,t){t===null?oe(di,di.current):oe(di,t.pool)}function np(){var e=_f();return e===null?null:{parent:pn._currentValue,pool:e}}var Pi=Error(c(460)),vf=Error(c(474)),wu=Error(c(542)),Tu={then:function(){}};function lp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ap(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Et,Et),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e;default:if(typeof t.status=="string")t.then(Et,Et);else{if(e=wt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=s}},function(s){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ip(e),e}throw pi=t,Pi}}function hi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(pi=n,Pi):n}}var pi=null;function sp(){if(pi===null)throw Error(c(459));var e=pi;return pi=null,e}function ip(e){if(e===Pi||e===wu)throw Error(c(483))}var er=null,sc=0;function Eu(e){var t=sc;return sc+=1,er===null&&(er=[]),ap(er,e,t)}function ic(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Au(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 rp(e){function t(U,R){if(e){var q=U.deletions;q===null?(U.deletions=[R],U.flags|=16):q.push(R)}}function n(U,R){if(!e)return null;for(;R!==null;)t(U,R),R=R.sibling;return null}function s(U){for(var R=new Map;U!==null;)U.key!==null?R.set(U.key,U):R.set(U.index,U),U=U.sibling;return R}function u(U,R){return U=Cl(U,R),U.index=0,U.sibling=null,U}function f(U,R,q){return U.index=q,e?(q=U.alternate,q!==null?(q=q.index,q<R?(U.flags|=67108866,R):q):(U.flags|=67108866,R)):(U.flags|=1048576,R)}function g(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function S(U,R,q,ne){return R===null||R.tag!==6?(R=ec(q,U.mode,ne),R.return=U,R):(R=u(R,q),R.return=U,R)}function A(U,R,q,ne){var Oe=q.type;return Oe===L?ee(U,R,q.props.children,ne,q.key):R!==null&&(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===F&&hi(Oe)===R.type)?(R=u(R,q.props),ic(R,q),R.return=U,R):(R=ci(q.type,q.key,q.props,null,U.mode,ne),ic(R,q),R.return=U,R)}function G(U,R,q,ne){return R===null||R.tag!==4||R.stateNode.containerInfo!==q.containerInfo||R.stateNode.implementation!==q.implementation?(R=$i(q,U.mode,ne),R.return=U,R):(R=u(R,q.children||[]),R.return=U,R)}function ee(U,R,q,ne,Oe){return R===null||R.tag!==7?(R=Ua(q,U.mode,ne,Oe),R.return=U,R):(R=u(R,q),R.return=U,R)}function se(U,R,q){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=ec(""+R,U.mode,q),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case C:return q=ci(R.type,R.key,R.props,null,U.mode,q),ic(q,R),q.return=U,q;case N:return R=$i(R,U.mode,q),R.return=U,R;case F:return R=hi(R),se(U,R,q)}if(ge(R)||ie(R))return R=Ua(R,U.mode,q,null),R.return=U,R;if(typeof R.then=="function")return se(U,Eu(R),q);if(R.$$typeof===I)return se(U,ku(U,R),q);Au(U,R)}return null}function Q(U,R,q,ne){var Oe=R!==null?R.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return Oe!==null?null:S(U,R,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case C:return q.key===Oe?A(U,R,q,ne):null;case N:return q.key===Oe?G(U,R,q,ne):null;case F:return q=hi(q),Q(U,R,q,ne)}if(ge(q)||ie(q))return Oe!==null?null:ee(U,R,q,ne,null);if(typeof q.then=="function")return Q(U,R,Eu(q),ne);if(q.$$typeof===I)return Q(U,R,ku(U,q),ne);Au(U,q)}return null}function J(U,R,q,ne,Oe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return U=U.get(q)||null,S(R,U,""+ne,Oe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case C:return U=U.get(ne.key===null?q:ne.key)||null,A(R,U,ne,Oe);case N:return U=U.get(ne.key===null?q:ne.key)||null,G(R,U,ne,Oe);case F:return ne=hi(ne),J(U,R,q,ne,Oe)}if(ge(ne)||ie(ne))return U=U.get(q)||null,ee(R,U,ne,Oe,null);if(typeof ne.then=="function")return J(U,R,q,Eu(ne),Oe);if(ne.$$typeof===I)return J(U,R,q,ku(R,ne),Oe);Au(R,ne)}return null}function ke(U,R,q,ne){for(var Oe=null,it=null,Ee=R,$e=R=0,tt=null;Ee!==null&&$e<q.length;$e++){Ee.index>$e?(tt=Ee,Ee=null):tt=Ee.sibling;var rt=Q(U,Ee,q[$e],ne);if(rt===null){Ee===null&&(Ee=tt);break}e&&Ee&&rt.alternate===null&&t(U,Ee),R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt,Ee=tt}if($e===q.length)return n(U,Ee),nt&&Ge(U,$e),Oe;if(Ee===null){for(;$e<q.length;$e++)Ee=se(U,q[$e],ne),Ee!==null&&(R=f(Ee,R,$e),it===null?Oe=Ee:it.sibling=Ee,it=Ee);return nt&&Ge(U,$e),Oe}for(Ee=s(Ee);$e<q.length;$e++)tt=J(Ee,U,$e,q[$e],ne),tt!==null&&(e&&tt.alternate!==null&&Ee.delete(tt.key===null?$e:tt.key),R=f(tt,R,$e),it===null?Oe=tt:it.sibling=tt,it=tt);return e&&Ee.forEach(function(Ds){return t(U,Ds)}),nt&&Ge(U,$e),Oe}function Ue(U,R,q,ne){if(q==null)throw Error(c(151));for(var Oe=null,it=null,Ee=R,$e=R=0,tt=null,rt=q.next();Ee!==null&&!rt.done;$e++,rt=q.next()){Ee.index>$e?(tt=Ee,Ee=null):tt=Ee.sibling;var Ds=Q(U,Ee,rt.value,ne);if(Ds===null){Ee===null&&(Ee=tt);break}e&&Ee&&Ds.alternate===null&&t(U,Ee),R=f(Ds,R,$e),it===null?Oe=Ds:it.sibling=Ds,it=Ds,Ee=tt}if(rt.done)return n(U,Ee),nt&&Ge(U,$e),Oe;if(Ee===null){for(;!rt.done;$e++,rt=q.next())rt=se(U,rt.value,ne),rt!==null&&(R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt);return nt&&Ge(U,$e),Oe}for(Ee=s(Ee);!rt.done;$e++,rt=q.next())rt=J(Ee,U,$e,rt.value,ne),rt!==null&&(e&&rt.alternate!==null&&Ee.delete(rt.key===null?$e:rt.key),R=f(rt,R,$e),it===null?Oe=rt:it.sibling=rt,it=rt);return e&&Ee.forEach(function(U_){return t(U,U_)}),nt&&Ge(U,$e),Oe}function kt(U,R,q,ne){if(typeof q=="object"&&q!==null&&q.type===L&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case C:e:{for(var Oe=q.key;R!==null;){if(R.key===Oe){if(Oe=q.type,Oe===L){if(R.tag===7){n(U,R.sibling),ne=u(R,q.props.children),ne.return=U,U=ne;break e}}else if(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===F&&hi(Oe)===R.type){n(U,R.sibling),ne=u(R,q.props),ic(ne,q),ne.return=U,U=ne;break e}n(U,R);break}else t(U,R);R=R.sibling}q.type===L?(ne=Ua(q.props.children,U.mode,ne,q.key),ne.return=U,U=ne):(ne=ci(q.type,q.key,q.props,null,U.mode,ne),ic(ne,q),ne.return=U,U=ne)}return g(U);case N:e:{for(Oe=q.key;R!==null;){if(R.key===Oe)if(R.tag===4&&R.stateNode.containerInfo===q.containerInfo&&R.stateNode.implementation===q.implementation){n(U,R.sibling),ne=u(R,q.children||[]),ne.return=U,U=ne;break e}else{n(U,R);break}else t(U,R);R=R.sibling}ne=$i(q,U.mode,ne),ne.return=U,U=ne}return g(U);case F:return q=hi(q),kt(U,R,q,ne)}if(ge(q))return ke(U,R,q,ne);if(ie(q)){if(Oe=ie(q),typeof Oe!="function")throw Error(c(150));return q=Oe.call(q),Ue(U,R,q,ne)}if(typeof q.then=="function")return kt(U,R,Eu(q),ne);if(q.$$typeof===I)return kt(U,R,ku(U,q),ne);Au(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,R!==null&&R.tag===6?(n(U,R.sibling),ne=u(R,q),ne.return=U,U=ne):(n(U,R),ne=ec(q,U.mode,ne),ne.return=U,U=ne),g(U)):n(U,R)}return function(U,R,q,ne){try{sc=0;var Oe=kt(U,R,q,ne);return er=null,Oe}catch(Ee){if(Ee===Pi||Ee===wu)throw Ee;var it=dn(29,Ee,null,U.mode);return it.lanes=ne,it.return=U,it}finally{}}}var mi=rp(!0),cp=rp(!1),bs=!1;function Sf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jf(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 xs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ys(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ot&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=ds(e),Su(e,null,n),t}return Vi(e,s,t,n),ds(e)}function rc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Vs(e,n)}}function kf(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var g={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=g:f=f.next=g,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Nf=!1;function cc(){if(Nf){var e=Wi;if(e!==null)throw e}}function uc(e,t,n,s){Nf=!1;var u=e.updateQueue;bs=!1;var f=u.firstBaseUpdate,g=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var A=S,G=A.next;A.next=null,g===null?f=G:g.next=G,g=A;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,S=ee.lastBaseUpdate,S!==g&&(S===null?ee.firstBaseUpdate=G:S.next=G,ee.lastBaseUpdate=A))}if(f!==null){var se=u.baseState;g=0,ee=G=A=null,S=f;do{var Q=S.lane&-536870913,J=Q!==S.lane;if(J?(et&Q)===Q:(s&Q)===Q){Q!==0&&Q===Fi&&(Nf=!0),ee!==null&&(ee=ee.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ke=e,Ue=S;Q=t;var kt=n;switch(Ue.tag){case 1:if(ke=Ue.payload,typeof ke=="function"){se=ke.call(kt,se,Q);break e}se=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ue.payload,Q=typeof ke=="function"?ke.call(kt,se,Q):ke,Q==null)break e;se=j({},se,Q);break e;case 2:bs=!0}}Q=S.callback,Q!==null&&(e.flags|=64,J&&(e.flags|=8192),J=u.callbacks,J===null?u.callbacks=[Q]:J.push(Q))}else J={lane:Q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ee===null?(G=ee=J,A=se):ee=ee.next=J,g|=Q;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;J=S,S=J.next,J.next=null,u.lastBaseUpdate=J,u.shared.pending=null}}while(!0);ee===null&&(A=se),u.baseState=A,u.firstBaseUpdate=G,u.lastBaseUpdate=ee,f===null&&(u.shared.lanes=0),ks|=g,e.lanes=g,e.memoizedState=se}}function up(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function op(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)up(n[e],t)}var tr=w(null),Cu=w(0);function fp(e,t){e=Za,oe(Cu,e),oe(tr,t),Za=e|t.baseLanes}function wf(){oe(Cu,Za),oe(tr,tr.current)}function Tf(){Za=Cu.current,K(tr),K(Cu)}var _l=w(null),Ml=null;function _s(e){var t=e.alternate;oe(an,an.current&1),oe(_l,e),Ml===null&&(t===null||tr.current!==null||t.memoizedState!==null)&&(Ml=e)}function Ef(e){oe(an,an.current),oe(_l,e),Ml===null&&(Ml=e)}function dp(e){e.tag===22?(oe(an,an.current),oe(_l,e),Ml===null&&(Ml=e)):vs()}function vs(){oe(an,an.current),oe(_l,_l.current)}function vl(e){K(_l),Ml===e&&(Ml=null),K(an)}var an=w(0);function Ru(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Dd(n)||zd(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 qa=0,Qe=null,St=null,mn=null,Mu=!1,nr=!1,gi=!1,Ou=0,oc=0,lr=null,Ty=0;function Zt(){throw Error(c(321))}function Af(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!el(e[n],t[n]))return!1;return!0}function Cf(e,t,n,s,u,f){return qa=f,Qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Kp:Xf,gi=!1,f=n(s,u),gi=!1,nr&&(f=pp(t,n,s,u)),hp(e),f}function hp(e){z.H=hc;var t=St!==null&&St.next!==null;if(qa=0,mn=St=Qe=null,Mu=!1,oc=0,lr=null,t)throw Error(c(300));e===null||gn||(e=e.dependencies,e!==null&&ju(e)&&(gn=!0))}function pp(e,t,n,s){Qe=e;var u=0;do{if(nr&&(lr=null),oc=0,nr=!1,25<=u)throw Error(c(301));if(u+=1,mn=St=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}z.H=Jp,f=t(n,s)}while(nr);return f}function Ey(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?fc(t):t,e=e.useState()[0],(St!==null?St.memoizedState:null)!==e&&(Qe.flags|=1024),t}function Rf(){var e=Ou!==0;return Ou=0,e}function Mf(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Of(e){if(Mu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Mu=!1}qa=0,mn=St=Qe=null,nr=!1,oc=Ou=0,lr=null}function nl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?Qe.memoizedState=mn=e:mn=mn.next=e,mn}function sn(){if(St===null){var e=Qe.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=mn===null?Qe.memoizedState:mn.next;if(t!==null)mn=t,St=e;else{if(e===null)throw Qe.alternate===null?Error(c(467)):Error(c(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},mn===null?Qe.memoizedState=mn=e:mn=mn.next=e}return mn}function Du(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fc(e){var t=oc;return oc+=1,lr===null&&(lr=[]),e=ap(lr,e,t),t=Qe,(mn===null?t.memoizedState:mn.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Kp:Xf),e}function zu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fc(e);if(e.$$typeof===I)return Ln(e)}throw Error(c(438,String(e)))}function Df(e){var t=null,n=Qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=Qe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Du(),Qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=de;return t.index++,n}function Ga(e,t){return typeof t=="function"?t(e):t}function Lu(e){var t=sn();return zf(t,St,e)}function zf(e,t,n){var s=e.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=n;var u=e.baseQueue,f=s.pending;if(f!==null){if(u!==null){var g=u.next;u.next=f.next,f.next=g}t.baseQueue=u=f,s.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=g=null,A=null,G=t,ee=!1;do{var se=G.lane&-536870913;if(se!==G.lane?(et&se)===se:(qa&se)===se){var Q=G.revertLane;if(Q===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),se===Fi&&(ee=!0);else if((qa&Q)===Q){G=G.next,Q===Fi&&(ee=!0);continue}else se={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},A===null?(S=A=se,g=f):A=A.next=se,Qe.lanes|=Q,ks|=Q;se=G.action,gi&&n(f,se),f=G.hasEagerState?G.eagerState:n(f,se)}else Q={lane:se,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},A===null?(S=A=Q,g=f):A=A.next=Q,Qe.lanes|=se,ks|=se;G=G.next}while(G!==null&&G!==t);if(A===null?g=f:A.next=S,!el(f,e.memoizedState)&&(gn=!0,ee&&(n=Wi,n!==null)))throw n;e.memoizedState=f,e.baseState=g,e.baseQueue=A,s.lastRenderedState=f}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Lf(e){var t=sn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var s=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var g=u=u.next;do f=e(f,g.action),g=g.next;while(g!==u);el(f,t.memoizedState)||(gn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,s]}function mp(e,t,n){var s=Qe,u=sn(),f=nt;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var g=!el((St||u).memoizedState,n);if(g&&(u.memoizedState=n,gn=!0),u=u.queue,Bf(xp.bind(null,s,u,e),[e]),u.getSnapshot!==t||g||mn!==null&&mn.memoizedState.tag&1){if(s.flags|=2048,ar(9,{destroy:void 0},bp.bind(null,s,u,n,t),null),wt===null)throw Error(c(349));f||(qa&127)!==0||gp(s,t,n)}return n}function gp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Qe.updateQueue,t===null?(t=Du(),Qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function bp(e,t,n,s){t.value=n,t.getSnapshot=s,yp(t)&&_p(e)}function xp(e,t,n){return n(function(){yp(t)&&_p(e)})}function yp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!el(e,n)}catch{return!0}}function _p(e){var t=ua(e,2);t!==null&&dl(t,e,2)}function Uf(e){var t=nl();if(typeof e=="function"){var n=e;if(e=n(),gi){we(!0);try{n()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:e},t}function vp(e,t,n,s){return e.baseState=n,zf(e,St,typeof s=="function"?s:Ga)}function Ay(e,t,n,s,u){if(Bu(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(g){f.listeners.push(g)}};z.T!==null?n(!0):f.isTransition=!1,s(f),n=t.pending,n===null?(f.next=t.pending=f,Sp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Sp(e,t){var n=t.action,s=t.payload,u=e.state;if(t.isTransition){var f=z.T,g={};z.T=g;try{var S=n(u,s),A=z.S;A!==null&&A(g,S),jp(e,t,S)}catch(G){Hf(e,t,G)}finally{f!==null&&g.types!==null&&(f.types=g.types),z.T=f}}else try{f=n(u,s),jp(e,t,f)}catch(G){Hf(e,t,G)}}function jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){kp(e,t,s)},function(s){return Hf(e,t,s)}):kp(e,t,n)}function kp(e,t,n){t.status="fulfilled",t.value=n,Np(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sp(e,n)))}function Hf(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Np(t),t=t.next;while(t!==s)}e.action=null}function Np(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function wp(e,t){return t}function Tp(e,t){if(nt){var n=wt.formState;if(n!==null){e:{var s=Qe;if(nt){if(Mt){t:{for(var u=Mt,f=Rl;u.nodeType!==8;){if(!f){u=null;break t}if(u=Ol(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Mt=Ol(u.nextSibling),s=u.data==="F!";break e}}ms(s)}s=!1}s&&(t=n[0])}}return n=nl(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wp,lastRenderedState:t},n.queue=s,n=Qp.bind(null,Qe,s),s.dispatch=n,s=Uf(!1),f=Vf.bind(null,Qe,!1,s.queue),s=nl(),u={state:t,dispatch:null,action:e,pending:null},s.queue=u,n=Ay.bind(null,Qe,u,f,n),u.dispatch=n,s.memoizedState=e,[t,n,!1]}function Ep(e){var t=sn();return Ap(t,St,e)}function Ap(e,t,n){if(t=zf(e,t,wp)[0],e=Lu(Ga)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=fc(t)}catch(g){throw g===Pi?wu:g}else s=t;t=sn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Qe.flags|=2048,ar(9,{destroy:void 0},Cy.bind(null,u,n),null)),[s,f,e]}function Cy(e,t){e.action=t}function Cp(e){var t=sn(),n=St;if(n!==null)return Ap(t,n,e);sn(),t=t.memoizedState,n=sn();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function ar(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=Qe.updateQueue,t===null&&(t=Du(),Qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Rp(){return sn().memoizedState}function Uu(e,t,n,s){var u=nl();Qe.flags|=e,u.memoizedState=ar(1|t,{destroy:void 0},n,s===void 0?null:s)}function Hu(e,t,n,s){var u=sn();s=s===void 0?null:s;var f=u.memoizedState.inst;St!==null&&s!==null&&Af(s,St.memoizedState.deps)?u.memoizedState=ar(t,f,n,s):(Qe.flags|=e,u.memoizedState=ar(1|t,f,n,s))}function Mp(e,t){Uu(8390656,8,e,t)}function Bf(e,t){Hu(2048,8,e,t)}function Ry(e){Qe.flags|=4;var t=Qe.updateQueue;if(t===null)t=Du(),Qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Op(e){var t=sn().memoizedState;return Ry({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Dp(e,t){return Hu(4,2,e,t)}function zp(e,t){return Hu(4,4,e,t)}function Lp(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 Up(e,t,n){n=n!=null?n.concat([e]):null,Hu(4,4,Lp.bind(null,t,e),n)}function qf(){}function Hp(e,t){var n=sn();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Af(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Bp(e,t){var n=sn();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Af(t,s[1]))return s[0];if(s=e(),gi){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[s,t],s}function Gf(e,t,n){return n===void 0||(qa&1073741824)!==0&&(et&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=qm(),Qe.lanes|=e,ks|=e,n)}function qp(e,t,n,s){return el(n,t)?n:tr.current!==null?(e=Gf(e,n,s),el(e,t)||(gn=!0),e):(qa&42)===0||(qa&1073741824)!==0&&(et&261930)===0?(gn=!0,e.memoizedState=n):(e=qm(),Qe.lanes|=e,ks|=e,t)}function Gp(e,t,n,s,u){var f=te.p;te.p=f!==0&&8>f?f:8;var g=z.T,S={};z.T=S,Vf(e,!1,t,n);try{var A=u(),G=z.S;if(G!==null&&G(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var ee=wy(A,s);dc(e,t,ee,kl(e))}else dc(e,t,s,kl(e))}catch(se){dc(e,t,{then:function(){},status:"rejected",reason:se},kl())}finally{te.p=f,g!==null&&S.types!==null&&(g.types=S.types),z.T=g}}function My(){}function If(e,t,n,s){if(e.tag!==5)throw Error(c(476));var u=Ip(e).queue;Gp(e,u,t,P,n===null?My:function(){return Yp(e),n(s)})}function Ip(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Yp(e){var t=Ip(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},kl())}function Yf(){return Ln(Ac)}function Vp(){return sn().memoizedState}function Xp(){return sn().memoizedState}function Oy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kl();e=xs(n);var s=ys(t,e,n);s!==null&&(dl(s,t,n),rc(s,t,n)),t={cache:xf()},e.payload=t;return}t=t.return}}function Dy(e,t,n){var s=kl();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bu(e)?$p(t,n):(n=La(e,t,n,s),n!==null&&(dl(n,e,s),Zp(n,t,s)))}function Qp(e,t,n){var s=kl();dc(e,t,n,s)}function dc(e,t,n,s){var u={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bu(e))$p(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,S=f(g,n);if(u.hasEagerState=!0,u.eagerState=S,el(S,g))return Vi(e,t,u,0),wt===null&&ii(),!1}catch{}finally{}if(n=La(e,t,u,s),n!==null)return dl(n,e,s),Zp(n,t,s),!0}return!1}function Vf(e,t,n,s){if(s={lane:2,revertLane:Sd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Bu(e)){if(t)throw Error(c(479))}else t=La(e,n,s,2),t!==null&&dl(t,e,2)}function Bu(e){var t=e.alternate;return e===Qe||t!==null&&t===Qe}function $p(e,t){nr=Mu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zp(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Vs(e,n)}}var hc={readContext:Ln,use:zu,useCallback:Zt,useContext:Zt,useEffect:Zt,useImperativeHandle:Zt,useLayoutEffect:Zt,useInsertionEffect:Zt,useMemo:Zt,useReducer:Zt,useRef:Zt,useState:Zt,useDebugValue:Zt,useDeferredValue:Zt,useTransition:Zt,useSyncExternalStore:Zt,useId:Zt,useHostTransitionStatus:Zt,useFormState:Zt,useActionState:Zt,useOptimistic:Zt,useMemoCache:Zt,useCacheRefresh:Zt};hc.useEffectEvent=Zt;var Kp={readContext:Ln,use:zu,useCallback:function(e,t){return nl().memoizedState=[e,t===void 0?null:t],e},useContext:Ln,useEffect:Mp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Uu(4194308,4,Lp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uu(4194308,4,e,t)},useInsertionEffect:function(e,t){Uu(4,2,e,t)},useMemo:function(e,t){var n=nl();t=t===void 0?null:t;var s=e();if(gi){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=nl();if(n!==void 0){var u=n(t);if(gi){we(!0);try{n(t)}finally{we(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=Dy.bind(null,Qe,e),[s.memoizedState,e]},useRef:function(e){var t=nl();return e={current:e},t.memoizedState=e},useState:function(e){e=Uf(e);var t=e.queue,n=Qp.bind(null,Qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qf,useDeferredValue:function(e,t){var n=nl();return Gf(n,e,t)},useTransition:function(){var e=Uf(!1);return e=Gp.bind(null,Qe,e.queue,!0,!1),nl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Qe,u=nl();if(nt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),wt===null)throw Error(c(349));(et&127)!==0||gp(s,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Mp(xp.bind(null,s,f,e),[e]),s.flags|=2048,ar(9,{destroy:void 0},bp.bind(null,s,f,n,t),null),n},useId:function(){var e=nl(),t=wt.identifierPrefix;if(nt){var n=ze,s=Te;n=(s&~(1<<32-Ce(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Ou++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ty++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Yf,useFormState:Tp,useActionState:Tp,useOptimistic:function(e){var t=nl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vf.bind(null,Qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Df,useCacheRefresh:function(){return nl().memoizedState=Oy.bind(null,Qe)},useEffectEvent:function(e){var t=nl(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Xf={readContext:Ln,use:zu,useCallback:Hp,useContext:Ln,useEffect:Bf,useImperativeHandle:Up,useInsertionEffect:Dp,useLayoutEffect:zp,useMemo:Bp,useReducer:Lu,useRef:Rp,useState:function(){return Lu(Ga)},useDebugValue:qf,useDeferredValue:function(e,t){var n=sn();return qp(n,St.memoizedState,e,t)},useTransition:function(){var e=Lu(Ga)[0],t=sn().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:mp,useId:Vp,useHostTransitionStatus:Yf,useFormState:Ep,useActionState:Ep,useOptimistic:function(e,t){var n=sn();return vp(n,St,e,t)},useMemoCache:Df,useCacheRefresh:Xp};Xf.useEffectEvent=Op;var Jp={readContext:Ln,use:zu,useCallback:Hp,useContext:Ln,useEffect:Bf,useImperativeHandle:Up,useInsertionEffect:Dp,useLayoutEffect:zp,useMemo:Bp,useReducer:Lf,useRef:Rp,useState:function(){return Lf(Ga)},useDebugValue:qf,useDeferredValue:function(e,t){var n=sn();return St===null?Gf(n,e,t):qp(n,St.memoizedState,e,t)},useTransition:function(){var e=Lf(Ga)[0],t=sn().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:mp,useId:Vp,useHostTransitionStatus:Yf,useFormState:Cp,useActionState:Cp,useOptimistic:function(e,t){var n=sn();return St!==null?vp(n,St,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Df,useCacheRefresh:Xp};Jp.useEffectEvent=Op;function Qf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $f={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=kl(),u=xs(s);u.payload=t,n!=null&&(u.callback=n),t=ys(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=kl(),u=xs(s);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=ys(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kl(),s=xs(n);s.tag=2,t!=null&&(s.callback=t),t=ys(e,s,n),t!==null&&(dl(t,e,n),rc(t,e,n))}};function Fp(e,t,n,s,u,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,g):t.prototype&&t.prototype.isPureReactComponent?!us(n,s)||!us(u,f):!0}function Wp(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&$f.enqueueReplaceState(t,t.state,null)}function bi(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}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 Pp(e){yl(e)}function em(e){console.error(e)}function tm(e){yl(e)}function qu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function nm(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Zf(e,t,n){return n=xs(n),n.tag=3,n.payload={element:null},n.callback=function(){qu(e,t)},n}function lm(e){return e=xs(e),e.tag=3,e}function am(e,t,n,s){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;e.payload=function(){return u(f)},e.callback=function(){nm(t,n,s)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){nm(t,n,s),typeof u!="function"&&(Ns===null?Ns=new Set([this]):Ns.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function zy(e,t,n,s,u){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Ji(t,n,u,!0),n=_l.current,n!==null){switch(n.tag){case 31:case 13:return Ml===null?Wu():n.alternate===null&&Kt===0&&(Kt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,s===Tu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),yd(e,s,u)),!1;case 22:return n.flags|=65536,s===Tu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),yd(e,s,u)),!1}throw Error(c(435,n.tag))}return yd(e,s,u),Wu(),!1}if(nt)return t=_l.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,s!==hf&&(e=Error(c(422),{cause:s}),nc(b(e,n)))):(s!==hf&&(t=Error(c(423),{cause:s}),nc(b(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=b(s,n),u=Zf(e.stateNode,s,u),kf(e,u),Kt!==4&&(Kt=2)),!1;var f=Error(c(520),{cause:s});if(f=b(f,n),vc===null?vc=[f]:vc.push(f),Kt!==4&&(Kt=2),t===null)return!0;s=b(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Zf(n.stateNode,s,e),kf(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"&&(Ns===null||!Ns.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=lm(u),am(u,e,n,s),kf(n,u),!1}n=n.return}while(n!==null);return!1}var Kf=Error(c(461)),gn=!1;function Un(e,t,n,s){t.child=e===null?cp(t,null,n,s):mi(t,e.child,n,s)}function sm(e,t,n,s,u){n=n.render;var f=t.ref;if("ref"in s){var g={};for(var S in s)S!=="ref"&&(g[S]=s[S])}else g=s;return fi(t),s=Cf(e,t,n,g,f,u),S=Rf(),e!==null&&!gn?(Mf(e,t,u),Ia(e,t,u)):(nt&&S&&hn(t),t.flags|=1,Un(e,t,s,u),t.child)}function im(e,t,n,s,u){if(e===null){var f=n.type;return typeof f=="function"&&!Xi(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,rm(e,t,f,s,u)):(e=ci(n.type,null,s,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!ld(e,u)){var g=f.memoizedProps;if(n=n.compare,n=n!==null?n:us,n(g,s)&&e.ref===t.ref)return Ia(e,t,u)}return t.flags|=1,e=Cl(f,s),e.ref=t.ref,e.return=t,t.child=e}function rm(e,t,n,s,u){if(e!==null){var f=e.memoizedProps;if(us(f,s)&&e.ref===t.ref)if(gn=!1,t.pendingProps=s=f,ld(e,u))(e.flags&131072)!==0&&(gn=!0);else return t.lanes=e.lanes,Ia(e,t,u)}return Jf(e,t,n,s,u)}function cm(e,t,n,s){var u=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(s=t.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~f}else s=0,t.child=null;return um(e,t,f,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Nu(t,f!==null?f.cachePool:null),f!==null?fp(t,f):wf(),dp(t);else return s=t.lanes=536870912,um(e,t,f!==null?f.baseLanes|n:n,n,s)}else f!==null?(Nu(t,f.cachePool),fp(t,f),vs(),t.memoizedState=null):(e!==null&&Nu(t,null),wf(),vs());return Un(e,t,u,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function um(e,t,n,s,u){var f=_f();return f=f===null?null:{parent:pn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Nu(t,null),wf(),dp(t),e!==null&&Ji(e,t,s,!0),t.childLanes=u,null}function Gu(e,t){return t=Yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function om(e,t,n){return mi(t,e.child,null,n),e=Gu(t,t.pendingProps),e.flags|=2,vl(t),t.memoizedState=null,e}function Ly(e,t,n){var s=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(nt){if(s.mode==="hidden")return e=Gu(t,s),t.lanes=536870912,pc(null,e);if(Ef(t),(e=Mt)?(e=Sg(e,Rl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:Te,overflow:ze}:null,retryLane:536870912,hydrationErrors:null},n=Qi(e),n.return=t,t.child=n,zn=t,Mt=null)):e=null,e===null)throw ms(t);return t.lanes=536870912,null}return Gu(t,s)}var f=e.memoizedState;if(f!==null){var g=f.dehydrated;if(Ef(t),u)if(t.flags&256)t.flags&=-257,t=om(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(gn||Ji(e,t,n,!1),u=(n&e.childLanes)!==0,gn||u){if(s=wt,s!==null&&(g=Hl(s,n),g!==0&&g!==f.retryLane))throw f.retryLane=g,ua(e,g),dl(s,e,g),Kf;Wu(),t=om(e,t,n)}else e=f.treeContext,Mt=Ol(g.nextSibling),zn=t,nt=!0,ps=null,Rl=!1,e!==null&&Zi(t,e),t=Gu(t,s),t.flags|=4096;return t}return e=Cl(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Iu(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 Jf(e,t,n,s,u){return fi(t),n=Cf(e,t,n,s,void 0,u),s=Rf(),e!==null&&!gn?(Mf(e,t,u),Ia(e,t,u)):(nt&&s&&hn(t),t.flags|=1,Un(e,t,n,u),t.child)}function fm(e,t,n,s,u,f){return fi(t),t.updateQueue=null,n=pp(t,s,n,u),hp(e),s=Rf(),e!==null&&!gn?(Mf(e,t,f),Ia(e,t,f)):(nt&&s&&hn(t),t.flags|=1,Un(e,t,n,f),t.child)}function dm(e,t,n,s,u){if(fi(t),t.stateNode===null){var f=hs,g=n.contextType;typeof g=="object"&&g!==null&&(f=Ln(g)),f=new n(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=$f,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},Sf(t),g=n.contextType,f.context=typeof g=="object"&&g!==null?Ln(g):hs,f.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(Qf(t,n,g,s),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&$f.enqueueReplaceState(f,f.state,null),uc(t,s,f,u),cc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,A=bi(n,S);f.props=A;var G=f.context,ee=n.contextType;g=hs,typeof ee=="object"&&ee!==null&&(g=Ln(ee));var se=n.getDerivedStateFromProps;ee=typeof se=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ee||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||G!==g)&&Wp(t,f,s,g),bs=!1;var Q=t.memoizedState;f.state=Q,uc(t,s,f,u),cc(),G=t.memoizedState,S||Q!==G||bs?(typeof se=="function"&&(Qf(t,n,se,s),G=t.memoizedState),(A=bs||Fp(t,n,A,s,Q,G,g))?(ee||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=s,t.memoizedState=G),f.props=s,f.state=G,f.context=g,s=A):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,jf(e,t),g=t.memoizedProps,ee=bi(n,g),f.props=ee,se=t.pendingProps,Q=f.context,G=n.contextType,A=hs,typeof G=="object"&&G!==null&&(A=Ln(G)),S=n.getDerivedStateFromProps,(G=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==se||Q!==A)&&Wp(t,f,s,A),bs=!1,Q=t.memoizedState,f.state=Q,uc(t,s,f,u),cc();var J=t.memoizedState;g!==se||Q!==J||bs||e!==null&&e.dependencies!==null&&ju(e.dependencies)?(typeof S=="function"&&(Qf(t,n,S,s),J=t.memoizedState),(ee=bs||Fp(t,n,ee,s,Q,J,A)||e!==null&&e.dependencies!==null&&ju(e.dependencies))?(G||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,J,A),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,J,A)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=J),f.props=s,f.state=J,f.context=A,s=ee):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,Iu(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=mi(t,e.child,null,u),t.child=mi(t,null,n,u)):Un(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ia(e,t,u),e}function hm(e,t,n,s){return ui(),t.flags|=256,Un(e,t,n,s),t.child}var Ff={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wf(e){return{baseLanes:e,cachePool:np()}}function Pf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=jl),e}function pm(e,t,n){var s=t.pendingProps,u=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(an.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(nt){if(u?_s(t):vs(),(e=Mt)?(e=Sg(e,Rl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:rl!==null?{id:Te,overflow:ze}:null,retryLane:536870912,hydrationErrors:null},n=Qi(e),n.return=t,t.child=n,zn=t,Mt=null)):e=null,e===null)throw ms(t);return zd(e)?t.lanes=32:t.lanes=536870912,null}var S=s.children;return s=s.fallback,u?(vs(),u=t.mode,S=Yu({mode:"hidden",children:S},u),s=Ua(s,u,n,null),S.return=t,s.return=t,S.sibling=s,t.child=S,s=t.child,s.memoizedState=Wf(n),s.childLanes=Pf(e,g,n),t.memoizedState=Ff,pc(null,s)):(_s(t),ed(t,S))}var A=e.memoizedState;if(A!==null&&(S=A.dehydrated,S!==null)){if(f)t.flags&256?(_s(t),t.flags&=-257,t=td(e,t,n)):t.memoizedState!==null?(vs(),t.child=e.child,t.flags|=128,t=null):(vs(),S=s.fallback,u=t.mode,s=Yu({mode:"visible",children:s.children},u),S=Ua(S,u,n,null),S.flags|=2,s.return=t,S.return=t,s.sibling=S,t.child=s,mi(t,e.child,null,n),s=t.child,s.memoizedState=Wf(n),s.childLanes=Pf(e,g,n),t.memoizedState=Ff,t=pc(null,s));else if(_s(t),zd(S)){if(g=S.nextSibling&&S.nextSibling.dataset,g)var G=g.dgst;g=G,s=Error(c(419)),s.stack="",s.digest=g,nc({value:s,source:null,stack:null}),t=td(e,t,n)}else if(gn||Ji(e,t,n,!1),g=(n&e.childLanes)!==0,gn||g){if(g=wt,g!==null&&(s=Hl(g,n),s!==0&&s!==A.retryLane))throw A.retryLane=s,ua(e,s),dl(g,e,s),Kf;Dd(S)||Wu(),t=td(e,t,n)}else Dd(S)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,Mt=Ol(S.nextSibling),zn=t,nt=!0,ps=null,Rl=!1,e!==null&&Zi(t,e),t=ed(t,s.children),t.flags|=4096);return t}return u?(vs(),S=s.fallback,u=t.mode,A=e.child,G=A.sibling,s=Cl(A,{mode:"hidden",children:s.children}),s.subtreeFlags=A.subtreeFlags&65011712,G!==null?S=Cl(G,S):(S=Ua(S,u,n,null),S.flags|=2),S.return=t,s.return=t,s.sibling=S,t.child=s,pc(null,s),s=t.child,S=e.child.memoizedState,S===null?S=Wf(n):(u=S.cachePool,u!==null?(A=pn._currentValue,u=u.parent!==A?{parent:A,pool:A}:u):u=np(),S={baseLanes:S.baseLanes|n,cachePool:u}),s.memoizedState=S,s.childLanes=Pf(e,g,n),t.memoizedState=Ff,pc(e.child,s)):(_s(t),n=e.child,e=n.sibling,n=Cl(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=n,t.memoizedState=null,n)}function ed(e,t){return t=Yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yu(e,t){return e=dn(22,e,null,t),e.lanes=0,e}function td(e,t,n){return mi(t,e.child,null,n),e=ed(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),gf(e.return,t,n)}function nd(e,t,n,s,u,f){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:u,treeForkCount:f}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=s,g.tail=n,g.tailMode=u,g.treeForkCount=f)}function gm(e,t,n){var s=t.pendingProps,u=s.revealOrder,f=s.tail;s=s.children;var g=an.current,S=(g&2)!==0;if(S?(g=g&1|2,t.flags|=128):g&=1,oe(an,g),Un(e,t,s,n),s=nt?At:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mm(e,n,t);else if(e.tag===19)mm(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&&Ru(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),nd(t,!1,u,n,f,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ru(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}nd(t,!0,n,null,f,s);break;case"together":nd(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ia(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ks|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(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=Cl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ld(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ju(e)))}function Uy(e,t,n){switch(t.tag){case 3:st(t,t.stateNode.containerInfo),gs(t,pn,e.memoizedState.cache),ui();break;case 27:case 5:Ut(t);break;case 4:st(t,t.stateNode.containerInfo);break;case 10:gs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ef(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(_s(t),t.flags|=128,null):(n&t.child.childLanes)!==0?pm(e,t,n):(_s(t),e=Ia(e,t,n),e!==null?e.sibling:null);_s(t);break;case 19:var u=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Ji(e,t,n,!1),s=(n&t.childLanes)!==0),u){if(s)return gm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),oe(an,an.current),s)break;return null;case 22:return t.lanes=0,cm(e,t,n,t.pendingProps);case 24:gs(t,pn,e.memoizedState.cache)}return Ia(e,t,n)}function bm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)gn=!0;else{if(!ld(e,n)&&(t.flags&128)===0)return gn=!1,Uy(e,t,n);gn=(e.flags&131072)!==0}else gn=!1,nt&&(t.flags&1048576)!==0&&Rt(t,At,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=hi(t.elementType),t.type=e,typeof e=="function")Xi(e)?(s=bi(e,s),t.tag=1,t=dm(null,t,e,s,n)):(t.tag=0,t=Jf(null,t,e,s,n));else{if(e!=null){var u=e.$$typeof;if(u===E){t.tag=11,t=sm(null,t,e,s,n);break e}else if(u===D){t.tag=14,t=im(null,t,e,s,n);break e}}throw t=je(e)||e,Error(c(306,t,""))}}return t;case 0:return Jf(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,u=bi(s,t.pendingProps),dm(e,t,s,u,n);case 3:e:{if(st(t,t.stateNode.containerInfo),e===null)throw Error(c(387));s=t.pendingProps;var f=t.memoizedState;u=f.element,jf(e,t),uc(t,s,null,n);var g=t.memoizedState;if(s=g.cache,gs(t,pn,s),s!==f.cache&&bf(t,[pn],n,!0),cc(),s=g.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=hm(e,t,s,n);break e}else if(s!==u){u=b(Error(c(424)),t),nc(u),t=hm(e,t,s,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(Mt=Ol(e.firstChild),zn=t,nt=!0,ps=null,Rl=!0,n=cp(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ui(),s===u){t=Ia(e,t,n);break e}Un(e,t,s,n)}t=t.child}return t;case 26:return Iu(e,t),e===null?(n=Eg(t.type,null,t.pendingProps,null))?t.memoizedState=n:nt||(n=t.type,e=t.pendingProps,s=so(Ae.current).createElement(n),s[$t]=t,s[Je]=e,Hn(s,n,e),ut(s),t.stateNode=s):t.memoizedState=Eg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ut(t),e===null&&nt&&(s=t.stateNode=Ng(t.type,t.pendingProps,Ae.current),zn=t,Rl=!0,u=Mt,As(t.type)?(Ld=u,Mt=Ol(s.firstChild)):Mt=u),Un(e,t,t.pendingProps.children,n),Iu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&nt&&((u=s=Mt)&&(s=h_(s,t.type,t.pendingProps,Rl),s!==null?(t.stateNode=s,zn=t,Mt=Ol(s.firstChild),Rl=!1,u=!0):u=!1),u||ms(t)),Ut(t),u=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,s=f.children,Rd(u,f)?s=null:g!==null&&Rd(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=Cf(e,t,Ey,null,null,n),Ac._currentValue=u),Iu(e,t),Un(e,t,s,n),t.child;case 6:return e===null&&nt&&((e=n=Mt)&&(n=p_(n,t.pendingProps,Rl),n!==null?(t.stateNode=n,zn=t,Mt=null,e=!0):e=!1),e||ms(t)),null;case 13:return pm(e,t,n);case 4:return st(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=mi(t,null,s,n):Un(e,t,s,n),t.child;case 11:return sm(e,t,t.type,t.pendingProps,n);case 7:return Un(e,t,t.pendingProps,n),t.child;case 8:return Un(e,t,t.pendingProps.children,n),t.child;case 12:return Un(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,gs(t,t.type,s.value),Un(e,t,s.children,n),t.child;case 9:return u=t.type._context,s=t.pendingProps.children,fi(t),u=Ln(u),s=s(u),t.flags|=1,Un(e,t,s,n),t.child;case 14:return im(e,t,t.type,t.pendingProps,n);case 15:return rm(e,t,t.type,t.pendingProps,n);case 19:return gm(e,t,n);case 31:return Ly(e,t,n);case 22:return cm(e,t,n,t.pendingProps);case 24:return fi(t),s=Ln(pn),e===null?(u=_f(),u===null&&(u=wt,f=xf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:s,cache:u},Sf(t),gs(t,pn,u)):((e.lanes&n)!==0&&(jf(e,t),uc(t,null,null,n),cc()),u=e.memoizedState,f=t.memoizedState,u.parent!==s?(u={parent:s,cache:s},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),gs(t,pn,s)):(s=f.cache,gs(t,pn,s),s!==u.cache&&bf(t,[pn],n,!0))),Un(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ya(e){e.flags|=4}function ad(e,t,n,s,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(Vm())e.flags|=8192;else throw pi=Tu,vf}else e.flags&=-16777217}function xm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Og(t))if(Vm())e.flags|=8192;else throw pi=Tu,vf}function Vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vn():536870912,e.lanes|=t,cr|=t)}function mc(e,t){if(!nt)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Hy(e,t,n){var s=t.pendingProps;switch(Yl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ot(t),null;case 1:return Ot(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ba(pn),Ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,pf())),Ot(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ya(t),f!==null?(Ot(t),xm(t,f)):(Ot(t),ad(t,u,null,s,n))):f?f!==e.memoizedState?(Ya(t),Ot(t),xm(t,f)):(Ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ya(t),Ot(t),ad(t,u,e,s,n)),null;case 27:if(Le(t),n=Ae.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Ot(t),null}e=he.current,Ki(t)?Fh(t):(e=Ng(u,s,n),t.stateNode=e,Ya(t))}return Ot(t),null;case 5:if(Le(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return Ot(t),null}if(f=he.current,Ki(t))Fh(t);else{var g=so(Ae.current);switch(f){case 1:f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=g.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?g.createElement("select",{is:s.is}):g.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?g.createElement(u,{is:s.is}):g.createElement(u)}}f[$t]=t,f[Je]=s;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)f.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=f;e:switch(Hn(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ya(t)}}return Ot(t),ad(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ae.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,u=zn,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[$t]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||pg(e.nodeValue,n)),e||ms(t,!0)}else e=so(e).createTextNode(s),e[$t]=t,t.stateNode=e}return Ot(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ki(t),n!==null){if(e===null){if(!s)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[$t]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ot(t),e=!1}else n=pf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(vl(t),t):(vl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ot(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ki(t),s!==null&&s.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[$t]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ot(t),u=!1}else u=pf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(vl(t),t):(vl(t),null)}return vl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vu(t,t.updateQueue),Ot(t),null);case 4:return Ze(),e===null&&wd(t.stateNode.containerInfo),Ot(t),null;case 10:return Ba(t.type),Ot(t),null;case 19:if(K(an),s=t.memoizedState,s===null)return Ot(t),null;if(u=(t.flags&128)!==0,f=s.rendering,f===null)if(u)mc(s,!1);else{if(Kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Ru(e),f!==null){for(t.flags|=128,mc(s,!1),e=f.updateQueue,t.updateQueue=e,Vu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Pr(n,e),n=n.sibling;return oe(an,an.current&1|2),nt&&Ge(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ct()>Ku&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304)}else{if(!u)if(e=Ru(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Vu(t,e),mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!nt)return Ot(t),null}else 2*ct()-s.renderingStartTime>Ku&&n!==536870912&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ct(),e.sibling=null,n=an.current,oe(an,u?n&1|2:n&1),nt&&Ge(t,s.treeForkCount),e):(Ot(t),null);case 22:case 23:return vl(t),Tf(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(Ot(t),t.subtreeFlags&6&&(t.flags|=8192)):Ot(t),n=t.updateQueue,n!==null&&Vu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&K(di),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ba(pn),Ot(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function By(e,t){switch(Yl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ba(pn),Ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Le(t),null;case 31:if(t.memoizedState!==null){if(vl(t),t.alternate===null)throw Error(c(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(vl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(an),null;case 4:return Ze(),null;case 10:return Ba(t.type),null;case 22:case 23:return vl(t),Tf(),e!==null&&K(di),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ba(pn),null;case 25:return null;default:return null}}function ym(e,t){switch(Yl(t),t.tag){case 3:Ba(pn),Ze();break;case 26:case 27:case 5:Le(t);break;case 4:Ze();break;case 31:t.memoizedState!==null&&vl(t);break;case 13:vl(t);break;case 19:K(an);break;case 10:Ba(t.type);break;case 22:case 23:vl(t),Tf(),e!==null&&K(di);break;case 24:Ba(pn)}}function gc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var u=s.next;n=u;do{if((n.tag&e)===e){s=void 0;var f=n.create,g=n.inst;s=f(),g.destroy=s}n=n.next}while(n!==u)}}catch(S){_t(t,t.return,S)}}function Ss(e,t,n){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){var g=s.inst,S=g.destroy;if(S!==void 0){g.destroy=void 0,u=t;var A=n,G=S;try{G()}catch(ee){_t(u,A,ee)}}}s=s.next}while(s!==f)}}catch(ee){_t(t,t.return,ee)}}function _m(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{op(t,n)}catch(s){_t(e,e.return,s)}}}function vm(e,t,n){n.props=bi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){_t(e,t,s)}}function bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(u){_t(e,t,u)}}function oa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(u){_t(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){_t(e,t,u)}else n.current=null}function Sm(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(u){_t(e,e.return,u)}}function sd(e,t,n){try{var s=e.stateNode;r_(s,e.type,n,t),s[Je]=t}catch(u){_t(e,e.return,u)}}function jm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&As(e.type)||e.tag===4}function id(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||jm(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&&As(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 rd(e,t,n){var s=e.tag;if(s===5||s===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=Et));else if(s!==4&&(s===27&&As(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rd(e,t,n),e=e.sibling;e!==null;)rd(e,t,n),e=e.sibling}function Xu(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&As(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xu(e,t,n),e=e.sibling;e!==null;)Xu(e,t,n),e=e.sibling}function km(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Hn(t,s,n),t[$t]=e,t[Je]=n}catch(f){_t(e,e.return,f)}}var Va=!1,bn=!1,cd=!1,Nm=typeof WeakSet=="function"?WeakSet:Set,En=null;function qy(e,t){if(e=e.containerInfo,Ad=ho,e=mu(e),li(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var g=0,S=-1,A=-1,G=0,ee=0,se=e,Q=null;t:for(;;){for(var J;se!==n||u!==0&&se.nodeType!==3||(S=g+u),se!==f||s!==0&&se.nodeType!==3||(A=g+s),se.nodeType===3&&(g+=se.nodeValue.length),(J=se.firstChild)!==null;)Q=se,se=J;for(;;){if(se===e)break t;if(Q===n&&++G===u&&(S=g),Q===f&&++ee===s&&(A=g),(J=se.nextSibling)!==null)break;se=Q,Q=se.parentNode}se=J}n=S===-1||A===-1?null:{start:S,end:A}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cd={focusedElem:e,selectionRange:n},ho=!1,En=t;En!==null;)if(t=En,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,En=e;else for(;En!==null;){switch(t=En,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,s=n.stateNode;try{var ke=bi(n.type,u);e=s.getSnapshotBeforeUpdate(ke,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ue){_t(n,n.return,Ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Od(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Od(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,En=e;break}En=t.return}}function wm(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:Qa(e,n),s&4&&gc(5,n);break;case 1:if(Qa(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){_t(n,n.return,g)}else{var u=bi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){_t(n,n.return,g)}}s&64&&_m(n),s&512&&bc(n,n.return);break;case 3:if(Qa(e,n),s&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{op(e,t)}catch(g){_t(n,n.return,g)}}break;case 27:t===null&&s&4&&km(n);case 26:case 5:Qa(e,n),t===null&&s&4&&Sm(n),s&512&&bc(n,n.return);break;case 12:Qa(e,n);break;case 31:Qa(e,n),s&4&&Am(e,n);break;case 13:Qa(e,n),s&4&&Cm(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ky.bind(null,n),m_(e,n))));break;case 22:if(s=n.memoizedState!==null||Va,!s){t=t!==null&&t.memoizedState!==null||bn,u=Va;var f=bn;Va=s,(bn=t)&&!f?$a(e,n,(n.subtreeFlags&8772)!==0):Qa(e,n),Va=u,bn=f}break;case 30:break;default:Qa(e,n)}}function Tm(e){var t=e.alternate;t!==null&&(e.alternate=null,Tm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Na(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 Gt=null,cl=!1;function Xa(e,t,n){for(n=n.child;n!==null;)Em(e,t,n),n=n.sibling}function Em(e,t,n){if(ue&&typeof ue.onCommitFiberUnmount=="function")try{ue.onCommitFiberUnmount(Z,n)}catch{}switch(n.tag){case 26:bn||oa(n,t),Xa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:bn||oa(n,t);var s=Gt,u=cl;As(n.type)&&(Gt=n.stateNode,cl=!1),Xa(e,t,n),wc(n.stateNode),Gt=s,cl=u;break;case 5:bn||oa(n,t);case 6:if(s=Gt,u=cl,Gt=null,Xa(e,t,n),Gt=s,cl=u,Gt!==null)if(cl)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(n.stateNode)}catch(f){_t(n,t,f)}else try{Gt.removeChild(n.stateNode)}catch(f){_t(n,t,f)}break;case 18:Gt!==null&&(cl?(e=Gt,_g(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),gr(e)):_g(Gt,n.stateNode));break;case 4:s=Gt,u=cl,Gt=n.stateNode.containerInfo,cl=!0,Xa(e,t,n),Gt=s,cl=u;break;case 0:case 11:case 14:case 15:Ss(2,n,t),bn||Ss(4,n,t),Xa(e,t,n);break;case 1:bn||(oa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&vm(n,t,s)),Xa(e,t,n);break;case 21:Xa(e,t,n);break;case 22:bn=(s=bn)||n.memoizedState!==null,Xa(e,t,n),bn=s;break;default:Xa(e,t,n)}}function Am(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gr(e)}catch(n){_t(t,t.return,n)}}}function Cm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gr(e)}catch(n){_t(t,t.return,n)}}function Gy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Nm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Nm),t;default:throw Error(c(435,e.tag))}}function Qu(e,t){var n=Gy(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var u=Jy.bind(null,e,s);s.then(u,u)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var u=n[s],f=e,g=t,S=g;e:for(;S!==null;){switch(S.tag){case 27:if(As(S.type)){Gt=S.stateNode,cl=!1;break e}break;case 5:Gt=S.stateNode,cl=!1;break e;case 3:case 4:Gt=S.stateNode.containerInfo,cl=!0;break e}S=S.return}if(Gt===null)throw Error(c(160));Em(f,g,u),Gt=null,cl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Rm(t,e),t=t.sibling}var Vl=null;function Rm(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),ol(e),s&4&&(Ss(3,e,e.return),gc(3,e),Ss(5,e,e.return));break;case 1:ul(t,e),ol(e),s&512&&(bn||n===null||oa(n,n.return)),s&64&&Va&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var u=Vl;if(ul(t,e),ol(e),s&512&&(bn||n===null||oa(n,n.return)),s&4){var f=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Wl]||f[$t]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(s),u.head.insertBefore(f,u.querySelector("head > title"))),Hn(f,s,n),f[$t]=e,ut(f),s=f;break e;case"link":var g=Rg("link","href",u).get(s+(n.href||""));if(g){for(var S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;case"meta":if(g=Rg("meta","content",u).get(s+(n.content||""))){for(S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),Hn(f,s,n),u.head.appendChild(f);break;default:throw Error(c(468,s))}f[$t]=e,ut(f),s=f}e.stateNode=s}else Mg(u,e.type,e.stateNode);else e.stateNode=Cg(u,s,e.memoizedProps);else f!==s?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,s===null?Mg(u,e.type,e.stateNode):Cg(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&sd(e,e.memoizedProps,n.memoizedProps)}break;case 27:ul(t,e),ol(e),s&512&&(bn||n===null||oa(n,n.return)),n!==null&&s&4&&sd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),ol(e),s&512&&(bn||n===null||oa(n,n.return)),e.flags&32){u=e.stateNode;try{B(u,"")}catch(ke){_t(e,e.return,ke)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,sd(e,u,n!==null?n.memoizedProps:u)),s&1024&&(cd=!0);break;case 6:if(ul(t,e),ol(e),s&4){if(e.stateNode===null)throw Error(c(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(ke){_t(e,e.return,ke)}}break;case 3:if(co=null,u=Vl,Vl=io(t.containerInfo),ul(t,e),Vl=u,ol(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{gr(t.containerInfo)}catch(ke){_t(e,e.return,ke)}cd&&(cd=!1,Mm(e));break;case 4:s=Vl,Vl=io(e.stateNode.containerInfo),ul(t,e),ol(e),Vl=s;break;case 12:ul(t,e),ol(e);break;case 31:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 13:ul(t,e),ol(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zu=ct()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 22:u=e.memoizedState!==null;var A=n!==null&&n.memoizedState!==null,G=Va,ee=bn;if(Va=G||u,bn=ee||A,ul(t,e),bn=ee,Va=G,ol(e),s&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||A||Va||bn||xi(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){A=n=t;try{if(f=A.stateNode,u)g=f.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{S=A.stateNode;var se=A.memoizedProps.style,Q=se!=null&&se.hasOwnProperty("display")?se.display:null;S.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(ke){_t(A,A.return,ke)}}}else if(t.tag===6){if(n===null){A=t;try{A.stateNode.nodeValue=u?"":A.memoizedProps}catch(ke){_t(A,A.return,ke)}}}else if(t.tag===18){if(n===null){A=t;try{var J=A.stateNode;u?vg(J,!0):vg(A.stateNode,!1)}catch(ke){_t(A,A.return,ke)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Qu(e,n))));break;case 19:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 30:break;case 21:break;default:ul(t,e),ol(e)}}function ol(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(jm(s)){n=s;break}s=s.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=id(e);Xu(e,f,u);break;case 5:var g=n.stateNode;n.flags&32&&(B(g,""),n.flags&=-33);var S=id(e);Xu(e,S,g);break;case 3:case 4:var A=n.stateNode.containerInfo,G=id(e);rd(e,G,A);break;default:throw Error(c(161))}}catch(ee){_t(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Qa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wm(e,t.alternate,t),t=t.sibling}function xi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ss(4,t,t.return),xi(t);break;case 1:oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vm(t,t.return,n),xi(t);break;case 27:wc(t.stateNode);case 26:case 5:oa(t,t.return),xi(t);break;case 22:t.memoizedState===null&&xi(t);break;case 30:xi(t);break;default:xi(t)}e=e.sibling}}function $a(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,u=e,f=t,g=f.flags;switch(f.tag){case 0:case 11:case 15:$a(u,f,n),gc(4,f);break;case 1:if($a(u,f,n),s=f,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(G){_t(s,s.return,G)}if(s=f,u=s.updateQueue,u!==null){var S=s.stateNode;try{var A=u.shared.hiddenCallbacks;if(A!==null)for(u.shared.hiddenCallbacks=null,u=0;u<A.length;u++)up(A[u],S)}catch(G){_t(s,s.return,G)}}n&&g&64&&_m(f),bc(f,f.return);break;case 27:km(f);case 26:case 5:$a(u,f,n),n&&s===null&&g&4&&Sm(f),bc(f,f.return);break;case 12:$a(u,f,n);break;case 31:$a(u,f,n),n&&g&4&&Am(u,f);break;case 13:$a(u,f,n),n&&g&4&&Cm(u,f);break;case 22:f.memoizedState===null&&$a(u,f,n),bc(f,f.return);break;case 30:break;default:$a(u,f,n)}t=t.sibling}}function ud(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&&lc(n))}function od(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e))}function Xl(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Om(e,t,n,s),t=t.sibling}function Om(e,t,n,s){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,n,s),u&2048&&gc(9,t);break;case 1:Xl(e,t,n,s);break;case 3:Xl(e,t,n,s),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e)));break;case 12:if(u&2048){Xl(e,t,n,s),e=t.stateNode;try{var f=t.memoizedProps,g=f.id,S=f.onPostCommit;typeof S=="function"&&S(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(A){_t(t,t.return,A)}}else Xl(e,t,n,s);break;case 31:Xl(e,t,n,s);break;case 13:Xl(e,t,n,s);break;case 23:break;case 22:f=t.stateNode,g=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,n,s):xc(e,t):f._visibility&2?Xl(e,t,n,s):(f._visibility|=2,sr(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),u&2048&&ud(g,t);break;case 24:Xl(e,t,n,s),u&2048&&od(t.alternate,t);break;default:Xl(e,t,n,s)}}function sr(e,t,n,s,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,g=t,S=n,A=s,G=g.flags;switch(g.tag){case 0:case 11:case 15:sr(f,g,S,A,u),gc(8,g);break;case 23:break;case 22:var ee=g.stateNode;g.memoizedState!==null?ee._visibility&2?sr(f,g,S,A,u):xc(f,g):(ee._visibility|=2,sr(f,g,S,A,u)),u&&G&2048&&ud(g.alternate,g);break;case 24:sr(f,g,S,A,u),u&&G&2048&&od(g.alternate,g);break;default:sr(f,g,S,A,u)}t=t.sibling}}function xc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,u=s.flags;switch(s.tag){case 22:xc(n,s),u&2048&&ud(s.alternate,s);break;case 24:xc(n,s),u&2048&&od(s.alternate,s);break;default:xc(n,s)}t=t.sibling}}var yc=8192;function ir(e,t,n){if(e.subtreeFlags&yc)for(e=e.child;e!==null;)Dm(e,t,n),e=e.sibling}function Dm(e,t,n){switch(e.tag){case 26:ir(e,t,n),e.flags&yc&&e.memoizedState!==null&&T_(n,Vl,e.memoizedState,e.memoizedProps);break;case 5:ir(e,t,n);break;case 3:case 4:var s=Vl;Vl=io(e.stateNode.containerInfo),ir(e,t,n),Vl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=yc,yc=16777216,ir(e,t,n),yc=s):ir(e,t,n));break;default:ir(e,t,n)}}function zm(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 _c(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];En=s,Um(s,e)}zm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lm(e),e=e.sibling}function Lm(e){switch(e.tag){case 0:case 11:case 15:_c(e),e.flags&2048&&Ss(9,e,e.return);break;case 3:_c(e);break;case 12:_c(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):_c(e);break;default:_c(e)}}function $u(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];En=s,Um(s,e)}zm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ss(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function Um(e,t){for(;En!==null;){var n=En;switch(n.tag){case 0:case 11:case 15:Ss(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:lc(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,En=s;else e:for(n=e;En!==null;){s=En;var u=s.sibling,f=s.return;if(Tm(s),s===n){En=null;break e}if(u!==null){u.return=f,En=u;break e}En=f}}}var Iy={getCacheForType:function(e){var t=Ln(pn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ln(pn).controller.signal}},Yy=typeof WeakMap=="function"?WeakMap:Map,ot=0,wt=null,We=null,et=0,yt=0,Sl=null,js=!1,rr=!1,fd=!1,Za=0,Kt=0,ks=0,yi=0,dd=0,jl=0,cr=0,vc=null,fl=null,hd=!1,Zu=0,Hm=0,Ku=1/0,Ju=null,Ns=null,Sn=0,ws=null,ur=null,Ka=0,pd=0,md=null,Bm=null,Sc=0,gd=null;function kl(){return(ot&2)!==0&&et!==0?et&-et:z.T!==null?Sd():ka()}function qm(){if(jl===0)if((et&536870912)===0||nt){var e=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),jl=e}else jl=536870912;return e=_l.current,e!==null&&(e.flags|=32),jl}function dl(e,t,n){(e===wt&&(yt===2||yt===9)||e.cancelPendingCommit!==null)&&(or(e,0),Ts(e,et,jl,!1)),Tl(e,n),((ot&2)===0||e!==wt)&&(e===wt&&((ot&2)===0&&(yi|=n),Kt===4&&Ts(e,et,jl,!1)),fa(e))}function Gm(e,t,n){if((ot&6)!==0)throw Error(c(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Fn(e,t),u=s?Qy(e,t):xd(e,t,!0),f=s;do{if(u===0){rr&&!s&&Ts(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Vy(n)){u=xd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var S=e;u=vc;var A=S.current.memoizedState.isDehydrated;if(A&&(or(S,g).flags|=256),g=xd(S,g,!1),g!==2){if(fd&&!A){S.errorRecoveryDisabledLanes|=f,yi|=f,u=4;break e}f=fl,fl=u,f!==null&&(fl===null?fl=f:fl.push.apply(fl,f))}u=g}if(f=!1,u!==2)continue}}if(u===1){or(e,0),Ts(e,t,0,!0);break}e:{switch(s=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ts(s,t,jl,!js);break e;case 2:fl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Zu+300-ct(),10<u)){if(Ts(s,t,jl,!js),Ul(s,0,!0)!==0)break e;Ka=t,s.timeoutHandle=xg(Im.bind(null,s,n,fl,Ju,hd,t,jl,yi,cr,js,f,"Throttled",-0,0),u);break e}Im(s,n,fl,Ju,hd,t,jl,yi,cr,js,f,null,-0,0)}}break}while(!0);fa(e)}function Im(e,t,n,s,u,f,g,S,A,G,ee,se,Q,J){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Et},Dm(t,f,se);var ke=(f&62914560)===f?Zu-ct():(f&4194048)===f?Hm-ct():0;if(ke=E_(se,ke),ke!==null){Ka=f,e.cancelPendingCommit=ke(Jm.bind(null,e,t,f,n,s,u,g,S,A,ee,se,null,Q,J)),Ts(e,f,g,!G);return}}Jm(e,t,f,n,s,u,g,S,A)}function Vy(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 s=0;s<n.length;s++){var u=n[s],f=u.getSnapshot;u=u.value;try{if(!el(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 Ts(e,t,n,s){t&=~dd,t&=~yi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var u=t;0<u;){var f=31-Ce(u),g=1<<f;s[f]=-1,u&=~g}n!==0&&ja(e,n,t)}function Fu(){return(ot&6)===0?(jc(0),!1):!0}function bd(){if(We!==null){if(yt===0)var e=We.return;else e=We,Ha=oi=null,Of(e),er=null,sc=0,e=We;for(;e!==null;)ym(e.alternate,e),e=e.return;We=null}}function or(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,o_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ka=0,bd(),wt=e,We=n=Cl(e.current,null),et=t,yt=0,Sl=null,js=!1,rr=Fn(e,t),fd=!1,cr=jl=dd=yi=ks=Kt=0,fl=vc=null,hd=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var u=31-Ce(s),f=1<<u;t|=e[u],s&=~f}return Za=t,ii(),n}function Ym(e,t){Qe=null,z.H=hc,t===Pi||t===wu?(t=sp(),yt=3):t===vf?(t=sp(),yt=4):yt=t===Kf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sl=t,We===null&&(Kt=1,qu(e,b(t,e.current)))}function Vm(){var e=_l.current;return e===null?!0:(et&4194048)===et?Ml===null:(et&62914560)===et||(et&536870912)!==0?e===Ml:!1}function Xm(){var e=z.H;return z.H=hc,e===null?hc:e}function Qm(){var e=z.A;return z.A=Iy,e}function Wu(){Kt=4,js||(et&4194048)!==et&&_l.current!==null||(rr=!0),(ks&134217727)===0&&(yi&134217727)===0||wt===null||Ts(wt,et,jl,!1)}function xd(e,t,n){var s=ot;ot|=2;var u=Xm(),f=Qm();(wt!==e||et!==t)&&(Ju=null,or(e,t)),t=!1;var g=Kt;e:do try{if(yt!==0&&We!==null){var S=We,A=Sl;switch(yt){case 8:bd(),g=6;break e;case 3:case 2:case 9:case 6:_l.current===null&&(t=!0);var G=yt;if(yt=0,Sl=null,fr(e,S,A,G),n&&rr){g=0;break e}break;default:G=yt,yt=0,Sl=null,fr(e,S,A,G)}}Xy(),g=Kt;break}catch(ee){Ym(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Ha=oi=null,ot=s,z.H=u,z.A=f,We===null&&(wt=null,et=0,ii()),g}function Xy(){for(;We!==null;)$m(We)}function Qy(e,t){var n=ot;ot|=2;var s=Xm(),u=Qm();wt!==e||et!==t?(Ju=null,Ku=ct()+500,or(e,t)):rr=Fn(e,t);e:do try{if(yt!==0&&We!==null){t=We;var f=Sl;t:switch(yt){case 1:yt=0,Sl=null,fr(e,t,f,1);break;case 2:case 9:if(lp(f)){yt=0,Sl=null,Zm(t);break}t=function(){yt!==2&&yt!==9||wt!==e||(yt=7),fa(e)},f.then(t,t);break e;case 3:yt=7;break e;case 4:yt=5;break e;case 7:lp(f)?(yt=0,Sl=null,Zm(t)):(yt=0,Sl=null,fr(e,t,f,7));break;case 5:var g=null;switch(We.tag){case 26:g=We.memoizedState;case 5:case 27:var S=We;if(g?Og(g):S.stateNode.complete){yt=0,Sl=null;var A=S.sibling;if(A!==null)We=A;else{var G=S.return;G!==null?(We=G,Pu(G)):We=null}break t}}yt=0,Sl=null,fr(e,t,f,5);break;case 6:yt=0,Sl=null,fr(e,t,f,6);break;case 8:bd(),Kt=6;break e;default:throw Error(c(462))}}$y();break}catch(ee){Ym(e,ee)}while(!0);return Ha=oi=null,z.H=s,z.A=u,ot=n,We!==null?0:(wt=null,et=0,ii(),Kt)}function $y(){for(;We!==null&&!In();)$m(We)}function $m(e){var t=bm(e.alternate,e,Za);e.memoizedProps=e.pendingProps,t===null?Pu(e):We=t}function Zm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fm(n,t,t.pendingProps,t.type,void 0,et);break;case 11:t=fm(n,t,t.pendingProps,t.type.render,t.ref,et);break;case 5:Of(t);default:ym(n,t),t=We=Pr(t,Za),t=bm(n,t,Za)}e.memoizedProps=e.pendingProps,t===null?Pu(e):We=t}function fr(e,t,n,s){Ha=oi=null,Of(t),er=null,sc=0;var u=t.return;try{if(zy(e,u,t,n,et)){Kt=1,qu(e,b(n,e.current)),We=null;return}}catch(f){if(u!==null)throw We=u,f;Kt=1,qu(e,b(n,e.current)),We=null;return}t.flags&32768?(nt||s===1?e=!0:rr||(et&536870912)!==0?e=!1:(js=e=!0,(s===2||s===9||s===3||s===6)&&(s=_l.current,s!==null&&s.tag===13&&(s.flags|=16384))),Km(t,e)):Pu(t)}function Pu(e){var t=e;do{if((t.flags&32768)!==0){Km(t,js);return}e=t.return;var n=Hy(t.alternate,t,Za);if(n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Kt===0&&(Kt=5)}function Km(e,t){do{var n=By(e.alternate,e);if(n!==null){n.flags&=32767,We=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){We=e;return}We=e=n}while(e!==null);Kt=6,We=null}function Jm(e,t,n,s,u,f,g,S,A){e.cancelPendingCommit=null;do eo();while(Sn!==0);if((ot&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=fs,Sa(e,n,f,g,S,A),e===wt&&(We=wt=null,et=0),ur=t,ws=e,Ka=n,pd=f,md=u,Bm=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fy(Qt,function(){return tg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=z.T,z.T=null,u=te.p,te.p=2,g=ot,ot|=4;try{qy(e,t,n)}finally{ot=g,te.p=u,z.T=s}}Sn=1,Fm(),Wm(),Pm()}}function Fm(){if(Sn===1){Sn=0;var e=ws,t=ur,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var s=te.p;te.p=2;var u=ot;ot|=4;try{Rm(t,e);var f=Cd,g=mu(e.containerInfo),S=f.focusedElem,A=f.selectionRange;if(g!==S&&S&&S.ownerDocument&&pu(S.ownerDocument.documentElement,S)){if(A!==null&&li(S)){var G=A.start,ee=A.end;if(ee===void 0&&(ee=G),"selectionStart"in S)S.selectionStart=G,S.selectionEnd=Math.min(ee,S.value.length);else{var se=S.ownerDocument||document,Q=se&&se.defaultView||window;if(Q.getSelection){var J=Q.getSelection(),ke=S.textContent.length,Ue=Math.min(A.start,ke),kt=A.end===void 0?Ue:Math.min(A.end,ke);!J.extend&&Ue>kt&&(g=kt,kt=Ue,Ue=g);var U=hu(S,Ue),R=hu(S,kt);if(U&&R&&(J.rangeCount!==1||J.anchorNode!==U.node||J.anchorOffset!==U.offset||J.focusNode!==R.node||J.focusOffset!==R.offset)){var q=se.createRange();q.setStart(U.node,U.offset),J.removeAllRanges(),Ue>kt?(J.addRange(q),J.extend(R.node,R.offset)):(q.setEnd(R.node,R.offset),J.addRange(q))}}}}for(se=[],J=S;J=J.parentNode;)J.nodeType===1&&se.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<se.length;S++){var ne=se[S];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}ho=!!Ad,Cd=Ad=null}finally{ot=u,te.p=s,z.T=n}}e.current=t,Sn=2}}function Wm(){if(Sn===2){Sn=0;var e=ws,t=ur,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var s=te.p;te.p=2;var u=ot;ot|=4;try{wm(e,t.alternate,t)}finally{ot=u,te.p=s,z.T=n}}Sn=3}}function Pm(){if(Sn===4||Sn===3){Sn=0,Xt();var e=ws,t=ur,n=Ka,s=Bm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Sn=5:(Sn=0,ur=ws=null,eg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ns=null),rn(n),t=t.stateNode,ue&&typeof ue.onCommitFiberRoot=="function")try{ue.onCommitFiberRoot(Z,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=z.T,u=te.p,te.p=2,z.T=null;try{for(var f=e.onRecoverableError,g=0;g<s.length;g++){var S=s[g];f(S.value,{componentStack:S.stack})}}finally{z.T=t,te.p=u}}(Ka&3)!==0&&eo(),fa(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===gd?Sc++:(Sc=0,gd=e):Sc=0,jc(0)}}function eg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,lc(t)))}function eo(){return Fm(),Wm(),Pm(),tg()}function tg(){if(Sn!==5)return!1;var e=ws,t=pd;pd=0;var n=rn(Ka),s=z.T,u=te.p;try{te.p=32>n?32:n,z.T=null,n=md,md=null;var f=ws,g=Ka;if(Sn=0,ur=ws=null,Ka=0,(ot&6)!==0)throw Error(c(331));var S=ot;if(ot|=4,Lm(f.current),Om(f,f.current,g,n),ot=S,jc(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(Z,f)}catch{}return!0}finally{te.p=u,z.T=s,eg(e,t)}}function ng(e,t,n){t=b(n,t),t=Zf(e.stateNode,t,2),e=ys(e,t,2),e!==null&&(Tl(e,2),fa(e))}function _t(e,t,n){if(e.tag===3)ng(e,e,n);else for(;t!==null;){if(t.tag===3){ng(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ns===null||!Ns.has(s))){e=b(n,e),n=lm(2),s=ys(t,n,2),s!==null&&(am(n,s,t,e),Tl(s,2),fa(s));break}}t=t.return}}function yd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Yy;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(n)||(fd=!0,u.add(n),e=Zy.bind(null,e,t,n),t.then(e,e))}function Zy(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,wt===e&&(et&n)===n&&(Kt===4||Kt===3&&(et&62914560)===et&&300>ct()-Zu?(ot&2)===0&&or(e,0):dd|=n,cr===et&&(cr=0)),fa(e)}function lg(e,t){t===0&&(t=vn()),e=ua(e,t),e!==null&&(Tl(e,t),fa(e))}function Ky(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),lg(e,n)}function Jy(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(c(314))}s!==null&&s.delete(t),lg(e,n)}function Fy(e,t){return Jt(e,t)}var to=null,dr=null,_d=!1,no=!1,vd=!1,Es=0;function fa(e){e!==dr&&e.next===null&&(dr===null?to=dr=e:dr=dr.next=e),no=!0,_d||(_d=!0,Py())}function jc(e,t){if(!vd&&no){vd=!0;do for(var n=!1,s=to;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var g=s.suspendedLanes,S=s.pingedLanes;f=(1<<31-Ce(42|e)+1)-1,f&=u&~(g&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,rg(s,f))}else f=et,f=Ul(s,s===wt?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Fn(s,f)||(n=!0,rg(s,f));s=s.next}while(n);vd=!1}}function Wy(){ag()}function ag(){no=_d=!1;var e=0;Es!==0&&u_()&&(e=Es);for(var t=ct(),n=null,s=to;s!==null;){var u=s.next,f=sg(s,t);f===0?(s.next=null,n===null?to=u:n.next=u,u===null&&(dr=n)):(n=s,(e!==0||(f&3)!==0)&&(no=!0)),s=u}Sn!==0&&Sn!==5||jc(e),Es!==0&&(Es=0)}function sg(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var g=31-Ce(f),S=1<<g,A=u[g];A===-1?((S&n)===0||(S&s)!==0)&&(u[g]=Yn(S,t)):A<=t&&(e.expiredLanes|=S),f&=~S}if(t=wt,n=et,n=Ul(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(yt===2||yt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ft(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Fn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&Ft(s),rn(n)){case 2:case 8:n=_n;break;case 32:n=Qt;break;case 268435456:n=wn;break;default:n=Qt}return s=ig.bind(null,e),n=Jt(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&Ft(s),e.callbackPriority=2,e.callbackNode=null,2}function ig(e,t){if(Sn!==0&&Sn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(eo()&&e.callbackNode!==n)return null;var s=et;return s=Ul(e,e===wt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Gm(e,s,t),sg(e,ct()),e.callbackNode!=null&&e.callbackNode===n?ig.bind(null,e):null)}function rg(e,t){if(eo())return null;Gm(e,t,!0)}function Py(){f_(function(){(ot&6)!==0?Jt(kn,Wy):ag()})}function Sd(){if(Es===0){var e=Fi;e===0&&(e=Se,Se<<=1,(Se&261888)===0&&(Se=256)),Es=e}return Es}function cg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function ug(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 e_(e,t,n,s,u){if(t==="submit"&&n&&n.stateNode===u){var f=cg((u[Je]||null).action),g=s.submitter;g&&(t=(t=g[Je]||null)?cg(t.formAction):g.getAttribute("formAction"),t!==null&&(f=t,g=null));var S=new ls("action","action",null,s,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Es!==0){var A=g?ug(u,g):new FormData(u);If(n,{pending:!0,data:A,method:u.method,action:f},null,A)}}else typeof f=="function"&&(S.preventDefault(),A=g?ug(u,g):new FormData(u),If(n,{pending:!0,data:A,method:u.method,action:f},f,A))},currentTarget:u}]})}}for(var jd=0;jd<tl.length;jd++){var kd=tl[jd],t_=kd.toLowerCase(),n_=kd[0].toUpperCase()+kd.slice(1);Yt(t_,"on"+n_)}Yt(xu,"onAnimationEnd"),Yt(yu,"onAnimationIteration"),Yt(_u,"onAnimationStart"),Yt("dblclick","onDoubleClick"),Yt("focusin","onFocus"),Yt("focusout","onBlur"),Yt(ff,"onTransitionRun"),Yt(df,"onTransitionStart"),Yt(vu,"onTransitionCancel"),Yt(Wr,"onTransitionEnd"),Qn("onMouseEnter",["mouseout","mouseover"]),Qn("onMouseLeave",["mouseout","mouseover"]),Qn("onPointerEnter",["pointerout","pointerover"]),Qn("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 kc="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(" "),l_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function og(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],u=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var g=s.length-1;0<=g;g--){var S=s[g],A=S.instance,G=S.currentTarget;if(S=S.listener,A!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=G;try{f(u)}catch(ee){yl(ee)}u.currentTarget=null,f=A}else for(g=0;g<s.length;g++){if(S=s[g],A=S.instance,G=S.currentTarget,S=S.listener,A!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=G;try{f(u)}catch(ee){yl(ee)}u.currentTarget=null,f=A}}}}function Pe(e,t){var n=t[Xs];n===void 0&&(n=t[Xs]=new Set);var s=e+"__bubble";n.has(s)||(fg(t,e,2,!1),n.add(s))}function Nd(e,t,n){var s=0;t&&(s|=4),fg(n,e,s,t)}var lo="_reactListening"+Math.random().toString(36).slice(2);function wd(e){if(!e[lo]){e[lo]=!0,Vn.forEach(function(n){n!=="selectionchange"&&(l_.has(n)||Nd(n,!1,e),Nd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[lo]||(t[lo]=!0,Nd("selectionchange",!1,t))}}function fg(e,t,n,s){switch(qg(t)){case 2:var u=R_;break;case 8:u=M_;break;default:u=Gd}n=u.bind(null,t,n,e),u=void 0,!Ks||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),s?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 Td(e,t,n,s,u){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var g=s.tag;if(g===3||g===4){var S=s.stateNode.containerInfo;if(S===u)break;if(g===4)for(g=s.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===u)return;g=g.return}for(;S!==null;){if(g=Pl(S),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){s=f=g;continue e}S=S.parentNode}}s=s.return}Ui(function(){var G=f,ee=Bt(n),se=[];e:{var Q=si.get(e);if(Q!==void 0){var J=ls,ke=e;switch(e){case"keypress":if(Ra(n)===0)break e;case"keydown":case"keyup":J=Jo;break;case"focusin":ke="focus",J=ss;break;case"focusout":ke="blur",J=ss;break;case"beforeblur":case"afterblur":J=ss;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":J=Br;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Fc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=rs;break;case xu:case yu:case _u:J=Ma;break;case Wr:J=Po;break;case"scroll":case"scrollend":J=Zo;break;case"wheel":J=tf;break;case"copy":case"cut":case"paste":J=Ws;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=eu;break;case"toggle":case"beforetoggle":J=ei}var Ue=(t&4)!==0,kt=!Ue&&(e==="scroll"||e==="scrollend"),U=Ue?Q!==null?Q+"Capture":null:Q;Ue=[];for(var R=G,q;R!==null;){var ne=R;if(q=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||q===null||U===null||(ne=Zs(R,U),ne!=null&&Ue.push(Nc(R,ne,q))),kt)break;R=R.return}0<Ue.length&&(Q=new J(Q,ke,null,n,ee),se.push({event:Q,listeners:Ue}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",Q&&n!==on&&(ke=n.relatedTarget||n.fromElement)&&(Pl(ke)||ke[Wn]))break e;if((J||Q)&&(Q=ee.window===ee?ee:(Q=ee.ownerDocument)?Q.defaultView||Q.parentWindow:window,J?(ke=n.relatedTarget||n.toElement,J=G,ke=ke?Pl(ke):null,ke!==null&&(kt=d(ke),Ue=ke.tag,ke!==kt||Ue!==5&&Ue!==27&&Ue!==6)&&(ke=null)):(J=null,ke=G),J!==ke)){if(Ue=Br,ne="onMouseLeave",U="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(Ue=eu,ne="onPointerLeave",U="onPointerEnter",R="pointer"),kt=J==null?Q:Pt(J),q=ke==null?Q:Pt(ke),Q=new Ue(ne,R+"leave",J,n,ee),Q.target=kt,Q.relatedTarget=q,ne=null,Pl(ee)===G&&(Ue=new Ue(U,R+"enter",ke,n,ee),Ue.target=q,Ue.relatedTarget=kt,ne=Ue),kt=ne,J&&ke)t:{for(Ue=a_,U=J,R=ke,q=0,ne=U;ne;ne=Ue(ne))q++;ne=0;for(var Oe=R;Oe;Oe=Ue(Oe))ne++;for(;0<q-ne;)U=Ue(U),q--;for(;0<ne-q;)R=Ue(R),ne--;for(;q--;){if(U===R||R!==null&&U===R.alternate){Ue=U;break t}U=Ue(U),R=Ue(R)}Ue=null}else Ue=null;J!==null&&dg(se,Q,J,Ue,!1),ke!==null&&kt!==null&&dg(se,kt,ke,Ue,!0)}}e:{if(Q=G?Pt(G):window,J=Q.nodeName&&Q.nodeName.toLowerCase(),J==="select"||J==="input"&&Q.type==="file")var it=Xr;else if(su(Q))if(cu)it=uf;else{it=rf;var Ee=sf}else J=Q.nodeName,!J||J.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?G&&De(G.elementType)&&(it=Xr):it=cf;if(it&&(it=it(e,G))){iu(se,it,n,ee);break e}Ee&&Ee(e,Q,G),e==="focusout"&&G&&Q.type==="number"&&G.memoizedProps.value!=null&&la(Q,"number",Q.value)}switch(Ee=G?Pt(G):window,e){case"focusin":(su(Ee)||Ee.contentEditable==="true")&&(Il=Ee,Kr=G,ai=null);break;case"focusout":ai=Kr=Il=null;break;case"mousedown":Jr=!0;break;case"contextmenu":case"mouseup":case"dragend":Jr=!1,gu(se,n,ee);break;case"selectionchange":if(Zr)break;case"keydown":case"keyup":gu(se,n,ee)}var $e;if(Gr)e:{switch(e){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else cs?Ir(e,n)&&(tt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(tt="onCompositionStart");tt&&(nu&&n.locale!=="ko"&&(cs||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&cs&&($e=Al()):(xl=ee,Hi="value"in xl?xl.value:xl.textContent,cs=!0)),Ee=ao(G,tt),0<Ee.length&&(tt=new is(tt,e,null,n,ee),se.push({event:tt,listeners:Ee}),$e?tt.data=$e:($e=Yr(n),$e!==null&&(tt.data=$e)))),($e=tu?au(e,n):Vr(e,n))&&(tt=ao(G,"onBeforeInput"),0<tt.length&&(Ee=new is("onBeforeInput","beforeinput",null,n,ee),se.push({event:Ee,listeners:tt}),Ee.data=$e)),e_(se,e,G,n,ee)}og(se,t)})}function Nc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ao(e,t){for(var n=t+"Capture",s=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Zs(e,n),u!=null&&s.unshift(Nc(e,u,f)),u=Zs(e,t),u!=null&&s.push(Nc(e,u,f))),e.tag===3)return s;e=e.return}return[]}function a_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dg(e,t,n,s,u){for(var f=t._reactName,g=[];n!==null&&n!==s;){var S=n,A=S.alternate,G=S.stateNode;if(S=S.tag,A!==null&&A===s)break;S!==5&&S!==26&&S!==27||G===null||(A=G,u?(G=Zs(n,f),G!=null&&g.unshift(Nc(n,G,A))):u||(G=Zs(n,f),G!=null&&g.push(Nc(n,G,A)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var s_=/\r\n?/g,i_=/\u0000|\uFFFD/g;function hg(e){return(typeof e=="string"?e:""+e).replace(s_,`
50
+ `).replace(i_,"")}function pg(e,t){return t=hg(t),hg(e)===t}function jt(e,t,n,s,u,f){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||B(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&B(e,""+s);break;case"className":Mn(e,"class",s);break;case"tabIndex":Mn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Mn(e,n,s);break;case"style":Re(e,s,f);break;case"data":if(t!=="object"){Mn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=tn(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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"&&jt(e,t,"name",u.name,u,null),jt(e,t,"formEncType",u.formEncType,u,null),jt(e,t,"formMethod",u.formMethod,u,null),jt(e,t,"formTarget",u.formTarget,u,null)):(jt(e,t,"encType",u.encType,u,null),jt(e,t,"method",u.method,u,null),jt(e,t,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=tn(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Et);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=tn(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),Tn(e,"popover",s);break;case"xlinkActuate":cn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":cn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":cn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":cn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":cn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":cn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":cn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":cn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":cn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Tn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=pt.get(n)||n,Tn(e,n,s))}}function Ed(e,t,n,s,u,f){switch(n){case"style":Re(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof s=="string"?B(e,s):(typeof s=="number"||typeof s=="bigint")&&B(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Et);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wa.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[Je]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof s=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,u);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Tn(e,n,s)}}}function Hn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var g=n[f];if(g!=null)switch(f){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,f,g,n,null)}}u&&jt(e,t,"srcSet",n.srcSet,n,null),s&&jt(e,t,"src",n.src,n,null);return;case"input":Pe("invalid",e);var S=f=g=u=null,A=null,G=null;for(s in n)if(n.hasOwnProperty(s)){var ee=n[s];if(ee!=null)switch(s){case"name":u=ee;break;case"type":g=ee;break;case"checked":A=ee;break;case"defaultChecked":G=ee;break;case"value":f=ee;break;case"defaultValue":S=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:jt(e,t,s,ee,n,null)}}Bl(e,f,S,A,G,g,u,!1);return;case"select":Pe("invalid",e),s=g=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":g=S;break;case"multiple":s=S;default:jt(e,t,u,S,n,null)}t=f,n=g,e.multiple=!!s,t!=null?il(e,!!s,t,!1):n!=null&&il(e,!!s,n,!0);return;case"textarea":Pe("invalid",e),f=u=s=null;for(g in n)if(n.hasOwnProperty(g)&&(S=n[g],S!=null))switch(g){case"value":s=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:jt(e,t,g,S,n,null)}k(e,s,u,f);return;case"option":for(A in n)if(n.hasOwnProperty(A)&&(s=n[A],s!=null))switch(A){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:jt(e,t,A,s,n,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<kc.length;s++)Pe(kc[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(G in n)if(n.hasOwnProperty(G)&&(s=n[G],s!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,G,s,n,null)}return;default:if(De(t)){for(ee in n)n.hasOwnProperty(ee)&&(s=n[ee],s!==void 0&&Ed(e,t,ee,s,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(s=n[S],s!=null&&jt(e,t,S,s,n,null))}function r_(e,t,n,s){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,g=null,S=null,A=null,G=null,ee=null;for(J in n){var se=n[J];if(n.hasOwnProperty(J)&&se!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":A=se;default:s.hasOwnProperty(J)||jt(e,t,J,null,s,se)}}for(var Q in s){var J=s[Q];if(se=n[Q],s.hasOwnProperty(Q)&&(J!=null||se!=null))switch(Q){case"type":f=J;break;case"name":u=J;break;case"checked":G=J;break;case"defaultChecked":ee=J;break;case"value":g=J;break;case"defaultValue":S=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(c(137,t));break;default:J!==se&&jt(e,t,Q,J,s,se)}}bl(e,g,S,A,G,ee,f,u);return;case"select":J=g=S=Q=null;for(f in n)if(A=n[f],n.hasOwnProperty(f)&&A!=null)switch(f){case"value":break;case"multiple":J=A;default:s.hasOwnProperty(f)||jt(e,t,f,null,s,A)}for(u in s)if(f=s[u],A=n[u],s.hasOwnProperty(u)&&(f!=null||A!=null))switch(u){case"value":Q=f;break;case"defaultValue":S=f;break;case"multiple":g=f;default:f!==A&&jt(e,t,u,f,s,A)}t=S,n=g,s=J,Q!=null?il(e,!!n,Q,!1):!!s!=!!n&&(t!=null?il(e,!!n,t,!0):il(e,!!n,n?[]:"",!1));return;case"textarea":J=Q=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:jt(e,t,S,null,s,u)}for(g in s)if(u=s[g],f=n[g],s.hasOwnProperty(g)&&(u!=null||f!=null))switch(g){case"value":Q=u;break;case"defaultValue":J=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&jt(e,t,g,u,s,f)}fe(e,Q,J);return;case"option":for(var ke in n)if(Q=n[ke],n.hasOwnProperty(ke)&&Q!=null&&!s.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:jt(e,t,ke,null,s,Q)}for(A in s)if(Q=s[A],J=n[A],s.hasOwnProperty(A)&&Q!==J&&(Q!=null||J!=null))switch(A){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:jt(e,t,A,Q,s,J)}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 Ue in n)Q=n[Ue],n.hasOwnProperty(Ue)&&Q!=null&&!s.hasOwnProperty(Ue)&&jt(e,t,Ue,null,s,Q);for(G in s)if(Q=s[G],J=n[G],s.hasOwnProperty(G)&&Q!==J&&(Q!=null||J!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:jt(e,t,G,Q,s,J)}return;default:if(De(t)){for(var kt in n)Q=n[kt],n.hasOwnProperty(kt)&&Q!==void 0&&!s.hasOwnProperty(kt)&&Ed(e,t,kt,void 0,s,Q);for(ee in s)Q=s[ee],J=n[ee],!s.hasOwnProperty(ee)||Q===J||Q===void 0&&J===void 0||Ed(e,t,ee,Q,s,J);return}}for(var U in n)Q=n[U],n.hasOwnProperty(U)&&Q!=null&&!s.hasOwnProperty(U)&&jt(e,t,U,null,s,Q);for(se in s)Q=s[se],J=n[se],!s.hasOwnProperty(se)||Q===J||Q==null&&J==null||jt(e,t,se,Q,s,J)}function mg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function c_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var u=n[s],f=u.transferSize,g=u.initiatorType,S=u.duration;if(f&&S&&mg(g)){for(g=0,S=u.responseEnd,s+=1;s<n.length;s++){var A=n[s],G=A.startTime;if(G>S)break;var ee=A.transferSize,se=A.initiatorType;ee&&mg(se)&&(A=A.responseEnd,g+=ee*(A<S?1:(S-G)/(A-G)))}if(--s,t+=8*(f+g)/(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 Ad=null,Cd=null;function so(e){return e.nodeType===9?e:e.ownerDocument}function gg(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 bg(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 Rd(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 Md=null;function u_(){var e=window.event;return e&&e.type==="popstate"?e===Md?!1:(Md=e,!0):(Md=null,!1)}var xg=typeof setTimeout=="function"?setTimeout:void 0,o_=typeof clearTimeout=="function"?clearTimeout:void 0,yg=typeof Promise=="function"?Promise:void 0,f_=typeof queueMicrotask=="function"?queueMicrotask:typeof yg<"u"?function(e){return yg.resolve(null).then(e).catch(d_)}:xg;function d_(e){setTimeout(function(){throw e})}function As(e){return e==="head"}function _g(e,t){var n=t,s=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(u),gr(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")wc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,wc(n);for(var f=n.firstChild;f;){var g=f.nextSibling,S=f.nodeName;f[Wl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=g}}else n==="body"&&wc(e.ownerDocument.body);n=u}while(n);gr(t)}function vg(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function Od(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":Od(n),Na(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function h_(e,t,n,s){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Wl])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=Ol(e.nextSibling),e===null)break}return null}function p_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ol(e.nextSibling),e===null))return null;return e}function Sg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ol(e.nextSibling),e===null))return null;return e}function Dd(e){return e.data==="$?"||e.data==="$~"}function zd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ol(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 Ld=null;function jg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ol(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function kg(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 Ng(e,t,n){switch(t=so(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 wc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Na(e)}var Dl=new Map,wg=new Set;function io(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ja=te.d;te.d={f:g_,r:b_,D:x_,C:y_,L:__,m:v_,X:j_,S:S_,M:k_};function g_(){var e=Ja.f(),t=Fu();return e||t}function b_(e){var t=gl(e);t!==null&&t.tag===5&&t.type==="form"?Yp(t):Ja.r(e)}var hr=typeof document>"u"?null:document;function Tg(e,t,n){var s=hr;if(s&&typeof t=="string"&&t){var u=On(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),wg.has(u)||(wg.add(u),e={rel:e,crossOrigin:n,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),Hn(t,"link",e),ut(t),s.head.appendChild(t)))}}function x_(e){Ja.D(e),Tg("dns-prefetch",e,null)}function y_(e,t){Ja.C(e,t),Tg("preconnect",e,t)}function __(e,t,n){Ja.L(e,t,n);var s=hr;if(s&&e&&t){var u='link[rel="preload"][as="'+On(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+On(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+On(n.imageSizes)+'"]')):u+='[href="'+On(e)+'"]';var f=u;switch(t){case"style":f=pr(e);break;case"script":f=mr(e)}Dl.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Dl.set(f,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(Tc(f))||t==="script"&&s.querySelector(Ec(f))||(t=s.createElement("link"),Hn(t,"link",e),ut(t),s.head.appendChild(t)))}}function v_(e,t){Ja.m(e,t);var n=hr;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+On(s)+'"][href="'+On(e)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=mr(e)}if(!Dl.has(f)&&(e=j({rel:"modulepreload",href:e},t),Dl.set(f,e),n.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ec(f)))return}s=n.createElement("link"),Hn(s,"link",e),ut(s),n.head.appendChild(s)}}}function S_(e,t,n){Ja.S(e,t,n);var s=hr;if(s&&e){var u=en(s).hoistableStyles,f=pr(e);t=t||"default";var g=u.get(f);if(!g){var S={loading:0,preload:null};if(g=s.querySelector(Tc(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Dl.get(f))&&Ud(e,n);var A=g=s.createElement("link");ut(A),Hn(A,"link",e),A._p=new Promise(function(G,ee){A.onload=G,A.onerror=ee}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,ro(g,t,s)}g={type:"stylesheet",instance:g,count:1,state:S},u.set(f,g)}}}function j_(e,t){Ja.X(e,t);var n=hr;if(n&&e){var s=en(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0},t),(t=Dl.get(u))&&Hd(e,t),f=n.createElement("script"),ut(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function k_(e,t){Ja.M(e,t);var n=hr;if(n&&e){var s=en(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=Dl.get(u))&&Hd(e,t),f=n.createElement("script"),ut(f),Hn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function Eg(e,t,n,s){var u=(u=Ae.current)?io(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=pr(n.href),n=en(u).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=pr(n.href);var f=en(u).hoistableStyles,g=f.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,g),(f=u.querySelector(Tc(e)))&&!f._p&&(g.instance=f,g.state.loading=5),Dl.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},Dl.set(e,n),f||N_(u,e,n,g.state))),t&&s===null)throw Error(c(528,""));return g}if(t&&s!==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=mr(n),n=en(u).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function pr(e){return'href="'+On(e)+'"'}function Tc(e){return'link[rel="stylesheet"]['+e+"]"}function Ag(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function N_(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Hn(t,"link",n),ut(t),e.head.appendChild(t))}function mr(e){return'[src="'+On(e)+'"]'}function Ec(e){return"script[async]"+e}function Cg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+On(n.href)+'"]');if(s)return t.instance=s,ut(s),s;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ut(s),Hn(s,"style",u),ro(s,n.precedence,e),t.instance=s;case"stylesheet":u=pr(n.href);var f=e.querySelector(Tc(u));if(f)return t.state.loading|=4,t.instance=f,ut(f),f;s=Ag(n),(u=Dl.get(u))&&Ud(s,u),f=(e.ownerDocument||e).createElement("link"),ut(f);var g=f;return g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Hn(f,"link",s),t.state.loading|=4,ro(f,n.precedence,e),t.instance=f;case"script":return f=mr(n.src),(u=e.querySelector(Ec(f)))?(t.instance=u,ut(u),u):(s=n,(u=Dl.get(f))&&(s=j({},n),Hd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),ut(u),Hn(u,"link",s),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&&(s=t.instance,t.state.loading|=4,ro(s,n.precedence,e));return t.instance}function ro(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,g=0;g<s.length;g++){var S=s[g];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 Ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var co=null;function Rg(e,t,n){if(co===null){var s=new Map,u=co=new Map;u.set(n,s)}else u=co,s=u.get(n),s||(s=new Map,u.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Wl]||f[$t]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var g=f.getAttribute(t)||"";g=e+g;var S=s.get(g);S?S.push(f):s.set(g,[f])}}return s}function Mg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function w_(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 Og(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function T_(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=pr(s.href),f=t.querySelector(Tc(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=uo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,ut(f);return}f=t.ownerDocument||t,s=Ag(s),(u=Dl.get(u))&&Ud(s,u),f=f.createElement("link"),ut(f);var g=f;g._p=new Promise(function(S,A){g.onload=S,g.onerror=A}),Hn(f,"link",s),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=uo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Bd=0;function E_(e,t){return e.stylesheets&&e.count===0&&fo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&fo(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Bd===0&&(Bd=62500*c_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fo(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Bd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oo=null;function fo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oo=new Map,t.forEach(A_,e),oo=null,uo.call(e))}function A_(e,t){if(!(t.state.loading&4)){var n=oo.get(e);if(n)var s=n.get(null);else{n=new Map,oo.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var g=u[f];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(n.set(g.dataset.precedence,g),s=g)}s&&n.set(null,s)}u=t.instance,g=u.getAttribute("data-precedence"),f=n.get(g)||s,f===s&&n.set(null,u),n.set(g,u),this.count++,s=uo.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Ac={$$typeof:I,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function C_(e,t,n,s,u,f,g,S,A){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=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Dg(e,t,n,s,u,f,g,S,A,G,ee,se){return e=new C_(e,t,n,g,A,G,ee,se,S),t=1,f===!0&&(t|=24),f=dn(3,null,null,t),e.current=f,f.stateNode=e,t=xf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:n,cache:t},Sf(f),e}function zg(e){return e?(e=hs,e):hs}function Lg(e,t,n,s,u,f){u=zg(u),s.context===null?s.context=u:s.pendingContext=u,s=xs(t),s.payload={element:n},f=f===void 0?null:f,f!==null&&(s.callback=f),n=ys(e,s,t),n!==null&&(dl(n,e,t),rc(n,e,t))}function Ug(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qd(e,t){Ug(e,t),(e=e.alternate)&&Ug(e,t)}function Hg(e){if(e.tag===13||e.tag===31){var t=ua(e,67108864);t!==null&&dl(t,e,67108864),qd(e,67108864)}}function Bg(e){if(e.tag===13||e.tag===31){var t=kl();t=Jl(t);var n=ua(e,t);n!==null&&dl(n,e,t),qd(e,t)}}var ho=!0;function R_(e,t,n,s){var u=z.T;z.T=null;var f=te.p;try{te.p=2,Gd(e,t,n,s)}finally{te.p=f,z.T=u}}function M_(e,t,n,s){var u=z.T;z.T=null;var f=te.p;try{te.p=8,Gd(e,t,n,s)}finally{te.p=f,z.T=u}}function Gd(e,t,n,s){if(ho){var u=Id(s);if(u===null)Td(e,t,s,po,n),Gg(e,s);else if(D_(u,e,t,n,s))s.stopPropagation();else if(Gg(e,s),t&4&&-1<O_.indexOf(e)){for(;u!==null;){var f=gl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var g=Rn(f.pendingLanes);if(g!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;g;){var A=1<<31-Ce(g);S.entanglements[1]|=A,g&=~A}fa(f),(ot&6)===0&&(Ku=ct()+500,jc(0))}}break;case 31:case 13:S=ua(f,2),S!==null&&dl(S,f,2),Fu(),qd(f,2)}if(f=Id(s),f===null&&Td(e,t,s,po,n),f===u)break;u=f}u!==null&&s.stopPropagation()}else Td(e,t,s,null,n)}}function Id(e){return e=Bt(e),Yd(e)}var po=null;function Yd(e){if(po=null,e=Pl(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 po=e,null}function qg(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(jn()){case kn:return 2;case _n:return 8;case Qt:case Nn:return 32;case wn:return 268435456;default:return 32}default:return 32}}var Vd=!1,Cs=null,Rs=null,Ms=null,Cc=new Map,Rc=new Map,Os=[],O_="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 Gg(e,t){switch(e){case"focusin":case"focusout":Cs=null;break;case"dragenter":case"dragleave":Rs=null;break;case"mouseover":case"mouseout":Ms=null;break;case"pointerover":case"pointerout":Cc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function Mc(e,t,n,s,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:f,targetContainers:[u]},t!==null&&(t=gl(t),t!==null&&Hg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function D_(e,t,n,s,u){switch(t){case"focusin":return Cs=Mc(Cs,e,t,n,s,u),!0;case"dragenter":return Rs=Mc(Rs,e,t,n,s,u),!0;case"mouseover":return Ms=Mc(Ms,e,t,n,s,u),!0;case"pointerover":var f=u.pointerId;return Cc.set(f,Mc(Cc.get(f)||null,e,t,n,s,u)),!0;case"gotpointercapture":return f=u.pointerId,Rc.set(f,Mc(Rc.get(f)||null,e,t,n,s,u)),!0}return!1}function Ig(e){var t=Pl(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,ml(e.priority,function(){Bg(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,ml(e.priority,function(){Bg(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 mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Id(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);on=s,n.target.dispatchEvent(s),on=null}else return t=gl(n),t!==null&&Hg(t),e.blockedOn=n,!1;t.shift()}return!0}function Yg(e,t,n){mo(e)&&n.delete(t)}function z_(){Vd=!1,Cs!==null&&mo(Cs)&&(Cs=null),Rs!==null&&mo(Rs)&&(Rs=null),Ms!==null&&mo(Ms)&&(Ms=null),Cc.forEach(Yg),Rc.forEach(Yg)}function go(e,t){e.blockedOn===t&&(e.blockedOn=null,Vd||(Vd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,z_)))}var bo=null;function Vg(e){bo!==e&&(bo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){bo===e&&(bo=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],u=e[t+2];if(typeof s!="function"){if(Yd(s||n)===null)continue;break}var f=gl(n);f!==null&&(e.splice(t,3),t-=3,If(f,{pending:!0,data:u,method:n.method,action:s},s,u))}}))}function gr(e){function t(A){return go(A,e)}Cs!==null&&go(Cs,e),Rs!==null&&go(Rs,e),Ms!==null&&go(Ms,e),Cc.forEach(t),Rc.forEach(t);for(var n=0;n<Os.length;n++){var s=Os[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Os.length&&(n=Os[0],n.blockedOn===null);)Ig(n),n.blockedOn===null&&Os.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var u=n[s],f=n[s+1],g=u[Je]||null;if(typeof f=="function")g||Vg(n);else if(g){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,g=f[Je]||null)S=g.formAction;else if(Yd(u)!==null)continue}else S=g.action;typeof S=="function"?n[s+1]=S:(n.splice(s,3),s-=3),Vg(n)}}}function Xg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(g){return u=g})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),s||setTimeout(n,20)}function n(){if(!s&&!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 s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Xd(e){this._internalRoot=e}xo.prototype.render=Xd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,s=kl();Lg(n,s,e,t,null,null)},xo.prototype.unmount=Xd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lg(e.current,2,null,e,null,null),Fu(),t[Wn]=null}};function xo(e){this._internalRoot=e}xo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ka();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Os.length&&t!==0&&t<Os[n].priority;n++);Os.splice(n,0,e),n===0&&Ig(e)}};var Qg=l.version;if(Qg!=="19.2.8")throw Error(c(527,Qg,"19.2.8"));te.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 L_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{Z=yo.inject(L_),ue=yo}catch{}}return Dc.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,s="",u=Pp,f=em,g=tm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Dg(e,1,!1,null,null,n,s,null,u,f,g,Xg),e[Wn]=t.current,wd(e),new Xd(t)},Dc.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var s=!1,u="",f=Pp,g=em,S=tm,A=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(A=n.formState)),t=Dg(e,1,!0,t,n??null,s,u,A,f,g,S,Xg),t.context=zg(null),n=t.current,s=kl(),s=Jl(s),u=xs(s),u.callback=null,ys(n,u,s),n=s,t.current.lanes=n,Tl(t,n),fa(t),e[Wn]=t.current,wd(e),new xo(t)},Dc.version="19.2.8",Dc}var lb;function Z_(){if(lb)return Kd.exports;lb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Kd.exports=$_(),Kd.exports}var K_=Z_();const jx=1;var Pa,Tr,Er,Ar,Cr,Kc,Rr,Xo,kx;class J_{constructor(l){Vt(this,Xo);Vt(this,Pa,null);Vt(this,Tr,new Set);Vt(this,Er,500);Vt(this,Ar,null);Vt(this,Cr,!1);Vt(this,Kc,null);Vt(this,Rr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){ft(this,Rr,l)}connect(){if(Be(this,Cr))return;const l=new WebSocket(this.url);ft(this,Pa,l),l.addEventListener("open",()=>{var i,c;ft(this,Er,500),this.send({type:"hello",protocol:jx,clientName:"ccv-web"}),(i=Be(this,Kc))==null||i.call(this),(c=Be(this,Rr))==null||c.call(this)}),l.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of Be(this,Tr))o(c)}),l.addEventListener("close",()=>{var i;ft(this,Pa,null),(i=Be(this,Rr))==null||i.call(this),xn(this,Xo,kx).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){ft(this,Kc,l)}on(l){return Be(this,Tr).add(l),()=>Be(this,Tr).delete(l)}send(l){var i;((i=Be(this,Pa))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,Pa).send(JSON.stringify(l))}get connected(){var l;return((l=Be(this,Pa))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;ft(this,Cr,!0),(l=Be(this,Pa))==null||l.close()}}Pa=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,Cr=new WeakMap,Kc=new WeakMap,Rr=new WeakMap,Xo=new WeakSet,kx=function(){if(Be(this,Cr)||Be(this,Ar)!==null)return;const l=Be(this,Er);ft(this,Er,Math.min(l*2,1e4)),ft(this,Ar,window.setTimeout(()=>{ft(this,Ar,null),this.connect()},l))};const F_=1,Nx="ccv:relay",Mo="ccv:relay.host";function W_(){try{const a=localStorage.getItem(Nx);if(!a)return null;const l=JSON.parse(a);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function wx(){localStorage.removeItem(Nx)}var ya,Mr,_a,Or,Dr,Gs,Ni,wi,Is,Ti,zr,Ei,Ai,zt,Us,xh,Tx,ji,yh;class P_{constructor(l){Vt(this,zt);Vt(this,ya,null);Vt(this,Mr,new Set);Vt(this,_a,null);Vt(this,Or,null);Vt(this,Dr,500);Vt(this,Gs,null);Vt(this,Ni,!1);Vt(this,wi,!1);Vt(this,Is,!1);Vt(this,Ti,null);Vt(this,zr,"Подключаемся…");Vt(this,Ei,0);Vt(this,Ai,[]);this.session=l}get connected(){return Be(this,wi)&&Be(this,Is)}get statusText(){return Be(this,zr)}get hostId(){return Be(this,Ti)}on(l){return Be(this,Mr).add(l),()=>Be(this,Mr).delete(l)}onReconnect(l){ft(this,Or,l)}onStatus(l){ft(this,_a,l)}connect(){Be(this,Ni)||xn(this,zt,xh).call(this)}send(l){if(!Be(this,wi)){Be(this,Ai).length<64&&Be(this,Ai).push(l);return}xn(this,zt,ji).call(this,{t:"client.frame",body:l})}close(){var l;ft(this,Ni,!0),Be(this,Gs)!==null&&window.clearTimeout(Be(this,Gs)),(l=Be(this,ya))==null||l.close()}}ya=new WeakMap,Mr=new WeakMap,_a=new WeakMap,Or=new WeakMap,Dr=new WeakMap,Gs=new WeakMap,Ni=new WeakMap,wi=new WeakMap,Is=new WeakMap,Ti=new WeakMap,zr=new WeakMap,Ei=new WeakMap,Ai=new WeakMap,zt=new WeakSet,Us=function(l){var i;Be(this,zr)!==l&&(ft(this,zr,l),(i=Be(this,_a))==null||i.call(this))},xh=async function(){if(Be(this,ya))return;if(!Be(this,Ti))try{ft(this,Ti,await e0(this.session.token))}catch(c){xn(this,zt,Us).call(this,c instanceof Error?c.message:String(c)),xn(this,zt,yh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${l}://${location.host}/relay/client`);ft(this,ya,i),i.addEventListener("open",()=>{xn(this,zt,ji).call(this,{t:"client.hello",protocol:F_,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}xn(this,zt,Tx).call(this,o)}),i.addEventListener("close",()=>{var c;ft(this,ya,null),ft(this,wi,!1),ft(this,Is,!1),xn(this,zt,Us).call(this,"Нет связи с сервером"),(c=Be(this,_a))==null||c.call(this),xn(this,zt,yh).call(this)}),i.addEventListener("error",()=>i.close())},Tx=function(l){var i,c,o,d,h,m,p;switch(l.t){case"client.ok":ft(this,Dr,500),xn(this,zt,ji).call(this,{t:"client.attach",hostId:Be(this,Ti)??"",...Be(this,Ei)>0?{sinceRseq:Be(this,Ei)}:{}});return;case"client.attached":ft(this,wi,!0),ft(this,Is,l.online),ft(this,Ei,l.rseq),xn(this,zt,Us).call(this,l.online?"Хост на связи":"Компьютер не на связи"),xn(this,zt,ji).call(this,{t:"client.frame",body:{type:"hello",protocol:jx,clientName:"ccv-web-relay"}});const x=Be(this,Ai);ft(this,Ai,[]);for(const y of x)xn(this,zt,ji).call(this,{t:"client.frame",body:y});(i=Be(this,Or))==null||i.call(this),(c=Be(this,_a))==null||c.call(this);return;case"host.frame":{l.rseq>0&&ft(this,Ei,l.rseq);const y=l.body;for(const j of Be(this,Mr))j(y);return}case"host.online":ft(this,Is,!0),xn(this,zt,Us).call(this,"Хост на связи"),(o=Be(this,Or))==null||o.call(this),(d=Be(this,_a))==null||d.call(this);return;case"host.offline":ft(this,Is,!1),xn(this,zt,Us).call(this,"Компьютер не на связи"),(h=Be(this,_a))==null||h.call(this);return;case"ping":xn(this,zt,ji).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){wx(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Mo),xn(this,zt,Us).call(this,"Этот компьютер отвязан от аккаунта"),ft(this,Ni,!0),(m=Be(this,ya))==null||m.close();return}l.code!=="offline"&&xn(this,zt,Us).call(this,l.message),(p=Be(this,_a))==null||p.call(this);return}},ji=function(l){var i;((i=Be(this,ya))==null?void 0:i.readyState)===WebSocket.OPEN&&Be(this,ya).send(JSON.stringify(l))},yh=function(){if(Be(this,Ni)||Be(this,Gs)!==null)return;const l=Be(this,Dr);ft(this,Dr,Math.min(l*2,1e4)),ft(this,Gs,window.setTimeout(()=>{ft(this,Gs,null),xn(this,zt,xh).call(this)},l))};async function e0(a){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Mo,l),l;const i=localStorage.getItem(Mo);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${a}`}});if(c.status===401)throw wx(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Mo,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Oo(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const t0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function n0(){if(Oo()==="local")return new J_(t0);const a=W_();return a?new P_(a):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const hl={items:[],pending:[],lastSeq:0,contextTokens:null},Pd={entries:[],total:0,loading:!1};function Ex(a){var l;return((l=a.entries[0])==null?void 0:l.seq)??1}function ab(a){return a.total>0&&Ex(a)>1}function l0(a,l){const i=new Set(a.entries.map(o=>o.seq));return{entries:[...a.entries,...l.entries.filter(o=>!i.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function a0(a){return Do(hl,a).items.map(l=>({...l,id:`h:${l.id}`}))}function Do(a,l){let i=a;for(const c of l)c.seq<=i.lastSeq||(i={...s0(i,c.event,c.seq),lastSeq:c.seq});return i}function s0(a,l,i){var o,d;const c=a.items;switch(l.kind){case"user.message":return da(a,{id:`u${i}`,kind:"user",text:l.text});case"assistant.delta":{const h=c.findIndex(p=>p.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const m=c[h];return br(a,h,{...m,text:m.text+l.text})}case"assistant.text":{const h=c.findIndex(p=>p.id===l.blockId),m={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?da(a,m):br(a,h,m)}case"thinking.delta":{const h=c.findIndex(p=>p.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"thinking",text:l.text});const m=c[h];return br(a,h,{...m,text:m.text+l.text})}case"assistant.thinking":{const h=c.findIndex(p=>p.id===l.blockId),m={id:l.blockId,kind:"thinking",text:l.text};return h===-1?da(a,m):br(a,h,m)}case"tool.use":return da(a,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(p=>p.kind==="tool"&&p.toolUseId===l.toolUseId);if(h===-1)return a;const m=c[h];return br(a,h,{...m,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...a,pending:[...a.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=a.pending.find(p=>p.requestId===l.requestId),m=a.pending.filter(p=>p.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const p=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(p!==-1){const x=c[p];return br({...a,pending:m},p,{...x,answers:l.answers})}}return l.decision==="allow"?{...a,pending:m}:da({...a,pending:m},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=a.items.map(p=>p.kind==="assistant"&&p.streaming?{...p,streaming:!1}:p),m=l.contextTokens??a.contextTokens;return da({...a,items:h,contextTokens:m},{id:`r${i}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?a:da(a,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return da(a,{id:`e${i}`,kind:"notice",tone:"error",text:l.message});case"state":return a;default:return a}}function da(a,l){return{...a,items:[...a.items,l]}}function br(a,l,i){const c=a.items.slice();return c[l]=i,{...a,items:c}}const _h="ccv:theme",eh=["system","light","dark"];function i0(){const[a,l]=_.useState(r0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=a==="dark"||a==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[a]);const i=_.useCallback(o=>{try{localStorage.setItem(_h,o)}catch{}l(o)},[]),c=_.useCallback(()=>{l(o=>{const d=eh[(eh.indexOf(o)+1)%eh.length];try{localStorage.setItem(_h,d)}catch{}return d})},[]);return[a,i,c]}function r0(){try{const a=localStorage.getItem(_h);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}const Ax=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Ci={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:"вопроса"}},c0=320,Cx="ccv:panes";function u0(a){return`--${a}-w`}function Rx(a,l){const i=Ci[a];return Math.round(Math.min(i.max,Math.max(i.min,l)))}function o0(){const a={};for(const l of Object.keys(Ci))a[l]=Ci[l].width;try{const l=localStorage.getItem(Cx);if(l){const i=JSON.parse(l);for(const c of Object.keys(Ci)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(a[c]=Rx(c,o))}}}catch{}return a}function f0(){const[a,l]=_.useState(o0),i=_.useCallback(h=>{try{localStorage.setItem(Cx,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,m)=>{l(p=>{const x=Rx(h,m);if(p[h]===x)return p;const y={...p,[h]:x};return i(y),y})},[i]),o=_.useCallback(h=>{l(m=>{const p={...m,[h]:Ci[h].width};return i(p),p})},[i]),d={};for(const h of Object.keys(Ci))d[u0(h)]=`${a[h]}px`;return{widths:a,style:d,setWidth:c,reset:o}}const th=260,Mx=120,d0=200,sb="ccv:terminal-h";function ib(a,l){return Math.round(Math.min(l,Math.max(Mx,a)))}function h0(){const[a,l]=_.useState(()=>{try{const d=localStorage.getItem(sb);if(d){const h=Number(d);if(Number.isFinite(h))return ib(h,1/0)}}catch{}return th}),i=_.useCallback(d=>{try{localStorage.setItem(sb,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const m=ib(d,h);l(p=>p===m?p:(i(m),m))},[i]),o=_.useCallback(()=>{l(th),i(th)},[i]);return{height:a,setHeight:c,reset:o}}function Mh(a){const[l,i]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(a).matches);return _.useEffect(()=>{const c=window.matchMedia(a),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[a]),l}const p0={height:0,offsetTop:0,offsetLeft:0};function rb(){if(typeof window>"u")return p0;const a=window.visualViewport;return a?{height:a.height,offsetTop:a.offsetTop,offsetLeft:a.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function m0(a){const[l,i]=_.useState(rb);return _.useEffect(()=>{if(!a)return;const c=window.visualViewport,o=()=>{const d=rb();i(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))},[a]),l}function Oh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Di=Oh();function Ox(a){Di=a}var ki={exec:()=>null};function xr(a){let l=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=l[c];return o||(o=a(c),l[c]=o),o}}function at(a,l=""){let i=typeof a=="string"?a:a.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(Kn.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,l)};return c}var g0=((a="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+a)}catch{return!1}})(),Kn={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:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:xr(a=>new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:xr(a=>new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:xr(a=>new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),headingBeginRegex:xr(a=>new RegExp(`^ {0,${a}}#`)),htmlBeginRegex:xr(a=>new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:xr(a=>new RegExp(`^ {0,${a}}>`))},b0=/^(?:[ \t]*(?:\n|$))+/,x0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,y0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Jc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,_0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Dh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zx=at(Dx).replace(/bull/g,Dh).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(),v0=at(Dx).replace(/bull/g,Dh).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(),zh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,S0=/^[^\n]+/,Lh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,j0=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k0=at(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Dh).getRegex(),Qo="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",Uh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,N0=at("^ {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",Uh).replace("tag",Qo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Lx=a=>at(zh).replace("hr",Jc).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",a).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex(),w0=Lx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),T0=Lx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),E0=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",T0).getRegex(),Hh={blockquote:E0,code:x0,def:j0,fences:y0,heading:_0,hr:Jc,html:N0,lheading:zx,list:k0,newline:b0,paragraph:w0,table:ki,text:S0},cb=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Jc).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",Qo).getRegex(),A0={...Hh,lheading:v0,table:cb,paragraph:at(zh).replace("hr",Jc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cb).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",Qo).getRegex()},C0={...Hh,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Uh).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:ki,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(zh).replace("hr",Jc).replace("heading",` *#{1,6} *[^
51
+ ]`).replace("lheading",zx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},R0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,M0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ux=/^( {2,}|\\)\n(?!\s*$)/,O0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lr=/[\p{P}\p{S}]/u,$o=/[\s\p{P}\p{S}]/u,Bh=/[^\s\p{P}\p{S}]/u,D0=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,$o).getRegex(),Hx=/(?!~)[\p{P}\p{S}]/u,z0=/(?!~)[\s\p{P}\p{S}]/u,L0=/(?:[^\s\p{P}\p{S}]|~)/u,U0=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",g0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Bx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,H0=at(Bx,"u").replace(/punct/g,Lr).getRegex(),B0=at(Bx,"u").replace(/punct/g,Hx).getRegex(),qx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",q0=at(qx,"gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),G0=at(qx,"gu").replace(/notPunctSpace/g,L0).replace(/punctSpace/g,z0).replace(/punct/g,Hx).getRegex(),I0=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),Y0=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Lr).getRegex(),V0="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",X0=at(V0,"gu").replace(/notPunctSpace/g,Bh).replace(/punctSpace/g,$o).replace(/punct/g,Lr).getRegex(),Q0=at(/\\(punct)/,"gu").replace(/punct/g,Lr).getRegex(),$0=at(/^<(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(),Z0=at(Uh).replace("(?:-->|$)","-->").getRegex(),K0=at("^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",Z0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Uo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,J0=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Uo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gx=at(/^!?\[(label)\]\[(ref)\]/).replace("label",Uo).replace("ref",Lh).getRegex(),Ix=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lh).getRegex(),F0=at("reflink|nolink(?!\\()","g").replace("reflink",Gx).replace("nolink",Ix).getRegex(),ub=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qh={_backpedal:ki,anyPunctuation:Q0,autolink:$0,blockSkip:U0,br:Ux,code:M0,del:ki,delLDelim:ki,delRDelim:ki,emStrongLDelim:H0,emStrongRDelimAst:q0,emStrongRDelimUnd:I0,escape:R0,link:J0,nolink:Ix,punctuation:D0,reflink:Gx,reflinkSearch:F0,tag:K0,text:O0,url:ki},W0={...qh,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",Uo).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uo).getRegex()},vh={...qh,emStrongRDelimAst:G0,emStrongLDelim:B0,delLDelim:Y0,delRDelim:X0,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ub).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:at(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ub).getRegex()},P0={...vh,br:at(Ux).replace("{2,}","*").getRegex(),text:at(vh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_o={normal:Hh,gfm:A0,pedantic:C0},zc={normal:qh,gfm:vh,breaks:P0,pedantic:W0},ev={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ob=a=>ev[a];function ga(a,l){if(l){if(Kn.escapeTest.test(a))return a.replace(Kn.escapeReplace,ob)}else if(Kn.escapeTestNoEncode.test(a))return a.replace(Kn.escapeReplaceNoEncode,ob);return a}function fb(a){try{a=encodeURI(a).replace(Kn.percentDecode,"%")}catch{return null}return a}function db(a,l){var d;let i=a.replace(Kn.findPipe,(h,m,p)=>{let x=!1,y=m;for(;--y>=0&&p[y]==="\\";)x=!x;return x?"|":" |"}),c=i.split(Kn.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(Kn.slashPipe,"|");return c}function zs(a,l,i){let c=a.length;if(c===0)return"";let o=0;for(;o<c&&a.charAt(c-o-1)===l;)o++;return a.slice(0,c-o)}function hb(a){let l=a.split(`
52
52
  `),i=l.length-1;for(;i>=0&&Kn.blankLine.test(l[i]);)i--;return l.length-i<=2?a:l.slice(0,i+1).join(`
53
- `)}function ev(a,l){if(a.indexOf(l[1])===-1)return-1;let i=0;for(let c=0;c<a.length;c++)if(a[c]==="\\")c++;else if(a[c]===l[0])i++;else if(a[c]===l[1]&&(i--,i<0))return c;return i>0?-2:-1}function tv(a,l=0){let i=l,c="";for(let o of a)if(o===" "){let d=4-i%4;c+=" ".repeat(d),i+=d}else c+=o,i++;return c}function pb(a,l,i,c,o){let d=l.href,h=l.title||null,p=a[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let m={type:a[0].charAt(0)==="!"?"image":"link",raw:i,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,m}function nv(a,l,i){let c=a.match(i.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
54
- `).map(d=>{let h=d.match(i.other.beginningSpace);if(h===null)return d;let[p]=h;return p.length>=o.length?d.slice(o.length):d}).join(`
55
- `)}var Ho=class{constructor(a){Nt(this,"options");Nt(this,"rules");Nt(this,"lexer");this.options=a||Di}space(a){let l=this.rules.block.newline.exec(a);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(a){let l=this.rules.block.code.exec(a);if(l){let i=this.options.pedantic?l[0]:hb(l[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(a){let l=this.rules.block.fences.exec(a);if(l){let i=l[0],c=nv(i,l[3]||"",this.rules);return{type:"code",raw:i,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(a){let l=this.rules.block.heading.exec(a);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){let c=zs(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:zs(l[0],`
53
+ `)}function tv(a,l){if(a.indexOf(l[1])===-1)return-1;let i=0;for(let c=0;c<a.length;c++)if(a[c]==="\\")c++;else if(a[c]===l[0])i++;else if(a[c]===l[1]&&(i--,i<0))return c;return i>0?-2:-1}function nv(a,l=0){let i=l,c="";for(let o of a)if(o===" "){let d=4-i%4;c+=" ".repeat(d),i+=d}else c+=o,i++;return c}function pb(a,l,i,c,o){let d=l.href,h=l.title||null,m=a[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let p={type:a[0].charAt(0)==="!"?"image":"link",raw:i,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,p}function lv(a,l,i){let c=a.match(i.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
54
+ `).map(d=>{let h=d.match(i.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
55
+ `)}var Ho=class{constructor(a){Nt(this,"options");Nt(this,"rules");Nt(this,"lexer");this.options=a||Di}space(a){let l=this.rules.block.newline.exec(a);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(a){let l=this.rules.block.code.exec(a);if(l){let i=this.options.pedantic?l[0]:hb(l[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(a){let l=this.rules.block.fences.exec(a);if(l){let i=l[0],c=lv(i,l[3]||"",this.rules);return{type:"code",raw:i,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(a){let l=this.rules.block.heading.exec(a);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){let c=zs(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:zs(l[0],`
56
56
  `),depth:l[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(a){let l=this.rules.block.hr.exec(a);if(l)return{type:"hr",raw:zs(l[0],`
57
57
  `)}}blockquote(a){let l=this.rules.block.blockquote.exec(a);if(l){let i=zs(l[0],`
58
58
  `).split(`
59
- `),c="",o="",d=[];for(;i.length>0;){let h=!1,p=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))p.push(i[m]),h=!0;else if(!h)p.push(i[m]);else break;i=i.slice(m);let x=p.join(`
59
+ `),c="",o="",d=[];for(;i.length>0;){let h=!1,m=[],p;for(p=0;p<i.length;p++)if(this.rules.other.blockquoteStart.test(i[p]))m.push(i[p]),h=!0;else if(!h)m.push(i[p]);else break;i=i.slice(p);let x=m.join(`
60
60
  `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
61
61
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
62
62
  ${x}`:x,o=o?`${o}
63
63
  ${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,i.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 C=v,N=C.raw+`
64
64
  `+i.join(`
65
- `),D=this.blockquote(N);d[d.length-1]=D,c=c.substring(0,c.length-C.raw.length)+D.raw,o=o.substring(0,o.length-C.text.length)+D.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,N=C.raw+`
65
+ `),L=this.blockquote(N);d[d.length-1]=L,c=c.substring(0,c.length-C.raw.length)+L.raw,o=o.substring(0,o.length-C.text.length)+L.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,N=C.raw+`
66
66
  `+i.join(`
67
- `),D=this.list(N);d[d.length-1]=D,c=c.substring(0,c.length-v.raw.length)+D.raw,o=o.substring(0,o.length-C.raw.length)+D.raw,i=N.substring(d.at(-1).raw.length).split(`
68
- `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(a){let l=this.rules.block.list.exec(a);if(l){let i=l[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let d=this.rules.other.listItemRegex(i),h=!1;for(;a;){let m=!1,x="",y="";if(!(l=d.exec(a))||this.rules.block.hr.test(a))break;x=l[0],a=a.substring(x.length);let j=tv(l[2].split(`
67
+ `),L=this.list(N);d[d.length-1]=L,c=c.substring(0,c.length-v.raw.length)+L.raw,o=o.substring(0,o.length-C.raw.length)+L.raw,i=N.substring(d.at(-1).raw.length).split(`
68
+ `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(a){let l=this.rules.block.list.exec(a);if(l){let i=l[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let d=this.rules.other.listItemRegex(i),h=!1;for(;a;){let p=!1,x="",y="";if(!(l=d.exec(a))||this.rules.block.hr.test(a))break;x=l[0],a=a.substring(x.length);let j=nv(l[2].split(`
69
69
  `,1)[0],l[1].length),v=a.split(`
70
70
  `,1)[0],C=!j.trim(),N=0;if(this.options.pedantic?(N=2,y=j.trimStart()):C?N=l[1].length+1:(N=j.search(this.rules.other.nonSpaceChar),N=N>4?1:N,y=j.slice(N),N+=l[1].length),C&&this.rules.other.blankLine.test(v)&&(x+=v+`
71
- `,a=a.substring(v.length+1),m=!0),!m){let D=this.rules.other.nextBulletRegex(N),B=this.rules.other.hrRegex(N),q=this.rules.other.fencesBeginRegex(N),z=this.rules.other.headingBeginRegex(N),X=this.rules.other.htmlBeginRegex(N),E=this.rules.other.blockquoteBeginRegex(N);for(;a;){let H=a.split(`
72
- `,1)[0],U;if(v=H,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),U=v):U=v.replace(this.rules.other.tabCharGlobal," "),q.test(v)||z.test(v)||X.test(v)||E.test(v)||D.test(v)||B.test(v))break;if(U.search(this.rules.other.nonSpaceChar)>=N||!v.trim())y+=`
73
- `+U.slice(N);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||q.test(j)||z.test(j)||B.test(j))break;y+=`
74
- `+v}C=!v.trim(),x+=H+`
75
- `,a=a.substring(H.length+1),j=U.slice(N)}}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 p=o.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let m of o.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let x=m.tokens[0];if(m.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){m.text=m.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(m.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};m.checked=j.checked,o.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=j.raw+m.tokens[0].raw,m.tokens[0].text=j.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(j)):m.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):m.tokens.unshift(j)}}else m.task&&(m.task=!1);if(!o.loose){let y=m.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 m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(a){let l=this.rules.block.html.exec(a);if(l){let i=hb(l[0]);return{type:"html",block:!0,raw:i,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:i}}}def(a){let l=this.rules.block.def.exec(a);if(l){let i=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:i,raw:zs(l[0],`
71
+ `,a=a.substring(v.length+1),p=!0),!p){let L=this.rules.other.nextBulletRegex(N),H=this.rules.other.hrRegex(N),$=this.rules.other.fencesBeginRegex(N),M=this.rules.other.headingBeginRegex(N),I=this.rules.other.htmlBeginRegex(N),E=this.rules.other.blockquoteBeginRegex(N);for(;a;){let X=a.split(`
72
+ `,1)[0],O;if(v=X,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),O=v):O=v.replace(this.rules.other.tabCharGlobal," "),$.test(v)||M.test(v)||I.test(v)||E.test(v)||L.test(v)||H.test(v))break;if(O.search(this.rules.other.nonSpaceChar)>=N||!v.trim())y+=`
73
+ `+O.slice(N);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||$.test(j)||M.test(j)||H.test(j))break;y+=`
74
+ `+v}C=!v.trim(),x+=X+`
75
+ `,a=a.substring(X.length+1),j=O.slice(N)}}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 p of o.items){this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]);let x=p.tokens[0];if(p.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){p.text=p.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(p.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};p.checked=j.checked,o.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=j.raw+p.tokens[0].raw,p.tokens[0].text=j.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(j)):p.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):p.tokens.unshift(j)}}else p.task&&(p.task=!1);if(!o.loose){let y=p.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 p of o.items){p.loose=!0;for(let x of p.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(a){let l=this.rules.block.html.exec(a);if(l){let i=hb(l[0]);return{type:"html",block:!0,raw:i,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:i}}}def(a){let l=this.rules.block.def.exec(a);if(l){let i=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:i,raw:zs(l[0],`
76
76
  `),href:c,title:o}}}table(a){var h;let l=this.rules.block.table.exec(a);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let i=db(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
77
77
  `):[],d={type:"table",raw:zs(l[0],`
78
- `),header:[],align:[],rows:[]};if(i.length===c.length){for(let p of c)this.rules.other.tableAlignRight.test(p)?d.align.push("right"):this.rules.other.tableAlignCenter.test(p)?d.align.push("center"):this.rules.other.tableAlignLeft.test(p)?d.align.push("left"):d.align.push(null);for(let p=0;p<i.length;p++)d.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:d.align[p]});for(let p of o)d.rows.push(db(p,d.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:d.align[x]})));return d}}lheading(a){let l=this.rules.block.lheading.exec(a);if(l){let i=l[1].trim();return{type:"heading",raw:zs(l[0],`
78
+ `),header:[],align:[],rows:[]};if(i.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<i.length;m++)d.header.push({text:i[m],tokens:this.lexer.inline(i[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(db(m,d.header.length).map((p,x)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:d.align[x]})));return d}}lheading(a){let l=this.rules.block.lheading.exec(a);if(l){let i=l[1].trim();return{type:"heading",raw:zs(l[0],`
79
79
  `),depth:l[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(a){let l=this.rules.block.paragraph.exec(a);if(l){let i=l[1].charAt(l[1].length-1)===`
80
- `?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:i,tokens:this.lexer.inline(i)}}}text(a){let l=this.rules.block.text.exec(a);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(a){let l=this.rules.inline.escape.exec(a);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(a){let l=this.rules.inline.tag.exec(a);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(a){let l=this.rules.inline.link.exec(a);if(l){let i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let d=zs(i.slice(0,-1),"\\");if((i.length-d.length)%2===0)return}else{let d=ev(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?c=c.slice(1):c=c.slice(1,-1)),pb(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(a,l){let i;if((i=this.rules.inline.reflink.exec(a))||(i=this.rules.inline.nolink.exec(a))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=i[0].charAt(0);return{type:"text",raw:d,text:d}}return pb(i,o,i[0],this.lexer,this.rules)}}emStrong(a,l,i=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,p=o,m=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*a.length+o);(c=x.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){p+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){m+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+m);let y=[...c[0]][0].length,j=a.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let C=j.slice(1,-1);return{type:"em",raw:j,text:C,tokens:this.lexer.inlineTokens(C)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(a){let l=this.rules.inline.code.exec(a);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(a){let l=this.rules.inline.br.exec(a);if(l)return{type:"br",raw:l[0]}}del(a,l,i=""){let c=this.rules.inline.delLDelim.exec(a);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,p=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*a.length+o);(c=m.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){p+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p);let x=[...c[0]][0].length,y=a.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(a){let l=this.rules.inline.autolink.exec(a);if(l){let i,c;return l[2]==="@"?(i=l[1],c="mailto:"+i):(i=l[1],c=i),{type:"link",raw:l[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(a){var i;let l;if(l=this.rules.inline.url.exec(a)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((i=this.rules.inline._backpedal.exec(l[0]))==null?void 0:i[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(a){let l=this.rules.inline.text.exec(a);if(l){let i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},$l=class Sh{constructor(l){Nt(this,"tokens");Nt(this,"options");Nt(this,"state");Nt(this,"inlineQueue");Nt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Di,this.options.tokenizer=this.options.tokenizer||new Ho,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 i={other:Kn,block:_o.normal,inline:zc.normal};this.options.pedantic?(i.block=_o.pedantic,i.inline=zc.pedantic):this.options.gfm&&(i.block=_o.gfm,this.options.breaks?i.inline=zc.breaks:i.inline=zc.gfm),this.tokenizer.rules=i}static get rules(){return{block:_o,inline:zc}}static lex(l,i){return new Sh(i).lex(l)}static lexInline(l,i){return new Sh(i).inlineTokens(l)}lex(l){l=l.replace(Kn.carriageReturn,`
81
- `),this.blockTokens(l,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],c=!1){var d,h,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(Kn.tabCharGlobal," ").replace(Kn.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let m;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(m=y.call({lexer:this},l,i))?(l=l.substring(m.raw.length),i.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);let y=i.at(-1);m.raw.length===1&&y!==void 0?y.raw+=`
82
- `:i.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
80
+ `?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:i,tokens:this.lexer.inline(i)}}}text(a){let l=this.rules.block.text.exec(a);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(a){let l=this.rules.inline.escape.exec(a);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(a){let l=this.rules.inline.tag.exec(a);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(a){let l=this.rules.inline.link.exec(a);if(l){let i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let d=zs(i.slice(0,-1),"\\");if((i.length-d.length)%2===0)return}else{let d=tv(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?c=c.slice(1):c=c.slice(1,-1)),pb(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(a,l){let i;if((i=this.rules.inline.reflink.exec(a))||(i=this.rules.inline.nolink.exec(a))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=i[0].charAt(0);return{type:"text",raw:d,text:d}}return pb(i,o,i[0],this.lexer,this.rules)}}emStrong(a,l,i=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,m=o,p=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*a.length+o);(c=x.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){p+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+p);let y=[...c[0]][0].length,j=a.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let C=j.slice(1,-1);return{type:"em",raw:j,text:C,tokens:this.lexer.inlineTokens(C)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(a){let l=this.rules.inline.code.exec(a);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(a){let l=this.rules.inline.br.exec(a);if(l)return{type:"br",raw:l[0]}}del(a,l,i=""){let c=this.rules.inline.delLDelim.exec(a);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,m=o,p=this.rules.inline.delRDelim;for(p.lastIndex=0,l=l.slice(-1*a.length+o);(c=p.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let x=[...c[0]][0].length,y=a.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(a){let l=this.rules.inline.autolink.exec(a);if(l){let i,c;return l[2]==="@"?(i=l[1],c="mailto:"+i):(i=l[1],c=i),{type:"link",raw:l[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(a){var i;let l;if(l=this.rules.inline.url.exec(a)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((i=this.rules.inline._backpedal.exec(l[0]))==null?void 0:i[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(a){let l=this.rules.inline.text.exec(a);if(l){let i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},$l=class Sh{constructor(l){Nt(this,"tokens");Nt(this,"options");Nt(this,"state");Nt(this,"inlineQueue");Nt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Di,this.options.tokenizer=this.options.tokenizer||new Ho,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 i={other:Kn,block:_o.normal,inline:zc.normal};this.options.pedantic?(i.block=_o.pedantic,i.inline=zc.pedantic):this.options.gfm&&(i.block=_o.gfm,this.options.breaks?i.inline=zc.breaks:i.inline=zc.gfm),this.tokenizer.rules=i}static get rules(){return{block:_o,inline:zc}}static lex(l,i){return new Sh(i).lex(l)}static lexInline(l,i){return new Sh(i).inlineTokens(l)}lex(l){l=l.replace(Kn.carriageReturn,`
81
+ `),this.blockTokens(l,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(Kn.tabCharGlobal," ").replace(Kn.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let p;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(p=y.call({lexer:this},l,i))?(l=l.substring(p.raw.length),i.push(p),!0):!1))continue;if(p=this.tokenizer.space(l)){l=l.substring(p.raw.length);let y=i.at(-1);p.raw.length===1&&y!==void 0?y.raw+=`
82
+ `:i.push(p);continue}if(p=this.tokenizer.code(l)){l=l.substring(p.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
83
83
  `)?"":`
84
- `)+m.raw,y.text+=`
85
- `+m.text,this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
84
+ `)+p.raw,y.text+=`
85
+ `+p.text,this.inlineQueue.at(-1).src=y.text):i.push(p);continue}if(p=this.tokenizer.fences(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.heading(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.hr(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.blockquote(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.list(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.html(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.def(l)){l=l.substring(p.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
86
86
  `)?"":`
87
- `)+m.raw,y.text+=`
88
- `+m.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},i.push(m));continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),i.push(m);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=l.substring(0,y+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let y=i.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
87
+ `)+p.raw,y.text+=`
88
+ `+p.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title},i.push(p));continue}if(p=this.tokenizer.table(l)){l=l.substring(p.raw.length),i.push(p);continue}if(p=this.tokenizer.lheading(l)){l=l.substring(p.raw.length),i.push(p);continue}let x=l;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(C=>{v=C.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=l.substring(0,y+1))}if(this.state.top&&(p=this.tokenizer.paragraph(x))){let y=i.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
89
89
  `)?"":`
90
- `)+m.raw,y.text+=`
91
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(m),c=x.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
90
+ `)+p.raw,y.text+=`
91
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(p),c=x.length!==l.length,l=l.substring(p.raw.length);continue}if(p=this.tokenizer.text(l)){l=l.substring(p.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
92
92
  `)?"":`
93
- `)+m.raw,y.text+=`
94
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,i}inline(l,i=[]){return this.inlineQueue.push({src:l,tokens:i}),i}inlineTokens(l,i=[]){var p,m,x,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,C=>v.includes(C.slice(C.lastIndexOf("[")+1,-1))?"["+"a".repeat(C.length-2)+"]":C))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,C,N)=>{let D=N?N.length:0;return v.slice(0,D)+"["+"a".repeat(v.length-D-2)+"]"}),c=((m=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:m.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(N=>(v=N.call({lexer:this},l,i))?(l=l.substring(v.raw.length),i.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let N=i.at(-1);v.type==="text"&&(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):i.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),i.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),i.push(v);continue}let C=l;if((j=this.options.extensions)!=null&&j.startInline){let N=1/0,D=l.slice(1),B;this.options.extensions.startInline.forEach(q=>{B=q.call({lexer:this},D),typeof B=="number"&&B>=0&&(N=Math.min(N,B))}),N<1/0&&N>=0&&(C=l.substring(0,N+1))}if(v=this.tokenizer.inlineText(C)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let N=i.at(-1);(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):i.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return i}infiniteLoopError(l){let i="Infinite loop on byte: "+l;if(this.options.silent)console.error(i);else throw new Error(i)}},Bo=class{constructor(a){Nt(this,"options");Nt(this,"parser");this.options=a||Di}space(a){return""}code({text:a,lang:l,escaped:i}){var d;let c=(d=(l||"").match(Kn.notSpaceStart))==null?void 0:d[0],o=a.replace(Kn.endingNewline,"")+`
93
+ `)+p.raw,y.text+=`
94
+ `+p.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(p);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,i}inline(l,i=[]){return this.inlineQueue.push({src:l,tokens:i}),i}inlineTokens(l,i=[]){var m,p,x,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,C=>v.includes(C.slice(C.lastIndexOf("[")+1,-1))?"["+"a".repeat(C.length-2)+"]":C))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,C,N)=>{let L=N?N.length:0;return v.slice(0,L)+"["+"a".repeat(v.length-L-2)+"]"}),c=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(N=>(v=N.call({lexer:this},l,i))?(l=l.substring(v.raw.length),i.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let N=i.at(-1);v.type==="text"&&(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):i.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),i.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),i.push(v);continue}let C=l;if((j=this.options.extensions)!=null&&j.startInline){let N=1/0,L=l.slice(1),H;this.options.extensions.startInline.forEach($=>{H=$.call({lexer:this},L),typeof H=="number"&&H>=0&&(N=Math.min(N,H))}),N<1/0&&N>=0&&(C=l.substring(0,N+1))}if(v=this.tokenizer.inlineText(C)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let N=i.at(-1);(N==null?void 0:N.type)==="text"?(N.raw+=v.raw,N.text+=v.text):i.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return i}infiniteLoopError(l){let i="Infinite loop on byte: "+l;if(this.options.silent)console.error(i);else throw new Error(i)}},Bo=class{constructor(a){Nt(this,"options");Nt(this,"parser");this.options=a||Di}space(a){return""}code({text:a,lang:l,escaped:i}){var d;let c=(d=(l||"").match(Kn.notSpaceStart))==null?void 0:d[0],o=a.replace(Kn.endingNewline,"")+`
95
95
  `;return c?'<pre><code class="language-'+ga(c)+'">'+(i?o:ga(o,!0))+`</code></pre>
96
96
  `:"<pre><code>"+(i?o:ga(o,!0))+`</code></pre>
97
97
  `}blockquote({tokens:a}){return`<blockquote>
98
98
  ${this.parser.parse(a)}</blockquote>
99
99
  `}html({text:a}){return a}def(a){return""}heading({tokens:a,depth:l}){return`<h${l}>${this.parser.parseInline(a)}</h${l}>
100
100
  `}hr(a){return`<hr>
101
- `}list(a){let l=a.ordered,i=a.start,c="";for(let h=0;h<a.items.length;h++){let p=a.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",d=l&&i!==1?' start="'+i+'"':"";return"<"+o+d+`>
101
+ `}list(a){let l=a.ordered,i=a.start,c="";for(let h=0;h<a.items.length;h++){let m=a.items[h];c+=this.listitem(m)}let o=l?"ol":"ul",d=l&&i!==1?' start="'+i+'"':"";return"<"+o+d+`>
102
102
  `+c+"</"+o+`>
103
103
  `}listitem(a){return`<li>${this.parser.parse(a.tokens)}</li>
104
104
  `}checkbox({checked:a}){return"<input "+(a?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:a}){return`<p>${this.parser.parseInline(a)}</p>
@@ -109,26 +109,26 @@ ${this.parser.parse(a)}</blockquote>
109
109
  `}tablerow({text:a}){return`<tr>
110
110
  ${a}</tr>
111
111
  `}tablecell(a){let l=this.parser.parseInline(a.tokens),i=a.header?"th":"td";return(a.align?`<${i} align="${a.align}">`:`<${i}>`)+l+`</${i}>
112
- `}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${ga(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:l,tokens:i}){let c=this.parser.parseInline(i),o=fb(a);if(o===null)return c;a=o;let d='<a href="'+a+'"';return l&&(d+=' title="'+ga(l)+'"'),d+=">"+c+"</a>",d}image({href:a,title:l,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=fb(a);if(o===null)return ga(i);a=o;let d=`<img src="${a}" alt="${ga(i)}"`;return l&&(d+=` title="${ga(l)}"`),d+=">",d}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:ga(a.text)}},Gh=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},Zl=class jh{constructor(l){Nt(this,"options");Nt(this,"renderer");Nt(this,"textRenderer");this.options=l||Di,this.options.renderer=this.options.renderer||new Bo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gh}static parse(l,i){return new jh(i).parse(l)}static parseInline(l,i){return new jh(i).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let i="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let m=h,x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.type)){i+=x||"";continue}}let p=h;switch(p.type){case"space":{i+=this.renderer.space(p);break}case"hr":{i+=this.renderer.hr(p);break}case"heading":{i+=this.renderer.heading(p);break}case"code":{i+=this.renderer.code(p);break}case"table":{i+=this.renderer.table(p);break}case"blockquote":{i+=this.renderer.blockquote(p);break}case"list":{i+=this.renderer.list(p);break}case"checkbox":{i+=this.renderer.checkbox(p);break}case"html":{i+=this.renderer.html(p);break}case"def":{i+=this.renderer.def(p);break}case"paragraph":{i+=this.renderer.paragraph(p);break}case"text":{i+=this.renderer.text(p);break}default:{let m='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}parseInline(l,i=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let p=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[p.type]){let x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){c+=x||"";continue}}let m=p;switch(m.type){case"escape":{c+=i.text(m);break}case"html":{c+=i.html(m);break}case"link":{c+=i.link(m);break}case"image":{c+=i.image(m);break}case"checkbox":{c+=i.checkbox(m);break}case"strong":{c+=i.strong(m);break}case"em":{c+=i.em(m);break}case"codespan":{c+=i.codespan(m);break}case"br":{c+=i.br(m);break}case"del":{c+=i.del(m);break}case"text":{c+=i.text(m);break}default:{let x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Ro,Gc=(Ro=class{constructor(a){Nt(this,"options");Nt(this,"block");this.options=a||Di}preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(a=this.block){return a?$l.lex:$l.lexInline}provideParser(a=this.block){return a?Zl.parse:Zl.parseInline}},Nt(Ro,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Nt(Ro,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ro),lv=class{constructor(...a){Nt(this,"defaults",Oh());Nt(this,"options",this.setOptions);Nt(this,"parse",this.parseMarkdown(!0));Nt(this,"parseInline",this.parseMarkdown(!1));Nt(this,"Parser",Zl);Nt(this,"Renderer",Bo);Nt(this,"TextRenderer",Gh);Nt(this,"Lexer",$l);Nt(this,"Tokenizer",Ho);Nt(this,"Hooks",Gc);this.use(...a)}walkTokens(a,l){var c,o;let i=[];for(let d of a)switch(i=i.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let p of h.header)i=i.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let m of p)i=i.concat(this.walkTokens(m.tokens,l));break}case"list":{let h=d;i=i.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(p=>{let m=h[p].flat(1/0);i=i.concat(this.walkTokens(m,l))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,l)))}}return i}use(...a){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let p=o.renderer.apply(this,h);return p===!1&&(p=d.apply(this,h)),p}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),i.renderer){let o=this.defaults.renderer||new Bo(this.defaults);for(let d in i.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,p=i.renderer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Ho(this.defaults);for(let d in i.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,p=i.tokenizer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Gc;for(let d in i.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,p=i.hooks[h],m=o[h];Gc.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Gc.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await p.call(o,x);return m.call(o,j)})();let y=p.call(o,x);return m.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await p.apply(o,x);return j===!1&&(j=await m.apply(o,x)),j})();let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,d=i.walkTokens;c.walkTokens=function(h){let p=[];return p.push(d.call(this,h)),o&&(p=p.concat(o.call(this,h))),p}}this.defaults={...this.defaults,...c}}),this}setOptions(a){return this.defaults={...this.defaults,...a},this}lexer(a,l){return $l.lex(a,l??this.defaults)}parser(a,l){return Zl.parse(a,l??this.defaults)}parseMarkdown(a){return(l,i)=>{let c={...i},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=a),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,p=await(o.hooks?await o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(a):a?Zl.parse:Zl.parseInline)(m,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(a):a?Zl.parse:Zl.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return d(h)}}}onError(a,l){return i=>{if(i.message+=`
113
- Please report this to https://github.com/markedjs/marked.`,a){let c="<p>An error occurred:</p><pre>"+ga(i.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(i);throw i}}},Oi=new lv;function gt(a,l){return Oi.parse(a,l)}gt.options=gt.setOptions=function(a){return Oi.setOptions(a),gt.defaults=Oi.defaults,Mx(gt.defaults),gt};gt.getDefaults=Oh;gt.defaults=Di;gt.use=function(...a){return Oi.use(...a),gt.defaults=Oi.defaults,Mx(gt.defaults),gt};gt.walkTokens=function(a,l){return Oi.walkTokens(a,l)};gt.parseInline=Oi.parseInline;gt.Parser=Zl;gt.parser=Zl.parse;gt.Renderer=Bo;gt.TextRenderer=Gh;gt.Lexer=$l;gt.lexer=$l.lex;gt.Tokenizer=Ho;gt.Hooks=Gc;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Zl.parse;$l.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 mb(a,l){(l==null||l>a.length)&&(l=a.length);for(var i=0,c=Array(l);i<l;i++)c[i]=a[i];return c}function av(a){if(Array.isArray(a))return a}function sv(a,l){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var c,o,d,h,p=[],m=!0,x=!1;try{if(d=(i=i.call(a)).next,l!==0)for(;!(m=(c=d.call(i)).done)&&(p.push(c.value),p.length!==l);m=!0);}catch(y){x=!0,o=y}finally{try{if(!m&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function iv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rv(a,l){return av(a)||sv(a,l)||cv(a,l)||iv()}function cv(a,l){if(a){if(typeof a=="string")return mb(a,l);var i={}.toString.call(a).slice(8,-1);return i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set"?Array.from(a):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mb(a,l):void 0}}const Ix=Object.entries,gb=Object.setPrototypeOf,uv=Object.isFrozen,ov=Object.getPrototypeOf,fv=Object.getOwnPropertyDescriptor;let Bn=Object.freeze,qn=Object.seal,Sr=Object.create,Yx=typeof Reflect<"u"&&Reflect,kh=Yx.apply,Nh=Yx.construct;Bn||(Bn=function(l){return l});qn||(qn=function(l){return l});kh||(kh=function(l,i){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(i,o)});Nh||(Nh=function(l){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new l(...c)});const yr=xn(Array.prototype.forEach),dv=xn(Array.prototype.lastIndexOf),bb=xn(Array.prototype.pop),_r=xn(Array.prototype.push),hv=xn(Array.prototype.splice),qs=Array.isArray,Ic=xn(String.prototype.toLowerCase),nh=xn(String.prototype.toString),xb=xn(String.prototype.match),Lc=xn(String.prototype.replace),yb=xn(String.prototype.indexOf),pv=xn(String.prototype.trim),mv=xn(Number.prototype.toString),gv=xn(Boolean.prototype.toString),_b=typeof BigInt>"u"?null:xn(BigInt.prototype.toString),vb=typeof Symbol>"u"?null:xn(Symbol.prototype.toString),An=xn(Object.prototype.hasOwnProperty),Uc=xn(Object.prototype.toString),En=xn(RegExp.prototype.test),_i=bv(TypeError);function xn(a){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return kh(a,l,c)}}function bv(a){return function(){for(var l=arguments.length,i=new Array(l),c=0;c<l;c++)i[c]=arguments[c];return Nh(a,i)}}function lt(a,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ic;if(gb&&gb(a,null),!qs(l))return a;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=i(o);d!==o&&(uv(l)||(l[c]=d),o=d)}a[o]=!0}return a}function xv(a){for(let l=0;l<a.length;l++)An(a,l)||(a[l]=null);return a}function ll(a){const l=Sr(null);for(const c of Ix(a)){var i=rv(c,2);const o=i[0],d=i[1];An(a,o)&&(qs(d)?l[o]=xv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=ll(d):l[o]=d)}return l}function yv(a){switch(typeof a){case"string":return a;case"number":return mv(a);case"boolean":return gv(a);case"bigint":return _b?_b(a):"0";case"symbol":return vb?vb(a):"Symbol()";case"undefined":return Uc(a);case"function":case"object":{if(a===null)return Uc(a);const l=a,i=ba(l,"toString");if(typeof i=="function"){const c=i(l);return typeof c=="string"?c:Uc(c)}return Uc(a)}default:return Uc(a)}}function ba(a,l){for(;a!==null;){const c=fv(a,l);if(c){if(c.get)return xn(c.get);if(typeof c.value=="function")return xn(c.value)}a=ov(a)}function i(){return null}return i}function _v(a){try{return En(a,""),!0}catch{return!1}}const Sb=Bn(["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"]),lh=Bn(["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"]),ah=Bn(["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"]),vv=Bn(["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"]),sh=Bn(["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"]),Sv=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jb=Bn(["#text"]),kb=Bn(["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"]),ih=Bn(["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"]),Nb=Bn(["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"]),vo=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jv=qn(/{{[\w\W]*|^[\w\W]*}}/g),kv=qn(/<%[\w\W]*|^[\w\W]*%>/g),Nv=qn(/\${[\w\W]*/g),wv=qn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tv=qn(/^aria-[\-\w]+$/),wb=qn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ev=qn(/^(?:\w+script|data):/i),Av=qn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Cv=qn(/^html$/i),Rv=qn(/^[a-z][.\w]*(-[.\w]+)+$/i),Tb=qn(/<[/\w!]/g),Eb=qn(/<[/\w]/g),Mv=qn(/<\/no(script|embed|frames)/i),Ov=qn(/\/>/i),Nl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Dv=function(){return typeof window>"u"?null:window},zv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Ab=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ls=function(l,i,c,o){return An(l,i)&&qs(l[i])?lt(o.base?ll(o.base):{},l[i],o.transform):c};function Vx(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dv();const l=fe=>Vx(fe);if(l.version="3.4.12",l.removed=[],!a||!a.document||a.document.nodeType!==Nl.document||!a.Element)return l.isSupported=!1,l;let i=a.document;const c=i,o=c.currentScript;a.DocumentFragment;const d=a.HTMLTemplateElement,h=a.Node,p=a.Element,m=a.NodeFilter,x=a.NamedNodeMap;x===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const y=a.DOMParser,j=a.trustedTypes,v=p.prototype,C=ba(v,"cloneNode"),N=ba(v,"remove"),D=ba(v,"nextSibling"),B=ba(v,"childNodes"),q=ba(v,"parentNode"),z=ba(v,"shadowRoot"),X=ba(v,"attributes"),E=h&&h.prototype?ba(h.prototype,"nodeType"):null,H=h&&h.prototype?ba(h.prototype,"nodeName"):null;if(typeof d=="function"){const fe=i.createElement("template");fe.content&&fe.content.ownerDocument&&(i=fe.content.ownerDocument)}let U,M="",P,ie=!1,de=0;const W=function(){if(de>0)throw _i('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.')},se=function(k){W(),de++;try{return U.createHTML(k)}finally{de--}},ge=function(k){W(),de++;try{return U.createScriptURL(k)}finally{de--}},je=function(){return ie||(P=zv(j,o),ie=!0),P},me=i,O=me.implementation,te=me.createNodeIterator,Y=me.createDocumentFragment,oe=me.getElementsByTagName,xe=c.importNode;let w=Ab();l.isSupported=typeof Ix=="function"&&typeof q=="function"&&O&&O.createHTMLDocument!==void 0;const J=jv,ue=kv,he=Nv,Ne=wv,Ae=Tv,qe=Ev,st=Av,Ze=Rv;let Ut=wb,Le=null;const dt=lt({},[...Sb,...lh,...ah,...sh,...jb]);let Ke=null;const Ie=lt({},[...kb,...ih,...Nb,...vo]);let Fe=Object.seal(Sr(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}})),ht=null,It=null;const vt=Object.seal(Sr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Gn=!0,Jt=!0,Ft=!1,In=!0,Xt=!1,ct=!0,Sn=!1,jn=!1,yn=null,Qt=null,kn=!1,Nn=!1,Ht=!1,Wt=!1,K=!0,ce=!1;const we="user-content-";let Ce=!0,bt=!1,T={},Q=null;const Se=lt({},["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 Me=null;const He=lt({},["audio","video","img","source","image","track"]);let Cn=null;const Ul=lt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",_n="http://www.w3.org/1999/xhtml";let Tt=_n,Tl=!1,Sa=null;const ja=lt({},[Fn,Yn,_n],nh),Vs=Bn(["mi","mo","mn","ms","mtext"]);let Hl=lt({},Vs);const Jl=Bn(["annotation-xml"]);let Rn=lt({},Jl);const ka=lt({},["title","style","font","a","script"]);let ml=null;const al=["application/xhtml+xml","text/html"],$t="text/html";let Je=null,Wn=null;const Xs=i.createElement("form"),Li=function(k){return k instanceof RegExp||k instanceof Function},Qs=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wn&&Wn===k)return;(!k||typeof k!="object")&&(k={}),k=ll(k),ml=al.indexOf(k.PARSER_MEDIA_TYPE)===-1?$t:k.PARSER_MEDIA_TYPE,Je=ml==="application/xhtml+xml"?nh:Ic,Le=Ls(k,"ALLOWED_TAGS",dt,{transform:Je}),Ke=Ls(k,"ALLOWED_ATTR",Ie,{transform:Je}),Sa=Ls(k,"ALLOWED_NAMESPACES",ja,{transform:nh}),Cn=Ls(k,"ADD_URI_SAFE_ATTR",Ul,{transform:Je,base:Ul}),Me=Ls(k,"ADD_DATA_URI_TAGS",He,{transform:Je,base:He}),Q=Ls(k,"FORBID_CONTENTS",Se,{transform:Je}),ht=Ls(k,"FORBID_TAGS",ll({}),{transform:Je}),It=Ls(k,"FORBID_ATTR",ll({}),{transform:Je}),T=An(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?ll(k.USE_PROFILES):k.USE_PROFILES:!1,Gn=k.ALLOW_ARIA_ATTR!==!1,Jt=k.ALLOW_DATA_ATTR!==!1,Ft=k.ALLOW_UNKNOWN_PROTOCOLS||!1,In=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xt=k.SAFE_FOR_TEMPLATES||!1,ct=k.SAFE_FOR_XML!==!1,Sn=k.WHOLE_DOCUMENT||!1,Nn=k.RETURN_DOM||!1,Ht=k.RETURN_DOM_FRAGMENT||!1,Wt=k.RETURN_TRUSTED_TYPE||!1,kn=k.FORCE_BODY||!1,K=k.SANITIZE_DOM!==!1,ce=k.SANITIZE_NAMED_PROPS||!1,Ce=k.KEEP_CONTENT!==!1,bt=k.IN_PLACE||!1,Ut=_v(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:wb,Tt=typeof k.NAMESPACE=="string"?k.NAMESPACE:_n,Hl=An(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?ll(k.MATHML_TEXT_INTEGRATION_POINTS):lt({},Vs),Rn=An(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?ll(k.HTML_INTEGRATION_POINTS):lt({},Jl);const G=An(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?ll(k.CUSTOM_ELEMENT_HANDLING):Sr(null);if(Fe=Sr(null),An(G,"tagNameCheck")&&Li(G.tagNameCheck)&&(Fe.tagNameCheck=G.tagNameCheck),An(G,"attributeNameCheck")&&Li(G.attributeNameCheck)&&(Fe.attributeNameCheck=G.attributeNameCheck),An(G,"allowCustomizedBuiltInElements")&&typeof G.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=G.allowCustomizedBuiltInElements),qn(Fe),Xt&&(Jt=!1),Ht&&(Nn=!0),T&&(Le=lt({},jb),Ke=Sr(null),T.html===!0&&(lt(Le,Sb),lt(Ke,kb)),T.svg===!0&&(lt(Le,lh),lt(Ke,ih),lt(Ke,vo)),T.svgFilters===!0&&(lt(Le,ah),lt(Ke,ih),lt(Ke,vo)),T.mathMl===!0&&(lt(Le,sh),lt(Ke,Nb),lt(Ke,vo))),vt.tagCheck=null,vt.attributeCheck=null,An(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?vt.tagCheck=k.ADD_TAGS:qs(k.ADD_TAGS)&&(Le===dt&&(Le=ll(Le)),lt(Le,k.ADD_TAGS,Je))),An(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?vt.attributeCheck=k.ADD_ATTR:qs(k.ADD_ATTR)&&(Ke===Ie&&(Ke=ll(Ke)),lt(Ke,k.ADD_ATTR,Je))),An(k,"ADD_URI_SAFE_ATTR")&&qs(k.ADD_URI_SAFE_ATTR)&&lt(Cn,k.ADD_URI_SAFE_ATTR,Je),An(k,"FORBID_CONTENTS")&&qs(k.FORBID_CONTENTS)&&(Q===Se&&(Q=ll(Q)),lt(Q,k.FORBID_CONTENTS,Je)),An(k,"ADD_FORBID_CONTENTS")&&qs(k.ADD_FORBID_CONTENTS)&&(Q===Se&&(Q=ll(Q)),lt(Q,k.ADD_FORBID_CONTENTS,Je)),Ce&&(Le["#text"]=!0),Sn&&lt(Le,["html","head","body"]),Le.table&&(lt(Le,["tbody"]),delete ht.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw _i('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw _i('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const re=U;U=k.TRUSTED_TYPES_POLICY;try{M=se("")}catch(ye){throw U=re,ye}}else k.TRUSTED_TYPES_POLICY===null?(U=void 0,M=""):(U===void 0&&(U=je()),U&&typeof M=="string"&&(M=se("")));Bn&&Bn(k),Wn=k},Fl=lt({},[...lh,...ah,...vv]),Wl=lt({},[...sh,...Sv]),Na=function(k,G,re){return G.namespaceURI===_n?k==="svg":G.namespaceURI===Fn?k==="svg"&&(re==="annotation-xml"||Hl[re]):!!Fl[k]},Pl=function(k,G,re){return G.namespaceURI===_n?k==="math":G.namespaceURI===Yn?k==="math"&&Rn[re]:!!Wl[k]},gl=function(k,G,re){return G.namespaceURI===Yn&&!Rn[re]||G.namespaceURI===Fn&&!Hl[re]?!1:!Wl[k]&&(ka[k]||!Fl[k])},Pt=function(k){let G=q(k);(!G||!G.tagName)&&(G={namespaceURI:Tt,tagName:"template"});const re=Ic(k.tagName),ye=Ic(G.tagName);return Sa[k.namespaceURI]?k.namespaceURI===Yn?Na(re,G,ye):k.namespaceURI===Fn?Pl(re,G,ye):k.namespaceURI===_n?gl(re,G,ye):!!(ml==="application/xhtml+xml"&&Sa[k.namespaceURI]):!1},en=function(k){_r(l.removed,{element:k});try{q(k).removeChild(k)}catch{if(N(k),!q(k))throw _i("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ut=function(k){Xn(k);const G=B(k);if(G){const ye=[];yr(G,Re=>{_r(ye,Re)}),yr(ye,Re=>{try{N(Re)}catch{}})}const re=X(k);if(re)for(let ye=re.length-1;ye>=0;--ye){const Re=re[ye],De=Re&&Re.name;if(typeof De=="string")try{k.removeAttribute(De)}catch{}}},Vn=function(k,G){try{_r(l.removed,{attribute:G.getAttributeNode(k),from:G})}catch{_r(l.removed,{attribute:null,from:G})}if(G.removeAttribute(k),k==="is")if(Nn||Ht)try{en(G)}catch{}else try{G.setAttribute(k,"")}catch{}},wa=function(k){const G=X(k);if(G)for(let re=G.length-1;re>=0;--re){const ye=G[re],Re=ye&&ye.name;if(!(typeof Re!="string"||Ke[Je(Re)]))try{k.removeAttribute(Re)}catch{}}},Xn=function(k){const G=[k];for(;G.length>0;){const re=G.pop();(E?E(re):re.nodeType)===Nl.element&&wa(re);const Re=B(re);if(Re)for(let De=Re.length-1;De>=0;--De)G.push(Re[De])}},Qn=function(k){if(!ct)return;const G=[k];for(;G.length>0;){const re=G.pop(),ye=E?E(re):re.nodeType;if(ye===Nl.processingInstruction||ye===Nl.comment&&En(Eb,re.data)){try{N(re)}catch{}continue}if(ye===Nl.element){const De=re,pt=Je(H?H(re):re.nodeName);try{De.hasAttribute&&De.hasAttribute("patchsrc")&&De.removeAttribute("patchsrc"),De.hasAttribute&&De.hasAttribute("for")&&pt!=="label"&&pt!=="output"&&De.removeAttribute("for")}catch{}}const Re=B(re);if(Re)for(let De=Re.length-1;De>=0;--De)G.push(Re[De])}},sl=function(k){let G=null,re=null;if(kn)k="<remove></remove>"+k;else{const De=xb(k,/^[\r\n\t ]+/);re=De&&De[0]}ml==="application/xhtml+xml"&&Tt===_n&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const ye=U?se(k):k;if(Tt===_n)try{G=new y().parseFromString(ye,ml)}catch{}if(!G||!G.documentElement){G=O.createDocument(Tt,"template",null);try{G.documentElement.innerHTML=Tl?M:ye}catch{}}const Re=G.body||G.documentElement;return k&&re&&Re.insertBefore(i.createTextNode(re),Re.childNodes[0]||null),Tt===_n?oe.call(G,Sn?"html":"body")[0]:Sn?G.documentElement:Re},ea=function(k){return te.call(k.ownerDocument||k,k,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Pn=function(k){return k=Lc(k,J," "),k=Lc(k,ue," "),k=Lc(k,he," "),k},$s=function(k){var G;k.normalize();const re=te.call(k.ownerDocument||k,k,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let ye=re.nextNode();for(;ye;)ye.data=Pn(ye.data),ye=re.nextNode();const Re=(G=k.querySelectorAll)===null||G===void 0?void 0:G.call(k,"template");Re&&yr(Re,De=>{Mn(De.content)&&$s(De.content)})},wn=function(k){const G=H?H(k):null;return typeof G!="string"||Je(G)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==X(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==E(k)||k.childNodes!==B(k)},Mn=function(k){if(!E||typeof k!="object"||k===null)return!1;try{return E(k)===Nl.documentFragment}catch{return!1}},rn=function(k){if(!E||typeof k!="object"||k===null)return!1;try{return typeof E(k)=="number"}catch{return!1}};function xt(fe,k,G){fe.length!==0&&yr(fe,re=>{re.call(l,k,G,Wn)})}const Ta=function(k,G){return!!(ct&&k.hasChildNodes()&&!rn(k.firstElementChild)&&En(Tb,k.textContent)&&En(Tb,k.innerHTML)||ct&&k.namespaceURI===_n&&G==="style"&&rn(k.firstElementChild)||k.nodeType===Nl.processingInstruction||ct&&k.nodeType===Nl.comment&&En(Eb,k.data))},Hr=function(k,G){if(!ht[G]&&Aa(G)&&(Fe.tagNameCheck instanceof RegExp&&En(Fe.tagNameCheck,G)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(G)))return!1;if(Ce&&!Q[G]){const re=q(k),ye=B(k);if(ye&&re){const Re=ye.length;for(let De=Re-1;De>=0;--De){const pt=bt?ye[De]:C(ye[De],!0);re.insertBefore(pt,D(k))}}}return en(k),!0},ta=function(k,G){if(xt(w.beforeSanitizeElements,k,null),k!==G&&q(k)===null)return!0;if(wn(k))return en(k),!0;const re=Je(H?H(k):k.nodeName);if(xt(w.uponSanitizeElement,k,{tagName:re,allowedTags:Le}),k!==G&&q(k)===null)return!0;if(Ta(k,re))return en(k),!0;if(ht[re]||!(vt.tagCheck instanceof Function&&vt.tagCheck(re))&&!Le[re]){const Re=Hr(k,re);return Re===!1&&xt(w.afterSanitizeElements,k,null),Re}if((E?E(k):k.nodeType)===Nl.element&&!Pt(k)||(re==="noscript"||re==="noembed"||re==="noframes")&&En(Mv,k.innerHTML))return en(k),!0;if(Xt&&k.nodeType===Nl.text){const Re=Pn(k.textContent);k.textContent!==Re&&(_r(l.removed,{element:k.cloneNode()}),k.textContent=Re)}return xt(w.afterSanitizeElements,k,null),!1},na=function(k,G,re){if(It[G]||ct&&G==="patchsrc"||ct&&G==="for"&&k!=="label"&&k!=="output"||K&&(G==="id"||G==="name")&&(re in i||re in Xs))return!1;const ye=Ke[G]||vt.attributeCheck instanceof Function&&vt.attributeCheck(G,k);if(!(Jt&&En(Ne,G))){if(!(Gn&&En(Ae,G))){if(ye){if(!Cn[G]){if(!En(Ut,Lc(re,st,""))){if(!((G==="src"||G==="xlink:href"||G==="href")&&k!=="script"&&yb(re,"data:")===0&&Me[k])){if(!(Ft&&!En(qe,Lc(re,st,"")))){if(re)return!1}}}}}else if(!(Aa(k)&&(Fe.tagNameCheck instanceof RegExp&&En(Fe.tagNameCheck,k)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(k))&&(Fe.attributeNameCheck instanceof RegExp&&En(Fe.attributeNameCheck,G)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(G,k))||G==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&En(Fe.tagNameCheck,re)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(re))))return!1}}return!0},Ea=lt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Aa=function(k){return!Ea[Ic(k)]&&En(Ze,k)},On=function(k,G,re,ye){if(U&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!re)switch(j.getAttributeType(k,G)){case"TrustedHTML":return se(ye);case"TrustedScriptURL":return ge(ye)}return ye},bl=function(k,G,re,ye){try{re?k.setAttributeNS(re,G,ye):k.setAttribute(G,ye),wn(k)?en(k):bb(l.removed)}catch{Vn(G,k)}},Bl=function(k){xt(w.beforeSanitizeAttributes,k,null);const G=k.attributes;if(!G||wn(k))return;const re={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ke,forceKeepAttr:void 0};let ye=G.length;const Re=Je(k.nodeName);for(;ye--;){const De=G[ye],pt=De.name,cn=De.namespaceURI,tn=De.value,Et=Je(pt),un=tn;let Bt=pt==="value"?un:pv(un);if(re.attrName=Et,re.attrValue=Bt,re.keepAttr=!0,re.forceKeepAttr=void 0,xt(w.uponSanitizeAttribute,k,re),Bt=re.attrValue,ce&&(Et==="id"||Et==="name")&&yb(Bt,we)!==0&&(Vn(pt,k),Bt=we+Bt),ct&&En(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Bt)){Vn(pt,k);continue}if(Et==="attributename"&&xb(Bt,"href")){Vn(pt,k);continue}if(!re.forceKeepAttr){if(!re.keepAttr){Vn(pt,k);continue}if(!In&&En(Ov,Bt)){Vn(pt,k);continue}if(Xt&&(Bt=Pn(Bt)),!na(Re,Et,Bt)){Vn(pt,k);continue}Bt=On(Re,Et,cn,Bt),Bt!==un&&bl(k,pt,cn,Bt)}}xt(w.afterSanitizeAttributes,k,null)},la=function(k){let G=null;const re=ea(k);for(xt(w.beforeSanitizeShadowDOM,k,null);G=re.nextNode();)if(xt(w.uponSanitizeShadowNode,G,null),ta(G,k),Bl(G),Mn(G.content)&&la(G.content),(E?E(G):G.nodeType)===Nl.element){const Re=z(G);Mn(Re)&&(il(Re),la(Re))}xt(w.afterSanitizeShadowDOM,k,null)},il=function(k){const G=[{node:k,shadow:null}];for(;G.length>0;){const re=G.pop();if(re.shadow){la(re.shadow);continue}const ye=re.node,De=(E?E(ye):ye.nodeType)===Nl.element,pt=B(ye);if(pt)for(let cn=pt.length-1;cn>=0;--cn)G.push({node:pt[cn],shadow:null});if(De){const cn=H?H(ye):null;if(typeof cn=="string"&&Je(cn)==="template"){const tn=ye.content;Mn(tn)&&G.push({node:tn,shadow:null})}}if(De){const cn=z(ye);Mn(cn)&&G.push({node:null,shadow:cn},{node:cn,shadow:null})}}};return l.sanitize=function(fe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=null,re=null,ye=null,Re=null;if(Tl=!fe,Tl&&(fe="<!-->"),typeof fe!="string"&&!rn(fe)&&(fe=yv(fe),typeof fe!="string"))throw _i("dirty is not a string, aborting");if(!l.isSupported)return fe;jn?(Le=yn,Ke=Qt):Qs(k),(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&(Le=ll(Le)),w.uponSanitizeAttribute.length>0&&(Ke=ll(Ke)),l.removed=[];const De=bt&&typeof fe!="string"&&rn(fe);if(De){Qn(fe);const Et=H?H(fe):fe.nodeName;if(typeof Et=="string"){const un=Je(Et);if(!Le[un]||ht[un])throw ut(fe),_i("root node is forbidden and cannot be sanitized in-place")}if(wn(fe))throw ut(fe),_i("root node is clobbered and cannot be sanitized in-place");try{il(fe)}catch(un){throw ut(fe),un}}else if(rn(fe))G=sl("<!---->"),re=G.ownerDocument.importNode(fe,!0),re.nodeType===Nl.element&&re.nodeName==="BODY"||re.nodeName==="HTML"?G=re:G.appendChild(re),il(re);else{if(!Nn&&!Xt&&!Sn&&fe.indexOf("<")===-1)return U&&Wt?se(fe):fe;if(G=sl(fe),!G)return Nn?null:Wt?M:""}G&&kn&&en(G.firstChild);const pt=De?fe:G,cn=ea(pt);try{for(;ye=cn.nextNode();)ta(ye,pt),Bl(ye),Mn(ye.content)&&la(ye.content)}catch(Et){throw De&&(ut(fe),yr(l.removed,un=>{un.element&&Xn(un.element)})),Et}if(De)return yr(l.removed,Et=>{Et.element&&Xn(Et.element)}),Xt&&$s(fe),fe;if(Nn){if(Xt&&$s(G),Ht)for(Re=Y.call(G.ownerDocument);G.firstChild;)Re.appendChild(G.firstChild);else Re=G;return(Ke.shadowroot||Ke.shadowrootmode)&&(Re=xe.call(c,Re,!0)),Re}let tn=Sn?G.outerHTML:G.innerHTML;return Sn&&Le["!doctype"]&&G.ownerDocument&&G.ownerDocument.doctype&&G.ownerDocument.doctype.name&&En(Cv,G.ownerDocument.doctype.name)&&(tn="<!DOCTYPE "+G.ownerDocument.doctype.name+`>
115
- `+tn),Xt&&(tn=Pn(tn)),U&&Wt?se(tn):tn},l.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qs(fe),jn=!0,yn=Le,Qt=Ke},l.clearConfig=function(){Wn=null,jn=!1,yn=null,Qt=null,U=P,M=""},l.isValidAttribute=function(fe,k,G){Wn||Qs({});const re=Je(fe),ye=Je(k);return na(re,ye,G)},l.addHook=function(fe,k){typeof k=="function"&&An(w,fe)&&_r(w[fe],k)},l.removeHook=function(fe,k){if(An(w,fe)){if(k!==void 0){const G=dv(w[fe],k);return G===-1?void 0:hv(w[fe],G,1)[0]}return bb(w[fe])}},l.removeHooks=function(fe){An(w,fe)&&(w[fe]=[])},l.removeAllHooks=function(){w=Ab()},l}var Lv=Vx();const Uv=1024;let Hv=0;class Ll{constructor(l,i){this.from=l,this.to=i}}class Lt{constructor(l={}){this.id=Hv++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Kl.match(l)),i=>{let c=l(i);return c===void 0?null:[this,c]}}}Lt.closedBy=new Lt({deserialize:a=>a.split(" ")});Lt.openedBy=new Lt({deserialize:a=>a.split(" ")});Lt.group=new Lt({deserialize:a=>a.split(" ")});Lt.isolate=new Lt({deserialize:a=>{if(a&&a!="rtl"&&a!="ltr"&&a!="auto")throw new RangeError("Invalid value for isolate: "+a);return a||"auto"}});Lt.contextHash=new Lt({perNode:!0});Lt.lookAhead=new Lt({perNode:!0});Lt.mounted=new Lt({perNode:!0});class Nr{constructor(l,i,c,o=!1){this.tree=l,this.overlay=i,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[Lt.mounted.id]}}const Bv=Object.create(null);class Kl{constructor(l,i,c,o=0){this.name=l,this.props=i,this.id=c,this.flags=o}static define(l){let i=l.props&&l.props.length?Object.create(null):Bv,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Kl(l.name||"",i,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let i=this.prop(Lt.group);return i?i.indexOf(l)>-1:!1}return this.id==l}static match(l){let i=Object.create(null);for(let c in l)for(let o of c.split(" "))i[o]=l[c];return c=>{for(let o=c.prop(Lt.group),d=-1;d<(o?o.length:0);d++){let h=i[d<0?c.name:o[d]];if(h)return h}}}}Kl.none=new Kl("",Object.create(null),0,8);class Xx{constructor(l){this.types=l;for(let i=0;i<l.length;i++)if(l[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let i=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let p=h[1],m=h[0];m.combine&&m.id in o&&(p=m.combine(o[m.id],p)),o[m.id]=p}}i.push(o?new Kl(c.name,o,c.id,c.flags):c)}return new Xx(i)}}const So=new WeakMap,Cb=new WeakMap;var Dt;(function(a){a[a.ExcludeBuffers=1]="ExcludeBuffers",a[a.IncludeAnonymous=2]="IncludeAnonymous",a[a.IgnoreMounts=4]="IgnoreMounts",a[a.IgnoreOverlays=8]="IgnoreOverlays",a[a.EnterBracketed=16]="EnterBracketed"})(Dt||(Dt={}));class pl{constructor(l,i,c,o,d){if(this.type=l,this.children=i,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,p]of d)this.props[typeof h=="number"?h:h.id]=p}}toString(){let l=Nr.get(this);if(l&&!l.overlay)return l.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(l=0){return new qo(this.topNode,l)}cursorAt(l,i=0,c=0){let o=So.get(this)||this.topNode,d=new qo(o);return d.moveTo(l,i),So.set(this,d._tree),d}get topNode(){return new Jn(this,0,0,null)}resolve(l,i=0){let c=Xc(So.get(this)||this.topNode,l,i,!1);return So.set(this,c),c}resolveInner(l,i=0){let c=Xc(Cb.get(this)||this.topNode,l,i,!0);return Cb.set(this,c),c}resolveStack(l,i=0){return Iv(this,l,i)}iterate(l){let{enter:i,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&Dt.IncludeAnonymous)>0;for(let m=this.cursor(h|Dt.IncludeAnonymous);;){let x=!1;if(m.from<=d&&m.to>=o&&(!p&&m.type.isAnonymous||i(m)!==!1)){if(m.firstChild())continue;x=!0}for(;x&&c&&(p||!m.type.isAnonymous)&&c(m),!m.nextSibling();){if(!m.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let i in this.props)l.push([+i,this.props[i]]);return l}balance(l={}){return this.children.length<=8?this:Vh(Kl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new pl(this.type,i,c,o,this.propValues),l.makeTree||((i,c,o)=>new pl(Kl.none,i,c,o)))}static build(l){return Yv(l)}}pl.empty=new pl(Kl.none,[],[],0);class Ih{constructor(l,i){this.buffer=l,this.index=i}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 Ih(this.buffer,this.index)}}class Ys{constructor(l,i,c){this.buffer=l,this.length=i,this.set=c}get type(){return Kl.none}toString(){let l=[];for(let i=0;i<this.buffer.length;)l.push(this.childString(i)),i=this.buffer[i+3];return l.join(",")}childString(l){let i=this.buffer[l],c=this.buffer[l+3],o=this.set.types[i],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,i,c,o,d){let{buffer:h}=this,p=-1;for(let m=l;m!=i&&!(Qx(d,o,h[m+1],h[m+2])&&(p=m,c>0));m=h[m+3]);return p}slice(l,i,c){let o=this.buffer,d=new Uint16Array(i-l),h=0;for(let p=l,m=0;p<i;){d[m++]=o[p++],d[m++]=o[p++]-c;let x=d[m++]=o[p++]-c;d[m++]=o[p++]-l,h=Math.max(h,x)}return new Ys(d,h,this.set)}}function Qx(a,l,i,c){switch(a){case-2:return i<l;case-1:return c>=l&&i<l;case 0:return i<l&&c>l;case 1:return i<=l&&c>l;case 2:return c>l;case 4:return!0}}function Xc(a,l,i,c){for(var o;a.from==a.to||(i<1?a.from>=l:a.from>l)||(i>-1?a.to<=l:a.to<l);){let h=!c&&a instanceof Jn&&a.index<0?null:a.parent;if(!h)return a;a=h}let d=c?0:Dt.IgnoreOverlays;if(c)for(let h=a,p=h.parent;p;h=p,p=h.parent)h instanceof Jn&&h.index<0&&((o=p.enter(l,i,d))===null||o===void 0?void 0:o.from)!=h.from&&(a=p);for(;;){let h=a.enter(l,i,d);if(!h)return a;a=h}}class $x{cursor(l=0){return new qo(this,l)}getChild(l,i=null,c=null){let o=Rb(this,l,i,c);return o.length?o[0]:null}getChildren(l,i=null,c=null){return Rb(this,l,i,c)}resolve(l,i=0){return Xc(this,l,i,!1)}resolveInner(l,i=0){return Xc(this,l,i,!0)}matchContext(l){return wh(this.parent,l)}enterUnfinishedNodesBefore(l){let i=this.childBefore(l),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class Jn extends $x{constructor(l,i,c,o){super(),this._tree=l,this.from=i,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,i,c,o,d=0){for(let h=this;;){for(let{children:p,positions:m}=h._tree,x=i>0?p.length:-1;l!=x;l+=i){let y=p[l],j=m[l]+h.from,v;if(!(!(d&Dt.EnterBracketed&&y instanceof pl&&(v=Nr.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!Qx(o,c,j,j+y.length))){if(y instanceof Ys){if(d&Dt.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,i,c-j,o);if(C>-1)return new va(new qv(h,y,l,j),null,C)}else if(d&Dt.IncludeAnonymous||!y.type.isAnonymous||Yh(y)){let C;if(!(d&Dt.IgnoreMounts)&&(C=Nr.get(y))&&!C.overlay)return new Jn(C.tree,j,l,h);let N=new Jn(y,j,l,h);return d&Dt.IncludeAnonymous||!N.type.isAnonymous?N:N.nextChild(i<0?y.children.length-1:0,i,c,o,d)}}}if(d&Dt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+i:l=i<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,i,c=0){let o;if(!(c&Dt.IgnoreOverlays)&&(o=Nr.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Dt.EnterBracketed&&o.bracketed;for(let{from:p,to:m}of o.overlay)if((i>0||h?p<=d:p<d)&&(i<0||h?m>=d:m>d))return new Jn(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,i,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Rb(a,l,i,c){let o=a.cursor(),d=[];if(!o.firstChild())return d;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function wh(a,l,i=l.length-1){for(let c=a;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[i]&&l[i]!=c.name)return!1;i--}}return!0}class qv{constructor(l,i,c,o){this.parent=l,this.buffer=i,this.index=c,this.start=o}}class va extends $x{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,i,c){super(),this.context=l,this._parent=i,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,i,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.context.start,c);return d<0?null:new va(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,i,c=0){if(c&Dt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,l-this.context.start,i);return d<0?null:new va(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,i=l.buffer[this.index+3];return i<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new va(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new va(this.context,this._parent,l.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],i=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),i.push(0)}return new pl(this.type,l,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Zx(a){if(!a.length)return null;let l=0,i=a[0];for(let d=1;d<a.length;d++){let h=a[d];(h.from>i.from||h.to<i.to)&&(i=h,l=d)}let c=i instanceof Jn&&i.index<0?null:i.parent,o=a.slice();return c?o[l]=c:o.splice(l,1),new Gv(o,i)}class Gv{constructor(l,i){this.heads=l,this.node=i}get next(){return Zx(this.heads)}}function Iv(a,l,i){let c=a.resolveInner(l,i),o=null;for(let d=c instanceof Jn?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,i)),d=h}else{let h=Nr.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new Jn(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Xc(p,l,i,!1))}}return o?Zx(o):c}class qo{get name(){return this.type.name}constructor(l,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~Dt.EnterBracketed,l instanceof Jn)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,i){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Jn?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,i,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,i,c=this.mode){return this.buffer?c&Dt.ExcludeBuffers?!1:this.enterChild(1,l,i):this.yield(this._tree.enter(l,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Dt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:i}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let i,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let d=i+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let p=c._tree.children[d];if(this.mode&Dt.IncludeAnonymous||p instanceof Ys||!p.type.isAnonymous||Yh(p))return!1}return!0}move(l,i){if(i&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,i=0){for(;(this.from==this.to||(i<1?this.from>=l:this.from>l)||(i>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,i););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,i=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;i=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)i=new va(this.buffer,i,this.stack[o]);return this.bufferNode=new va(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,i){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return wh(this.node.parent,l);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return wh(this._tree,l,o);let h=c[i.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Yh(a){return a.children.some(l=>l instanceof Ys||!l.type.isAnonymous||Yh(l))}function Yv(a){var l;let{buffer:i,nodeSet:c,maxBufferLength:o=Uv,reused:d=[],minRepeatType:h=c.types.length}=a,p=Array.isArray(i)?new Ih(i,i.length):i,m=c.types,x=0,y=0;function j(H,U,M,P,ie,de){let{id:W,start:se,end:ge,size:je}=p,me=y,O=x;if(je<0)if(p.next(),je==-1){let w=d[W];M.push(w),P.push(se-H);return}else if(je==-3){x=W;return}else if(je==-4){y=W;return}else throw new RangeError(`Unrecognized record size: ${je}`);let te=m[W],Y,oe,xe=se-H;if(ge-se<=o&&(oe=B(p.pos-U,ie))){let w=new Uint16Array(oe.size-oe.skip),J=p.pos-oe.size,ue=w.length;for(;p.pos>J;)ue=q(oe.start,w,ue);Y=new Ys(w,ge-oe.start,c),xe=oe.start-H}else{let w=p.pos-je;p.next();let J=[],ue=[],he=W>=h?W:-1,Ne=0,Ae=ge;for(;p.pos>w;)he>=0&&p.id==he&&p.size>=0?(p.end<=Ae-o&&(N(J,ue,se,Ne,p.end,Ae,he,me,O),Ne=J.length,Ae=p.end),p.next()):de>2500?v(se,w,J,ue):j(se,w,J,ue,he,de+1);if(he>=0&&Ne>0&&Ne<J.length&&N(J,ue,se,Ne,se,Ae,he,me,O),J.reverse(),ue.reverse(),he>-1&&Ne>0){let qe=C(te,O);Y=Vh(te,J,ue,0,J.length,0,ge-se,qe,qe)}else Y=D(te,J,ue,ge-se,me-ge,O)}M.push(Y),P.push(xe)}function v(H,U,M,P){let ie=[],de=0,W=-1;for(;p.pos>U;){let{id:se,start:ge,end:je,size:me}=p;if(me>4)p.next();else{if(W>-1&&ge<W)break;W<0&&(W=je-o),ie.push(se,ge,je),de++,p.next()}}if(de){let se=new Uint16Array(de*4),ge=ie[ie.length-2];for(let je=ie.length-3,me=0;je>=0;je-=3)se[me++]=ie[je],se[me++]=ie[je+1]-ge,se[me++]=ie[je+2]-ge,se[me++]=me;M.push(new Ys(se,ie[2]-ge,c)),P.push(ge-H)}}function C(H,U){return(M,P,ie)=>{let de=0,W=M.length-1,se,ge;if(W>=0&&(se=M[W])instanceof pl){if(!W&&se.type==H&&se.length==ie)return se;(ge=se.prop(Lt.lookAhead))&&(de=P[W]+se.length+ge)}return D(H,M,P,ie,de,U)}}function N(H,U,M,P,ie,de,W,se,ge){let je=[],me=[];for(;H.length>P;)je.push(H.pop()),me.push(U.pop()+M-ie);H.push(D(c.types[W],je,me,de-ie,se-de,ge)),U.push(ie-M)}function D(H,U,M,P,ie,de,W){if(de){let se=[Lt.contextHash,de];W=W?[se].concat(W):[se]}if(ie>25){let se=[Lt.lookAhead,ie];W=W?[se].concat(W):[se]}return new pl(H,U,M,P,W)}function B(H,U){let M=p.fork(),P=0,ie=0,de=0,W=M.end-o,se={size:0,start:0,skip:0};e:for(let ge=M.pos-H;M.pos>ge;){let je=M.size;if(M.id==U&&je>=0){se.size=P,se.start=ie,se.skip=de,de+=4,P+=4,M.next();continue}let me=M.pos-je;if(je<0||me<ge||M.start<W)break;let O=M.id>=h?4:0,te=M.start;for(M.next();M.pos>me;){if(M.size<0)if(M.size==-3||M.size==-4)O+=4;else break e;else M.id>=h&&(O+=4);M.next()}ie=te,P+=je,de+=O}return(U<0||P==H)&&(se.size=P,se.start=ie,se.skip=de),se.size>4?se:void 0}function q(H,U,M){let{id:P,start:ie,end:de,size:W}=p;if(p.next(),W>=0&&P<h){let se=M;if(W>4){let ge=p.pos-(W-4);for(;p.pos>ge;)M=q(H,U,M)}U[--M]=se,U[--M]=de-H,U[--M]=ie-H,U[--M]=P}else W==-3?x=P:W==-4&&(y=P);return M}let z=[],X=[];for(;p.pos>0;)j(a.start||0,a.bufferStart||0,z,X,-1,0);let E=(l=a.length)!==null&&l!==void 0?l:z.length?X[0]+z[0].length:0;return new pl(m[a.topID],z.reverse(),X.reverse(),E)}const Mb=new WeakMap;function zo(a,l){if(!a.isAnonymous||l instanceof Ys||l.type!=a)return 1;let i=Mb.get(l);if(i==null){i=1;for(let c of l.children){if(c.type!=a||!(c instanceof pl)){i=1;break}i+=zo(a,c)}Mb.set(l,i)}return i}function Vh(a,l,i,c,o,d,h,p,m){let x=0;for(let N=c;N<o;N++)x+=zo(a,l[N]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(N,D,B,q,z){for(let X=B;X<q;){let E=X,H=D[X],U=zo(a,N[X]);for(X++;X<q;X++){let M=zo(a,N[X]);if(U+M>=y)break;U+=M}if(X==E+1){if(U>y){let M=N[E];C(M.children,M.positions,0,M.children.length,D[E]+z);continue}j.push(N[E])}else{let M=D[X-1]+N[X-1].length-H;j.push(Vh(a,N,D,E,X,H,M,null,m))}v.push(H+z-d)}}return C(l,i,c,o,0),(p||m)(j,v,h)}class Bk{constructor(){this.map=new WeakMap}setBuffer(l,i,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(i,c)}getBuffer(l,i){let c=this.map.get(l);return c&&c.get(i)}set(l,i){l instanceof va?this.setBuffer(l.context.buffer,l.index,i):l instanceof Jn&&this.map.set(l.tree,i)}get(l){return l instanceof va?this.getBuffer(l.context.buffer,l.index):l instanceof Jn?this.map.get(l.tree):void 0}cursorSet(l,i){l.buffer?this.setBuffer(l.buffer.buffer,l.index,i):this.map.set(l.tree,i)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Qc{constructor(l,i,c,o,d=!1,h=!1){this.from=l,this.to=i,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,i=[],c=!1){let o=[new Qc(0,l.length,l,0,!1,c)];for(let d of i)d.to>l.length&&o.push(d);return o}static applyChanges(l,i,c=128){if(!i.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let p=0,m=0,x=0;;p++){let y=p<i.length?i[p]:null,j=y?y.fromA:1e9;if(j-m>=c)for(;h&&h.from<j;){let v=h;if(m>=v.from||j<=v.to||x){let C=Math.max(v.from,m)-x,N=Math.min(v.to,j)-x;v=C>=N?null:new Qc(C,N,v.tree,v.offset+x,p>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;m=y.toA,x=y.toA-y.toB}return o}}class qk{startParse(l,i,c){return typeof l=="string"&&(l=new Vv(l)),c=c?c.length?c.map(o=>new Ll(o.from,o.to)):[new Ll(0,0)]:[new Ll(0,l.length)],this.createParse(l,i||[],c)}parse(l,i,c){let o=this.startParse(l,i,c);for(;;){let d=o.advance();if(d)return d}}}class Vv{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,i){return this.string.slice(l,i)}}function Gk(a){return(l,i,c,o)=>new Qv(l,a,i,c,o)}class Ob{constructor(l,i,c,o,d,h){this.parser=l,this.parse=i,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Db(a){if(!a.length||a.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}class Xv{constructor(l,i,c,o,d,h,p,m){this.parser=l,this.predicate=i,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=m,this.depth=0,this.ranges=[]}}const Th=new Lt({perNode:!0});class Qv{constructor(l,i,c,o,d){this.nest=i,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new pl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Th,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],i=l.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[Lt.mounted.id]=new Nr(i,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<l&&(l=Math.min(l,this.inner[i].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(l)}startInner(){let l=new Kv(this.fragments),i=null,c=null,o=new qo(new Jn(this.baseTree,this.ranges[0].from,0,null),Dt.IncludeAnonymous|Dt.IgnoreMounts);e:for(let d,h;;){let p=!0,m;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)p=!1;else if(l.hasNode(o)){if(i){let x=i.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&&!i.ranges.some(C=>C.from<v&&C.to>j)&&i.ranges.push({from:j,to:v})}}p=!1}else if(c&&(h=$v(c.ranges,o.from,o.to)))p=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(Zv(o),i&&i.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")i=new Xv(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,i);else{let y=Ub(this.ranges,d.overlay||(o.from<o.to?[new Ll(o.from,o.to)]:[]));y.length&&Db(y),(y.length||!d.overlay)&&this.inner.push(new Ob(d.parser,y.length?d.parser.startParse(this.input,Hb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Ll(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}):p=!1}}else if(i&&(m=i.predicate(o))&&(m===!0&&(m=new Ll(o.from,o.to)),m.from<m.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==m.from?i.ranges[x]={from:i.ranges[x].from,to:m.to}:i.ranges.push(m)}if(p&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Ub(this.ranges,i.ranges);x.length&&(Db(x),this.inner.splice(i.index,0,new Ob(i.parser,i.parser.startParse(this.input,Hb(i.mounts,x),x),i.ranges.map(y=>new Ll(y.from-i.start,y.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function $v(a,l,i){for(let c of a){if(c.from>=i)break;if(c.to>l)return c.from<=l&&c.to>=i?2:1}return 0}function zb(a,l,i,c,o,d){if(l<i){let h=a.buffer[l+1];c.push(a.slice(l,i,h)),o.push(h-d)}}function Zv(a){let{node:l}=a,i=[],c=l.context.buffer;do i.push(a.index),a.parent();while(!a.tree);let o=a.tree,d=o.children.indexOf(c),h=o.children[d],p=h.buffer,m=[d];function x(y,j,v,C,N,D){let B=i[D],q=[],z=[];zb(h,y,B,q,z,C);let X=p[B+1],E=p[B+2];m.push(q.length);let H=D?x(B+4,p[B+3],h.set.types[p[B]],X,E-X,D-1):l.toTree();return q.push(H),z.push(X-C),zb(h,p[B+3],j,q,z,C),new pl(v,q,z,N)}o.children[d]=x(0,p.length,Kl.none,0,h.length,i.length-1);for(let y of m){let j=a.tree.children[y],v=a.tree.positions[y];a.yield(new Jn(j,v+a.from,y,a._tree))}}class Lb{constructor(l,i){this.offset=i,this.done=!1,this.cursor=l.cursor(Dt.IncludeAnonymous|Dt.IgnoreMounts)}moveTo(l){let{cursor:i}=this,c=l-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=l&&i.enter(c,1,Dt.IgnoreOverlays|Dt.ExcludeBuffers)))if(i.to<=l)i.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==l.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof pl)i=i.children[0];else break}return!1}}class Kv{constructor(l){var i;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(i=c.tree.prop(Th))!==null&&i!==void 0?i:c.to,this.inner=new Lb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(l=i.tree.prop(Th))!==null&&l!==void 0?l:i.to,this.inner=new Lb(i.tree,-i.offset)}}findMounts(l,i){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Lt.mounted);if(h&&h.parser==i)for(let p=this.fragI;p<this.fragments.length;p++){let m=this.fragments[p];if(m.from>=d.to)break;m.tree==this.curFrag.tree&&o.push({frag:m,pos:d.from-m.offset,mount:h})}}}return o}}function Ub(a,l){let i=null,c=l;for(let o=1,d=0;o<a.length;o++){let h=a[o-1].to,p=a[o].from;for(;d<c.length;d++){let m=c[d];if(m.from>=p)break;m.to<=h||(i||(c=i=l.slice()),m.from<h?(i[d]=new Ll(m.from,h),m.to>p&&i.splice(d+1,0,new Ll(p,m.to))):m.to>p?i[d--]=new Ll(p,m.to):i.splice(d--,1))}}return c}function Jv(a,l,i,c){let o=0,d=0,h=!1,p=!1,m=-1e9,x=[];for(;;){let y=o==a.length?1e9:h?a[o].to:a[o].from,j=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(m,i),C=Math.min(y,j,c);v<C&&x.push(new Ll(v,C))}if(m=Math.min(y,j),m==1e9)break;y==m&&(h?(h=!1,o++):h=!0),j==m&&(p?(p=!1,d++):p=!0)}return x}function Hb(a,l){let i=[];for(let{pos:c,mount:o,frag:d}of a){let h=c+(o.overlay?o.overlay[0].from:0),p=h+o.tree.length,m=Math.max(d.from,h),x=Math.min(d.to,p);if(o.overlay){let y=o.overlay.map(v=>new Ll(v.from+c,v.to+c)),j=Jv(l,y,m,x);for(let v=0,C=m;;v++){let N=v==j.length,D=N?x:j[v].from;if(D>C&&i.push(new Qc(C,D,o.tree,-h,d.from>=C||d.openStart,d.to<=D||d.openEnd)),N)break;C=j[v].to}}else i.push(new Qc(m,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return i}let Fv=0;class zl{constructor(l,i,c,o){this.name=l,this.set=i,this.base=c,this.modified=o,this.id=Fv++}toString(){let{name:l}=this;for(let i of this.modified)i.name&&(l=`${i.name}(${l})`);return l}static define(l,i){let c=typeof l=="string"?l:"?";if(l instanceof zl&&(i=l),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new zl(c,[],null,[]);if(o.set.push(o),i)for(let d of i.set)o.set.push(d);return o}static defineModifier(l){let i=new Go(l);return c=>c.modified.indexOf(i)>-1?c:Go.get(c.base||c,c.modified.concat(i).sort((o,d)=>o.id-d.id))}}let Wv=0;class Go{constructor(l){this.name=l,this.instances=[],this.id=Wv++}static get(l,i){if(!i.length)return l;let c=i[0].instances.find(p=>p.base==l&&Pv(i,p.modified));if(c)return c;let o=[],d=new zl(l.name,o,l,i);for(let p of i)p.instances.push(d);let h=e1(i);for(let p of l.set)if(!p.modified.length)for(let m of h)o.push(Go.get(p,m));return d}}function Pv(a,l){return a.length==l.length&&a.every((i,c)=>i==l[c])}function e1(a){let l=[[]];for(let i=0;i<a.length;i++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(a[i]));return l.sort((i,c)=>c.length-i.length)}function Ik(a){let l=Object.create(null);for(let i in a){let c=a[i];Array.isArray(c)||(c=[c]);for(let o of i.split(" "))if(o){let d=[],h=2,p=o;for(let j=0;;){if(p=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(p);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 C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);p=o.slice(j)}let m=d.length-1,x=d[m];if(!x)throw new RangeError("Invalid path: "+o);let y=new $c(c,h,m>0?d.slice(0,m):null);l[x]=y.sort(l[x])}}return Kx.add(l)}const Kx=new Lt({combine(a,l){let i,c,o;for(;a||l;){if(!a||l&&a.depth>=l.depth?(o=l,l=l.next):(o=a,a=a.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let d=new $c(o.tags,o.mode,o.context);i?i.next=d:c=d,i=d}return c}});class $c{constructor(l,i,c,o){this.tags=l,this.mode=i,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}$c.empty=new $c([],2,null);function Jx(a,l){let i=Object.create(null);for(let d of a)if(!Array.isArray(d.tag))i[d.tag.id]=d.class;else for(let h of d.tag)i[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let p of d)for(let m of p.set){let x=i[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function t1(a,l){let i=null;for(let c of a){let o=c.style(l);o&&(i=i?i+" "+o:o)}return i}function n1(a,l,i,c=0,o=a.length){let d=new a1(c,Array.isArray(l)?l:[l],i);d.highlightRange(a.cursor(),c,o,"",d.highlighters),d.flush(o)}function l1(a,l,i,c,o,d=0,h=a.length){let p=d;function m(x,y){if(!(x<=p)){for(let j=a.slice(p,x),v=0;;){let C=j.indexOf(`
116
- `,v),N=C<0?j.length:C;if(N>v&&c(j.slice(v,N),y),C<0)break;o(),v=C+1}p=x}}n1(l,i,(x,y,j)=>{m(x,""),m(y,j)},d,h),m(h,"")}class a1{constructor(l,i,c){this.at=l,this.highlighters=i,this.span=c,this.class=""}startSpan(l,i){i!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=i)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,i,c,o,d){let{type:h,from:p,to:m}=l;if(p>=c||m<=i)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let x=o,y=s1(l)||$c.empty,j=t1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(i,p),x),y.opaque)return;let v=l.tree&&l.tree.prop(Lt.mounted);if(v&&v.overlay){let C=l.node.enter(v.overlay[0].from+p,1),N=this.highlighters.filter(B=>!B.scope||B.scope(v.tree.type)),D=l.firstChild();for(let B=0,q=p;;B++){let z=B<v.overlay.length?v.overlay[B]:null,X=z?z.from+p:m,E=Math.max(i,q),H=Math.min(c,X);if(E<H&&D)for(;l.from<H&&(this.highlightRange(l,E,H,o,d),this.startSpan(Math.min(H,l.to),x),!(l.to>=X||!l.nextSibling())););if(!z||X>c)break;q=z.to+p,q>i&&(this.highlightRange(C.cursor(),Math.max(i,z.from+p),Math.min(c,q),"",N),this.startSpan(Math.min(c,q),x))}D&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=i)){if(l.from>=c)break;this.highlightRange(l,i,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function s1(a){let l=a.type.prop(Kx);for(;l&&l.context&&!a.matchContext(l.context);)l=l.next;return l||null}const be=zl.define,jo=be(),Hs=be(),Bb=be(Hs),qb=be(Hs),Bs=be(),ko=be(Bs),rh=be(Bs),xa=be(),vi=be(xa),ha=be(),pa=be(),Eh=be(),Hc=be(Eh),No=be(),ve={comment:jo,lineComment:be(jo),blockComment:be(jo),docComment:be(jo),name:Hs,variableName:be(Hs),typeName:Bb,tagName:be(Bb),propertyName:qb,attributeName:be(qb),className:be(Hs),labelName:be(Hs),namespace:be(Hs),macroName:be(Hs),literal:Bs,string:ko,docString:be(ko),character:be(ko),attributeValue:be(ko),number:rh,integer:be(rh),float:be(rh),bool:be(Bs),regexp:be(Bs),escape:be(Bs),color:be(Bs),url:be(Bs),keyword:ha,self:be(ha),null:be(ha),atom:be(ha),unit:be(ha),modifier:be(ha),operatorKeyword:be(ha),controlKeyword:be(ha),definitionKeyword:be(ha),moduleKeyword:be(ha),operator:pa,derefOperator:be(pa),arithmeticOperator:be(pa),logicOperator:be(pa),bitwiseOperator:be(pa),compareOperator:be(pa),updateOperator:be(pa),definitionOperator:be(pa),typeOperator:be(pa),controlOperator:be(pa),punctuation:Eh,separator:be(Eh),bracket:Hc,angleBracket:be(Hc),squareBracket:be(Hc),paren:be(Hc),brace:be(Hc),content:xa,heading:vi,heading1:be(vi),heading2:be(vi),heading3:be(vi),heading4:be(vi),heading5:be(vi),heading6:be(vi),contentSeparator:be(xa),list:be(xa),quote:be(xa),emphasis:be(xa),strong:be(xa),link:be(xa),monospace:be(xa),strikethrough:be(xa),inserted:be(),deleted:be(),changed:be(),invalid:be(),meta:No,documentMeta:be(No),annotation:be(No),processingInstruction:be(No),definition:zl.defineModifier("definition"),constant:zl.defineModifier("constant"),function:zl.defineModifier("function"),standard:zl.defineModifier("standard"),local:zl.defineModifier("local"),special:zl.defineModifier("special")};for(let a in ve){let l=ve[a];l instanceof zl&&(l.name=a)}Jx([{tag:ve.link,class:"tok-link"},{tag:ve.heading,class:"tok-heading"},{tag:ve.emphasis,class:"tok-emphasis"},{tag:ve.strong,class:"tok-strong"},{tag:ve.keyword,class:"tok-keyword"},{tag:ve.atom,class:"tok-atom"},{tag:ve.bool,class:"tok-bool"},{tag:ve.url,class:"tok-url"},{tag:ve.labelName,class:"tok-labelName"},{tag:ve.inserted,class:"tok-inserted"},{tag:ve.deleted,class:"tok-deleted"},{tag:ve.literal,class:"tok-literal"},{tag:ve.string,class:"tok-string"},{tag:ve.number,class:"tok-number"},{tag:[ve.regexp,ve.escape,ve.special(ve.string)],class:"tok-string2"},{tag:ve.variableName,class:"tok-variableName"},{tag:ve.local(ve.variableName),class:"tok-variableName tok-local"},{tag:ve.definition(ve.variableName),class:"tok-variableName tok-definition"},{tag:ve.special(ve.variableName),class:"tok-variableName2"},{tag:ve.definition(ve.propertyName),class:"tok-propertyName tok-definition"},{tag:ve.typeName,class:"tok-typeName"},{tag:ve.namespace,class:"tok-namespace"},{tag:ve.className,class:"tok-className"},{tag:ve.macroName,class:"tok-macroName"},{tag:ve.propertyName,class:"tok-propertyName"},{tag:ve.operator,class:"tok-operator"},{tag:ve.comment,class:"tok-comment"},{tag:ve.meta,class:"tok-meta"},{tag:ve.invalid,class:"tok-invalid"},{tag:ve.punctuation,class:"tok-punctuation"}]);const i1="modulepreload",r1=function(a,l){return new URL(a,l).href},Gb={},Xe=function(l,i,c){let o=Promise.resolve();if(i&&i.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 p=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(i.map(y=>{if(y=r1(y,c),y in Gb)return;Gb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let D=p.length-1;D>=0;D--){const B=p[D];if(B.href===y&&(!j||B.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const N=document.createElement("link");if(N.rel=j?"stylesheet":i1,j||(N.as="script"),N.crossOrigin="",N.href=y,x&&N.setAttribute("nonce",x),document.head.appendChild(N),j)return new Promise((D,B)=>{N.addEventListener("load",D),N.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return o.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return l().catch(d)})},Fx={js:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-B-8FWzpe.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Xe(async()=>{const{json:a}=await import("./index-Depy6k3N.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Xe(async()=>{const{json:a}=await import("./index-Depy6k3N.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Xe(async()=>{const{css:a}=await import("./index-Bv8vIAVO.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Xe(async()=>{const{css:a}=await import("./index-Bv8vIAVO.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Xe(async()=>{const{css:a}=await import("./index-Bv8vIAVO.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Xe(async()=>{const{html:a}=await import("./index-Cid3pp7b.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Xe(async()=>{const{html:a}=await import("./index-Cid3pp7b.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Xe(async()=>{const{html:a}=await import("./index-Cid3pp7b.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Xe(async()=>{const{html:a}=await import("./index-Cid3pp7b.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-BleqvvQk.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-BleqvvQk.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Xe(async()=>{const{python:a}=await import("./index-CkSGxu2i.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Xe(async()=>{const{python:a}=await import("./index-CkSGxu2i.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-CJo5aeRL.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-CJo5aeRL.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Xe(async()=>{const{rust:a}=await import("./index-CKz5fHXP.js");return{rust:a}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-CR_zbJ-Z.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-CR_zbJ-Z.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-CR_zbJ-Z.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-CR_zbJ-Z.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-CR_zbJ-Z.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Xe(async()=>{const{java:a}=await import("./index-hElc3lLb.js");return{java:a}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Xe(async()=>{const{go:a}=await import("./index-DklW2LtN.js");return{go:a}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Xe(async()=>{const{php:a}=await import("./index-DmEjP2AP.js");return{php:a}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Xe(async()=>{const{sql:a}=await import("./index-fWVyTiSX.js");return{sql:a}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-kMdLDVpb.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-kMdLDVpb.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},c1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},u1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function o1(a){const l=u1[a.toLowerCase()]??a.toLowerCase(),i=Fx[l];return i?i().catch(()=>null):null}async function f1(a){const l=(a.split("/").pop()??"").toLowerCase(),i=c1[l]??l.split(".").pop()??"",c=Fx[i];return c?c().catch(()=>null):null}const d1=Jx([{tag:[ve.keyword,ve.modifier,ve.controlKeyword,ve.moduleKeyword],class:"cmh-key"},{tag:[ve.propertyName],class:"cmh-prop"},{tag:[ve.function(ve.variableName),ve.labelName],class:"cmh-fn"},{tag:[ve.color,ve.constant(ve.name),ve.standard(ve.name),ve.bool],class:"cmh-const"},{tag:[ve.typeName,ve.className,ve.changed,ve.annotation,ve.self,ve.namespace],class:"cmh-type"},{tag:[ve.number,ve.integer,ve.float],class:"cmh-num"},{tag:[ve.string,ve.special(ve.string),ve.regexp],class:"cmh-str"},{tag:[ve.operator,ve.operatorKeyword,ve.escape],class:"cmh-op"},{tag:[ve.meta,ve.comment],class:"cmh-comment"},{tag:ve.invalid,class:"cmh-invalid"}]);function wo(a){return a.replace(/[&<>]/g,l=>l==="&"?"&amp;":l==="<"?"&lt;":"&gt;")}async function h1(a,l){const i=l?await o1(l):null;if(!i)return wo(a);try{const c=i.language.parser.parse(a);let o="";return l1(a,c,d1,(d,h)=>{o+=h?`<span class="${h}">${wo(d)}</span>`:wo(d)},()=>{o+=`
117
- `}),o}catch{return wo(a)}}gt.setOptions({gfm:!0,breaks:!1});function Wx(a){var i;const l=(i=a.split(".").pop())==null?void 0:i.toLowerCase();return l==="md"||l==="markdown"}async function Px(a){const l=await gt.parse(a,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await h1(c.text,c.lang??""),c.escaped=!0}});return Lv.sanitize(l)}function Ib(a,l){return{path:a.path,text:a.content,saved:a.content,eol:a.eol,encoding:a.encoding,mtime:a.mtime,size:a.size,binary:a.binary,tooLarge:a.tooLarge,stale:!1,revision:l,previewMode:Wx(a.path)}}function Fa(a){return!a.binary&&!a.tooLarge&&a.text!==a.saved}function p1(a){return a.split("/").pop()??a}function Ri(a){const l=a.lastIndexOf("/");return l===-1?"":a.slice(0,l)}function ch(a){return a<1024?`${a} Б`:a<1024*1024?`${(a/1024).toFixed(1)} КБ`:`${(a/1024/1024).toFixed(1)} МБ`}function Lo({x:a,y:l,items:i,note:c,onClose:o}){const d=_.useRef(null),[h,p]=_.useState({left:a,top:l}),[m,x]=_.useState(()=>{const v=i.findIndex(C=>!C.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),N=8,D=Math.max(N,Math.min(a,window.innerWidth-C.width-N)),B=Math.max(N,Math.min(l,window.innerHeight-C.height-N));p({left:D,top:B})},[a,l]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(N){var D;(D=d.current)!=null&&D.contains(N.target)||o()}function C(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",C,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=i.map((N,D)=>({item:N,index:D})).filter(N=>!N.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const N=v.key==="ArrowDown"?1:-1,D=C.findIndex(q=>q.index===m),B=C[(((D===-1?0:D)+N)%C.length+C.length)%C.length];B&&x(B.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const N=i[m];N&&y(N)}}}return r.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&r.jsx("div",{className:"ctxmenu__note",children:c}),i.map((v,C)=>r.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===m?" is-cursor":""),onMouseEnter:()=>x(C),onClick:()=>y(v),children:[r.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&r.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const m1=3500,g1=9e3,b1=220;function zi({result:a}){const[l,i]=_.useState(a),[c,o]=_.useState(!1);return _.useEffect(()=>{if(!a){i(null),o(!1);return}if(i(a),o(!1),a.url)return;const d=a.ok?m1:g1,h=setTimeout(()=>o(!0),d),p=setTimeout(()=>i(null),d+b1);return()=>{clearTimeout(h),clearTimeout(p)}},[a]),l?r.jsxs("div",{className:"oplog "+(l.ok?"oplog--ok":"oplog--bad")+(c?" oplog--leaving":""),role:"status","aria-live":l.ok?"polite":"assertive",children:[l.message,l.url&&r.jsxs("a",{className:"oplog__link",href:l.url,target:"_blank",rel:"noreferrer",onClick:d=>d.stopPropagation(),children:[l.url.replace(/^https?:\/\//,"")," ↗"]})]}):null}function Zc({value:a,className:l,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(a),p=_.useRef(null);_.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function m(){const x=d.trim();if(!x||x===a)return o();c(x)}return r.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:x=>h(x.target.value),onBlur:m,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),m()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Ur({active:a}){return a?r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M2 5h3V2"}),r.jsx("path",{d:"M14 5h-3V2"}),r.jsx("path",{d:"M2 11h3v3"}),r.jsx("path",{d:"M14 11h-3v3"})]}):r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M5 2H2v3"}),r.jsx("path",{d:"M11 2h3v3"}),r.jsx("path",{d:"M2 11v3h3"}),r.jsx("path",{d:"M14 11v3h-3"})]})}const x1=500,Si="application/x-ccv-fs-path",y1=200;function _1({open:a,tree:l,expanded:i,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:m,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:C,onMove:N,onCopy:D,onDelete:B,onRefresh:q,onClose:z,zoomed:X,onToggleZoom:E}){const[H,U]=_.useState(""),[M,P]=_.useState(null),[ie,de]=_.useState(null),[W,se]=_.useState(null),[ge,je]=_.useState(null),[me,O]=_.useState(null),[te,Y]=_.useState(null),oe=Mh("(hover: hover)"),xe=_.useRef(null),w=_.useMemo(()=>j1(d),[d]);function J(T){return!(!W||T===W.path||W.kind==="dir"&&T.startsWith(`${W.path}/`)||T===Ri(W.path))}function ue(T){return!(!me||T===me.path||me.kind==="dir"&&T.startsWith(`${me.path}/`)||me.mode==="cut"&&T===Ri(me.path))}function he(T){O({path:T.path,kind:T.kind,mode:"copy"})}function Ne(T){O({path:T.path,kind:T.kind,mode:"cut"})}function Ae(T){!me||!ue(T)||(T&&!i.has(T)&&y(T),me.mode==="cut"?(N(me.path,T),O(null)):D(me.path,T))}function qe(T,Q){const Se=T.touches[0];if(!Se)return;const Me={timer:0,x:Se.clientX,y:Se.clientY,el:T.currentTarget,fired:!1};Me.timer=window.setTimeout(()=>{Me.fired=!0,Q(Me.x,Me.y,Me.el)},x1),xe.current=Me}function st(T){const Q=xe.current,Se=T.touches[0];!Q||!Se||Math.hypot(Se.clientX-Q.x,Se.clientY-Q.y)>10&&(window.clearTimeout(Q.timer),xe.current=null)}function Ze(T){const Q=xe.current;Q&&(window.clearTimeout(Q.timer),Q.fired&&T.preventDefault())}function Ut(){var T;return(T=xe.current)!=null&&T.fired?(xe.current=null,!0):!1}function Le(T,Q,Se,Me){U((Me==null?void 0:Me.path)??""),Y({x:T,y:Q,opener:Se,entry:Me})}function dt(){const T=te==null?void 0:te.opener;Y(null),T!=null&&T.isConnected&&T.focus()}function Ke(T){return{onContextMenu:Q=>{Q.preventDefault(),Le(Q.clientX,Q.clientY,Q.currentTarget,T)},onTouchStart:Q=>qe(Q,(Se,Me,He)=>Le(Se,Me,He,T)),onTouchMove:st,onTouchEnd:Ze,onTouchCancel:Ze}}function Ie(T){T.target===T.currentTarget&&(T.preventDefault(),Le(T.clientX,T.clientY,T.currentTarget,null))}function Fe(T){T.target===T.currentTarget&&qe(T,(Q,Se,Me)=>Le(Q,Se,Me,null))}function ht(T){if(!(T.ctrlKey||T.metaKey)||T.target instanceof HTMLInputElement)return;const Q=T.key.toLowerCase();if(Q==="v"){T.preventDefault(),Ae(Wt());return}if(!H)return;const Se=Yb(l,H);Se&&(Q==="c"?(T.preventDefault(),he(Se)):Q==="x"&&(T.preventDefault(),Ne(Se)))}function It(T){return Q=>{Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData(Si,T.path),se({path:T.path,kind:T.kind})}}function vt(){se(null),je(null)}function Gn(T){return Q=>{Q.dataTransfer.types.includes(Si)&&(Q.stopPropagation(),!(T.kind!=="dir"||!J(T.path))&&(Q.preventDefault(),je(T.path)))}}function Jt(T){return Q=>{if(!Q.dataTransfer.types.includes(Si)||(Q.stopPropagation(),T.kind!=="dir"||!J(T.path)))return;Q.preventDefault();const Se=Q.dataTransfer.getData(Si);je(null),Se&&N(Se,T.path)}}function Ft(T){!T.dataTransfer.types.includes(Si)||!J("")||(T.preventDefault(),je(""))}function In(T){if(!T.dataTransfer.types.includes(Si)||!J(""))return;T.preventDefault();const Q=T.dataTransfer.getData(Si);je(null),Q&&N(Q,"")}const[Xt,ct]=_.useState(""),Sn=Xt.trim(),jn=Sn.length>0,yn=_.useRef(null),Qt=_.useRef(m);Qt.current=m;function kn(T){ct(T),yn.current&&clearTimeout(yn.current);const Q=T.trim();if(!Q){Qt.current("");return}yn.current=setTimeout(()=>Qt.current(Q),y1)}function Nn(T){yn.current&&clearTimeout(yn.current),ct(""),Qt.current(""),U(T.path),x(T)}const Ht=jn&&(p==null?void 0:p.query)===Sn?p:null;function Wt(){if(H==="")return"";const T=Yb(l,H);if((T==null?void 0:T.kind)==="dir")return H;const Q=H.lastIndexOf("/");return Q===-1?"":H.slice(0,Q)}function K(T,Q){const Se=Q??Wt();Se&&!i.has(Se)&&y(Se),de({parent:Se,kind:T})}function ce(){if(!te)return[];const T=Me=>oe?Me:void 0;if(!te.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:T("Ctrl+V"),disabled:!ue(""),onSelect:()=>Ae("")},{id:"new-file",label:"Создать файл",onSelect:()=>K("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>K("dir","")}];const Q=te.entry,Se=[Q.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(Q.path)}:{id:"toggle",label:i.has(Q.path)?"Свернуть":"Развернуть",onSelect:()=>y(Q.path)},{id:"copy",label:"Копировать",hint:T("Ctrl+C"),onSelect:()=>he(Q)},{id:"cut",label:"Вырезать",hint:T("Ctrl+X"),onSelect:()=>Ne(Q)}];return Q.kind==="dir"&&(Se.push({id:"paste",label:"Вставить",hint:T("Ctrl+V"),disabled:!ue(Q.path),onSelect:()=>Ae(Q.path)}),Se.push({id:"new-file",label:"Создать файл",onSelect:()=>K("file",Q.path)}),Se.push({id:"new-dir",label:"Создать каталог",onSelect:()=>K("dir",Q.path)})),Se.push({id:"rename",label:"Переименовать",onSelect:()=>P(Q.path)}),Se.push({id:"delete",label:"Удалить",onSelect:()=>B(Q)}),Se}const we=jn?[]:Ce("",0);function Ce(T,Q){const Se=l[T],Me=[];if(ie&&ie.parent===T&&Me.push(r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Q),children:[r.jsx("span",{className:"fsrow__icon",children:ie.kind==="dir"?r.jsx(Yo,{}):r.jsx(Vo,{})}),r.jsx(Zc,{className:"rename--file",value:"",placeholder:ie.kind==="dir"?"имя каталога":"имя файла",onCommit:He=>{de(null),v(T,ie.kind,He)},onCancel:()=>de(null)})]},`draft:${T}`)),!Se)return Me.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Q),children:"читаем…"},`wait:${T}`)),Me;Se.length===0&&!ie&&Me.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Q),children:"пусто"},`empty:${T}`));for(const He of Se){const Cn=He.kind==="dir"&&i.has(He.path);Me.push(M===He.path?r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Q),children:[r.jsx("span",{className:"fsrow__icon",children:He.kind==="dir"?r.jsx(Yo,{open:Cn}):r.jsx(Vo,{})}),r.jsx(Zc,{className:"rename--file",value:He.name,placeholder:"новое имя",onCommit:Ul=>{P(null),C(He.path,Ul)},onCancel:()=>P(null)})]},He.path):r.jsx(v1,{entry:He,depth:Q,open:Cn,active:He.path===c,selected:He.path===H,dirty:o.has(He.path),gitStatus:w.get(He.path),dragging:(W==null?void 0:W.path)===He.path,dropTarget:ge===He.path,cut:(me==null?void 0:me.mode)==="cut"&&me.path===He.path,onClick:()=>{Ut()||(U(He.path),He.kind==="dir"?y(He.path):j(He.path))},onRename:()=>P(He.path),onDelete:()=>B(He),onDragStart:It(He),onDragEnd:vt,onDragOver:Gn(He),onDrop:Jt(He),...Ke(He)},He.path)),Cn&&Me.push(...Ce(He.path,Q+1))}return Me}function bt(){if(!Ht)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ищем…"},"search:wait")];if(Ht.entries.length===0)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ничего не найдено"},"search:empty")];const T=Ht.entries.map(Q=>r.jsx(S1,{entry:Q,gitStatus:w.get(Q.path),onClick:()=>Nn(Q)},Q.path));return Ht.truncated&&T.push(r.jsxs("p",{className:"fsrow__pending",style:Wa(0),children:["показаны первые ",Ht.entries.length," — уточните запрос"]},"search:truncated")),T}return r.jsxs("aside",{className:(a?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(X?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:ht,children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:T=>{E&&(T.target.closest("button")||E())},children:[r.jsx(T1,{}),r.jsx("span",{className:"sidepane__title",children:"Файлы"}),r.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>K("file"),children:r.jsx(N1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>K("dir"),children:r.jsx(w1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:q,children:"↻"}),E&&r.jsx("button",{className:"sidepane__btn",title:X?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":X?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":X,onClick:E,children:r.jsx(Ur,{active:X})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:z,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(E1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:Xt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:T=>kn(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),Xt?kn(""):T.currentTarget.blur())}}),Xt&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>kn(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree"+(ge===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Ft,onDrop:In,onContextMenu:Ie,onTouchStart:Fe,onTouchMove:st,onTouchEnd:Ze,onTouchCancel:Ze,children:jn?bt():we}),r.jsx(zi,{result:h}),te&&r.jsx(Lo,{x:te.x,y:te.y,items:ce(),onClose:dt})]})}function v1({entry:a,depth:l,open:i,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:m,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:C,onDragEnd:N,onDragOver:D,onDrop:B,onContextMenu:q,onTouchStart:z,onTouchMove:X,onTouchEnd:E,onTouchCancel:H}){const U="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(a.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return r.jsxs("div",{className:U,style:Wa(l),draggable:!0,onDragStart:C,onDragEnd:N,onDragOver:D,onDrop:B,onContextMenu:q,onTouchStart:z,onTouchMove:X,onTouchEnd:E,onTouchCancel:H,children:[r.jsxs("button",{className:"fsrow__main",onClick:y,title:ey(a),children:[r.jsx("span",{className:"fsrow__icon"+Io("fsrow__icon",h),children:a.kind==="dir"?r.jsx(Yo,{open:i}):r.jsx(Vo,{})}),r.jsx("span",{className:"fsrow__name"+Io("fsrow__name",h),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&r.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),r.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${a.name}`,onClick:j,children:"✎"}),r.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${a.name}`,onClick:v,children:"✕"})]})}function S1({entry:a,gitStatus:l,onClick:i}){const c=a.path.slice(0,a.path.length-a.name.length-1);return r.jsxs("button",{className:"fsrow fsrow--search"+(a.ignored?" fsrow--ignored":""),style:Wa(0),onClick:i,title:ey(a),children:[r.jsx("span",{className:"fsrow__icon"+Io("fsrow__icon",l),children:a.kind==="dir"?r.jsx(Yo,{}):r.jsx(Vo,{})}),r.jsx("span",{className:"fsrow__name"+Io("fsrow__name",l),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&r.jsx("span",{className:"fsrow__path",children:c})]})}function ey(a){return a.ignored?`${a.path} — игнорируется git (.gitignore)`:a.path}function Wa(a){return{"--depth":a}}function Yb(a,l){var o;const i=l.lastIndexOf("/"),c=i===-1?"":l.slice(0,i);return((o=a[c])==null?void 0:o.find(d=>d.path===l))??null}function j1(a){const l=new Map,i={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||i[d]>i[h])&&l.set(o,d)};for(const o of a){const d=k1(o.status);if(!d)continue;c(o.path,d);let h=Ri(o.path);for(;c(h,d),!!h;)h=Ri(h)}return l}function k1(a){if(a==="??")return"added";const[l="",i=""]=a;return l==="A"||l==="R"||l==="C"?"added":l==="M"||i==="M"?"modified":null}function Io(a,l){return l?` ${a}--git-${l}`:""}function Yo({open:a=!1}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:a?r.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"}):r.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 Vo(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]})}function N1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function w1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:r.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"})}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function T1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.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"}),r.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 E1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const A1=200;function C1({open:a,result:l,onSearch:i,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,m]=_.useState(""),x=p.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(i);v.current=i;function C(B){m(B),j.current&&clearTimeout(j.current);const q=B.trim();if(!q){v.current("");return}j.current=setTimeout(()=>v.current(q),A1)}const N=y&&(l==null?void 0:l.query)===x?l:null;function D(){if(!N)return[r.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(N.matches.length===0)return[r.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const B=[];let q="";for(const z of N.matches)z.path!==q&&(q=z.path,B.push(r.jsx("p",{className:"searchgroup__path",title:z.path,children:z.path},`path:${z.path}`))),B.push(r.jsx(R1,{match:z,onClick:()=>c(z)},`${z.path}:${z.line}:${z.column}`));return N.truncated&&B.push(r.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",N.matches.length," — уточните запрос"]},"grep:truncated")),B}return r.jsxs("aside",{className:(a?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:B=>{h&&(B.target.closest("button")||h())},children:[r.jsx(M1,{}),r.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&r.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ur,{active:d})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(O1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:B=>C(B.target.value),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&(B.preventDefault(),p?C(""):B.currentTarget.blur())}}),p&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree",children:y?D():r.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function R1({match:a,onClick:l}){const i=a.lineText.slice(0,a.column-1),c=a.lineText.slice(a.column-1,a.column-1+a.matchLength),o=a.lineText.slice(a.column-1+a.matchLength);return r.jsxs("button",{className:"searchmatch",onClick:l,title:`${a.path}:${a.line}`,children:[r.jsx("span",{className:"searchmatch__line",children:a.line}),r.jsxs("span",{className:"searchmatch__text",children:[i,r.jsx("mark",{children:c}),o]})]})}function M1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function O1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let To=null;function D1(){return To||(To=Promise.all([Xe(()=>import("./index-C_LuD9HT.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Xe(()=>import("./index-891wE-Rj.js").then(a=>a.v),__vite__mapDeps([4,3]),import.meta.url),Xe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Xe(()=>import("./index-CrX9ldma.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Xe(()=>import("./codemirror-4gviWJRD.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([a,l,i,c,o])=>({EditorView:l.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:a.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(a=>{throw To=null,a})),To}function z1({path:a,doc:l,revision:i,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),p=_.useRef(null),m=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),C=_.useRef(o),N=_.useRef(d),D=_.useRef(a),B=_.useRef(i),q=_.useRef(l);C.current=o,N.current=d,D.current=a,B.current=i,q.current=l;const[z,X]=_.useState("loading"),[E,H]=_.useState(!1);function U(P,ie,de,W,se){const ge=x.current.get(W),je=y.current.get(W)===se;if(ge&&je)de.setState(ge);else{const O=P.EditorState.create({doc:q.current,extensions:[P.basicSetup,P.Prec.highest(P.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(N.current(D.current),!0)}])),P.keymap.of([P.indentWithTab]),ie.of([]),P.editorTheme,P.editorHighlight,P.EditorView.updateListener.of(te=>{te.docChanged&&C.current(D.current,te.state.doc.toString())})]});x.current.set(W,O),y.current.set(W,se),de.setState(O),j.current.delete(W)}if(j.current.has(W))return()=>{};let me=!1;return f1(W).then(O=>{me||!O||D.current!==W||(de.dispatch({effects:ie.reconfigure(O)}),x.current.set(W,de.state),j.current.add(W))}),()=>{me=!0}}_.useEffect(()=>{if(!h.current)return;let ie=!1,de=null,W=null;X("loading"),H(!1);const se=window.setTimeout(()=>{ie||H(!0)},200);return(async()=>{let ge;try{ge=await D1()}catch{window.clearTimeout(se),ie||X("error");return}if(ie||!h.current)return;window.clearTimeout(se);const je=new ge.Compartment;v.current=je,m.current=ge,W=new ge.EditorView({parent:h.current}),p.current=W,de=U(ge,je,W,D.current,B.current),X("ready")})(),()=>{ie=!0,window.clearTimeout(se),de==null||de(),W==null||W.destroy(),p.current===W&&(p.current=null),m.current=null,v.current=null}},[]),_.useEffect(()=>{const P=m.current,ie=p.current,de=v.current;if(!(!P||!ie||!de))return U(P,de,ie,a,i)},[a,i]);const M=_.useRef(0);return _.useEffect(()=>{const P=p.current,ie=m.current;if(!P||!ie||!c||c.token===M.current)return;M.current=c.token;const de=P.state.doc.lines,W=Math.min(Math.max(c.line,1),de),se=P.state.doc.line(W),ge=Math.min(se.from+Math.max(c.column-1,0),se.to);P.dispatch({selection:ie.EditorSelection.cursor(ge),effects:ie.EditorView.scrollIntoView(ge,{y:"center"})}),P.focus()},[c]),_.useEffect(()=>()=>{const P=p.current;P&&x.current.set(a,P.state)},[a]),r.jsxs("div",{className:"editor__code",children:[r.jsx("div",{ref:h,className:"editor__code-surface"+(z==="ready"?"":" is-hidden")}),z==="loading"&&E&&r.jsxs("div",{className:"editor__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),z==="error"&&r.jsxs("div",{className:"editor__fallback",children:[r.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[r.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),r.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),r.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function L1({file:a,goto:l,onChange:i,onSave:c,onReload:o,onOverwrite:d,onTogglePreview:h}){const p=Fa(a),m=Wx(a.path)&&!a.binary&&!a.tooLarge;return r.jsxs("div",{className:"editor",children:[r.jsxs("div",{className:"editor__bar",children:[r.jsx("span",{className:"editor__path",title:a.path,children:a.path}),r.jsxs("span",{className:"editor__meta",children:[ch(a.size),a.eol==="crlf"&&" · CRLF"]}),m&&r.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(a.previewMode?" is-on":""),role:"tab","aria-selected":a.previewMode,onClick:()=>!a.previewMode&&h(a.path),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(a.previewMode?"":" is-on"),role:"tab","aria-selected":!a.previewMode,onClick:()=>a.previewMode&&h(a.path),children:"Код"})]}),r.jsx("button",{className:"btn btn--sm",disabled:!p,title:"Сохранить (Ctrl+S)",onClick:()=>c(a.path),children:p?"Сохранить":"Сохранено"})]}),a.stale&&r.jsxs("div",{className:"editor__warn",children:[r.jsxs("span",{children:["Файл изменился на диске",p?" — а здесь есть несохранённые правки.":"."]}),r.jsx("button",{className:"btn btn--sm",onClick:()=>o(a.path),children:"Взять с диска"}),p&&r.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(a.path),children:"Сохранить поверх"})]}),a.binary?r.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",ch(a.size)," на диске."]}):a.tooLarge?r.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",ch(a.size),"). Такие правит агент, а не браузер."]}):m&&a.previewMode?r.jsx(U1,{text:a.text}):r.jsx(z1,{path:a.path,doc:a.text,revision:a.revision,goto:l,onChange:i,onSave:c})]})}function U1({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return Px(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function H1({files:a,activePath:l,busy:i,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return r.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[r.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[r.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&r.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),a.map(p=>r.jsxs("div",{className:"worktab"+(p.path===l?" is-on":""),role:"tab","aria-selected":p.path===l,onDoubleClick:m=>{h&&(m.target.closest(".worktab__close, .worktab__dot")||h())},children:[r.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:p1(p.path)}),Fa(p)?r.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):r.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),r.jsx("div",{className:"worktabs__spacer"}),h&&r.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ur,{active:d})})]})}const ty="ccv:sidebar.collapsed",ny="ccv:sidebar.mode",B1=500,Vb="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function q1({open:a,connected:l,status:i,workspaces:c,sessions:o,archived:d,pinned:h,activeWorkspaceId:p,activeSessionId:m,onSelectWorkspace:x,onSelectSession:y,onRenameSession:j,onPinSessions:v,onSelectPinned:C,onCloseWorkspaces:N,onArchiveSessions:D,onUnarchiveSessions:B,onOpenWorkspace:q,onNewSession:z,onOpenExtensions:X,account:E,onOpenAccount:H,relay:U,onOpenRelay:M,onOpenSettings:P,themeMode:ie,onCycleTheme:de}){const[W,se]=_.useState(null),[ge,je]=_.useState(""),[me,O]=_.useState(Y1),[te,Y]=_.useState(V1);function oe(){Y(T=>{const Q=T==="pinned"?"default":"pinned";try{localStorage.setItem(ny,Q)}catch{}return Q})}const xe=ge.trim().toLowerCase(),w=xe!=="",J=_.useMemo(()=>w?c.filter(T=>T.name.toLowerCase().includes(xe)||T.path.toLowerCase().includes(xe)):c,[c,xe,w]),ue=_.useMemo(()=>w?o.filter(T=>(T.title??"").toLowerCase().includes(xe)):o,[o,xe,w]),he=_.useMemo(()=>w?d.filter(T=>(T.title??"").toLowerCase().includes(xe)):d,[d,xe,w]),Ne=T=>{var Q;return((Q=c.find(Se=>Se.id===T))==null?void 0:Q.name)??"—"},Ae=T=>{var Q;return(Q=c.find(Se=>Se.id===T))==null?void 0:Q.path},qe=_.useMemo(()=>w?h.filter(T=>(T.title??"").toLowerCase().includes(xe)||Ne(T.workspaceId).toLowerCase().includes(xe)):h,[h,c,xe,w]);function st(T){O(Q=>{const Se=Q.includes(T)?Q.filter(Me=>Me!==T):[...Q,T];try{localStorage.setItem(ty,JSON.stringify(Se))}catch{}return Se})}const Ze=T=>!me.includes(T),Ut=Qb(J),Le=Qb(ue),[dt,Ke]=_.useState(null),[Ie,Fe]=_.useState(null),[ht,It]=_.useState(null),vt=_.useRef(null);function Gn(T,Q){const Se=T.touches[0];if(!Se)return;const Me={timer:0,x:Se.clientX,y:Se.clientY,el:T.currentTarget,fired:!1};Me.timer=window.setTimeout(()=>{Me.fired=!0,Q(Me.x,Me.y,Me.el)},B1),vt.current=Me}function Jt(T){const Q=vt.current,Se=T.touches[0];!Q||!Se||Math.hypot(Se.clientX-Q.x,Se.clientY-Q.y)>10&&(window.clearTimeout(Q.timer),vt.current=null)}function Ft(T){const Q=vt.current;Q&&(window.clearTimeout(Q.timer),Q.fired&&T.preventDefault())}function In(){var T;return(T=vt.current)!=null&&T.fired?(vt.current=null,!0):!1}function Xt(){const T=dt==null?void 0:dt.opener;Ke(null),T!=null&&T.isConnected&&T.focus()}function ct(){const T=Ie==null?void 0:Ie.opener;Fe(null),T!=null&&T.isConnected&&T.focus()}function Sn(){const T=ht==null?void 0:ht.opener;It(null),T!=null&&T.isConnected&&T.focus()}function jn(T){return{onContextMenu:Q=>{Q.preventDefault(),Ke({x:Q.clientX,y:Q.clientY,opener:Q.currentTarget,ids:Ut.targetsFor(T)})},onTouchStart:Q=>Gn(Q,(Se,Me,He)=>Ke({x:Se,y:Me,opener:He,ids:Ut.targetsFor(T)})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}function yn(T){return{onContextMenu:Q=>{Q.preventDefault(),Fe({x:Q.clientX,y:Q.clientY,opener:Q.currentTarget,ids:Le.targetsFor(T)})},onTouchStart:Q=>Gn(Q,(Se,Me,He)=>Fe({x:Se,y:Me,opener:He,ids:Le.targetsFor(T)})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}function Qt(T){return{onContextMenu:Q=>{Q.preventDefault(),It({x:Q.clientX,y:Q.clientY,opener:Q.currentTarget,ids:[T.id]})},onTouchStart:Q=>Gn(Q,(Se,Me,He)=>It({x:Se,y:Me,opener:He,ids:[T.id]})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}const kn=o.filter(T=>T.state!=="closed").length,Nn=dt?[{id:"close",label:dt.ids.length>1?`Закрыть проекты (${dt.ids.length})`:"Закрыть проект",onSelect:()=>{N(dt.ids),Ut.clear()}}]:[],Ht=dt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(p&&dt.ids.includes(p)&&kn>0?` в нём сейчас незавершённых сессий: ${kn} — при закрытии они остановятся на хосте.`:""):void 0,Wt=Ie?ue.find(T=>T.id===Ie.ids[0]):void 0,K=(Wt==null?void 0:Wt.pinned)!==!0,ce=Ie?[...Ie.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>se(Ie.ids[0])}]:[],{id:"pin",label:K?Ie.ids.length>1?`Закрепить (${Ie.ids.length})`:"Закрепить":Ie.ids.length>1?`Открепить (${Ie.ids.length})`:"Открепить",onSelect:()=>{Wt&&v(Wt.workspaceId,Ie.ids,K),Le.clear()}},{id:"archive",label:Ie.ids.length>1?`Убрать в архив (${Ie.ids.length})`:"Убрать в архив",onSelect:()=>{D(p,Ie.ids),Le.clear()}}]:[],we=Ie?Vb:void 0,Ce=ht?qe.find(T=>T.id===ht.ids[0]):void 0,bt=ht?[{id:"rename",label:"Переименовать",onSelect:()=>se(ht.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Ce&&v(Ce.workspaceId,[Ce.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ce&&D(Ce.workspaceId,[Ce.id])}}]:[];return r.jsxs("aside",{className:a?"sidebar sidebar--open":"sidebar",children:[r.jsxs("div",{className:"sidebar__head",children:[r.jsx("span",{className:l?"dot dot--on":"dot",title:i}),r.jsx("span",{className:"brand",children:"Claude Code Visual"}),r.jsx("button",{className:"theme-btn","aria-pressed":te==="pinned",title:te==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":te==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:oe,children:r.jsx(ly,{})}),r.jsx("button",{className:"theme-btn",title:`Тема: ${$b[ie]}`,"aria-label":`Тема: ${$b[ie]}. Переключить`,onClick:de,children:r.jsx(X1,{mode:ie})})]}),r.jsxs("div",{className:"fssearch fssearch--sidebar",children:[r.jsx(I1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:ge,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:T=>je(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),ge?je(""):T.currentTarget.blur())}}),ge&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>je(""),children:"✕"})]}),r.jsx("div",{className:"sidebar__scroll",children:te==="pinned"?r.jsxs(r.Fragment,{children:[qe.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),qe.map(T=>r.jsx("div",{className:T.id===m?"row row--active":"row",...W===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Qt(T)},children:W===T.id?r.jsx("div",{className:"row__main",children:r.jsx(Zc,{value:T.title??"",onCommit:Q=>{j(T,Q),se(null)},onCancel:()=>se(null)})}):r.jsxs("button",{className:"row__main",onClick:()=>{In()||C(T)},children:[r.jsx(oh,{title:T.title??"Без названия",pinned:!1,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx(Zb,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]})},T.id))]}):r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Проекты",count:J.length,open:Ze("workspaces"),onToggle:()=>st("workspaces")}),Ze("workspaces")&&r.jsxs(r.Fragment,{children:[J.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока ни одного"})}),J.map(T=>r.jsx("div",{className:Xb(T.id===p,Ut.selected.includes(T.id)),...jn(T),children:r.jsxs("button",{className:"row__main",onClick:Q=>{In()||Ut.click(Q,T,()=>x(T.id))},children:[r.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),r.jsx("span",{className:"row__meta",title:T.path,children:T.path})]})},T.id))]}),p&&r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Сессии",count:ue.length,open:Ze("sessions"),onToggle:()=>st("sessions")}),Ze("sessions")&&r.jsxs(r.Fragment,{children:[ue.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока ни одной"})}),ue.map(T=>r.jsx("div",{className:Xb(T.id===m,Le.selected.includes(T.id)),...W===T.id?{}:yn(T),children:W===T.id?r.jsx("div",{className:"row__main",children:r.jsx(Zc,{value:T.title??"",onCommit:Q=>{j(T,Q),se(null)},onCancel:()=>se(null)})}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"row__main",onClick:Q=>{In()||Le.click(Q,T,()=>y(T))},children:[r.jsx(oh,{title:T.title??"Без названия",pinned:T.pinned===!0,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx(Zb,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),r.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{In()||se(T.id)},children:"✎"})]})},T.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Архив",count:he.length,open:Ze("archive"),onToggle:()=>st("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Ze("archive")&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),he.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока пусто"})}),he.map(T=>r.jsxs("div",{className:T.id===m?"row row--active":"row",children:[r.jsxs("button",{className:"row__main",onClick:()=>y(T),children:[r.jsx(oh,{title:T.title??"Без названия",pinned:!1,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx("span",{className:"row__meta",children:J1(T)})]}),r.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>B([T.id]),children:"Вернуть"})]},T.id))]})]})]})]})}),r.jsxs("div",{className:"sidebar__foot",children:[r.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:H,children:[r.jsx("span",{className:E!=null&&E.loggedIn?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:E===null?"Аккаунт":E.loggedIn?E.email||"Вход выполнен":"Войти в аккаунт"}),(E==null?void 0:E.plan)&&r.jsx("span",{className:"chip",children:E.plan})]}),M&&r.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:M,children:[r.jsx("span",{className:U!=null&&U.connected?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:U===null?"Удалённый доступ":U.paired?U.connected?U.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(U==null?void 0:U.connected)&&U.clients>0&&r.jsx("span",{className:"chip",children:U.clients})]}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!X,title:"MCP-серверы и плагины",onClick:()=>X==null?void 0:X(),children:"Расширения"}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:P,children:"Настройки"}),r.jsx("button",{className:"btn btn--ghost",onClick:q,children:"+ Проект"}),r.jsx("button",{className:"btn btn--primary",onClick:z,disabled:!p,children:"+ Сессия"})]}),dt&&r.jsx(Lo,{x:dt.x,y:dt.y,items:Nn,note:Ht,onClose:Xt}),Ie&&r.jsx(Lo,{x:Ie.x,y:Ie.y,items:ce,note:we,onClose:ct}),ht&&r.jsx(Lo,{x:ht.x,y:ht.y,items:bt,note:Vb,onClose:Sn})]})}function Xb(a,l){const i=["row"];return a&&i.push("row--active"),l&&i.push("row--selected"),i.join(" ")}function Qb(a){const[l,i]=_.useState([]),c=_.useRef(null);function o(){i([]),c.current=null}function d(p,m,x){if(p.ctrlKey||p.metaKey){i(y=>y.includes(m.id)?y.filter(j=>j!==m.id):[...y,m.id]),c.current=m.id;return}if(p.shiftKey&&c.current){const y=a.findIndex(v=>v.id===c.current),j=a.findIndex(v=>v.id===m.id);if(y!==-1&&j!==-1){const[v,C]=y<j?[y,j]:[j,y];i(a.slice(v,C+1).map(N=>N.id));return}}o(),c.current=m.id,x()}function h(p){return l.includes(p.id)?l:(i([p.id]),c.current=p.id,[p.id])}return{selected:l,click:d,targetsFor:h,clear:o}}function uh({title:a,count:l,open:i,onToggle:c,hint:o}){const d=i?`Свернуть «${a}»`:`Развернуть «${a}»`;return r.jsxs("button",{className:"sidebar__section sidebar__section--btn","aria-expanded":i,title:o?`${d} — ${o}`:d,onClick:c,children:[r.jsx(G1,{open:i}),r.jsx("span",{className:"sidebar__section-name",children:a}),r.jsx("span",{className:"sidebar__count",children:l})]})}function G1({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function ly({className:a}){return r.jsxs("svg",{className:a,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),r.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),r.jsx("path",{d:"M8 12.2v1.4"})]})}function I1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Y1(){try{const a=localStorage.getItem(ty);if(a===null)return["archive"];const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>i==="workspaces"||i==="sessions"||i==="archive"):["archive"]}catch{return["archive"]}}function V1(){try{return localStorage.getItem(ny)==="pinned"?"pinned":"default"}catch{return"default"}}const $b={system:"как в системе",light:"светлая",dark:"тёмная"};function X1({mode:a}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return a==="dark"?r.jsx("svg",{...l,children:r.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"})}):a==="light"?r.jsxs("svg",{...l,children:[r.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),r.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"})]}):r.jsxs("svg",{...l,children:[r.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),r.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Q1(a){switch(a.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return $1(a.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function $1(a){switch(a){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Z1(a){switch(a.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return K1(a.lastTurn);case"error":return"error";case"closed":return"closed"}}function K1(a){switch(a){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Zb({session:a,tail:l}){return r.jsxs("span",{className:"row__meta",children:[r.jsxs("span",{className:`row__state row__state--${Z1(a)}`,children:[r.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),Q1(a)]})," · ",l]})}function oh({title:a,pinned:l,projectName:i,projectPath:c}){return r.jsxs("span",{className:"row__head",children:[r.jsxs("span",{className:"row__title",children:[l&&r.jsx(ly,{className:"row__pin"}),a]}),r.jsx("span",{className:"row__project",title:c,children:i})]})}function J1(a){const l=a.archivedAuto?"сама, по сроку молчания":"убрана вручную";return a.archivedAt?`${new Date(a.archivedAt).toLocaleString()} · ${l}`:l}const Kb=3,F1=15e5;function ay(a,l){if(!l||typeof l!="object")return null;const i=l,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(a==="Write"){if(typeof i.content!="string")return null;const o=fh(i.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(a==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=tS(W1(fh(i.old_string),fh(i.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:i.replace_all===!0?"все вхождения":null}}return null}function fh(a){if(a==="")return[];const l=a.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function W1(a,l){let i=0;for(;i<a.length&&i<l.length&&a[i]===l[i];)i++;let c=a.length,o=l.length;for(;c>i&&o>i&&a[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...a.slice(0,i).map(d),...P1(a.slice(i,c),l.slice(i,o)),...a.slice(c).map(d)]}function P1(a,l){if(a.length===0&&l.length===0)return[];if(a.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return a.map(y=>({type:"del",text:y}));if((a.length+1)*(l.length+1)>F1)return[...a.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const i=a.length,c=l.length,o=c+1,d=new Uint32Array((i+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=i-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=a[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const p=[];let m=0,x=0;for(;m<i&&x<c;){const y=a[m],j=l[x];y===j?(p.push({type:"ctx",text:y}),m++,x++):h(m+1,x)>=h(m,x+1)?(p.push({type:"del",text:y}),m++):(p.push({type:"add",text:j}),x++)}for(;m<i;)p.push({type:"del",text:a[m++]});for(;x<c;)p.push({type:"add",text:l[x++]});return eS(p)}function eS(a){const l=[];let i=[];function c(){l.push(...i.filter(o=>o.type==="del")),l.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of a)o.type==="ctx"?(c(),l.push(o)):i.push(o);return c(),l}function tS(a){if(!a.some(d=>d.type!=="ctx"))return a;const l=a.map(()=>!1);a.forEach((d,h)=>{if(d.type!=="ctx")for(let p=Math.max(0,h-Kb);p<=Math.min(a.length-1,h+Kb);p++)l[p]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${nS(c.length)} без изменений`}),c=[]}return a.forEach((d,h)=>{l[h]?(o(),i.push(d)):c.push(d)}),o(),i}function nS(a){const l=a%100;if(l>=11&&l<=14)return"строк";switch(a%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Xh(a){try{return await navigator.clipboard.writeText(a),!0}catch{}const l=document.createElement("textarea");l.value=a,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function lS(){try{return await navigator.clipboard.readText()}catch{return null}}const Qh=1600,Mi="Копировать",wr="Скопировано";function $h({text:a,hint:l,className:i}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Qh);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[a]),r.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?wr:`${Mi} ${l}`,title:c?wr:`${Mi} ${l}`,onClick:()=>{Xh(a).then(d=>{d&&o(!0)})},children:c?wr:Mi})}function Zh({diff:a}){return r.jsxs("div",{className:"diff",children:[r.jsxs("div",{className:"diff__head",children:[r.jsx("span",{className:"diff__path",title:a.filePath,children:a.filePath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]})]}),a.note&&r.jsx("div",{className:"diff__note",children:a.note}),r.jsx("div",{className:"diff__body",children:a.rows.length===0?r.jsx("div",{className:"diff__row diff__row--gap",children:r.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):a.rows.map((l,i)=>r.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[r.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),r.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},i))})]})}function aS({waiting:a}){const[l,i]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>i(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),r.jsxs("div",{className:a?"work work--wait":"work",children:[r.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:a?"ждёт разрешения":"думает"}),!a&&r.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Kh({items:a,busy:l,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,empty:m="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!0),v=_.useRef(null),C=_.useRef(null),N=_.useRef(!1);_.useEffect(()=>{j.current=!0,v.current=null,N.current=!1,C.current!==null&&(clearTimeout(C.current),C.current=null)},[p]),_.useEffect(()=>{const q=x.current,z=y.current;if(!q||!z)return;function X(U){!q||U===q.scrollTop||(N.current=!0,q.scrollTop=U)}function E(){if(!q)return;const U=v.current;if(U){const M=Fb(q,U.id);if(M){const P=M.getBoundingClientRect().top-q.getBoundingClientRect().top;X(q.scrollTop+(P-U.top))}C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{v.current=null},500);return}j.current&&X(q.scrollHeight)}const H=new ResizeObserver(E);return H.observe(z),()=>{H.disconnect(),C.current!==null&&clearTimeout(C.current)}},[]);function D(){const q=x.current;if(q){if(N.current){N.current=!1;return}j.current=q.scrollHeight-q.scrollTop-q.clientHeight<80}}function B(){if(d)return;const q=x.current,z=c[0];if(q&&z){const X=Fb(q,z.id);X&&(v.current={id:z.id,top:X.getBoundingClientRect().top-q.getBoundingClientRect().top})}h==null||h()}return r.jsx("div",{className:"transcript",ref:x,onScroll:D,children:r.jsxs("div",{className:"stream",ref:y,children:[o&&r.jsx("button",{type:"button",className:"transcript__more",onClick:B,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(q=>r.jsx(Jb,{item:q},q.id)),c.length>0&&a.length>0&&r.jsx("div",{className:"transcript__divider",children:r.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&a.length===0&&r.jsx("p",{className:"empty",children:m}),a.map(q=>r.jsx(Jb,{item:q},q.id)),l&&r.jsx(aS,{waiting:i})]})})}function Jb({item:a}){switch(a.kind){case"user":return r.jsx("div",{className:"msg--user","data-item-id":a.id,children:a.text});case"assistant":return r.jsxs("div",{className:"msg--assistant","data-item-id":a.id,children:[r.jsx(sS,{text:a.text}),a.streaming&&r.jsx("span",{className:"caret"}),a.text.trim()!==""&&r.jsx("div",{className:"msg--assistant__foot",children:r.jsx($h,{text:a.text,hint:"ответ целиком"})})]});case"thinking":return r.jsx("div",{className:"thinking","data-item-id":a.id,children:a.text});case"tool":return r.jsx(rS,{item:a});case"result":return r.jsxs("div",{className:"result-line","data-item-id":a.id,children:[r.jsx("span",{children:a.isError?"✗ "+a.subtype:"✓ готово"}),r.jsxs("span",{children:[(a.durationMs/1e3).toFixed(1)," с"]}),a.costUsd!==null&&r.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),r.jsxs("span",{children:["↑",Pb(a.inputTokens)," ↓",Pb(a.outputTokens)]})]});case"notice":return r.jsx("div",{className:a.tone==="error"?"notice notice--error":"notice","data-item-id":a.id,children:a.text})}}function Fb(a,l){const i=a.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===l)return c;return null}function sS({text:a}){const[l,i]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return Px(a).then(h=>{d||i(iS(h))}),()=>{d=!0}},[a]),_.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var m,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&Xh(p).then(y=>{if(!y)return;h.textContent=wr,h.setAttribute("aria-label",wr),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Mi,h.setAttribute("aria-label",Ah),h.classList.remove("copybtn--done"))},Qh);c.current.push(j)})}return r.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Ah=`${Mi} блок кода`;function iS(a){if(!a.includes("<pre"))return a;const l=new DOMParser().parseFromString(a,"text/html");for(const i of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Ah),o.title=Ah,o.textContent=Mi,c.append(o)}return l.body.innerHTML}function rS({item:a}){const[l,i]=_.useState(!1),c=a.result===null,o=ay(a.name,a.input),d=a.name==="AskUserQuestion"?oS(a.input):null;return r.jsxs("div",{className:"tool"+(a.isError?" tool--error":"")+(a.awaitingPermission?" tool--wait":""),"data-item-id":a.id,children:[r.jsxs("button",{className:"tool__head",onClick:()=>i(h=>!h),children:[r.jsx("span",{className:"tool__name",children:a.name}),r.jsx("span",{className:"tool__arg",children:d?uS(d):cS(a.input)}),r.jsx("span",{className:"tool__status",children:c?"…":a.isError?"ошибка":l?"▴":"▾"})]}),l&&r.jsxs("div",{className:"tool__body",children:[d?r.jsx(fS,{questions:d,answers:a.answers}):o?r.jsx(Zh,{diff:o}):r.jsx(Wb,{text:JSON.stringify(a.input,null,2),hint:"аргументы вызова"}),a.result!==null&&(!d||a.isError)&&r.jsx(Wb,{text:a.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Wb({text:a,hint:l,style:i}){return r.jsxs("div",{className:"codeblock",style:i,children:[r.jsx("pre",{className:"code",children:a}),r.jsx($h,{text:a,hint:l,className:"codeblock__copy"})]})}function cS(a){if(!a||typeof a!="object")return"";const l=a;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=l[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function uS(a){var i;const l=a.map(c=>c.header).filter(c=>c.length>0);return l.length===a.length?l.join(" · "):((i=a[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function oS(a){if(typeof a!="object"||a===null)return null;const l=a.questions;if(!Array.isArray(l)||l.length===0)return null;const i=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:p}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const m=[];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;m.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}i.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:p===!0})}return i}function fS({questions:a,answers:l}){return r.jsx("div",{className:"tool__questions",children:a.map((i,c)=>r.jsxs("div",{className:"tool__question",children:[r.jsxs("div",{className:"tool__question-head",children:[i.header&&r.jsx("span",{className:"chip chip--accent",children:i.header}),r.jsx("span",{className:"tool__question-text",children:i.question})]}),r.jsx("div",{className:"tool__question-answer",children:l!=null&&l[i.question]?r.jsx("span",{className:"tool__answer-value",children:l[i.question]}):r.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Pb(a){return a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const dS="ccv.dictation.lang",ex="ru-RU";function hS(a){try{return Function.prototype.toString.call(a).includes("[native code]")}catch{return!1}}function tx(){const a=window,l=[a.SpeechRecognition,a.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=l.find(hS);return!i&&l.length>0&&Ql("распознавание подменено: родной реализации в странице нет"),i??l[0]??null}function sy(){var a;try{return((a=localStorage.getItem(dS))==null?void 0:a.trim())||ex}catch{return ex}}function Ql(a,l){l===void 0?console.debug(`[dictation] ${a}`):console.debug(`[dictation] ${a}`,l)}const pS=3,mS=400,gS=5,bS=250,xS=2e3,yS=2e4;async function _S(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const vS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${sy()}`};function SS(a){const[l]=_.useState(()=>tx()!==null),[i,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),p=_.useRef(!1),m=_.useRef(!1),x=_.useRef(a),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),C=_.useRef(null),N=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),D=_.useCallback(()=>{N();const E=async H=>{if(C.current=null,!(!p.current||v.current)){if(!H&&!await _S()){if(Ql("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;C.current=setTimeout(()=>void E(!0),yS);return}Ql("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void E(!1),xS)},[N]);_.useEffect(()=>{x.current=a}),_.useEffect(()=>{const E=tx();if(!E)return;const H=new E;return H.lang=sy(),H.continuous=!0,H.interimResults=!0,H.onstart=()=>{Ql("сессия открыта"),v.current=!0,N(),c(!0)},H.onaudiostart=()=>{Ql("пошёл звук с микрофона"),y.current.audio=!0},H.onresult=U=>{var de;if(m.current)return;let M="",P="";for(let W=U.resultIndex;W<U.results.length;W++){const se=U.results[W];if(!se)continue;const ge=((de=se[0])==null?void 0:de.transcript)??"";se.isFinal?M+=ge:P+=ge}const ie=y.current;ie.heard=!0,ie.everHeard=!0,Ql("распознано",{final:M,interim:P}),x.current(M,P)},H.onerror=U=>{y.current.lastError=U.error,Ql("ошибка движка",U.error),!(U.error==="no-speech"||U.error==="aborted")&&(p.current=!1,c(!1),d(vS[U.error]??`Распознавание не работает: ${U.error}`))},H.onend=()=>{m.current=!1,v.current=!1;const U=y.current,M=Date.now()-U.openedAt;if(Ql("сессия закрыта",{мс:M,звук:U.audio,слова:U.heard,ошибка:U.lastError||null}),!p.current){c(!1);return}if(U.dead=!U.audio&&M<mS?U.dead+1:0,U.dead>=gS){p.current=!1,c(!1),d(U.lastError?`Распознавание не работает: ${U.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}U.silent=U.heard?0:U.silent+1,!U.everHeard&&!U.warned&&U.silent>=pS&&(U.warned=!0,d(U.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){U.openedAt=Date.now(),U.audio=!1,U.heard=!1,U.lastError="",D();try{H.start()}catch{}}},bS)},h.current=H,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.current=null,N(),H.onend=null,H.onresult=null,H.onerror=null,H.onstart=null,H.onaudiostart=null,H.abort(),h.current=null}},[]);const B=_.useCallback(()=>{var E;if(p.current){if(p.current=!1,Ql("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,N(),!v.current){c(!1);return}(E=h.current)==null||E.stop()}},[]),q=_.useCallback(()=>{const E=h.current;if(E){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,m.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),Ql("включение микрофона",{язык:E.lang}),D();try{E.start()}catch(H){Ql("start() не прошёл",H)}}},[D]),z=_.useCallback(()=>{p.current?B():q()},[q,B]),X=_.useCallback(()=>{var E;p.current&&v.current&&(m.current=!0,(E=h.current)==null||E.abort())},[]);return{supported:l,listening:i,error:o,toggle:z,stop:B,drop:X}}const iy="ccv:drafts",jS=40,kS=2e4,NS=500;let Yc=null,Vc=null;function ry(){if(Yc)return Yc;const a=new Map;try{const l=localStorage.getItem(iy);if(l){const i=JSON.parse(l);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&a.set(c,o)}}catch{}return Yc=a,window.addEventListener("pagehide",cy),a}function dh(a){return ry().get(a)??""}function wS(a,l){const i=ry(),c=l.slice(0,kS),o=i.has(a);if(o&&i.delete(a),c!=="")i.set(a,c);else if(!o)return;for(;i.size>jS;){const d=i.keys().next();if(d.done)break;i.delete(d.value)}TS()}function TS(){Vc===null&&(Vc=window.setTimeout(cy,NS))}function cy(){if(Vc!==null&&window.clearTimeout(Vc),Vc=null,!!Yc)try{localStorage.setItem(iy,JSON.stringify(Object.fromEntries(Yc)))}catch{}}const ES="(max-width: 860px)",nx=/^\/(\S*)$/,AS=new Set(["model","permissions"]);function CS(a){return AS.has(a.name)||a.name.startsWith("__")}const RS=new Set(["clear","rename"]),lx=/(?:^|\s)@([^\s@]*)$/,MS=200,OS=100,DS=190;function uy({disabled:a,busy:l,commands:i,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:m="Отправить",autoFocus:x=!1,onContextSearch:y,onCommand:j,onSend:v,onInterrupt:C,onEscape:N}){var Wt;const D=Mh(ES),[B,q]=_.useState(()=>p?dh(p):""),[z,X]=_.useState(!1),[E,H]=_.useState(0),U=_.useRef(null),M=_.useRef(null),P=_.useRef(null),[ie,de]=_.useState(()=>p?dh(p).length:0),[W,se]=_.useState([]),[ge,je]=_.useState(-1),me=_.useRef(""),[O,te]=_.useState(""),Y=SS(_.useCallback((K,ce)=>{K&&q(we=>hh(we,K)),te(ce.trim())},[])),oe=O?hh(B,O):B;_.useEffect(()=>{Y.listening||O===""||(q(K=>hh(K,O)),te(""))},[Y.listening,O]),_.useEffect(()=>{var K;x&&((K=U.current)==null||K.focus())},[x]);const xe=_.useRef(new Map),w=_.useRef(new Map),J=_.useRef(p),ue=_.useRef({text:B,caret:ie});ue.current={text:B,caret:ie};const he=_.useCallback((K,ce,we)=>{ce===""?(xe.current.delete(K),w.current.delete(K)):(xe.current.set(K,ce),w.current.set(K,we)),wS(K,ce)},[]),Ne=Y.drop;_.useLayoutEffect(()=>{const K=J.current;if(K===p)return;J.current=p,K&&he(K,ue.current.text,ue.current.caret);const ce=p?xe.current.get(p)??dh(p):"",we=p?w.current.get(p):void 0,Ce=Math.min(we??ce.length,ce.length);q(ce),de(Ce),P.current=[Ce,Ce],te(""),H(0),X(!1),je(-1),me.current="",Ne()},[p,he,Ne]),_.useEffect(()=>{p&&he(p,B,ie)},[p,B,ie,he]);const Ae=a?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",qe=_.useRef(0),st=_.useCallback(K=>{const ce=parseFloat(getComputedStyle(K).maxHeight),we=Number.isFinite(ce)&&ce>0?ce:DS;K.style.height="auto";const Ce=K.scrollHeight;K.style.height=`${Math.min(Ce,we)}px`,K.style.overflowY=Ce>we?"auto":"hidden";const bt=P.current;bt&&(P.current=null,K.setSelectionRange(bt[0],bt[1]))},[]);_.useEffect(()=>{const K=U.current;K&&st(K)},[oe,Ae,a,st]),_.useEffect(()=>{const K=U.current;if(!K)return;const ce=new ResizeObserver(([we])=>{const Ce=we==null?void 0:we.contentRect.width;Ce===void 0||Math.abs(Ce-qe.current)<1||(qe.current=Ce,st(K))});return ce.observe(K),()=>ce.disconnect()},[st]);const Ze=Y.stop;_.useEffect(()=>{a&&Ze()},[a,Ze]);const Ut=_.useMemo(()=>Y.error?{ok:!1,message:Y.error}:null,[Y.error]),Le=_.useMemo(()=>{var we;const K=(we=nx.exec(B))==null?void 0:we[1];if(K===void 0)return[];const ce=K.toLowerCase();return i.filter(Ce=>!CS(Ce)&&ph(Ce,ce)<oy).sort((Ce,bt)=>ph(Ce,ce)-ph(bt,ce))},[B,i]),dt=!z&&Le.length>0,Ke=Math.min(E,Le.length-1),Ie=z?null:((Wt=lx.exec(oe.slice(0,ie)))==null?void 0:Wt[1])??null,Fe=_.useRef(y);Fe.current=y,_.useEffect(()=>{if(Ie===null||Ie===""||Ie.endsWith("/")){Fe.current(Ie);return}const K=setTimeout(()=>Fe.current(Ie),MS);return()=>clearTimeout(K)},[Ie]);const ht=Ie!==null&&(o==null?void 0:o.query)===Ie,It=ht?o.entries:[],vt=Ie!==null,Gn=vt&&!ht,Jt=Math.min(E,Math.max(It.length-1,0));_.useEffect(()=>{var ce,we;if(!dt&&!vt)return;const K=dt?Ke:Jt;(we=(ce=M.current)==null?void 0:ce.children[K])==null||we.scrollIntoView({block:"nearest"})},[dt,vt,Ke,Jt]);function Ft(K,ce){var we;q(K),de(ce),P.current=[ce,ce],H(0),X(!1),O!==""&&(te(""),Y.drop()),(we=U.current)==null||we.focus()}function In(){q(""),te(""),H(0),de(0),X(!1),je(-1),me.current="",Y.drop(),p&&he(p,"",0)}function Xt(K){const ce=K.trim();!ce||a||(v(ce),se(we=>[ce,...we.filter(Ce=>Ce!==ce)].slice(0,OS)),In())}function ct(K){if(K<-1||K>=W.length)return;ge===-1&&(me.current=B);const ce=K===-1?me.current:W[K]??"";je(K),Ft(ce,ce.length)}function Sn(){var Ce;const K=((Ce=U.current)==null?void 0:Ce.selectionStart)??oe.length,we=`${K>0&&!/\s$/.test(oe.slice(0,K))?" ":""}@`;Ft(oe.slice(0,K)+we+oe.slice(K),K+we.length)}function jn(K){var bt;const ce=(bt=lx.exec(oe.slice(0,ie)))==null?void 0:bt[1];if(ce===void 0)return;const we=ie-ce.length-1,Ce=K.kind==="dir"?`@${K.path}/`:`@${K.path} `;Ft(oe.slice(0,we)+Ce+oe.slice(ie),we+Ce.length)}function yn(){var ce;const K=(ce=nx.exec(oe.trim()))==null?void 0:ce[1];if(K&&j(K)){In();return}Xt(oe)}function Qt(K,ce){q(K),de(ce),H(0),X(!1),je(-1),O!==""&&(te(""),Y.drop())}function kn(K){var Ce;const ce=RS.has(K.name)?c:null,we=`/${K.name} `;q(we+(ce??"")),de(we.length+((ce==null?void 0:ce.length)??0)),ce&&(P.current=[we.length,we.length+ce.length]),H(0),(Ce=U.current)==null||Ce.focus()}function Nn(K){if(j(K.name)){q(""),H(0),X(!1);return}K.argumentHint?kn(K):Xt(`/${K.name}`)}function Ht(K){if(dt){if(K.key==="ArrowDown")return K.preventDefault(),H(ce=>(Math.min(ce,Le.length-1)+1)%Le.length);if(K.key==="ArrowUp"){K.preventDefault();const ce=Le.length-1;return H(we=>(Math.min(we,ce)+ce)%Le.length)}if(K.key==="Enter"&&!K.shiftKey){K.preventDefault();const ce=Le[Ke];ce&&Nn(ce);return}if(K.key==="Tab"){K.preventDefault();const ce=Le[Ke];ce&&kn(ce);return}if(K.key==="Escape"){K.preventDefault(),K.stopPropagation(),X(!0);return}}if(vt){if(K.key==="ArrowDown"&&It.length>0)return K.preventDefault(),H(ce=>(Math.min(ce,It.length-1)+1)%It.length);if(K.key==="ArrowUp"&&It.length>0){K.preventDefault();const ce=It.length-1;return H(we=>(Math.min(we,ce)+ce)%It.length)}if(K.key==="Enter"&&!K.shiftKey||K.key==="Tab"){const ce=It[Jt];if(ce){K.preventDefault(),jn(ce);return}if(K.key==="Tab")return}if(K.key==="Escape"){K.preventDefault(),K.stopPropagation(),X(!0);return}}if((K.key==="ArrowUp"||K.key==="ArrowDown")&&!K.shiftKey){const ce=K.currentTarget,we=ce.selectionStart;if(ce.selectionEnd===we){const Ce=K.key==="ArrowUp",bt=Ce?!oe.slice(0,we).includes(`
118
- `):!oe.slice(we).includes(`
119
- `),T=Ce?ge+1:ge-1;if(bt&&T>=-1&&T<W.length){K.preventDefault(),ct(T);return}}}if(K.key==="Escape"&&N){K.preventDefault(),K.stopPropagation(),N();return}K.key==="Enter"&&!K.shiftKey&&!D&&(K.preventDefault(),yn())}return r.jsx("div",{className:d?`composer ${d}`:"composer",children:r.jsxs("div",{className:"composer__inner",children:[r.jsx(zi,{result:Ut}),vt&&!dt&&r.jsxs("div",{className:"cmdmenu",role:"listbox",ref:M,children:[It.map((K,ce)=>r.jsxs("button",{role:"option","aria-selected":ce===Jt,className:ce===Jt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(ce),onMouseDown:we=>{we.preventDefault(),jn(K)},children:[r.jsxs("span",{className:"cmdmenu__name",children:[K.name,K.kind==="dir"?"/":""]}),r.jsx("span",{className:"cmdmenu__desc",children:K.path}),K.ignored&&r.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},K.path)),It.length===0&&r.jsx("div",{className:"cmdmenu__empty",children:Gn?"ищем…":Ie?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),dt&&r.jsx("div",{className:"cmdmenu",role:"listbox",ref:M,children:Le.map((K,ce)=>r.jsxs("button",{role:"option","aria-selected":ce===Ke,className:ce===Ke?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(ce),onMouseDown:we=>{we.preventDefault(),Nn(K)},children:[r.jsxs("span",{className:"cmdmenu__name",children:["/",K.name]}),K.argumentHint&&r.jsx("span",{className:"cmdmenu__hint",children:K.argumentHint}),r.jsx("span",{className:"cmdmenu__desc",children:K.description})]},K.name))}),r.jsxs("div",{className:"composer__field",children:[r.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:a,onClick:Sn,children:r.jsx(US,{})}),r.jsx("textarea",{ref:U,value:oe,disabled:a,placeholder:Ae,onChange:K=>Qt(K.target.value,K.target.selectionStart),onSelect:K=>de(K.currentTarget.selectionStart),onKeyDown:Ht}),Y.supported&&r.jsx("button",{type:"button",className:Y.listening?"micbtn is-on":"micbtn",title:Y.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Y.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Y.listening,disabled:a,onClick:Y.toggle,children:r.jsx(BS,{on:Y.listening})}),l?r.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):r.jsxs("button",{className:"btn btn--primary sendbtn",onClick:yn,disabled:a||oe.trim()==="","aria-label":m,title:m,children:[r.jsx("span",{className:"sendbtn__label",children:m}),r.jsx(HS,{})]})]})]})})}function hh(a,l){const i=l.trim();if(i==="")return a;const c=Ch(i).slice(zS(a,i)).join(" ");return c===""?a:a===""||/\s$/.test(a)?a+c:`${a} ${c}`}function zS(a,l){const i=Ch(a),c=Ch(l);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((d,h)=>LS(d,c[h]??"")))return o;return 0}function Ch(a){return a.split(/\s+/).filter(l=>l!=="")}function LS(a,l){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(a)===i(l)}function US(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function HS(){return r.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:r.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function BS({on:a}){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:a?"currentColor":"none"}),r.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),r.jsx("path",{d:"M8 12.8v1.5"})]})}const oy=4;function ph(a,l){const i=a.name.toLowerCase();return i===l?0:i.startsWith(l)?1:a.aliases.some(c=>c.toLowerCase().startsWith(l))?2:i.includes(l)?3:oy}function qS({request:a,queued:l,onDecide:i}){const c=ay(a.toolName,a.input);return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[r.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),r.jsxs("div",{className:"sheet__body",children:[r.jsx("div",{className:"sheet__tool",children:a.toolName}),a.reason&&r.jsx("p",{className:"sheet__reason",children:a.reason}),c?r.jsx(Zh,{diff:c}):r.jsx("pre",{className:"code",children:JSON.stringify(a.input,null,2)})]}),r.jsxs("div",{className:"sheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>i(a.requestId,"deny"),children:"Отклонить"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>i(a.requestId,"allow"),children:"Разрешить"})]})]})})}function GS({request:a,queued:l,onAnswer:i,onDecline:c}){const{questions:o}=a,[d,h]=_.useState(()=>o.map(()=>new Set)),[p,m]=_.useState(()=>o.map(()=>"")),[x,y]=_.useState(()=>ax(o));_.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),y(ax(o))},[a.requestId]);const j=_.useMemo(()=>YS(o,d,p),[o,d,p]),v=j!==null;function C(X,E){var H,U;(U=(H=o[X])==null?void 0:H.options[E])!=null&&U.preview&&y(M=>{const P=M.slice();return P[X]=E,P})}function N(X,E,H){h(U=>{const M=U.slice(),P=new Set(M[X]);return H?P.has(E)?P.delete(E):P.add(E):P.has(E)||(P.clear(),P.add(E)),M[X]=P,M}),E!=="other"&&C(X,E)}function D(X,E){m(H=>{const U=H.slice();return U[X]=E,U})}function B(){j&&i(a.requestId,j)}function q(X){X.key==="Enter"&&(X.target.closest("button")||v&&(X.preventDefault(),B()))}function z(X){var M;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(X.key))return;const E=Array.from(X.currentTarget.querySelectorAll("button.qsheet__option")),H=E.indexOf(document.activeElement);if(H===-1)return;X.preventDefault();const U=X.key==="ArrowDown"||X.key==="ArrowRight"?1:-1;(M=E[(H+U+E.length)%E.length])==null||M.focus()}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:q,children:[r.jsxs("div",{className:"qsheet__head",children:[r.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),r.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),r.jsxs("div",{className:"qsheet__body",children:[a.reason&&r.jsx("p",{className:"qsheet__reason",children:a.reason}),o.map((X,E)=>r.jsx(IS,{q:X,qi:E,selected:d[E]??new Set,otherText:p[E]??"",previewIndex:x[E]??null,onToggle:N,onFocusOption:C,onOtherText:D,onOptionsKeyDown:z},E))]}),r.jsxs("div",{className:"qsheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>c(a.requestId),children:"Не отвечать"}),r.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:B,children:"Ответить"})]})]})})}function IS({q:a,qi:l,selected:i,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:m}){var C;const x=a.options.some(N=>N.preview),y=o!==null?(C=a.options[o])==null?void 0:C.preview:void 0,j=i.has("other"),v=a.multiSelect?"checkbox":"radio";return r.jsxs("div",{className:"qsheet__question",children:[r.jsxs("div",{className:"qsheet__qhead",children:[r.jsx("span",{className:"chip chip--accent",children:a.header}),r.jsx("span",{className:"qsheet__qtext",children:a.question})]}),r.jsxs("div",{className:"qsheet__options"+(a.multiSelect?"":" qsheet__options--radio"),role:a.multiSelect?"group":"radiogroup","aria-label":a.question,onKeyDown:m,children:[a.options.map((N,D)=>{const B=i.has(D);return r.jsxs("button",{type:"button",role:v,"aria-checked":B,className:"qsheet__option"+(B?" is-selected":""),onClick:()=>d(l,D,a.multiSelect),onFocus:()=>h(l,D),onMouseEnter:()=>h(l,D),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:N.label}),r.jsx("span",{className:"qsheet__opt-desc",children:N.description})]})]},D)}),r.jsxs("div",{className:"qsheet__other",children:[r.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",a.multiSelect),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),r.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&r.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${a.question}»`,value:c,onChange:N=>p(l,N.target.value),autoFocus:!0})]})]}),x&&r.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function ax(a){return a.map(l=>{const i=l.options.findIndex(c=>c.preview);return i===-1?null:i})}function YS(a,l,i){const c={};for(let o=0;o<a.length;o++){const d=a[o];if(!d)continue;const h=l[o]??new Set,p=[];for(let m=0;m<d.options.length;m++){const x=d.options[m];x&&h.has(m)&&p.push(x.label)}if(h.has("other")){const m=(i[o]??"").trim();m&&p.push(m)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function fy({path:a}){const[l,i]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!l)return;function p(m){var x;(x=d.current)!=null&&x.contains(m.target)||i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),_.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),Qh);return()=>clearTimeout(p)},[c]),_.useEffect(()=>i(!1),[a]);async function h(){await Xh(a)&&o(!0)}return r.jsxs("div",{ref:d,className:"cwd",children:[r.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${a}`,onClick:()=>i(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),i(!1))},children:[r.jsx(VS,{open:l}),r.jsx("span",{className:"cwd__short",children:a})]}),l&&r.jsxs("div",{className:"cwd__pop",children:[r.jsx("span",{className:"cwd__full",children:a}),r.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?wr:Mi})]})]})}function VS({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function es({value:a,options:l,onChange:i,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,m]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),C=l.find(B=>B.value===a)??null;_.useEffect(()=>{if(!p)return;const B=l.findIndex(q=>q.value===a);y(B===-1?0:B)},[p]),_.useEffect(()=>{if(!p)return;function B(q){var z;(z=j.current)!=null&&z.contains(q.target)||m(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[p]),_.useEffect(()=>{var B,q;p&&((q=(B=v.current)==null?void 0:B.querySelector(".is-cursor"))==null||q.scrollIntoView({block:"nearest"}))},[p,x]),_.useEffect(()=>{if(!p)return;const B=v.current,q=XS(j.current);if(!B||!q)return;const z=B.getBoundingClientRect().bottom-q.getBoundingClientRect().bottom;z>0&&(q.scrollTop+=Math.min(z+8,B.offsetHeight))},[p]);function N(B){m(!1),B.value!==a&&i(B.value)}function D(B){if(B.key==="Escape"){if(!p)return;B.preventDefault(),B.stopPropagation(),m(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!p)return m(!0);const q=B.key==="ArrowDown"?1:l.length-1;return y(z=>(z+q)%l.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!p)return m(!0);const q=l[x];q&&N(q)}}return r.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(B=>!B),onKeyDown:D,children:[r.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),r.jsx(QS,{})]}),p&&r.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((B,q)=>r.jsxs("button",{type:"button",role:"option","aria-selected":B.value===a,className:"select__option"+(q===x?" is-cursor":"")+(B.value===a?" is-on":""),onMouseEnter:()=>y(q),onClick:()=>N(B),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===a?"✓":""}),r.jsx("span",{className:"select__label",children:B.label}),B.hint&&r.jsx("span",{className:"select__hint",children:B.hint})]},B.value))})]})}function XS(a){let l=(a==null?void 0:a.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function QS(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const $S=["low","medium","high"];function dy({models:a,value:l,effort:i,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:p,onEffort:m,onUltracode:x,onThinking:y,onSwitchOnFlag:j}){const[v,C]=_.useState(!1),[N,D]=_.useState(0),B=_.useRef(null),q=_.useRef(null),z=a.find(M=>M.value===l)??null,X=z&&z.supportsEffort?z.effortLevels.length>0?z.effortLevels:$S:[],E=X.includes("xhigh");_.useEffect(()=>{if(!v)return;const M=a.findIndex(P=>P.value===l);D(M===-1?0:M)},[v]),_.useEffect(()=>{if(!v)return;function M(P){var ie;(ie=B.current)!=null&&ie.contains(P.target)||C(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[v]),_.useEffect(()=>{var M,P;v&&((P=(M=q.current)==null?void 0:M.querySelector(".is-cursor"))==null||P.scrollIntoView({block:"nearest"}))},[v,N]);function H(M){C(!1),M.value!==l&&p(M.value)}function U(M){if(M.key==="Escape"){if(!v)return;M.preventDefault(),M.stopPropagation(),C(!1);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){if(M.preventDefault(),!v)return C(!0);if(a.length===0)return;const P=M.key==="ArrowDown"?1:a.length-1;return D(ie=>(ie+P)%a.length)}if(M.key==="Enter"||M.key===" "){if(M.preventDefault(),!v)return C(!0);const P=a[N];P&&H(P)}}return r.jsxs("div",{ref:B,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>C(M=>!M),onKeyDown:U,children:[r.jsx("span",{className:"select__value",children:(z==null?void 0:z.displayName)??l??"—"}),c?r.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):X.length>0&&i&&r.jsx("span",{className:"select__suffix",children:i}),r.jsx(ZS,{})]}),v&&r.jsxs("div",{ref:q,className:"select__menu modelmenu",role:"menu",children:[r.jsx("div",{className:"modelmenu__head",children:"Модель"}),a.map((M,P)=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M.value===l,className:"select__option"+(P===N?" is-cursor":"")+(M.value===l?" is-on":""),onMouseEnter:()=>D(P),onClick:()=>H(M),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:M.value===l?"✓":""}),r.jsx("span",{className:"select__label",children:M.displayName}),M.description&&r.jsx("span",{className:"select__hint",children:M.description})]},M.value)),X.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"modelmenu__sep",role:"separator"}),r.jsxs("div",{className:"modelmenu__row",children:[r.jsxs("span",{className:"modelmenu__label",children:["Усилие",r.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),r.jsx("span",{className:"modelmenu__levels",children:X.map(M=>r.jsx("button",{type:"button",role:"menuitemradio","aria-checked":M===i,className:M===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(M),children:M},M))})]}),E&&r.jsx(mh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),r.jsx("div",{className:"modelmenu__sep",role:"separator"}),(z==null?void 0:z.supportsThinking)!==!1&&r.jsx(mh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>y(!o)}),r.jsx(mh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function mh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[r.jsxs("span",{className:"modelmenu__label",children:[a,r.jsx("span",{className:"modelmenu__desc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function ZS(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function wl({title:a,children:l,actions:i,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.useEffect(()=>{function p(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),d();return}if(m.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||(m.shiftKey&&document.activeElement===j?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),j.focus()))}return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[d]),r.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&d()},children:r.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":a,children:[r.jsxs("div",{className:"modal__head",children:[r.jsx("h2",{className:"modal__title",children:a}),r.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),r.jsx("div",{className:"modal__body",children:l}),i&&r.jsx("div",{className:"modal__actions",children:i})]})})}function KS({candidates:a,searching:l,agentItems:i,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:m,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[C,N]=_.useState("open"),[D,B]=_.useState(""),[q,z]=_.useState(!1),[X,E]=_.useState(""),[H,U]=_.useState(""),[M,P]=_.useState({git:!0,claudeMd:!0,readme:!0}),ie=D.trim(),de=ie!=="",W=X.trim(),se=H.trim(),ge=W!==""&&se!=="";_.useEffect(()=>{X===""&&d.length>0&&E(d[0])},[d]);const je=_.useRef(p);je.current=p,_.useEffect(()=>{if(C!=="open")return;const Y=D.trim(),oe=setTimeout(()=>je.current(Y),200);return()=>clearTimeout(oe)},[D,C]);function me(){de&&y(ie)}function O(){ge&&j(W,se,M)}function te(){de&&(z(!0),m(ie))}return h?r.jsxs(wl,{title:"Новый проект",onClose:v,actions:r.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[r.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),r.jsx("p",{className:"newproj__preview",children:h.path}),r.jsx("div",{className:"modal__error",children:r.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(Y=>r.jsx("li",{children:Y},Y))})}),r.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):r.jsxs(wl,{title:"Новый проект",className:q&&C==="open"?"modal--wide":void 0,onClose:v,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?r.jsxs(r.Fragment,{children:[c?r.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):r.jsx("button",{className:"btn",disabled:!de,onClick:te,title:"Найти по описанию",children:"Попросить агента"}),r.jsx("button",{className:"btn btn--primary",disabled:!de,onClick:me,children:"Открыть"})]}):r.jsx("button",{className:"btn btn--primary",disabled:!ge,onClick:O,children:"Создать"})]}),children:[r.jsxs("div",{className:"tabs",children:[r.jsx(sx,{label:"Открыть",on:C==="open",onClick:()=>N("open")}),r.jsx(sx,{label:"Создать",on:C==="create",onClick:()=>N("create")})]}),C==="open"?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),r.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),r.jsx("input",{id:"workspace-path",className:"input input--mono",value:D,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:Y=>B(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),me())}}),o&&r.jsx("p",{className:"modal__error",children:o}),a.length>0&&r.jsx("ul",{className:"finds",children:a.map(Y=>r.jsx("li",{children:r.jsxs("button",{className:"find",disabled:Y.open,title:Y.open?"Этот проект уже открыт":Y.path,onClick:()=>B(Y.path),onDoubleClick:()=>y(Y.path),children:[r.jsx("span",{className:"find__name",children:Y.name}),r.jsx("span",{className:"find__path",children:Y.path}),r.jsx("span",{className:"find__note",children:WS(Y)})]})},Y.path))}),a.length===0&&de&&!l&&!q&&r.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),q&&r.jsx("div",{className:"finds__agent",children:r.jsx(Kh,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),r.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),r.jsx("input",{id:"workspace-parent",className:"input input--mono",value:X,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:Y=>E(Y.target.value)}),d.length>0&&r.jsx("div",{className:"newproj__roots",children:d.map(Y=>r.jsx("button",{type:"button",className:Y===W?"newproj__root is-on":"newproj__root",title:Y,onClick:()=>E(Y),children:FS(Y)},Y))}),r.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),r.jsx("input",{id:"workspace-name",className:"input input--mono",value:H,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:Y=>U(Y.target.value),onKeyDown:Y=>{Y.key==="Enter"&&(Y.preventDefault(),O())}}),r.jsx("p",{className:"newproj__preview",children:ge?JS(W,se):"Каталог появится здесь"}),o&&r.jsx("p",{className:"modal__error",children:o}),r.jsxs("div",{className:"newproj__opts",children:[r.jsx(gh,{label:"git init",desc:"панель истории работает сразу",on:M.git,onToggle:()=>P(Y=>({...Y,git:!Y.git}))}),r.jsx(gh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:M.claudeMd,onToggle:()=>P(Y=>({...Y,claudeMd:!Y.claudeMd}))}),r.jsx(gh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:M.readme,onToggle:()=>P(Y=>({...Y,readme:!Y.readme}))})]})]})]})}function sx({label:a,on:l,onClick:i}){return r.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:i,children:a})}function gh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[r.jsxs("span",{className:"newproj__optlabel",children:[a,r.jsx("span",{className:"newproj__optdesc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function JS(a,l){const i=a.includes("\\")?"\\":"/";return a.replace(/[\\/]+$/,"")+i+l}function FS(a){const l=a.includes("\\")?"\\":"/",i=a.split(/[\\/]/).filter(Boolean);return i.length<=2?a:`…${l}${i.slice(-2).join(l)}`}function WS(a){return a.open?"уже открыт":a.why?a.why:a.sessions===0?"рядом с вашими проектами":`${PS(a.sessions)}${ej(a.lastUsedAt)}`}function PS(a){const l=a%10,i=a%100;return i>=11&&i<=14?`${a} сессий`:l===1?`${a} сессия`:l>=2&&l<=4?`${a} сессии`:`${a} сессий`}function ej(a){if(!a)return"";const l=Math.floor((Date.now()-a)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(a).toLocaleDateString("ru-RU")}`}const Jh=7;function tj(a){const l=[],i=[];let c=1;for(const o of a){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=ix(l),l[h]=o.hash);const[p,...m]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const v of m){let C=l.indexOf(v);C===-1&&(C=ix(l),l[C]=v),x.push({from:h,to:C})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||l[v]===C&&j.push(v)}nj(l),c=Math.max(c,l.length,h+1),i.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:i,columns:Math.min(c,Jh)}}function ix(a){const l=a.indexOf(null);return l!==-1?l:(a.push(null),a.length-1)}function nj(a){for(;a.length>0&&a[a.length-1]===null;)a.pop()}const hy=1500;function lj(a){const l=[];let i=!1;for(const c of a.patch.split(`
120
- `)){if(l.length>=hy){i=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:aj(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:a.path||a.oldPath,rows:l,added:a.added,removed:a.removed,note:sj(a,i)}}function aj(a){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(a);if(!l)return a;const i=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function sj(a,l){const i=[];return a.status==="added"&&i.push("новый файл"),a.status==="deleted"&&i.push("файл удалён"),a.status==="renamed"&&i.push(`переименован из ${a.oldPath}`),a.binary?i.push("двоичный файл"):a.patch===""&&i.push("содержимое не показано"),l&&i.push(`показаны первые ${hy} строк`),i.length>0?i.join(" · "):null}function ij({open:a,state:l,result:i,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:m,onPull:x,onPublish:y,onConnectRemote:j,onClose:v,zoomed:C,onToggleZoom:N}){const D=tj((l==null?void 0:l.commits)??[]),B=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(q=>({value:q.name,label:q.name,hint:q.hash.slice(0,8)}))];return r.jsxs("aside",{className:(a?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(C?" sidepane--zoomed":""),"aria-label":"История git",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:q=>{N&&(q.target.closest("button")||N())},children:[r.jsx(fj,{}),r.jsx("span",{className:"sidepane__title",children:"История"}),r.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),N&&r.jsx("button",{className:"sidepane__btn",title:C?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":C?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":C,onClick:N,children:r.jsx(Ur,{active:C})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:v,children:"✕"})]}),l===null?r.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"gitbar",children:r.jsx(es,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:B,onChange:q=>{q&&p(q,`ветку ${q}`)}})}),l.detached&&r.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),r.jsx("div",{className:"gitbar__actions",children:o?r.jsxs("p",{className:"gitbar__busy",children:[r.jsx(mj,{}),o]}):l.hasRemote?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[r.jsx(dj,{}),"Отправить",l.ahead>0&&r.jsx("span",{className:"gitbar__count",children:l.ahead})]}),r.jsxs("div",{className:"gitbar__group",children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[r.jsx(hj,{}),"Забрать",l.behind>0&&r.jsx("span",{className:"gitbar__count",children:l.behind})]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:r.jsx(pj,{})})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[r.jsx(cx,{}),"Опубликовать на GitHub"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),r.jsxs("div",{className:"sidepane__scroll",children:[r.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:r.jsxs("span",{className:"gitrow__body",children:[r.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${xj(l.changed.length)}`:"Рабочее дерево чистое"}),r.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(q=>bj(q.path)).join(", "):"незакоммиченных изменений нет"})]})}),D.rows.map(q=>r.jsx(rj,{row:q,columns:D.columns,head:q.commit.hash===l.head,local:l.hasRemote&&!q.commit.pushed,active:c===q.commit.hash,onOpen:()=>h(q.commit.hash)},q.commit.hash)),D.rows.length===0&&r.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):r.jsxs("div",{className:"gitempty",children:[r.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[r.jsx(cx,{}),"Опубликовать на GitHub"]}),r.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),r.jsx(zi,{result:i})]})}const Bc=50,rx=13;function rj({row:a,columns:l,head:i,local:c,active:o,onOpen:d}){const{commit:h}=a,p=h.refs.map(gj).filter(Boolean);return r.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[r.jsx(cj,{row:a,columns:l,head:i,local:c}),r.jsxs("span",{className:"gitrow__body",children:[r.jsxs("span",{className:"gitrow__subject",children:[p.map(m=>r.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),r.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",yj(h.date),c&&r.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function cj({row:a,columns:l,head:i,local:c}){const o=l*rx+6,d=Bc/2,h=x=>8+Math.min(x,Jh-1)*rx,p=c?"3.5 2.5":void 0,m=Eo(a.col);return r.jsxs("svg",{className:"gitgraph",width:o,height:Bc,viewBox:`0 0 ${o} ${Bc}`,"aria-hidden":"true",children:[a.through.map(x=>r.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Bc,style:{stroke:Eo(x)}},`t${x}`)),a.up.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Eo(x.from),strokeDasharray:p}},`u${y}`)),a.down.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Bc}`,fill:"none",style:{stroke:Eo(x.to),strokeDasharray:p}},`d${y}`)),i&&r.jsx("circle",{className:"gitgraph__head",cx:h(a.col),cy:d,r:a.commit.parents.length>1?7.4:6.6}),r.jsx("circle",{className:"gitgraph__dot",cx:h(a.col),cy:d,r:a.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:c?void 0:m}})]})}function Eo(a){return`var(--lane-${a%Jh})`}function uj({detail:a,local:l,onCheckout:i,onClose:c}){const o=a.hash==="";return r.jsxs(wl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${a.shortHash}`,onClose:c,actions:r.jsxs(r.Fragment,{children:[!o&&r.jsx("button",{className:"btn",onClick:()=>i(a.hash,`коммит ${a.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),r.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&r.jsxs("div",{className:"commit__head",children:[r.jsx("p",{className:"commit__subject",children:a.subject}),r.jsxs("p",{className:"commit__meta",children:[a.author,a.email&&` <${a.email}>`," · ",_j(a.date)," ·"," ",r.jsx("span",{className:"commit__hash",children:a.hash})]}),l&&r.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),a.parents.length>0&&r.jsxs("p",{className:"commit__meta",children:[a.parents.length>1?"слияние: ":"родитель: ",a.parents.map(d=>d.slice(0,8)).join(", ")]}),a.body&&r.jsx("pre",{className:"commit__body",children:a.body})]}),a.truncated&&r.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),a.files.length===0?r.jsx("p",{className:"modal__text",children:"Изменений нет."}):a.files.map(d=>r.jsx(oj,{file:d,defaultOpen:a.files.length<=3},d.path+d.oldPath))]})}function oj({file:a,defaultOpen:l}){const[i,c]=_.useState(l);return r.jsxs("div",{className:"commit__file",children:[r.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[r.jsx("span",{className:"commit__filepath",children:a.path||a.oldPath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]}),r.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&r.jsx(Zh,{diff:lj(a)})]})}function fj(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function dj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function hj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function pj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4"}),r.jsx("path",{d:"m13 13-2.6-2.6"})]})}function cx(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r.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 mj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function gj(a){return a.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function bj(a){const l=a.split("/");return l[l.length-1]??a}function xj(a){const l=a%100;if(l>=11&&l<=14)return"файлов";switch(a%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function yj(a){const l=Date.parse(a);if(Number.isNaN(l))return a;const i=Math.round((Date.now()-l)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function _j(a){const l=Date.parse(a);return Number.isNaN(l)?a:new Date(l).toLocaleString()}function ux(a){return a.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"project"}function vj({status:a,owners:l,files:i,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:m,onPublish:x,onClose:y}){var te;const[j,v]=_.useState(()=>ux(c)),[C,N]=_.useState(""),[D,B]=_.useState(""),[q,z]=_.useState(!0),[X,E]=_.useState("Первый коммит"),[H,U]=_.useState(null),[M,P]=_.useState("");_.useEffect(()=>{!C&&l.length>0&&N(l[0].login)},[C,l]),_.useEffect(()=>{i&&H===null&&U(new Set(i.files))},[i,H]);const ie=(a==null?void 0:a.connected)===!0,de=l.map(Y=>({value:Y.login,label:Y.login,hint:Y.kind==="org"?"организация":void 0})),W=_.useMemo(()=>{if(!i)return[];const Y=M.trim().toLowerCase();return Y?i.files.filter(oe=>oe.toLowerCase().includes(Y)):i.files},[i,M]),se=(H==null?void 0:H.size)??0,ge=ie&&j.trim()!==""&&C!==""&&d===""&&(o||se>0);function je(Y){U(oe=>{const xe=new Set(oe??[]);return xe.has(Y)?xe.delete(Y):xe.add(Y),xe})}function me(Y){U(oe=>{const xe=new Set(oe??[]);for(const w of W)Y?xe.add(w):xe.delete(w);return xe})}function O(){if(!ge)return;const Y=(i==null?void 0:i.files)??[];x({owner:C,name:j.trim(),description:D.trim(),private:q,include:o?[]:Y.filter(oe=>H==null?void 0:H.has(oe)),ignore:o?[]:Y.filter(oe=>!(H!=null&&H.has(oe))),message:o?"":X.trim()||"Первый коммит"})}return r.jsxs(wl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:y,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:y,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!ge,onClick:O,children:d||"Опубликовать"})]}),children:[r.jsx(Sj,{status:a,onRefreshStatus:p,onSaveToken:m}),r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Имя"}),r.jsx("input",{className:"input input--mono",value:j,spellCheck:!1,autoComplete:"off",onChange:Y=>v(ux(Y.target.value))})]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Владелец"}),l.length>1?r.jsx(es,{className:"settings__select",value:C,options:de,onChange:N,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):r.jsx("p",{className:"publish__static",children:((te=l[0])==null?void 0:te.login)??"—"})]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Описание (необязательно)"}),r.jsx("input",{className:"input",value:D,placeholder:"о чём проект — одной строкой",onChange:Y=>B(Y.target.value)})]}),r.jsxs("div",{className:"field publish__field",children:[r.jsx("span",{children:"Видимость"}),r.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[r.jsx(ox,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:q,onClick:()=>z(!0)}),r.jsx(ox,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!q,onClick:()=>z(!1)})]})]})]}),!o&&r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?r.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"publish__filehead",children:[r.jsxs("span",{className:"publish__filecount",children:[se," из ",i.files.length," файлов"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>me(!0),children:"Отметить все"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>me(!1),children:"Снять все"})]}),i.files.length>8&&r.jsx("input",{className:"input publish__filter",value:M,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:Y=>P(Y.target.value)}),r.jsx("div",{className:"publish__filelist",children:W.length===0?r.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):W.map(Y=>r.jsxs("button",{type:"button",role:"checkbox","aria-checked":(H==null?void 0:H.has(Y))===!0,className:"publish__file",onClick:()=>je(Y),children:[r.jsx("span",{className:"publish__box"+(H!=null&&H.has(Y)?" is-on":""),"aria-hidden":"true",children:(H==null?void 0:H.has(Y))&&"✓"}),r.jsx("span",{className:"publish__filepath",children:Y})]},Y))}),i.truncated&&r.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Сообщение коммита"}),r.jsx("input",{className:"input",value:X,onChange:Y=>E(Y.target.value)})]})]})]}),r.jsx(zi,{result:h})]})}function ox({title:a,desc:l,on:i,risky:c,onClick:o}){return r.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[a,c&&r.jsx("span",{className:"access__risk",children:"видно всем"})]}),r.jsx("span",{className:"access__desc",children:l})]})]})}function Sj({status:a,onRefreshStatus:l,onSaveToken:i}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return r.jsxs("div",{className:"publish__section publish__section--first",children:[r.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),a===null?r.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):a.connected?r.jsxs("div",{className:"publish__account",children:[r.jsx("span",{className:"chip chip--ok",children:a.login}),r.jsx("span",{className:"publish__accountvia",children:a.source==="gh"?"через GitHub CLI":"по личному токену"}),a.source==="token"&&r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):r.jsxs("div",{className:"publish__connect",children:[a.ghInstalled&&r.jsxs("p",{className:"modal__text",children:["В системе установлен ",r.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",r.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Личный токен GitHub"}),r.jsx(jj,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),r.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",r.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",r.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),a.message&&r.jsx("p",{className:"modal__error",children:a.message}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function jj({value:a,onChange:l,visible:i,onToggleVisible:c,placeholder:o,autoFocus:d}){return r.jsxs("div",{className:"pwfield",children:[r.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:a,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),r.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?r.jsx(Nj,{}):r.jsx(kj,{})})]})}function kj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Nj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),r.jsx("path",{d:"M2 14 14 2"})]})}function wj({busy:a,result:l,onSubmit:i,onClose:c}){const[o,d]=_.useState(""),h=/^(https?|ssh|git):\/\/\S+/i.test(o.trim())||/^[\w.-]+@[\w.-]+:.+/.test(o.trim());return r.jsxs(wl,{title:"Подключить существующий репозиторий",onClose:c,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:c,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!h||a!=="",onClick:()=>i(o.trim()),children:a||"Подключить"})]}),children:[r.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",r.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Адрес репозитория"}),r.jsx("input",{className:"input input--mono",value:o,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&h&&a===""&&i(o.trim())}})]}),r.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",r.jsx("code",{children:"https://…"}),", ",r.jsx("code",{children:"ssh://…"}),", ",r.jsx("code",{children:"git://…"})," и"," ",r.jsx("code",{children:"git@host:path"}),"."]}),r.jsx(zi,{result:l})]})}function Tj({open:a,items:l,busy:i,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:N,onModel:D,onEffort:B,onUltracode:q,onThinking:z,onSwitchOnFlag:X,onAsk:E,onInterrupt:H,onReset:U,onClose:M,zoomed:P,onToggleZoom:ie}){return r.jsxs("aside",{className:(a?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(P?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:de=>{ie&&(de.target.closest("button")||ie())},children:[r.jsx(Ej,{}),r.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),r.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:U,children:"↻"}),ie&&r.jsx("button",{className:"sidepane__btn",title:P?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":P?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":P,onClick:ie,children:r.jsx(Ur,{active:P})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:M,children:"✕"})]}),p.length>0&&r.jsxs("div",{className:"sidepane__tools",children:[r.jsx(dy,{className:"select--compact",models:p,value:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:D,onEffort:B,onUltracode:q,onThinking:z,onSwitchOnFlag:X}),r.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),r.jsx(Kh,{items:l,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),r.jsx(uy,{className:"composer--side",disabled:!c,busy:i,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:a,onContextSearch:C,onCommand:N,onSend:E,onInterrupt:H,onEscape:i?H:M})]})}function Ej(){return r.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:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Aj=75,Cj=90;function py({usage:a}){if(!(a!=null&&a.available))return null;const l=[];return a.fiveHour&&l.push({key:"five",label:"5 ч",window:a.fiveHour}),a.sevenDay&&l.push({key:"week",label:"нед",window:a.sevenDay}),l.length===0?null:r.jsx("div",{className:"usage",title:Oj(a),"aria-label":`Расход лимитов плана${a.plan?` ${a.plan}`:""}`,children:l.map(i=>r.jsx(Rj,{label:i.label,window:i.window},i.key))})}function Rj({label:a,window:l}){const i=Math.round(l.utilization),c=Dj(l.resetsAt);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"usage__label",children:a}),r.jsx("span",{className:"usage__track",role:"progressbar","aria-label":a,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`usage__fill${Mj(i)}`,style:{width:`${i}%`}})}),r.jsxs("span",{className:"usage__pct",children:[i,"%"]}),r.jsx("span",{className:"usage__reset",title:by(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Mj(a){return a>=Cj?" usage__fill--over":a>=Aj?" usage__fill--warn":""}function Oj(a){const l=[a.plan?`Лимиты плана ${a.plan}`:"Лимиты плана"],i=(c,o)=>{if(!o)return;const d=by(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return i("5 часов",a.fiveHour),i("Неделя",a.sevenDay),i("Неделя, Opus",a.sevenDayOpus),l.join(`
121
- `)}function my(a){if(!a)return null;const l=new Date(a);return Number.isNaN(l.getTime())?null:l}function gy(a){return a.getTime()-Date.now()<1440*60*1e3}function Dj(a){const l=my(a);return l?gy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function by(a){const l=my(a);return l?`обнулится ${gy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function xy(){const[a,l]=_.useState(()=>new Date);return _.useEffect(()=>{let i=0;const c=()=>{const d=new Date;l(d),i=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(i),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(i),document.removeEventListener("visibilitychange",o)}},[]),r.jsxs("time",{className:"clock",dateTime:a.toISOString(),title:zj(a),children:[r.jsx("span",{className:"clock__time",children:a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:"clock__date",children:a.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function zj(a){return a.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Lj({onClose:a,permission:l,model:i,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:m,onRename:x}){return r.jsx(wl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:a,children:r.jsxs("div",{className:"sessionmenu",children:[l&&r.jsx(vr,{label:"Режим прав",children:l}),r.jsx(vr,{label:"Модель",children:i}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&r.jsx(vr,{label:"Лимиты плана",children:r.jsx(py,{usage:c})}),r.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[r.jsx(Uj,{}),r.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&r.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),r.jsx(vr,{label:"Время",children:r.jsx(xy,{})}),d&&r.jsx(vr,{label:"Стоимость хода",children:r.jsx("span",{className:"badge badge--cost",children:d})}),o&&r.jsx(vr,{label:"Каталог проекта",children:r.jsx(fy,{path:o})}),x&&r.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"})]})})}function vr({label:a,children:l}){return r.jsxs("div",{className:"sessionmenu__row",children:[r.jsx("span",{className:"sessionmenu__label",children:a}),l]})}function Uj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Hj({tab:a,servers:l,plugins:i,marketplaces:c,catalog:o,result:d,actions:h,onTab:p,onClose:m}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return r.jsxs(wl,{title:"Расширения",className:"modal--wide",onClose:m,children:[r.jsx("div",{className:"tabs",role:"tablist",children:x.map(y=>r.jsxs("button",{role:"tab","aria-selected":a===y.id,className:a===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>p(y.id),children:[y.label,r.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),a==="mcp"&&r.jsx(Bj,{servers:l,actions:h}),a==="plugins"&&r.jsx(Vj,{plugins:i,marketplaces:c,actions:h}),a==="catalog"&&r.jsx(Xj,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),r.jsx(zi,{result:d})]})}function Bj({servers:a,actions:l}){const[i,c]=_.useState(!1);return r.jsxs(r.Fragment,{children:[a.length===0&&!i&&r.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",r.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",r.jsx("code",{children:"claude mcp list"}),"."]}),r.jsx("ul",{className:"extlist",children:a.map(o=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:o.name}),r.jsx("span",{className:`chip chip--${Gj(o.status)}`,children:qj[o.status]}),o.scope&&r.jsx("span",{className:"chip",children:o.scope}),o.transport&&r.jsx("span",{className:"chip",children:o.transport})]}),o.target&&r.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&r.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&r.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),i?r.jsx(Ij,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const qj={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Gj(a){return a==="connected"?"ok":a==="failed"?"bad":a==="needs-auth"?"warn":"mute"}function Ij({onSubmit:a,onCancel:l}){const[i,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,p]=_.useState(""),[m,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",C=i.trim()!==""&&(v?h.trim()!=="":m.trim()!=="");function N(){if(C)if(v){const[D,...B]=Yj(h);a(i.trim(),{transport:"stdio",command:D??"",args:B,env:fx(y)})}else a(i.trim(),{transport:o,url:m.trim(),headers:fx(y)})}return r.jsxs("div",{className:"extform extform--card",children:[r.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),r.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:D=>c(D.target.value)}),r.jsx("label",{className:"field",children:"Транспорт"}),r.jsx(es,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:D=>d(D)}),v?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),r.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:D=>p(D.target.value)})]}):r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),r.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:D=>x(D.target.value)})]}),r.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),r.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:D=>j(D.target.value)}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),r.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:N,children:"Подключить"})]})]})}function fx(a){const l={};for(const i of a.split(`
122
- `)){const c=i.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function Yj(a){return(a.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function Vj({plugins:a,marketplaces:l,actions:i}){const[c,o]=_.useState("");return r.jsxs(r.Fragment,{children:[a.length===0&&r.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),r.jsx("ul",{className:"extlist",children:a.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:d.name}),r.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&r.jsx("span",{className:"chip",children:d.version}),d.scope&&r.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&r.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&r.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),r.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),r.jsx("ul",{className:"extlist",children:l.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsx("div",{className:"extlist__head",children:r.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&r.jsx("div",{className:"extlist__meta",children:d.source}),r.jsx("div",{className:"extlist__actions",children:r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),r.jsxs("div",{className:"extform__row",children:[r.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(),i.marketplaceAdd(c.trim()),o(""))}}),r.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const qc=30;function Xj({catalog:a,hasMarketplaces:l,actions:i,onMarketplaces:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(qc),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(a.map(D=>D.category).filter(Boolean))].sort(),[a]),C=_.useMemo(()=>{const N=o.trim().toLowerCase();return a.filter(D=>h&&D.category!==h?!1:N?`${D.name} ${D.displayName} ${D.description} ${D.author}`.toLowerCase().includes(N):!0)},[a,o,h]);return a.length===0?r.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",r.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"catalog__filters",children:[r.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:N=>{d(N.target.value),x(qc)}}),r.jsx(es,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(N=>({value:N,label:N}))],onChange:N=>{p(N),x(qc)}})]}),C.length===0?r.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):r.jsx("ul",{className:"extlist",children:C.slice(0,m).map(N=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:N.name}),N.installed&&r.jsx("span",{className:"chip chip--ok",children:"установлен"}),N.version&&r.jsx("span",{className:"chip",children:N.version}),N.category&&r.jsx("span",{className:"chip",children:N.category})]}),N.description&&r.jsx("div",{className:"catalog__desc",children:N.description}),r.jsxs("div",{className:"extlist__meta",children:[N.author&&`${N.author} · `,N.marketplace]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",disabled:N.installed,onClick:()=>i.pluginInstall(N.id),children:N.installed?"Уже стоит":"Установить"}),N.homepage&&r.jsx("a",{className:"btn btn--ghost btn--sm",href:N.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},N.id))}),C.length>m&&r.jsx("div",{className:"extbar",children:r.jsxs("button",{className:"btn",onClick:()=>x(N=>N+qc),children:["Ещё ",Math.min(qc,C.length-m)," из ",C.length-m]})}),r.jsxs("div",{className:"extform",children:[r.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),r.jsxs("div",{className:"extform__row",children:[r.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:N=>j(N.target.value),onKeyDown:N=>{N.key!=="Enter"||y.trim()===""||(N.preventDefault(),i.pluginInstall(y.trim()),j(""))}}),r.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{i.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function Qj({status:a,login:l,actions:i,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:m}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[C,N]=_.useState(!1),D=d!==null&&(a==null?void 0:a.loggedIn)===!0&&!C&&!j,B=_.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const X=l.output.trim();return X===""?null:{ok:!0,message:X}},[l.error,l.output]);function q(X=x){const E=X.trim();E!==""&&(i.submitCode(E),y(""))}function z(){if(o>0){v(!1),N(!0);return}i.login("claudeai",!0)}return r.jsxs(wl,{title:"Аккаунт",onClose:m,children:[a===null?r.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):a.loggedIn?r.jsxs("div",{className:"account",children:[r.jsx("div",{className:"account__id",children:a.email||"Вход выполнен"}),r.jsxs("div",{className:"account__chips",children:[r.jsx("span",{className:"chip chip--ok",children:Kj[a.method]??a.method}),a.plan&&r.jsx("span",{className:"chip",children:a.plan})]}),a.organization&&r.jsx("div",{className:"extlist__meta",children:a.organization})]}):r.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",r.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?r.jsx(Jj,{login:l,remote:c,code:x,onCode:y,onSubmit:q,onCancel:i.cancel}):r.jsxs(r.Fragment,{children:[r.jsx(zi,{result:B}),C&&r.jsx("p",{className:"account__warn",role:"alert",children:$j(o)}),D&&h&&r.jsx("p",{className:"account__note",children:p}),r.jsx("div",{className:`extbar${a!=null&&a.loggedIn?" account__bar":""}`,children:a!=null&&a.loggedIn?r.jsxs(r.Fragment,{children:[D&&r.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
- ${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[r.jsx(Zj,{}),"Переподключить"]}),C?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>N(!1),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{N(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):r.jsx("button",{className:"btn",onClick:z,children:"Сменить аккаунт"}),j?r.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),i.logout()},children:"Точно выйти?"}):r.jsx("button",{className:"btn",onClick:()=>{N(!1),v(!0)},children:"Выйти"})]}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function $j(a){const l=a%10,i=a%100,c=l===1&&i!==11,o=c?"сессия":l>=2&&l<=4&&(i<12||i>14)?"сессии":"сессий";return`${a} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function Zj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Kj={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Jj({login:a,remote:l,code:i,onCode:c,onSubmit:o,onCancel:d}){var N;const[h,p]=_.useState(null),m=_.useRef(""),x=_.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const y=_.useCallback(async D=>{const{code:B,onCode:q,onSubmit:z}=x.current;if(D&&B.trim()!=="")return;const X=await lS();if(X===null){D||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const E=X.trim();if(!dx(E)){D||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(D){if(m.current===E)return;m.current=E}p(null),q(E),z(E)},[]);_.useEffect(()=>{if(!a.awaitingCode)return;const D=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",D),()=>document.removeEventListener("visibilitychange",D)},[a.awaitingCode,y]);const j=typeof((N=navigator.clipboard)==null?void 0:N.readText)=="function",v=i.trim()!==""&&!dx(i),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return r.jsxs("div",{className:"account__flow",children:[a.url?l?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),r.jsx("a",{className:"btn btn--primary account__go",href:a.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),r.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),r.jsxs("div",{className:"account__raw",children:[r.jsx("span",{className:"account__rawurl",children:a.url}),r.jsx($h,{text:a.url,hint:"ссылку входа"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),r.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),r.jsxs("details",{className:"account__fallback",children:[r.jsx("summary",{children:"Браузер не открылся"}),r.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),r.jsx("a",{className:"account__link",href:a.url,target:"_blank",rel:"noreferrer",children:a.url})]})]}):r.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),a.awaitingCode&&r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),r.jsxs("div",{className:"extform__row account__coderow",children:[r.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:D=>{p(null),c(D.target.value)},onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),o())}}),j&&r.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&r.jsx("p",{className:"account__note account__note--code",children:C})]}),a.output.trim()!==""&&r.jsx("pre",{className:"account__log",children:a.output.trim()}),r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function dx(a){const l=a.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[i,c]=l.split("#");return!!i&&!!c&&!/\s/.test(l)}function Fj({state:a,onPair:l,onUnpair:i,onClose:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(!1),y=_.useRef(null),j=(a==null?void 0:a.paired)===!0;_.useEffect(()=>{var C;j||(C=y.current)==null||C.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,a==null?void 0:a.error]);const v=(a==null?void 0:a.url)??"https://claudevisual.com";return r.jsx(wl,{title:"Удалённый доступ",onClose:c,children:j?r.jsxs("div",{className:"relay",children:[r.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",r.jsx("b",{children:hx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),r.jsxs("dl",{className:"relay__facts",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Имя"}),r.jsx("dd",{children:(a==null?void 0:a.name)??"—"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Связь"}),r.jsxs("dd",{children:[r.jsx("span",{className:a!=null&&a.connected?"dot dot--on":"dot"})," ",a!=null&&a.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Подключено"}),r.jsxs("dd",{children:[(a==null?void 0:a.clients)??0," вкладок"]})]})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),r.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),r.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):r.jsxs("div",{className:"relay",children:[r.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),r.jsxs("ol",{className:"relay__steps",children:[r.jsxs("li",{children:["Откройте ",r.jsx("b",{children:hx(v)})," и войдите (или зарегистрируйтесь)."]}),r.jsxs("li",{children:["Нажмите ",r.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),r.jsx("li",{children:"Введите его сюда."})]}),r.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Код сопряжения"}),r.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:C=>d(C.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Как назвать этот компьютер"}),r.jsx("input",{className:"input",value:h,onChange:C=>p(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function hx(a){try{return new URL(a).host}catch{return a}}const bh="",Wj=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Pj=Ex.map(a=>({value:a.value,label:a.value,hint:a.hint})),Ao=3600*1e3,ek=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],jr={"6h":6*Ao,"24h":24*Ao,"48h":48*Ao,"168h":168*Ao,never:0};function tk(a){return jr[a]??jr["48h"]}function nk(a){const l=Object.entries(jr).find(([,i])=>i===a);return l?l[0]:Object.keys(jr).reduce((i,c)=>Math.abs(jr[c]-a)<Math.abs(jr[i]-a)?c:i)}const lk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],kr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function ak(a){return kr[a]??kr.off}function sk(a){const l=Object.entries(kr).find(([,i])=>i===a);return l?l[0]:Object.keys(kr).reduce((i,c)=>Math.abs(kr[c]-a)<Math.abs(kr[i]-a)?c:i)}const ik=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function rk({settings:a,models:l,relayState:i,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:m}){const x=a===null,y=!x&&a.terminalEnabled===!0,j=!y,v=_.useMemo(()=>{const N=[{value:bh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(D=>({value:D.value,label:D.displayName,hint:D.description})):Wj];return a&&a.startModel!==null&&!N.some(D=>D.value===a.startModel)&&N.push({value:a.startModel,label:a.startModel}),N},[l,a]);function C(){var N,D;return(i==null?void 0:i.paired)!==!0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:p,children:"Связать компьютер"})]}):(N=i.shell)!=null&&N.enabled?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",i.shell.confirmedAt&&` Включено ${new Date(i.shell.confirmedAt).toLocaleString()}.`]}),r.jsx("button",{type:"button",className:"btn btn--danger",disabled:j,onClick:h,children:"Запретить"})]}):(D=i.shell)!=null&&D.pending?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",r.jsx("b",{children:i.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),r.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Отправить письмо ещё раз"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Разрешить с телефона"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Прислать письмо"})]})]})}return r.jsx(wl,{title:"Настройки",onClose:m,children:r.jsxs("div",{className:"settings",children:[r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),r.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:nk(a.autoArchiveAfterMs),options:ek,onChange:N=>o({autoArchiveAfterMs:tk(N)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),r.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:sk(a.autoSaveAfterPauseMs),options:lk,onChange:N=>o({autoSaveAfterPauseMs:ak(N)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),r.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Модель"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startModel??bh,options:v,onChange:N=>o({startModel:N===bh?null:N}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startPermissionMode,options:Pj,onChange:N=>o({startPermissionMode:N}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),r.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),r.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:ik.map(N=>{const D=!x&&a.folderAccess===N.value;return r.jsxs("button",{type:"button",role:"radio","aria-checked":D,disabled:x,className:"access__card"+(D?" is-on":"")+(N.risky?" access__card--risky":""),onClick:()=>o({folderAccess:N.value}),children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[N.title,N.risky&&r.jsx("span",{className:"access__risk",children:"самое широкое"})]}),r.jsx("span",{className:"access__desc",children:N.description})]})]},N.value)})})]}),r.jsxs("section",{className:"settings__section",children:[r.jsxs("div",{className:"settings__switch-row",children:[r.jsxs("div",{className:"settings__switch-copy",children:[r.jsx("h3",{className:"settings__heading",children:"Терминал"}),r.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?r.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):r.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:r.jsx("span",{className:"switch__knob"})})]}),r.jsxs("div",{className:"settings__nested"+(j?" is-disabled":""),children:[r.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?r.jsx("p",{className:"settings__hint",children:"Загрузка…"}):r.jsxs(r.Fragment,{children:[j&&r.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),C()]})]})]})]})})}const ck=16;function uk({pane:a,width:l,onResize:i,onReset:c}){const o=Ci[a],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-r0):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function p(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;i(Math.min(j.max,j.width+v))}function m(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(),i(l+j*ck*(o.side==="left"?1:-1)))}return r.jsx("div",{className:`pane-resizer pane-resizer--${a} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:p,onPointerUp:m,onPointerCancel:m,onDoubleClick:c,onKeyDown:x,children:r.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const ok=16;function fk({height:a,onResize:l,onReset:i}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-f0;return Math.round(a+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:a,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;l(y.height+j,y.max)}function p(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function m(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),l(a+y*ok,o()))}return r.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":a,"aria-valuemin":Rx,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:i,onKeyDown:m,children:r.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function px(){const a=document.documentElement,l=getComputedStyle(a),i=z=>l.getPropertyValue(z).trim(),c=i("--surface"),o=i("--text"),d=i("--text-2"),h=i("--muted"),p=i("--accent"),m=i("--accent-fg"),x=i("--select"),y=i("--danger"),j=i("--ok"),v=i("--warn"),C=i("--cm-fn"),N=i("--cm-key"),D=i("--cm-type"),B=mx(o,c,55),q=z=>mx(z,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:m,selectionBackground:x,black:B,brightBlack:h,red:y,brightRed:q(y),green:j,brightGreen:q(j),yellow:v,brightYellow:q(v),blue:C,brightBlue:q(C),magenta:N,brightMagenta:q(N),cyan:D,brightCyan:q(D),white:d,brightWhite:o}}function dk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ma=null;function hk(a){return ma||(ma=document.createElement("span"),ma.style.position="fixed",ma.style.width="0",ma.style.height="0",ma.style.opacity="0",ma.style.pointerEvents="none",document.body.appendChild(ma)),ma.style.color=a,getComputedStyle(ma).color}function mx(a,l,i){return hk(`color-mix(in srgb, ${a} ${100-i}%, ${l} ${i}%)`)}let Co=null;function pk(){return Co||(Co=Promise.all([Xe(()=>import("./xterm-D6Mng-DB.js").then(a=>a.x),__vite__mapDeps([22,23]),import.meta.url),Xe(()=>import("./addon-fit-CevVMrUA.js").then(a=>a.a),__vite__mapDeps([24,23]),import.meta.url),Xe(()=>import("./addon-web-links-CnB65OV_.js").then(a=>a.a),__vite__mapDeps([25,23]),import.meta.url),Xe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([a,l,i])=>({Terminal:a.Terminal,FitAddon:l.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(a=>{throw Co=null,a})),Co}function mk({terminals:a,activeId:l,blocked:i,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:m,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:C,onResize:N,onAttach:D,onHide:B,registerSink:q}){const[z,X]=_.useState(()=>px());return _.useEffect(()=>{const E=new MutationObserver(()=>X(px()));return E.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>E.disconnect()},[]),r.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&m?" termpanel--zoomed":""),style:p?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:m?void 0:{height:d},children:[r.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:E=>{x&&(E.target.closest("button")||x())},children:[r.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:a.map(E=>r.jsxs("div",{role:"tab","aria-selected":E.id===l,className:"termtab"+(E.id===l?" is-on":"")+(E.exitCode!==null?" termtab--exited":""),onDoubleClick:H=>{x&&(H.target.closest(".termtab__close")||x())},children:[r.jsx("button",{className:"termtab__name",title:E.cwd,onClick:()=>y(E.id),children:E.title}),E.exitCode!==null&&r.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${E.exitCode}`,children:E.exitCode}),r.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${E.title}»`,onClick:()=>v(E.id),children:"✕"})]},E.id))}),r.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:j,children:"+"}),r.jsx("div",{className:"termpanel__spacer"}),x&&r.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:r.jsx(Ur,{active:m})}),r.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:B,children:"✕"})]}),c&&a.length>0&&r.jsx(gx,{message:c,strip:!0,onRetry:null,onDismiss:o}),r.jsxs("div",{className:"termpanel__body",children:[c&&a.length===0?r.jsx(gx,{message:c,onRetry:i?null:j,onDismiss:o}):i?r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминал с удалённых устройств выключен"}),r.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):a.length===0&&r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминалов не открыто"}),r.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),a.map(E=>r.jsx(bk,{id:E.id,exitCode:E.exitCode,active:E.id===l,theme:z,mobile:p,onInput:C,onResize:N,onAttach:D,registerSink:q},E.id))]})]})}function gx({message:a,strip:l=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:d,details:h}=gk(a);return r.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[r.jsxs("div",{className:"termfail__text",children:[r.jsx("p",{className:"termfail__lede",children:o}),d&&r.jsx("p",{className:"termfail__hint",children:d}),h&&r.jsxs("details",{className:"termfail__details",children:[r.jsx("summary",{children:"Подробности"}),r.jsx("pre",{children:h})]})]}),r.jsxs("div",{className:"termfail__bar",children:[i&&r.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),r.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function gk(a){const[l="",...i]=a.trim().split(`
112
+ `}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${ga(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:l,tokens:i}){let c=this.parser.parseInline(i),o=fb(a);if(o===null)return c;a=o;let d='<a href="'+a+'"';return l&&(d+=' title="'+ga(l)+'"'),d+=">"+c+"</a>",d}image({href:a,title:l,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=fb(a);if(o===null)return ga(i);a=o;let d=`<img src="${a}" alt="${ga(i)}"`;return l&&(d+=` title="${ga(l)}"`),d+=">",d}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:ga(a.text)}},Gh=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},Zl=class jh{constructor(l){Nt(this,"options");Nt(this,"renderer");Nt(this,"textRenderer");this.options=l||Di,this.options.renderer=this.options.renderer||new Bo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gh}static parse(l,i){return new jh(i).parse(l)}static parseInline(l,i){return new jh(i).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let i="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let p=h,x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(p.type)){i+=x||"";continue}}let m=h;switch(m.type){case"space":{i+=this.renderer.space(m);break}case"hr":{i+=this.renderer.hr(m);break}case"heading":{i+=this.renderer.heading(m);break}case"code":{i+=this.renderer.code(m);break}case"table":{i+=this.renderer.table(m);break}case"blockquote":{i+=this.renderer.blockquote(m);break}case"list":{i+=this.renderer.list(m);break}case"checkbox":{i+=this.renderer.checkbox(m);break}case"html":{i+=this.renderer.html(m);break}case"def":{i+=this.renderer.def(m);break}case"paragraph":{i+=this.renderer.paragraph(m);break}case"text":{i+=this.renderer.text(m);break}default:{let p='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}parseInline(l,i=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let m=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let 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 p=m;switch(p.type){case"escape":{c+=i.text(p);break}case"html":{c+=i.html(p);break}case"link":{c+=i.link(p);break}case"image":{c+=i.image(p);break}case"checkbox":{c+=i.checkbox(p);break}case"strong":{c+=i.strong(p);break}case"em":{c+=i.em(p);break}case"codespan":{c+=i.codespan(p);break}case"br":{c+=i.br(p);break}case"del":{c+=i.del(p);break}case"text":{c+=i.text(p);break}default:{let x='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Ro,Gc=(Ro=class{constructor(a){Nt(this,"options");Nt(this,"block");this.options=a||Di}preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(a=this.block){return a?$l.lex:$l.lexInline}provideParser(a=this.block){return a?Zl.parse:Zl.parseInline}},Nt(Ro,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Nt(Ro,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ro),av=class{constructor(...a){Nt(this,"defaults",Oh());Nt(this,"options",this.setOptions);Nt(this,"parse",this.parseMarkdown(!0));Nt(this,"parseInline",this.parseMarkdown(!1));Nt(this,"Parser",Zl);Nt(this,"Renderer",Bo);Nt(this,"TextRenderer",Gh);Nt(this,"Lexer",$l);Nt(this,"Tokenizer",Ho);Nt(this,"Hooks",Gc);this.use(...a)}walkTokens(a,l){var c,o;let i=[];for(let d of a)switch(i=i.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)i=i.concat(this.walkTokens(m.tokens,l));for(let m of h.rows)for(let p of m)i=i.concat(this.walkTokens(p.tokens,l));break}case"list":{let h=d;i=i.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let p=h[m].flat(1/0);i=i.concat(this.walkTokens(p,l))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,l)))}}return i}use(...a){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),i.renderer){let o=this.defaults.renderer||new Bo(this.defaults);for(let d in i.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=i.renderer[h],p=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=p.apply(o,x)),y||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Ho(this.defaults);for(let d in i.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=i.tokenizer[h],p=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=p.apply(o,x)),y}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Gc;for(let d in i.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=i.hooks[h],p=o[h];Gc.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Gc.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,x);return p.call(o,j)})();let y=m.call(o,x);return p.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,x);return j===!1&&(j=await p.apply(o,x)),j})();let y=m.apply(o,x);return y===!1&&(y=p.apply(o,x)),y}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,d=i.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(a){return this.defaults={...this.defaults,...a},this}lexer(a,l){return $l.lex(a,l??this.defaults)}parser(a,l){return Zl.parse(a,l??this.defaults)}parseMarkdown(a){return(l,i)=>{let c={...i},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=a),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,m=await(o.hooks?await o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(h,o),p=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(p,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(a):a?Zl.parse:Zl.parseInline)(p,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(a):a?$l.lex:$l.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(a):a?Zl.parse:Zl.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(a,l){return i=>{if(i.message+=`
113
+ Please report this to https://github.com/markedjs/marked.`,a){let c="<p>An error occurred:</p><pre>"+ga(i.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(i);throw i}}},Oi=new av;function gt(a,l){return Oi.parse(a,l)}gt.options=gt.setOptions=function(a){return Oi.setOptions(a),gt.defaults=Oi.defaults,Ox(gt.defaults),gt};gt.getDefaults=Oh;gt.defaults=Di;gt.use=function(...a){return Oi.use(...a),gt.defaults=Oi.defaults,Ox(gt.defaults),gt};gt.walkTokens=function(a,l){return Oi.walkTokens(a,l)};gt.parseInline=Oi.parseInline;gt.Parser=Zl;gt.parser=Zl.parse;gt.Renderer=Bo;gt.TextRenderer=Gh;gt.Lexer=$l;gt.lexer=$l.lex;gt.Tokenizer=Ho;gt.Hooks=Gc;gt.parse=gt;gt.options;gt.setOptions;gt.use;gt.walkTokens;gt.parseInline;Zl.parse;$l.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 mb(a,l){(l==null||l>a.length)&&(l=a.length);for(var i=0,c=Array(l);i<l;i++)c[i]=a[i];return c}function sv(a){if(Array.isArray(a))return a}function iv(a,l){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var c,o,d,h,m=[],p=!0,x=!1;try{if(d=(i=i.call(a)).next,l!==0)for(;!(p=(c=d.call(i)).done)&&(m.push(c.value),m.length!==l);p=!0);}catch(y){x=!0,o=y}finally{try{if(!p&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function rv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
114
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cv(a,l){return sv(a)||iv(a,l)||uv(a,l)||rv()}function uv(a,l){if(a){if(typeof a=="string")return mb(a,l);var i={}.toString.call(a).slice(8,-1);return i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set"?Array.from(a):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?mb(a,l):void 0}}const Yx=Object.entries,gb=Object.setPrototypeOf,ov=Object.isFrozen,fv=Object.getPrototypeOf,dv=Object.getOwnPropertyDescriptor;let Bn=Object.freeze,qn=Object.seal,Sr=Object.create,Vx=typeof Reflect<"u"&&Reflect,kh=Vx.apply,Nh=Vx.construct;Bn||(Bn=function(l){return l});qn||(qn=function(l){return l});kh||(kh=function(l,i){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(i,o)});Nh||(Nh=function(l){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new l(...c)});const yr=yn(Array.prototype.forEach),hv=yn(Array.prototype.lastIndexOf),bb=yn(Array.prototype.pop),_r=yn(Array.prototype.push),pv=yn(Array.prototype.splice),qs=Array.isArray,Ic=yn(String.prototype.toLowerCase),nh=yn(String.prototype.toString),xb=yn(String.prototype.match),Lc=yn(String.prototype.replace),yb=yn(String.prototype.indexOf),mv=yn(String.prototype.trim),gv=yn(Number.prototype.toString),bv=yn(Boolean.prototype.toString),_b=typeof BigInt>"u"?null:yn(BigInt.prototype.toString),vb=typeof Symbol>"u"?null:yn(Symbol.prototype.toString),Cn=yn(Object.prototype.hasOwnProperty),Uc=yn(Object.prototype.toString),An=yn(RegExp.prototype.test),_i=xv(TypeError);function yn(a){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return kh(a,l,c)}}function xv(a){return function(){for(var l=arguments.length,i=new Array(l),c=0;c<l;c++)i[c]=arguments[c];return Nh(a,i)}}function lt(a,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ic;if(gb&&gb(a,null),!qs(l))return a;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=i(o);d!==o&&(ov(l)||(l[c]=d),o=d)}a[o]=!0}return a}function yv(a){for(let l=0;l<a.length;l++)Cn(a,l)||(a[l]=null);return a}function ll(a){const l=Sr(null);for(const c of Yx(a)){var i=cv(c,2);const o=i[0],d=i[1];Cn(a,o)&&(qs(d)?l[o]=yv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=ll(d):l[o]=d)}return l}function _v(a){switch(typeof a){case"string":return a;case"number":return gv(a);case"boolean":return bv(a);case"bigint":return _b?_b(a):"0";case"symbol":return vb?vb(a):"Symbol()";case"undefined":return Uc(a);case"function":case"object":{if(a===null)return Uc(a);const l=a,i=ba(l,"toString");if(typeof i=="function"){const c=i(l);return typeof c=="string"?c:Uc(c)}return Uc(a)}default:return Uc(a)}}function ba(a,l){for(;a!==null;){const c=dv(a,l);if(c){if(c.get)return yn(c.get);if(typeof c.value=="function")return yn(c.value)}a=fv(a)}function i(){return null}return i}function vv(a){try{return An(a,""),!0}catch{return!1}}const Sb=Bn(["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"]),lh=Bn(["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"]),ah=Bn(["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"]),Sv=Bn(["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"]),sh=Bn(["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"]),jv=Bn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),jb=Bn(["#text"]),kb=Bn(["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"]),ih=Bn(["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"]),Nb=Bn(["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"]),vo=Bn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kv=qn(/{{[\w\W]*|^[\w\W]*}}/g),Nv=qn(/<%[\w\W]*|^[\w\W]*%>/g),wv=qn(/\${[\w\W]*/g),Tv=qn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ev=qn(/^aria-[\-\w]+$/),wb=qn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Av=qn(/^(?:\w+script|data):/i),Cv=qn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rv=qn(/^html$/i),Mv=qn(/^[a-z][.\w]*(-[.\w]+)+$/i),Tb=qn(/<[/\w!]/g),Eb=qn(/<[/\w]/g),Ov=qn(/<\/no(script|embed|frames)/i),Dv=qn(/\/>/i),Nl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zv=function(){return typeof window>"u"?null:window},Lv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Ab=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ls=function(l,i,c,o){return Cn(l,i)&&qs(l[i])?lt(o.base?ll(o.base):{},l[i],o.transform):c};function Xx(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zv();const l=fe=>Xx(fe);if(l.version="3.4.12",l.removed=[],!a||!a.document||a.document.nodeType!==Nl.document||!a.Element)return l.isSupported=!1,l;let i=a.document;const c=i,o=c.currentScript;a.DocumentFragment;const d=a.HTMLTemplateElement,h=a.Node,m=a.Element,p=a.NodeFilter,x=a.NamedNodeMap;x===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const y=a.DOMParser,j=a.trustedTypes,v=m.prototype,C=ba(v,"cloneNode"),N=ba(v,"remove"),L=ba(v,"nextSibling"),H=ba(v,"childNodes"),$=ba(v,"parentNode"),M=ba(v,"shadowRoot"),I=ba(v,"attributes"),E=h&&h.prototype?ba(h.prototype,"nodeType"):null,X=h&&h.prototype?ba(h.prototype,"nodeName"):null;if(typeof d=="function"){const fe=i.createElement("template");fe.content&&fe.content.ownerDocument&&(i=fe.content.ownerDocument)}let O,D="",F,re=!1,de=0;const W=function(){if(de>0)throw _i('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.')},ie=function(k){W(),de++;try{return O.createHTML(k)}finally{de--}},me=function(k){W(),de++;try{return O.createScriptURL(k)}finally{de--}},je=function(){return re||(F=Lv(j,o),re=!0),F},ge=i,z=ge.implementation,te=ge.createNodeIterator,P=ge.createDocumentFragment,ae=ge.getElementsByTagName,xe=c.importNode;let w=Ab();l.isSupported=typeof Yx=="function"&&typeof $=="function"&&z&&z.createHTMLDocument!==void 0;const K=kv,oe=Nv,he=wv,Ne=Tv,Ae=Ev,qe=Av,st=Cv,Ze=Mv;let Ut=wb,Le=null;const dt=lt({},[...Sb,...lh,...ah,...sh,...jb]);let Ke=null;const Ie=lt({},[...kb,...ih,...Nb,...vo]);let Fe=Object.seal(Sr(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}})),ht=null,It=null;const vt=Object.seal(Sr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Gn=!0,Jt=!0,Ft=!1,In=!0,Xt=!1,ct=!0,jn=!1,kn=!1,_n=null,Qt=null,Nn=!1,wn=!1,Ht=!1,Wt=!1,Z=!0,ue=!1;const we="user-content-";let Ce=!0,bt=!1,T={},Y=null;const Se=lt({},["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 Me=null;const He=lt({},["audio","video","img","source","image","track"]);let Rn=null;const Ul=lt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Tt=vn,Tl=!1,Sa=null;const ja=lt({},[Fn,Yn,vn],nh),Vs=Bn(["mi","mo","mn","ms","mtext"]);let Hl=lt({},Vs);const Jl=Bn(["annotation-xml"]);let rn=lt({},Jl);const ka=lt({},["title","style","font","a","script"]);let ml=null;const al=["application/xhtml+xml","text/html"],$t="text/html";let Je=null,Wn=null;const Xs=i.createElement("form"),Li=function(k){return k instanceof RegExp||k instanceof Function},Qs=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wn&&Wn===k)return;(!k||typeof k!="object")&&(k={}),k=ll(k),ml=al.indexOf(k.PARSER_MEDIA_TYPE)===-1?$t:k.PARSER_MEDIA_TYPE,Je=ml==="application/xhtml+xml"?nh:Ic,Le=Ls(k,"ALLOWED_TAGS",dt,{transform:Je}),Ke=Ls(k,"ALLOWED_ATTR",Ie,{transform:Je}),Sa=Ls(k,"ALLOWED_NAMESPACES",ja,{transform:nh}),Rn=Ls(k,"ADD_URI_SAFE_ATTR",Ul,{transform:Je,base:Ul}),Me=Ls(k,"ADD_DATA_URI_TAGS",He,{transform:Je,base:He}),Y=Ls(k,"FORBID_CONTENTS",Se,{transform:Je}),ht=Ls(k,"FORBID_TAGS",ll({}),{transform:Je}),It=Ls(k,"FORBID_ATTR",ll({}),{transform:Je}),T=Cn(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?ll(k.USE_PROFILES):k.USE_PROFILES:!1,Gn=k.ALLOW_ARIA_ATTR!==!1,Jt=k.ALLOW_DATA_ATTR!==!1,Ft=k.ALLOW_UNKNOWN_PROTOCOLS||!1,In=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xt=k.SAFE_FOR_TEMPLATES||!1,ct=k.SAFE_FOR_XML!==!1,jn=k.WHOLE_DOCUMENT||!1,wn=k.RETURN_DOM||!1,Ht=k.RETURN_DOM_FRAGMENT||!1,Wt=k.RETURN_TRUSTED_TYPE||!1,Nn=k.FORCE_BODY||!1,Z=k.SANITIZE_DOM!==!1,ue=k.SANITIZE_NAMED_PROPS||!1,Ce=k.KEEP_CONTENT!==!1,bt=k.IN_PLACE||!1,Ut=vv(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:wb,Tt=typeof k.NAMESPACE=="string"?k.NAMESPACE:vn,Hl=Cn(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?ll(k.MATHML_TEXT_INTEGRATION_POINTS):lt({},Vs),rn=Cn(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?ll(k.HTML_INTEGRATION_POINTS):lt({},Jl);const B=Cn(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?ll(k.CUSTOM_ELEMENT_HANDLING):Sr(null);if(Fe=Sr(null),Cn(B,"tagNameCheck")&&Li(B.tagNameCheck)&&(Fe.tagNameCheck=B.tagNameCheck),Cn(B,"attributeNameCheck")&&Li(B.attributeNameCheck)&&(Fe.attributeNameCheck=B.attributeNameCheck),Cn(B,"allowCustomizedBuiltInElements")&&typeof B.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=B.allowCustomizedBuiltInElements),qn(Fe),Xt&&(Jt=!1),Ht&&(wn=!0),T&&(Le=lt({},jb),Ke=Sr(null),T.html===!0&&(lt(Le,Sb),lt(Ke,kb)),T.svg===!0&&(lt(Le,lh),lt(Ke,ih),lt(Ke,vo)),T.svgFilters===!0&&(lt(Le,ah),lt(Ke,ih),lt(Ke,vo)),T.mathMl===!0&&(lt(Le,sh),lt(Ke,Nb),lt(Ke,vo))),vt.tagCheck=null,vt.attributeCheck=null,Cn(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?vt.tagCheck=k.ADD_TAGS:qs(k.ADD_TAGS)&&(Le===dt&&(Le=ll(Le)),lt(Le,k.ADD_TAGS,Je))),Cn(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?vt.attributeCheck=k.ADD_ATTR:qs(k.ADD_ATTR)&&(Ke===Ie&&(Ke=ll(Ke)),lt(Ke,k.ADD_ATTR,Je))),Cn(k,"ADD_URI_SAFE_ATTR")&&qs(k.ADD_URI_SAFE_ATTR)&&lt(Rn,k.ADD_URI_SAFE_ATTR,Je),Cn(k,"FORBID_CONTENTS")&&qs(k.FORBID_CONTENTS)&&(Y===Se&&(Y=ll(Y)),lt(Y,k.FORBID_CONTENTS,Je)),Cn(k,"ADD_FORBID_CONTENTS")&&qs(k.ADD_FORBID_CONTENTS)&&(Y===Se&&(Y=ll(Y)),lt(Y,k.ADD_FORBID_CONTENTS,Je)),Ce&&(Le["#text"]=!0),jn&&lt(Le,["html","head","body"]),Le.table&&(lt(Le,["tbody"]),delete ht.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw _i('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw _i('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ce=O;O=k.TRUSTED_TYPES_POLICY;try{D=ie("")}catch(ye){throw O=ce,ye}}else k.TRUSTED_TYPES_POLICY===null?(O=void 0,D=""):(O===void 0&&(O=je()),O&&typeof D=="string"&&(D=ie("")));Bn&&Bn(k),Wn=k},Fl=lt({},[...lh,...ah,...Sv]),Wl=lt({},[...sh,...jv]),Na=function(k,B,ce){return B.namespaceURI===vn?k==="svg":B.namespaceURI===Fn?k==="svg"&&(ce==="annotation-xml"||Hl[ce]):!!Fl[k]},Pl=function(k,B,ce){return B.namespaceURI===vn?k==="math":B.namespaceURI===Yn?k==="math"&&rn[ce]:!!Wl[k]},gl=function(k,B,ce){return B.namespaceURI===Yn&&!rn[ce]||B.namespaceURI===Fn&&!Hl[ce]?!1:!Wl[k]&&(ka[k]||!Fl[k])},Pt=function(k){let B=$(k);(!B||!B.tagName)&&(B={namespaceURI:Tt,tagName:"template"});const ce=Ic(k.tagName),ye=Ic(B.tagName);return Sa[k.namespaceURI]?k.namespaceURI===Yn?Na(ce,B,ye):k.namespaceURI===Fn?Pl(ce,B,ye):k.namespaceURI===vn?gl(ce,B,ye):!!(ml==="application/xhtml+xml"&&Sa[k.namespaceURI]):!1},en=function(k){_r(l.removed,{element:k});try{$(k).removeChild(k)}catch{if(N(k),!$(k))throw _i("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ut=function(k){Xn(k);const B=H(k);if(B){const ye=[];yr(B,Re=>{_r(ye,Re)}),yr(ye,Re=>{try{N(Re)}catch{}})}const ce=I(k);if(ce)for(let ye=ce.length-1;ye>=0;--ye){const Re=ce[ye],De=Re&&Re.name;if(typeof De=="string")try{k.removeAttribute(De)}catch{}}},Vn=function(k,B){try{_r(l.removed,{attribute:B.getAttributeNode(k),from:B})}catch{_r(l.removed,{attribute:null,from:B})}if(B.removeAttribute(k),k==="is")if(wn||Ht)try{en(B)}catch{}else try{B.setAttribute(k,"")}catch{}},wa=function(k){const B=I(k);if(B)for(let ce=B.length-1;ce>=0;--ce){const ye=B[ce],Re=ye&&ye.name;if(!(typeof Re!="string"||Ke[Je(Re)]))try{k.removeAttribute(Re)}catch{}}},Xn=function(k){const B=[k];for(;B.length>0;){const ce=B.pop();(E?E(ce):ce.nodeType)===Nl.element&&wa(ce);const Re=H(ce);if(Re)for(let De=Re.length-1;De>=0;--De)B.push(Re[De])}},Qn=function(k){if(!ct)return;const B=[k];for(;B.length>0;){const ce=B.pop(),ye=E?E(ce):ce.nodeType;if(ye===Nl.processingInstruction||ye===Nl.comment&&An(Eb,ce.data)){try{N(ce)}catch{}continue}if(ye===Nl.element){const De=ce,pt=Je(X?X(ce):ce.nodeName);try{De.hasAttribute&&De.hasAttribute("patchsrc")&&De.removeAttribute("patchsrc"),De.hasAttribute&&De.hasAttribute("for")&&pt!=="label"&&pt!=="output"&&De.removeAttribute("for")}catch{}}const Re=H(ce);if(Re)for(let De=Re.length-1;De>=0;--De)B.push(Re[De])}},sl=function(k){let B=null,ce=null;if(Nn)k="<remove></remove>"+k;else{const De=xb(k,/^[\r\n\t ]+/);ce=De&&De[0]}ml==="application/xhtml+xml"&&Tt===vn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const ye=O?ie(k):k;if(Tt===vn)try{B=new y().parseFromString(ye,ml)}catch{}if(!B||!B.documentElement){B=z.createDocument(Tt,"template",null);try{B.documentElement.innerHTML=Tl?D:ye}catch{}}const Re=B.body||B.documentElement;return k&&ce&&Re.insertBefore(i.createTextNode(ce),Re.childNodes[0]||null),Tt===vn?ae.call(B,jn?"html":"body")[0]:jn?B.documentElement:Re},ea=function(k){return te.call(k.ownerDocument||k,k,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Pn=function(k){return k=Lc(k,K," "),k=Lc(k,oe," "),k=Lc(k,he," "),k},$s=function(k){var B;k.normalize();const ce=te.call(k.ownerDocument||k,k,p.SHOW_TEXT|p.SHOW_COMMENT|p.SHOW_CDATA_SECTION|p.SHOW_PROCESSING_INSTRUCTION,null);let ye=ce.nextNode();for(;ye;)ye.data=Pn(ye.data),ye=ce.nextNode();const Re=(B=k.querySelectorAll)===null||B===void 0?void 0:B.call(k,"template");Re&&yr(Re,De=>{Mn(De.content)&&$s(De.content)})},Tn=function(k){const B=X?X(k):null;return typeof B!="string"||Je(B)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==I(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==E(k)||k.childNodes!==H(k)},Mn=function(k){if(!E||typeof k!="object"||k===null)return!1;try{return E(k)===Nl.documentFragment}catch{return!1}},cn=function(k){if(!E||typeof k!="object"||k===null)return!1;try{return typeof E(k)=="number"}catch{return!1}};function xt(fe,k,B){fe.length!==0&&yr(fe,ce=>{ce.call(l,k,B,Wn)})}const Ta=function(k,B){return!!(ct&&k.hasChildNodes()&&!cn(k.firstElementChild)&&An(Tb,k.textContent)&&An(Tb,k.innerHTML)||ct&&k.namespaceURI===vn&&B==="style"&&cn(k.firstElementChild)||k.nodeType===Nl.processingInstruction||ct&&k.nodeType===Nl.comment&&An(Eb,k.data))},Hr=function(k,B){if(!ht[B]&&Aa(B)&&(Fe.tagNameCheck instanceof RegExp&&An(Fe.tagNameCheck,B)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(B)))return!1;if(Ce&&!Y[B]){const ce=$(k),ye=H(k);if(ye&&ce){const Re=ye.length;for(let De=Re-1;De>=0;--De){const pt=bt?ye[De]:C(ye[De],!0);ce.insertBefore(pt,L(k))}}}return en(k),!0},ta=function(k,B){if(xt(w.beforeSanitizeElements,k,null),k!==B&&$(k)===null)return!0;if(Tn(k))return en(k),!0;const ce=Je(X?X(k):k.nodeName);if(xt(w.uponSanitizeElement,k,{tagName:ce,allowedTags:Le}),k!==B&&$(k)===null)return!0;if(Ta(k,ce))return en(k),!0;if(ht[ce]||!(vt.tagCheck instanceof Function&&vt.tagCheck(ce))&&!Le[ce]){const Re=Hr(k,ce);return Re===!1&&xt(w.afterSanitizeElements,k,null),Re}if((E?E(k):k.nodeType)===Nl.element&&!Pt(k)||(ce==="noscript"||ce==="noembed"||ce==="noframes")&&An(Ov,k.innerHTML))return en(k),!0;if(Xt&&k.nodeType===Nl.text){const Re=Pn(k.textContent);k.textContent!==Re&&(_r(l.removed,{element:k.cloneNode()}),k.textContent=Re)}return xt(w.afterSanitizeElements,k,null),!1},na=function(k,B,ce){if(It[B]||ct&&B==="patchsrc"||ct&&B==="for"&&k!=="label"&&k!=="output"||Z&&(B==="id"||B==="name")&&(ce in i||ce in Xs))return!1;const ye=Ke[B]||vt.attributeCheck instanceof Function&&vt.attributeCheck(B,k);if(!(Jt&&An(Ne,B))){if(!(Gn&&An(Ae,B))){if(ye){if(!Rn[B]){if(!An(Ut,Lc(ce,st,""))){if(!((B==="src"||B==="xlink:href"||B==="href")&&k!=="script"&&yb(ce,"data:")===0&&Me[k])){if(!(Ft&&!An(qe,Lc(ce,st,"")))){if(ce)return!1}}}}}else if(!(Aa(k)&&(Fe.tagNameCheck instanceof RegExp&&An(Fe.tagNameCheck,k)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(k))&&(Fe.attributeNameCheck instanceof RegExp&&An(Fe.attributeNameCheck,B)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(B,k))||B==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&An(Fe.tagNameCheck,ce)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(ce))))return!1}}return!0},Ea=lt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Aa=function(k){return!Ea[Ic(k)]&&An(Ze,k)},On=function(k,B,ce,ye){if(O&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ce)switch(j.getAttributeType(k,B)){case"TrustedHTML":return ie(ye);case"TrustedScriptURL":return me(ye)}return ye},bl=function(k,B,ce,ye){try{ce?k.setAttributeNS(ce,B,ye):k.setAttribute(B,ye),Tn(k)?en(k):bb(l.removed)}catch{Vn(B,k)}},Bl=function(k){xt(w.beforeSanitizeAttributes,k,null);const B=k.attributes;if(!B||Tn(k))return;const ce={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ke,forceKeepAttr:void 0};let ye=B.length;const Re=Je(k.nodeName);for(;ye--;){const De=B[ye],pt=De.name,un=De.namespaceURI,tn=De.value,Et=Je(pt),on=tn;let Bt=pt==="value"?on:mv(on);if(ce.attrName=Et,ce.attrValue=Bt,ce.keepAttr=!0,ce.forceKeepAttr=void 0,xt(w.uponSanitizeAttribute,k,ce),Bt=ce.attrValue,ue&&(Et==="id"||Et==="name")&&yb(Bt,we)!==0&&(Vn(pt,k),Bt=we+Bt),ct&&An(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Bt)){Vn(pt,k);continue}if(Et==="attributename"&&xb(Bt,"href")){Vn(pt,k);continue}if(!ce.forceKeepAttr){if(!ce.keepAttr){Vn(pt,k);continue}if(!In&&An(Dv,Bt)){Vn(pt,k);continue}if(Xt&&(Bt=Pn(Bt)),!na(Re,Et,Bt)){Vn(pt,k);continue}Bt=On(Re,Et,un,Bt),Bt!==on&&bl(k,pt,un,Bt)}}xt(w.afterSanitizeAttributes,k,null)},la=function(k){let B=null;const ce=ea(k);for(xt(w.beforeSanitizeShadowDOM,k,null);B=ce.nextNode();)if(xt(w.uponSanitizeShadowNode,B,null),ta(B,k),Bl(B),Mn(B.content)&&la(B.content),(E?E(B):B.nodeType)===Nl.element){const Re=M(B);Mn(Re)&&(il(Re),la(Re))}xt(w.afterSanitizeShadowDOM,k,null)},il=function(k){const B=[{node:k,shadow:null}];for(;B.length>0;){const ce=B.pop();if(ce.shadow){la(ce.shadow);continue}const ye=ce.node,De=(E?E(ye):ye.nodeType)===Nl.element,pt=H(ye);if(pt)for(let un=pt.length-1;un>=0;--un)B.push({node:pt[un],shadow:null});if(De){const un=X?X(ye):null;if(typeof un=="string"&&Je(un)==="template"){const tn=ye.content;Mn(tn)&&B.push({node:tn,shadow:null})}}if(De){const un=M(ye);Mn(un)&&B.push({node:null,shadow:un},{node:un,shadow:null})}}};return l.sanitize=function(fe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,ce=null,ye=null,Re=null;if(Tl=!fe,Tl&&(fe="<!-->"),typeof fe!="string"&&!cn(fe)&&(fe=_v(fe),typeof fe!="string"))throw _i("dirty is not a string, aborting");if(!l.isSupported)return fe;kn?(Le=_n,Ke=Qt):Qs(k),(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&(Le=ll(Le)),w.uponSanitizeAttribute.length>0&&(Ke=ll(Ke)),l.removed=[];const De=bt&&typeof fe!="string"&&cn(fe);if(De){Qn(fe);const Et=X?X(fe):fe.nodeName;if(typeof Et=="string"){const on=Je(Et);if(!Le[on]||ht[on])throw ut(fe),_i("root node is forbidden and cannot be sanitized in-place")}if(Tn(fe))throw ut(fe),_i("root node is clobbered and cannot be sanitized in-place");try{il(fe)}catch(on){throw ut(fe),on}}else if(cn(fe))B=sl("<!---->"),ce=B.ownerDocument.importNode(fe,!0),ce.nodeType===Nl.element&&ce.nodeName==="BODY"||ce.nodeName==="HTML"?B=ce:B.appendChild(ce),il(ce);else{if(!wn&&!Xt&&!jn&&fe.indexOf("<")===-1)return O&&Wt?ie(fe):fe;if(B=sl(fe),!B)return wn?null:Wt?D:""}B&&Nn&&en(B.firstChild);const pt=De?fe:B,un=ea(pt);try{for(;ye=un.nextNode();)ta(ye,pt),Bl(ye),Mn(ye.content)&&la(ye.content)}catch(Et){throw De&&(ut(fe),yr(l.removed,on=>{on.element&&Xn(on.element)})),Et}if(De)return yr(l.removed,Et=>{Et.element&&Xn(Et.element)}),Xt&&$s(fe),fe;if(wn){if(Xt&&$s(B),Ht)for(Re=P.call(B.ownerDocument);B.firstChild;)Re.appendChild(B.firstChild);else Re=B;return(Ke.shadowroot||Ke.shadowrootmode)&&(Re=xe.call(c,Re,!0)),Re}let tn=jn?B.outerHTML:B.innerHTML;return jn&&Le["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&An(Rv,B.ownerDocument.doctype.name)&&(tn="<!DOCTYPE "+B.ownerDocument.doctype.name+`>
115
+ `+tn),Xt&&(tn=Pn(tn)),O&&Wt?ie(tn):tn},l.setConfig=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qs(fe),kn=!0,_n=Le,Qt=Ke},l.clearConfig=function(){Wn=null,kn=!1,_n=null,Qt=null,O=F,D=""},l.isValidAttribute=function(fe,k,B){Wn||Qs({});const ce=Je(fe),ye=Je(k);return na(ce,ye,B)},l.addHook=function(fe,k){typeof k=="function"&&Cn(w,fe)&&_r(w[fe],k)},l.removeHook=function(fe,k){if(Cn(w,fe)){if(k!==void 0){const B=hv(w[fe],k);return B===-1?void 0:pv(w[fe],B,1)[0]}return bb(w[fe])}},l.removeHooks=function(fe){Cn(w,fe)&&(w[fe]=[])},l.removeAllHooks=function(){w=Ab()},l}var Uv=Xx();const Hv=1024;let Bv=0;class Ll{constructor(l,i){this.from=l,this.to=i}}class Lt{constructor(l={}){this.id=Bv++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Kl.match(l)),i=>{let c=l(i);return c===void 0?null:[this,c]}}}Lt.closedBy=new Lt({deserialize:a=>a.split(" ")});Lt.openedBy=new Lt({deserialize:a=>a.split(" ")});Lt.group=new Lt({deserialize:a=>a.split(" ")});Lt.isolate=new Lt({deserialize:a=>{if(a&&a!="rtl"&&a!="ltr"&&a!="auto")throw new RangeError("Invalid value for isolate: "+a);return a||"auto"}});Lt.contextHash=new Lt({perNode:!0});Lt.lookAhead=new Lt({perNode:!0});Lt.mounted=new Lt({perNode:!0});class Nr{constructor(l,i,c,o=!1){this.tree=l,this.overlay=i,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[Lt.mounted.id]}}const qv=Object.create(null);class Kl{constructor(l,i,c,o=0){this.name=l,this.props=i,this.id=c,this.flags=o}static define(l){let i=l.props&&l.props.length?Object.create(null):qv,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Kl(l.name||"",i,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let i=this.prop(Lt.group);return i?i.indexOf(l)>-1:!1}return this.id==l}static match(l){let i=Object.create(null);for(let c in l)for(let o of c.split(" "))i[o]=l[c];return c=>{for(let o=c.prop(Lt.group),d=-1;d<(o?o.length:0);d++){let h=i[d<0?c.name:o[d]];if(h)return h}}}}Kl.none=new Kl("",Object.create(null),0,8);class Qx{constructor(l){this.types=l;for(let i=0;i<l.length;i++)if(l[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let i=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],p=h[0];p.combine&&p.id in o&&(m=p.combine(o[p.id],m)),o[p.id]=m}}i.push(o?new Kl(c.name,o,c.id,c.flags):c)}return new Qx(i)}}const So=new WeakMap,Cb=new WeakMap;var Dt;(function(a){a[a.ExcludeBuffers=1]="ExcludeBuffers",a[a.IncludeAnonymous=2]="IncludeAnonymous",a[a.IgnoreMounts=4]="IgnoreMounts",a[a.IgnoreOverlays=8]="IgnoreOverlays",a[a.EnterBracketed=16]="EnterBracketed"})(Dt||(Dt={}));class pl{constructor(l,i,c,o,d){if(this.type=l,this.children=i,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let l=Nr.get(this);if(l&&!l.overlay)return l.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(l=0){return new qo(this.topNode,l)}cursorAt(l,i=0,c=0){let o=So.get(this)||this.topNode,d=new qo(o);return d.moveTo(l,i),So.set(this,d._tree),d}get topNode(){return new Jn(this,0,0,null)}resolve(l,i=0){let c=Xc(So.get(this)||this.topNode,l,i,!1);return So.set(this,c),c}resolveInner(l,i=0){let c=Xc(Cb.get(this)||this.topNode,l,i,!0);return Cb.set(this,c),c}resolveStack(l,i=0){return Yv(this,l,i)}iterate(l){let{enter:i,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,m=(h&Dt.IncludeAnonymous)>0;for(let p=this.cursor(h|Dt.IncludeAnonymous);;){let x=!1;if(p.from<=d&&p.to>=o&&(!m&&p.type.isAnonymous||i(p)!==!1)){if(p.firstChild())continue;x=!0}for(;x&&c&&(m||!p.type.isAnonymous)&&c(p),!p.nextSibling();){if(!p.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let i in this.props)l.push([+i,this.props[i]]);return l}balance(l={}){return this.children.length<=8?this:Vh(Kl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new pl(this.type,i,c,o,this.propValues),l.makeTree||((i,c,o)=>new pl(Kl.none,i,c,o)))}static build(l){return Vv(l)}}pl.empty=new pl(Kl.none,[],[],0);class Ih{constructor(l,i){this.buffer=l,this.index=i}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 Ih(this.buffer,this.index)}}class Ys{constructor(l,i,c){this.buffer=l,this.length=i,this.set=c}get type(){return Kl.none}toString(){let l=[];for(let i=0;i<this.buffer.length;)l.push(this.childString(i)),i=this.buffer[i+3];return l.join(",")}childString(l){let i=this.buffer[l],c=this.buffer[l+3],o=this.set.types[i],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,i,c,o,d){let{buffer:h}=this,m=-1;for(let p=l;p!=i&&!($x(d,o,h[p+1],h[p+2])&&(m=p,c>0));p=h[p+3]);return m}slice(l,i,c){let o=this.buffer,d=new Uint16Array(i-l),h=0;for(let m=l,p=0;m<i;){d[p++]=o[m++],d[p++]=o[m++]-c;let x=d[p++]=o[m++]-c;d[p++]=o[m++]-l,h=Math.max(h,x)}return new Ys(d,h,this.set)}}function $x(a,l,i,c){switch(a){case-2:return i<l;case-1:return c>=l&&i<l;case 0:return i<l&&c>l;case 1:return i<=l&&c>l;case 2:return c>l;case 4:return!0}}function Xc(a,l,i,c){for(var o;a.from==a.to||(i<1?a.from>=l:a.from>l)||(i>-1?a.to<=l:a.to<l);){let h=!c&&a instanceof Jn&&a.index<0?null:a.parent;if(!h)return a;a=h}let d=c?0:Dt.IgnoreOverlays;if(c)for(let h=a,m=h.parent;m;h=m,m=h.parent)h instanceof Jn&&h.index<0&&((o=m.enter(l,i,d))===null||o===void 0?void 0:o.from)!=h.from&&(a=m);for(;;){let h=a.enter(l,i,d);if(!h)return a;a=h}}class Zx{cursor(l=0){return new qo(this,l)}getChild(l,i=null,c=null){let o=Rb(this,l,i,c);return o.length?o[0]:null}getChildren(l,i=null,c=null){return Rb(this,l,i,c)}resolve(l,i=0){return Xc(this,l,i,!1)}resolveInner(l,i=0){return Xc(this,l,i,!0)}matchContext(l){return wh(this.parent,l)}enterUnfinishedNodesBefore(l){let i=this.childBefore(l),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class Jn extends Zx{constructor(l,i,c,o){super(),this._tree=l,this.from=i,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,i,c,o,d=0){for(let h=this;;){for(let{children:m,positions:p}=h._tree,x=i>0?m.length:-1;l!=x;l+=i){let y=m[l],j=p[l]+h.from,v;if(!(!(d&Dt.EnterBracketed&&y instanceof pl&&(v=Nr.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!$x(o,c,j,j+y.length))){if(y instanceof Ys){if(d&Dt.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,i,c-j,o);if(C>-1)return new va(new Gv(h,y,l,j),null,C)}else if(d&Dt.IncludeAnonymous||!y.type.isAnonymous||Yh(y)){let C;if(!(d&Dt.IgnoreMounts)&&(C=Nr.get(y))&&!C.overlay)return new Jn(C.tree,j,l,h);let N=new Jn(y,j,l,h);return d&Dt.IncludeAnonymous||!N.type.isAnonymous?N:N.nextChild(i<0?y.children.length-1:0,i,c,o,d)}}}if(d&Dt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+i:l=i<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,i,c=0){let o;if(!(c&Dt.IgnoreOverlays)&&(o=Nr.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Dt.EnterBracketed&&o.bracketed;for(let{from:m,to:p}of o.overlay)if((i>0||h?m<=d:m<d)&&(i<0||h?p>=d:p>d))return new Jn(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,i,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Rb(a,l,i,c){let o=a.cursor(),d=[];if(!o.firstChild())return d;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function wh(a,l,i=l.length-1){for(let c=a;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[i]&&l[i]!=c.name)return!1;i--}}return!0}class Gv{constructor(l,i,c,o){this.parent=l,this.buffer=i,this.index=c,this.start=o}}class va extends Zx{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,i,c){super(),this.context=l,this._parent=i,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,i,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.context.start,c);return d<0?null:new va(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,i,c=0){if(c&Dt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,l-this.context.start,i);return d<0?null:new va(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,i=l.buffer[this.index+3];return i<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new va(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new va(this.context,this._parent,l.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],i=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),i.push(0)}return new pl(this.type,l,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Kx(a){if(!a.length)return null;let l=0,i=a[0];for(let d=1;d<a.length;d++){let h=a[d];(h.from>i.from||h.to<i.to)&&(i=h,l=d)}let c=i instanceof Jn&&i.index<0?null:i.parent,o=a.slice();return c?o[l]=c:o.splice(l,1),new Iv(o,i)}class Iv{constructor(l,i){this.heads=l,this.node=i}get next(){return Kx(this.heads)}}function Yv(a,l,i){let c=a.resolveInner(l,i),o=null;for(let d=c instanceof Jn?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,i)),d=h}else{let h=Nr.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let m=new Jn(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Xc(m,l,i,!1))}}return o?Kx(o):c}class qo{get name(){return this.type.name}constructor(l,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~Dt.EnterBracketed,l instanceof Jn)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,i){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Jn?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,i,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,i,c=this.mode){return this.buffer?c&Dt.ExcludeBuffers?!1:this.enterChild(1,l,i):this.yield(this._tree.enter(l,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Dt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:i}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let i,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let d=i+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let m=c._tree.children[d];if(this.mode&Dt.IncludeAnonymous||m instanceof Ys||!m.type.isAnonymous||Yh(m))return!1}return!0}move(l,i){if(i&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,i=0){for(;(this.from==this.to||(i<1?this.from>=l:this.from>l)||(i>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,i););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,i=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;i=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)i=new va(this.buffer,i,this.stack[o]);return this.bufferNode=new va(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,i){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return wh(this.node.parent,l);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return wh(this._tree,l,o);let h=c[i.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Yh(a){return a.children.some(l=>l instanceof Ys||!l.type.isAnonymous||Yh(l))}function Vv(a){var l;let{buffer:i,nodeSet:c,maxBufferLength:o=Hv,reused:d=[],minRepeatType:h=c.types.length}=a,m=Array.isArray(i)?new Ih(i,i.length):i,p=c.types,x=0,y=0;function j(X,O,D,F,re,de){let{id:W,start:ie,end:me,size:je}=m,ge=y,z=x;if(je<0)if(m.next(),je==-1){let w=d[W];D.push(w),F.push(ie-X);return}else if(je==-3){x=W;return}else if(je==-4){y=W;return}else throw new RangeError(`Unrecognized record size: ${je}`);let te=p[W],P,ae,xe=ie-X;if(me-ie<=o&&(ae=H(m.pos-O,re))){let w=new Uint16Array(ae.size-ae.skip),K=m.pos-ae.size,oe=w.length;for(;m.pos>K;)oe=$(ae.start,w,oe);P=new Ys(w,me-ae.start,c),xe=ae.start-X}else{let w=m.pos-je;m.next();let K=[],oe=[],he=W>=h?W:-1,Ne=0,Ae=me;for(;m.pos>w;)he>=0&&m.id==he&&m.size>=0?(m.end<=Ae-o&&(N(K,oe,ie,Ne,m.end,Ae,he,ge,z),Ne=K.length,Ae=m.end),m.next()):de>2500?v(ie,w,K,oe):j(ie,w,K,oe,he,de+1);if(he>=0&&Ne>0&&Ne<K.length&&N(K,oe,ie,Ne,ie,Ae,he,ge,z),K.reverse(),oe.reverse(),he>-1&&Ne>0){let qe=C(te,z);P=Vh(te,K,oe,0,K.length,0,me-ie,qe,qe)}else P=L(te,K,oe,me-ie,ge-me,z)}D.push(P),F.push(xe)}function v(X,O,D,F){let re=[],de=0,W=-1;for(;m.pos>O;){let{id:ie,start:me,end:je,size:ge}=m;if(ge>4)m.next();else{if(W>-1&&me<W)break;W<0&&(W=je-o),re.push(ie,me,je),de++,m.next()}}if(de){let ie=new Uint16Array(de*4),me=re[re.length-2];for(let je=re.length-3,ge=0;je>=0;je-=3)ie[ge++]=re[je],ie[ge++]=re[je+1]-me,ie[ge++]=re[je+2]-me,ie[ge++]=ge;D.push(new Ys(ie,re[2]-me,c)),F.push(me-X)}}function C(X,O){return(D,F,re)=>{let de=0,W=D.length-1,ie,me;if(W>=0&&(ie=D[W])instanceof pl){if(!W&&ie.type==X&&ie.length==re)return ie;(me=ie.prop(Lt.lookAhead))&&(de=F[W]+ie.length+me)}return L(X,D,F,re,de,O)}}function N(X,O,D,F,re,de,W,ie,me){let je=[],ge=[];for(;X.length>F;)je.push(X.pop()),ge.push(O.pop()+D-re);X.push(L(c.types[W],je,ge,de-re,ie-de,me)),O.push(re-D)}function L(X,O,D,F,re,de,W){if(de){let ie=[Lt.contextHash,de];W=W?[ie].concat(W):[ie]}if(re>25){let ie=[Lt.lookAhead,re];W=W?[ie].concat(W):[ie]}return new pl(X,O,D,F,W)}function H(X,O){let D=m.fork(),F=0,re=0,de=0,W=D.end-o,ie={size:0,start:0,skip:0};e:for(let me=D.pos-X;D.pos>me;){let je=D.size;if(D.id==O&&je>=0){ie.size=F,ie.start=re,ie.skip=de,de+=4,F+=4,D.next();continue}let ge=D.pos-je;if(je<0||ge<me||D.start<W)break;let z=D.id>=h?4:0,te=D.start;for(D.next();D.pos>ge;){if(D.size<0)if(D.size==-3||D.size==-4)z+=4;else break e;else D.id>=h&&(z+=4);D.next()}re=te,F+=je,de+=z}return(O<0||F==X)&&(ie.size=F,ie.start=re,ie.skip=de),ie.size>4?ie:void 0}function $(X,O,D){let{id:F,start:re,end:de,size:W}=m;if(m.next(),W>=0&&F<h){let ie=D;if(W>4){let me=m.pos-(W-4);for(;m.pos>me;)D=$(X,O,D)}O[--D]=ie,O[--D]=de-X,O[--D]=re-X,O[--D]=F}else W==-3?x=F:W==-4&&(y=F);return D}let M=[],I=[];for(;m.pos>0;)j(a.start||0,a.bufferStart||0,M,I,-1,0);let E=(l=a.length)!==null&&l!==void 0?l:M.length?I[0]+M[0].length:0;return new pl(p[a.topID],M.reverse(),I.reverse(),E)}const Mb=new WeakMap;function zo(a,l){if(!a.isAnonymous||l instanceof Ys||l.type!=a)return 1;let i=Mb.get(l);if(i==null){i=1;for(let c of l.children){if(c.type!=a||!(c instanceof pl)){i=1;break}i+=zo(a,c)}Mb.set(l,i)}return i}function Vh(a,l,i,c,o,d,h,m,p){let x=0;for(let N=c;N<o;N++)x+=zo(a,l[N]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(N,L,H,$,M){for(let I=H;I<$;){let E=I,X=L[I],O=zo(a,N[I]);for(I++;I<$;I++){let D=zo(a,N[I]);if(O+D>=y)break;O+=D}if(I==E+1){if(O>y){let D=N[E];C(D.children,D.positions,0,D.children.length,L[E]+M);continue}j.push(N[E])}else{let D=L[I-1]+N[I-1].length-X;j.push(Vh(a,N,L,E,I,X,D,null,p))}v.push(X+M-d)}}return C(l,i,c,o,0),(m||p)(j,v,h)}class Bk{constructor(){this.map=new WeakMap}setBuffer(l,i,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(i,c)}getBuffer(l,i){let c=this.map.get(l);return c&&c.get(i)}set(l,i){l instanceof va?this.setBuffer(l.context.buffer,l.index,i):l instanceof Jn&&this.map.set(l.tree,i)}get(l){return l instanceof va?this.getBuffer(l.context.buffer,l.index):l instanceof Jn?this.map.get(l.tree):void 0}cursorSet(l,i){l.buffer?this.setBuffer(l.buffer.buffer,l.index,i):this.map.set(l.tree,i)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Qc{constructor(l,i,c,o,d=!1,h=!1){this.from=l,this.to=i,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,i=[],c=!1){let o=[new Qc(0,l.length,l,0,!1,c)];for(let d of i)d.to>l.length&&o.push(d);return o}static applyChanges(l,i,c=128){if(!i.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let m=0,p=0,x=0;;m++){let y=m<i.length?i[m]:null,j=y?y.fromA:1e9;if(j-p>=c)for(;h&&h.from<j;){let v=h;if(p>=v.from||j<=v.to||x){let C=Math.max(v.from,p)-x,N=Math.min(v.to,j)-x;v=C>=N?null:new Qc(C,N,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;p=y.toA,x=y.toA-y.toB}return o}}class qk{startParse(l,i,c){return typeof l=="string"&&(l=new Xv(l)),c=c?c.length?c.map(o=>new Ll(o.from,o.to)):[new Ll(0,0)]:[new Ll(0,l.length)],this.createParse(l,i||[],c)}parse(l,i,c){let o=this.startParse(l,i,c);for(;;){let d=o.advance();if(d)return d}}}class Xv{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,i){return this.string.slice(l,i)}}function Gk(a){return(l,i,c,o)=>new $v(l,a,i,c,o)}class Ob{constructor(l,i,c,o,d,h){this.parser=l,this.parse=i,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Db(a){if(!a.length||a.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}class Qv{constructor(l,i,c,o,d,h,m,p){this.parser=l,this.predicate=i,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=p,this.depth=0,this.ranges=[]}}const Th=new Lt({perNode:!0});class $v{constructor(l,i,c,o,d){this.nest=i,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new pl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Th,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],i=l.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[Lt.mounted.id]=new Nr(i,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<l&&(l=Math.min(l,this.inner[i].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(l)}startInner(){let l=new Jv(this.fragments),i=null,c=null,o=new qo(new Jn(this.baseTree,this.ranges[0].from,0,null),Dt.IncludeAnonymous|Dt.IgnoreMounts);e:for(let d,h;;){let m=!0,p;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(l.hasNode(o)){if(i){let x=i.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&&!i.ranges.some(C=>C.from<v&&C.to>j)&&i.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=Zv(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||(Kv(o),i&&i.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")i=new Qv(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,i);else{let y=Ub(this.ranges,d.overlay||(o.from<o.to?[new Ll(o.from,o.to)]:[]));y.length&&Db(y),(y.length||!d.overlay)&&this.inner.push(new Ob(d.parser,y.length?d.parser.startParse(this.input,Hb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Ll(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(i&&(p=i.predicate(o))&&(p===!0&&(p=new Ll(o.from,o.to)),p.from<p.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==p.from?i.ranges[x]={from:i.ranges[x].from,to:p.to}:i.ranges.push(p)}if(m&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Ub(this.ranges,i.ranges);x.length&&(Db(x),this.inner.splice(i.index,0,new Ob(i.parser,i.parser.startParse(this.input,Hb(i.mounts,x),x),i.ranges.map(y=>new Ll(y.from-i.start,y.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function Zv(a,l,i){for(let c of a){if(c.from>=i)break;if(c.to>l)return c.from<=l&&c.to>=i?2:1}return 0}function zb(a,l,i,c,o,d){if(l<i){let h=a.buffer[l+1];c.push(a.slice(l,i,h)),o.push(h-d)}}function Kv(a){let{node:l}=a,i=[],c=l.context.buffer;do i.push(a.index),a.parent();while(!a.tree);let o=a.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,p=[d];function x(y,j,v,C,N,L){let H=i[L],$=[],M=[];zb(h,y,H,$,M,C);let I=m[H+1],E=m[H+2];p.push($.length);let X=L?x(H+4,m[H+3],h.set.types[m[H]],I,E-I,L-1):l.toTree();return $.push(X),M.push(I-C),zb(h,m[H+3],j,$,M,C),new pl(v,$,M,N)}o.children[d]=x(0,m.length,Kl.none,0,h.length,i.length-1);for(let y of p){let j=a.tree.children[y],v=a.tree.positions[y];a.yield(new Jn(j,v+a.from,y,a._tree))}}class Lb{constructor(l,i){this.offset=i,this.done=!1,this.cursor=l.cursor(Dt.IncludeAnonymous|Dt.IgnoreMounts)}moveTo(l){let{cursor:i}=this,c=l-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=l&&i.enter(c,1,Dt.IgnoreOverlays|Dt.ExcludeBuffers)))if(i.to<=l)i.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==l.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof pl)i=i.children[0];else break}return!1}}class Jv{constructor(l){var i;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(i=c.tree.prop(Th))!==null&&i!==void 0?i:c.to,this.inner=new Lb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(l=i.tree.prop(Th))!==null&&l!==void 0?l:i.to,this.inner=new Lb(i.tree,-i.offset)}}findMounts(l,i){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(Lt.mounted);if(h&&h.parser==i)for(let m=this.fragI;m<this.fragments.length;m++){let p=this.fragments[m];if(p.from>=d.to)break;p.tree==this.curFrag.tree&&o.push({frag:p,pos:d.from-p.offset,mount:h})}}}return o}}function Ub(a,l){let i=null,c=l;for(let o=1,d=0;o<a.length;o++){let h=a[o-1].to,m=a[o].from;for(;d<c.length;d++){let p=c[d];if(p.from>=m)break;p.to<=h||(i||(c=i=l.slice()),p.from<h?(i[d]=new Ll(p.from,h),p.to>m&&i.splice(d+1,0,new Ll(m,p.to))):p.to>m?i[d--]=new Ll(m,p.to):i.splice(d--,1))}}return c}function Fv(a,l,i,c){let o=0,d=0,h=!1,m=!1,p=-1e9,x=[];for(;;){let y=o==a.length?1e9:h?a[o].to:a[o].from,j=d==l.length?1e9:m?l[d].to:l[d].from;if(h!=m){let v=Math.max(p,i),C=Math.min(y,j,c);v<C&&x.push(new Ll(v,C))}if(p=Math.min(y,j),p==1e9)break;y==p&&(h?(h=!1,o++):h=!0),j==p&&(m?(m=!1,d++):m=!0)}return x}function Hb(a,l){let i=[];for(let{pos:c,mount:o,frag:d}of a){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,p=Math.max(d.from,h),x=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new Ll(v.from+c,v.to+c)),j=Fv(l,y,p,x);for(let v=0,C=p;;v++){let N=v==j.length,L=N?x:j[v].from;if(L>C&&i.push(new Qc(C,L,o.tree,-h,d.from>=C||d.openStart,d.to<=L||d.openEnd)),N)break;C=j[v].to}}else i.push(new Qc(p,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return i}let Wv=0;class zl{constructor(l,i,c,o){this.name=l,this.set=i,this.base=c,this.modified=o,this.id=Wv++}toString(){let{name:l}=this;for(let i of this.modified)i.name&&(l=`${i.name}(${l})`);return l}static define(l,i){let c=typeof l=="string"?l:"?";if(l instanceof zl&&(i=l),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new zl(c,[],null,[]);if(o.set.push(o),i)for(let d of i.set)o.set.push(d);return o}static defineModifier(l){let i=new Go(l);return c=>c.modified.indexOf(i)>-1?c:Go.get(c.base||c,c.modified.concat(i).sort((o,d)=>o.id-d.id))}}let Pv=0;class Go{constructor(l){this.name=l,this.instances=[],this.id=Pv++}static get(l,i){if(!i.length)return l;let c=i[0].instances.find(m=>m.base==l&&e1(i,m.modified));if(c)return c;let o=[],d=new zl(l.name,o,l,i);for(let m of i)m.instances.push(d);let h=t1(i);for(let m of l.set)if(!m.modified.length)for(let p of h)o.push(Go.get(m,p));return d}}function e1(a,l){return a.length==l.length&&a.every((i,c)=>i==l[c])}function t1(a){let l=[[]];for(let i=0;i<a.length;i++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(a[i]));return l.sort((i,c)=>c.length-i.length)}function Ik(a){let l=Object.create(null);for(let i in a){let c=a[i];Array.isArray(c)||(c=[c]);for(let o of i.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 C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let p=d.length-1,x=d[p];if(!x)throw new RangeError("Invalid path: "+o);let y=new $c(c,h,p>0?d.slice(0,p):null);l[x]=y.sort(l[x])}}return Jx.add(l)}const Jx=new Lt({combine(a,l){let i,c,o;for(;a||l;){if(!a||l&&a.depth>=l.depth?(o=l,l=l.next):(o=a,a=a.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let d=new $c(o.tags,o.mode,o.context);i?i.next=d:c=d,i=d}return c}});class $c{constructor(l,i,c,o){this.tags=l,this.mode=i,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}$c.empty=new $c([],2,null);function Fx(a,l){let i=Object.create(null);for(let d of a)if(!Array.isArray(d.tag))i[d.tag.id]=d.class;else for(let h of d.tag)i[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let m of d)for(let p of m.set){let x=i[p.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function n1(a,l){let i=null;for(let c of a){let o=c.style(l);o&&(i=i?i+" "+o:o)}return i}function l1(a,l,i,c=0,o=a.length){let d=new s1(c,Array.isArray(l)?l:[l],i);d.highlightRange(a.cursor(),c,o,"",d.highlighters),d.flush(o)}function a1(a,l,i,c,o,d=0,h=a.length){let m=d;function p(x,y){if(!(x<=m)){for(let j=a.slice(m,x),v=0;;){let C=j.indexOf(`
116
+ `,v),N=C<0?j.length:C;if(N>v&&c(j.slice(v,N),y),C<0)break;o(),v=C+1}m=x}}l1(l,i,(x,y,j)=>{p(x,""),p(y,j)},d,h),p(h,"")}class s1{constructor(l,i,c){this.at=l,this.highlighters=i,this.span=c,this.class=""}startSpan(l,i){i!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=i)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,i,c,o,d){let{type:h,from:m,to:p}=l;if(m>=c||p<=i)return;h.isTop&&(d=this.highlighters.filter(C=>!C.scope||C.scope(h)));let x=o,y=i1(l)||$c.empty,j=n1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(i,m),x),y.opaque)return;let v=l.tree&&l.tree.prop(Lt.mounted);if(v&&v.overlay){let C=l.node.enter(v.overlay[0].from+m,1),N=this.highlighters.filter(H=>!H.scope||H.scope(v.tree.type)),L=l.firstChild();for(let H=0,$=m;;H++){let M=H<v.overlay.length?v.overlay[H]:null,I=M?M.from+m:p,E=Math.max(i,$),X=Math.min(c,I);if(E<X&&L)for(;l.from<X&&(this.highlightRange(l,E,X,o,d),this.startSpan(Math.min(X,l.to),x),!(l.to>=I||!l.nextSibling())););if(!M||I>c)break;$=M.to+m,$>i&&(this.highlightRange(C.cursor(),Math.max(i,M.from+m),Math.min(c,$),"",N),this.startSpan(Math.min(c,$),x))}L&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=i)){if(l.from>=c)break;this.highlightRange(l,i,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function i1(a){let l=a.type.prop(Jx);for(;l&&l.context&&!a.matchContext(l.context);)l=l.next;return l||null}const be=zl.define,jo=be(),Hs=be(),Bb=be(Hs),qb=be(Hs),Bs=be(),ko=be(Bs),rh=be(Bs),xa=be(),vi=be(xa),ha=be(),pa=be(),Eh=be(),Hc=be(Eh),No=be(),ve={comment:jo,lineComment:be(jo),blockComment:be(jo),docComment:be(jo),name:Hs,variableName:be(Hs),typeName:Bb,tagName:be(Bb),propertyName:qb,attributeName:be(qb),className:be(Hs),labelName:be(Hs),namespace:be(Hs),macroName:be(Hs),literal:Bs,string:ko,docString:be(ko),character:be(ko),attributeValue:be(ko),number:rh,integer:be(rh),float:be(rh),bool:be(Bs),regexp:be(Bs),escape:be(Bs),color:be(Bs),url:be(Bs),keyword:ha,self:be(ha),null:be(ha),atom:be(ha),unit:be(ha),modifier:be(ha),operatorKeyword:be(ha),controlKeyword:be(ha),definitionKeyword:be(ha),moduleKeyword:be(ha),operator:pa,derefOperator:be(pa),arithmeticOperator:be(pa),logicOperator:be(pa),bitwiseOperator:be(pa),compareOperator:be(pa),updateOperator:be(pa),definitionOperator:be(pa),typeOperator:be(pa),controlOperator:be(pa),punctuation:Eh,separator:be(Eh),bracket:Hc,angleBracket:be(Hc),squareBracket:be(Hc),paren:be(Hc),brace:be(Hc),content:xa,heading:vi,heading1:be(vi),heading2:be(vi),heading3:be(vi),heading4:be(vi),heading5:be(vi),heading6:be(vi),contentSeparator:be(xa),list:be(xa),quote:be(xa),emphasis:be(xa),strong:be(xa),link:be(xa),monospace:be(xa),strikethrough:be(xa),inserted:be(),deleted:be(),changed:be(),invalid:be(),meta:No,documentMeta:be(No),annotation:be(No),processingInstruction:be(No),definition:zl.defineModifier("definition"),constant:zl.defineModifier("constant"),function:zl.defineModifier("function"),standard:zl.defineModifier("standard"),local:zl.defineModifier("local"),special:zl.defineModifier("special")};for(let a in ve){let l=ve[a];l instanceof zl&&(l.name=a)}Fx([{tag:ve.link,class:"tok-link"},{tag:ve.heading,class:"tok-heading"},{tag:ve.emphasis,class:"tok-emphasis"},{tag:ve.strong,class:"tok-strong"},{tag:ve.keyword,class:"tok-keyword"},{tag:ve.atom,class:"tok-atom"},{tag:ve.bool,class:"tok-bool"},{tag:ve.url,class:"tok-url"},{tag:ve.labelName,class:"tok-labelName"},{tag:ve.inserted,class:"tok-inserted"},{tag:ve.deleted,class:"tok-deleted"},{tag:ve.literal,class:"tok-literal"},{tag:ve.string,class:"tok-string"},{tag:ve.number,class:"tok-number"},{tag:[ve.regexp,ve.escape,ve.special(ve.string)],class:"tok-string2"},{tag:ve.variableName,class:"tok-variableName"},{tag:ve.local(ve.variableName),class:"tok-variableName tok-local"},{tag:ve.definition(ve.variableName),class:"tok-variableName tok-definition"},{tag:ve.special(ve.variableName),class:"tok-variableName2"},{tag:ve.definition(ve.propertyName),class:"tok-propertyName tok-definition"},{tag:ve.typeName,class:"tok-typeName"},{tag:ve.namespace,class:"tok-namespace"},{tag:ve.className,class:"tok-className"},{tag:ve.macroName,class:"tok-macroName"},{tag:ve.propertyName,class:"tok-propertyName"},{tag:ve.operator,class:"tok-operator"},{tag:ve.comment,class:"tok-comment"},{tag:ve.meta,class:"tok-meta"},{tag:ve.invalid,class:"tok-invalid"},{tag:ve.punctuation,class:"tok-punctuation"}]);const r1="modulepreload",c1=function(a,l){return new URL(a,l).href},Gb={},Xe=function(l,i,c){let o=Promise.resolve();if(i&&i.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"),p=document.querySelector("meta[property=csp-nonce]"),x=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));o=h(i.map(y=>{if(y=c1(y,c),y in Gb)return;Gb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let L=m.length-1;L>=0;L--){const H=m[L];if(H.href===y&&(!j||H.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const N=document.createElement("link");if(N.rel=j?"stylesheet":r1,j||(N.as="script"),N.crossOrigin="",N.href=y,x&&N.setAttribute("nonce",x),document.head.appendChild(N),j)return new Promise((L,H)=>{N.addEventListener("load",L),N.addEventListener("error",()=>H(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return l().catch(d)})},Wx={js:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-C7BowCu_.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Xe(async()=>{const{json:a}=await import("./index-Ds7Lfmpa.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Xe(async()=>{const{json:a}=await import("./index-Ds7Lfmpa.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Xe(async()=>{const{css:a}=await import("./index-BXGO38V0.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Xe(async()=>{const{css:a}=await import("./index-BXGO38V0.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Xe(async()=>{const{css:a}=await import("./index-BXGO38V0.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Xe(async()=>{const{html:a}=await import("./index-C73L6h-_.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Xe(async()=>{const{html:a}=await import("./index-C73L6h-_.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Xe(async()=>{const{html:a}=await import("./index-C73L6h-_.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Xe(async()=>{const{html:a}=await import("./index-C73L6h-_.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-CGu7N9dH.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-CGu7N9dH.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Xe(async()=>{const{python:a}=await import("./index-BsWsF3Fl.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Xe(async()=>{const{python:a}=await import("./index-BsWsF3Fl.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-DQd5QKK5.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-DQd5QKK5.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Xe(async()=>{const{rust:a}=await import("./index-BfEIguB2.js");return{rust:a}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-NSr-7K-t.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-NSr-7K-t.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-NSr-7K-t.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-NSr-7K-t.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-NSr-7K-t.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Xe(async()=>{const{java:a}=await import("./index-DK3fr1-H.js");return{java:a}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Xe(async()=>{const{go:a}=await import("./index-BWCkRrtJ.js");return{go:a}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Xe(async()=>{const{php:a}=await import("./index-BUPafoiW.js");return{php:a}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Xe(async()=>{const{sql:a}=await import("./index-DZONC7G0.js");return{sql:a}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-C37A4Z6a.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-C37A4Z6a.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},u1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},o1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function f1(a){const l=o1[a.toLowerCase()]??a.toLowerCase(),i=Wx[l];return i?i().catch(()=>null):null}async function d1(a){const l=(a.split("/").pop()??"").toLowerCase(),i=u1[l]??l.split(".").pop()??"",c=Wx[i];return c?c().catch(()=>null):null}const h1=Fx([{tag:[ve.keyword,ve.modifier,ve.controlKeyword,ve.moduleKeyword],class:"cmh-key"},{tag:[ve.propertyName],class:"cmh-prop"},{tag:[ve.function(ve.variableName),ve.labelName],class:"cmh-fn"},{tag:[ve.color,ve.constant(ve.name),ve.standard(ve.name),ve.bool],class:"cmh-const"},{tag:[ve.typeName,ve.className,ve.changed,ve.annotation,ve.self,ve.namespace],class:"cmh-type"},{tag:[ve.number,ve.integer,ve.float],class:"cmh-num"},{tag:[ve.string,ve.special(ve.string),ve.regexp],class:"cmh-str"},{tag:[ve.operator,ve.operatorKeyword,ve.escape],class:"cmh-op"},{tag:[ve.meta,ve.comment],class:"cmh-comment"},{tag:ve.invalid,class:"cmh-invalid"}]);function wo(a){return a.replace(/[&<>]/g,l=>l==="&"?"&amp;":l==="<"?"&lt;":"&gt;")}async function p1(a,l){const i=l?await f1(l):null;if(!i)return wo(a);try{const c=i.language.parser.parse(a);let o="";return a1(a,c,h1,(d,h)=>{o+=h?`<span class="${h}">${wo(d)}</span>`:wo(d)},()=>{o+=`
117
+ `}),o}catch{return wo(a)}}gt.setOptions({gfm:!0,breaks:!1});function Px(a){var i;const l=(i=a.split(".").pop())==null?void 0:i.toLowerCase();return l==="md"||l==="markdown"}async function ey(a){const l=await gt.parse(a,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await p1(c.text,c.lang??""),c.escaped=!0}});return Uv.sanitize(l)}function Ib(a,l){return{path:a.path,text:a.content,saved:a.content,eol:a.eol,encoding:a.encoding,mtime:a.mtime,size:a.size,binary:a.binary,tooLarge:a.tooLarge,stale:!1,revision:l,previewMode:Px(a.path)}}function Fa(a){return!a.binary&&!a.tooLarge&&a.text!==a.saved}function m1(a){return a.split("/").pop()??a}function Ri(a){const l=a.lastIndexOf("/");return l===-1?"":a.slice(0,l)}function ch(a){return a<1024?`${a} Б`:a<1024*1024?`${(a/1024).toFixed(1)} КБ`:`${(a/1024/1024).toFixed(1)} МБ`}function Lo({x:a,y:l,items:i,note:c,onClose:o}){const d=_.useRef(null),[h,m]=_.useState({left:a,top:l}),[p,x]=_.useState(()=>{const v=i.findIndex(C=>!C.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),N=8,L=Math.max(N,Math.min(a,window.innerWidth-C.width-N)),H=Math.max(N,Math.min(l,window.innerHeight-C.height-N));m({left:L,top:H})},[a,l]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(N){var L;(L=d.current)!=null&&L.contains(N.target)||o()}function C(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",C,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=i.map((N,L)=>({item:N,index:L})).filter(N=>!N.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const N=v.key==="ArrowDown"?1:-1,L=C.findIndex($=>$.index===p),H=C[(((L===-1?0:L)+N)%C.length+C.length)%C.length];H&&x(H.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const N=i[p];N&&y(N)}}}return r.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&r.jsx("div",{className:"ctxmenu__note",children:c}),i.map((v,C)=>r.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===p?" is-cursor":""),onMouseEnter:()=>x(C),onClick:()=>y(v),children:[r.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&r.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const g1=3500,b1=9e3,Yb=220;function zi({result:a,onDismiss:l}){const[i,c]=_.useState(a),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!a){c(null),d(!1);return}if(c(a),d(!1),a.url)return;const m=a.ok?g1:b1,p=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+Yb);return()=>{clearTimeout(p),clearTimeout(x)}},[a]),!i)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Yb)};return r.jsxs("div",{className:"oplog "+(i.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(i.url?" oplog--dismissible":""),role:"status","aria-live":i.ok?"polite":"assertive",children:[i.message,i.url&&r.jsxs("a",{className:"oplog__link",href:i.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&l&&r.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Zc({value:a,className:l,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(a),m=_.useRef(null);_.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function p(){const x=d.trim();if(!x||x===a)return o();c(x)}return r.jsx("input",{ref:m,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:x=>h(x.target.value),onBlur:p,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),p()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Ur({active:a}){return a?r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M2 5h3V2"}),r.jsx("path",{d:"M14 5h-3V2"}),r.jsx("path",{d:"M2 11h3v3"}),r.jsx("path",{d:"M14 11h-3v3"})]}):r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M5 2H2v3"}),r.jsx("path",{d:"M11 2h3v3"}),r.jsx("path",{d:"M2 11v3h3"}),r.jsx("path",{d:"M14 11v3h-3"})]})}const x1=500,Si="application/x-ccv-fs-path",y1=200;function _1({open:a,tree:l,expanded:i,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:p,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:C,onMove:N,onCopy:L,onDelete:H,onRefresh:$,onClose:M,zoomed:I,onToggleZoom:E}){const[X,O]=_.useState(""),[D,F]=_.useState(null),[re,de]=_.useState(null),[W,ie]=_.useState(null),[me,je]=_.useState(null),[ge,z]=_.useState(null),[te,P]=_.useState(null),ae=Mh("(hover: hover)"),xe=_.useRef(null),w=_.useMemo(()=>j1(d),[d]);function K(T){return!(!W||T===W.path||W.kind==="dir"&&T.startsWith(`${W.path}/`)||T===Ri(W.path))}function oe(T){return!(!ge||T===ge.path||ge.kind==="dir"&&T.startsWith(`${ge.path}/`)||ge.mode==="cut"&&T===Ri(ge.path))}function he(T){z({path:T.path,kind:T.kind,mode:"copy"})}function Ne(T){z({path:T.path,kind:T.kind,mode:"cut"})}function Ae(T){!ge||!oe(T)||(T&&!i.has(T)&&y(T),ge.mode==="cut"?(N(ge.path,T),z(null)):L(ge.path,T))}function qe(T,Y){const Se=T.touches[0];if(!Se)return;const Me={timer:0,x:Se.clientX,y:Se.clientY,el:T.currentTarget,fired:!1};Me.timer=window.setTimeout(()=>{Me.fired=!0,Y(Me.x,Me.y,Me.el)},x1),xe.current=Me}function st(T){const Y=xe.current,Se=T.touches[0];!Y||!Se||Math.hypot(Se.clientX-Y.x,Se.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),xe.current=null)}function Ze(T){const Y=xe.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&T.preventDefault())}function Ut(){var T;return(T=xe.current)!=null&&T.fired?(xe.current=null,!0):!1}function Le(T,Y,Se,Me){O((Me==null?void 0:Me.path)??""),P({x:T,y:Y,opener:Se,entry:Me})}function dt(){const T=te==null?void 0:te.opener;P(null),T!=null&&T.isConnected&&T.focus()}function Ke(T){return{onContextMenu:Y=>{Y.preventDefault(),Le(Y.clientX,Y.clientY,Y.currentTarget,T)},onTouchStart:Y=>qe(Y,(Se,Me,He)=>Le(Se,Me,He,T)),onTouchMove:st,onTouchEnd:Ze,onTouchCancel:Ze}}function Ie(T){T.target===T.currentTarget&&(T.preventDefault(),Le(T.clientX,T.clientY,T.currentTarget,null))}function Fe(T){T.target===T.currentTarget&&qe(T,(Y,Se,Me)=>Le(Y,Se,Me,null))}function ht(T){if(!(T.ctrlKey||T.metaKey)||T.target instanceof HTMLInputElement)return;const Y=T.key.toLowerCase();if(Y==="v"){T.preventDefault(),Ae(Wt());return}if(!X)return;const Se=Vb(l,X);Se&&(Y==="c"?(T.preventDefault(),he(Se)):Y==="x"&&(T.preventDefault(),Ne(Se)))}function It(T){return Y=>{Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData(Si,T.path),ie({path:T.path,kind:T.kind})}}function vt(){ie(null),je(null)}function Gn(T){return Y=>{Y.dataTransfer.types.includes(Si)&&(Y.stopPropagation(),!(T.kind!=="dir"||!K(T.path))&&(Y.preventDefault(),je(T.path)))}}function Jt(T){return Y=>{if(!Y.dataTransfer.types.includes(Si)||(Y.stopPropagation(),T.kind!=="dir"||!K(T.path)))return;Y.preventDefault();const Se=Y.dataTransfer.getData(Si);je(null),Se&&N(Se,T.path)}}function Ft(T){!T.dataTransfer.types.includes(Si)||!K("")||(T.preventDefault(),je(""))}function In(T){if(!T.dataTransfer.types.includes(Si)||!K(""))return;T.preventDefault();const Y=T.dataTransfer.getData(Si);je(null),Y&&N(Y,"")}const[Xt,ct]=_.useState(""),jn=Xt.trim(),kn=jn.length>0,_n=_.useRef(null),Qt=_.useRef(p);Qt.current=p;function Nn(T){ct(T),_n.current&&clearTimeout(_n.current);const Y=T.trim();if(!Y){Qt.current("");return}_n.current=setTimeout(()=>Qt.current(Y),y1)}function wn(T){_n.current&&clearTimeout(_n.current),ct(""),Qt.current(""),O(T.path),x(T)}const Ht=kn&&(m==null?void 0:m.query)===jn?m:null;function Wt(){if(X==="")return"";const T=Vb(l,X);if((T==null?void 0:T.kind)==="dir")return X;const Y=X.lastIndexOf("/");return Y===-1?"":X.slice(0,Y)}function Z(T,Y){const Se=Y??Wt();Se&&!i.has(Se)&&y(Se),de({parent:Se,kind:T})}function ue(){if(!te)return[];const T=Me=>ae?Me:void 0;if(!te.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:T("Ctrl+V"),disabled:!oe(""),onSelect:()=>Ae("")},{id:"new-file",label:"Создать файл",onSelect:()=>Z("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Z("dir","")}];const Y=te.entry,Se=[Y.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(Y.path)}:{id:"toggle",label:i.has(Y.path)?"Свернуть":"Развернуть",onSelect:()=>y(Y.path)},{id:"copy",label:"Копировать",hint:T("Ctrl+C"),onSelect:()=>he(Y)},{id:"cut",label:"Вырезать",hint:T("Ctrl+X"),onSelect:()=>Ne(Y)}];return Y.kind==="dir"&&(Se.push({id:"paste",label:"Вставить",hint:T("Ctrl+V"),disabled:!oe(Y.path),onSelect:()=>Ae(Y.path)}),Se.push({id:"new-file",label:"Создать файл",onSelect:()=>Z("file",Y.path)}),Se.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Z("dir",Y.path)})),Se.push({id:"rename",label:"Переименовать",onSelect:()=>F(Y.path)}),Se.push({id:"delete",label:"Удалить",onSelect:()=>H(Y)}),Se}const we=kn?[]:Ce("",0);function Ce(T,Y){const Se=l[T],Me=[];if(re&&re.parent===T&&Me.push(r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Y),children:[r.jsx("span",{className:"fsrow__icon",children:re.kind==="dir"?r.jsx(Yo,{}):r.jsx(Vo,{})}),r.jsx(Zc,{className:"rename--file",value:"",placeholder:re.kind==="dir"?"имя каталога":"имя файла",onCommit:He=>{de(null),v(T,re.kind,He)},onCancel:()=>de(null)})]},`draft:${T}`)),!Se)return Me.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Y),children:"читаем…"},`wait:${T}`)),Me;Se.length===0&&!re&&Me.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Y),children:"пусто"},`empty:${T}`));for(const He of Se){const Rn=He.kind==="dir"&&i.has(He.path);Me.push(D===He.path?r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Y),children:[r.jsx("span",{className:"fsrow__icon",children:He.kind==="dir"?r.jsx(Yo,{open:Rn}):r.jsx(Vo,{})}),r.jsx(Zc,{className:"rename--file",value:He.name,placeholder:"новое имя",onCommit:Ul=>{F(null),C(He.path,Ul)},onCancel:()=>F(null)})]},He.path):r.jsx(v1,{entry:He,depth:Y,open:Rn,active:He.path===c,selected:He.path===X,dirty:o.has(He.path),gitStatus:w.get(He.path),dragging:(W==null?void 0:W.path)===He.path,dropTarget:me===He.path,cut:(ge==null?void 0:ge.mode)==="cut"&&ge.path===He.path,onClick:()=>{Ut()||(O(He.path),He.kind==="dir"?y(He.path):j(He.path))},onRename:()=>F(He.path),onDelete:()=>H(He),onDragStart:It(He),onDragEnd:vt,onDragOver:Gn(He),onDrop:Jt(He),...Ke(He)},He.path)),Rn&&Me.push(...Ce(He.path,Y+1))}return Me}function bt(){if(!Ht)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ищем…"},"search:wait")];if(Ht.entries.length===0)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ничего не найдено"},"search:empty")];const T=Ht.entries.map(Y=>r.jsx(S1,{entry:Y,gitStatus:w.get(Y.path),onClick:()=>wn(Y)},Y.path));return Ht.truncated&&T.push(r.jsxs("p",{className:"fsrow__pending",style:Wa(0),children:["показаны первые ",Ht.entries.length," — уточните запрос"]},"search:truncated")),T}return r.jsxs("aside",{className:(a?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(I?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:ht,children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:T=>{E&&(T.target.closest("button")||E())},children:[r.jsx(T1,{}),r.jsx("span",{className:"sidepane__title",children:"Файлы"}),r.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Z("file"),children:r.jsx(N1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Z("dir"),children:r.jsx(w1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:$,children:"↻"}),E&&r.jsx("button",{className:"sidepane__btn",title:I?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":I?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":I,onClick:E,children:r.jsx(Ur,{active:I})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:M,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(E1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:Xt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:T=>Nn(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),Xt?Nn(""):T.currentTarget.blur())}}),Xt&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Nn(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree"+(me===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Ft,onDrop:In,onContextMenu:Ie,onTouchStart:Fe,onTouchMove:st,onTouchEnd:Ze,onTouchCancel:Ze,children:kn?bt():we}),r.jsx(zi,{result:h}),te&&r.jsx(Lo,{x:te.x,y:te.y,items:ue(),onClose:dt})]})}function v1({entry:a,depth:l,open:i,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:p,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:C,onDragEnd:N,onDragOver:L,onDrop:H,onContextMenu:$,onTouchStart:M,onTouchMove:I,onTouchEnd:E,onTouchCancel:X}){const O="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(a.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(p?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return r.jsxs("div",{className:O,style:Wa(l),draggable:!0,onDragStart:C,onDragEnd:N,onDragOver:L,onDrop:H,onContextMenu:$,onTouchStart:M,onTouchMove:I,onTouchEnd:E,onTouchCancel:X,children:[r.jsxs("button",{className:"fsrow__main",onClick:y,title:ty(a),children:[r.jsx("span",{className:"fsrow__icon"+Io("fsrow__icon",h),children:a.kind==="dir"?r.jsx(Yo,{open:i}):r.jsx(Vo,{})}),r.jsx("span",{className:"fsrow__name"+Io("fsrow__name",h),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&r.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),r.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${a.name}`,onClick:j,children:"✎"}),r.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${a.name}`,onClick:v,children:"✕"})]})}function S1({entry:a,gitStatus:l,onClick:i}){const c=a.path.slice(0,a.path.length-a.name.length-1);return r.jsxs("button",{className:"fsrow fsrow--search"+(a.ignored?" fsrow--ignored":""),style:Wa(0),onClick:i,title:ty(a),children:[r.jsx("span",{className:"fsrow__icon"+Io("fsrow__icon",l),children:a.kind==="dir"?r.jsx(Yo,{}):r.jsx(Vo,{})}),r.jsx("span",{className:"fsrow__name"+Io("fsrow__name",l),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&r.jsx("span",{className:"fsrow__path",children:c})]})}function ty(a){return a.ignored?`${a.path} — игнорируется git (.gitignore)`:a.path}function Wa(a){return{"--depth":a}}function Vb(a,l){var o;const i=l.lastIndexOf("/"),c=i===-1?"":l.slice(0,i);return((o=a[c])==null?void 0:o.find(d=>d.path===l))??null}function j1(a){const l=new Map,i={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||i[d]>i[h])&&l.set(o,d)};for(const o of a){const d=k1(o.status);if(!d)continue;c(o.path,d);let h=Ri(o.path);for(;c(h,d),!!h;)h=Ri(h)}return l}function k1(a){if(a==="??")return"added";const[l="",i=""]=a;return l==="A"||l==="R"||l==="C"?"added":l==="M"||i==="M"?"modified":null}function Io(a,l){return l?` ${a}--git-${l}`:""}function Yo({open:a=!1}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:a?r.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"}):r.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 Vo(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]})}function N1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function w1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:r.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"})}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function T1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.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"}),r.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 E1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const A1=200;function C1({open:a,result:l,onSearch:i,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,p]=_.useState(""),x=m.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(i);v.current=i;function C(H){p(H),j.current&&clearTimeout(j.current);const $=H.trim();if(!$){v.current("");return}j.current=setTimeout(()=>v.current($),A1)}const N=y&&(l==null?void 0:l.query)===x?l:null;function L(){if(!N)return[r.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(N.matches.length===0)return[r.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const H=[];let $="";for(const M of N.matches)M.path!==$&&($=M.path,H.push(r.jsx("p",{className:"searchgroup__path",title:M.path,children:M.path},`path:${M.path}`))),H.push(r.jsx(R1,{match:M,onClick:()=>c(M)},`${M.path}:${M.line}:${M.column}`));return N.truncated&&H.push(r.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",N.matches.length," — уточните запрос"]},"grep:truncated")),H}return r.jsxs("aside",{className:(a?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:H=>{h&&(H.target.closest("button")||h())},children:[r.jsx(M1,{}),r.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&r.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ur,{active:d})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(O1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:H=>C(H.target.value),onKeyDown:H=>{H.stopPropagation(),H.key==="Escape"&&(H.preventDefault(),m?C(""):H.currentTarget.blur())}}),m&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree",children:y?L():r.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function R1({match:a,onClick:l}){const i=a.lineText.slice(0,a.column-1),c=a.lineText.slice(a.column-1,a.column-1+a.matchLength),o=a.lineText.slice(a.column-1+a.matchLength);return r.jsxs("button",{className:"searchmatch",onClick:l,title:`${a.path}:${a.line}`,children:[r.jsx("span",{className:"searchmatch__line",children:a.line}),r.jsxs("span",{className:"searchmatch__text",children:[i,r.jsx("mark",{children:c}),o]})]})}function M1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function O1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let To=null;function D1(){return To||(To=Promise.all([Xe(()=>import("./index-D6dXU68i.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Xe(()=>import("./index-891wE-Rj.js").then(a=>a.v),__vite__mapDeps([4,3]),import.meta.url),Xe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Xe(()=>import("./index-BJxrsvYI.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Xe(()=>import("./codemirror-CT_I9W8V.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([a,l,i,c,o])=>({EditorView:l.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:a.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(a=>{throw To=null,a})),To}function z1({path:a,doc:l,revision:i,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),m=_.useRef(null),p=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),C=_.useRef(o),N=_.useRef(d),L=_.useRef(a),H=_.useRef(i),$=_.useRef(l);C.current=o,N.current=d,L.current=a,H.current=i,$.current=l;const[M,I]=_.useState("loading"),[E,X]=_.useState(!1);function O(F,re,de,W,ie){const me=x.current.get(W),je=y.current.get(W)===ie;if(me&&je)de.setState(me);else{const z=F.EditorState.create({doc:$.current,extensions:[F.basicSetup,F.Prec.highest(F.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(N.current(L.current),!0)}])),F.keymap.of([F.indentWithTab]),re.of([]),F.editorTheme,F.editorHighlight,F.EditorView.updateListener.of(te=>{te.docChanged&&C.current(L.current,te.state.doc.toString())})]});x.current.set(W,z),y.current.set(W,ie),de.setState(z),j.current.delete(W)}if(j.current.has(W))return()=>{};let ge=!1;return d1(W).then(z=>{ge||!z||L.current!==W||(de.dispatch({effects:re.reconfigure(z)}),x.current.set(W,de.state),j.current.add(W))}),()=>{ge=!0}}_.useEffect(()=>{if(!h.current)return;let re=!1,de=null,W=null;I("loading"),X(!1);const ie=window.setTimeout(()=>{re||X(!0)},200);return(async()=>{let me;try{me=await D1()}catch{window.clearTimeout(ie),re||I("error");return}if(re||!h.current)return;window.clearTimeout(ie);const je=new me.Compartment;v.current=je,p.current=me,W=new me.EditorView({parent:h.current}),m.current=W,de=O(me,je,W,L.current,H.current),I("ready")})(),()=>{re=!0,window.clearTimeout(ie),de==null||de(),W==null||W.destroy(),m.current===W&&(m.current=null),p.current=null,v.current=null}},[]),_.useEffect(()=>{const F=p.current,re=m.current,de=v.current;if(!(!F||!re||!de))return O(F,de,re,a,i)},[a,i]);const D=_.useRef(0);return _.useEffect(()=>{const F=m.current,re=p.current;if(!F||!re||!c||c.token===D.current)return;D.current=c.token;const de=F.state.doc.lines,W=Math.min(Math.max(c.line,1),de),ie=F.state.doc.line(W),me=Math.min(ie.from+Math.max(c.column-1,0),ie.to);F.dispatch({selection:re.EditorSelection.cursor(me),effects:re.EditorView.scrollIntoView(me,{y:"center"})}),F.focus()},[c]),_.useEffect(()=>()=>{const F=m.current;F&&x.current.set(a,F.state)},[a]),r.jsxs("div",{className:"editor__code",children:[r.jsx("div",{ref:h,className:"editor__code-surface"+(M==="ready"?"":" is-hidden")}),M==="loading"&&E&&r.jsxs("div",{className:"editor__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),M==="error"&&r.jsxs("div",{className:"editor__fallback",children:[r.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[r.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),r.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),r.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function L1({file:a,goto:l,onChange:i,onSave:c,onReload:o,onOverwrite:d,onTogglePreview:h}){const m=Fa(a),p=Px(a.path)&&!a.binary&&!a.tooLarge;return r.jsxs("div",{className:"editor",children:[r.jsxs("div",{className:"editor__bar",children:[r.jsx("span",{className:"editor__path",title:a.path,children:a.path}),r.jsxs("span",{className:"editor__meta",children:[ch(a.size),a.eol==="crlf"&&" · CRLF"]}),p&&r.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(a.previewMode?" is-on":""),role:"tab","aria-selected":a.previewMode,onClick:()=>!a.previewMode&&h(a.path),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(a.previewMode?"":" is-on"),role:"tab","aria-selected":!a.previewMode,onClick:()=>a.previewMode&&h(a.path),children:"Код"})]}),r.jsx("button",{className:"btn btn--sm",disabled:!m,title:"Сохранить (Ctrl+S)",onClick:()=>c(a.path),children:m?"Сохранить":"Сохранено"})]}),a.stale&&r.jsxs("div",{className:"editor__warn",children:[r.jsxs("span",{children:["Файл изменился на диске",m?" — а здесь есть несохранённые правки.":"."]}),r.jsx("button",{className:"btn btn--sm",onClick:()=>o(a.path),children:"Взять с диска"}),m&&r.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(a.path),children:"Сохранить поверх"})]}),a.binary?r.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",ch(a.size)," на диске."]}):a.tooLarge?r.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",ch(a.size),"). Такие правит агент, а не браузер."]}):p&&a.previewMode?r.jsx(U1,{text:a.text}):r.jsx(z1,{path:a.path,doc:a.text,revision:a.revision,goto:l,onChange:i,onSave:c})]})}function U1({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return ey(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function H1({files:a,activePath:l,busy:i,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return r.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[r.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[r.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&r.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),a.map(m=>r.jsxs("div",{className:"worktab"+(m.path===l?" is-on":""),role:"tab","aria-selected":m.path===l,onDoubleClick:p=>{h&&(p.target.closest(".worktab__close, .worktab__dot")||h())},children:[r.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:m1(m.path)}),Fa(m)?r.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):r.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),r.jsx("div",{className:"worktabs__spacer"}),h&&r.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Ur,{active:d})})]})}const ny="ccv:sidebar.collapsed",ly="ccv:sidebar.mode",B1=500,Xb="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function q1({open:a,connected:l,status:i,workspaces:c,sessions:o,archived:d,pinned:h,activeWorkspaceId:m,activeSessionId:p,onSelectWorkspace:x,onSelectSession:y,onRenameSession:j,onPinSessions:v,onSelectPinned:C,onCloseWorkspaces:N,onArchiveSessions:L,onUnarchiveSessions:H,onOpenWorkspace:$,onNewSession:M,onOpenExtensions:I,account:E,onOpenAccount:X,relay:O,onOpenRelay:D,onOpenSettings:F,themeMode:re,onCycleTheme:de}){const[W,ie]=_.useState(null),[me,je]=_.useState(""),[ge,z]=_.useState(Y1),[te,P]=_.useState(V1);function ae(){P(T=>{const Y=T==="pinned"?"default":"pinned";try{localStorage.setItem(ly,Y)}catch{}return Y})}const xe=me.trim().toLowerCase(),w=xe!=="",K=_.useMemo(()=>w?c.filter(T=>T.name.toLowerCase().includes(xe)||T.path.toLowerCase().includes(xe)):c,[c,xe,w]),oe=_.useMemo(()=>w?o.filter(T=>(T.title??"").toLowerCase().includes(xe)):o,[o,xe,w]),he=_.useMemo(()=>w?d.filter(T=>(T.title??"").toLowerCase().includes(xe)):d,[d,xe,w]),Ne=T=>{var Y;return((Y=c.find(Se=>Se.id===T))==null?void 0:Y.name)??"—"},Ae=T=>{var Y;return(Y=c.find(Se=>Se.id===T))==null?void 0:Y.path},qe=_.useMemo(()=>w?h.filter(T=>(T.title??"").toLowerCase().includes(xe)||Ne(T.workspaceId).toLowerCase().includes(xe)):h,[h,c,xe,w]);function st(T){z(Y=>{const Se=Y.includes(T)?Y.filter(Me=>Me!==T):[...Y,T];try{localStorage.setItem(ny,JSON.stringify(Se))}catch{}return Se})}const Ze=T=>!ge.includes(T),Ut=$b(K),Le=$b(oe),[dt,Ke]=_.useState(null),[Ie,Fe]=_.useState(null),[ht,It]=_.useState(null),vt=_.useRef(null);function Gn(T,Y){const Se=T.touches[0];if(!Se)return;const Me={timer:0,x:Se.clientX,y:Se.clientY,el:T.currentTarget,fired:!1};Me.timer=window.setTimeout(()=>{Me.fired=!0,Y(Me.x,Me.y,Me.el)},B1),vt.current=Me}function Jt(T){const Y=vt.current,Se=T.touches[0];!Y||!Se||Math.hypot(Se.clientX-Y.x,Se.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),vt.current=null)}function Ft(T){const Y=vt.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&T.preventDefault())}function In(){var T;return(T=vt.current)!=null&&T.fired?(vt.current=null,!0):!1}function Xt(){const T=dt==null?void 0:dt.opener;Ke(null),T!=null&&T.isConnected&&T.focus()}function ct(){const T=Ie==null?void 0:Ie.opener;Fe(null),T!=null&&T.isConnected&&T.focus()}function jn(){const T=ht==null?void 0:ht.opener;It(null),T!=null&&T.isConnected&&T.focus()}function kn(T){return{onContextMenu:Y=>{Y.preventDefault(),Ke({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:Ut.targetsFor(T)})},onTouchStart:Y=>Gn(Y,(Se,Me,He)=>Ke({x:Se,y:Me,opener:He,ids:Ut.targetsFor(T)})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}function _n(T){return{onContextMenu:Y=>{Y.preventDefault(),Fe({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:Le.targetsFor(T)})},onTouchStart:Y=>Gn(Y,(Se,Me,He)=>Fe({x:Se,y:Me,opener:He,ids:Le.targetsFor(T)})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}function Qt(T){return{onContextMenu:Y=>{Y.preventDefault(),It({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:[T.id]})},onTouchStart:Y=>Gn(Y,(Se,Me,He)=>It({x:Se,y:Me,opener:He,ids:[T.id]})),onTouchMove:Jt,onTouchEnd:Ft,onTouchCancel:Ft}}const Nn=o.filter(T=>T.state!=="closed").length,wn=dt?[{id:"close",label:dt.ids.length>1?`Закрыть проекты (${dt.ids.length})`:"Закрыть проект",onSelect:()=>{N(dt.ids),Ut.clear()}}]:[],Ht=dt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(m&&dt.ids.includes(m)&&Nn>0?` в нём сейчас незавершённых сессий: ${Nn} — при закрытии они остановятся на хосте.`:""):void 0,Wt=Ie?oe.find(T=>T.id===Ie.ids[0]):void 0,Z=(Wt==null?void 0:Wt.pinned)!==!0,ue=Ie?[...Ie.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ie(Ie.ids[0])}]:[],{id:"pin",label:Z?Ie.ids.length>1?`Закрепить (${Ie.ids.length})`:"Закрепить":Ie.ids.length>1?`Открепить (${Ie.ids.length})`:"Открепить",onSelect:()=>{Wt&&v(Wt.workspaceId,Ie.ids,Z),Le.clear()}},{id:"archive",label:Ie.ids.length>1?`Убрать в архив (${Ie.ids.length})`:"Убрать в архив",onSelect:()=>{L(m,Ie.ids),Le.clear()}}]:[],we=Ie?Xb:void 0,Ce=ht?qe.find(T=>T.id===ht.ids[0]):void 0,bt=ht?[{id:"rename",label:"Переименовать",onSelect:()=>ie(ht.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Ce&&v(Ce.workspaceId,[Ce.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ce&&L(Ce.workspaceId,[Ce.id])}}]:[];return r.jsxs("aside",{className:a?"sidebar sidebar--open":"sidebar",children:[r.jsxs("div",{className:"sidebar__head",children:[r.jsx("span",{className:l?"dot dot--on":"dot",title:i}),r.jsx("span",{className:"brand",children:"Claude Code Visual"}),r.jsx("button",{className:"theme-btn","aria-pressed":te==="pinned",title:te==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":te==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:ae,children:r.jsx(ay,{})}),r.jsx("button",{className:"theme-btn",title:`Тема: ${Zb[re]}`,"aria-label":`Тема: ${Zb[re]}. Переключить`,onClick:de,children:r.jsx(X1,{mode:re})})]}),r.jsxs("div",{className:"fssearch fssearch--sidebar",children:[r.jsx(I1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:me,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:T=>je(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),me?je(""):T.currentTarget.blur())}}),me&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>je(""),children:"✕"})]}),r.jsx("div",{className:"sidebar__scroll",children:te==="pinned"?r.jsxs(r.Fragment,{children:[qe.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),qe.map(T=>r.jsx("div",{className:T.id===p?"row row--active":"row",...W===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Qt(T)},children:W===T.id?r.jsx("div",{className:"row__main",children:r.jsx(Zc,{value:T.title??"",onCommit:Y=>{j(T,Y),ie(null)},onCancel:()=>ie(null)})}):r.jsxs("button",{className:"row__main",onClick:()=>{In()||C(T)},children:[r.jsx(oh,{title:T.title??"Без названия",pinned:!1,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx(Kb,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]})},T.id))]}):r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Проекты",count:K.length,open:Ze("workspaces"),onToggle:()=>st("workspaces")}),Ze("workspaces")&&r.jsxs(r.Fragment,{children:[K.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока ни одного"})}),K.map(T=>r.jsx("div",{className:Qb(T.id===m,Ut.selected.includes(T.id)),...kn(T),children:r.jsxs("button",{className:"row__main",onClick:Y=>{In()||Ut.click(Y,T,()=>x(T.id))},children:[r.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),r.jsx("span",{className:"row__meta",title:T.path,children:T.path})]})},T.id))]}),m&&r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Сессии",count:oe.length,open:Ze("sessions"),onToggle:()=>st("sessions")}),Ze("sessions")&&r.jsxs(r.Fragment,{children:[oe.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока ни одной"})}),oe.map(T=>r.jsx("div",{className:Qb(T.id===p,Le.selected.includes(T.id)),...W===T.id?{}:_n(T),children:W===T.id?r.jsx("div",{className:"row__main",children:r.jsx(Zc,{value:T.title??"",onCommit:Y=>{j(T,Y),ie(null)},onCancel:()=>ie(null)})}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"row__main",onClick:Y=>{In()||Le.click(Y,T,()=>y(T))},children:[r.jsx(oh,{title:T.title??"Без названия",pinned:T.pinned===!0,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx(Kb,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),r.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{In()||ie(T.id)},children:"✎"})]})},T.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(uh,{title:"Архив",count:he.length,open:Ze("archive"),onToggle:()=>st("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Ze("archive")&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),he.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:w?"Ничего не найдено":"Пока пусто"})}),he.map(T=>r.jsxs("div",{className:T.id===p?"row row--active":"row",children:[r.jsxs("button",{className:"row__main",onClick:()=>y(T),children:[r.jsx(oh,{title:T.title??"Без названия",pinned:!1,projectName:Ne(T.workspaceId),projectPath:Ae(T.workspaceId)}),r.jsx("span",{className:"row__meta",children:J1(T)})]}),r.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>H([T.id]),children:"Вернуть"})]},T.id))]})]})]})]})}),r.jsxs("div",{className:"sidebar__foot",children:[r.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:X,children:[r.jsx("span",{className:E!=null&&E.loggedIn?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:E===null?"Аккаунт":E.loggedIn?E.email||"Вход выполнен":"Войти в аккаунт"}),(E==null?void 0:E.plan)&&r.jsx("span",{className:"chip",children:E.plan})]}),D&&r.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:D,children:[r.jsx("span",{className:O!=null&&O.connected?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:O===null?"Удалённый доступ":O.paired?O.connected?O.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(O==null?void 0:O.connected)&&O.clients>0&&r.jsx("span",{className:"chip",children:O.clients})]}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!I,title:"MCP-серверы и плагины",onClick:()=>I==null?void 0:I(),children:"Расширения"}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:F,children:"Настройки"}),r.jsx("button",{className:"btn btn--ghost",onClick:$,children:"+ Проект"}),r.jsx("button",{className:"btn btn--primary",onClick:M,disabled:!m,children:"+ Сессия"})]}),dt&&r.jsx(Lo,{x:dt.x,y:dt.y,items:wn,note:Ht,onClose:Xt}),Ie&&r.jsx(Lo,{x:Ie.x,y:Ie.y,items:ue,note:we,onClose:ct}),ht&&r.jsx(Lo,{x:ht.x,y:ht.y,items:bt,note:Xb,onClose:jn})]})}function Qb(a,l){const i=["row"];return a&&i.push("row--active"),l&&i.push("row--selected"),i.join(" ")}function $b(a){const[l,i]=_.useState([]),c=_.useRef(null);function o(){i([]),c.current=null}function d(m,p,x){if(m.ctrlKey||m.metaKey){i(y=>y.includes(p.id)?y.filter(j=>j!==p.id):[...y,p.id]),c.current=p.id;return}if(m.shiftKey&&c.current){const y=a.findIndex(v=>v.id===c.current),j=a.findIndex(v=>v.id===p.id);if(y!==-1&&j!==-1){const[v,C]=y<j?[y,j]:[j,y];i(a.slice(v,C+1).map(N=>N.id));return}}o(),c.current=p.id,x()}function h(m){return l.includes(m.id)?l:(i([m.id]),c.current=m.id,[m.id])}return{selected:l,click:d,targetsFor:h,clear:o}}function uh({title:a,count:l,open:i,onToggle:c,hint:o}){const d=i?`Свернуть «${a}»`:`Развернуть «${a}»`;return r.jsxs("button",{className:"sidebar__section sidebar__section--btn","aria-expanded":i,title:o?`${d} — ${o}`:d,onClick:c,children:[r.jsx(G1,{open:i}),r.jsx("span",{className:"sidebar__section-name",children:a}),r.jsx("span",{className:"sidebar__count",children:l})]})}function G1({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function ay({className:a}){return r.jsxs("svg",{className:a,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),r.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),r.jsx("path",{d:"M8 12.2v1.4"})]})}function I1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Y1(){try{const a=localStorage.getItem(ny);if(a===null)return["archive"];const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>i==="workspaces"||i==="sessions"||i==="archive"):["archive"]}catch{return["archive"]}}function V1(){try{return localStorage.getItem(ly)==="pinned"?"pinned":"default"}catch{return"default"}}const Zb={system:"как в системе",light:"светлая",dark:"тёмная"};function X1({mode:a}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return a==="dark"?r.jsx("svg",{...l,children:r.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"})}):a==="light"?r.jsxs("svg",{...l,children:[r.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),r.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"})]}):r.jsxs("svg",{...l,children:[r.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),r.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Q1(a){switch(a.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return $1(a.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function $1(a){switch(a){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Z1(a){switch(a.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return K1(a.lastTurn);case"error":return"error";case"closed":return"closed"}}function K1(a){switch(a){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Kb({session:a,tail:l}){return r.jsxs("span",{className:"row__meta",children:[r.jsxs("span",{className:`row__state row__state--${Z1(a)}`,children:[r.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),Q1(a)]})," · ",l]})}function oh({title:a,pinned:l,projectName:i,projectPath:c}){return r.jsxs("span",{className:"row__head",children:[r.jsxs("span",{className:"row__title",children:[l&&r.jsx(ay,{className:"row__pin"}),a]}),r.jsx("span",{className:"row__project",title:c,children:i})]})}function J1(a){const l=a.archivedAuto?"сама, по сроку молчания":"убрана вручную";return a.archivedAt?`${new Date(a.archivedAt).toLocaleString()} · ${l}`:l}const Jb=3,F1=15e5;function sy(a,l){if(!l||typeof l!="object")return null;const i=l,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(a==="Write"){if(typeof i.content!="string")return null;const o=fh(i.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(a==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=tS(W1(fh(i.old_string),fh(i.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:i.replace_all===!0?"все вхождения":null}}return null}function fh(a){if(a==="")return[];const l=a.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function W1(a,l){let i=0;for(;i<a.length&&i<l.length&&a[i]===l[i];)i++;let c=a.length,o=l.length;for(;c>i&&o>i&&a[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...a.slice(0,i).map(d),...P1(a.slice(i,c),l.slice(i,o)),...a.slice(c).map(d)]}function P1(a,l){if(a.length===0&&l.length===0)return[];if(a.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return a.map(y=>({type:"del",text:y}));if((a.length+1)*(l.length+1)>F1)return[...a.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const i=a.length,c=l.length,o=c+1,d=new Uint32Array((i+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=i-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=a[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let p=0,x=0;for(;p<i&&x<c;){const y=a[p],j=l[x];y===j?(m.push({type:"ctx",text:y}),p++,x++):h(p+1,x)>=h(p,x+1)?(m.push({type:"del",text:y}),p++):(m.push({type:"add",text:j}),x++)}for(;p<i;)m.push({type:"del",text:a[p++]});for(;x<c;)m.push({type:"add",text:l[x++]});return eS(m)}function eS(a){const l=[];let i=[];function c(){l.push(...i.filter(o=>o.type==="del")),l.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of a)o.type==="ctx"?(c(),l.push(o)):i.push(o);return c(),l}function tS(a){if(!a.some(d=>d.type!=="ctx"))return a;const l=a.map(()=>!1);a.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Jb);m<=Math.min(a.length-1,h+Jb);m++)l[m]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${nS(c.length)} без изменений`}),c=[]}return a.forEach((d,h)=>{l[h]?(o(),i.push(d)):c.push(d)}),o(),i}function nS(a){const l=a%100;if(l>=11&&l<=14)return"строк";switch(a%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Xh(a){try{return await navigator.clipboard.writeText(a),!0}catch{}const l=document.createElement("textarea");l.value=a,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function lS(){try{return await navigator.clipboard.readText()}catch{return null}}const Qh=1600,Mi="Копировать",wr="Скопировано";function $h({text:a,hint:l,className:i}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Qh);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[a]),r.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?wr:`${Mi} ${l}`,title:c?wr:`${Mi} ${l}`,onClick:()=>{Xh(a).then(d=>{d&&o(!0)})},children:c?wr:Mi})}function Zh({diff:a}){return r.jsxs("div",{className:"diff",children:[r.jsxs("div",{className:"diff__head",children:[r.jsx("span",{className:"diff__path",title:a.filePath,children:a.filePath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]})]}),a.note&&r.jsx("div",{className:"diff__note",children:a.note}),r.jsx("div",{className:"diff__body",children:a.rows.length===0?r.jsx("div",{className:"diff__row diff__row--gap",children:r.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):a.rows.map((l,i)=>r.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[r.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),r.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},i))})]})}function aS({waiting:a}){const[l,i]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>i(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),r.jsxs("div",{className:a?"work work--wait":"work",children:[r.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:a?"ждёт разрешения":"думает"}),!a&&r.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Kh({items:a,busy:l,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,empty:p="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!0),v=_.useRef(null),C=_.useRef(null),N=_.useRef(!1);_.useEffect(()=>{j.current=!0,v.current=null,N.current=!1,C.current!==null&&(clearTimeout(C.current),C.current=null)},[m]),_.useEffect(()=>{const $=x.current,M=y.current;if(!$||!M)return;function I(O){!$||O===$.scrollTop||(N.current=!0,$.scrollTop=O)}function E(){if(!$)return;const O=v.current;if(O){const D=Wb($,O.id);if(D){const F=D.getBoundingClientRect().top-$.getBoundingClientRect().top;I($.scrollTop+(F-O.top))}C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{v.current=null},500);return}j.current&&I($.scrollHeight)}const X=new ResizeObserver(E);return X.observe(M),()=>{X.disconnect(),C.current!==null&&clearTimeout(C.current)}},[]);function L(){const $=x.current;if($){if(N.current){N.current=!1;return}j.current=$.scrollHeight-$.scrollTop-$.clientHeight<80}}function H(){if(d)return;const $=x.current,M=c[0];if($&&M){const I=Wb($,M.id);I&&(v.current={id:M.id,top:I.getBoundingClientRect().top-$.getBoundingClientRect().top})}h==null||h()}return r.jsx("div",{className:"transcript",ref:x,onScroll:L,children:r.jsxs("div",{className:"stream",ref:y,children:[o&&r.jsx("button",{type:"button",className:"transcript__more",onClick:H,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map($=>r.jsx(Fb,{item:$},$.id)),c.length>0&&a.length>0&&r.jsx("div",{className:"transcript__divider",children:r.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&a.length===0&&r.jsx("p",{className:"empty",children:p}),a.map($=>r.jsx(Fb,{item:$},$.id)),l&&r.jsx(aS,{waiting:i})]})})}function Fb({item:a}){switch(a.kind){case"user":return r.jsx("div",{className:"msg--user","data-item-id":a.id,children:a.text});case"assistant":return r.jsxs("div",{className:"msg--assistant","data-item-id":a.id,children:[r.jsx(sS,{text:a.text}),a.streaming&&r.jsx("span",{className:"caret"}),a.text.trim()!==""&&r.jsx("div",{className:"msg--assistant__foot",children:r.jsx($h,{text:a.text,hint:"ответ целиком"})})]});case"thinking":return r.jsx("div",{className:"thinking","data-item-id":a.id,children:a.text});case"tool":return r.jsx(rS,{item:a});case"result":return r.jsxs("div",{className:"result-line","data-item-id":a.id,children:[r.jsx("span",{children:a.isError?"✗ "+a.subtype:"✓ готово"}),r.jsxs("span",{children:[(a.durationMs/1e3).toFixed(1)," с"]}),a.costUsd!==null&&r.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),r.jsxs("span",{children:["↑",ex(a.inputTokens)," ↓",ex(a.outputTokens)]})]});case"notice":return r.jsx("div",{className:a.tone==="error"?"notice notice--error":"notice","data-item-id":a.id,children:a.text})}}function Wb(a,l){const i=a.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===l)return c;return null}function sS({text:a}){const[l,i]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return ey(a).then(h=>{d||i(iS(h))}),()=>{d=!0}},[a]),_.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var p,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(p=h.parentElement)==null?void 0:p.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&Xh(m).then(y=>{if(!y)return;h.textContent=wr,h.setAttribute("aria-label",wr),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Mi,h.setAttribute("aria-label",Ah),h.classList.remove("copybtn--done"))},Qh);c.current.push(j)})}return r.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Ah=`${Mi} блок кода`;function iS(a){if(!a.includes("<pre"))return a;const l=new DOMParser().parseFromString(a,"text/html");for(const i of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Ah),o.title=Ah,o.textContent=Mi,c.append(o)}return l.body.innerHTML}function rS({item:a}){const[l,i]=_.useState(!1),c=a.result===null,o=sy(a.name,a.input),d=a.name==="AskUserQuestion"?oS(a.input):null;return r.jsxs("div",{className:"tool"+(a.isError?" tool--error":"")+(a.awaitingPermission?" tool--wait":""),"data-item-id":a.id,children:[r.jsxs("button",{className:"tool__head",onClick:()=>i(h=>!h),children:[r.jsx("span",{className:"tool__name",children:a.name}),r.jsx("span",{className:"tool__arg",children:d?uS(d):cS(a.input)}),r.jsx("span",{className:"tool__status",children:c?"…":a.isError?"ошибка":l?"▴":"▾"})]}),l&&r.jsxs("div",{className:"tool__body",children:[d?r.jsx(fS,{questions:d,answers:a.answers}):o?r.jsx(Zh,{diff:o}):r.jsx(Pb,{text:JSON.stringify(a.input,null,2),hint:"аргументы вызова"}),a.result!==null&&(!d||a.isError)&&r.jsx(Pb,{text:a.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Pb({text:a,hint:l,style:i}){return r.jsxs("div",{className:"codeblock",style:i,children:[r.jsx("pre",{className:"code",children:a}),r.jsx($h,{text:a,hint:l,className:"codeblock__copy"})]})}function cS(a){if(!a||typeof a!="object")return"";const l=a;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=l[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function uS(a){var i;const l=a.map(c=>c.header).filter(c=>c.length>0);return l.length===a.length?l.join(" · "):((i=a[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function oS(a){if(typeof a!="object"||a===null)return null;const l=a.questions;if(!Array.isArray(l)||l.length===0)return null;const i=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const p=[];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;p.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}i.push({question:o,header:typeof d=="string"?d:"",options:p,multiSelect:m===!0})}return i}function fS({questions:a,answers:l}){return r.jsx("div",{className:"tool__questions",children:a.map((i,c)=>r.jsxs("div",{className:"tool__question",children:[r.jsxs("div",{className:"tool__question-head",children:[i.header&&r.jsx("span",{className:"chip chip--accent",children:i.header}),r.jsx("span",{className:"tool__question-text",children:i.question})]}),r.jsx("div",{className:"tool__question-answer",children:l!=null&&l[i.question]?r.jsx("span",{className:"tool__answer-value",children:l[i.question]}):r.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function ex(a){return a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const dS="ccv.dictation.lang",tx="ru-RU";function hS(a){try{return Function.prototype.toString.call(a).includes("[native code]")}catch{return!1}}function nx(){const a=window,l=[a.SpeechRecognition,a.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=l.find(hS);return!i&&l.length>0&&Ql("распознавание подменено: родной реализации в странице нет"),i??l[0]??null}function iy(){var a;try{return((a=localStorage.getItem(dS))==null?void 0:a.trim())||tx}catch{return tx}}function Ql(a,l){l===void 0?console.debug(`[dictation] ${a}`):console.debug(`[dictation] ${a}`,l)}const pS=3,mS=400,gS=5,bS=250,xS=2e3,yS=2e4;async function _S(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const vS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${iy()}`};function SS(a){const[l]=_.useState(()=>nx()!==null),[i,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),m=_.useRef(!1),p=_.useRef(!1),x=_.useRef(a),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),C=_.useRef(null),N=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),L=_.useCallback(()=>{N();const E=async X=>{if(C.current=null,!(!m.current||v.current)){if(!X&&!await _S()){if(Ql("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void E(!0),yS);return}Ql("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void E(!1),xS)},[N]);_.useEffect(()=>{x.current=a}),_.useEffect(()=>{const E=nx();if(!E)return;const X=new E;return X.lang=iy(),X.continuous=!0,X.interimResults=!0,X.onstart=()=>{Ql("сессия открыта"),v.current=!0,N(),c(!0)},X.onaudiostart=()=>{Ql("пошёл звук с микрофона"),y.current.audio=!0},X.onresult=O=>{var de;if(p.current)return;let D="",F="";for(let W=O.resultIndex;W<O.results.length;W++){const ie=O.results[W];if(!ie)continue;const me=((de=ie[0])==null?void 0:de.transcript)??"";ie.isFinal?D+=me:F+=me}const re=y.current;re.heard=!0,re.everHeard=!0,Ql("распознано",{final:D,interim:F}),x.current(D,F)},X.onerror=O=>{y.current.lastError=O.error,Ql("ошибка движка",O.error),!(O.error==="no-speech"||O.error==="aborted")&&(m.current=!1,c(!1),d(vS[O.error]??`Распознавание не работает: ${O.error}`))},X.onend=()=>{p.current=!1,v.current=!1;const O=y.current,D=Date.now()-O.openedAt;if(Ql("сессия закрыта",{мс:D,звук:O.audio,слова:O.heard,ошибка:O.lastError||null}),!m.current){c(!1);return}if(O.dead=!O.audio&&D<mS?O.dead+1:0,O.dead>=gS){m.current=!1,c(!1),d(O.lastError?`Распознавание не работает: ${O.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}O.silent=O.heard?0:O.silent+1,!O.everHeard&&!O.warned&&O.silent>=pS&&(O.warned=!0,d(O.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){O.openedAt=Date.now(),O.audio=!1,O.heard=!1,O.lastError="",L();try{X.start()}catch{}}},bS)},h.current=X,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,N(),X.onend=null,X.onresult=null,X.onerror=null,X.onstart=null,X.onaudiostart=null,X.abort(),h.current=null}},[]);const H=_.useCallback(()=>{var E;if(m.current){if(m.current=!1,Ql("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,N(),!v.current){c(!1);return}(E=h.current)==null||E.stop()}},[]),$=_.useCallback(()=>{const E=h.current;if(E){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,p.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),Ql("включение микрофона",{язык:E.lang}),L();try{E.start()}catch(X){Ql("start() не прошёл",X)}}},[L]),M=_.useCallback(()=>{m.current?H():$()},[$,H]),I=_.useCallback(()=>{var E;m.current&&v.current&&(p.current=!0,(E=h.current)==null||E.abort())},[]);return{supported:l,listening:i,error:o,toggle:M,stop:H,drop:I}}const ry="ccv:drafts",jS=40,kS=2e4,NS=500;let Yc=null,Vc=null;function cy(){if(Yc)return Yc;const a=new Map;try{const l=localStorage.getItem(ry);if(l){const i=JSON.parse(l);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&a.set(c,o)}}catch{}return Yc=a,window.addEventListener("pagehide",uy),a}function dh(a){return cy().get(a)??""}function wS(a,l){const i=cy(),c=l.slice(0,kS),o=i.has(a);if(o&&i.delete(a),c!=="")i.set(a,c);else if(!o)return;for(;i.size>jS;){const d=i.keys().next();if(d.done)break;i.delete(d.value)}TS()}function TS(){Vc===null&&(Vc=window.setTimeout(uy,NS))}function uy(){if(Vc!==null&&window.clearTimeout(Vc),Vc=null,!!Yc)try{localStorage.setItem(ry,JSON.stringify(Object.fromEntries(Yc)))}catch{}}const ES="(max-width: 860px)",lx=/^\/(\S*)$/,AS=new Set(["model","permissions"]);function CS(a){return AS.has(a.name)||a.name.startsWith("__")}const RS=new Set(["clear","rename"]),ax=/(?:^|\s)@([^\s@]*)$/,MS=200,OS=100,DS=190;function oy({disabled:a,busy:l,commands:i,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:p="Отправить",autoFocus:x=!1,onContextSearch:y,onCommand:j,onSend:v,onInterrupt:C,onEscape:N}){var Wt;const L=Mh(ES),[H,$]=_.useState(()=>m?dh(m):""),[M,I]=_.useState(!1),[E,X]=_.useState(0),O=_.useRef(null),D=_.useRef(null),F=_.useRef(null),[re,de]=_.useState(()=>m?dh(m).length:0),[W,ie]=_.useState([]),[me,je]=_.useState(-1),ge=_.useRef(""),[z,te]=_.useState(""),P=SS(_.useCallback((Z,ue)=>{Z&&$(we=>hh(we,Z)),te(ue.trim())},[])),ae=z?hh(H,z):H;_.useEffect(()=>{P.listening||z===""||($(Z=>hh(Z,z)),te(""))},[P.listening,z]),_.useEffect(()=>{var Z;x&&((Z=O.current)==null||Z.focus())},[x]);const xe=_.useRef(new Map),w=_.useRef(new Map),K=_.useRef(m),oe=_.useRef({text:H,caret:re});oe.current={text:H,caret:re};const he=_.useCallback((Z,ue,we)=>{ue===""?(xe.current.delete(Z),w.current.delete(Z)):(xe.current.set(Z,ue),w.current.set(Z,we)),wS(Z,ue)},[]),Ne=P.drop;_.useLayoutEffect(()=>{const Z=K.current;if(Z===m)return;K.current=m,Z&&he(Z,oe.current.text,oe.current.caret);const ue=m?xe.current.get(m)??dh(m):"",we=m?w.current.get(m):void 0,Ce=Math.min(we??ue.length,ue.length);$(ue),de(Ce),F.current=[Ce,Ce],te(""),X(0),I(!1),je(-1),ge.current="",Ne()},[m,he,Ne]),_.useEffect(()=>{m&&he(m,H,re)},[m,H,re,he]);const Ae=a?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",qe=_.useRef(0),st=_.useCallback(Z=>{const ue=parseFloat(getComputedStyle(Z).maxHeight),we=Number.isFinite(ue)&&ue>0?ue:DS;Z.style.height="auto";const Ce=Z.scrollHeight;Z.style.height=`${Math.min(Ce,we)}px`,Z.style.overflowY=Ce>we?"auto":"hidden";const bt=F.current;bt&&(F.current=null,Z.setSelectionRange(bt[0],bt[1]))},[]);_.useEffect(()=>{const Z=O.current;Z&&st(Z)},[ae,Ae,a,st]),_.useEffect(()=>{const Z=O.current;if(!Z)return;const ue=new ResizeObserver(([we])=>{const Ce=we==null?void 0:we.contentRect.width;Ce===void 0||Math.abs(Ce-qe.current)<1||(qe.current=Ce,st(Z))});return ue.observe(Z),()=>ue.disconnect()},[st]);const Ze=P.stop;_.useEffect(()=>{a&&Ze()},[a,Ze]);const Ut=_.useMemo(()=>P.error?{ok:!1,message:P.error}:null,[P.error]),Le=_.useMemo(()=>{var we;const Z=(we=lx.exec(H))==null?void 0:we[1];if(Z===void 0)return[];const ue=Z.toLowerCase();return i.filter(Ce=>!CS(Ce)&&ph(Ce,ue)<fy).sort((Ce,bt)=>ph(Ce,ue)-ph(bt,ue))},[H,i]),dt=!M&&Le.length>0,Ke=Math.min(E,Le.length-1),Ie=M?null:((Wt=ax.exec(ae.slice(0,re)))==null?void 0:Wt[1])??null,Fe=_.useRef(y);Fe.current=y,_.useEffect(()=>{if(Ie===null||Ie===""||Ie.endsWith("/")){Fe.current(Ie);return}const Z=setTimeout(()=>Fe.current(Ie),MS);return()=>clearTimeout(Z)},[Ie]);const ht=Ie!==null&&(o==null?void 0:o.query)===Ie,It=ht?o.entries:[],vt=Ie!==null,Gn=vt&&!ht,Jt=Math.min(E,Math.max(It.length-1,0));_.useEffect(()=>{var ue,we;if(!dt&&!vt)return;const Z=dt?Ke:Jt;(we=(ue=D.current)==null?void 0:ue.children[Z])==null||we.scrollIntoView({block:"nearest"})},[dt,vt,Ke,Jt]);function Ft(Z,ue){var we;$(Z),de(ue),F.current=[ue,ue],X(0),I(!1),z!==""&&(te(""),P.drop()),(we=O.current)==null||we.focus()}function In(){$(""),te(""),X(0),de(0),I(!1),je(-1),ge.current="",P.drop(),m&&he(m,"",0)}function Xt(Z){const ue=Z.trim();!ue||a||(v(ue),ie(we=>[ue,...we.filter(Ce=>Ce!==ue)].slice(0,OS)),In())}function ct(Z){if(Z<-1||Z>=W.length)return;me===-1&&(ge.current=H);const ue=Z===-1?ge.current:W[Z]??"";je(Z),Ft(ue,ue.length)}function jn(){var Ce;const Z=((Ce=O.current)==null?void 0:Ce.selectionStart)??ae.length,we=`${Z>0&&!/\s$/.test(ae.slice(0,Z))?" ":""}@`;Ft(ae.slice(0,Z)+we+ae.slice(Z),Z+we.length)}function kn(Z){var bt;const ue=(bt=ax.exec(ae.slice(0,re)))==null?void 0:bt[1];if(ue===void 0)return;const we=re-ue.length-1,Ce=Z.kind==="dir"?`@${Z.path}/`:`@${Z.path} `;Ft(ae.slice(0,we)+Ce+ae.slice(re),we+Ce.length)}function _n(){var ue;const Z=(ue=lx.exec(ae.trim()))==null?void 0:ue[1];if(Z&&j(Z)){In();return}Xt(ae)}function Qt(Z,ue){$(Z),de(ue),X(0),I(!1),je(-1),z!==""&&(te(""),P.drop())}function Nn(Z){var Ce;const ue=RS.has(Z.name)?c:null,we=`/${Z.name} `;$(we+(ue??"")),de(we.length+((ue==null?void 0:ue.length)??0)),ue&&(F.current=[we.length,we.length+ue.length]),X(0),(Ce=O.current)==null||Ce.focus()}function wn(Z){if(j(Z.name)){$(""),X(0),I(!1);return}Z.argumentHint?Nn(Z):Xt(`/${Z.name}`)}function Ht(Z){if(dt){if(Z.key==="ArrowDown")return Z.preventDefault(),X(ue=>(Math.min(ue,Le.length-1)+1)%Le.length);if(Z.key==="ArrowUp"){Z.preventDefault();const ue=Le.length-1;return X(we=>(Math.min(we,ue)+ue)%Le.length)}if(Z.key==="Enter"&&!Z.shiftKey){Z.preventDefault();const ue=Le[Ke];ue&&wn(ue);return}if(Z.key==="Tab"){Z.preventDefault();const ue=Le[Ke];ue&&Nn(ue);return}if(Z.key==="Escape"){Z.preventDefault(),Z.stopPropagation(),I(!0);return}}if(vt){if(Z.key==="ArrowDown"&&It.length>0)return Z.preventDefault(),X(ue=>(Math.min(ue,It.length-1)+1)%It.length);if(Z.key==="ArrowUp"&&It.length>0){Z.preventDefault();const ue=It.length-1;return X(we=>(Math.min(we,ue)+ue)%It.length)}if(Z.key==="Enter"&&!Z.shiftKey||Z.key==="Tab"){const ue=It[Jt];if(ue){Z.preventDefault(),kn(ue);return}if(Z.key==="Tab")return}if(Z.key==="Escape"){Z.preventDefault(),Z.stopPropagation(),I(!0);return}}if((Z.key==="ArrowUp"||Z.key==="ArrowDown")&&!Z.shiftKey){const ue=Z.currentTarget,we=ue.selectionStart;if(ue.selectionEnd===we){const Ce=Z.key==="ArrowUp",bt=Ce?!ae.slice(0,we).includes(`
118
+ `):!ae.slice(we).includes(`
119
+ `),T=Ce?me+1:me-1;if(bt&&T>=-1&&T<W.length){Z.preventDefault(),ct(T);return}}}if(Z.key==="Escape"&&N){Z.preventDefault(),Z.stopPropagation(),N();return}Z.key==="Enter"&&!Z.shiftKey&&!L&&(Z.preventDefault(),_n())}return r.jsx("div",{className:d?`composer ${d}`:"composer",children:r.jsxs("div",{className:"composer__inner",children:[r.jsx(zi,{result:Ut}),vt&&!dt&&r.jsxs("div",{className:"cmdmenu",role:"listbox",ref:D,children:[It.map((Z,ue)=>r.jsxs("button",{role:"option","aria-selected":ue===Jt,className:ue===Jt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>X(ue),onMouseDown:we=>{we.preventDefault(),kn(Z)},children:[r.jsxs("span",{className:"cmdmenu__name",children:[Z.name,Z.kind==="dir"?"/":""]}),r.jsx("span",{className:"cmdmenu__desc",children:Z.path}),Z.ignored&&r.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},Z.path)),It.length===0&&r.jsx("div",{className:"cmdmenu__empty",children:Gn?"ищем…":Ie?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),dt&&r.jsx("div",{className:"cmdmenu",role:"listbox",ref:D,children:Le.map((Z,ue)=>r.jsxs("button",{role:"option","aria-selected":ue===Ke,className:ue===Ke?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>X(ue),onMouseDown:we=>{we.preventDefault(),wn(Z)},children:[r.jsxs("span",{className:"cmdmenu__name",children:["/",Z.name]}),Z.argumentHint&&r.jsx("span",{className:"cmdmenu__hint",children:Z.argumentHint}),r.jsx("span",{className:"cmdmenu__desc",children:Z.description})]},Z.name))}),r.jsxs("div",{className:"composer__field",children:[r.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:a,onClick:jn,children:r.jsx(US,{})}),r.jsx("textarea",{ref:O,value:ae,disabled:a,placeholder:Ae,onChange:Z=>Qt(Z.target.value,Z.target.selectionStart),onSelect:Z=>de(Z.currentTarget.selectionStart),onKeyDown:Ht}),P.supported&&r.jsx("button",{type:"button",className:P.listening?"micbtn is-on":"micbtn",title:P.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":P.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":P.listening,disabled:a,onClick:P.toggle,children:r.jsx(BS,{on:P.listening})}),l?r.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):r.jsxs("button",{className:"btn btn--primary sendbtn",onClick:_n,disabled:a||ae.trim()==="","aria-label":p,title:p,children:[r.jsx("span",{className:"sendbtn__label",children:p}),r.jsx(HS,{})]})]})]})})}function hh(a,l){const i=l.trim();if(i==="")return a;const c=Ch(i).slice(zS(a,i)).join(" ");return c===""?a:a===""||/\s$/.test(a)?a+c:`${a} ${c}`}function zS(a,l){const i=Ch(a),c=Ch(l);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((d,h)=>LS(d,c[h]??"")))return o;return 0}function Ch(a){return a.split(/\s+/).filter(l=>l!=="")}function LS(a,l){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(a)===i(l)}function US(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function HS(){return r.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:r.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function BS({on:a}){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:a?"currentColor":"none"}),r.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),r.jsx("path",{d:"M8 12.8v1.5"})]})}const fy=4;function ph(a,l){const i=a.name.toLowerCase();return i===l?0:i.startsWith(l)?1:a.aliases.some(c=>c.toLowerCase().startsWith(l))?2:i.includes(l)?3:fy}function qS({request:a,queued:l,onDecide:i}){const c=sy(a.toolName,a.input);return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[r.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),r.jsxs("div",{className:"sheet__body",children:[r.jsx("div",{className:"sheet__tool",children:a.toolName}),a.reason&&r.jsx("p",{className:"sheet__reason",children:a.reason}),c?r.jsx(Zh,{diff:c}):r.jsx("pre",{className:"code",children:JSON.stringify(a.input,null,2)})]}),r.jsxs("div",{className:"sheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>i(a.requestId,"deny"),children:"Отклонить"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>i(a.requestId,"allow"),children:"Разрешить"})]})]})})}function GS({request:a,queued:l,onAnswer:i,onDecline:c}){const{questions:o}=a,[d,h]=_.useState(()=>o.map(()=>new Set)),[m,p]=_.useState(()=>o.map(()=>"")),[x,y]=_.useState(()=>sx(o));_.useEffect(()=>{h(o.map(()=>new Set)),p(o.map(()=>"")),y(sx(o))},[a.requestId]);const j=_.useMemo(()=>YS(o,d,m),[o,d,m]),v=j!==null;function C(I,E){var X,O;(O=(X=o[I])==null?void 0:X.options[E])!=null&&O.preview&&y(D=>{const F=D.slice();return F[I]=E,F})}function N(I,E,X){h(O=>{const D=O.slice(),F=new Set(D[I]);return X?F.has(E)?F.delete(E):F.add(E):F.has(E)||(F.clear(),F.add(E)),D[I]=F,D}),E!=="other"&&C(I,E)}function L(I,E){p(X=>{const O=X.slice();return O[I]=E,O})}function H(){j&&i(a.requestId,j)}function $(I){I.key==="Enter"&&(I.target.closest("button")||v&&(I.preventDefault(),H()))}function M(I){var D;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(I.key))return;const E=Array.from(I.currentTarget.querySelectorAll("button.qsheet__option")),X=E.indexOf(document.activeElement);if(X===-1)return;I.preventDefault();const O=I.key==="ArrowDown"||I.key==="ArrowRight"?1:-1;(D=E[(X+O+E.length)%E.length])==null||D.focus()}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:$,children:[r.jsxs("div",{className:"qsheet__head",children:[r.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),r.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),r.jsxs("div",{className:"qsheet__body",children:[a.reason&&r.jsx("p",{className:"qsheet__reason",children:a.reason}),o.map((I,E)=>r.jsx(IS,{q:I,qi:E,selected:d[E]??new Set,otherText:m[E]??"",previewIndex:x[E]??null,onToggle:N,onFocusOption:C,onOtherText:L,onOptionsKeyDown:M},E))]}),r.jsxs("div",{className:"qsheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>c(a.requestId),children:"Не отвечать"}),r.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:H,children:"Ответить"})]})]})})}function IS({q:a,qi:l,selected:i,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:p}){var C;const x=a.options.some(N=>N.preview),y=o!==null?(C=a.options[o])==null?void 0:C.preview:void 0,j=i.has("other"),v=a.multiSelect?"checkbox":"radio";return r.jsxs("div",{className:"qsheet__question",children:[r.jsxs("div",{className:"qsheet__qhead",children:[r.jsx("span",{className:"chip chip--accent",children:a.header}),r.jsx("span",{className:"qsheet__qtext",children:a.question})]}),r.jsxs("div",{className:"qsheet__options"+(a.multiSelect?"":" qsheet__options--radio"),role:a.multiSelect?"group":"radiogroup","aria-label":a.question,onKeyDown:p,children:[a.options.map((N,L)=>{const H=i.has(L);return r.jsxs("button",{type:"button",role:v,"aria-checked":H,className:"qsheet__option"+(H?" is-selected":""),onClick:()=>d(l,L,a.multiSelect),onFocus:()=>h(l,L),onMouseEnter:()=>h(l,L),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:N.label}),r.jsx("span",{className:"qsheet__opt-desc",children:N.description})]})]},L)}),r.jsxs("div",{className:"qsheet__other",children:[r.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",a.multiSelect),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),r.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&r.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${a.question}»`,value:c,onChange:N=>m(l,N.target.value),autoFocus:!0})]})]}),x&&r.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function sx(a){return a.map(l=>{const i=l.options.findIndex(c=>c.preview);return i===-1?null:i})}function YS(a,l,i){const c={};for(let o=0;o<a.length;o++){const d=a[o];if(!d)continue;const h=l[o]??new Set,m=[];for(let p=0;p<d.options.length;p++){const x=d.options[p];x&&h.has(p)&&m.push(x.label)}if(h.has("other")){const p=(i[o]??"").trim();p&&m.push(p)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function dy({path:a}){const[l,i]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!l)return;function m(p){var x;(x=d.current)!=null&&x.contains(p.target)||i(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[l]),_.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),Qh);return()=>clearTimeout(m)},[c]),_.useEffect(()=>i(!1),[a]);async function h(){await Xh(a)&&o(!0)}return r.jsxs("div",{ref:d,className:"cwd",children:[r.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${a}`,onClick:()=>i(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!l||(m.preventDefault(),m.stopPropagation(),i(!1))},children:[r.jsx(VS,{open:l}),r.jsx("span",{className:"cwd__short",children:a})]}),l&&r.jsxs("div",{className:"cwd__pop",children:[r.jsx("span",{className:"cwd__full",children:a}),r.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?wr:Mi})]})]})}function VS({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function es({value:a,options:l,onChange:i,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,p]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),C=l.find(H=>H.value===a)??null;_.useEffect(()=>{if(!m)return;const H=l.findIndex($=>$.value===a);y(H===-1?0:H)},[m]),_.useEffect(()=>{if(!m)return;function H($){var M;(M=j.current)!=null&&M.contains($.target)||p(!1)}return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[m]),_.useEffect(()=>{var H,$;m&&(($=(H=v.current)==null?void 0:H.querySelector(".is-cursor"))==null||$.scrollIntoView({block:"nearest"}))},[m,x]),_.useEffect(()=>{if(!m)return;const H=v.current,$=XS(j.current);if(!H||!$)return;const M=H.getBoundingClientRect().bottom-$.getBoundingClientRect().bottom;M>0&&($.scrollTop+=Math.min(M+8,H.offsetHeight))},[m]);function N(H){p(!1),H.value!==a&&i(H.value)}function L(H){if(H.key==="Escape"){if(!m)return;H.preventDefault(),H.stopPropagation(),p(!1);return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){if(H.preventDefault(),!m)return p(!0);const $=H.key==="ArrowDown"?1:l.length-1;return y(M=>(M+$)%l.length)}if(H.key==="Enter"||H.key===" "){if(H.preventDefault(),!m)return p(!0);const $=l[x];$&&N($)}}return r.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>p(H=>!H),onKeyDown:L,children:[r.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),r.jsx(QS,{})]}),m&&r.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((H,$)=>r.jsxs("button",{type:"button",role:"option","aria-selected":H.value===a,className:"select__option"+($===x?" is-cursor":"")+(H.value===a?" is-on":""),onMouseEnter:()=>y($),onClick:()=>N(H),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:H.value===a?"✓":""}),r.jsx("span",{className:"select__label",children:H.label}),H.hint&&r.jsx("span",{className:"select__hint",children:H.hint})]},H.value))})]})}function XS(a){let l=(a==null?void 0:a.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function QS(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const $S=["low","medium","high"];function hy({models:a,value:l,effort:i,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:m,onEffort:p,onUltracode:x,onThinking:y,onSwitchOnFlag:j}){const[v,C]=_.useState(!1),[N,L]=_.useState(0),H=_.useRef(null),$=_.useRef(null),M=a.find(D=>D.value===l)??null,I=M&&M.supportsEffort?M.effortLevels.length>0?M.effortLevels:$S:[],E=I.includes("xhigh");_.useEffect(()=>{if(!v)return;const D=a.findIndex(F=>F.value===l);L(D===-1?0:D)},[v]),_.useEffect(()=>{if(!v)return;function D(F){var re;(re=H.current)!=null&&re.contains(F.target)||C(!1)}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),_.useEffect(()=>{var D,F;v&&((F=(D=$.current)==null?void 0:D.querySelector(".is-cursor"))==null||F.scrollIntoView({block:"nearest"}))},[v,N]);function X(D){C(!1),D.value!==l&&m(D.value)}function O(D){if(D.key==="Escape"){if(!v)return;D.preventDefault(),D.stopPropagation(),C(!1);return}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(D.preventDefault(),!v)return C(!0);if(a.length===0)return;const F=D.key==="ArrowDown"?1:a.length-1;return L(re=>(re+F)%a.length)}if(D.key==="Enter"||D.key===" "){if(D.preventDefault(),!v)return C(!0);const F=a[N];F&&X(F)}}return r.jsxs("div",{ref:H,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>C(D=>!D),onKeyDown:O,children:[r.jsx("span",{className:"select__value",children:(M==null?void 0:M.displayName)??l??"—"}),c?r.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):I.length>0&&i&&r.jsx("span",{className:"select__suffix",children:i}),r.jsx(ZS,{})]}),v&&r.jsxs("div",{ref:$,className:"select__menu modelmenu",role:"menu",children:[r.jsx("div",{className:"modelmenu__head",children:"Модель"}),a.map((D,F)=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":D.value===l,className:"select__option"+(F===N?" is-cursor":"")+(D.value===l?" is-on":""),onMouseEnter:()=>L(F),onClick:()=>X(D),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:D.value===l?"✓":""}),r.jsx("span",{className:"select__label",children:D.displayName}),D.description&&r.jsx("span",{className:"select__hint",children:D.description})]},D.value)),I.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"modelmenu__sep",role:"separator"}),r.jsxs("div",{className:"modelmenu__row",children:[r.jsxs("span",{className:"modelmenu__label",children:["Усилие",r.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),r.jsx("span",{className:"modelmenu__levels",children:I.map(D=>r.jsx("button",{type:"button",role:"menuitemradio","aria-checked":D===i,className:D===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>p(D),children:D},D))})]}),E&&r.jsx(mh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),r.jsx("div",{className:"modelmenu__sep",role:"separator"}),(M==null?void 0:M.supportsThinking)!==!1&&r.jsx(mh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>y(!o)}),r.jsx(mh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function mh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[r.jsxs("span",{className:"modelmenu__label",children:[a,r.jsx("span",{className:"modelmenu__desc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function ZS(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function wl({title:a,children:l,actions:i,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.useEffect(()=>{function m(p){if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),d();return}if(p.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||(p.shiftKey&&document.activeElement===j?(p.preventDefault(),v.focus()):!p.shiftKey&&document.activeElement===v&&(p.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),r.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:r.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":a,children:[r.jsxs("div",{className:"modal__head",children:[r.jsx("h2",{className:"modal__title",children:a}),r.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),r.jsx("div",{className:"modal__body",children:l}),i&&r.jsx("div",{className:"modal__actions",children:i})]})})}function KS({candidates:a,searching:l,agentItems:i,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:p,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[C,N]=_.useState("open"),[L,H]=_.useState(""),[$,M]=_.useState(!1),[I,E]=_.useState(""),[X,O]=_.useState(""),[D,F]=_.useState({git:!0,claudeMd:!0,readme:!0}),re=L.trim(),de=re!=="",W=I.trim(),ie=X.trim(),me=W!==""&&ie!=="";_.useEffect(()=>{I===""&&d.length>0&&E(d[0])},[d]);const je=_.useRef(m);je.current=m,_.useEffect(()=>{if(C!=="open")return;const P=L.trim(),ae=setTimeout(()=>je.current(P),200);return()=>clearTimeout(ae)},[L,C]);function ge(){de&&y(re)}function z(){me&&j(W,ie,D)}function te(){de&&(M(!0),p(re))}return h?r.jsxs(wl,{title:"Новый проект",onClose:v,actions:r.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[r.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),r.jsx("p",{className:"newproj__preview",children:h.path}),r.jsx("div",{className:"modal__error",children:r.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(P=>r.jsx("li",{children:P},P))})}),r.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):r.jsxs(wl,{title:"Новый проект",className:$&&C==="open"?"modal--wide":void 0,onClose:v,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?r.jsxs(r.Fragment,{children:[c?r.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):r.jsx("button",{className:"btn",disabled:!de,onClick:te,title:"Найти по описанию",children:"Попросить агента"}),r.jsx("button",{className:"btn btn--primary",disabled:!de,onClick:ge,children:"Открыть"})]}):r.jsx("button",{className:"btn btn--primary",disabled:!me,onClick:z,children:"Создать"})]}),children:[r.jsxs("div",{className:"tabs",children:[r.jsx(ix,{label:"Открыть",on:C==="open",onClick:()=>N("open")}),r.jsx(ix,{label:"Создать",on:C==="create",onClick:()=>N("create")})]}),C==="open"?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),r.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),r.jsx("input",{id:"workspace-path",className:"input input--mono",value:L,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:P=>H(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),ge())}}),o&&r.jsx("p",{className:"modal__error",children:o}),a.length>0&&r.jsx("ul",{className:"finds",children:a.map(P=>r.jsx("li",{children:r.jsxs("button",{className:"find",disabled:P.open,title:P.open?"Этот проект уже открыт":P.path,onClick:()=>H(P.path),onDoubleClick:()=>y(P.path),children:[r.jsx("span",{className:"find__name",children:P.name}),r.jsx("span",{className:"find__path",children:P.path}),r.jsx("span",{className:"find__note",children:WS(P)})]})},P.path))}),a.length===0&&de&&!l&&!$&&r.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&r.jsx("div",{className:"finds__agent",children:r.jsx(Kh,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),r.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),r.jsx("input",{id:"workspace-parent",className:"input input--mono",value:I,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:P=>E(P.target.value)}),d.length>0&&r.jsx("div",{className:"newproj__roots",children:d.map(P=>r.jsx("button",{type:"button",className:P===W?"newproj__root is-on":"newproj__root",title:P,onClick:()=>E(P),children:FS(P)},P))}),r.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),r.jsx("input",{id:"workspace-name",className:"input input--mono",value:X,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:P=>O(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),z())}}),r.jsx("p",{className:"newproj__preview",children:me?JS(W,ie):"Каталог появится здесь"}),o&&r.jsx("p",{className:"modal__error",children:o}),r.jsxs("div",{className:"newproj__opts",children:[r.jsx(gh,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>F(P=>({...P,git:!P.git}))}),r.jsx(gh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>F(P=>({...P,claudeMd:!P.claudeMd}))}),r.jsx(gh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>F(P=>({...P,readme:!P.readme}))})]})]})]})}function ix({label:a,on:l,onClick:i}){return r.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:i,children:a})}function gh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[r.jsxs("span",{className:"newproj__optlabel",children:[a,r.jsx("span",{className:"newproj__optdesc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function JS(a,l){const i=a.includes("\\")?"\\":"/";return a.replace(/[\\/]+$/,"")+i+l}function FS(a){const l=a.includes("\\")?"\\":"/",i=a.split(/[\\/]/).filter(Boolean);return i.length<=2?a:`…${l}${i.slice(-2).join(l)}`}function WS(a){return a.open?"уже открыт":a.why?a.why:a.sessions===0?"рядом с вашими проектами":`${PS(a.sessions)}${ej(a.lastUsedAt)}`}function PS(a){const l=a%10,i=a%100;return i>=11&&i<=14?`${a} сессий`:l===1?`${a} сессия`:l>=2&&l<=4?`${a} сессии`:`${a} сессий`}function ej(a){if(!a)return"";const l=Math.floor((Date.now()-a)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(a).toLocaleDateString("ru-RU")}`}const Jh=7;function tj(a){const l=[],i=[];let c=1;for(const o of a){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=rx(l),l[h]=o.hash);const[m,...p]=o.parents;l[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of p){let C=l.indexOf(v);C===-1&&(C=rx(l),l[C]=v),x.push({from:h,to:C})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const C=d[v];!C||C===o.hash||v===h||l[v]===C&&j.push(v)}nj(l),c=Math.max(c,l.length,h+1),i.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:i,columns:Math.min(c,Jh)}}function rx(a){const l=a.indexOf(null);return l!==-1?l:(a.push(null),a.length-1)}function nj(a){for(;a.length>0&&a[a.length-1]===null;)a.pop()}const py=1500;function lj(a){const l=[];let i=!1;for(const c of a.patch.split(`
120
+ `)){if(l.length>=py){i=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:aj(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:a.path||a.oldPath,rows:l,added:a.added,removed:a.removed,note:sj(a,i)}}function aj(a){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(a);if(!l)return a;const i=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function sj(a,l){const i=[];return a.status==="added"&&i.push("новый файл"),a.status==="deleted"&&i.push("файл удалён"),a.status==="renamed"&&i.push(`переименован из ${a.oldPath}`),a.binary?i.push("двоичный файл"):a.patch===""&&i.push("содержимое не показано"),l&&i.push(`показаны первые ${py} строк`),i.length>0?i.join(" · "):null}function ij({open:a,state:l,result:i,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:p,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:C,zoomed:N,onToggleZoom:L}){const H=tj((l==null?void 0:l.commits)??[]),$=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(M=>({value:M.name,label:M.name,hint:M.hash.slice(0,8)}))];return r.jsxs("aside",{className:(a?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(N?" sidepane--zoomed":""),"aria-label":"История git",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:M=>{L&&(M.target.closest("button")||L())},children:[r.jsx(fj,{}),r.jsx("span",{className:"sidepane__title",children:"История"}),r.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),L&&r.jsx("button",{className:"sidepane__btn",title:N?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":N?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":N,onClick:L,children:r.jsx(Ur,{active:N})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,children:"✕"})]}),l===null?r.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"gitbar",children:r.jsx(es,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:$,onChange:M=>{M&&m(M,`ветку ${M}`)}})}),l.detached&&r.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),r.jsx("div",{className:"gitbar__actions",children:o?r.jsxs("p",{className:"gitbar__busy",children:[r.jsx(mj,{}),o]}):l.hasRemote?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:p,children:[r.jsx(dj,{}),"Отправить",l.ahead>0&&r.jsx("span",{className:"gitbar__count",children:l.ahead})]}),r.jsxs("div",{className:"gitbar__group",children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[r.jsx(hj,{}),"Забрать",l.behind>0&&r.jsx("span",{className:"gitbar__count",children:l.behind})]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:r.jsx(pj,{})})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[r.jsx(ux,{}),"Опубликовать на GitHub"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),r.jsxs("div",{className:"sidepane__scroll",children:[r.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:r.jsxs("span",{className:"gitrow__body",children:[r.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${xj(l.changed.length)}`:"Рабочее дерево чистое"}),r.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(M=>bj(M.path)).join(", "):"незакоммиченных изменений нет"})]})}),H.rows.map(M=>r.jsx(rj,{row:M,columns:H.columns,head:M.commit.hash===l.head,local:l.hasRemote&&!M.commit.pushed,active:c===M.commit.hash,onOpen:()=>h(M.commit.hash)},M.commit.hash)),H.rows.length===0&&r.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):r.jsxs("div",{className:"gitempty",children:[r.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[r.jsx(ux,{}),"Опубликовать на GitHub"]}),r.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),r.jsx(zi,{result:i,onDismiss:v})]})}const Bc=50,cx=13;function rj({row:a,columns:l,head:i,local:c,active:o,onOpen:d}){const{commit:h}=a,m=h.refs.map(gj).filter(Boolean);return r.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[r.jsx(cj,{row:a,columns:l,head:i,local:c}),r.jsxs("span",{className:"gitrow__body",children:[r.jsxs("span",{className:"gitrow__subject",children:[m.map(p=>r.jsx("span",{className:"gitrow__ref",children:p},p)),h.subject]}),r.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",yj(h.date),c&&r.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function cj({row:a,columns:l,head:i,local:c}){const o=l*cx+6,d=Bc/2,h=x=>8+Math.min(x,Jh-1)*cx,m=c?"3.5 2.5":void 0,p=Eo(a.col);return r.jsxs("svg",{className:"gitgraph",width:o,height:Bc,viewBox:`0 0 ${o} ${Bc}`,"aria-hidden":"true",children:[a.through.map(x=>r.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Bc,style:{stroke:Eo(x)}},`t${x}`)),a.up.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Eo(x.from),strokeDasharray:m}},`u${y}`)),a.down.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Bc}`,fill:"none",style:{stroke:Eo(x.to),strokeDasharray:m}},`d${y}`)),i&&r.jsx("circle",{className:"gitgraph__head",cx:h(a.col),cy:d,r:a.commit.parents.length>1?7.4:6.6}),r.jsx("circle",{className:"gitgraph__dot",cx:h(a.col),cy:d,r:a.commit.parents.length>1?4.6:3.6,style:{stroke:p,fill:c?void 0:p}})]})}function Eo(a){return`var(--lane-${a%Jh})`}function uj({detail:a,local:l,onCheckout:i,onClose:c}){const o=a.hash==="";return r.jsxs(wl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${a.shortHash}`,onClose:c,actions:r.jsxs(r.Fragment,{children:[!o&&r.jsx("button",{className:"btn",onClick:()=>i(a.hash,`коммит ${a.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),r.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&r.jsxs("div",{className:"commit__head",children:[r.jsx("p",{className:"commit__subject",children:a.subject}),r.jsxs("p",{className:"commit__meta",children:[a.author,a.email&&` <${a.email}>`," · ",_j(a.date)," ·"," ",r.jsx("span",{className:"commit__hash",children:a.hash})]}),l&&r.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),a.parents.length>0&&r.jsxs("p",{className:"commit__meta",children:[a.parents.length>1?"слияние: ":"родитель: ",a.parents.map(d=>d.slice(0,8)).join(", ")]}),a.body&&r.jsx("pre",{className:"commit__body",children:a.body})]}),a.truncated&&r.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),a.files.length===0?r.jsx("p",{className:"modal__text",children:"Изменений нет."}):a.files.map(d=>r.jsx(oj,{file:d,defaultOpen:a.files.length<=3},d.path+d.oldPath))]})}function oj({file:a,defaultOpen:l}){const[i,c]=_.useState(l);return r.jsxs("div",{className:"commit__file",children:[r.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[r.jsx("span",{className:"commit__filepath",children:a.path||a.oldPath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]}),r.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&r.jsx(Zh,{diff:lj(a)})]})}function fj(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function dj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function hj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function pj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4"}),r.jsx("path",{d:"m13 13-2.6-2.6"})]})}function ux(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r.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 mj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function gj(a){return a.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function bj(a){const l=a.split("/");return l[l.length-1]??a}function xj(a){const l=a%100;if(l>=11&&l<=14)return"файлов";switch(a%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function yj(a){const l=Date.parse(a);if(Number.isNaN(l))return a;const i=Math.round((Date.now()-l)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function _j(a){const l=Date.parse(a);return Number.isNaN(l)?a:new Date(l).toLocaleString()}function ox(a){return a.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function vj({status:a,owners:l,files:i,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:p,onPublish:x,onDismissResult:y,onClose:j}){var P;const[v,C]=_.useState(()=>ox(c)),[N,L]=_.useState(""),[H,$]=_.useState(""),[M,I]=_.useState(!0),[E,X]=_.useState("Первый коммит"),[O,D]=_.useState(null),[F,re]=_.useState("");_.useEffect(()=>{!N&&l.length>0&&L(l[0].login)},[N,l]),_.useEffect(()=>{i&&O===null&&D(new Set(i.files))},[i,O]);const de=(a==null?void 0:a.connected)===!0,W=l.map(ae=>({value:ae.login,label:ae.login,hint:ae.kind==="org"?"организация":void 0})),ie=_.useMemo(()=>{if(!i)return[];const ae=F.trim().toLowerCase();return ae?i.files.filter(xe=>xe.toLowerCase().includes(ae)):i.files},[i,F]),me=(O==null?void 0:O.size)??0,je=de&&v.trim()!==""&&N!==""&&d===""&&(o||me>0);function ge(ae){D(xe=>{const w=new Set(xe??[]);return w.has(ae)?w.delete(ae):w.add(ae),w})}function z(ae){D(xe=>{const w=new Set(xe??[]);for(const K of ie)ae?w.add(K):w.delete(K);return w})}function te(){if(!je)return;const ae=(i==null?void 0:i.files)??[];x({owner:N,name:v.trim(),description:H.trim(),private:M,include:o?[]:ae.filter(xe=>O==null?void 0:O.has(xe)),ignore:o?[]:ae.filter(xe=>!(O!=null&&O.has(xe))),message:o?"":E.trim()||"Первый коммит"})}return r.jsxs(wl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!je,onClick:te,children:d||"Опубликовать"})]}),children:[r.jsx(Sj,{status:a,onRefreshStatus:m,onSaveToken:p}),r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Имя"}),r.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:ae=>C(ox(ae.target.value))})]}),v.trim()===""&&r.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Владелец"}),l.length>1?r.jsx(es,{className:"settings__select",value:N,options:W,onChange:L,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):r.jsx("p",{className:"publish__static",children:((P=l[0])==null?void 0:P.login)??"—"})]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Описание (необязательно)"}),r.jsx("input",{className:"input",value:H,placeholder:"о чём проект — одной строкой",onChange:ae=>$(ae.target.value)})]}),r.jsxs("div",{className:"field publish__field",children:[r.jsx("span",{children:"Видимость"}),r.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[r.jsx(fx,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:M,onClick:()=>I(!0)}),r.jsx(fx,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!M,onClick:()=>I(!1)})]})]})]}),!o&&r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?r.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"publish__filehead",children:[r.jsxs("span",{className:"publish__filecount",children:[me," из ",i.files.length," файлов"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>z(!0),children:"Отметить все"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>z(!1),children:"Снять все"})]}),i.files.length>8&&r.jsx("input",{className:"input publish__filter",value:F,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:ae=>re(ae.target.value)}),r.jsx("div",{className:"publish__filelist",children:ie.length===0?r.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ie.map(ae=>r.jsxs("button",{type:"button",role:"checkbox","aria-checked":(O==null?void 0:O.has(ae))===!0,className:"publish__file",onClick:()=>ge(ae),children:[r.jsx("span",{className:"publish__box"+(O!=null&&O.has(ae)?" is-on":""),"aria-hidden":"true",children:(O==null?void 0:O.has(ae))&&"✓"}),r.jsx("span",{className:"publish__filepath",children:ae})]},ae))}),i.truncated&&r.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Сообщение коммита"}),r.jsx("input",{className:"input",value:E,onChange:ae=>X(ae.target.value)})]})]})]}),r.jsx(zi,{result:h,onDismiss:y})]})}function fx({title:a,desc:l,on:i,risky:c,onClick:o}){return r.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[a,c&&r.jsx("span",{className:"access__risk",children:"видно всем"})]}),r.jsx("span",{className:"access__desc",children:l})]})]})}function Sj({status:a,onRefreshStatus:l,onSaveToken:i}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return r.jsxs("div",{className:"publish__section publish__section--first",children:[r.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),a===null?r.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):a.connected?r.jsxs("div",{className:"publish__account",children:[r.jsx("span",{className:"chip chip--ok",children:a.login}),r.jsx("span",{className:"publish__accountvia",children:a.source==="gh"?"через GitHub CLI":"по личному токену"}),a.source==="token"&&r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):r.jsxs("div",{className:"publish__connect",children:[a.ghInstalled&&r.jsxs("p",{className:"modal__text",children:["В системе установлен ",r.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",r.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Личный токен GitHub"}),r.jsx(jj,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),r.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",r.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",r.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),a.message&&r.jsx("p",{className:"modal__error",children:a.message}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function jj({value:a,onChange:l,visible:i,onToggleVisible:c,placeholder:o,autoFocus:d}){return r.jsxs("div",{className:"pwfield",children:[r.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:a,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),r.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?r.jsx(Nj,{}):r.jsx(kj,{})})]})}function kj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Nj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),r.jsx("path",{d:"M2 14 14 2"})]})}function wj({busy:a,result:l,onSubmit:i,onDismissResult:c,onClose:o}){const[d,h]=_.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return r.jsxs(wl,{title:"Подключить существующий репозиторий",onClose:o,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||a!=="",onClick:()=>i(d.trim()),children:a||"Подключить"})]}),children:[r.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",r.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Адрес репозитория"}),r.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:p=>h(p.target.value),onKeyDown:p=>{p.key==="Enter"&&m&&a===""&&i(d.trim())}})]}),r.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",r.jsx("code",{children:"https://…"}),", ",r.jsx("code",{children:"ssh://…"}),", ",r.jsx("code",{children:"git://…"})," и"," ",r.jsx("code",{children:"git@host:path"}),"."]}),r.jsx(zi,{result:l,onDismiss:c})]})}function Tj({open:a,items:l,busy:i,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:p,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:N,onModel:L,onEffort:H,onUltracode:$,onThinking:M,onSwitchOnFlag:I,onAsk:E,onInterrupt:X,onReset:O,onClose:D,zoomed:F,onToggleZoom:re}){return r.jsxs("aside",{className:(a?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(F?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:de=>{re&&(de.target.closest("button")||re())},children:[r.jsx(Ej,{}),r.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),r.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:O,children:"↻"}),re&&r.jsx("button",{className:"sidepane__btn",title:F?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":F?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":F,onClick:re,children:r.jsx(Ur,{active:F})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),m.length>0&&r.jsxs("div",{className:"sidepane__tools",children:[r.jsx(hy,{className:"select--compact",models:m,value:p,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:L,onEffort:H,onUltracode:$,onThinking:M,onSwitchOnFlag:I}),r.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),r.jsx(Kh,{items:l,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),r.jsx(oy,{className:"composer--side",disabled:!c,busy:i,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:a,onContextSearch:C,onCommand:N,onSend:E,onInterrupt:X,onEscape:i?X:D})]})}function Ej(){return r.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:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const Aj=75,Cj=90;function my({usage:a}){if(!(a!=null&&a.available))return null;const l=[];return a.fiveHour&&l.push({key:"five",label:"5 ч",window:a.fiveHour}),a.sevenDay&&l.push({key:"week",label:"нед",window:a.sevenDay}),l.length===0?null:r.jsx("div",{className:"usage",title:Oj(a),"aria-label":`Расход лимитов плана${a.plan?` ${a.plan}`:""}`,children:l.map(i=>r.jsx(Rj,{label:i.label,window:i.window},i.key))})}function Rj({label:a,window:l}){const i=Math.round(l.utilization),c=Dj(l.resetsAt);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"usage__label",children:a}),r.jsx("span",{className:"usage__track",role:"progressbar","aria-label":a,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`usage__fill${Mj(i)}`,style:{width:`${i}%`}})}),r.jsxs("span",{className:"usage__pct",children:[i,"%"]}),r.jsx("span",{className:"usage__reset",title:xy(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Mj(a){return a>=Cj?" usage__fill--over":a>=Aj?" usage__fill--warn":""}function Oj(a){const l=[a.plan?`Лимиты плана ${a.plan}`:"Лимиты плана"],i=(c,o)=>{if(!o)return;const d=xy(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return i("5 часов",a.fiveHour),i("Неделя",a.sevenDay),i("Неделя, Opus",a.sevenDayOpus),l.join(`
121
+ `)}function gy(a){if(!a)return null;const l=new Date(a);return Number.isNaN(l.getTime())?null:l}function by(a){return a.getTime()-Date.now()<1440*60*1e3}function Dj(a){const l=gy(a);return l?by(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function xy(a){const l=gy(a);return l?`обнулится ${by(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function yy(){const[a,l]=_.useState(()=>new Date);return _.useEffect(()=>{let i=0;const c=()=>{const d=new Date;l(d),i=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(i),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(i),document.removeEventListener("visibilitychange",o)}},[]),r.jsxs("time",{className:"clock",dateTime:a.toISOString(),title:zj(a),children:[r.jsx("span",{className:"clock__time",children:a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:"clock__date",children:a.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function zj(a){return a.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Lj({onClose:a,permission:l,model:i,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:p,onRename:x}){return r.jsx(wl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:a,children:r.jsxs("div",{className:"sessionmenu",children:[l&&r.jsx(vr,{label:"Режим прав",children:l}),r.jsx(vr,{label:"Модель",children:i}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&r.jsx(vr,{label:"Лимиты плана",children:r.jsx(my,{usage:c})}),r.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[r.jsx(Uj,{}),r.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",p&&r.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(p).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),r.jsx(vr,{label:"Время",children:r.jsx(yy,{})}),d&&r.jsx(vr,{label:"Стоимость хода",children:r.jsx("span",{className:"badge badge--cost",children:d})}),o&&r.jsx(vr,{label:"Каталог проекта",children:r.jsx(dy,{path:o})}),x&&r.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"})]})})}function vr({label:a,children:l}){return r.jsxs("div",{className:"sessionmenu__row",children:[r.jsx("span",{className:"sessionmenu__label",children:a}),l]})}function Uj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Hj({tab:a,servers:l,plugins:i,marketplaces:c,catalog:o,result:d,actions:h,onTab:m,onClose:p}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return r.jsxs(wl,{title:"Расширения",className:"modal--wide",onClose:p,children:[r.jsx("div",{className:"tabs",role:"tablist",children:x.map(y=>r.jsxs("button",{role:"tab","aria-selected":a===y.id,className:a===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>m(y.id),children:[y.label,r.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),a==="mcp"&&r.jsx(Bj,{servers:l,actions:h}),a==="plugins"&&r.jsx(Vj,{plugins:i,marketplaces:c,actions:h}),a==="catalog"&&r.jsx(Xj,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>m("plugins")}),r.jsx(zi,{result:d})]})}function Bj({servers:a,actions:l}){const[i,c]=_.useState(!1);return r.jsxs(r.Fragment,{children:[a.length===0&&!i&&r.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",r.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",r.jsx("code",{children:"claude mcp list"}),"."]}),r.jsx("ul",{className:"extlist",children:a.map(o=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:o.name}),r.jsx("span",{className:`chip chip--${Gj(o.status)}`,children:qj[o.status]}),o.scope&&r.jsx("span",{className:"chip",children:o.scope}),o.transport&&r.jsx("span",{className:"chip",children:o.transport})]}),o.target&&r.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&r.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&r.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),i?r.jsx(Ij,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const qj={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Gj(a){return a==="connected"?"ok":a==="failed"?"bad":a==="needs-auth"?"warn":"mute"}function Ij({onSubmit:a,onCancel:l}){const[i,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,m]=_.useState(""),[p,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",C=i.trim()!==""&&(v?h.trim()!=="":p.trim()!=="");function N(){if(C)if(v){const[L,...H]=Yj(h);a(i.trim(),{transport:"stdio",command:L??"",args:H,env:dx(y)})}else a(i.trim(),{transport:o,url:p.trim(),headers:dx(y)})}return r.jsxs("div",{className:"extform extform--card",children:[r.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),r.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:L=>c(L.target.value)}),r.jsx("label",{className:"field",children:"Транспорт"}),r.jsx(es,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:L=>d(L)}),v?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),r.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:L=>m(L.target.value)})]}):r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),r.jsx("input",{id:"mcp-url",className:"input input--mono",value:p,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:L=>x(L.target.value)})]}),r.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),r.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:L=>j(L.target.value)}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),r.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:N,children:"Подключить"})]})]})}function dx(a){const l={};for(const i of a.split(`
122
+ `)){const c=i.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function Yj(a){return(a.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function Vj({plugins:a,marketplaces:l,actions:i}){const[c,o]=_.useState("");return r.jsxs(r.Fragment,{children:[a.length===0&&r.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),r.jsx("ul",{className:"extlist",children:a.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:d.name}),r.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&r.jsx("span",{className:"chip",children:d.version}),d.scope&&r.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&r.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&r.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),r.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),r.jsx("ul",{className:"extlist",children:l.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsx("div",{className:"extlist__head",children:r.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&r.jsx("div",{className:"extlist__meta",children:d.source}),r.jsx("div",{className:"extlist__actions",children:r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),r.jsxs("div",{className:"extform__row",children:[r.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(),i.marketplaceAdd(c.trim()),o(""))}}),r.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const qc=30;function Xj({catalog:a,hasMarketplaces:l,actions:i,onMarketplaces:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[p,x]=_.useState(qc),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(a.map(L=>L.category).filter(Boolean))].sort(),[a]),C=_.useMemo(()=>{const N=o.trim().toLowerCase();return a.filter(L=>h&&L.category!==h?!1:N?`${L.name} ${L.displayName} ${L.description} ${L.author}`.toLowerCase().includes(N):!0)},[a,o,h]);return a.length===0?r.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",r.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"catalog__filters",children:[r.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:N=>{d(N.target.value),x(qc)}}),r.jsx(es,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(N=>({value:N,label:N}))],onChange:N=>{m(N),x(qc)}})]}),C.length===0?r.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):r.jsx("ul",{className:"extlist",children:C.slice(0,p).map(N=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:N.name}),N.installed&&r.jsx("span",{className:"chip chip--ok",children:"установлен"}),N.version&&r.jsx("span",{className:"chip",children:N.version}),N.category&&r.jsx("span",{className:"chip",children:N.category})]}),N.description&&r.jsx("div",{className:"catalog__desc",children:N.description}),r.jsxs("div",{className:"extlist__meta",children:[N.author&&`${N.author} · `,N.marketplace]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",disabled:N.installed,onClick:()=>i.pluginInstall(N.id),children:N.installed?"Уже стоит":"Установить"}),N.homepage&&r.jsx("a",{className:"btn btn--ghost btn--sm",href:N.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},N.id))}),C.length>p&&r.jsx("div",{className:"extbar",children:r.jsxs("button",{className:"btn",onClick:()=>x(N=>N+qc),children:["Ещё ",Math.min(qc,C.length-p)," из ",C.length-p]})}),r.jsxs("div",{className:"extform",children:[r.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),r.jsxs("div",{className:"extform__row",children:[r.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:N=>j(N.target.value),onKeyDown:N=>{N.key!=="Enter"||y.trim()===""||(N.preventDefault(),i.pluginInstall(y.trim()),j(""))}}),r.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{i.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function Qj({status:a,login:l,actions:i,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:p}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[C,N]=_.useState(!1),L=d!==null&&(a==null?void 0:a.loggedIn)===!0&&!C&&!j,H=_.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const I=l.output.trim();return I===""?null:{ok:!0,message:I}},[l.error,l.output]);function $(I=x){const E=I.trim();E!==""&&(i.submitCode(E),y(""))}function M(){if(o>0){v(!1),N(!0);return}i.login("claudeai",!0)}return r.jsxs(wl,{title:"Аккаунт",onClose:p,children:[a===null?r.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):a.loggedIn?r.jsxs("div",{className:"account",children:[r.jsx("div",{className:"account__id",children:a.email||"Вход выполнен"}),r.jsxs("div",{className:"account__chips",children:[r.jsx("span",{className:"chip chip--ok",children:Kj[a.method]??a.method}),a.plan&&r.jsx("span",{className:"chip",children:a.plan})]}),a.organization&&r.jsx("div",{className:"extlist__meta",children:a.organization})]}):r.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",r.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?r.jsx(Jj,{login:l,remote:c,code:x,onCode:y,onSubmit:$,onCancel:i.cancel}):r.jsxs(r.Fragment,{children:[r.jsx(zi,{result:H}),C&&r.jsx("p",{className:"account__warn",role:"alert",children:$j(o)}),L&&h&&r.jsx("p",{className:"account__note",children:m}),r.jsx("div",{className:`extbar${a!=null&&a.loggedIn?" account__bar":""}`,children:a!=null&&a.loggedIn?r.jsxs(r.Fragment,{children:[L&&r.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[r.jsx(Zj,{}),"Переподключить"]}),C?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>N(!1),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{N(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):r.jsx("button",{className:"btn",onClick:M,children:"Сменить аккаунт"}),j?r.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),i.logout()},children:"Точно выйти?"}):r.jsx("button",{className:"btn",onClick:()=>{N(!1),v(!0)},children:"Выйти"})]}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function $j(a){const l=a%10,i=a%100,c=l===1&&i!==11,o=c?"сессия":l>=2&&l<=4&&(i<12||i>14)?"сессии":"сессий";return`${a} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function Zj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Kj={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Jj({login:a,remote:l,code:i,onCode:c,onSubmit:o,onCancel:d}){var N;const[h,m]=_.useState(null),p=_.useRef(""),x=_.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const y=_.useCallback(async L=>{const{code:H,onCode:$,onSubmit:M}=x.current;if(L&&H.trim()!=="")return;const I=await lS();if(I===null){L||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const E=I.trim();if(!hx(E)){L||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(L){if(p.current===E)return;p.current=E}m(null),$(E),M(E)},[]);_.useEffect(()=>{if(!a.awaitingCode)return;const L=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",L),()=>document.removeEventListener("visibilitychange",L)},[a.awaitingCode,y]);const j=typeof((N=navigator.clipboard)==null?void 0:N.readText)=="function",v=i.trim()!==""&&!hx(i),C=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return r.jsxs("div",{className:"account__flow",children:[a.url?l?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),r.jsx("a",{className:"btn btn--primary account__go",href:a.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),r.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),r.jsxs("div",{className:"account__raw",children:[r.jsx("span",{className:"account__rawurl",children:a.url}),r.jsx($h,{text:a.url,hint:"ссылку входа"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),r.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),r.jsxs("details",{className:"account__fallback",children:[r.jsx("summary",{children:"Браузер не открылся"}),r.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),r.jsx("a",{className:"account__link",href:a.url,target:"_blank",rel:"noreferrer",children:a.url})]})]}):r.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),a.awaitingCode&&r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),r.jsxs("div",{className:"extform__row account__coderow",children:[r.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:L=>{m(null),c(L.target.value)},onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),o())}}),j&&r.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),C&&r.jsx("p",{className:"account__note account__note--code",children:C})]}),a.output.trim()!==""&&r.jsx("pre",{className:"account__log",children:a.output.trim()}),r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function hx(a){const l=a.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[i,c]=l.split("#");return!!i&&!!c&&!/\s/.test(l)}function Fj({state:a,onPair:l,onUnpair:i,onClose:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[p,x]=_.useState(!1),y=_.useRef(null),j=(a==null?void 0:a.paired)===!0;_.useEffect(()=>{var C;j||(C=y.current)==null||C.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,a==null?void 0:a.error]);const v=(a==null?void 0:a.url)??"https://claudevisual.com";return r.jsx(wl,{title:"Удалённый доступ",onClose:c,children:j?r.jsxs("div",{className:"relay",children:[r.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",r.jsx("b",{children:px(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),r.jsxs("dl",{className:"relay__facts",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Имя"}),r.jsx("dd",{children:(a==null?void 0:a.name)??"—"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Связь"}),r.jsxs("dd",{children:[r.jsx("span",{className:a!=null&&a.connected?"dot dot--on":"dot"})," ",a!=null&&a.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Подключено"}),r.jsxs("dd",{children:[(a==null?void 0:a.clients)??0," вкладок"]})]})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),r.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),r.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):r.jsxs("div",{className:"relay",children:[r.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),r.jsxs("ol",{className:"relay__steps",children:[r.jsxs("li",{children:["Откройте ",r.jsx("b",{children:px(v)})," и войдите (или зарегистрируйтесь)."]}),r.jsxs("li",{children:["Нажмите ",r.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),r.jsx("li",{children:"Введите его сюда."})]}),r.jsxs("form",{className:"relay__form",onSubmit:C=>{C.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Код сопряжения"}),r.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:C=>d(C.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Как назвать этот компьютер"}),r.jsx("input",{className:"input",value:h,onChange:C=>m(C.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||p,children:p?"Связываем…":"Связать"})]})]})})}function px(a){try{return new URL(a).host}catch{return a}}const bh="",Wj=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],Pj=Ax.map(a=>({value:a.value,label:a.value,hint:a.hint})),Ao=3600*1e3,ek=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],jr={"6h":6*Ao,"24h":24*Ao,"48h":48*Ao,"168h":168*Ao,never:0};function tk(a){return jr[a]??jr["48h"]}function nk(a){const l=Object.entries(jr).find(([,i])=>i===a);return l?l[0]:Object.keys(jr).reduce((i,c)=>Math.abs(jr[c]-a)<Math.abs(jr[i]-a)?c:i)}const lk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],kr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function ak(a){return kr[a]??kr.off}function sk(a){const l=Object.entries(kr).find(([,i])=>i===a);return l?l[0]:Object.keys(kr).reduce((i,c)=>Math.abs(kr[c]-a)<Math.abs(kr[i]-a)?c:i)}const ik=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function rk({settings:a,models:l,relayState:i,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:p}){const x=a===null,y=!x&&a.terminalEnabled===!0,j=!y,v=_.useMemo(()=>{const N=[{value:bh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Wj];return a&&a.startModel!==null&&!N.some(L=>L.value===a.startModel)&&N.push({value:a.startModel,label:a.startModel}),N},[l,a]);function C(){var N,L;return(i==null?void 0:i.paired)!==!0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:m,children:"Связать компьютер"})]}):(N=i.shell)!=null&&N.enabled?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",i.shell.confirmedAt&&` Включено ${new Date(i.shell.confirmedAt).toLocaleString()}.`]}),r.jsx("button",{type:"button",className:"btn btn--danger",disabled:j,onClick:h,children:"Запретить"})]}):(L=i.shell)!=null&&L.pending?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",r.jsx("b",{children:i.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),r.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Отправить письмо ещё раз"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Разрешить с телефона"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Прислать письмо"})]})]})}return r.jsx(wl,{title:"Настройки",onClose:p,children:r.jsxs("div",{className:"settings",children:[r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),r.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:nk(a.autoArchiveAfterMs),options:ek,onChange:N=>o({autoArchiveAfterMs:tk(N)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),r.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:sk(a.autoSaveAfterPauseMs),options:lk,onChange:N=>o({autoSaveAfterPauseMs:ak(N)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),r.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Модель"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startModel??bh,options:v,onChange:N=>o({startModel:N===bh?null:N}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startPermissionMode,options:Pj,onChange:N=>o({startPermissionMode:N}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),r.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),r.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:ik.map(N=>{const L=!x&&a.folderAccess===N.value;return r.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:x,className:"access__card"+(L?" is-on":"")+(N.risky?" access__card--risky":""),onClick:()=>o({folderAccess:N.value}),children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[N.title,N.risky&&r.jsx("span",{className:"access__risk",children:"самое широкое"})]}),r.jsx("span",{className:"access__desc",children:N.description})]})]},N.value)})})]}),r.jsxs("section",{className:"settings__section",children:[r.jsxs("div",{className:"settings__switch-row",children:[r.jsxs("div",{className:"settings__switch-copy",children:[r.jsx("h3",{className:"settings__heading",children:"Терминал"}),r.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?r.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):r.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:r.jsx("span",{className:"switch__knob"})})]}),r.jsxs("div",{className:"settings__nested"+(j?" is-disabled":""),children:[r.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?r.jsx("p",{className:"settings__hint",children:"Загрузка…"}):r.jsxs(r.Fragment,{children:[j&&r.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),C()]})]})]})]})})}const ck=16;function uk({pane:a,width:l,onResize:i,onReset:c}){const o=Ci[a],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-c0):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;i(Math.min(j.max,j.width+v))}function p(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(),i(l+j*ck*(o.side==="left"?1:-1)))}return r.jsx("div",{className:`pane-resizer pane-resizer--${a} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:p,onPointerCancel:p,onDoubleClick:c,onKeyDown:x,children:r.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const ok=16;function fk({height:a,onResize:l,onReset:i}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-d0;return Math.round(a+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:a,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;l(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 p(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),l(a+y*ok,o()))}return r.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":a,"aria-valuemin":Mx,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:i,onKeyDown:p,children:r.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function mx(){const a=document.documentElement,l=getComputedStyle(a),i=M=>l.getPropertyValue(M).trim(),c=i("--surface"),o=i("--text"),d=i("--text-2"),h=i("--muted"),m=i("--accent"),p=i("--accent-fg"),x=i("--select"),y=i("--danger"),j=i("--ok"),v=i("--warn"),C=i("--cm-fn"),N=i("--cm-key"),L=i("--cm-type"),H=gx(o,c,55),$=M=>gx(M,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:p,selectionBackground:x,black:H,brightBlack:h,red:y,brightRed:$(y),green:j,brightGreen:$(j),yellow:v,brightYellow:$(v),blue:C,brightBlue:$(C),magenta:N,brightMagenta:$(N),cyan:L,brightCyan:$(L),white:d,brightWhite:o}}function dk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ma=null;function hk(a){return ma||(ma=document.createElement("span"),ma.style.position="fixed",ma.style.width="0",ma.style.height="0",ma.style.opacity="0",ma.style.pointerEvents="none",document.body.appendChild(ma)),ma.style.color=a,getComputedStyle(ma).color}function gx(a,l,i){return hk(`color-mix(in srgb, ${a} ${100-i}%, ${l} ${i}%)`)}let Co=null;function pk(){return Co||(Co=Promise.all([Xe(()=>import("./xterm-D6Mng-DB.js").then(a=>a.x),__vite__mapDeps([22,23]),import.meta.url),Xe(()=>import("./addon-fit-CevVMrUA.js").then(a=>a.a),__vite__mapDeps([24,23]),import.meta.url),Xe(()=>import("./addon-web-links-CnB65OV_.js").then(a=>a.a),__vite__mapDeps([25,23]),import.meta.url),Xe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([a,l,i])=>({Terminal:a.Terminal,FitAddon:l.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(a=>{throw Co=null,a})),Co}function mk({terminals:a,activeId:l,blocked:i,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:p,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:C,onResize:N,onAttach:L,onHide:H,registerSink:$}){const[M,I]=_.useState(()=>mx());return _.useEffect(()=>{const E=new MutationObserver(()=>I(mx()));return E.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>E.disconnect()},[]),r.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&p?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:p?void 0:{height:d},children:[r.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:E=>{x&&(E.target.closest("button")||x())},children:[r.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:a.map(E=>r.jsxs("div",{role:"tab","aria-selected":E.id===l,className:"termtab"+(E.id===l?" is-on":"")+(E.exitCode!==null?" termtab--exited":""),onDoubleClick:X=>{x&&(X.target.closest(".termtab__close")||x())},children:[r.jsx("button",{className:"termtab__name",title:E.cwd,onClick:()=>y(E.id),children:E.title}),E.exitCode!==null&&r.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${E.exitCode}`,children:E.exitCode}),r.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${E.title}»`,onClick:()=>v(E.id),children:"✕"})]},E.id))}),r.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:j,children:"+"}),r.jsx("div",{className:"termpanel__spacer"}),x&&r.jsx("button",{className:"termpanel__zoom",title:p?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":p?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":p,onClick:x,children:r.jsx(Ur,{active:p})}),r.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:H,children:"✕"})]}),c&&a.length>0&&r.jsx(bx,{message:c,strip:!0,onRetry:null,onDismiss:o}),r.jsxs("div",{className:"termpanel__body",children:[c&&a.length===0?r.jsx(bx,{message:c,onRetry:i?null:j,onDismiss:o}):i?r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминал с удалённых устройств выключен"}),r.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):a.length===0&&r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминалов не открыто"}),r.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),a.map(E=>r.jsx(bk,{id:E.id,exitCode:E.exitCode,active:E.id===l,theme:M,mobile:m,onInput:C,onResize:N,onAttach:L,registerSink:$},E.id))]})]})}function bx({message:a,strip:l=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:d,details:h}=gk(a);return r.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[r.jsxs("div",{className:"termfail__text",children:[r.jsx("p",{className:"termfail__lede",children:o}),d&&r.jsx("p",{className:"termfail__hint",children:d}),h&&r.jsxs("details",{className:"termfail__details",children:[r.jsx("summary",{children:"Подробности"}),r.jsx("pre",{children:h})]})]}),r.jsxs("div",{className:"termfail__bar",children:[i&&r.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),r.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function gk(a){const[l="",...i]=a.trim().split(`
124
124
 
125
125
  `),c=l.split(`
126
126
  `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??a.trim(),hint:c.slice(1).join(" "),details:i.join(`
127
127
 
128
- `).trim()}}function bk({id:a,exitCode:l,active:i,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:m}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const C=_.useRef(c),N=_.useRef(l),[D,B]=_.useState("loading"),[q,z]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let E=!1,H=null;B("loading"),z(!1);const U=window.setTimeout(()=>{E||z(!0)},200);return(async()=>{let M;try{M=await pk()}catch{window.clearTimeout(U),E||B("error");return}if(E||!x.current)return;window.clearTimeout(U);const{Terminal:P,FitAddon:ie,WebLinksAddon:de}=M,W=new P({fontFamily:dk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),se=new ie;W.loadAddon(se),W.loadAddon(new de),W.open(x.current),y.current=W,W.attachCustomKeyEventHandler(oe=>{if(oe.type!=="keydown"||!(oe.ctrlKey||oe.metaKey))return!0;if(oe.key==="`")return!1;if(oe.key==="c"||oe.key==="C"){const w=W.getSelection();return w?(navigator.clipboard.writeText(w),!1):!oe.shiftKey}return oe.shiftKey&&(oe.key==="v"||oe.key==="V")?(navigator.clipboard.readText().then(w=>{w&&W.paste(w)}),!1):!0});const ge=W.onData(oe=>d(a,oe));let je={cols:W.cols,rows:W.rows},me=null;const O=W.onResize(({cols:oe,rows:xe})=>{me!==null&&window.clearTimeout(me),me=window.setTimeout(()=>{me=null,!(oe===je.cols&&xe===je.rows)&&(je={cols:oe,rows:xe},h(a,oe,xe))},100)}),te=new ResizeObserver(()=>{try{se.fit()}catch{return}v.current&&W.scrollToBottom()});te.observe(x.current);const Y=m(a,oe=>{oe.kind==="buffer"&&W.reset(),W.write(oe.data)});p(a),N.current!==null&&!j.current&&(j.current=!0,W.write(`\r
128
+ `).trim()}}function bk({id:a,exitCode:l,active:i,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:p}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const C=_.useRef(c),N=_.useRef(l),[L,H]=_.useState("loading"),[$,M]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let E=!1,X=null;H("loading"),M(!1);const O=window.setTimeout(()=>{E||M(!0)},200);return(async()=>{let D;try{D=await pk()}catch{window.clearTimeout(O),E||H("error");return}if(E||!x.current)return;window.clearTimeout(O);const{Terminal:F,FitAddon:re,WebLinksAddon:de}=D,W=new F({fontFamily:dk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ie=new re;W.loadAddon(ie),W.loadAddon(new de),W.open(x.current),y.current=W,W.attachCustomKeyEventHandler(ae=>{if(ae.type!=="keydown"||!(ae.ctrlKey||ae.metaKey))return!0;if(ae.key==="`")return!1;if(ae.key==="c"||ae.key==="C"){const w=W.getSelection();return w?(navigator.clipboard.writeText(w),!1):!ae.shiftKey}return ae.shiftKey&&(ae.key==="v"||ae.key==="V")?(navigator.clipboard.readText().then(w=>{w&&W.paste(w)}),!1):!0});const me=W.onData(ae=>d(a,ae));let je={cols:W.cols,rows:W.rows},ge=null;const z=W.onResize(({cols:ae,rows:xe})=>{ge!==null&&window.clearTimeout(ge),ge=window.setTimeout(()=>{ge=null,!(ae===je.cols&&xe===je.rows)&&(je={cols:ae,rows:xe},h(a,ae,xe))},100)}),te=new ResizeObserver(()=>{try{ie.fit()}catch{return}v.current&&W.scrollToBottom()});te.observe(x.current);const P=p(a,ae=>{ae.kind==="buffer"&&W.reset(),W.write(ae.data)});m(a),N.current!==null&&!j.current&&(j.current=!0,W.write(`\r
129
129
  \x1B[2m— Процесс завершён (код ${N.current}) —\x1B[0m\r
130
- `)),i&&W.focus(),H=()=>{me!==null&&window.clearTimeout(me),te.disconnect(),ge.dispose(),O.dispose(),Y(),W.dispose(),y.current=null},B("ready")})(),()=>{E=!0,window.clearTimeout(U),H==null||H(),H=null}},[a]),_.useEffect(()=>{if(!o)return;const X=x.current;if(!X)return;let E=null,H=0,U=!1;const M=W=>{W.pointerType==="mouse"||E!==null||(E=W.pointerId,H=W.clientY,U=!1)},P=W=>{if(W.pointerId!==E)return;const se=H-W.clientY;if(!U){if(Math.abs(se)<4)return;U=!0,X.setPointerCapture(W.pointerId)}H=W.clientY;const ge=X.querySelector(".xterm-viewport");ge&&(ge.scrollTop+=se)},ie=W=>{W.pointerId===E&&(X.hasPointerCapture(W.pointerId)&&X.releasePointerCapture(W.pointerId),E=null,U=!1)},de=W=>W.stopPropagation();return X.addEventListener("pointerdown",M),X.addEventListener("pointermove",P),X.addEventListener("pointerup",ie),X.addEventListener("pointercancel",ie),X.addEventListener("touchmove",de,{capture:!0}),()=>{X.removeEventListener("pointerdown",M),X.removeEventListener("pointermove",P),X.removeEventListener("pointerup",ie),X.removeEventListener("pointercancel",ie),X.removeEventListener("touchmove",de,{capture:!0}),E!==null&&X.hasPointerCapture(E)&&X.releasePointerCapture(E)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var X;i&&((X=y.current)==null||X.focus())},[i]),_.useEffect(()=>{if(N.current=l,l===null){j.current=!1;return}if(j.current)return;const X=y.current;X&&(j.current=!0,X.write(`\r
130
+ `)),i&&W.focus(),X=()=>{ge!==null&&window.clearTimeout(ge),te.disconnect(),me.dispose(),z.dispose(),P(),W.dispose(),y.current=null},H("ready")})(),()=>{E=!0,window.clearTimeout(O),X==null||X(),X=null}},[a]),_.useEffect(()=>{if(!o)return;const I=x.current;if(!I)return;let E=null,X=0,O=!1;const D=W=>{W.pointerType==="mouse"||E!==null||(E=W.pointerId,X=W.clientY,O=!1)},F=W=>{if(W.pointerId!==E)return;const ie=X-W.clientY;if(!O){if(Math.abs(ie)<4)return;O=!0,I.setPointerCapture(W.pointerId)}X=W.clientY;const me=I.querySelector(".xterm-viewport");me&&(me.scrollTop+=ie)},re=W=>{W.pointerId===E&&(I.hasPointerCapture(W.pointerId)&&I.releasePointerCapture(W.pointerId),E=null,O=!1)},de=W=>W.stopPropagation();return I.addEventListener("pointerdown",D),I.addEventListener("pointermove",F),I.addEventListener("pointerup",re),I.addEventListener("pointercancel",re),I.addEventListener("touchmove",de,{capture:!0}),()=>{I.removeEventListener("pointerdown",D),I.removeEventListener("pointermove",F),I.removeEventListener("pointerup",re),I.removeEventListener("pointercancel",re),I.removeEventListener("touchmove",de,{capture:!0}),E!==null&&I.hasPointerCapture(E)&&I.releasePointerCapture(E)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var I;i&&((I=y.current)==null||I.focus())},[i]),_.useEffect(()=>{if(N.current=l,l===null){j.current=!1;return}if(j.current)return;const I=y.current;I&&(j.current=!0,I.write(`\r
131
131
  \x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
132
- `))},[l]),r.jsxs("div",{className:"termview"+(i?" is-active":""),children:[r.jsx("div",{ref:x,className:"termview__surface"+(D==="ready"?"":" is-hidden")}),D==="loading"&&q&&r.jsxs("div",{className:"termview__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),D==="error"&&r.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[r.jsx("p",{children:"Не удалось загрузить терминал"}),r.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),r.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const xk=2e5,yk=75,_k=90;function vk({tokens:a,maxTokens:l,fetchedAt:i}){if(a===null)return null;const c=l??xk,o=Math.min(100,Math.round(a/c*100)),d=`${a.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
133
- обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return r.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[r.jsx("span",{className:"contextbar__label",children:"контекст"}),r.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`contextbar__fill${Sk(o)}`,style:{width:`${o}%`}})}),r.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Sk(a){return a>=_k?" contextbar__fill--over":a>=yk?" contextbar__fill--warn":""}const yy="ccv:last-session",jk=300*1e3,kk=1e4;function Nk(){try{const a=localStorage.getItem(yy);if(!a)return null;const l=JSON.parse(a);if(typeof l!="object"||l===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=l;return typeof i!="string"||typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function wk(a,l){return a.id===l.sessionId?!0:l.claudeSessionId?a.id===l.claudeSessionId||a.claudeSessionId===l.claudeSessionId:!1}const Tk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},bx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Ek={active:!1,url:"",awaitingCode:!1,output:"",error:null};function xx(a,l,i){if(a===null)return null;const c=a.lastIndexOf("/");if(c===-1&&a!=="")return l;const o=i[c===-1?"":a.slice(0,c)];if(!o)return null;const d=a.slice(c+1).toLowerCase();return d===""?{query:a,entries:o}:{query:a,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,p)=>yx(h.name,d)-yx(p.name,d))}}function yx(a,l){return a.toLowerCase().startsWith(l)?0:1}function _x(a,l){const i=a.find(o=>o.value===l)??a.find(o=>o.resolvedModel===l),c=l&&!i?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...a],selected:(i==null?void 0:i.value)??c??(a.some(o=>o.value==="default")?"default":"")}}function Ak(){var tc;const a=_.useRef(null),[l,i]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[p,m]=_.useState(!1),x=_.useMemo(()=>Oo()==="relay",[]),[y,j]=_.useState([]),[v,C]=_.useState([]),[N,D]=_.useState([]),[B,q]=_.useState([]),[z,X]=_.useState(null),[E,H]=_.useState(null),[U,M]=_.useState(null),[P,ie]=_.useState(hl),[de,W]=_.useState(Pd),[se,ge]=_.useState(!1),[je,me]=_.useState(!1),O=Mh("(max-width: 860px)"),[te,Y]=_.useState(!1);_.useEffect(()=>{O||Y(!1)},[O]);const[oe,xe]=_.useState(!1),[w,J]=_.useState([]),[ue,he]=_.useState(!1),[Ne,Ae]=_.useState(hl),[qe,st]=_.useState(null),[Ze,Ut]=_.useState(null),[Le,dt]=_.useState([]),[Ke,Ie]=_.useState(null),[Fe,ht]=_.useState(null),[It,vt]=_.useState([]),[Gn,Jt]=_.useState([]),[Ft,In]=_.useState([]),[Xt,ct]=_.useState([]),[Sn,jn]=_.useState(null),[yn,Qt]=_.useState(!1),[kn,Nn]=_.useState(null),[Ht,Wt]=_.useState(null),[K,ce]=_.useState(!1),[we,Ce]=_.useState(Ek),[bt,T]=_.useState(null),[Q,Se]=_.useState(null),[Me,He]=_.useState(!1),[Cn,,Ul]=s0(),Fn=o0(),[Yn,_n]=_.useState(!1),[Tt,Tl]=_.useState(null),[Sa,ja]=_.useState(null),[Vs,Hl]=_.useState(null),[Jl,Rn]=_.useState(null),[ka,ml]=_.useState(null),[al,$t]=_.useState(""),[Je,Wn]=_.useState(null),[Xs,Li]=_.useState([]),[Qs,Fl]=_.useState(!1),[Wl,Na]=_.useState(null),[Pl,gl]=_.useState(!1),[Pt,en]=_.useState(!1),[ut,Vn]=_.useState({}),[wa,Xn]=_.useState([""]),[Qn,sl]=_.useState([]),[ea,Pn]=_.useState(null),[$s,wn]=_.useState(null),[Mn,rn]=_.useState(null),[xt,Ta]=_.useState(null),[Hr,ta]=_.useState(null),[na,Ea]=_.useState({}),[Aa,On]=_.useState({}),[bl,Bl]=_.useState(!1),[la,il]=_.useState(null),[fe,k]=_.useState(null),G=_.useRef(0),re=_.useRef(null),[ye,Re]=_.useState(!1),[De,pt]=_.useState([]),[cn,tn]=_.useState(null),[Et,un]=_.useState(null),Bt=d0(),aa=p0(O&&ye),El=_.useRef(new Map),sa=(Ht==null?void 0:Ht.terminalEnabled)===!0,ts=Oo()==="relay"&&((tc=d==null?void 0:d.shell)==null?void 0:tc.enabled)!==!0,Ui=_.useRef(!1),Zs=_.useCallback((b,$)=>(El.current.set(b,$),()=>{El.current.get(b)===$&&El.current.delete(b)}),[]),[Dn,Ks]=_.useState(!1),[ns,xl]=_.useState(null),[Hi,Ca]=_.useState(hl),[Al,Ra]=_.useState(null),[ia,ra]=_.useState({}),on=_.useRef([]),[mt,ls]=_.useState(null);function Js(b){ls($=>$===b?null:b)}_.useEffect(()=>{(O||mt==="terminal"&&!ye||mt==="files"&&!Pt||mt==="search"&&!bl||mt==="git"&&!Yn||mt==="ask"&&!Dn||mt==="main"&&Qn.length===0)&&ls(null)},[mt,O,ye,Pt,bl,Yn,Dn,Qn.length]);const[Zo]=_.useState(Nk),Bi=_.useRef(Zo),as=_.useRef(!1),nn=_.useRef(null),ln=_.useRef(null),Br=_.useRef(0);nn.current=E,ln.current=z,Br.current=P.lastSeq;const ql=_.useRef(null),Fc=_.useRef(0);Fc.current=Hi.lastSeq;const qi=_.useRef(null),ss=_.useRef(""),Fs=_.useRef(null),Ma=_.useRef([]),Wc=_.useRef([""]);Ma.current=Qn,Wc.current=wa;const Ws=_.useRef(new Map),Gi=_.useRef(new Set),is=_.useRef(null),Ps=_.useRef(null),Pc=_.useRef(0);_.useEffect(()=>{const b=t0();if(!b)return;a.current=b;const $=()=>{i(b.connected),o(b.statusText)};b.onStatus($),b.onReconnect(()=>{$();const At=nn.current;At&&b.send({type:"session.sync",sessionId:At,sinceSeq:Br.current});const Ct=ql.current;Ct&&b.send({type:"session.sync",sessionId:Ct,sinceSeq:Fc.current})});const pe=b.on(At=>Ko(At));b.connect();const Ye=window.setInterval(()=>{$(),b.connected&&b.send({type:"ping",nonce:Date.now()})},15e3);return()=>{pe(),window.clearInterval(Ye),b.close()}},[]);const Ko=_.useCallback(b=>{var $,pe,Ye,At,Ct,qt,rl;switch(b.type){case"hello.ok":i(!0);break;case"workspace.list":{j(b.workspaces),X(Ge=>{var Yl;if(Ge)return Ge;const Rt=Bi.current,dn=Rt&&b.workspaces.find(Zi=>Zi.id===Rt.workspaceId);return(dn==null?void 0:dn.id)??((Yl=b.workspaces[0])==null?void 0:Yl.id)??null});const Te=Fs.current;if(!Te)break;const ze=b.workspaces.find(Ge=>Ok(Ge.path,Te));if(!ze)break;Fs.current=null,xe(!1),X(ze.id);break}case"workspace.candidates":if(b.query.trim()!==ss.current)break;J(b.candidates),b.source==="host"&&he(!1);break;case"finder.opened":qi.current=b.sessionId;break;case"workspace.roots":dt(b.roots);break;case"workspace.created":if(X(b.workspace.id),b.warnings.length===0){xe(!1),Ut(null);break}Ie({path:b.workspace.path,warnings:b.warnings});break;case"session.list":if(b.workspaceId!==ln.current)break;C(b.sessions),D(b.archived);break;case"session.pinned":q(b.sessions);break;case"session.summary":if(b.session.id===qi.current){st(b.session);break}if(b.session.parentSessionId){b.session.id===ql.current&&Ra(b.session);break}C(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.session.id);if(ze===-1)return[b.session,...Te];const Ge=Te.slice();return Ge[ze]=b.session,Ge}),q(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.session.id);if(ze===-1)return Te;const Ge=Te.slice();return Ge[ze]={...b.session,pinned:!0,...Te[ze].pinnedAt?{pinnedAt:Te[ze].pinnedAt}:{}},Ge}),H(Te=>Te??b.session.id);break;case"usage.state":b.sessionId===nn.current&&(T(b.usage),He(!1));break;case"context.state":b.sessionId===nn.current&&(Se(b.context),He(!1));break;case"session.capabilities":b.sessionId===nn.current&&M(b.capabilities);break;case"session.events":if(b.sessionId===ql.current){Ca(Te=>Do(Te,b.entries));break}if(b.sessionId===qi.current){Ae(Te=>Do(Te,b.entries));break}if(b.sessionId!==nn.current)break;ie(Te=>Do(Te,b.entries));break;case"session.history":if(b.sessionId!==nn.current)break;W(Te=>n0(Te,b));break;case"side.opened":{if(b.parentSessionId!==nn.current)break;ql.current=b.sessionId,xl(b.sessionId);const Te=on.current;on.current=[];for(const ze of Te)ze(b.sessionId);break}case"side.closed":if(b.parentSessionId!==nn.current)break;ql.current=null,xl(null),Ca(hl),Ra(null);break;case"git.state":if(b.workspaceId!==ln.current)break;Tl(b.state);break;case"git.commit":if(b.workspaceId!==ln.current)break;ja(b.detail);break;case"git.result":if(b.workspaceId!==ln.current)break;Rn({ok:b.ok,message:b.message,url:b.url}),b.ok&&(ja(null),Hl(null),Fl(!1),gl(!1));break;case"git.busy":if(b.workspaceId!==ln.current)break;$t(b.label);break;case"git.files":if(b.workspaceId!==ln.current)break;Na({files:b.files,truncated:b.truncated});break;case"github.status":Wn(b.status);break;case"github.owners":Li(b.owners);break;case"fs.dir":if(b.workspaceId!==ln.current)break;Vn(Te=>({...Te,[b.path]:b.entries}));break;case"fs.search":if(b.workspaceId!==ln.current)break;if(b.scope!=="tree"){const Te=b.scope;On(ze=>({...ze,[Te]:{query:b.query,entries:b.entries}}));break}ta({query:b.query,entries:b.entries,truncated:b.truncated});break;case"fs.grep":if(b.workspaceId!==ln.current)break;il({query:b.query,matches:b.matches,truncated:b.truncated});break;case"fs.file":{if(b.workspaceId!==ln.current)break;const Te=Gi.current.delete(b.file.path);sl(Ge=>{const Rt=Ge.findIndex(Zi=>Zi.path===b.file.path);if(Rt===-1)return[...Ge,Ib(b.file,++Pc.current)];const dn=Ge[Rt],Yl=Ge.slice();return Yl[Rt]=dn.saved===b.file.content&&!Fa(dn)?{...dn,mtime:b.file.mtime,size:b.file.size,stale:!1}:Ib(b.file,++Pc.current),Yl}),Te&&Pn(b.file.path);const ze=re.current;ze&&ze.path===b.file.path&&(re.current=null,k({...ze,token:++G.current}));break}case"fs.saved":{if(b.workspaceId!==ln.current)break;const Te=Ws.current.get(b.path);Ws.current.delete(b.path);const ze=Te!==void 0;sl(Rt=>Rt.map(dn=>dn.path!==b.path?dn:ze?{...dn,saved:Te,mtime:b.mtime,size:b.size,stale:!1}:{...dn,stale:!0}));const Ge=Ma.current.find(Rt=>Rt.path===b.path);!ze&&Ge&&!Fa(Ge)&&(($=a.current)==null||$.send({type:"fs.read",workspaceId:b.workspaceId,path:b.path})),(pe=a.current)==null||pe.send({type:"git.state",workspaceId:b.workspaceId});break}case"fs.result":{if(b.workspaceId!==ln.current)break;if(wn({ok:b.ok,message:b.message}),b.ok||Ws.current.delete(b.path),b.conflict&&sl(ze=>ze.map(Ge=>Ge.path===b.path?{...Ge,stale:!0}:Ge)),Ps.current===b.path){const ze=Ps.current;Ps.current=null,b.ok&&(Gi.current.add(ze),(Ye=a.current)==null||Ye.send({type:"fs.read",workspaceId:b.workspaceId,path:ze}))}const Te=is.current;if(b.ok&&Te&&Te.to===b.path){is.current=null;const ze=Ge=>Ge===Te.from?Te.to:Ge.startsWith(`${Te.from}/`)?Te.to+Ge.slice(Te.from.length):Ge;sl(Ge=>Ge.map(Rt=>({...Rt,path:ze(Rt.path)}))),Pn(Ge=>Ge===null?null:ze(Ge)),Xn(Ge=>Ge.map(ze)),Vn(Ge=>{const Rt={};for(const[dn,Yl]of Object.entries(Ge))dn===Te.from||dn.startsWith(`${Te.from}/`)||(Rt[dn]=Yl);return Rt})}b.ok&&((At=a.current)==null||At.send({type:"git.state",workspaceId:b.workspaceId}));break}case"term.list":if(b.workspaceId!==ln.current)break;pt(b.terminals);break;case"term.opened":if(b.terminal.workspaceId!==ln.current)break;un(null),pt(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.terminal.id);if(ze===-1)return[...Te,b.terminal];const Ge=Te.slice();return Ge[ze]=b.terminal,Ge}),Ui.current&&(Ui.current=!1,tn(b.terminal.id));break;case"term.buffer":(Ct=El.current.get(b.id))==null||Ct({kind:"buffer",data:b.data});break;case"term.data":(qt=El.current.get(b.id))==null||qt({kind:"data",data:b.data});break;case"term.exit":pt(Te=>Te.map(ze=>ze.id===b.id?{...ze,exitCode:b.exitCode}:ze));break;case"term.closed":pt(Te=>Te.filter(ze=>ze.id!==b.id));break;case"mcp.list":b.sessionId===nn.current&&vt(b.servers);break;case"plugin.list":if(b.sessionId!==nn.current)break;Jt(b.plugins),In(b.marketplaces),ct(b.catalog);break;case"operation.result":b.sessionId===nn.current&&jn(b.result);break;case"auth.status":Nn(b.status);break;case"relay.state":h(b.state);break;case"settings.state":Wt(b.settings);break;case"auth.login":Ce(b.state),b.state.active&&Qt(!0);break;case"session.closed":C(Te=>Te.map(ze=>ze.id===b.sessionId?{...ze,state:"closed"}:ze));break;case"error":console.error("[host]",b.message,b.context??""),(b.context==="workspace.open"||b.context==="workspace.create")&&(Fs.current=null,Ut(b.message)),(rl=b.context)!=null&&rl.startsWith("term.")&&un(b.message);break}},[]),ae=_.useCallback(b=>{var $;($=a.current)==null||$.send(b)},[]);_.useEffect(()=>{z&&ae({type:"session.list",workspaceId:z})},[z,ae]),_.useEffect(()=>{l&&ae({type:"session.pins"})},[l,ae]),_.useEffect(()=>{l&&ae({type:"settings.get"})},[l,ae]),_.useEffect(()=>{if(as.current)return;const b=Bi.current;if(!b||!z)return;if(z!==b.workspaceId){as.current=!0;return}if(E){as.current=!0;return}if(v.length===0)return;const $=v.find(pe=>wk(pe,b));as.current=!0,$&&Ii($)},[v,z,E]),_.useEffect(()=>{!z||ts||!sa||ae({type:"term.list",workspaceId:z})},[z,ts,sa,ae]),_.useEffect(()=>{tn(b=>{var $;return b&&De.some(pe=>pe.id===b)?b:(($=De[0])==null?void 0:$.id)??null})},[De]),_.useEffect(()=>{oe&&ae({type:"workspace.roots"})},[oe,ae]);const ca=_.useCallback(()=>{const b=nn.current;b&&(He(!0),ae({type:"usage.get",sessionId:b}),ae({type:"context.get",sessionId:b}))},[ae]);_.useEffect(()=>{if(!Me)return;const b=window.setTimeout(()=>He(!1),kk);return()=>window.clearTimeout(b)},[Me]);const qr=_.useMemo(()=>{const b=Math.max((bt==null?void 0:bt.fetchedAt)??0,(Q==null?void 0:Q.fetchedAt)??0);return b>0?b:null},[bt==null?void 0:bt.fetchedAt,Q==null?void 0:Q.fetchedAt]),Jo="Обновить лимиты и контекст"+(qr?`
134
- обновлено в ${new Date(qr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{if(Se(null),!E)return;ca();const b=()=>{document.hidden||ca()},$=window.setInterval(b,jk),pe=()=>{document.hidden||ca()};return document.addEventListener("visibilitychange",pe),()=>{window.clearInterval($),document.removeEventListener("visibilitychange",pe)}},[E,ca]),_.useEffect(()=>{if(!E){W(Pd);return}W({...Pd,loading:!0}),ae({type:"session.history",sessionId:E})},[E,ae]);const Fo=_.useCallback(()=>{!E||de.loading||!ab(de)||(W(b=>({...b,loading:!0})),ae({type:"session.history",sessionId:E,before:Tx(de)}))},[E,de,ae]),eu=_.useMemo(()=>l0(de.entries),[de.entries]),_e=_.useMemo(()=>v.find(b=>b.id===E)??null,[v,E]),rs=y.find(b=>b.id===z)??null;_.useEffect(()=>{if(!z||!E)return;const b={workspaceId:z,sessionId:E,claudeSessionId:(_e==null?void 0:_e.claudeSessionId)??null};try{localStorage.setItem(yy,JSON.stringify(b))}catch{}},[z,E,_e==null?void 0:_e.claudeSessionId]);function Wo(b){Fs.current=b,Ut(null),ae({type:"workspace.open",path:b})}function Po(b,$,pe){Ut(null),ae({type:"workspace.create",parent:b,name:$,init:pe})}function ef(b){if(ss.current=b,!b){J([]),he(!1);return}he(!0),ae({type:"workspace.find",query:b})}function tf(b){ss.current=b,Ae(hl),ae({type:"workspace.find.agent",query:b})}function nf(){xe(!1),Ut(null),Ie(null),J([]),Ae(hl),st(null),ss.current="",Fs.current=null}function ei(){const b=nn.current;b&&ql.current&&ae({type:"side.reset",sessionId:b}),ql.current=null,xl(null),Ca(hl),Ra(null),ra({}),on.current=[]}function lf(b){ae({type:"workspace.close",workspaceIds:b}),!(!z||!b.includes(z))&&(ei(),X(null),H(null),C([]),D([]),ie(hl),M(null),me(!1))}function Gr(b,$){ae({type:"session.archive",workspaceId:b,sessionIds:$}),E&&($.includes(E)||_e!=null&&_e.claudeSessionId&&$.includes(_e.claudeSessionId))&&(ei(),H(null),ie(hl),M(null),me(!1))}function ti(){z&&(ei(),H(null),M(null),ie(hl),me(!1),ae({type:"session.start",workspaceId:z}),ge(!1))}function tu(b){ei(),Da(),X(b),H(null),ie(hl),M(null),me(!1),Tl(null),ja(null),Hl(null),Rn(null),$t(""),Fl(!1),Na(null),gl(!1),pt([]),tn(null)}function nu(b,$,pe){ae({type:"session.pin",workspaceId:b,sessionIds:$,pinned:pe})}function lu(b){b.workspaceId!==z&&tu(b.workspaceId),Ii(b)}function Ii(b){if(ge(!1),ei(),ie(hl),M(null),me(!1),b.state==="closed"){H(null),ae({type:"session.start",workspaceId:b.workspaceId,resume:b.id});return}H(b.id),ae({type:"session.sync",sessionId:b.id,sinceSeq:0})}function Ir(b,$){ae({type:"session.rename",sessionId:b.id,title:$,workspaceId:b.workspaceId}),C(pe=>pe.map(Ye=>Ye.id===b.id?{...Ye,title:$}:Ye))}function Yr(b){E&&(ge(!1),jn(null),ht(b),ae({type:"mcp.list",sessionId:E}),ae({type:"plugin.list",sessionId:E}))}const cs={mcpAction:(b,$)=>{E&&(ae({type:"mcp.action",sessionId:E,name:b,action:$}),ht(null))},mcpAdd:(b,$)=>{E&&ae({type:"mcp.add",sessionId:E,name:b,draft:$})},mcpRemove:b=>{E&&ae({type:"mcp.remove",sessionId:E,name:b})},pluginInstall:b=>{E&&ae({type:"plugin.install",sessionId:E,spec:b})},pluginUninstall:b=>{E&&ae({type:"plugin.uninstall",sessionId:E,id:b})},pluginToggle:(b,$)=>{E&&ae({type:"plugin.toggle",sessionId:E,id:b,enabled:$})},marketplaceAdd:b=>{E&&ae({type:"marketplace.add",sessionId:E,source:b})},marketplaceRemove:b=>{E&&ae({type:"marketplace.remove",sessionId:E,name:b})}};function au(){ge(!1),Qt(!0),ae({type:"auth.status"})}const Vr={login:(b,$)=>ae({type:"auth.login",mode:b,switchAccount:$}),submitCode:b=>ae({type:"auth.code",code:b}),cancel:()=>ae({type:"auth.cancel"}),logout:()=>ae({type:"auth.logout"})};function af(){ge(!1),ce(!0),ae({type:"settings.get"})}function su(b){Wt($=>$&&{...$,...b}),ae({type:"settings.update",settings:b})}function iu(b){E&&ae({type:"side.ask",sessionId:E,text:b})}function ni(){E&&(ae({type:"side.reset",sessionId:E}),ql.current=null,xl(null),Ca(hl),Ra(null),ra({}),on.current=[])}function Gl(b){const $=ql.current;if($){b($);return}const pe=nn.current;pe&&(on.current.push(b),ae({type:"side.open",sessionId:pe}))}function ru(){z&&ae({type:"git.state",workspaceId:z})}function Yi(b){z&&(Hl(b),ae({type:"git.show",workspaceId:z,ref:b}))}function Xr(b,$){Rn(null),ml({target:b,label:$})}function cu(){!z||!ka||(ae({type:"git.checkout",workspaceId:z,target:ka.target}),ml(null))}function Qr(){z&&(Rn(null),ae({type:"git.push",workspaceId:z}))}function $r(b){z&&(Rn(null),ae({type:"git.pull",workspaceId:z,merge:b}))}function uu(){z&&(Rn(null),Na(null),Fl(!0),ae({type:"github.status"}),ae({type:"github.owners"}),ae({type:"git.files",workspaceId:z}))}function ou(b){z&&(Rn(null),ae({type:"git.publish",workspaceId:z,...b}))}function fu(b){z&&(Rn(null),ae({type:"git.remote",workspaceId:z,url:b}))}function sf(){Rn(null),gl(!0)}function rf(b){ae({type:"github.token",token:b})}function cf(){ae({type:"github.status"})}_.useEffect(()=>{if(!(!Pt||!z))for(const b of wa)b in ut||ae({type:"fs.list",workspaceId:z,path:b})},[Pt,wa,ut,z,ae]);function uf(b){Xn($=>$.includes(b)?$.filter(pe=>pe!==b):[...$,b])}function of(b){if(!b){ta(null);return}z&&ae({type:"fs.search",workspaceId:z,query:b})}function el(b){if(!b){il(null);return}z&&ae({type:"fs.grep",workspaceId:z,query:b})}const us=_.useCallback((b,$)=>{Ea(At=>({...At,[b]:$}));const pe=ln.current;if($===null||!pe)return;const Ye=$.lastIndexOf("/");if(Ye!==-1){ae({type:"fs.list",workspaceId:pe,path:$.slice(0,Ye)});return}if($===""){ae({type:"fs.list",workspaceId:pe,path:""});return}ae({type:"fs.search",workspaceId:pe,query:$,scope:b})},[ae]),du=_.useMemo(()=>xx(na.mention??null,Aa.mention??null,ut),[na.mention,Aa.mention,ut]),hu=_.useMemo(()=>xx(na.side??null,Aa.side??null,ut),[na.side,Aa.side,ut]);function pu(b){li(b.path,{line:b.line,column:b.column})}function mu(b){const $=[];let pe=Ri(b.path);for(;$.push(pe),!!pe;)pe=Ri(pe);Xn(Ye=>{const At=new Set(Ye);for(const Ct of $)At.add(Ct);return b.kind==="dir"&&At.add(b.path),[...At]}),b.kind==="file"&&li(b.path)}function li(b,$){if(Ma.current.find(Ye=>Ye.path===b)){Pn(b),$&&k({path:b,...$,token:++G.current});return}z&&($&&(re.current={path:b,...$}),Gi.current.add(b),ae({type:"fs.read",workspaceId:z,path:b}))}function Zr(b,$=!1){const pe=Ma.current,Ye=pe.find(qt=>qt.path===b);if(Ye&&Fa(Ye)&&!$){Ta(b);return}Ta(null);const At=pe.findIndex(qt=>qt.path===b),Ct=pe.filter(qt=>qt.path!==b);sl(Ct),Pn(qt=>{var rl;return qt===b?((rl=Ct[Math.min(At,Ct.length-1)])==null?void 0:rl.path)??null:qt})}function Il(b,$=!1){const pe=Ma.current.find(Ye=>Ye.path===b);!pe||!z||!$&&!Fa(pe)||(Ws.current.set(b,pe.text),ae({type:"fs.write",workspaceId:z,path:b,content:pe.text,eol:pe.eol,encoding:pe.encoding,baseMtime:pe.mtime,...$?{force:!0}:{}}))}function Kr(b){z&&ae({type:"fs.read",workspaceId:z,path:b})}const ai=_.useRef(new Map);function Jr(b){const $=ai.current,pe=$.get(b);pe&&clearTimeout(pe);const Ye=(Ht==null?void 0:Ht.autoSaveAfterPauseMs)??0;Ye<=0||$.set(b,setTimeout(()=>{$.delete(b);const At=Ma.current.find(Ct=>Ct.path===b);At&&Fa(At)&&!At.stale&&Il(b)},Ye))}function gu(b,$,pe){if(!z)return;const Ye=b?`${b}/${pe}`:pe;wn(null),$==="file"&&(Ps.current=Ye),ae({type:"fs.create",workspaceId:z,path:Ye,kind:$})}function Oa(b,$){if(!z)return;const pe=Ri(b),Ye=pe?`${pe}/${$}`:$;wn(null),is.current={from:b,to:Ye},ae({type:"fs.rename",workspaceId:z,path:b,to:Ye})}function os(b,$){if(!z)return;const pe=b.slice(b.lastIndexOf("/")+1),Ye=$?`${$}/${pe}`:pe;Ye!==b&&(wn(null),is.current={from:b,to:Ye},ae({type:"fs.rename",workspaceId:z,path:b,to:Ye}))}function Fr(b,$){z&&(wn(null),ae({type:"fs.copy",workspaceId:z,path:b,toDir:$}))}function bu(b){z&&(wn(null),rn(null),ae({type:"fs.delete",workspaceId:z,path:b.path}),sl($=>$.filter(pe=>pe.path!==b.path&&!pe.path.startsWith(`${b.path}/`))),Pn($=>$&&($===b.path||$.startsWith(`${b.path}/`))?null:$))}function Da(){Vn({}),Xn([""]),sl([]),Pn(null),wn(null),ta(null),il(null),Ea({}),On({}),k(null),Gi.current.clear(),Ws.current.clear(),re.current=null,is.current=null,Ps.current=null}function xu(){!z||ts||!sa||(un(null),Ui.current=!0,ae({type:"term.open",workspaceId:z,cols:80,rows:24}))}function yu(b){ae({type:"term.close",id:b})}function _u(b,$){E&&ae({type:"permission.respond",sessionId:E,requestId:b,decision:$})}function ff(b,$){E&&ae({type:"permission.respond",sessionId:E,requestId:b,decision:"allow",answers:$})}function df(b){E&&ae({type:"permission.respond",sessionId:E,requestId:b,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}_.useEffect(()=>{function b($){if($.key!=="Escape")return;if(mt!==null){const Ye=$.target;if(!(Ye instanceof HTMLElement&&Ye.closest(".termview, .editor, .sidepane"))){ls(null);return}}if(!E||P.pending.length>0)return;const pe=$.target;pe instanceof HTMLElement&&pe.closest(".sidepane, .editor")||ae({type:"control.interrupt",sessionId:E})}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[E,P.pending.length,ae,mt]),_.useEffect(()=>{function b($){$.key!=="`"||!($.ctrlKey||$.metaKey)||sa&&($.preventDefault(),Re(pe=>!pe))}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[sa]);const vu=_.useMemo(()=>{const b=(U==null?void 0:U.commands)??[];return b.length===0?b:[...b,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...bx]},[U]);function Wr(b){const $=Tk[b];return $?(Yr($),!0):bx.some(pe=>pe.name===b)?(au(),b==="logout"&&Vr.logout(),b==="switch-account"&&Vr.login("claudeai",!0),!0):!1}const si=(_e==null?void 0:_e.state)==="waiting_permission",tl=(_e==null?void 0:_e.state)==="reconnecting",Yt=(_e==null?void 0:_e.state)==="running"||tl||si,yl=P.pending[0]??null;_.useEffect(()=>{!Yn&&!Pt||!z||Yt||ae({type:"git.state",workspaceId:z})},[Yn,Pt,z,Yt,ae]),_.useEffect(()=>{if(!(Yt||!z)){Pt&&Vn(b=>{const $={};for(const[pe,Ye]of Object.entries(b))Wc.current.includes(pe)||($[pe]=Ye);return $});for(const b of Ma.current)Fa(b)||ae({type:"fs.read",workspaceId:z,path:b.path})}},[Yt,z,Pt,ae]);const $n=(_e==null?void 0:_e.cwd)??(U==null?void 0:U.cwd)??null,za=(U==null?void 0:U.models)??[],fs=(_e==null?void 0:_e.model)??(U==null?void 0:U.model)??null,{rows:ii,selected:Vi}=_x(za,fs),La=Al?{model:Al.model,effort:Al.effort,ultracode:Al.ultracode,thinking:Al.thinking,switchOnFlag:Al.switchModelsOnFlag}:{model:ia.model??fs,effort:ia.effort??(_e==null?void 0:_e.effort)??null,ultracode:ia.ultracode??(_e==null?void 0:_e.ultracode)??!1,thinking:ia.thinking??(_e==null?void 0:_e.thinking)??!0,switchOnFlag:ia.switchOnFlag??(_e==null?void 0:_e.switchModelsOnFlag)??!0},ua=_x(za,La.model),Su=(Al==null?void 0:Al.state)==="running",ds=ea?Qn.find(b=>b.path===ea)??null:null,hs=new Set(Qn.filter(Fa).map(b=>b.path)),ri=b=>r.jsx(uk,{pane:b,width:Fn.widths[b],onResize:$=>Fn.setWidth(b,$),onReset:()=>Fn.reset(b)}),fn=b=>O?null:()=>Js(b),Xi=U&&r.jsx(es,{title:"Режим прав",value:(_e==null?void 0:_e.permissionMode)??"default",options:Ex.map(b=>({value:b.value,label:b.value,hint:b.hint})),onChange:b=>{E&&ae({type:"control.set_mode",sessionId:E,mode:b})}}),Cl=ii.length>0?r.jsx(dy,{models:ii,value:Vi,effort:(_e==null?void 0:_e.effort)??null,ultracode:(_e==null?void 0:_e.ultracode)??!1,thinking:(_e==null?void 0:_e.thinking)??!0,switchOnFlag:(_e==null?void 0:_e.switchModelsOnFlag)??!0,onModel:b=>{!E||!b||ae({type:"control.set_model",sessionId:E,model:b})},onEffort:b=>{E&&ae({type:"control.set_effort",sessionId:E,effort:b})},onUltracode:b=>{E&&ae({type:"control.set_ultracode",sessionId:E,enabled:b})},onThinking:b=>{E&&ae({type:"control.set_thinking",sessionId:E,enabled:b})},onSwitchOnFlag:b=>{E&&ae({type:"control.set_flag_switch",sessionId:E,enabled:b})}}):fs&&r.jsx("span",{className:"badge",children:fs}),Pr=Yt&&r.jsx("span",{className:si?"badge badge--wait":"badge badge--live",children:si?"ждёт":tl?"переподключается":"работает"}),ci=()=>{E&&ae({type:"session.reconnect",sessionId:E})},Ua=tl?"Сессия уже поднимает новый процесс":Yt?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ec=E&&(tl||(_e==null?void 0:_e.state)==="error")?r.jsxs("div",{className:tl?"relink":"relink relink--error",role:"status",children:[r.jsxs("span",{className:"relink__msg",children:[r.jsx("span",{className:"relink__dot","aria-hidden":"true"}),tl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),r.jsx("button",{className:"btn btn--sm",title:tl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ci,children:tl?"Переподключить сейчас":"Переподключить"})]}):null,Qi=_e&&_e.totalCostUsd>0?`$${_e.totalCostUsd.toFixed(3)}`:null,$i=r.jsx("button",{className:Dn?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Dn,onClick:()=>Ks(b=>!b),children:r.jsx(zk,{})});return r.jsxs("div",{className:"app",style:Fn.style,children:[r.jsx(q1,{open:se,connected:l,status:c,workspaces:y,sessions:v.filter(b=>b.workspaceId===z),archived:N.filter(b=>b.workspaceId===z),pinned:B,activeWorkspaceId:z,activeSessionId:E,onPinSessions:nu,onSelectPinned:lu,onCloseWorkspaces:lf,onArchiveSessions:Gr,onUnarchiveSessions:b=>{z&&ae({type:"session.unarchive",workspaceId:z,sessionIds:b})},onSelectWorkspace:tu,onSelectSession:Ii,onRenameSession:Ir,onOpenWorkspace:()=>xe(!0),onNewSession:ti,onOpenExtensions:E?()=>Yr("mcp"):null,account:kn,onOpenAccount:au,relay:d,onOpenRelay:x?null:()=>m(!0),onOpenSettings:af,themeMode:Cn,onCycleTheme:Ul}),ri("sidebar"),se&&r.jsx("div",{className:"scrim",onClick:()=>ge(!1)}),r.jsx(_1,{open:Pt,tree:ut,expanded:new Set(wa),activePath:ea,dirty:hs,gitChanges:(Tt==null?void 0:Tt.changed)??[],result:$s,searchResult:Hr,onSearch:of,onReveal:mu,onToggle:uf,onOpen:li,onCreate:gu,onRename:Oa,onMove:os,onCopy:Fr,onDelete:rn,onRefresh:()=>{wn(null),Vn({}),ru()},onClose:()=>en(!1),zoomed:mt==="files",onToggleZoom:fn("files")}),Pt&&mt!=="files"&&ri("files"),r.jsx(C1,{open:bl,result:la,onSearch:el,onOpenMatch:pu,onClose:()=>Bl(!1),zoomed:mt==="search",onToggleZoom:fn("search")}),bl&&mt!=="search"&&ri("search"),r.jsx(ij,{open:Yn,state:Tt,result:Jl,selected:Vs,busy:al,onRefresh:ru,onShow:Yi,onCheckout:Xr,onPush:Qr,onPull:$r,onPublish:uu,onConnectRemote:sf,onClose:()=>_n(!1),zoomed:mt==="git",onToggleZoom:fn("git")}),Yn&&mt!=="git"&&ri("git"),r.jsxs("main",{className:mt==="main"||mt==="terminal"?"main main--zoomed":"main",children:[r.jsxs("header",{className:"topbar",children:[r.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>ge(!0),children:"☰"}),r.jsx("button",{className:Pt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Pt,onClick:()=>{en(b=>!b),_n(!1),Bl(!1)},children:r.jsx(Ck,{})}),r.jsx("button",{className:bl?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":bl,onClick:()=>{Bl(b=>!b),en(!1),_n(!1)},children:r.jsx(Rk,{})}),r.jsx("button",{className:Yn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Yn,onClick:()=>{_n(b=>!b),en(!1),Bl(!1)},children:r.jsx(Mk,{})}),sa&&r.jsx("button",{className:ye?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ye,onClick:()=>Re(b=>!b),children:r.jsx(Dk,{})}),O&&$i,O&&r.jsx("button",{className:te?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":te,onClick:()=>Y(!0),children:r.jsx(Lk,{})}),r.jsxs("div",{className:"topbar__id",children:[je&&_e?r.jsx(Zc,{className:"rename--title",value:_e.title??"",onCommit:b=>{Ir(_e,b),me(!1)},onCancel:()=>me(!1)}):r.jsxs("div",{className:"topbar__head",children:[r.jsx("button",{className:"topbar__title",disabled:!_e||O,title:_e&&!O?"Переименовать сессию":void 0,onClick:()=>me(!0),children:(_e==null?void 0:_e.title)??"Claude Code Visual"}),rs&&r.jsx("span",{className:"topbar__project",title:rs.path,children:rs.name})]}),O?Pr:$n&&r.jsx(fy,{path:$n})]}),!O&&r.jsxs("div",{className:"topbar__tools",children:[r.jsx("button",{type:"button",className:Me?"meters-refresh is-busy":"meters-refresh",title:Jo,"aria-label":"Обновить лимиты и контекст","aria-busy":Me,disabled:!E||Me,onClick:ca,children:r.jsx(Uk,{})}),r.jsx(py,{usage:bt}),r.jsx(xy,{}),Xi,Cl,Pr,Qi&&r.jsx("span",{className:"badge badge--cost",children:Qi}),$i]})]}),r.jsx(vk,{tokens:(Q==null?void 0:Q.tokens)??P.contextTokens,maxTokens:(Q==null?void 0:Q.maxTokens)??null,fetchedAt:(Q==null?void 0:Q.fetchedAt)??null}),O&&te&&r.jsx(Lj,{onClose:()=>Y(!1),permission:Xi,model:Cl,usage:bt,cwd:$n,costLabel:Qi,onRefresh:ca,refreshing:Me,metersFetchedAt:qr,onRename:_e?()=>{me(!0),Y(!1)}:null}),Qn.length>0&&r.jsx(H1,{files:Qn,activePath:ea,busy:Yt,onSelect:Pn,onClose:b=>Zr(b),zoomed:mt==="main",onToggleZoom:fn("main")}),ds?r.jsx(L1,{file:ds,goto:(fe==null?void 0:fe.path)===ds.path?fe:null,onChange:(b,$)=>{sl(pe=>pe.map(Ye=>Ye.path===b?{...Ye,text:$}:Ye)),Jr(b)},onSave:b=>Il(b),onReload:Kr,onOverwrite:b=>Il(b,!0),onTogglePreview:b=>sl($=>$.map(pe=>pe.path===b?{...pe,previewMode:!pe.previewMode}:pe))}):r.jsxs(r.Fragment,{children:[r.jsx(Kh,{items:P.items,busy:Yt&&!tl,waiting:si,history:eu,historyHasMore:ab(de),historyLoading:de.loading,onLoadHistory:Fo,sessionId:E??void 0}),ec,r.jsx(uy,{disabled:!E,busy:Yt&&!tl,placeholder:tl?"Промпт уйдёт, как только связь вернётся":void 0,commands:vu,sessionTitle:(_e==null?void 0:_e.title)??null,contextResult:du,draftKey:E,onContextSearch:b=>us("mention",b),onCommand:Wr,onSend:b=>{E&&ae({type:"prompt.send",sessionId:E,text:b})},onInterrupt:()=>{E&&ae({type:"control.interrupt",sessionId:E})}})]}),ye&&sa&&r.jsxs(r.Fragment,{children:[!O&&mt!=="terminal"&&r.jsx(fk,{height:Bt.height,onResize:Bt.setHeight,onReset:Bt.reset}),r.jsx(mk,{mobile:O,zoomed:mt==="terminal",onToggleZoom:fn("terminal"),terminals:De,activeId:cn,blocked:ts,error:Et,onDismissError:()=>un(null),height:O?aa.height:Bt.height,offset:O?{top:aa.offsetTop,left:aa.offsetLeft}:void 0,onSelect:tn,onOpen:xu,onClose:yu,onInput:(b,$)=>ae({type:"term.input",id:b,data:$}),onResize:(b,$,pe)=>ae({type:"term.resize",id:b,cols:$,rows:pe}),onAttach:b=>ae({type:"term.attach",id:b}),onHide:()=>Re(!1),registerSink:Zs})]})]}),r.jsx(Tj,{open:Dn,items:Hi.items,busy:Su,ready:E!==null,commands:vu,contextResult:hu,draftKey:E,models:ua.rows,model:ua.selected,effort:La.effort,ultracode:La.ultracode,thinking:La.thinking,switchOnFlag:La.switchOnFlag,onContextSearch:b=>us("side",b),onCommand:Wr,onModel:b=>{b&&(ra($=>({...$,model:b})),Gl($=>ae({type:"control.set_model",sessionId:$,model:b})))},onEffort:b=>{ra($=>({...$,effort:b,ultracode:!1})),Gl($=>ae({type:"control.set_effort",sessionId:$,effort:b}))},onUltracode:b=>{ra($=>({...$,ultracode:b,...b?{effort:"xhigh"}:{}})),Gl($=>ae({type:"control.set_ultracode",sessionId:$,enabled:b}))},onThinking:b=>{ra($=>({...$,thinking:b})),Gl($=>ae({type:"control.set_thinking",sessionId:$,enabled:b}))},onSwitchOnFlag:b=>{ra($=>({...$,switchOnFlag:b})),Gl($=>ae({type:"control.set_flag_switch",sessionId:$,enabled:b}))},onAsk:iu,onInterrupt:()=>{ns&&ae({type:"control.interrupt",sessionId:ns})},onReset:ni,onClose:()=>Ks(!1),zoomed:mt==="ask",onToggleZoom:fn("ask")}),Dn&&mt!=="ask"&&ri("ask"),(Yn||Dn||Pt||bl)&&r.jsx("div",{className:"scrim scrim--pane",onClick:()=>{_n(!1),Ks(!1),en(!1),Bl(!1)}}),Sa&&r.jsx(uj,{detail:Sa,local:((Tt==null?void 0:Tt.hasRemote)??!1)&&(Tt==null?void 0:Tt.commits.some(b=>b.hash===Sa.hash&&!b.pushed))===!0,onCheckout:Xr,onClose:()=>{ja(null),Hl(null)}}),ka&&r.jsxs(wl,{title:"Переключить рабочее дерево?",onClose:()=>ml(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>ml(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:cu,children:"Переключиться"})]}),children:[r.jsxs("p",{className:"modal__text",children:["git переключится на ",ka.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Yt&&r.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Tt&&Tt.changed.length>0&&r.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Tt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Qs&&r.jsx(vj,{status:Je,owners:Xs,files:Wl,defaultName:(rs==null?void 0:rs.name)??"",hasCommits:Tt===null||Tt.head!=="",busy:al,result:Jl,onRefreshStatus:cf,onSaveToken:rf,onPublish:ou,onClose:()=>Fl(!1)}),Pl&&r.jsx(wj,{busy:al,result:Jl,onSubmit:fu,onClose:()=>gl(!1)}),Mn&&r.jsx(wl,{title:Mn.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>rn(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>rn(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>bu(Mn),children:"Удалить"})]}),children:r.jsxs("p",{className:"modal__text",children:[Mn.path," будет удалён с диска",Mn.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),xt&&r.jsx(wl,{title:"Закрыть без сохранения?",onClose:()=>Ta(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>Ta(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>Zr(xt,!0),children:"Закрыть"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>{Il(xt),Zr(xt,!0)},children:"Сохранить и закрыть"})]}),children:r.jsxs("p",{className:"modal__text",children:["В ",xt," есть несохранённые правки."]})}),Fe&&r.jsx(Hj,{tab:Fe,servers:It,plugins:Gn,marketplaces:Ft,catalog:Xt,result:Sn,actions:cs,onTab:ht,onClose:()=>ht(null)}),yn&&r.jsx(Qj,{status:kn,login:we,actions:Vr,remote:x,runningSessions:v.filter(b=>b.state==="running"||b.state==="waiting_permission").length,onReconnect:E?()=>{ci(),Qt(!1)}:null,reconnectBlocked:Yt,reconnectHint:Ua,onClose:()=>Qt(!1)}),p&&r.jsx(Fj,{state:d,onPair:(b,$)=>ae({type:"relay.pair",code:b,...$?{name:$}:{}}),onUnpair:()=>ae({type:"relay.unpair"}),onClose:()=>m(!1)}),K&&r.jsx(rk,{settings:Ht,models:(U==null?void 0:U.models)??[],relayState:d,local:Oo()==="local",onChange:su,onEnableShell:()=>ae({type:"relay.shell.enable"}),onDisableShell:()=>ae({type:"relay.shell.disable"}),onOpenRelay:()=>{ce(!1),m(!0)},onClose:()=>ce(!1)}),oe&&r.jsx(KS,{candidates:w,searching:ue,agentItems:Ne.items,agentBusy:(qe==null?void 0:qe.state)==="running",error:Ze,roots:Le,created:Ke,onSearch:ef,onAskAgent:tf,onInterrupt:()=>{const b=qi.current;b&&ae({type:"control.interrupt",sessionId:b})},onSubmit:Wo,onCreate:Po,onClose:nf}),yl!=null&&yl.questions&&yl.questions.length>0?r.jsx(GS,{request:{...yl,questions:yl.questions},queued:P.pending.length-1,onAnswer:ff,onDecline:df}):yl&&r.jsx(qS,{request:yl,queued:P.pending.length-1,onDecide:_u})]})}function Ck(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.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 Rk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Mk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Ok(a,l){return vx(a)===vx(l)}function vx(a){return a.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Dk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),r.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),r.jsx("path",{d:"M8.2 10h3.1"})]})}function zk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function Lk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function Uk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const _y=document.getElementById("root");if(!_y)throw new Error("#root not found");Z_.createRoot(_y).render(r.jsx(_.StrictMode,{children:r.jsx(Ak,{})}));export{Uv as D,Dt as I,Lt as N,qk as P,zl as T,Kl as a,Xx as b,pl as c,Bk as d,Jx as e,Qc as f,n1 as h,Gk as p,Ik as s,ve as t};
132
+ `))},[l]),r.jsxs("div",{className:"termview"+(i?" is-active":""),children:[r.jsx("div",{ref:x,className:"termview__surface"+(L==="ready"?"":" is-hidden")}),L==="loading"&&$&&r.jsxs("div",{className:"termview__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),L==="error"&&r.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[r.jsx("p",{children:"Не удалось загрузить терминал"}),r.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),r.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const xk=2e5,yk=75,_k=90;function vk({tokens:a,maxTokens:l,fetchedAt:i}){if(a===null)return null;const c=l??xk,o=Math.min(100,Math.round(a/c*100)),d=`${a.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
133
+ обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return r.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[r.jsx("span",{className:"contextbar__label",children:"контекст"}),r.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`contextbar__fill${Sk(o)}`,style:{width:`${o}%`}})}),r.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Sk(a){return a>=_k?" contextbar__fill--over":a>=yk?" contextbar__fill--warn":""}const _y="ccv:last-session",jk=300*1e3,kk=1e4;function Nk(){try{const a=localStorage.getItem(_y);if(!a)return null;const l=JSON.parse(a);if(typeof l!="object"||l===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=l;return typeof i!="string"||typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function wk(a,l){return a.id===l.sessionId?!0:l.claudeSessionId?a.id===l.claudeSessionId||a.claudeSessionId===l.claudeSessionId:!1}const Tk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},xx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Ek={active:!1,url:"",awaitingCode:!1,output:"",error:null};function yx(a,l,i){if(a===null)return null;const c=a.lastIndexOf("/");if(c===-1&&a!=="")return l;const o=i[c===-1?"":a.slice(0,c)];if(!o)return null;const d=a.slice(c+1).toLowerCase();return d===""?{query:a,entries:o}:{query:a,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>_x(h.name,d)-_x(m.name,d))}}function _x(a,l){return a.toLowerCase().startsWith(l)?0:1}function vx(a,l){const i=a.find(o=>o.value===l)??a.find(o=>o.resolvedModel===l),c=l&&!i?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...a],selected:(i==null?void 0:i.value)??c??(a.some(o=>o.value==="default")?"default":"")}}function Ak(){var tc;const a=_.useRef(null),[l,i]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[m,p]=_.useState(!1),x=_.useMemo(()=>Oo()==="relay",[]),[y,j]=_.useState([]),[v,C]=_.useState([]),[N,L]=_.useState([]),[H,$]=_.useState([]),[M,I]=_.useState(null),[E,X]=_.useState(null),[O,D]=_.useState(null),[F,re]=_.useState(hl),[de,W]=_.useState(Pd),[ie,me]=_.useState(!1),[je,ge]=_.useState(!1),z=Mh("(max-width: 860px)"),[te,P]=_.useState(!1);_.useEffect(()=>{z||P(!1)},[z]);const[ae,xe]=_.useState(!1),[w,K]=_.useState([]),[oe,he]=_.useState(!1),[Ne,Ae]=_.useState(hl),[qe,st]=_.useState(null),[Ze,Ut]=_.useState(null),[Le,dt]=_.useState([]),[Ke,Ie]=_.useState(null),[Fe,ht]=_.useState(null),[It,vt]=_.useState([]),[Gn,Jt]=_.useState([]),[Ft,In]=_.useState([]),[Xt,ct]=_.useState([]),[jn,kn]=_.useState(null),[_n,Qt]=_.useState(!1),[Nn,wn]=_.useState(null),[Ht,Wt]=_.useState(null),[Z,ue]=_.useState(!1),[we,Ce]=_.useState(Ek),[bt,T]=_.useState(null),[Y,Se]=_.useState(null),[Me,He]=_.useState(!1),[Rn,,Ul]=i0(),Fn=f0(),[Yn,vn]=_.useState(!1),[Tt,Tl]=_.useState(null),[Sa,ja]=_.useState(null),[Vs,Hl]=_.useState(null),[Jl,rn]=_.useState(null),[ka,ml]=_.useState(null),[al,$t]=_.useState(""),[Je,Wn]=_.useState(null),[Xs,Li]=_.useState([]),[Qs,Fl]=_.useState(!1),[Wl,Na]=_.useState(null),[Pl,gl]=_.useState(!1),[Pt,en]=_.useState(!1),[ut,Vn]=_.useState({}),[wa,Xn]=_.useState([""]),[Qn,sl]=_.useState([]),[ea,Pn]=_.useState(null),[$s,Tn]=_.useState(null),[Mn,cn]=_.useState(null),[xt,Ta]=_.useState(null),[Hr,ta]=_.useState(null),[na,Ea]=_.useState({}),[Aa,On]=_.useState({}),[bl,Bl]=_.useState(!1),[la,il]=_.useState(null),[fe,k]=_.useState(null),B=_.useRef(0),ce=_.useRef(null),[ye,Re]=_.useState(!1),[De,pt]=_.useState([]),[un,tn]=_.useState(null),[Et,on]=_.useState(null),Bt=h0(),aa=m0(z&&ye),El=_.useRef(new Map),sa=(Ht==null?void 0:Ht.terminalEnabled)===!0,ts=Oo()==="relay"&&((tc=d==null?void 0:d.shell)==null?void 0:tc.enabled)!==!0,Ui=_.useRef(!1),Zs=_.useCallback((b,V)=>(El.current.set(b,V),()=>{El.current.get(b)===V&&El.current.delete(b)}),[]),[Dn,Ks]=_.useState(!1),[ns,xl]=_.useState(null),[Hi,Ca]=_.useState(hl),[Al,Ra]=_.useState(null),[ia,ra]=_.useState({}),fn=_.useRef([]),[mt,ls]=_.useState(null);function Js(b){ls(V=>V===b?null:b)}_.useEffect(()=>{(z||mt==="terminal"&&!ye||mt==="files"&&!Pt||mt==="search"&&!bl||mt==="git"&&!Yn||mt==="ask"&&!Dn||mt==="main"&&Qn.length===0)&&ls(null)},[mt,z,ye,Pt,bl,Yn,Dn,Qn.length]);const[Zo]=_.useState(Nk),Bi=_.useRef(Zo),as=_.useRef(!1),nn=_.useRef(null),ln=_.useRef(null),Br=_.useRef(0);nn.current=E,ln.current=M,Br.current=F.lastSeq;const ql=_.useRef(null),Fc=_.useRef(0);Fc.current=Hi.lastSeq;const qi=_.useRef(null),ss=_.useRef(""),Fs=_.useRef(null),Ma=_.useRef([]),Wc=_.useRef([""]);Ma.current=Qn,Wc.current=wa;const Ws=_.useRef(new Map),Gi=_.useRef(new Set),is=_.useRef(null),Ps=_.useRef(null),Pc=_.useRef(0);_.useEffect(()=>{const b=n0();if(!b)return;a.current=b;const V=()=>{i(b.connected),o(b.statusText)};b.onStatus(V),b.onReconnect(()=>{V();const At=nn.current;At&&b.send({type:"session.sync",sessionId:At,sinceSeq:Br.current});const Ct=ql.current;Ct&&b.send({type:"session.sync",sessionId:Ct,sinceSeq:Fc.current})});const pe=b.on(At=>Ko(At));b.connect();const Ye=window.setInterval(()=>{V(),b.connected&&b.send({type:"ping",nonce:Date.now()})},15e3);return()=>{pe(),window.clearInterval(Ye),b.close()}},[]);const Ko=_.useCallback(b=>{var V,pe,Ye,At,Ct,qt,rl;switch(b.type){case"hello.ok":i(!0);break;case"workspace.list":{j(b.workspaces),I(Ge=>{var Yl;if(Ge)return Ge;const Rt=Bi.current,hn=Rt&&b.workspaces.find(Zi=>Zi.id===Rt.workspaceId);return(hn==null?void 0:hn.id)??((Yl=b.workspaces[0])==null?void 0:Yl.id)??null});const Te=Fs.current;if(!Te)break;const ze=b.workspaces.find(Ge=>Ok(Ge.path,Te));if(!ze)break;Fs.current=null,xe(!1),I(ze.id);break}case"workspace.candidates":if(b.query.trim()!==ss.current)break;K(b.candidates),b.source==="host"&&he(!1);break;case"finder.opened":qi.current=b.sessionId;break;case"workspace.roots":dt(b.roots);break;case"workspace.created":if(I(b.workspace.id),b.warnings.length===0){xe(!1),Ut(null);break}Ie({path:b.workspace.path,warnings:b.warnings});break;case"session.list":if(b.workspaceId!==ln.current)break;C(b.sessions),L(b.archived);break;case"session.pinned":$(b.sessions);break;case"session.summary":if(b.session.id===qi.current){st(b.session);break}if(b.session.parentSessionId){b.session.id===ql.current&&Ra(b.session);break}C(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.session.id);if(ze===-1)return[b.session,...Te];const Ge=Te.slice();return Ge[ze]=b.session,Ge}),$(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.session.id);if(ze===-1)return Te;const Ge=Te.slice();return Ge[ze]={...b.session,pinned:!0,...Te[ze].pinnedAt?{pinnedAt:Te[ze].pinnedAt}:{}},Ge}),X(Te=>Te??b.session.id);break;case"usage.state":b.sessionId===nn.current&&(T(b.usage),He(!1));break;case"context.state":b.sessionId===nn.current&&(Se(b.context),He(!1));break;case"session.capabilities":b.sessionId===nn.current&&D(b.capabilities);break;case"session.events":if(b.sessionId===ql.current){Ca(Te=>Do(Te,b.entries));break}if(b.sessionId===qi.current){Ae(Te=>Do(Te,b.entries));break}if(b.sessionId!==nn.current)break;re(Te=>Do(Te,b.entries));break;case"session.history":if(b.sessionId!==nn.current)break;W(Te=>l0(Te,b));break;case"side.opened":{if(b.parentSessionId!==nn.current)break;ql.current=b.sessionId,xl(b.sessionId);const Te=fn.current;fn.current=[];for(const ze of Te)ze(b.sessionId);break}case"side.closed":if(b.parentSessionId!==nn.current)break;ql.current=null,xl(null),Ca(hl),Ra(null);break;case"git.state":if(b.workspaceId!==ln.current)break;Tl(b.state);break;case"git.commit":if(b.workspaceId!==ln.current)break;ja(b.detail);break;case"git.result":if(b.workspaceId!==ln.current)break;rn({ok:b.ok,message:b.message,url:b.url}),b.ok&&(ja(null),Hl(null),Fl(!1),gl(!1));break;case"git.busy":if(b.workspaceId!==ln.current)break;$t(b.label);break;case"git.files":if(b.workspaceId!==ln.current)break;Na({files:b.files,truncated:b.truncated});break;case"github.status":Wn(b.status);break;case"github.owners":Li(b.owners);break;case"fs.dir":if(b.workspaceId!==ln.current)break;Vn(Te=>({...Te,[b.path]:b.entries}));break;case"fs.search":if(b.workspaceId!==ln.current)break;if(b.scope!=="tree"){const Te=b.scope;On(ze=>({...ze,[Te]:{query:b.query,entries:b.entries}}));break}ta({query:b.query,entries:b.entries,truncated:b.truncated});break;case"fs.grep":if(b.workspaceId!==ln.current)break;il({query:b.query,matches:b.matches,truncated:b.truncated});break;case"fs.file":{if(b.workspaceId!==ln.current)break;const Te=Gi.current.delete(b.file.path);sl(Ge=>{const Rt=Ge.findIndex(Zi=>Zi.path===b.file.path);if(Rt===-1)return[...Ge,Ib(b.file,++Pc.current)];const hn=Ge[Rt],Yl=Ge.slice();return Yl[Rt]=hn.saved===b.file.content&&!Fa(hn)?{...hn,mtime:b.file.mtime,size:b.file.size,stale:!1}:Ib(b.file,++Pc.current),Yl}),Te&&Pn(b.file.path);const ze=ce.current;ze&&ze.path===b.file.path&&(ce.current=null,k({...ze,token:++B.current}));break}case"fs.saved":{if(b.workspaceId!==ln.current)break;const Te=Ws.current.get(b.path);Ws.current.delete(b.path);const ze=Te!==void 0;sl(Rt=>Rt.map(hn=>hn.path!==b.path?hn:ze?{...hn,saved:Te,mtime:b.mtime,size:b.size,stale:!1}:{...hn,stale:!0}));const Ge=Ma.current.find(Rt=>Rt.path===b.path);!ze&&Ge&&!Fa(Ge)&&((V=a.current)==null||V.send({type:"fs.read",workspaceId:b.workspaceId,path:b.path})),(pe=a.current)==null||pe.send({type:"git.state",workspaceId:b.workspaceId});break}case"fs.result":{if(b.workspaceId!==ln.current)break;if(Tn({ok:b.ok,message:b.message}),b.ok||Ws.current.delete(b.path),b.conflict&&sl(ze=>ze.map(Ge=>Ge.path===b.path?{...Ge,stale:!0}:Ge)),Ps.current===b.path){const ze=Ps.current;Ps.current=null,b.ok&&(Gi.current.add(ze),(Ye=a.current)==null||Ye.send({type:"fs.read",workspaceId:b.workspaceId,path:ze}))}const Te=is.current;if(b.ok&&Te&&Te.to===b.path){is.current=null;const ze=Ge=>Ge===Te.from?Te.to:Ge.startsWith(`${Te.from}/`)?Te.to+Ge.slice(Te.from.length):Ge;sl(Ge=>Ge.map(Rt=>({...Rt,path:ze(Rt.path)}))),Pn(Ge=>Ge===null?null:ze(Ge)),Xn(Ge=>Ge.map(ze)),Vn(Ge=>{const Rt={};for(const[hn,Yl]of Object.entries(Ge))hn===Te.from||hn.startsWith(`${Te.from}/`)||(Rt[hn]=Yl);return Rt})}b.ok&&((At=a.current)==null||At.send({type:"git.state",workspaceId:b.workspaceId}));break}case"term.list":if(b.workspaceId!==ln.current)break;pt(b.terminals);break;case"term.opened":if(b.terminal.workspaceId!==ln.current)break;on(null),pt(Te=>{const ze=Te.findIndex(Rt=>Rt.id===b.terminal.id);if(ze===-1)return[...Te,b.terminal];const Ge=Te.slice();return Ge[ze]=b.terminal,Ge}),Ui.current&&(Ui.current=!1,tn(b.terminal.id));break;case"term.buffer":(Ct=El.current.get(b.id))==null||Ct({kind:"buffer",data:b.data});break;case"term.data":(qt=El.current.get(b.id))==null||qt({kind:"data",data:b.data});break;case"term.exit":pt(Te=>Te.map(ze=>ze.id===b.id?{...ze,exitCode:b.exitCode}:ze));break;case"term.closed":pt(Te=>Te.filter(ze=>ze.id!==b.id));break;case"mcp.list":b.sessionId===nn.current&&vt(b.servers);break;case"plugin.list":if(b.sessionId!==nn.current)break;Jt(b.plugins),In(b.marketplaces),ct(b.catalog);break;case"operation.result":b.sessionId===nn.current&&kn(b.result);break;case"auth.status":wn(b.status);break;case"relay.state":h(b.state);break;case"settings.state":Wt(b.settings);break;case"auth.login":Ce(b.state),b.state.active&&Qt(!0);break;case"session.closed":C(Te=>Te.map(ze=>ze.id===b.sessionId?{...ze,state:"closed"}:ze));break;case"error":console.error("[host]",b.message,b.context??""),(b.context==="workspace.open"||b.context==="workspace.create")&&(Fs.current=null,Ut(b.message)),(rl=b.context)!=null&&rl.startsWith("term.")&&on(b.message);break}},[]),le=_.useCallback(b=>{var V;(V=a.current)==null||V.send(b)},[]);_.useEffect(()=>{M&&le({type:"session.list",workspaceId:M})},[M,le]),_.useEffect(()=>{l&&le({type:"session.pins"})},[l,le]),_.useEffect(()=>{l&&le({type:"settings.get"})},[l,le]),_.useEffect(()=>{if(as.current)return;const b=Bi.current;if(!b||!M)return;if(M!==b.workspaceId){as.current=!0;return}if(E){as.current=!0;return}if(v.length===0)return;const V=v.find(pe=>wk(pe,b));as.current=!0,V&&Ii(V)},[v,M,E]),_.useEffect(()=>{!M||ts||!sa||le({type:"term.list",workspaceId:M})},[M,ts,sa,le]),_.useEffect(()=>{tn(b=>{var V;return b&&De.some(pe=>pe.id===b)?b:((V=De[0])==null?void 0:V.id)??null})},[De]),_.useEffect(()=>{ae&&le({type:"workspace.roots"})},[ae,le]);const ca=_.useCallback(()=>{const b=nn.current;b&&(He(!0),le({type:"usage.get",sessionId:b}),le({type:"context.get",sessionId:b}))},[le]);_.useEffect(()=>{if(!Me)return;const b=window.setTimeout(()=>He(!1),kk);return()=>window.clearTimeout(b)},[Me]);const qr=_.useMemo(()=>{const b=Math.max((bt==null?void 0:bt.fetchedAt)??0,(Y==null?void 0:Y.fetchedAt)??0);return b>0?b:null},[bt==null?void 0:bt.fetchedAt,Y==null?void 0:Y.fetchedAt]),Jo="Обновить лимиты и контекст"+(qr?`
134
+ обновлено в ${new Date(qr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{if(Se(null),!E)return;ca();const b=()=>{document.hidden||ca()},V=window.setInterval(b,jk),pe=()=>{document.hidden||ca()};return document.addEventListener("visibilitychange",pe),()=>{window.clearInterval(V),document.removeEventListener("visibilitychange",pe)}},[E,ca]),_.useEffect(()=>{if(!E){W(Pd);return}W({...Pd,loading:!0}),le({type:"session.history",sessionId:E})},[E,le]);const Fo=_.useCallback(()=>{!E||de.loading||!ab(de)||(W(b=>({...b,loading:!0})),le({type:"session.history",sessionId:E,before:Ex(de)}))},[E,de,le]),eu=_.useMemo(()=>a0(de.entries),[de.entries]),_e=_.useMemo(()=>v.find(b=>b.id===E)??null,[v,E]),rs=y.find(b=>b.id===M)??null;_.useEffect(()=>{if(!M||!E)return;const b={workspaceId:M,sessionId:E,claudeSessionId:(_e==null?void 0:_e.claudeSessionId)??null};try{localStorage.setItem(_y,JSON.stringify(b))}catch{}},[M,E,_e==null?void 0:_e.claudeSessionId]);function Wo(b){Fs.current=b,Ut(null),le({type:"workspace.open",path:b})}function Po(b,V,pe){Ut(null),le({type:"workspace.create",parent:b,name:V,init:pe})}function ef(b){if(ss.current=b,!b){K([]),he(!1);return}he(!0),le({type:"workspace.find",query:b})}function tf(b){ss.current=b,Ae(hl),le({type:"workspace.find.agent",query:b})}function nf(){xe(!1),Ut(null),Ie(null),K([]),Ae(hl),st(null),ss.current="",Fs.current=null}function ei(){const b=nn.current;b&&ql.current&&le({type:"side.reset",sessionId:b}),ql.current=null,xl(null),Ca(hl),Ra(null),ra({}),fn.current=[]}function lf(b){le({type:"workspace.close",workspaceIds:b}),!(!M||!b.includes(M))&&(ei(),I(null),X(null),C([]),L([]),re(hl),D(null),ge(!1))}function Gr(b,V){le({type:"session.archive",workspaceId:b,sessionIds:V}),E&&(V.includes(E)||_e!=null&&_e.claudeSessionId&&V.includes(_e.claudeSessionId))&&(ei(),X(null),re(hl),D(null),ge(!1))}function ti(){M&&(ei(),X(null),D(null),re(hl),ge(!1),le({type:"session.start",workspaceId:M}),me(!1))}function tu(b){ei(),Da(),I(b),X(null),re(hl),D(null),ge(!1),Tl(null),ja(null),Hl(null),rn(null),$t(""),Fl(!1),Na(null),gl(!1),pt([]),tn(null)}function nu(b,V,pe){le({type:"session.pin",workspaceId:b,sessionIds:V,pinned:pe})}function lu(b){b.workspaceId!==M&&tu(b.workspaceId),Ii(b)}function Ii(b){if(me(!1),ei(),re(hl),D(null),ge(!1),b.state==="closed"){X(null),le({type:"session.start",workspaceId:b.workspaceId,resume:b.id});return}X(b.id),le({type:"session.sync",sessionId:b.id,sinceSeq:0})}function Ir(b,V){le({type:"session.rename",sessionId:b.id,title:V,workspaceId:b.workspaceId}),C(pe=>pe.map(Ye=>Ye.id===b.id?{...Ye,title:V}:Ye))}function Yr(b){E&&(me(!1),kn(null),ht(b),le({type:"mcp.list",sessionId:E}),le({type:"plugin.list",sessionId:E}))}const cs={mcpAction:(b,V)=>{E&&(le({type:"mcp.action",sessionId:E,name:b,action:V}),ht(null))},mcpAdd:(b,V)=>{E&&le({type:"mcp.add",sessionId:E,name:b,draft:V})},mcpRemove:b=>{E&&le({type:"mcp.remove",sessionId:E,name:b})},pluginInstall:b=>{E&&le({type:"plugin.install",sessionId:E,spec:b})},pluginUninstall:b=>{E&&le({type:"plugin.uninstall",sessionId:E,id:b})},pluginToggle:(b,V)=>{E&&le({type:"plugin.toggle",sessionId:E,id:b,enabled:V})},marketplaceAdd:b=>{E&&le({type:"marketplace.add",sessionId:E,source:b})},marketplaceRemove:b=>{E&&le({type:"marketplace.remove",sessionId:E,name:b})}};function au(){me(!1),Qt(!0),le({type:"auth.status"})}const Vr={login:(b,V)=>le({type:"auth.login",mode:b,switchAccount:V}),submitCode:b=>le({type:"auth.code",code:b}),cancel:()=>le({type:"auth.cancel"}),logout:()=>le({type:"auth.logout"})};function af(){me(!1),ue(!0),le({type:"settings.get"})}function su(b){Wt(V=>V&&{...V,...b}),le({type:"settings.update",settings:b})}function iu(b){E&&le({type:"side.ask",sessionId:E,text:b})}function ni(){E&&(le({type:"side.reset",sessionId:E}),ql.current=null,xl(null),Ca(hl),Ra(null),ra({}),fn.current=[])}function Gl(b){const V=ql.current;if(V){b(V);return}const pe=nn.current;pe&&(fn.current.push(b),le({type:"side.open",sessionId:pe}))}function ru(){M&&le({type:"git.state",workspaceId:M})}function Yi(b){M&&(Hl(b),le({type:"git.show",workspaceId:M,ref:b}))}function Xr(b,V){rn(null),ml({target:b,label:V})}function cu(){!M||!ka||(le({type:"git.checkout",workspaceId:M,target:ka.target}),ml(null))}function Qr(){M&&(rn(null),le({type:"git.push",workspaceId:M}))}function $r(b){M&&(rn(null),le({type:"git.pull",workspaceId:M,merge:b}))}function uu(){M&&(rn(null),Na(null),Fl(!0),le({type:"github.status"}),le({type:"github.owners"}),le({type:"git.files",workspaceId:M}))}function ou(b){M&&(rn(null),le({type:"git.publish",workspaceId:M,...b}))}function fu(b){M&&(rn(null),le({type:"git.remote",workspaceId:M,url:b}))}function sf(){rn(null),gl(!0)}function rf(b){le({type:"github.token",token:b}),le({type:"github.owners"})}function cf(){le({type:"github.status"}),le({type:"github.owners"})}_.useEffect(()=>{if(!(!Pt||!M))for(const b of wa)b in ut||le({type:"fs.list",workspaceId:M,path:b})},[Pt,wa,ut,M,le]);function uf(b){Xn(V=>V.includes(b)?V.filter(pe=>pe!==b):[...V,b])}function of(b){if(!b){ta(null);return}M&&le({type:"fs.search",workspaceId:M,query:b})}function el(b){if(!b){il(null);return}M&&le({type:"fs.grep",workspaceId:M,query:b})}const us=_.useCallback((b,V)=>{Ea(At=>({...At,[b]:V}));const pe=ln.current;if(V===null||!pe)return;const Ye=V.lastIndexOf("/");if(Ye!==-1){le({type:"fs.list",workspaceId:pe,path:V.slice(0,Ye)});return}if(V===""){le({type:"fs.list",workspaceId:pe,path:""});return}le({type:"fs.search",workspaceId:pe,query:V,scope:b})},[le]),du=_.useMemo(()=>yx(na.mention??null,Aa.mention??null,ut),[na.mention,Aa.mention,ut]),hu=_.useMemo(()=>yx(na.side??null,Aa.side??null,ut),[na.side,Aa.side,ut]);function pu(b){li(b.path,{line:b.line,column:b.column})}function mu(b){const V=[];let pe=Ri(b.path);for(;V.push(pe),!!pe;)pe=Ri(pe);Xn(Ye=>{const At=new Set(Ye);for(const Ct of V)At.add(Ct);return b.kind==="dir"&&At.add(b.path),[...At]}),b.kind==="file"&&li(b.path)}function li(b,V){if(Ma.current.find(Ye=>Ye.path===b)){Pn(b),V&&k({path:b,...V,token:++B.current});return}M&&(V&&(ce.current={path:b,...V}),Gi.current.add(b),le({type:"fs.read",workspaceId:M,path:b}))}function Zr(b,V=!1){const pe=Ma.current,Ye=pe.find(qt=>qt.path===b);if(Ye&&Fa(Ye)&&!V){Ta(b);return}Ta(null);const At=pe.findIndex(qt=>qt.path===b),Ct=pe.filter(qt=>qt.path!==b);sl(Ct),Pn(qt=>{var rl;return qt===b?((rl=Ct[Math.min(At,Ct.length-1)])==null?void 0:rl.path)??null:qt})}function Il(b,V=!1){const pe=Ma.current.find(Ye=>Ye.path===b);!pe||!M||!V&&!Fa(pe)||(Ws.current.set(b,pe.text),le({type:"fs.write",workspaceId:M,path:b,content:pe.text,eol:pe.eol,encoding:pe.encoding,baseMtime:pe.mtime,...V?{force:!0}:{}}))}function Kr(b){M&&le({type:"fs.read",workspaceId:M,path:b})}const ai=_.useRef(new Map);function Jr(b){const V=ai.current,pe=V.get(b);pe&&clearTimeout(pe);const Ye=(Ht==null?void 0:Ht.autoSaveAfterPauseMs)??0;Ye<=0||V.set(b,setTimeout(()=>{V.delete(b);const At=Ma.current.find(Ct=>Ct.path===b);At&&Fa(At)&&!At.stale&&Il(b)},Ye))}function gu(b,V,pe){if(!M)return;const Ye=b?`${b}/${pe}`:pe;Tn(null),V==="file"&&(Ps.current=Ye),le({type:"fs.create",workspaceId:M,path:Ye,kind:V})}function Oa(b,V){if(!M)return;const pe=Ri(b),Ye=pe?`${pe}/${V}`:V;Tn(null),is.current={from:b,to:Ye},le({type:"fs.rename",workspaceId:M,path:b,to:Ye})}function os(b,V){if(!M)return;const pe=b.slice(b.lastIndexOf("/")+1),Ye=V?`${V}/${pe}`:pe;Ye!==b&&(Tn(null),is.current={from:b,to:Ye},le({type:"fs.rename",workspaceId:M,path:b,to:Ye}))}function Fr(b,V){M&&(Tn(null),le({type:"fs.copy",workspaceId:M,path:b,toDir:V}))}function bu(b){M&&(Tn(null),cn(null),le({type:"fs.delete",workspaceId:M,path:b.path}),sl(V=>V.filter(pe=>pe.path!==b.path&&!pe.path.startsWith(`${b.path}/`))),Pn(V=>V&&(V===b.path||V.startsWith(`${b.path}/`))?null:V))}function Da(){Vn({}),Xn([""]),sl([]),Pn(null),Tn(null),ta(null),il(null),Ea({}),On({}),k(null),Gi.current.clear(),Ws.current.clear(),ce.current=null,is.current=null,Ps.current=null}function xu(){!M||ts||!sa||(on(null),Ui.current=!0,le({type:"term.open",workspaceId:M,cols:80,rows:24}))}function yu(b){le({type:"term.close",id:b})}function _u(b,V){E&&le({type:"permission.respond",sessionId:E,requestId:b,decision:V})}function ff(b,V){E&&le({type:"permission.respond",sessionId:E,requestId:b,decision:"allow",answers:V})}function df(b){E&&le({type:"permission.respond",sessionId:E,requestId:b,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}_.useEffect(()=>{function b(V){if(V.key!=="Escape")return;if(mt!==null){const Ye=V.target;if(!(Ye instanceof HTMLElement&&Ye.closest(".termview, .editor, .sidepane"))){ls(null);return}}if(!E||F.pending.length>0)return;const pe=V.target;pe instanceof HTMLElement&&pe.closest(".sidepane, .editor")||le({type:"control.interrupt",sessionId:E})}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[E,F.pending.length,le,mt]),_.useEffect(()=>{function b(V){V.key!=="`"||!(V.ctrlKey||V.metaKey)||sa&&(V.preventDefault(),Re(pe=>!pe))}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[sa]);const vu=_.useMemo(()=>{const b=(O==null?void 0:O.commands)??[];return b.length===0?b:[...b,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...xx]},[O]);function Wr(b){const V=Tk[b];return V?(Yr(V),!0):xx.some(pe=>pe.name===b)?(au(),b==="logout"&&Vr.logout(),b==="switch-account"&&Vr.login("claudeai",!0),!0):!1}const si=(_e==null?void 0:_e.state)==="waiting_permission",tl=(_e==null?void 0:_e.state)==="reconnecting",Yt=(_e==null?void 0:_e.state)==="running"||tl||si,yl=F.pending[0]??null;_.useEffect(()=>{!Yn&&!Pt||!M||Yt||le({type:"git.state",workspaceId:M})},[Yn,Pt,M,Yt,le]),_.useEffect(()=>{if(!(Yt||!M)){Pt&&Vn(b=>{const V={};for(const[pe,Ye]of Object.entries(b))Wc.current.includes(pe)||(V[pe]=Ye);return V});for(const b of Ma.current)Fa(b)||le({type:"fs.read",workspaceId:M,path:b.path})}},[Yt,M,Pt,le]);const $n=(_e==null?void 0:_e.cwd)??(O==null?void 0:O.cwd)??null,za=(O==null?void 0:O.models)??[],fs=(_e==null?void 0:_e.model)??(O==null?void 0:O.model)??null,{rows:ii,selected:Vi}=vx(za,fs),La=Al?{model:Al.model,effort:Al.effort,ultracode:Al.ultracode,thinking:Al.thinking,switchOnFlag:Al.switchModelsOnFlag}:{model:ia.model??fs,effort:ia.effort??(_e==null?void 0:_e.effort)??null,ultracode:ia.ultracode??(_e==null?void 0:_e.ultracode)??!1,thinking:ia.thinking??(_e==null?void 0:_e.thinking)??!0,switchOnFlag:ia.switchOnFlag??(_e==null?void 0:_e.switchModelsOnFlag)??!0},ua=vx(za,La.model),Su=(Al==null?void 0:Al.state)==="running",ds=ea?Qn.find(b=>b.path===ea)??null:null,hs=new Set(Qn.filter(Fa).map(b=>b.path)),ri=b=>r.jsx(uk,{pane:b,width:Fn.widths[b],onResize:V=>Fn.setWidth(b,V),onReset:()=>Fn.reset(b)}),dn=b=>z?null:()=>Js(b),Xi=O&&r.jsx(es,{title:"Режим прав",value:(_e==null?void 0:_e.permissionMode)??"default",options:Ax.map(b=>({value:b.value,label:b.value,hint:b.hint})),onChange:b=>{E&&le({type:"control.set_mode",sessionId:E,mode:b})}}),Cl=ii.length>0?r.jsx(hy,{models:ii,value:Vi,effort:(_e==null?void 0:_e.effort)??null,ultracode:(_e==null?void 0:_e.ultracode)??!1,thinking:(_e==null?void 0:_e.thinking)??!0,switchOnFlag:(_e==null?void 0:_e.switchModelsOnFlag)??!0,onModel:b=>{!E||!b||le({type:"control.set_model",sessionId:E,model:b})},onEffort:b=>{E&&le({type:"control.set_effort",sessionId:E,effort:b})},onUltracode:b=>{E&&le({type:"control.set_ultracode",sessionId:E,enabled:b})},onThinking:b=>{E&&le({type:"control.set_thinking",sessionId:E,enabled:b})},onSwitchOnFlag:b=>{E&&le({type:"control.set_flag_switch",sessionId:E,enabled:b})}}):fs&&r.jsx("span",{className:"badge",children:fs}),Pr=Yt&&r.jsx("span",{className:si?"badge badge--wait":"badge badge--live",children:si?"ждёт":tl?"переподключается":"работает"}),ci=()=>{E&&le({type:"session.reconnect",sessionId:E})},Ua=tl?"Сессия уже поднимает новый процесс":Yt?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ec=E&&(tl||(_e==null?void 0:_e.state)==="error")?r.jsxs("div",{className:tl?"relink":"relink relink--error",role:"status",children:[r.jsxs("span",{className:"relink__msg",children:[r.jsx("span",{className:"relink__dot","aria-hidden":"true"}),tl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),r.jsx("button",{className:"btn btn--sm",title:tl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ci,children:tl?"Переподключить сейчас":"Переподключить"})]}):null,Qi=_e&&_e.totalCostUsd>0?`$${_e.totalCostUsd.toFixed(3)}`:null,$i=r.jsx("button",{className:Dn?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Dn,onClick:()=>Ks(b=>!b),children:r.jsx(zk,{})});return r.jsxs("div",{className:"app",style:Fn.style,children:[r.jsx(q1,{open:ie,connected:l,status:c,workspaces:y,sessions:v.filter(b=>b.workspaceId===M),archived:N.filter(b=>b.workspaceId===M),pinned:H,activeWorkspaceId:M,activeSessionId:E,onPinSessions:nu,onSelectPinned:lu,onCloseWorkspaces:lf,onArchiveSessions:Gr,onUnarchiveSessions:b=>{M&&le({type:"session.unarchive",workspaceId:M,sessionIds:b})},onSelectWorkspace:tu,onSelectSession:Ii,onRenameSession:Ir,onOpenWorkspace:()=>xe(!0),onNewSession:ti,onOpenExtensions:E?()=>Yr("mcp"):null,account:Nn,onOpenAccount:au,relay:d,onOpenRelay:x?null:()=>p(!0),onOpenSettings:af,themeMode:Rn,onCycleTheme:Ul}),ri("sidebar"),ie&&r.jsx("div",{className:"scrim",onClick:()=>me(!1)}),r.jsx(_1,{open:Pt,tree:ut,expanded:new Set(wa),activePath:ea,dirty:hs,gitChanges:(Tt==null?void 0:Tt.changed)??[],result:$s,searchResult:Hr,onSearch:of,onReveal:mu,onToggle:uf,onOpen:li,onCreate:gu,onRename:Oa,onMove:os,onCopy:Fr,onDelete:cn,onRefresh:()=>{Tn(null),Vn({}),ru()},onClose:()=>en(!1),zoomed:mt==="files",onToggleZoom:dn("files")}),Pt&&mt!=="files"&&ri("files"),r.jsx(C1,{open:bl,result:la,onSearch:el,onOpenMatch:pu,onClose:()=>Bl(!1),zoomed:mt==="search",onToggleZoom:dn("search")}),bl&&mt!=="search"&&ri("search"),r.jsx(ij,{open:Yn,state:Tt,result:Jl,selected:Vs,busy:al,onRefresh:ru,onShow:Yi,onCheckout:Xr,onPush:Qr,onPull:$r,onPublish:uu,onConnectRemote:sf,onDismissResult:()=>rn(null),onClose:()=>vn(!1),zoomed:mt==="git",onToggleZoom:dn("git")}),Yn&&mt!=="git"&&ri("git"),r.jsxs("main",{className:mt==="main"||mt==="terminal"?"main main--zoomed":"main",children:[r.jsxs("header",{className:"topbar",children:[r.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>me(!0),children:"☰"}),r.jsx("button",{className:Pt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Pt,onClick:()=>{en(b=>!b),vn(!1),Bl(!1)},children:r.jsx(Ck,{})}),r.jsx("button",{className:bl?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":bl,onClick:()=>{Bl(b=>!b),en(!1),vn(!1)},children:r.jsx(Rk,{})}),r.jsx("button",{className:Yn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Yn,onClick:()=>{vn(b=>!b),en(!1),Bl(!1)},children:r.jsx(Mk,{})}),sa&&r.jsx("button",{className:ye?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ye,onClick:()=>Re(b=>!b),children:r.jsx(Dk,{})}),z&&$i,z&&r.jsx("button",{className:te?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":te,onClick:()=>P(!0),children:r.jsx(Lk,{})}),r.jsxs("div",{className:"topbar__id",children:[je&&_e?r.jsx(Zc,{className:"rename--title",value:_e.title??"",onCommit:b=>{Ir(_e,b),ge(!1)},onCancel:()=>ge(!1)}):r.jsxs("div",{className:"topbar__head",children:[r.jsx("button",{className:"topbar__title",disabled:!_e||z,title:_e&&!z?"Переименовать сессию":void 0,onClick:()=>ge(!0),children:(_e==null?void 0:_e.title)??"Claude Code Visual"}),rs&&r.jsx("span",{className:"topbar__project",title:rs.path,children:rs.name})]}),z?Pr:$n&&r.jsx(dy,{path:$n})]}),!z&&r.jsxs("div",{className:"topbar__tools",children:[r.jsx("button",{type:"button",className:Me?"meters-refresh is-busy":"meters-refresh",title:Jo,"aria-label":"Обновить лимиты и контекст","aria-busy":Me,disabled:!E||Me,onClick:ca,children:r.jsx(Uk,{})}),r.jsx(my,{usage:bt}),r.jsx(yy,{}),Xi,Cl,Pr,Qi&&r.jsx("span",{className:"badge badge--cost",children:Qi}),$i]})]}),r.jsx(vk,{tokens:(Y==null?void 0:Y.tokens)??F.contextTokens,maxTokens:(Y==null?void 0:Y.maxTokens)??null,fetchedAt:(Y==null?void 0:Y.fetchedAt)??null}),z&&te&&r.jsx(Lj,{onClose:()=>P(!1),permission:Xi,model:Cl,usage:bt,cwd:$n,costLabel:Qi,onRefresh:ca,refreshing:Me,metersFetchedAt:qr,onRename:_e?()=>{ge(!0),P(!1)}:null}),Qn.length>0&&r.jsx(H1,{files:Qn,activePath:ea,busy:Yt,onSelect:Pn,onClose:b=>Zr(b),zoomed:mt==="main",onToggleZoom:dn("main")}),ds?r.jsx(L1,{file:ds,goto:(fe==null?void 0:fe.path)===ds.path?fe:null,onChange:(b,V)=>{sl(pe=>pe.map(Ye=>Ye.path===b?{...Ye,text:V}:Ye)),Jr(b)},onSave:b=>Il(b),onReload:Kr,onOverwrite:b=>Il(b,!0),onTogglePreview:b=>sl(V=>V.map(pe=>pe.path===b?{...pe,previewMode:!pe.previewMode}:pe))}):r.jsxs(r.Fragment,{children:[r.jsx(Kh,{items:F.items,busy:Yt&&!tl,waiting:si,history:eu,historyHasMore:ab(de),historyLoading:de.loading,onLoadHistory:Fo,sessionId:E??void 0}),ec,r.jsx(oy,{disabled:!E,busy:Yt&&!tl,placeholder:tl?"Промпт уйдёт, как только связь вернётся":void 0,commands:vu,sessionTitle:(_e==null?void 0:_e.title)??null,contextResult:du,draftKey:E,onContextSearch:b=>us("mention",b),onCommand:Wr,onSend:b=>{E&&le({type:"prompt.send",sessionId:E,text:b})},onInterrupt:()=>{E&&le({type:"control.interrupt",sessionId:E})}})]}),ye&&sa&&r.jsxs(r.Fragment,{children:[!z&&mt!=="terminal"&&r.jsx(fk,{height:Bt.height,onResize:Bt.setHeight,onReset:Bt.reset}),r.jsx(mk,{mobile:z,zoomed:mt==="terminal",onToggleZoom:dn("terminal"),terminals:De,activeId:un,blocked:ts,error:Et,onDismissError:()=>on(null),height:z?aa.height:Bt.height,offset:z?{top:aa.offsetTop,left:aa.offsetLeft}:void 0,onSelect:tn,onOpen:xu,onClose:yu,onInput:(b,V)=>le({type:"term.input",id:b,data:V}),onResize:(b,V,pe)=>le({type:"term.resize",id:b,cols:V,rows:pe}),onAttach:b=>le({type:"term.attach",id:b}),onHide:()=>Re(!1),registerSink:Zs})]})]}),r.jsx(Tj,{open:Dn,items:Hi.items,busy:Su,ready:E!==null,commands:vu,contextResult:hu,draftKey:E,models:ua.rows,model:ua.selected,effort:La.effort,ultracode:La.ultracode,thinking:La.thinking,switchOnFlag:La.switchOnFlag,onContextSearch:b=>us("side",b),onCommand:Wr,onModel:b=>{b&&(ra(V=>({...V,model:b})),Gl(V=>le({type:"control.set_model",sessionId:V,model:b})))},onEffort:b=>{ra(V=>({...V,effort:b,ultracode:!1})),Gl(V=>le({type:"control.set_effort",sessionId:V,effort:b}))},onUltracode:b=>{ra(V=>({...V,ultracode:b,...b?{effort:"xhigh"}:{}})),Gl(V=>le({type:"control.set_ultracode",sessionId:V,enabled:b}))},onThinking:b=>{ra(V=>({...V,thinking:b})),Gl(V=>le({type:"control.set_thinking",sessionId:V,enabled:b}))},onSwitchOnFlag:b=>{ra(V=>({...V,switchOnFlag:b})),Gl(V=>le({type:"control.set_flag_switch",sessionId:V,enabled:b}))},onAsk:iu,onInterrupt:()=>{ns&&le({type:"control.interrupt",sessionId:ns})},onReset:ni,onClose:()=>Ks(!1),zoomed:mt==="ask",onToggleZoom:dn("ask")}),Dn&&mt!=="ask"&&ri("ask"),(Yn||Dn||Pt||bl)&&r.jsx("div",{className:"scrim scrim--pane",onClick:()=>{vn(!1),Ks(!1),en(!1),Bl(!1)}}),Sa&&r.jsx(uj,{detail:Sa,local:((Tt==null?void 0:Tt.hasRemote)??!1)&&(Tt==null?void 0:Tt.commits.some(b=>b.hash===Sa.hash&&!b.pushed))===!0,onCheckout:Xr,onClose:()=>{ja(null),Hl(null)}}),ka&&r.jsxs(wl,{title:"Переключить рабочее дерево?",onClose:()=>ml(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>ml(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:cu,children:"Переключиться"})]}),children:[r.jsxs("p",{className:"modal__text",children:["git переключится на ",ka.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Yt&&r.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Tt&&Tt.changed.length>0&&r.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Tt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Qs&&r.jsx(vj,{status:Je,owners:Xs,files:Wl,defaultName:(rs==null?void 0:rs.name)??"",hasCommits:Tt===null||Tt.head!=="",busy:al,result:Jl,onRefreshStatus:cf,onSaveToken:rf,onPublish:ou,onDismissResult:()=>rn(null),onClose:()=>Fl(!1)}),Pl&&r.jsx(wj,{busy:al,result:Jl,onSubmit:fu,onDismissResult:()=>rn(null),onClose:()=>gl(!1)}),Mn&&r.jsx(wl,{title:Mn.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>cn(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>cn(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>bu(Mn),children:"Удалить"})]}),children:r.jsxs("p",{className:"modal__text",children:[Mn.path," будет удалён с диска",Mn.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),xt&&r.jsx(wl,{title:"Закрыть без сохранения?",onClose:()=>Ta(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>Ta(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>Zr(xt,!0),children:"Закрыть"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>{Il(xt),Zr(xt,!0)},children:"Сохранить и закрыть"})]}),children:r.jsxs("p",{className:"modal__text",children:["В ",xt," есть несохранённые правки."]})}),Fe&&r.jsx(Hj,{tab:Fe,servers:It,plugins:Gn,marketplaces:Ft,catalog:Xt,result:jn,actions:cs,onTab:ht,onClose:()=>ht(null)}),_n&&r.jsx(Qj,{status:Nn,login:we,actions:Vr,remote:x,runningSessions:v.filter(b=>b.state==="running"||b.state==="waiting_permission").length,onReconnect:E?()=>{ci(),Qt(!1)}:null,reconnectBlocked:Yt,reconnectHint:Ua,onClose:()=>Qt(!1)}),m&&r.jsx(Fj,{state:d,onPair:(b,V)=>le({type:"relay.pair",code:b,...V?{name:V}:{}}),onUnpair:()=>le({type:"relay.unpair"}),onClose:()=>p(!1)}),Z&&r.jsx(rk,{settings:Ht,models:(O==null?void 0:O.models)??[],relayState:d,local:Oo()==="local",onChange:su,onEnableShell:()=>le({type:"relay.shell.enable"}),onDisableShell:()=>le({type:"relay.shell.disable"}),onOpenRelay:()=>{ue(!1),p(!0)},onClose:()=>ue(!1)}),ae&&r.jsx(KS,{candidates:w,searching:oe,agentItems:Ne.items,agentBusy:(qe==null?void 0:qe.state)==="running",error:Ze,roots:Le,created:Ke,onSearch:ef,onAskAgent:tf,onInterrupt:()=>{const b=qi.current;b&&le({type:"control.interrupt",sessionId:b})},onSubmit:Wo,onCreate:Po,onClose:nf}),yl!=null&&yl.questions&&yl.questions.length>0?r.jsx(GS,{request:{...yl,questions:yl.questions},queued:F.pending.length-1,onAnswer:ff,onDecline:df}):yl&&r.jsx(qS,{request:yl,queued:F.pending.length-1,onDecide:_u})]})}function Ck(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.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 Rk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Mk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Ok(a,l){return Sx(a)===Sx(l)}function Sx(a){return a.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Dk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),r.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),r.jsx("path",{d:"M8.2 10h3.1"})]})}function zk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function Lk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function Uk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const vy=document.getElementById("root");if(!vy)throw new Error("#root not found");K_.createRoot(vy).render(r.jsx(_.StrictMode,{children:r.jsx(Ak,{})}));export{Hv as D,Dt as I,Lt as N,qk as P,zl as T,Kl as a,Qx as b,pl as c,Bk as d,Fx as e,Qc as f,l1 as h,Gk as p,Ik as s,ve as t};