@seele00/seele 0.1.90 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-DF7L1goG.js → abnfDiagram-VRR7QNED-Bk9MBFkJ.js} +1 -1
- package/web/dist/assets/{arc-D_1bIRe1.js → arc-BVc03_al.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-r_FcYjMG.js → architectureDiagram-ZJ3FMSHR-CFPt3jsT.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-DuzRQJU2.js → blockDiagram-677ZJIJ3-COn4TYDw.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-Bdc5Bfyz.js → c4Diagram-LMCZKHZV-BxUnwtlh.js} +1 -1
- package/web/dist/assets/channel-yFs-Gq20.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-CisGjz8q.js → chunk-2Q5K7J3B-DnqayxOO.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-BIxwA01r.js → chunk-32BRIVSS-FV9xQzYB.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-ComqKkqn.js → chunk-5VM5RSS4-CJeNh06E.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-BB4bzNnX.js → chunk-EX3LRPZG-BlBcXu5H.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-C9wEnvIa.js → chunk-JWPE2WC7-szLhxZnd.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-BbRrLD6M.js → chunk-MOJQB5TN-C1LDO9D_.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-DKXCnRKu.js → chunk-RYQCIY6F-CiClHZyZ.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-JQHfw92B.js → chunk-V7JOEXUC-n1tguvUO.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-BEbJEJoE.js → chunk-VR4S4FIN-CR8EX9NW.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-BOW353gZ.js → chunk-XXDRQBXY-DpjJ6v05.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-COg74g3K.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-COg74g3K.js +1 -0
- package/web/dist/assets/{core-CzO9snBr.js → core-BRk-g4A9.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-BbeVUtyp.js → cose-bilkent-JH36ORCC-DoR-G2p8.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-BDE4qOtD.js → cynefin-VYW2F7L2-BYzO0Ov5.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CP7X5YM_.js → cynefinDiagram-TSTJHNR4-BfqlYtZi.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-DZoUhmJg.js → dagre-VKFMJZFB-Dra53twT.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-DyrmMUO2.js → diagram-FQU43EPY-Bk4tc38x.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-Ct3ASvI4.js → diagram-G47NLZAW-1E7PeuUx.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-CH3P02kI.js → diagram-NH7WQ7WH-Xk1wGBIX.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-Brgx0XRL.js → diagram-OA4YK3LP-CrsRt9r6.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-BKs-80QV.js → diagram-WEI45ONY-CHtBs1KN.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-IbW9Myv_.js → ebnfDiagram-CCIWWBDH-C7-QWSl0.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-CiGShKaX.js → erDiagram-Q63AITRT-DiOVThui.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-BeeqR6Sb.js → flowDiagram-23GEKE2U-Br91Wz-M.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-CD_hfx9S.js → ganttDiagram-NO4QXBWP-By8vHX6a.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-yNN0i97D.js → gitGraphDiagram-IHSO6WYX-UXQCzkaG.js} +1 -1
- package/web/dist/assets/index-SNNGgjTK.js +129 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-D0VHLtiR.js → infoDiagram-FWYZ7A6U-BiL8ppeH.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-CgVMGAvL.js → ishikawaDiagram-FXEZZL3T-DcgEdr6A.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-jrm9FTSj.js → journeyDiagram-5HDEW3XC-CJY52xkn.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-BGXfA-QS.js → kanban-definition-HUTT4EX6-DNz9v56b.js} +1 -1
- package/web/dist/assets/{linear-C_CTdv3H.js → linear-D60RLvJy.js} +1 -1
- package/web/dist/assets/{mermaid.core-fvt-s7xJ.js → mermaid.core-DSU3sJ3I.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-BM7xEoSD.js → mindmap-definition-LN4V7U3C-DS2scLjg.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-BOYnFOcO.js → pegDiagram-2B236MQR-bN6flvMf.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-VFanZA6z.js → pieDiagram-ENE6RG2P-By_nSIP5.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DvITxXLG.js → quadrantDiagram-ABIIQ3AL-B6zXIAWd.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-CSg5M6n7.js → railroadDiagram-RFXS5EU6-t5tUNYCj.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-CYpGrvJQ.js → requirementDiagram-TGXJPOKE-CFWdjZSq.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-CGmP9DOt.js → sankeyDiagram-HTMAVEWB-CsOHwxi2.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-rfC8R3jV.js → sequenceDiagram-DBY2YBRQ-D-EJC47n.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-DAaxunyr.js → sizeCapture-X5ZJPWSS-DGKMALHs.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-Bn_BkRv3.js → stateDiagram-2N3HPSRC-CFOTpx7v.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DAPXQZpK.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-DN7Tcrz5.js → swimlanes-5IMT3BWC-C_bffiO1.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-jtMcWO95.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CU_GzLCw.js → timeline-definition-FHXFAJF6-DRbXgeMo.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-ct8sWoQj.js → vennDiagram-L72KCM5P-D8x4PyA2.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-CBXXfhuD.js → wardleyDiagram-EHGQE667-DWAW-YX0.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-CKSIZXup.js → xychartDiagram-FW5EYKEG-CEMz29dH.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/assets/channel-CRmsPRFE.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BrVZhF0J.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BrVZhF0J.js +0 -1
- package/web/dist/assets/index-aUVmJEDj.js +0 -129
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-Dz_UKy_6.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-D6-tfiO4.js +0 -8
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Uk=Object.defineProperty;var Bk=(e,i,a)=>i in e?Uk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var Tc=(e,i,a)=>Bk(e,typeof i!="symbol"?i+"":i,a);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(u){if(u.ep)return;u.ep=!0;const c=a(u);fetch(u.href,c)}})();const qk="modulepreload",Hk=function(e,i){return new URL(e,i).href},Ty={},Ct=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=Hk(b,r),b in Ty)return;Ty[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const q=p[R];if(q.href===b&&(!x||q.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const T=document.createElement("link");if(T.rel=x?"stylesheet":qk,x||(T.as="script"),T.crossOrigin="",T.href=b,m&&T.setAttribute("nonce",m),document.head.appendChild(T),x)return new Promise((R,q)=>{T.addEventListener("load",R),T.addEventListener("error",()=>q(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function xb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ff={exports:{}},Ro={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Ey;function $k(){if(Ey)return Ro;Ey=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return Ro.Fragment=i,Ro.jsx=a,Ro.jsxs=a,Ro}var Ay;function Gk(){return Ay||(Ay=1,Ff.exports=$k()),Ff.exports}var s=Gk(),Pf={exports:{}},Be={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Ny;function Vk(){if(Ny)return Be;Ny=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=j&&A[j]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,q={};function N(A,z,C){this.props=A,this.context=z,this.refs=q,this.updater=C||T}N.prototype.isReactComponent={},N.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function H(){}H.prototype=N.prototype;function $(A,z,C){this.props=A,this.context=z,this.refs=q,this.updater=C||T}var W=$.prototype=new H;W.constructor=$,R(W,N.prototype),W.isPureReactComponent=!0;var ae=Array.isArray;function D(){}var Q={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function ee(A,z,C){var Y=C.ref;return{$$typeof:e,type:A,key:z,ref:Y!==void 0?Y:null,props:C}}function L(A,z){return ee(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function de(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ee=/\/+/g;function ge(A,z){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(D,D):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,z,C,Y,fe){var X=typeof A;(X==="undefined"||X==="boolean")&&(A=null);var ye=!1;if(A===null)ye=!0;else switch(X){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(A.$$typeof){case e:case i:ye=!0;break;case b:return ye=A._init,V(ye(A._payload),z,C,Y,fe)}}if(ye)return fe=fe(A),ye=Y===""?"."+ge(A,0):Y,ae(fe)?(C="",ye!=null&&(C=ye.replace(Ee,"$&/")+"/"),V(fe,z,C,"",function(jt){return jt})):fe!=null&&(te(fe)&&(fe=L(fe,C+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Ee,"$&/")+"/")+ye)),z.push(fe)),1;ye=0;var Re=Y===""?".":Y+":";if(ae(A))for(var Fe=0;Fe<A.length;Fe++)Y=A[Fe],X=Re+ge(Y,Fe),ye+=V(Y,z,C,X,fe);else if(Fe=w(A),typeof Fe=="function")for(A=Fe.call(A),Fe=0;!(Y=A.next()).done;)Y=Y.value,X=Re+ge(Y,Fe++),ye+=V(Y,z,C,X,fe);else if(X==="object"){if(typeof A.then=="function")return V(ue(A),z,C,Y,fe);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ye}function oe(A,z,C){if(A==null)return A;var Y=[],fe=0;return V(A,Y,"","",function(X){return z.call(C,X,fe++)}),Y}function xe(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var _e=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:oe,forEach:function(A,z,C){oe(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return oe(A,function(){z++}),z},toArray:function(A){return oe(A,function(z){return z})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Be.Activity=x,Be.Children=O,Be.Component=N,Be.Fragment=a,Be.Profiler=u,Be.PureComponent=$,Be.StrictMode=r,Be.Suspense=g,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,Be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Q.H.useMemoCache(A)}},Be.cache=function(A){return function(){return A.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var Y=R({},A.props),fe=A.key;if(z!=null)for(X in z.key!==void 0&&(fe=""+z.key),z)!re.call(z,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&z.ref===void 0||(Y[X]=z[X]);var X=arguments.length-2;if(X===1)Y.children=C;else if(1<X){for(var ye=Array(X),Re=0;Re<X;Re++)ye[Re]=arguments[Re+2];Y.children=ye}return ee(A.type,fe,Y)},Be.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Be.createElement=function(A,z,C){var Y,fe={},X=null;if(z!=null)for(Y in z.key!==void 0&&(X=""+z.key),z)re.call(z,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(fe[Y]=z[Y]);var ye=arguments.length-2;if(ye===1)fe.children=C;else if(1<ye){for(var Re=Array(ye),Fe=0;Fe<ye;Fe++)Re[Fe]=arguments[Fe+2];fe.children=Re}if(A&&A.defaultProps)for(Y in ye=A.defaultProps,ye)fe[Y]===void 0&&(fe[Y]=ye[Y]);return ee(A,X,fe)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(A){return{$$typeof:p,render:A}},Be.isValidElement=te,Be.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:xe}},Be.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Be.startTransition=function(A){var z=Q.T,C={};Q.T=C;try{var Y=A(),fe=Q.S;fe!==null&&fe(C,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(D,_e)}catch(X){_e(X)}finally{z!==null&&C.types!==null&&(z.types=C.types),Q.T=z}},Be.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},Be.use=function(A){return Q.H.use(A)},Be.useActionState=function(A,z,C){return Q.H.useActionState(A,z,C)},Be.useCallback=function(A,z){return Q.H.useCallback(A,z)},Be.useContext=function(A){return Q.H.useContext(A)},Be.useDebugValue=function(){},Be.useDeferredValue=function(A,z){return Q.H.useDeferredValue(A,z)},Be.useEffect=function(A,z){return Q.H.useEffect(A,z)},Be.useEffectEvent=function(A){return Q.H.useEffectEvent(A)},Be.useId=function(){return Q.H.useId()},Be.useImperativeHandle=function(A,z,C){return Q.H.useImperativeHandle(A,z,C)},Be.useInsertionEffect=function(A,z){return Q.H.useInsertionEffect(A,z)},Be.useLayoutEffect=function(A,z){return Q.H.useLayoutEffect(A,z)},Be.useMemo=function(A,z){return Q.H.useMemo(A,z)},Be.useOptimistic=function(A,z){return Q.H.useOptimistic(A,z)},Be.useReducer=function(A,z,C){return Q.H.useReducer(A,z,C)},Be.useRef=function(A){return Q.H.useRef(A)},Be.useState=function(A){return Q.H.useState(A)},Be.useSyncExternalStore=function(A,z,C){return Q.H.useSyncExternalStore(A,z,C)},Be.useTransition=function(){return Q.H.useTransition()},Be.version="19.2.7",Be}var Dy;function oh(){return Dy||(Dy=1,Pf.exports=Vk()),Pf.exports}var _=oh(),Yf={exports:{}},Mo={},Wf={exports:{}},Kf={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var _y;function Fk(){return _y||(_y=1,(function(e){function i(V,oe){var xe=V.length;V.push(oe);e:for(;0<xe;){var _e=xe-1>>>1,O=V[_e];if(0<u(O,oe))V[_e]=oe,V[xe]=O,xe=_e;else break e}}function a(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var oe=V[0],xe=V.pop();if(xe!==oe){V[0]=xe;e:for(var _e=0,O=V.length,A=O>>>1;_e<A;){var z=2*(_e+1)-1,C=V[z],Y=z+1,fe=V[Y];if(0>u(C,xe))Y<O&&0>u(fe,C)?(V[_e]=fe,V[Y]=xe,_e=Y):(V[_e]=C,V[z]=xe,_e=z);else if(Y<O&&0>u(fe,xe))V[_e]=fe,V[Y]=xe,_e=Y;else break e}}return oe}function u(V,oe){var xe=V.sortIndex-oe.sortIndex;return xe!==0?xe:V.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,x=null,j=3,w=!1,T=!1,R=!1,q=!1,N=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function W(V){for(var oe=a(m);oe!==null;){if(oe.callback===null)r(m);else if(oe.startTime<=V)r(m),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=a(m)}}function ae(V){if(R=!1,W(V),!T)if(a(g)!==null)T=!0,D||(D=!0,de());else{var oe=a(m);oe!==null&&ue(ae,oe.startTime-V)}}var D=!1,Q=-1,re=5,ee=-1;function L(){return q?!0:!(e.unstable_now()-ee<re)}function te(){if(q=!1,D){var V=e.unstable_now();ee=V;var oe=!0;try{e:{T=!1,R&&(R=!1,H(Q),Q=-1),w=!0;var xe=j;try{t:{for(W(V),x=a(g);x!==null&&!(x.expirationTime>V&&L());){var _e=x.callback;if(typeof _e=="function"){x.callback=null,j=x.priorityLevel;var O=_e(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,W(V),oe=!0;break t}x===a(g)&&r(g),W(V)}else r(g);x=a(g)}if(x!==null)oe=!0;else{var A=a(m);A!==null&&ue(ae,A.startTime-V),oe=!1}}break e}finally{x=null,j=xe,w=!1}oe=void 0}}finally{oe?de():D=!1}}}var de;if(typeof $=="function")de=function(){$(te)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,ge=Ee.port2;Ee.port1.onmessage=te,de=function(){ge.postMessage(null)}}else de=function(){N(te,0)};function ue(V,oe){Q=N(function(){V(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(V){switch(j){case 1:case 2:case 3:var oe=3;break;default:oe=j}var xe=j;j=oe;try{return V()}finally{j=xe}},e.unstable_requestPaint=function(){q=!0},e.unstable_runWithPriority=function(V,oe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var xe=j;j=V;try{return oe()}finally{j=xe}},e.unstable_scheduleCallback=function(V,oe,xe){var _e=e.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?_e+xe:_e):xe=_e,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=xe+O,V={id:b++,callback:oe,priorityLevel:V,startTime:xe,expirationTime:O,sortIndex:-1},xe>_e?(V.sortIndex=xe,i(m,V),a(g)===null&&V===a(m)&&(R?(H(Q),Q=-1):R=!0,ue(ae,xe-_e))):(V.sortIndex=O,i(g,V),T||w||(T=!0,D||(D=!0,de()))),V},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(V){var oe=j;return function(){var xe=j;j=oe;try{return V.apply(this,arguments)}finally{j=xe}}}})(Kf)),Kf}var Ry;function Pk(){return Ry||(Ry=1,Wf.exports=Fk()),Wf.exports}var Xf={exports:{}},pn={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var My;function Yk(){if(My)return pn;My=1;var e=oh();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},pn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},pn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},pn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},pn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),j=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},pn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},pn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},pn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},pn.requestFormReset=function(g){r.d.r(g)},pn.unstable_batchedUpdates=function(g,m){return g(m)},pn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},pn.useFormStatus=function(){return d.H.useHostTransitionStatus()},pn.version="19.2.7",pn}var Oy;function Wk(){if(Oy)return Xf.exports;Oy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Xf.exports=Yk(),Xf.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var zy;function Kk(){if(zy)return Mo;zy=1;var e=Pk(),i=oh(),a=Wk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,E=f.child;E;){if(E===l){v=!0,l=f,o=h;break}if(E===o){v=!0,o=f,l=h;break}E=E.sibling}if(!v){for(E=h.child;E;){if(E===l){v=!0,l=h,o=f;break}if(E===o){v=!0,o=h,l=f;break}E=E.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ee?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case N:return"Profiler";case q:return"StrictMode";case ae:return"Suspense";case D:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case $:return t.displayName||"Context";case H:return(t._context.displayName||"Context")+".Consumer";case W:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case re:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var ue=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},_e=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=_e[O],_e[O]=null,O--)}function C(t,n){O++,_e[O]=t.current,t.current=n}var Y=A(null),fe=A(null),X=A(null),ye=A(null);function Re(t,n){switch(C(X,n),C(fe,t),C(Y,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Kg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Kg(n),t=Xg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(Y),C(Y,t)}function Fe(){z(Y),z(fe),z(X)}function jt(t){t.memoizedState!==null&&C(ye,t);var n=Y.current,l=Xg(n,t.type);n!==l&&(C(fe,t),C(Y,l))}function xt(t){fe.current===t&&(z(Y),z(fe)),ye.current===t&&(z(ye),Ao._currentValue=xe)}var on,Pe;function wt(t){if(on===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);on=n&&n[1]||"",Pe=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+on+t+Pe}var Ot=!1;function un(t,n){if(!t||Ot)return"";Ot=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){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(Z){var K=Z}Reflect.construct(t,[],se)}else{try{se.call()}catch(Z){K=Z}t.call(se.prototype)}}else{try{throw Error()}catch(Z){K=Z}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(Z){if(Z&&K&&typeof Z.stack=="string")return[Z.stack,K.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],E=h[1];if(v&&E){var I=v.split(`
|
|
45
|
+
`),P=E.split(`
|
|
46
|
+
`);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===P.length)for(o=I.length-1,f=P.length-1;1<=o&&0<=f&&I[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==P[f]){var ne=`
|
|
47
|
+
`+I[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{Ot=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?wt(l):""}function ze(t,n){switch(t.tag){case 26:case 27:case 5:return wt(t.type);case 16:return wt("Lazy");case 13:return t.child!==n&&n!==null?wt("Suspense Fallback"):wt("Suspense");case 19:return wt("SuspenseList");case 0:case 15:return un(t.type,!1);case 11:return un(t.type.render,!1);case 1:return un(t.type,!0);case 31:return wt("Activity");default:return""}}function zt(t){try{var n="",l=null;do n+=ze(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
|
|
48
|
+
Error generating stack: `+o.message+`
|
|
49
|
+
`+o.stack}}var gn=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,ji=e.unstable_cancelCallback,Xn=e.unstable_shouldYield,Ea=e.unstable_requestPaint,Dt=e.unstable_now,Aa=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Vt=e.log,Qn=e.unstable_setDisableYieldValue,Ft=null,Tt=null;function ut(t){if(typeof Vt=="function"&&Qn(t),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Ft,t)}catch{}}var rt=Math.clz32?Math.clz32:rd,Si=Math.log,jn=Math.LN2;function rd(t){return t>>>=0,t===0?32:31-(Si(t)/jn|0)|0}var wr=256,kr=262144,Ml=4194304;function Ci(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Na(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?f=Ci(o):(v&=E,v!==0?f=Ci(v):l||(l=E&~t,l!==0&&(f=Ci(l))))):(E=o&~h,E!==0?f=Ci(E):v!==0?f=Ci(v):l||(l=o&~t,l!==0&&(f=Ci(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function nn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Da(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 bt(){var t=Ml;return Ml<<=1,(Ml&62914560)===0&&(Ml=4194304),t}function Qi(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function _a(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ol(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var E=t.entanglements,I=t.expirationTimes,P=t.hiddenUpdates;for(l=v&~l;0<l;){var ne=31-rt(l),se=1<<ne;E[ne]=0,I[ne]=-1;var K=P[ne];if(K!==null)for(P[ne]=null,ne=0;ne<K.length;ne++){var Z=K[ne];Z!==null&&(Z.lane&=-536870913)}l&=~se}o!==0&&ks(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function ks(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function Ra(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-rt(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function ru(t,n){var l=n&-n;return l=(l&42)!==0?1:jr(l),(l&(t.suspendedLanes|n))!==0?0:l}function jr(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function js(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ss(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:by(t.type))}function su(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var Zn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Zn,Lt="__reactProps$"+Zn,qn="__reactContainer$"+Zn,Ti="__reactEvents$"+Zn,Ma="__reactListeners$"+Zn,Oa="__reactHandles$"+Zn,Sr="__reactResources$"+Zn,Ei="__reactMarker$"+Zn;function Cs(t){delete t[Pt],delete t[Lt],delete t[Ti],delete t[Ma],delete t[Oa]}function Jn(t){var n=t[Pt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[qn]||l[Pt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=iy(t);t!==null;){if(l=t[Pt])return l;t=iy(t)}return n}t=l,l=t.parentNode}return null}function Ai(t){if(t=t[Pt]||t[qn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Zi(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Ni(t){var n=t[Sr];return n||(n=t[Sr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Et(t){t[Ei]=!0}var ou=new Set,Ts={};function cn(t,n){Di(t,n),Di(t+"Capture",n)}function Di(t,n){for(Ts[t]=n,t=0;t<n.length;t++)ou.add(n[t])}var uu=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]*$"),cu={},du={};function za(t){return gn.call(du,t)?!0:gn.call(cu,t)?!1:uu.test(t)?du[t]=!0:(cu[t]=!0,!1)}function Cr(t,n,l){if(za(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function zl(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function Xt(t,n,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+o)}}function It(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function fu(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _i(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ji(t){if(!t._valueTracker){var n=fu(t)?"checked":"value";t._valueTracker=_i(t,n,""+t[n])}}function Es(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=fu(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function Sn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var hi=/[\n"\\]/g;function Ut(t){return t.replace(hi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Tr(t,n,l,o,f,h,v,E){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+It(n)):t.value!==""+It(n)&&(t.value=""+It(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Er(t,v,It(n)):l!=null?Er(t,v,It(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+It(E):t.removeAttribute("name")}function La(t,n,l,o,f,h,v,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Ji(t);return}l=l!=null?""+It(l):"",n=n!=null?""+It(n):l,E||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=E?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),Ji(t)}function Er(t,n,l){n==="number"&&Sn(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ei(t,n,l,o){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+It(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function pu(t,n,l){if(n!=null&&(n=""+It(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+It(l):""}function Ll(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=It(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),Ji(t)}function ti(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var As=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 Ar(t,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,l):typeof l!="number"||l===0||As.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Ns(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&Ar(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Ar(t,h,n[h])}function Ia(t){if(t.indexOf("-")===-1)return!1;switch(t){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 ni=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"]]),Ri=/^[\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 Ua(t){return Ri.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function yn(){}var Il=null;function Ul(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ba=null,Mi=null;function Ds(t){var n=Ai(t);if(n&&(t=n.stateNode)){var l=t[Lt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Tr(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ut(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Lt]||null;if(!f)throw Error(r(90));Tr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===t.form&&Es(o)}break e;case"textarea":pu(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ei(t,!!l.multiple,n,!1)}}}var _s=!1;function Oi(t,n,l){if(_s)return t(n,l);_s=!0;try{var o=t(n);return o}finally{if(_s=!1,(Ba!==null||Mi!==null)&&(ac(),Ba&&(n=Ba,t=Mi,Mi=Ba=null,Ds(n),t)))for(n=0;n<t.length;n++)Ds(t[n])}}function Bl(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Lt]||null;if(o===null)return null;l=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qa=!1;if(ii)try{var Ha={};Object.defineProperty(Ha,"passive",{get:function(){qa=!0}}),window.addEventListener("test",Ha,Ha),window.removeEventListener("test",Ha,Ha)}catch{qa=!1}var ai=null,zi=null,ea=null;function Rs(){if(ea)return ea;var t,n=zi,l=n.length,o,f="value"in ai?ai.value:ai.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return ea=f.slice(t,1<o?1-o:void 0)}function Li(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function $a(){return!0}function Nr(){return!1}function Qt(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(l=t[E],this[E]=l?l(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?$a:Nr,this.isPropagationStopped=Nr,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=$a)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=$a)},persist:function(){},isPersistent:$a}),n}var Ii={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=Qt(Ii),Ga=x({},Ii,{view:0,detail:0}),Ui=Qt(Ga),Cn,Zt,Bi,ta=x({},Ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:na,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Bi&&(Bi&&t.type==="mousemove"?(Cn=t.screenX-Bi.screenX,Zt=t.screenY-Bi.screenY):Zt=Cn=0,Bi=t),Cn)},movementY:function(t){return"movementY"in t?t.movementY:Zt}}),Va=Qt(ta),Fa=x({},ta,{dataTransfer:0}),Dr=Qt(Fa),_r=x({},Ga,{relatedTarget:0}),Hl=Qt(_r),Ms=x({},Ii,{animationName:0,elapsedTime:0,pseudoElement:0}),Ne=Qt(Ms),hu=x({},Ii,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),mi=Qt(hu),Jt=x({},Ii,{data:0}),Rr=Qt(Jt),$l={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},at={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"},Pa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mr(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Pa[t])?!!n[t]:!1}function na(){return Mr}var Gl=x({},Ga,{key:function(t){if(t.key){var n=$l[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Li(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?at[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:na,charCode:function(t){return t.type==="keypress"?Li(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Li(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Os=Qt(Gl),Or=x({},ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mu=Qt(Or),sd=x({},Ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:na}),Vl=Qt(sd),gu=x({},Ii,{propertyName:0,elapsedTime:0,pseudoElement:0}),zs=Qt(gu),Ls=x({},ta,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Is=Qt(Ls),Us=x({},Ii,{newState:0,oldState:0}),zr=Qt(Us),od=[9,13,27,32],ia=ii&&"CompositionEvent"in window,Fl=null;ii&&"documentMode"in document&&(Fl=document.documentMode);var ud=ii&&"TextEvent"in window&&!Fl,yu=ii&&(!ia||Fl&&8<Fl&&11>=Fl),Lr=" ",qi=!1;function Ya(t,n){switch(t){case"keyup":return od.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function we(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Wa=!1;function xn(t,n){switch(t){case"compositionend":return we(n);case"keypress":return n.which!==32?null:(qi=!0,Lr);case"textInput":return t=n.data,t===Lr&&qi?null:t;default:return null}}function cd(t,n){if(Wa)return t==="compositionend"||!ia&&Ya(t,n)?(t=Rs(),ea=zi=ai=null,Wa=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return yu&&n.locale!=="ko"?null:n.data;default:return null}}var dd={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 Pl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!dd[t.type]:n==="textarea"}function xu(t,n,l,o){Ba?Mi?Mi.push(o):Mi=[o]:Ba=o,n=dc(n,"onChange"),0<n.length&&(l=new ql("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Ka=null,aa=null;function fd(t){Gg(t,0)}function Ir(t){var n=Zi(t);if(Es(n))return t}function Yl(t,n){if(t==="change")return n}var Ur=!1;if(ii){var Wl;if(ii){var Bs="oninput"in document;if(!Bs){var Br=document.createElement("div");Br.setAttribute("oninput","return;"),Bs=typeof Br.oninput=="function"}Wl=Bs}else Wl=!1;Ur=Wl&&(!document.documentMode||9<document.documentMode)}function bu(){Ka&&(Ka.detachEvent("onpropertychange",vu),aa=Ka=null)}function vu(t){if(t.propertyName==="value"&&Ir(aa)){var n=[];xu(n,aa,t,Ul(t)),Oi(fd,n)}}function qs(t,n,l){t==="focusin"?(bu(),Ka=n,aa=l,Ka.attachEvent("onpropertychange",vu)):t==="focusout"&&bu()}function wu(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ir(aa)}function pd(t,n){if(t==="click")return Ir(n)}function hd(t,n){if(t==="input"||t==="change")return Ir(n)}function ku(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var bn=typeof Object.is=="function"?Object.is:ku;function Kl(t,n){if(bn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!gn.call(n,f)||!bn(t[f],n[f]))return!1}return!0}function ju(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Su(t,n){var l=ju(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=n&&o>=n)return{node:l,offset:n-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ju(l)}}function Cu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Cu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Tu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Sn(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Sn(t.document)}return n}function Hs(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var md=ii&&"documentMode"in document&&11>=document.documentMode,Xa=null,$s=null,Xl=null,Gs=!1;function Eu(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Gs||Xa==null||Xa!==Sn(o)||(o=Xa,"selectionStart"in o&&Hs(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Xl&&Kl(Xl,o)||(Xl=o,o=dc($s,"onSelect"),0<o.length&&(n=new ql("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=Xa)))}function la(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Qa={animationend:la("Animation","AnimationEnd"),animationiteration:la("Animation","AnimationIteration"),animationstart:la("Animation","AnimationStart"),transitionrun:la("Transition","TransitionRun"),transitionstart:la("Transition","TransitionStart"),transitioncancel:la("Transition","TransitionCancel"),transitionend:la("Transition","TransitionEnd")},Vs={},Au={};ii&&(Au=document.createElement("div").style,"AnimationEvent"in window||(delete Qa.animationend.animation,delete Qa.animationiteration.animation,delete Qa.animationstart.animation),"TransitionEvent"in window||delete Qa.transitionend.transition);function ra(t){if(Vs[t])return Vs[t];if(!Qa[t])return t;var n=Qa[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Au)return Vs[t]=n[l];return t}var Nu=ra("animationend"),Fs=ra("animationiteration"),Tn=ra("animationstart"),Ps=ra("transitionrun"),Du=ra("transitionstart"),Ql=ra("transitioncancel"),Hi=ra("transitionend"),_u=new Map,Ys="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(" ");Ys.push("scrollEnd");function Hn(t,n){_u.set(t,n),cn(n,[t])}var qr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},En=[],Za=0,Hr=0;function Zl(){for(var t=Za,n=Hr=Za=0;n<t;){var l=En[n];En[n++]=null;var o=En[n];En[n++]=null;var f=En[n];En[n++]=null;var h=En[n];if(En[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&oa(l,f,h)}}function $r(t,n,l,o){En[Za++]=t,En[Za++]=n,En[Za++]=l,En[Za++]=o,Hr|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Ws(t,n,l,o){return $r(t,n,l,o),ua(t)}function sa(t,n){return $r(t,null,null,n),ua(t)}function oa(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function ua(t){if(50<wo)throw wo=0,mf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ja={};function gd(t,n,l,o){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(t,n,l,o){return new gd(t,n,l,o)}function Ks(t){return t=t.prototype,!(!t||!t.isReactComponent)}function li(t,n){var l=t.alternate;return l===null?(l=dn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Ru(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Gr(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")Ks(t)&&(v=1);else if(typeof t=="string")v=Tk(t,l,Y.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=dn(31,l,n,f),t.elementType=ee,t.lanes=h,t;case R:return ca(l.children,f,h,n);case q:v=8,f|=24;break;case N:return t=dn(12,l,n,f|2),t.elementType=N,t.lanes=h,t;case ae:return t=dn(13,l,n,f),t.elementType=ae,t.lanes=h,t;case D:return t=dn(19,l,n,f),t.elementType=D,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case H:v=9;break e;case W:v=11;break e;case Q:v=14;break e;case re:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=dn(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function ca(t,n,l,o){return t=dn(7,t,o,n),t.lanes=l,t}function Xs(t,n,l){return t=dn(6,t,null,n),t.lanes=l,t}function Mu(t){var n=dn(18,null,null,0);return n.stateNode=t,n}function Qs(t,n,l){return n=dn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Ou=new WeakMap;function An(t,n){if(typeof t=="object"&&t!==null){var l=Ou.get(t);return l!==void 0?l:(n={value:t,source:n,stack:zt(n)},Ou.set(t,n),n)}return{value:t,source:n,stack:zt(n)}}var el=[],tl=0,Vr=null,Jl=0,Nn=[],an=0,$i=null,Dn=1,ri="";function gi(t,n){el[tl++]=Jl,el[tl++]=Vr,Vr=t,Jl=n}function er(t,n,l){Nn[an++]=Dn,Nn[an++]=ri,Nn[an++]=$i,$i=t;var o=Dn;t=ri;var f=32-rt(o)-1;o&=~(1<<f),l+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Dn=1<<32-rt(n)+f|l<<f|o,ri=h+t}else Dn=1<<h|l<<f|o,ri=t}function yi(t){t.return!==null&&(gi(t,1),er(t,1,0))}function tr(t){for(;t===Vr;)Vr=el[--tl],el[tl]=null,Jl=el[--tl],el[tl]=null;for(;t===$i;)$i=Nn[--an],Nn[an]=null,ri=Nn[--an],Nn[an]=null,Dn=Nn[--an],Nn[an]=null}function Zs(t,n){Nn[an++]=Dn,Nn[an++]=ri,Nn[an++]=$i,Dn=n.id,ri=n.overflow,$i=t}var _t=null,ct=null,Ge=!1,Gi=null,_n=!1,Js=Error(r(519));function Vi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(An(n,t)),Js}function eo(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Pt]=t,n[Lt]=o,l){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(l=0;l<jo.length;l++)We(jo[l],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":We("invalid",n),La(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":We("invalid",n);break;case"textarea":We("invalid",n),Ll(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||Yg(n.textContent,l)?(o.popover!=null&&(We("beforetoggle",n),We("toggle",n)),o.onScroll!=null&&We("scroll",n),o.onScrollEnd!=null&&We("scrollend",n),o.onClick!=null&&(n.onclick=yn),n=!0):n=!1,n||Vi(t,!0)}function nl(t){for(_t=t.return;_t;)switch(_t.tag){case 5:case 31:case 13:_n=!1;return;case 27:case 3:_n=!0;return;default:_t=_t.return}}function il(t){if(t!==_t)return!1;if(!Ge)return nl(t),Ge=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Df(t.type,t.memoizedProps)),l=!l),l&&ct&&Vi(t),nl(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=ny(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=ny(t)}else n===27?(n=ct,wl(t.type)?(t=zf,zf=null,ct=t):ct=n):ct=_t?ci(t.stateNode.nextSibling):null;return!0}function $n(){ct=_t=null,Ge=!1}function da(){var t=Gi;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),Gi=null),t}function xi(t){Gi===null?Gi=[t]:Gi.push(t)}var to=A(null),fa=null,bi=null;function et(t,n,l){C(to,n._currentValue),n._currentValue=l}function fn(t){t._currentValue=to.current,z(to)}function no(t,n,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===l)break;t=t.return}}function vn(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=f;for(var I=0;I<n.length;I++)if(E.context===n[I]){h.lanes|=l,E=h.alternate,E!==null&&(E.lanes|=l),no(h.return,l,t),o||(v=null);break e}h=E.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),no(v,l,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function al(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var E=f.type;bn(f.pendingProps.value,v.value)||(t!==null?t.push(E):t=[E])}}else if(f===ye.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Ao):t=[Ao])}f=f.return}t!==null&&vn(n,t,l,o),n.flags|=262144}function si(t){for(t=t.firstContext;t!==null;){if(!bn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function pa(t){fa=t,bi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Yt(t){return Pr(fa,t)}function Fr(t,n){return fa===null&&pa(t),Pr(t,n)}function Pr(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},bi===null){if(t===null)throw Error(r(308));bi=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else bi=bi.next=n;return l}var yd=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},xd=e.unstable_scheduleCallback,bd=e.unstable_NormalPriority,St={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yr(){return{controller:new yd,data:new Map,refCount:0}}function ll(t){t.refCount--,t.refCount===0&&xd(bd,function(){t.controller.abort()})}var rl=null,y=0,k=0,S=null;function M(t,n){if(rl===null){var l=rl=[];y=0,k=wf(),S={status:"pending",value:void 0,then:function(o){l.push(o)}}}return y++,n.then(U,U),n}function U(){if(--y===0&&rl!==null){S!==null&&(S.status="fulfilled");var t=rl;rl=null,k=0,S=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function J(t,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var be=V.S;V.S=function(t,n){yg=Dt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&M(t,n),be!==null&&be(t,n)};var Le=A(null);function Ae(){var t=Le.current;return t!==null?t:mt.pooledCache}function ve(t,n){n===null?C(Le,Le.current):C(Le,n.pool)}function en(){var t=Ae();return t===null?null:{parent:St._currentValue,pool:t}}var ht=Error(r(460)),sl=Error(r(474)),ln=Error(r(542)),oi={then:function(){}};function ol(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Wr(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(yn,yn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Bh(t),t;default:if(typeof n.status=="string")n.then(yn,yn);else{if(t=mt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Bh(t),t}throw ir=n,ht}}function nr(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ir=l,ht):l}}var ir=null;function Uh(){if(ir===null)throw Error(r(459));var t=ir;return ir=null,t}function Bh(t){if(t===ht||t===ln)throw Error(r(483))}var Kr=null,io=0;function zu(t){var n=io;return io+=1,Kr===null&&(Kr=[]),Wr(Kr,t,n)}function ao(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Lu(t,n){throw n.$$typeof===j?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function qh(t){function n(G,B){if(t){var F=G.deletions;F===null?(G.deletions=[B],G.flags|=16):F.push(B)}}function l(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=li(G,B),G.index=0,G.sibling=null,G}function h(G,B,F){return G.index=F,t?(F=G.alternate,F!==null?(F=F.index,F<B?(G.flags|=67108866,B):F):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function E(G,B,F,le){return B===null||B.tag!==6?(B=Xs(F,G.mode,le),B.return=G,B):(B=f(B,F),B.return=G,B)}function I(G,B,F,le){var De=F.type;return De===R?ne(G,B,F.props.children,le,F.key):B!==null&&(B.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===re&&nr(De)===B.type)?(B=f(B,F.props),ao(B,F),B.return=G,B):(B=Gr(F.type,F.key,F.props,null,G.mode,le),ao(B,F),B.return=G,B)}function P(G,B,F,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==F.containerInfo||B.stateNode.implementation!==F.implementation?(B=Qs(F,G.mode,le),B.return=G,B):(B=f(B,F.children||[]),B.return=G,B)}function ne(G,B,F,le,De){return B===null||B.tag!==7?(B=ca(F,G.mode,le,De),B.return=G,B):(B=f(B,F),B.return=G,B)}function se(G,B,F){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Xs(""+B,G.mode,F),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return F=Gr(B.type,B.key,B.props,null,G.mode,F),ao(F,B),F.return=G,F;case T:return B=Qs(B,G.mode,F),B.return=G,B;case re:return B=nr(B),se(G,B,F)}if(ue(B)||de(B))return B=ca(B,G.mode,F,null),B.return=G,B;if(typeof B.then=="function")return se(G,zu(B),F);if(B.$$typeof===$)return se(G,Fr(G,B),F);Lu(G,B)}return null}function K(G,B,F,le){var De=B!==null?B.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return De!==null?null:E(G,B,""+F,le);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case w:return F.key===De?I(G,B,F,le):null;case T:return F.key===De?P(G,B,F,le):null;case re:return F=nr(F),K(G,B,F,le)}if(ue(F)||de(F))return De!==null?null:ne(G,B,F,le,null);if(typeof F.then=="function")return K(G,B,zu(F),le);if(F.$$typeof===$)return K(G,B,Fr(G,F),le);Lu(G,F)}return null}function Z(G,B,F,le,De){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(F)||null,E(B,G,""+le,De);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?F:le.key)||null,I(B,G,le,De);case T:return G=G.get(le.key===null?F:le.key)||null,P(B,G,le,De);case re:return le=nr(le),Z(G,B,F,le,De)}if(ue(le)||de(le))return G=G.get(F)||null,ne(B,G,le,De,null);if(typeof le.then=="function")return Z(G,B,F,zu(le),De);if(le.$$typeof===$)return Z(G,B,F,Fr(B,le),De);Lu(B,le)}return null}function ke(G,B,F,le){for(var De=null,nt=null,Te=B,$e=B=0,Ze=null;Te!==null&&$e<F.length;$e++){Te.index>$e?(Ze=Te,Te=null):Ze=Te.sibling;var it=K(G,Te,F[$e],le);if(it===null){Te===null&&(Te=Ze);break}t&&Te&&it.alternate===null&&n(G,Te),B=h(it,B,$e),nt===null?De=it:nt.sibling=it,nt=it,Te=Ze}if($e===F.length)return l(G,Te),Ge&&gi(G,$e),De;if(Te===null){for(;$e<F.length;$e++)Te=se(G,F[$e],le),Te!==null&&(B=h(Te,B,$e),nt===null?De=Te:nt.sibling=Te,nt=Te);return Ge&&gi(G,$e),De}for(Te=o(Te);$e<F.length;$e++)Ze=Z(Te,G,$e,F[$e],le),Ze!==null&&(t&&Ze.alternate!==null&&Te.delete(Ze.key===null?$e:Ze.key),B=h(Ze,B,$e),nt===null?De=Ze:nt.sibling=Ze,nt=Ze);return t&&Te.forEach(function(Tl){return n(G,Tl)}),Ge&&gi(G,$e),De}function Oe(G,B,F,le){if(F==null)throw Error(r(151));for(var De=null,nt=null,Te=B,$e=B=0,Ze=null,it=F.next();Te!==null&&!it.done;$e++,it=F.next()){Te.index>$e?(Ze=Te,Te=null):Ze=Te.sibling;var Tl=K(G,Te,it.value,le);if(Tl===null){Te===null&&(Te=Ze);break}t&&Te&&Tl.alternate===null&&n(G,Te),B=h(Tl,B,$e),nt===null?De=Tl:nt.sibling=Tl,nt=Tl,Te=Ze}if(it.done)return l(G,Te),Ge&&gi(G,$e),De;if(Te===null){for(;!it.done;$e++,it=F.next())it=se(G,it.value,le),it!==null&&(B=h(it,B,$e),nt===null?De=it:nt.sibling=it,nt=it);return Ge&&gi(G,$e),De}for(Te=o(Te);!it.done;$e++,it=F.next())it=Z(Te,G,$e,it.value,le),it!==null&&(t&&it.alternate!==null&&Te.delete(it.key===null?$e:it.key),B=h(it,B,$e),nt===null?De=it:nt.sibling=it,nt=it);return t&&Te.forEach(function(Ik){return n(G,Ik)}),Ge&&gi(G,$e),De}function pt(G,B,F,le){if(typeof F=="object"&&F!==null&&F.type===R&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case w:e:{for(var De=F.key;B!==null;){if(B.key===De){if(De=F.type,De===R){if(B.tag===7){l(G,B.sibling),le=f(B,F.props.children),le.return=G,G=le;break e}}else if(B.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===re&&nr(De)===B.type){l(G,B.sibling),le=f(B,F.props),ao(le,F),le.return=G,G=le;break e}l(G,B);break}else n(G,B);B=B.sibling}F.type===R?(le=ca(F.props.children,G.mode,le,F.key),le.return=G,G=le):(le=Gr(F.type,F.key,F.props,null,G.mode,le),ao(le,F),le.return=G,G=le)}return v(G);case T:e:{for(De=F.key;B!==null;){if(B.key===De)if(B.tag===4&&B.stateNode.containerInfo===F.containerInfo&&B.stateNode.implementation===F.implementation){l(G,B.sibling),le=f(B,F.children||[]),le.return=G,G=le;break e}else{l(G,B);break}else n(G,B);B=B.sibling}le=Qs(F,G.mode,le),le.return=G,G=le}return v(G);case re:return F=nr(F),pt(G,B,F,le)}if(ue(F))return ke(G,B,F,le);if(de(F)){if(De=de(F),typeof De!="function")throw Error(r(150));return F=De.call(F),Oe(G,B,F,le)}if(typeof F.then=="function")return pt(G,B,zu(F),le);if(F.$$typeof===$)return pt(G,B,Fr(G,F),le);Lu(G,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,B!==null&&B.tag===6?(l(G,B.sibling),le=f(B,F),le.return=G,G=le):(l(G,B),le=Xs(F,G.mode,le),le.return=G,G=le),v(G)):l(G,B)}return function(G,B,F,le){try{io=0;var De=pt(G,B,F,le);return Kr=null,De}catch(Te){if(Te===ht||Te===ln)throw Te;var nt=dn(29,Te,null,G.mode);return nt.lanes=le,nt.return=G,nt}finally{}}}var ar=qh(!0),Hh=qh(!1),ul=!1;function vd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function cl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function dl(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(lt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=ua(t),oa(t,null,l),n}return $r(t,o,n,l),ua(t)}function lo(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ra(t,l)}}function kd(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var jd=!1;function ro(){if(jd){var t=S;if(t!==null)throw t}}function so(t,n,l,o){jd=!1;var f=t.updateQueue;ul=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var I=E,P=I.next;I.next=null,v===null?h=P:v.next=P,v=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,E=ne.lastBaseUpdate,E!==v&&(E===null?ne.firstBaseUpdate=P:E.next=P,ne.lastBaseUpdate=I))}if(h!==null){var se=f.baseState;v=0,ne=P=I=null,E=h;do{var K=E.lane&-536870913,Z=K!==E.lane;if(Z?(Qe&K)===K:(o&K)===K){K!==0&&K===k&&(jd=!0),ne!==null&&(ne=ne.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ke=t,Oe=E;K=n;var pt=l;switch(Oe.tag){case 1:if(ke=Oe.payload,typeof ke=="function"){se=ke.call(pt,se,K);break e}se=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Oe.payload,K=typeof ke=="function"?ke.call(pt,se,K):ke,K==null)break e;se=x({},se,K);break e;case 2:ul=!0}}K=E.callback,K!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[K]:Z.push(K))}else Z={lane:K,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ne===null?(P=ne=Z,I=se):ne=ne.next=Z,v|=K;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;Z=E,E=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);ne===null&&(I=se),f.baseState=I,f.firstBaseUpdate=P,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),gl|=v,t.lanes=v,t.memoizedState=se}}function $h(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Gh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)$h(l[t],n)}var Xr=A(null),Iu=A(0);function Vh(t,n){t=ka,C(Iu,t),C(Xr,n),ka=t|n.baseLanes}function Sd(){C(Iu,ka),C(Xr,Xr.current)}function Cd(){ka=Iu.current,z(Xr),z(Iu)}var Gn=A(null),ui=null;function fl(t){var n=t.alternate;C(Rt,Rt.current&1),C(Gn,t),ui===null&&(n===null||Xr.current!==null||n.memoizedState!==null)&&(ui=t)}function Td(t){C(Rt,Rt.current),C(Gn,t),ui===null&&(ui=t)}function Fh(t){t.tag===22?(C(Rt,Rt.current),C(Gn,t),ui===null&&(ui=t)):pl()}function pl(){C(Rt,Rt.current),C(Gn,Gn.current)}function Vn(t){z(Gn),ui===t&&(ui=null),z(Rt)}var Rt=A(0);function Uu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Mf(l)||Of(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ha=0,qe=null,dt=null,Bt=null,Bu=!1,Qr=!1,lr=!1,qu=0,oo=0,Zr=null,Ew=0;function At(){throw Error(r(321))}function Ed(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!bn(t[l],n[l]))return!1;return!0}function Ad(t,n,l,o,f,h){return ha=h,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?Am:Gd,lr=!1,h=l(o,f),lr=!1,Qr&&(h=Yh(n,l,o,f)),Ph(t),h}function Ph(t){V.H=fo;var n=dt!==null&&dt.next!==null;if(ha=0,Bt=dt=qe=null,Bu=!1,oo=0,Zr=null,n)throw Error(r(300));t===null||qt||(t=t.dependencies,t!==null&&si(t)&&(qt=!0))}function Yh(t,n,l,o){qe=t;var f=0;do{if(Qr&&(Zr=null),oo=0,Qr=!1,25<=f)throw Error(r(301));if(f+=1,Bt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=Nm,h=n(l,o)}while(Qr);return h}function Aw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?uo(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(qe.flags|=1024),n}function Nd(){var t=qu!==0;return qu=0,t}function Dd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function _d(t){if(Bu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Bu=!1}ha=0,Bt=dt=qe=null,Qr=!1,oo=qu=0,Zr=null}function wn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?qe.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function Mt(){if(dt===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=Bt===null?qe.memoizedState:Bt.next;if(n!==null)Bt=n,dt=t;else{if(t===null)throw qe.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?qe.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function Hu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function uo(t){var n=oo;return oo+=1,Zr===null&&(Zr=[]),t=Wr(Zr,t,n),n=qe,(Bt===null?n.memoizedState:Bt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?Am:Gd),t}function $u(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return uo(t);if(t.$$typeof===$)return Yt(t)}throw Error(r(438,String(t)))}function Rd(t){var n=null,l=qe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Hu(),qe.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=L;return n.index++,l}function ma(t,n){return typeof n=="function"?n(t):n}function Gu(t){var n=Mt();return Md(n,dt,t)}function Md(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var E=v=null,I=null,P=n,ne=!1;do{var se=P.lane&-536870913;if(se!==P.lane?(Qe&se)===se:(ha&se)===se){var K=P.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),se===k&&(ne=!0);else if((ha&K)===K){P=P.next,K===k&&(ne=!0);continue}else se={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(E=I=se,v=h):I=I.next=se,qe.lanes|=K,gl|=K;se=P.action,lr&&l(h,se),h=P.hasEagerState?P.eagerState:l(h,se)}else K={lane:se,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(E=I=K,v=h):I=I.next=K,qe.lanes|=se,gl|=se;P=P.next}while(P!==null&&P!==n);if(I===null?v=h:I.next=E,!bn(h,t.memoizedState)&&(qt=!0,ne&&(l=S,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Od(t){var n=Mt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);bn(h,n.memoizedState)||(qt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Wh(t,n,l){var o=qe,f=Mt(),h=Ge;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!bn((dt||f).memoizedState,l);if(v&&(f.memoizedState=l,qt=!0),f=f.queue,Id(Qh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||Bt!==null&&Bt.memoizedState.tag&1){if(o.flags|=2048,Jr(9,{destroy:void 0},Xh.bind(null,o,f,l,n),null),mt===null)throw Error(r(349));h||(ha&127)!==0||Kh(o,n,l)}return l}function Kh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=qe.updateQueue,n===null?(n=Hu(),qe.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Xh(t,n,l,o){n.value=l,n.getSnapshot=o,Zh(n)&&Jh(t)}function Qh(t,n,l){return l(function(){Zh(n)&&Jh(t)})}function Zh(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!bn(t,l)}catch{return!0}}function Jh(t){var n=sa(t,2);n!==null&&Ln(n,t,2)}function zd(t){var n=wn();if(typeof t=="function"){var l=t;if(t=l(),lr){ut(!0);try{l()}finally{ut(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:t},n}function em(t,n,l,o){return t.baseState=l,Md(t,dt,typeof o=="function"?o:ma)}function Nw(t,n,l,o,f){if(Pu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,tm(n,h)):(h.next=l.next,n.pending=l.next=h)}}function tm(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var E=l(f,o),I=V.S;I!==null&&I(v,E),nm(t,n,E)}catch(P){Ld(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=l(f,o),nm(t,n,h)}catch(P){Ld(t,n,P)}}function nm(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){im(t,n,o)},function(o){return Ld(t,n,o)}):im(t,n,l)}function im(t,n,l){n.status="fulfilled",n.value=l,am(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,tm(t,l)))}function Ld(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,am(n),n=n.next;while(n!==o)}t.action=null}function am(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function lm(t,n){return n}function rm(t,n){if(Ge){var l=mt.formState;if(l!==null){e:{var o=qe;if(Ge){if(ct){t:{for(var f=ct,h=_n;f.nodeType!==8;){if(!h){f=null;break t}if(f=ci(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ct=ci(f.nextSibling),o=f.data==="F!";break e}}Vi(o)}o=!1}o&&(n=l[0])}}return l=wn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lm,lastRenderedState:n},l.queue=o,l=Cm.bind(null,qe,o),o.dispatch=l,o=zd(!1),h=$d.bind(null,qe,!1,o.queue),o=wn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Nw.bind(null,qe,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function sm(t){var n=Mt();return om(n,dt,t)}function om(t,n,l){if(n=Md(t,n,lm)[0],t=Gu(ma)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=uo(n)}catch(v){throw v===ht?ln:v}else o=n;n=Mt();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(qe.flags|=2048,Jr(9,{destroy:void 0},Dw.bind(null,f,l),null)),[o,h,t]}function Dw(t,n){t.action=n}function um(t){var n=Mt(),l=dt;if(l!==null)return om(n,l,t);Mt(),n=n.memoizedState,l=Mt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function Jr(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=Hu(),qe.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function cm(){return Mt().memoizedState}function Vu(t,n,l,o){var f=wn();qe.flags|=t,f.memoizedState=Jr(1|n,{destroy:void 0},l,o===void 0?null:o)}function Fu(t,n,l,o){var f=Mt();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&Ed(o,dt.memoizedState.deps)?f.memoizedState=Jr(n,h,l,o):(qe.flags|=t,f.memoizedState=Jr(1|n,h,l,o))}function dm(t,n){Vu(8390656,8,t,n)}function Id(t,n){Fu(2048,8,t,n)}function _w(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=Hu(),qe.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function fm(t){var n=Mt().memoizedState;return _w({ref:n,nextImpl:t}),function(){if((lt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function pm(t,n){return Fu(4,2,t,n)}function hm(t,n){return Fu(4,4,t,n)}function mm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function gm(t,n,l){l=l!=null?l.concat([t]):null,Fu(4,4,mm.bind(null,n,t),l)}function Ud(){}function ym(t,n){var l=Mt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&Ed(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function xm(t,n){var l=Mt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&Ed(n,o[1]))return o[0];if(o=t(),lr){ut(!0);try{t()}finally{ut(!1)}}return l.memoizedState=[o,n],o}function Bd(t,n,l){return l===void 0||(ha&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=bg(),qe.lanes|=t,gl|=t,l)}function bm(t,n,l,o){return bn(l,n)?l:Xr.current!==null?(t=Bd(t,l,o),bn(t,n)||(qt=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Qe&261930)===0?(qt=!0,t.memoizedState=l):(t=bg(),qe.lanes|=t,gl|=t,n)}function vm(t,n,l,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=V.T,E={};V.T=E,$d(t,!1,n,l);try{var I=f(),P=V.S;if(P!==null&&P(E,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=J(I,o);co(t,n,ne,Yn(t))}else co(t,n,o,Yn(t))}catch(se){co(t,n,{then:function(){},status:"rejected",reason:se},Yn())}finally{oe.p=h,v!==null&&E.types!==null&&(v.types=E.types),V.T=v}}function Rw(){}function qd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=wm(t).queue;vm(t,f,n,xe,l===null?Rw:function(){return km(t),l(o)})}function wm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:xe},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function km(t){var n=wm(t);n.next===null&&(n=t.alternate.memoizedState),co(t,n.next.queue,{},Yn())}function Hd(){return Yt(Ao)}function jm(){return Mt().memoizedState}function Sm(){return Mt().memoizedState}function Mw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Yn();t=cl(l);var o=dl(n,t,l);o!==null&&(Ln(o,n,l),lo(o,n,l)),n={cache:Yr()},t.payload=n;return}n=n.return}}function Ow(t,n,l){var o=Yn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Pu(t)?Tm(n,l):(l=Ws(t,n,l,o),l!==null&&(Ln(l,t,o),Em(l,n,o)))}function Cm(t,n,l){var o=Yn();co(t,n,l,o)}function co(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Pu(t))Tm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,E=h(v,l);if(f.hasEagerState=!0,f.eagerState=E,bn(E,v))return $r(t,n,f,0),mt===null&&Zl(),!1}catch{}finally{}if(l=Ws(t,n,f,o),l!==null)return Ln(l,t,o),Em(l,n,o),!0}return!1}function $d(t,n,l,o){if(o={lane:2,revertLane:wf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Pu(t)){if(n)throw Error(r(479))}else n=Ws(t,l,o,2),n!==null&&Ln(n,t,2)}function Pu(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function Tm(t,n){Qr=Bu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Em(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ra(t,l)}}var fo={readContext:Yt,use:$u,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};fo.useEffectEvent=At;var Am={readContext:Yt,use:$u,useCallback:function(t,n){return wn().memoizedState=[t,n===void 0?null:n],t},useContext:Yt,useEffect:dm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Vu(4194308,4,mm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Vu(4194308,4,t,n)},useInsertionEffect:function(t,n){Vu(4,2,t,n)},useMemo:function(t,n){var l=wn();n=n===void 0?null:n;var o=t();if(lr){ut(!0);try{t()}finally{ut(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=wn();if(l!==void 0){var f=l(n);if(lr){ut(!0);try{l(n)}finally{ut(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=Ow.bind(null,qe,t),[o.memoizedState,t]},useRef:function(t){var n=wn();return t={current:t},n.memoizedState=t},useState:function(t){t=zd(t);var n=t.queue,l=Cm.bind(null,qe,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Ud,useDeferredValue:function(t,n){var l=wn();return Bd(l,t,n)},useTransition:function(){var t=zd(!1);return t=vm.bind(null,qe,t.queue,!0,!1),wn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=qe,f=wn();if(Ge){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),mt===null)throw Error(r(349));(Qe&127)!==0||Kh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,dm(Qh.bind(null,o,h,t),[t]),o.flags|=2048,Jr(9,{destroy:void 0},Xh.bind(null,o,h,l,n),null),l},useId:function(){var t=wn(),n=mt.identifierPrefix;if(Ge){var l=ri,o=Dn;l=(o&~(1<<32-rt(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=qu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Ew++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Hd,useFormState:rm,useActionState:rm,useOptimistic:function(t){var n=wn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=$d.bind(null,qe,!0,l),l.dispatch=n,[t,n]},useMemoCache:Rd,useCacheRefresh:function(){return wn().memoizedState=Mw.bind(null,qe)},useEffectEvent:function(t){var n=wn(),l={impl:t};return n.memoizedState=l,function(){if((lt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Gd={readContext:Yt,use:$u,useCallback:ym,useContext:Yt,useEffect:Id,useImperativeHandle:gm,useInsertionEffect:pm,useLayoutEffect:hm,useMemo:xm,useReducer:Gu,useRef:cm,useState:function(){return Gu(ma)},useDebugValue:Ud,useDeferredValue:function(t,n){var l=Mt();return bm(l,dt.memoizedState,t,n)},useTransition:function(){var t=Gu(ma)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:uo(t),n]},useSyncExternalStore:Wh,useId:jm,useHostTransitionStatus:Hd,useFormState:sm,useActionState:sm,useOptimistic:function(t,n){var l=Mt();return em(l,dt,t,n)},useMemoCache:Rd,useCacheRefresh:Sm};Gd.useEffectEvent=fm;var Nm={readContext:Yt,use:$u,useCallback:ym,useContext:Yt,useEffect:Id,useImperativeHandle:gm,useInsertionEffect:pm,useLayoutEffect:hm,useMemo:xm,useReducer:Od,useRef:cm,useState:function(){return Od(ma)},useDebugValue:Ud,useDeferredValue:function(t,n){var l=Mt();return dt===null?Bd(l,t,n):bm(l,dt.memoizedState,t,n)},useTransition:function(){var t=Od(ma)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:uo(t),n]},useSyncExternalStore:Wh,useId:jm,useHostTransitionStatus:Hd,useFormState:um,useActionState:um,useOptimistic:function(t,n){var l=Mt();return dt!==null?em(l,dt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Rd,useCacheRefresh:Sm};Nm.useEffectEvent=fm;function Vd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Fd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Yn(),f=cl(o);f.payload=n,l!=null&&(f.callback=l),n=dl(t,f,o),n!==null&&(Ln(n,t,o),lo(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Yn(),f=cl(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=dl(t,f,o),n!==null&&(Ln(n,t,o),lo(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Yn(),o=cl(l);o.tag=2,n!=null&&(o.callback=n),n=dl(t,o,l),n!==null&&(Ln(n,t,l),lo(n,t,l))}};function Dm(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!Kl(l,o)||!Kl(f,h):!0}function _m(t,n,l,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==t&&Fd.enqueueReplaceState(n,n.state,null)}function rr(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Rm(t){qr(t)}function Mm(t){console.error(t)}function Om(t){qr(t)}function Yu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function zm(t,n,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Pd(t,n,l){return l=cl(l),l.tag=3,l.payload={element:null},l.callback=function(){Yu(t,n)},l}function Lm(t){return t=cl(t),t.tag=3,t}function Im(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){zm(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){zm(n,l,o),typeof f!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function zw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&al(n,l,f,!0),l=Gn.current,l!==null){switch(l.tag){case 31:case 13:return ui===null?lc():l.alternate===null&&Nt===0&&(Nt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===oi?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),xf(t,o,f)),!1;case 22:return l.flags|=65536,o===oi?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),xf(t,o,f)),!1}throw Error(r(435,l.tag))}return xf(t,o,f),lc(),!1}if(Ge)return n=Gn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Js&&(t=Error(r(422),{cause:o}),xi(An(t,l)))):(o!==Js&&(n=Error(r(423),{cause:o}),xi(An(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=An(o,l),f=Pd(t.stateNode,o,f),kd(t,f),Nt!==4&&(Nt=2)),!1;var h=Error(r(520),{cause:o});if(h=An(h,l),vo===null?vo=[h]:vo.push(h),Nt!==4&&(Nt=2),n===null)return!0;o=An(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Pd(l.stateNode,o,t),kd(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(yl===null||!yl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Lm(f),Im(f,t,l,o),kd(l,f),!1}l=l.return}while(l!==null);return!1}var Yd=Error(r(461)),qt=!1;function rn(t,n,l,o){n.child=t===null?Hh(n,null,l,o):ar(n,t.child,l,o)}function Um(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return pa(n),o=Ad(t,n,l,v,h,f),E=Nd(),t!==null&&!qt?(Dd(t,n,f),ga(t,n,f)):(Ge&&E&&yi(n),n.flags|=1,rn(t,n,o,f),n.child)}function Bm(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!Ks(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,qm(t,n,h,o,f)):(t=Gr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!tf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:Kl,l(v,o)&&t.ref===n.ref)return ga(t,n,f)}return n.flags|=1,t=li(h,o),t.ref=n.ref,t.return=n,n.child=t}function qm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(Kl(h,o)&&t.ref===n.ref)if(qt=!1,n.pendingProps=o=h,tf(t,f))(t.flags&131072)!==0&&(qt=!0);else return n.lanes=t.lanes,ga(t,n,f)}return Wd(t,n,l,o,f)}function Hm(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return $m(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ve(n,h!==null?h.cachePool:null),h!==null?Vh(n,h):Sd(),Fh(n);else return o=n.lanes=536870912,$m(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ve(n,h.cachePool),Vh(n,h),pl(),n.memoizedState=null):(t!==null&&ve(n,null),Sd(),pl());return rn(t,n,f,l),n.child}function po(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function $m(t,n,l,o,f){var h=Ae();return h=h===null?null:{parent:St._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ve(n,null),Sd(),Fh(n),t!==null&&al(t,n,o,!0),n.childLanes=f,null}function Wu(t,n){return n=Xu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Gm(t,n,l){return ar(n,t.child,null,l),t=Wu(n,n.pendingProps),t.flags|=2,Vn(n),n.memoizedState=null,t}function Lw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ge){if(o.mode==="hidden")return t=Wu(n,o),n.lanes=536870912,po(null,t);if(Td(n),(t=ct)?(t=ty(t,_n),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:$i!==null?{id:Dn,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},l=Mu(t),l.return=n,n.child=l,_t=n,ct=null)):t=null,t===null)throw Vi(n);return n.lanes=536870912,null}return Wu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Td(n),f)if(n.flags&256)n.flags&=-257,n=Gm(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(qt||al(t,n,l,!1),f=(l&t.childLanes)!==0,qt||f){if(o=mt,o!==null&&(v=ru(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,sa(t,v),Ln(o,t,v),Yd;lc(),n=Gm(t,n,l)}else t=h.treeContext,ct=ci(v.nextSibling),_t=n,Ge=!0,Gi=null,_n=!1,t!==null&&Zs(n,t),n=Wu(n,o),n.flags|=4096;return n}return t=li(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Ku(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function Wd(t,n,l,o,f){return pa(n),l=Ad(t,n,l,o,void 0,f),o=Nd(),t!==null&&!qt?(Dd(t,n,f),ga(t,n,f)):(Ge&&o&&yi(n),n.flags|=1,rn(t,n,l,f),n.child)}function Vm(t,n,l,o,f,h){return pa(n),n.updateQueue=null,l=Yh(n,o,l,f),Ph(t),o=Nd(),t!==null&&!qt?(Dd(t,n,h),ga(t,n,h)):(Ge&&o&&yi(n),n.flags|=1,rn(t,n,l,h),n.child)}function Fm(t,n,l,o,f){if(pa(n),n.stateNode===null){var h=Ja,v=l.contextType;typeof v=="object"&&v!==null&&(h=Yt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Fd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},vd(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Yt(v):Ja,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Vd(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Fd.enqueueReplaceState(h,h.state,null),so(n,o,h,f),ro(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var E=n.memoizedProps,I=rr(l,E);h.props=I;var P=h.context,ne=l.contextType;v=Ja,typeof ne=="object"&&ne!==null&&(v=Yt(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||P!==v)&&_m(n,h,o,v),ul=!1;var K=n.memoizedState;h.state=K,so(n,o,h,f),ro(),P=n.memoizedState,E||K!==P||ul?(typeof se=="function"&&(Vd(n,l,se,o),P=n.memoizedState),(I=ul||Dm(n,l,I,o,K,P,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,wd(t,n),v=n.memoizedProps,ne=rr(l,v),h.props=ne,se=n.pendingProps,K=h.context,P=l.contextType,I=Ja,typeof P=="object"&&P!==null&&(I=Yt(P)),E=l.getDerivedStateFromProps,(P=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==se||K!==I)&&_m(n,h,o,I),ul=!1,K=n.memoizedState,h.state=K,so(n,o,h,f),ro();var Z=n.memoizedState;v!==se||K!==Z||ul||t!==null&&t.dependencies!==null&&si(t.dependencies)?(typeof E=="function"&&(Vd(n,l,E,o),Z=n.memoizedState),(ne=ul||Dm(n,l,ne,o,K,Z,I)||t!==null&&t.dependencies!==null&&si(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Z,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Z,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Z),h.props=o,h.state=Z,h.context=I,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,Ku(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=ar(n,t.child,null,f),n.child=ar(n,null,l,f)):rn(t,n,l,f),n.memoizedState=h.state,t=n.child):t=ga(t,n,f),t}function Pm(t,n,l,o){return $n(),n.flags|=256,rn(t,n,l,o),n.child}var Kd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xd(t){return{baseLanes:t,cachePool:en()}}function Qd(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Pn),t}function Ym(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ge){if(f?fl(n):pl(),(t=ct)?(t=ty(t,_n),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:$i!==null?{id:Dn,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},l=Mu(t),l.return=n,n.child=l,_t=n,ct=null)):t=null,t===null)throw Vi(n);return Of(t)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(pl(),f=n.mode,E=Xu({mode:"hidden",children:E},f),o=ca(o,f,l,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Xd(l),o.childLanes=Qd(t,v,l),n.memoizedState=Kd,po(null,o)):(fl(n),Zd(n,E))}var I=t.memoizedState;if(I!==null&&(E=I.dehydrated,E!==null)){if(h)n.flags&256?(fl(n),n.flags&=-257,n=Jd(t,n,l)):n.memoizedState!==null?(pl(),n.child=t.child,n.flags|=128,n=null):(pl(),E=o.fallback,f=n.mode,o=Xu({mode:"visible",children:o.children},f),E=ca(E,f,l,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,ar(n,t.child,null,l),o=n.child,o.memoizedState=Xd(l),o.childLanes=Qd(t,v,l),n.memoizedState=Kd,n=po(null,o));else if(fl(n),Of(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,xi({value:o,source:null,stack:null}),n=Jd(t,n,l)}else if(qt||al(t,n,l,!1),v=(l&t.childLanes)!==0,qt||v){if(v=mt,v!==null&&(o=ru(v,l),o!==0&&o!==I.retryLane))throw I.retryLane=o,sa(t,o),Ln(v,t,o),Yd;Mf(E)||lc(),n=Jd(t,n,l)}else Mf(E)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,ct=ci(E.nextSibling),_t=n,Ge=!0,Gi=null,_n=!1,t!==null&&Zs(n,t),n=Zd(n,o.children),n.flags|=4096);return n}return f?(pl(),E=o.fallback,f=n.mode,I=t.child,P=I.sibling,o=li(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,P!==null?E=li(P,E):(E=ca(E,f,l,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,po(null,o),o=n.child,E=t.child.memoizedState,E===null?E=Xd(l):(f=E.cachePool,f!==null?(I=St._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=en(),E={baseLanes:E.baseLanes|l,cachePool:f}),o.memoizedState=E,o.childLanes=Qd(t,v,l),n.memoizedState=Kd,po(t.child,o)):(fl(n),l=t.child,t=l.sibling,l=li(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=l,n.memoizedState=null,l)}function Zd(t,n){return n=Xu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Xu(t,n){return t=dn(22,t,null,n),t.lanes=0,t}function Jd(t,n,l){return ar(n,t.child,null,l),t=Zd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Wm(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),no(t.return,n,l)}function ef(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Km(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Rt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,C(Rt,v),rn(t,n,o,l),o=Ge?Jl:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Wm(t,l,n);else if(t.tag===19)Wm(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Uu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),ef(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Uu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}ef(n,!0,l,null,h,o);break;case"together":ef(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ga(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),gl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(al(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=li(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=li(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function tf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&si(t)))}function Iw(t,n,l){switch(n.tag){case 3:Re(n,n.stateNode.containerInfo),et(n,St,t.memoizedState.cache),$n();break;case 27:case 5:jt(n);break;case 4:Re(n,n.stateNode.containerInfo);break;case 10:et(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Td(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(fl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Ym(t,n,l):(fl(n),t=ga(t,n,l),t!==null?t.sibling:null);fl(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(al(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Km(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Rt,Rt.current),o)break;return null;case 22:return n.lanes=0,Hm(t,n,l,n.pendingProps);case 24:et(n,St,t.memoizedState.cache)}return ga(t,n,l)}function Xm(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)qt=!0;else{if(!tf(t,l)&&(n.flags&128)===0)return qt=!1,Iw(t,n,l);qt=(t.flags&131072)!==0}else qt=!1,Ge&&(n.flags&1048576)!==0&&er(n,Jl,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=nr(n.elementType),n.type=t,typeof t=="function")Ks(t)?(o=rr(t,o),n.tag=1,n=Fm(null,n,t,o,l)):(n.tag=0,n=Wd(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===W){n.tag=11,n=Um(null,n,t,o,l);break e}else if(f===Q){n.tag=14,n=Bm(null,n,t,o,l);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Wd(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=rr(o,n.pendingProps),Fm(t,n,o,f,l);case 3:e:{if(Re(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,wd(t,n),so(n,o,null,l);var v=n.memoizedState;if(o=v.cache,et(n,St,o),o!==h.cache&&vn(n,[St],l,!0),ro(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Pm(t,n,o,l);break e}else if(o!==f){f=An(Error(r(424)),n),xi(f),n=Pm(t,n,o,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ct=ci(t.firstChild),_t=n,Ge=!0,Gi=null,_n=!0,l=Hh(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if($n(),o===f){n=ga(t,n,l);break e}rn(t,n,o,l)}n=n.child}return n;case 26:return Ku(t,n),t===null?(l=sy(n.type,null,n.pendingProps,null))?n.memoizedState=l:Ge||(l=n.type,t=n.pendingProps,o=fc(X.current).createElement(l),o[Pt]=n,o[Lt]=t,sn(o,l,t),Et(o),n.stateNode=o):n.memoizedState=sy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return jt(n),t===null&&Ge&&(o=n.stateNode=ay(n.type,n.pendingProps,X.current),_t=n,_n=!0,f=ct,wl(n.type)?(zf=f,ct=ci(o.firstChild)):ct=f),rn(t,n,n.pendingProps.children,l),Ku(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ge&&((f=o=ct)&&(o=pk(o,n.type,n.pendingProps,_n),o!==null?(n.stateNode=o,_t=n,ct=ci(o.firstChild),_n=!1,f=!0):f=!1),f||Vi(n)),jt(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Df(f,h)?o=null:v!==null&&Df(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=Ad(t,n,Aw,null,null,l),Ao._currentValue=f),Ku(t,n),rn(t,n,o,l),n.child;case 6:return t===null&&Ge&&((t=l=ct)&&(l=hk(l,n.pendingProps,_n),l!==null?(n.stateNode=l,_t=n,ct=null,t=!0):t=!1),t||Vi(n)),null;case 13:return Ym(t,n,l);case 4:return Re(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=ar(n,null,o,l):rn(t,n,o,l),n.child;case 11:return Um(t,n,n.type,n.pendingProps,l);case 7:return rn(t,n,n.pendingProps,l),n.child;case 8:return rn(t,n,n.pendingProps.children,l),n.child;case 12:return rn(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,et(n,n.type,o.value),rn(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,pa(n),f=Yt(f),o=o(f),n.flags|=1,rn(t,n,o,l),n.child;case 14:return Bm(t,n,n.type,n.pendingProps,l);case 15:return qm(t,n,n.type,n.pendingProps,l);case 19:return Km(t,n,l);case 31:return Lw(t,n,l);case 22:return Hm(t,n,l,n.pendingProps);case 24:return pa(n),o=Yt(St),t===null?(f=Ae(),f===null&&(f=mt,h=Yr(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},vd(n),et(n,St,f)):((t.lanes&l)!==0&&(wd(t,n),so(n,null,null,l),ro()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),et(n,St,o)):(o=h.cache,et(n,St,o),o!==f.cache&&vn(n,[St],l,!0))),rn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function ya(t){t.flags|=4}function nf(t,n,l,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(jg())t.flags|=8192;else throw ir=oi,sl}else t.flags&=-16777217}function Qm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!fy(n))if(jg())t.flags|=8192;else throw ir=oi,sl}function Qu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?bt():536870912,t.lanes|=n,is|=n)}function ho(t,n){if(!Ge)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function vt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,n}function Uw(t,n,l){var o=n.pendingProps;switch(tr(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(n),null;case 1:return vt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),fn(St),Fe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(il(n)?ya(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,da())),vt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(ya(n),h!==null?(vt(n),Qm(n,h)):(vt(n),nf(n,f,null,o,l))):h?h!==t.memoizedState?(ya(n),vt(n),Qm(n,h)):(vt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&ya(n),vt(n),nf(n,f,t,o,l)),null;case 27:if(xt(n),l=X.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return vt(n),null}t=Y.current,il(n)?eo(n):(t=ay(f,o,l),n.stateNode=t,ya(n))}return vt(n),null;case 5:if(xt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return vt(n),null}if(h=Y.current,il(n))eo(n);else{var v=fc(X.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Pt]=n,h[Lt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(sn(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ya(n)}}return vt(n),nf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=X.current,il(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=_t,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Pt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Yg(t.nodeValue,l)),t||Vi(n,!0)}else t=fc(t).createTextNode(o),t[Pt]=n,n.stateNode=t}return vt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=il(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Pt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),t=!1}else l=da(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Vn(n),n):(Vn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=il(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Pt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=da(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Vn(n),n):(Vn(n),null)}return Vn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Qu(n,n.updateQueue),vt(n),null);case 4:return Fe(),t===null&&Cf(n.stateNode.containerInfo),vt(n),null;case 10:return fn(n.type),vt(n),null;case 19:if(z(Rt),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)ho(o,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Uu(t),h!==null){for(n.flags|=128,ho(o,!1),t=h.updateQueue,n.updateQueue=t,Qu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Ru(l,t),l=l.sibling;return C(Rt,Rt.current&1|2),Ge&&gi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Dt()>nc&&(n.flags|=128,f=!0,ho(o,!1),n.lanes=4194304)}else{if(!f)if(t=Uu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Qu(n,t),ho(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ge)return vt(n),null}else 2*Dt()-o.renderingStartTime>nc&&l!==536870912&&(n.flags|=128,f=!0,ho(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Dt(),t.sibling=null,l=Rt.current,C(Rt,f?l&1|2:l&1),Ge&&gi(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return Vn(n),Cd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),l=n.updateQueue,l!==null&&Qu(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z(Le),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),fn(St),vt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Bw(t,n){switch(tr(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return fn(St),Fe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return xt(n),null;case 31:if(n.memoizedState!==null){if(Vn(n),n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Vn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(Rt),null;case 4:return Fe(),null;case 10:return fn(n.type),null;case 22:case 23:return Vn(n),Cd(),t!==null&&z(Le),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return fn(St),null;case 25:return null;default:return null}}function Zm(t,n){switch(tr(n),n.tag){case 3:fn(St),Fe();break;case 26:case 27:case 5:xt(n);break;case 4:Fe();break;case 31:n.memoizedState!==null&&Vn(n);break;case 13:Vn(n);break;case 19:z(Rt);break;case 10:fn(n.type);break;case 22:case 23:Vn(n),Cd(),t!==null&&z(Le);break;case 24:fn(St)}}function mo(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(E){ot(n,n.return,E)}}function hl(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,f=n;var I=l,P=E;try{P()}catch(ne){ot(f,I,ne)}}}o=o.next}while(o!==h)}}catch(ne){ot(n,n.return,ne)}}function Jm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Gh(n,l)}catch(o){ot(t,t.return,o)}}}function eg(t,n,l){l.props=rr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ot(t,n,o)}}function go(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){ot(t,n,f)}}function Fi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ot(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){ot(t,n,f)}else l.current=null}function tg(t){var n=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){ot(t,t.return,f)}}function af(t,n,l){try{var o=t.stateNode;sk(o,t.type,l,n),o[Lt]=n}catch(f){ot(t,t.return,f)}}function ng(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&wl(t.type)||t.tag===4}function lf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ng(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&wl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rf(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=yn));else if(o!==4&&(o===27&&wl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(rf(t,n,l),t=t.sibling;t!==null;)rf(t,n,l),t=t.sibling}function Zu(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(o!==4&&(o===27&&wl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Zu(t,n,l),t=t.sibling;t!==null;)Zu(t,n,l),t=t.sibling}function ig(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);sn(n,o,l),n[Pt]=t,n[Lt]=l}catch(h){ot(t,t.return,h)}}var xa=!1,Ht=!1,sf=!1,ag=typeof WeakSet=="function"?WeakSet:Set,tn=null;function qw(t,n){if(t=t.containerInfo,Af=bc,t=Tu(t),Hs(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,E=-1,I=-1,P=0,ne=0,se=t,K=null;t:for(;;){for(var Z;se!==l||f!==0&&se.nodeType!==3||(E=v+f),se!==h||o!==0&&se.nodeType!==3||(I=v+o),se.nodeType===3&&(v+=se.nodeValue.length),(Z=se.firstChild)!==null;)K=se,se=Z;for(;;){if(se===t)break t;if(K===l&&++P===f&&(E=v),K===h&&++ne===o&&(I=v),(Z=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=Z}l=E===-1||I===-1?null:{start:E,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Nf={focusedElem:t,selectionRange:l},bc=!1,tn=n;tn!==null;)if(n=tn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,tn=t;else for(;tn!==null;){switch(n=tn,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var ke=rr(l.type,f);t=o.getSnapshotBeforeUpdate(ke,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){ot(l,l.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Rf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Rf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,tn=t;break}tn=n.return}}function lg(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:va(t,l),o&4&&mo(5,l);break;case 1:if(va(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ot(l,l.return,v)}else{var f=rr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ot(l,l.return,v)}}o&64&&Jm(l),o&512&&go(l,l.return);break;case 3:if(va(t,l),o&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Gh(t,n)}catch(v){ot(l,l.return,v)}}break;case 27:n===null&&o&4&&ig(l);case 26:case 5:va(t,l),n===null&&o&4&&tg(l),o&512&&go(l,l.return);break;case 12:va(t,l);break;case 31:va(t,l),o&4&&og(t,l);break;case 13:va(t,l),o&4&&ug(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Kw.bind(null,l),mk(t,l))));break;case 22:if(o=l.memoizedState!==null||xa,!o){n=n!==null&&n.memoizedState!==null||Ht,f=xa;var h=Ht;xa=o,(Ht=n)&&!h?wa(t,l,(l.subtreeFlags&8772)!==0):va(t,l),xa=f,Ht=h}break;case 30:break;default:va(t,l)}}function rg(t){var n=t.alternate;n!==null&&(t.alternate=null,rg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Cs(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var kt=null,Rn=!1;function ba(t,n,l){for(l=l.child;l!==null;)sg(t,n,l),l=l.sibling}function sg(t,n,l){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Ft,l)}catch{}switch(l.tag){case 26:Ht||Fi(l,n),ba(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Ht||Fi(l,n);var o=kt,f=Rn;wl(l.type)&&(kt=l.stateNode,Rn=!1),ba(t,n,l),Co(l.stateNode),kt=o,Rn=f;break;case 5:Ht||Fi(l,n);case 6:if(o=kt,f=Rn,kt=null,ba(t,n,l),kt=o,Rn=f,kt!==null)if(Rn)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(l.stateNode)}catch(h){ot(l,n,h)}else try{kt.removeChild(l.stateNode)}catch(h){ot(l,n,h)}break;case 18:kt!==null&&(Rn?(t=kt,Jg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ds(t)):Jg(kt,l.stateNode));break;case 4:o=kt,f=Rn,kt=l.stateNode.containerInfo,Rn=!0,ba(t,n,l),kt=o,Rn=f;break;case 0:case 11:case 14:case 15:hl(2,l,n),Ht||hl(4,l,n),ba(t,n,l);break;case 1:Ht||(Fi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&eg(l,n,o)),ba(t,n,l);break;case 21:ba(t,n,l);break;case 22:Ht=(o=Ht)||l.memoizedState!==null,ba(t,n,l),Ht=o;break;default:ba(t,n,l)}}function og(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ds(t)}catch(l){ot(n,n.return,l)}}}function ug(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ds(t)}catch(l){ot(n,n.return,l)}}function Hw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new ag),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new ag),n;default:throw Error(r(435,t.tag))}}function Ju(t,n){var l=Hw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Xw.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(wl(E.type)){kt=E.stateNode,Rn=!1;break e}break;case 5:kt=E.stateNode,Rn=!1;break e;case 3:case 4:kt=E.stateNode.containerInfo,Rn=!0;break e}E=E.return}if(kt===null)throw Error(r(160));sg(h,v,f),kt=null,Rn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)cg(n,t),n=n.sibling}var vi=null;function cg(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(hl(3,t,t.return),mo(3,t),hl(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&(Ht||l===null||Fi(l,l.return)),o&64&&xa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=vi;if(Mn(n,t),On(t),o&512&&(Ht||l===null||Fi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Ei]||h[Pt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),sn(h,o,l),h[Pt]=t,Et(h),o=h;break e;case"link":var v=cy("link","href",f).get(o+(l.href||""));if(v){for(var E=0;E<v.length;E++)if(h=v[E],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(E,1);break t}}h=f.createElement(o),sn(h,o,l),f.head.appendChild(h);break;case"meta":if(v=cy("meta","content",f).get(o+(l.content||""))){for(E=0;E<v.length;E++)if(h=v[E],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(E,1);break t}}h=f.createElement(o),sn(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Pt]=t,Et(h),o=h}t.stateNode=o}else dy(f,t.type,t.stateNode);else t.stateNode=uy(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?dy(f,t.type,t.stateNode):uy(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&af(t,t.memoizedProps,l.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&(Ht||l===null||Fi(l,l.return)),l!==null&&o&4&&af(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&(Ht||l===null||Fi(l,l.return)),t.flags&32){f=t.stateNode;try{ti(f,"")}catch(ke){ot(t,t.return,ke)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,af(t,f,l!==null?l.memoizedProps:f)),o&1024&&(sf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(ke){ot(t,t.return,ke)}}break;case 3:if(mc=null,f=vi,vi=pc(n.containerInfo),Mn(n,t),vi=f,On(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ds(n.containerInfo)}catch(ke){ot(t,t.return,ke)}sf&&(sf=!1,dg(t));break;case 4:o=vi,vi=pc(t.stateNode.containerInfo),Mn(n,t),On(t),vi=o;break;case 12:Mn(n,t),On(t);break;case 31:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ju(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(tc=Dt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ju(t,o)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,P=xa,ne=Ht;if(xa=P||f,Ht=ne||I,Mn(n,t),Ht=ne,xa=P,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||I||xa||Ht||sr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){I=l=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=I.stateNode;var se=I.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;E.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(ke){ot(I,I.return,ke)}}}else if(n.tag===6){if(l===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ke){ot(I,I.return,ke)}}}else if(n.tag===18){if(l===null){I=n;try{var Z=I.stateNode;f?ey(Z,!0):ey(I.stateNode,!1)}catch(ke){ot(I,I.return,ke)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,Ju(t,l))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ju(t,o)));break;case 30:break;case 21:break;default:Mn(n,t),On(t)}}function On(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(ng(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=lf(t);Zu(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(ti(v,""),l.flags&=-33);var E=lf(t);Zu(t,E,v);break;case 3:case 4:var I=l.stateNode.containerInfo,P=lf(t);rf(t,P,I);break;default:throw Error(r(161))}}catch(ne){ot(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function dg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;dg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function va(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)lg(t,n.alternate,n),n=n.sibling}function sr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:hl(4,n,n.return),sr(n);break;case 1:Fi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&eg(n,n.return,l),sr(n);break;case 27:Co(n.stateNode);case 26:case 5:Fi(n,n.return),sr(n);break;case 22:n.memoizedState===null&&sr(n);break;case 30:sr(n);break;default:sr(n)}t=t.sibling}}function wa(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:wa(f,h,l),mo(4,h);break;case 1:if(wa(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){ot(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var E=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)$h(I[f],E)}catch(P){ot(o,o.return,P)}}l&&v&64&&Jm(h),go(h,h.return);break;case 27:ig(h);case 26:case 5:wa(f,h,l),l&&o===null&&v&4&&tg(h),go(h,h.return);break;case 12:wa(f,h,l);break;case 31:wa(f,h,l),l&&v&4&&og(f,h);break;case 13:wa(f,h,l),l&&v&4&&ug(f,h);break;case 22:h.memoizedState===null&&wa(f,h,l),go(h,h.return);break;case 30:break;default:wa(f,h,l)}n=n.sibling}}function of(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&ll(l))}function uf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ll(t))}function wi(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)fg(t,n,l,o),n=n.sibling}function fg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:wi(t,n,l,o),f&2048&&mo(9,n);break;case 1:wi(t,n,l,o);break;case 3:wi(t,n,l,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ll(t)));break;case 12:if(f&2048){wi(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,E=h.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ot(n,n.return,I)}}else wi(t,n,l,o);break;case 31:wi(t,n,l,o);break;case 13:wi(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?wi(t,n,l,o):yo(t,n):h._visibility&2?wi(t,n,l,o):(h._visibility|=2,es(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&of(v,n);break;case 24:wi(t,n,l,o),f&2048&&uf(n.alternate,n);break;default:wi(t,n,l,o)}}function es(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,E=l,I=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:es(h,v,E,I,f),mo(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?es(h,v,E,I,f):yo(h,v):(ne._visibility|=2,es(h,v,E,I,f)),f&&P&2048&&of(v.alternate,v);break;case 24:es(h,v,E,I,f),f&&P&2048&&uf(v.alternate,v);break;default:es(h,v,E,I,f)}n=n.sibling}}function yo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,o=n,f=o.flags;switch(o.tag){case 22:yo(l,o),f&2048&&of(o.alternate,o);break;case 24:yo(l,o),f&2048&&uf(o.alternate,o);break;default:yo(l,o)}n=n.sibling}}var xo=8192;function ts(t,n,l){if(t.subtreeFlags&xo)for(t=t.child;t!==null;)pg(t,n,l),t=t.sibling}function pg(t,n,l){switch(t.tag){case 26:ts(t,n,l),t.flags&xo&&t.memoizedState!==null&&Ek(l,vi,t.memoizedState,t.memoizedProps);break;case 5:ts(t,n,l);break;case 3:case 4:var o=vi;vi=pc(t.stateNode.containerInfo),ts(t,n,l),vi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=xo,xo=16777216,ts(t,n,l),xo=o):ts(t,n,l));break;default:ts(t,n,l)}}function hg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function bo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];tn=o,gg(o,t)}hg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mg(t),t=t.sibling}function mg(t){switch(t.tag){case 0:case 11:case 15:bo(t),t.flags&2048&&hl(9,t,t.return);break;case 3:bo(t);break;case 12:bo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,ec(t)):bo(t);break;default:bo(t)}}function ec(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];tn=o,gg(o,t)}hg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:hl(8,n,n.return),ec(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,ec(n));break;default:ec(n)}t=t.sibling}}function gg(t,n){for(;tn!==null;){var l=tn;switch(l.tag){case 0:case 11:case 15:hl(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ll(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,tn=o;else e:for(l=t;tn!==null;){o=tn;var f=o.sibling,h=o.return;if(rg(o),o===l){tn=null;break e}if(f!==null){f.return=h,tn=f;break e}tn=h}}}var $w={getCacheForType:function(t){var n=Yt(St),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Yt(St).controller.signal}},Gw=typeof WeakMap=="function"?WeakMap:Map,lt=0,mt=null,Ye=null,Qe=0,st=0,Fn=null,ml=!1,ns=!1,cf=!1,ka=0,Nt=0,gl=0,or=0,df=0,Pn=0,is=0,vo=null,zn=null,ff=!1,tc=0,yg=0,nc=1/0,ic=null,yl=null,Wt=0,xl=null,as=null,ja=0,pf=0,hf=null,xg=null,wo=0,mf=null;function Yn(){return(lt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?wf():Ss()}function bg(){if(Pn===0)if((Qe&536870912)===0||Ge){var t=kr;kr<<=1,(kr&3932160)===0&&(kr=262144),Pn=t}else Pn=536870912;return t=Gn.current,t!==null&&(t.flags|=32),Pn}function Ln(t,n,l){(t===mt&&(st===2||st===9)||t.cancelPendingCommit!==null)&&(ls(t,0),bl(t,Qe,Pn,!1)),_a(t,l),((lt&2)===0||t!==mt)&&(t===mt&&((lt&2)===0&&(or|=l),Nt===4&&bl(t,Qe,Pn,!1)),Pi(t))}function vg(t,n,l){if((lt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||nn(t,n),f=o?Pw(t,n):yf(t,n,!0),h=o;do{if(f===0){ns&&!o&&bl(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Vw(l)){f=yf(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var E=t;f=vo;var I=E.current.memoizedState.isDehydrated;if(I&&(ls(E,v).flags|=256),v=yf(E,v,!1),v!==2){if(cf&&!I){E.errorRecoveryDisabledLanes|=h,or|=h,f=4;break e}h=zn,zn=f,h!==null&&(zn===null?zn=h:zn.push.apply(zn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){ls(t,0),bl(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:bl(o,n,Pn,!ml);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=tc+300-Dt(),10<f)){if(bl(o,n,Pn,!ml),Na(o,0,!0)!==0)break e;ja=n,o.timeoutHandle=Qg(wg.bind(null,o,l,zn,ic,ff,n,Pn,or,is,ml,h,"Throttled",-0,0),f);break e}wg(o,l,zn,ic,ff,n,Pn,or,is,ml,h,null,-0,0)}}break}while(!0);Pi(t)}function wg(t,n,l,o,f,h,v,E,I,P,ne,se,K,Z){if(t.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},pg(n,h,se);var ke=(h&62914560)===h?tc-Dt():(h&4194048)===h?yg-Dt():0;if(ke=Ak(se,ke),ke!==null){ja=h,t.cancelPendingCommit=ke(Ng.bind(null,t,n,h,l,o,f,v,E,I,ne,se,null,K,Z)),bl(t,h,v,!P);return}}Ng(t,n,h,l,o,f,v,E,I)}function Vw(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!bn(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function bl(t,n,l,o){n&=~df,n&=~or,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&ks(t,l,n)}function ac(){return(lt&6)===0?(ko(0),!1):!0}function gf(){if(Ye!==null){if(st===0)var t=Ye.return;else t=Ye,bi=fa=null,_d(t),Kr=null,io=0,t=Ye;for(;t!==null;)Zm(t.alternate,t),t=t.return;Ye=null}}function ls(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,ck(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),ja=0,gf(),mt=t,Ye=l=li(t.current,null),Qe=n,st=0,Fn=null,ml=!1,ns=nn(t,n),cf=!1,is=Pn=df=or=gl=Nt=0,zn=vo=null,ff=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-rt(o),h=1<<f;n|=t[f],o&=~h}return ka=n,Zl(),l}function kg(t,n){qe=null,V.H=fo,n===ht||n===ln?(n=Uh(),st=3):n===sl?(n=Uh(),st=4):st=n===Yd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Fn=n,Ye===null&&(Nt=1,Yu(t,An(n,t.current)))}function jg(){var t=Gn.current;return t===null?!0:(Qe&4194048)===Qe?ui===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===ui:!1}function Sg(){var t=V.H;return V.H=fo,t===null?fo:t}function Cg(){var t=V.A;return V.A=$w,t}function lc(){Nt=4,ml||(Qe&4194048)!==Qe&&Gn.current!==null||(ns=!0),(gl&134217727)===0&&(or&134217727)===0||mt===null||bl(mt,Qe,Pn,!1)}function yf(t,n,l){var o=lt;lt|=2;var f=Sg(),h=Cg();(mt!==t||Qe!==n)&&(ic=null,ls(t,n)),n=!1;var v=Nt;e:do try{if(st!==0&&Ye!==null){var E=Ye,I=Fn;switch(st){case 8:gf(),v=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(n=!0);var P=st;if(st=0,Fn=null,rs(t,E,I,P),l&&ns){v=0;break e}break;default:P=st,st=0,Fn=null,rs(t,E,I,P)}}Fw(),v=Nt;break}catch(ne){kg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,bi=fa=null,lt=o,V.H=f,V.A=h,Ye===null&&(mt=null,Qe=0,Zl()),v}function Fw(){for(;Ye!==null;)Tg(Ye)}function Pw(t,n){var l=lt;lt|=2;var o=Sg(),f=Cg();mt!==t||Qe!==n?(ic=null,nc=Dt()+500,ls(t,n)):ns=nn(t,n);e:do try{if(st!==0&&Ye!==null){n=Ye;var h=Fn;t:switch(st){case 1:st=0,Fn=null,rs(t,n,h,1);break;case 2:case 9:if(ol(h)){st=0,Fn=null,Eg(n);break}n=function(){st!==2&&st!==9||mt!==t||(st=7),Pi(t)},h.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:ol(h)?(st=0,Fn=null,Eg(n)):(st=0,Fn=null,rs(t,n,h,7));break;case 5:var v=null;switch(Ye.tag){case 26:v=Ye.memoizedState;case 5:case 27:var E=Ye;if(v?fy(v):E.stateNode.complete){st=0,Fn=null;var I=E.sibling;if(I!==null)Ye=I;else{var P=E.return;P!==null?(Ye=P,rc(P)):Ye=null}break t}}st=0,Fn=null,rs(t,n,h,5);break;case 6:st=0,Fn=null,rs(t,n,h,6);break;case 8:gf(),Nt=6;break e;default:throw Error(r(462))}}Yw();break}catch(ne){kg(t,ne)}while(!0);return bi=fa=null,V.H=o,V.A=f,lt=l,Ye!==null?0:(mt=null,Qe=0,Zl(),Nt)}function Yw(){for(;Ye!==null&&!Xn();)Tg(Ye)}function Tg(t){var n=Xm(t.alternate,t,ka);t.memoizedProps=t.pendingProps,n===null?rc(t):Ye=n}function Eg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Vm(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Vm(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:_d(n);default:Zm(l,n),n=Ye=Ru(n,ka),n=Xm(l,n,ka)}t.memoizedProps=t.pendingProps,n===null?rc(t):Ye=n}function rs(t,n,l,o){bi=fa=null,_d(n),Kr=null,io=0;var f=n.return;try{if(zw(t,f,n,l,Qe)){Nt=1,Yu(t,An(l,t.current)),Ye=null;return}}catch(h){if(f!==null)throw Ye=f,h;Nt=1,Yu(t,An(l,t.current)),Ye=null;return}n.flags&32768?(Ge||o===1?t=!0:ns||(Qe&536870912)!==0?t=!1:(ml=t=!0,(o===2||o===9||o===3||o===6)&&(o=Gn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ag(n,t)):rc(n)}function rc(t){var n=t;do{if((n.flags&32768)!==0){Ag(n,ml);return}t=n.return;var l=Uw(n.alternate,n,ka);if(l!==null){Ye=l;return}if(n=n.sibling,n!==null){Ye=n;return}Ye=n=t}while(n!==null);Nt===0&&(Nt=5)}function Ag(t,n){do{var l=Bw(t.alternate,t);if(l!==null){l.flags&=32767,Ye=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=l}while(t!==null);Nt=6,Ye=null}function Ng(t,n,l,o,f,h,v,E,I){t.cancelPendingCommit=null;do sc();while(Wt!==0);if((lt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Hr,Ol(t,l,h,v,E,I),t===mt&&(Ye=mt=null,Qe=0),as=n,xl=t,ja=l,pf=h,hf=f,xg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Qw(Ce,function(){return Og(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,f=oe.p,oe.p=2,v=lt,lt|=4;try{qw(t,n,l)}finally{lt=v,oe.p=f,V.T=o}}Wt=1,Dg(),_g(),Rg()}}function Dg(){if(Wt===1){Wt=0;var t=xl,n=as,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=V.T,V.T=null;var o=oe.p;oe.p=2;var f=lt;lt|=4;try{cg(n,t);var h=Nf,v=Tu(t.containerInfo),E=h.focusedElem,I=h.selectionRange;if(v!==E&&E&&E.ownerDocument&&Cu(E.ownerDocument.documentElement,E)){if(I!==null&&Hs(E)){var P=I.start,ne=I.end;if(ne===void 0&&(ne=P),"selectionStart"in E)E.selectionStart=P,E.selectionEnd=Math.min(ne,E.value.length);else{var se=E.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var Z=K.getSelection(),ke=E.textContent.length,Oe=Math.min(I.start,ke),pt=I.end===void 0?Oe:Math.min(I.end,ke);!Z.extend&&Oe>pt&&(v=pt,pt=Oe,Oe=v);var G=Su(E,Oe),B=Su(E,pt);if(G&&B&&(Z.rangeCount!==1||Z.anchorNode!==G.node||Z.anchorOffset!==G.offset||Z.focusNode!==B.node||Z.focusOffset!==B.offset)){var F=se.createRange();F.setStart(G.node,G.offset),Z.removeAllRanges(),Oe>pt?(Z.addRange(F),Z.extend(B.node,B.offset)):(F.setEnd(B.node,B.offset),Z.addRange(F))}}}}for(se=[],Z=E;Z=Z.parentNode;)Z.nodeType===1&&se.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<se.length;E++){var le=se[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}bc=!!Af,Nf=Af=null}finally{lt=f,oe.p=o,V.T=l}}t.current=n,Wt=2}}function _g(){if(Wt===2){Wt=0;var t=xl,n=as,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=V.T,V.T=null;var o=oe.p;oe.p=2;var f=lt;lt|=4;try{lg(t,n.alternate,n)}finally{lt=f,oe.p=o,V.T=l}}Wt=3}}function Rg(){if(Wt===4||Wt===3){Wt=0,Ea();var t=xl,n=as,l=ja,o=xg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,as=xl=null,Mg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(yl=null),js(l),n=n.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Ft,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=oe.p,oe.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var E=o[v];h(E.value,{componentStack:E.stack})}}finally{V.T=n,oe.p=f}}(ja&3)!==0&&sc(),Pi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===mf?wo++:(wo=0,mf=t):wo=0,ko(0)}}function Mg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ll(n)))}function sc(){return Dg(),_g(),Rg(),Og()}function Og(){if(Wt!==5)return!1;var t=xl,n=pf;pf=0;var l=js(ja),o=V.T,f=oe.p;try{oe.p=32>l?32:l,V.T=null,l=hf,hf=null;var h=xl,v=ja;if(Wt=0,as=xl=null,ja=0,(lt&6)!==0)throw Error(r(331));var E=lt;if(lt|=4,mg(h.current),fg(h,h.current,v,l),lt=E,ko(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Ft,h)}catch{}return!0}finally{oe.p=f,V.T=o,Mg(t,n)}}function zg(t,n,l){n=An(l,n),n=Pd(t.stateNode,n,2),t=dl(t,n,2),t!==null&&(_a(t,2),Pi(t))}function ot(t,n,l){if(t.tag===3)zg(t,t,l);else for(;n!==null;){if(n.tag===3){zg(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(yl===null||!yl.has(o))){t=An(l,t),l=Lm(2),o=dl(n,l,2),o!==null&&(Im(l,o,n,t),_a(o,2),Pi(o));break}}n=n.return}}function xf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Gw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(cf=!0,f.add(l),t=Ww.bind(null,t,n,l),n.then(t,t))}function Ww(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,mt===t&&(Qe&l)===l&&(Nt===4||Nt===3&&(Qe&62914560)===Qe&&300>Dt()-tc?(lt&2)===0&&ls(t,0):df|=l,is===Qe&&(is=0)),Pi(t)}function Lg(t,n){n===0&&(n=bt()),t=sa(t,n),t!==null&&(_a(t,n),Pi(t))}function Kw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Lg(t,l)}function Xw(t,n){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Lg(t,l)}function Qw(t,n){return Kt(t,n)}var oc=null,ss=null,bf=!1,uc=!1,vf=!1,vl=0;function Pi(t){t!==ss&&t.next===null&&(ss===null?oc=ss=t:ss=ss.next=t),uc=!0,bf||(bf=!0,Jw())}function ko(t,n){if(!vf&&uc){vf=!0;do for(var l=!1,o=oc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,qg(o,h))}else h=Qe,h=Na(o,o===mt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||nn(o,h)||(l=!0,qg(o,h));o=o.next}while(l);vf=!1}}function Zw(){Ig()}function Ig(){uc=bf=!1;var t=0;vl!==0&&uk()&&(t=vl);for(var n=Dt(),l=null,o=oc;o!==null;){var f=o.next,h=Ug(o,n);h===0?(o.next=null,l===null?oc=f:l.next=f,f===null&&(ss=l)):(l=o,(t!==0||(h&3)!==0)&&(uc=!0)),o=f}Wt!==0&&Wt!==5||ko(t),vl!==0&&(vl=0)}function Ug(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),E=1<<v,I=f[v];I===-1?((E&l)===0||(E&o)!==0)&&(f[v]=Da(E,n)):I<=n&&(t.expiredLanes|=E),h&=~E}if(n=mt,l=Qe,l=Na(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(st===2||st===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&ji(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||nn(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&ji(o),js(l)){case 2:case 8:l=ce;break;case 32:l=Ce;break;case 268435456:l=Xe;break;default:l=Ce}return o=Bg.bind(null,t),l=Kt(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&ji(o),t.callbackPriority=2,t.callbackNode=null,2}function Bg(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(sc()&&t.callbackNode!==l)return null;var o=Qe;return o=Na(t,t===mt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(vg(t,o,n),Ug(t,Dt()),t.callbackNode!=null&&t.callbackNode===l?Bg.bind(null,t):null)}function qg(t,n){if(sc())return null;vg(t,n,!0)}function Jw(){dk(function(){(lt&6)!==0?Kt(ie,Zw):Ig()})}function wf(){if(vl===0){var t=k;t===0&&(t=wr,wr<<=1,(wr&261888)===0&&(wr=256)),vl=t}return vl}function Hg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ua(""+t)}function $g(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function ek(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Hg((f[Lt]||null).action),v=o.submitter;v&&(n=(n=v[Lt]||null)?Hg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var E=new ql("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(vl!==0){var I=v?$g(f,v):new FormData(f);qd(l,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(E.preventDefault(),I=v?$g(f,v):new FormData(f),qd(l,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var kf=0;kf<Ys.length;kf++){var jf=Ys[kf],tk=jf.toLowerCase(),nk=jf[0].toUpperCase()+jf.slice(1);Hn(tk,"on"+nk)}Hn(Nu,"onAnimationEnd"),Hn(Fs,"onAnimationIteration"),Hn(Tn,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(Ps,"onTransitionRun"),Hn(Du,"onTransitionStart"),Hn(Ql,"onTransitionCancel"),Hn(Hi,"onTransitionEnd"),Di("onMouseEnter",["mouseout","mouseover"]),Di("onMouseLeave",["mouseout","mouseover"]),Di("onPointerEnter",["pointerout","pointerover"]),Di("onPointerLeave",["pointerout","pointerover"]),cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jo="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(" "),ik=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jo));function Gg(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var E=o[v],I=E.instance,P=E.currentTarget;if(E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=P;try{h(f)}catch(ne){qr(ne)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(E=o[v],I=E.instance,P=E.currentTarget,E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=P;try{h(f)}catch(ne){qr(ne)}f.currentTarget=null,h=I}}}}function We(t,n){var l=n[Ti];l===void 0&&(l=n[Ti]=new Set);var o=t+"__bubble";l.has(o)||(Vg(n,t,2,!1),l.add(o))}function Sf(t,n,l){var o=0;n&&(o|=4),Vg(l,t,o,n)}var cc="_reactListening"+Math.random().toString(36).slice(2);function Cf(t){if(!t[cc]){t[cc]=!0,ou.forEach(function(l){l!=="selectionchange"&&(ik.has(l)||Sf(l,!1,t),Sf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[cc]||(n[cc]=!0,Sf("selectionchange",!1,n))}}function Vg(t,n,l,o){switch(by(n)){case 2:var f=_k;break;case 8:f=Rk;break;default:f=qf}l=f.bind(null,n,l,t),f=void 0,!qa||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function Tf(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var E=o.stateNode.containerInfo;if(E===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;E!==null;){if(v=Jn(E),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}E=E.parentNode}}o=o.return}Oi(function(){var P=h,ne=Ul(l),se=[];e:{var K=_u.get(t);if(K!==void 0){var Z=ql,ke=t;switch(t){case"keypress":if(Li(l)===0)break e;case"keydown":case"keyup":Z=Os;break;case"focusin":ke="focus",Z=Hl;break;case"focusout":ke="blur",Z=Hl;break;case"beforeblur":case"afterblur":Z=Hl;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Va;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Dr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Vl;break;case Nu:case Fs:case Tn:Z=Ne;break;case Hi:Z=zs;break;case"scroll":case"scrollend":Z=Ui;break;case"wheel":Z=Is;break;case"copy":case"cut":case"paste":Z=mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=mu;break;case"toggle":case"beforetoggle":Z=zr}var Oe=(n&4)!==0,pt=!Oe&&(t==="scroll"||t==="scrollend"),G=Oe?K!==null?K+"Capture":null:K;Oe=[];for(var B=P,F;B!==null;){var le=B;if(F=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||F===null||G===null||(le=Bl(B,G),le!=null&&Oe.push(So(B,le,F))),pt)break;B=B.return}0<Oe.length&&(K=new Z(K,ke,null,l,ne),se.push({event:K,listeners:Oe}))}}if((n&7)===0){e:{if(K=t==="mouseover"||t==="pointerover",Z=t==="mouseout"||t==="pointerout",K&&l!==Il&&(ke=l.relatedTarget||l.fromElement)&&(Jn(ke)||ke[qn]))break e;if((Z||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,Z?(ke=l.relatedTarget||l.toElement,Z=P,ke=ke?Jn(ke):null,ke!==null&&(pt=c(ke),Oe=ke.tag,ke!==pt||Oe!==5&&Oe!==27&&Oe!==6)&&(ke=null)):(Z=null,ke=P),Z!==ke)){if(Oe=Va,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=mu,le="onPointerLeave",G="onPointerEnter",B="pointer"),pt=Z==null?K:Zi(Z),F=ke==null?K:Zi(ke),K=new Oe(le,B+"leave",Z,l,ne),K.target=pt,K.relatedTarget=F,le=null,Jn(ne)===P&&(Oe=new Oe(G,B+"enter",ke,l,ne),Oe.target=F,Oe.relatedTarget=pt,le=Oe),pt=le,Z&&ke)t:{for(Oe=ak,G=Z,B=ke,F=0,le=G;le;le=Oe(le))F++;le=0;for(var De=B;De;De=Oe(De))le++;for(;0<F-le;)G=Oe(G),F--;for(;0<le-F;)B=Oe(B),le--;for(;F--;){if(G===B||B!==null&&G===B.alternate){Oe=G;break t}G=Oe(G),B=Oe(B)}Oe=null}else Oe=null;Z!==null&&Fg(se,K,Z,Oe,!1),ke!==null&&pt!==null&&Fg(se,pt,ke,Oe,!0)}}e:{if(K=P?Zi(P):window,Z=K.nodeName&&K.nodeName.toLowerCase(),Z==="select"||Z==="input"&&K.type==="file")var nt=Yl;else if(Pl(K))if(Ur)nt=hd;else{nt=wu;var Te=qs}else Z=K.nodeName,!Z||Z.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?P&&Ia(P.elementType)&&(nt=Yl):nt=pd;if(nt&&(nt=nt(t,P))){xu(se,nt,l,ne);break e}Te&&Te(t,K,P),t==="focusout"&&P&&K.type==="number"&&P.memoizedProps.value!=null&&Er(K,"number",K.value)}switch(Te=P?Zi(P):window,t){case"focusin":(Pl(Te)||Te.contentEditable==="true")&&(Xa=Te,$s=P,Xl=null);break;case"focusout":Xl=$s=Xa=null;break;case"mousedown":Gs=!0;break;case"contextmenu":case"mouseup":case"dragend":Gs=!1,Eu(se,l,ne);break;case"selectionchange":if(md)break;case"keydown":case"keyup":Eu(se,l,ne)}var $e;if(ia)e:{switch(t){case"compositionstart":var Ze="onCompositionStart";break e;case"compositionend":Ze="onCompositionEnd";break e;case"compositionupdate":Ze="onCompositionUpdate";break e}Ze=void 0}else Wa?Ya(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(yu&&l.locale!=="ko"&&(Wa||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Wa&&($e=Rs()):(ai=ne,zi="value"in ai?ai.value:ai.textContent,Wa=!0)),Te=dc(P,Ze),0<Te.length&&(Ze=new Rr(Ze,t,null,l,ne),se.push({event:Ze,listeners:Te}),$e?Ze.data=$e:($e=we(l),$e!==null&&(Ze.data=$e)))),($e=ud?xn(t,l):cd(t,l))&&(Ze=dc(P,"onBeforeInput"),0<Ze.length&&(Te=new Rr("onBeforeInput","beforeinput",null,l,ne),se.push({event:Te,listeners:Ze}),Te.data=$e)),ek(se,t,P,l,ne)}Gg(se,n)})}function So(t,n,l){return{instance:t,listener:n,currentTarget:l}}function dc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Bl(t,l),f!=null&&o.unshift(So(t,f,h)),f=Bl(t,n),f!=null&&o.push(So(t,f,h))),t.tag===3)return o;t=t.return}return[]}function ak(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Fg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var E=l,I=E.alternate,P=E.stateNode;if(E=E.tag,I!==null&&I===o)break;E!==5&&E!==26&&E!==27||P===null||(I=P,f?(P=Bl(l,h),P!=null&&v.unshift(So(l,P,I))):f||(P=Bl(l,h),P!=null&&v.push(So(l,P,I)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var lk=/\r\n?/g,rk=/\u0000|\uFFFD/g;function Pg(t){return(typeof t=="string"?t:""+t).replace(lk,`
|
|
50
|
+
`).replace(rk,"")}function Yg(t,n){return n=Pg(n),Pg(t)===n}function ft(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||ti(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&ti(t,""+o);break;case"className":zl(t,"class",o);break;case"tabIndex":zl(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zl(t,l,o);break;case"style":Ns(t,o,h);break;case"data":if(n!=="object"){zl(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Ua(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"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 h=="function"&&(l==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=Ua(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=yn);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=Ua(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.removeAttribute(l);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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":We("beforetoggle",t),We("toggle",t),Cr(t,"popover",o);break;case"xlinkActuate":Xt(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xt(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xt(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xt(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xt(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xt(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Cr(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=ni.get(l)||l,Cr(t,l,o))}}function Ef(t,n,l,o,f,h){switch(l){case"style":Ns(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?ti(t,o):(typeof o=="number"||typeof o=="bigint")&&ti(t,""+o);break;case"onScroll":o!=null&&We("scroll",t);break;case"onScrollEnd":o!=null&&We("scrollend",t);break;case"onClick":o!=null&&(t.onclick=yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ts.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[Lt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):Cr(t,l,o)}}}function sn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",t),We("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,l,null)}}f&&ft(t,n,"srcSet",l.srcSet,l,null),o&&ft(t,n,"src",l.src,l,null);return;case"input":We("invalid",t);var E=h=v=f=null,I=null,P=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":I=ne;break;case"defaultChecked":P=ne;break;case"value":h=ne;break;case"defaultValue":E=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:ft(t,n,o,ne,l,null)}}La(t,h,E,I,P,v,f,!1);return;case"select":We("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(E=l[f],E!=null))switch(f){case"value":h=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:ft(t,n,f,E,l,null)}n=h,l=v,t.multiple=!!o,n!=null?ei(t,!!o,n,!1):l!=null&&ei(t,!!o,l,!0);return;case"textarea":We("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(E=l[v],E!=null))switch(v){case"value":o=E;break;case"defaultValue":f=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:ft(t,n,v,E,l,null)}Ll(t,o,f,h);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(o=l[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,I,o,l,null)}return;case"dialog":We("beforetoggle",t),We("toggle",t),We("cancel",t),We("close",t);break;case"iframe":case"object":We("load",t);break;case"video":case"audio":for(o=0;o<jo.length;o++)We(jo[o],t);break;case"image":We("error",t),We("load",t);break;case"details":We("toggle",t);break;case"embed":case"source":case"link":We("error",t),We("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in l)if(l.hasOwnProperty(P)&&(o=l[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,P,o,l,null)}return;default:if(Ia(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&Ef(t,n,ne,o,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(o=l[E],o!=null&&ft(t,n,E,o,l,null))}function sk(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,E=null,I=null,P=null,ne=null;for(Z in l){var se=l[Z];if(l.hasOwnProperty(Z)&&se!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":I=se;default:o.hasOwnProperty(Z)||ft(t,n,Z,null,o,se)}}for(var K in o){var Z=o[K];if(se=l[K],o.hasOwnProperty(K)&&(Z!=null||se!=null))switch(K){case"type":h=Z;break;case"name":f=Z;break;case"checked":P=Z;break;case"defaultChecked":ne=Z;break;case"value":v=Z;break;case"defaultValue":E=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==se&&ft(t,n,K,Z,o,se)}}Tr(t,v,E,I,P,ne,h,f);return;case"select":Z=v=E=K=null;for(h in l)if(I=l[h],l.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":Z=I;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=l[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":K=h;break;case"defaultValue":E=h;break;case"multiple":v=h;default:h!==I&&ft(t,n,f,h,o,I)}n=E,l=v,o=Z,K!=null?ei(t,!!l,K,!1):!!o!=!!l&&(n!=null?ei(t,!!l,n,!0):ei(t,!!l,l?[]:"",!1));return;case"textarea":Z=K=null;for(E in l)if(f=l[E],l.hasOwnProperty(E)&&f!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ft(t,n,E,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":K=f;break;case"defaultValue":Z=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}pu(t,K,Z);return;case"option":for(var ke in l)if(K=l[ke],l.hasOwnProperty(ke)&&K!=null&&!o.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:ft(t,n,ke,null,o,K)}for(I in o)if(K=o[I],Z=l[I],o.hasOwnProperty(I)&&K!==Z&&(K!=null||Z!=null))switch(I){case"selected":t.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:ft(t,n,I,K,o,Z)}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 Oe in l)K=l[Oe],l.hasOwnProperty(Oe)&&K!=null&&!o.hasOwnProperty(Oe)&&ft(t,n,Oe,null,o,K);for(P in o)if(K=o[P],Z=l[P],o.hasOwnProperty(P)&&K!==Z&&(K!=null||Z!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:ft(t,n,P,K,o,Z)}return;default:if(Ia(n)){for(var pt in l)K=l[pt],l.hasOwnProperty(pt)&&K!==void 0&&!o.hasOwnProperty(pt)&&Ef(t,n,pt,void 0,o,K);for(ne in o)K=o[ne],Z=l[ne],!o.hasOwnProperty(ne)||K===Z||K===void 0&&Z===void 0||Ef(t,n,ne,K,o,Z);return}}for(var G in l)K=l[G],l.hasOwnProperty(G)&&K!=null&&!o.hasOwnProperty(G)&&ft(t,n,G,null,o,K);for(se in o)K=o[se],Z=l[se],!o.hasOwnProperty(se)||K===Z||K==null&&Z==null||ft(t,n,se,K,o,Z)}function Wg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ok(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,E=f.duration;if(h&&E&&Wg(v)){for(v=0,E=f.responseEnd,o+=1;o<l.length;o++){var I=l[o],P=I.startTime;if(P>E)break;var ne=I.transferSize,se=I.initiatorType;ne&&Wg(se)&&(I=I.responseEnd,v+=ne*(I<E?1:(E-P)/(I-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Af=null,Nf=null;function fc(t){return t.nodeType===9?t:t.ownerDocument}function Kg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Df(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var _f=null;function uk(){var t=window.event;return t&&t.type==="popstate"?t===_f?!1:(_f=t,!0):(_f=null,!1)}var Qg=typeof setTimeout=="function"?setTimeout:void 0,ck=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,dk=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(t){return Zg.resolve(null).then(t).catch(fk)}:Qg;function fk(t){setTimeout(function(){throw t})}function wl(t){return t==="head"}function Jg(t,n){var l=n,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),ds(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Co(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Co(l);for(var h=l.firstChild;h;){var v=h.nextSibling,E=h.nodeName;h[Ei]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&Co(t.ownerDocument.body);l=f}while(l);ds(n)}function ey(t,n){var l=t;t=0;do{var o=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function Rf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Rf(l),Cs(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function pk(t,n,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ei])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function hk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=ci(t.nextSibling),t===null))return null;return t}function ty(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ci(t.nextSibling),t===null))return null;return t}function Mf(t){return t.data==="$?"||t.data==="$~"}function Of(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function mk(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function ci(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var zf=null;function ny(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return ci(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function iy(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function ay(t,n,l){switch(n=fc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Co(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Cs(t)}var di=new Map,ly=new Set;function pc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Sa=oe.d;oe.d={f:gk,r:yk,D:xk,C:bk,L:vk,m:wk,X:jk,S:kk,M:Sk};function gk(){var t=Sa.f(),n=ac();return t||n}function yk(t){var n=Ai(t);n!==null&&n.tag===5&&n.type==="form"?km(n):Sa.r(t)}var os=typeof document>"u"?null:document;function ry(t,n,l){var o=os;if(o&&typeof n=="string"&&n){var f=Ut(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ly.has(f)||(ly.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),sn(n,"link",t),Et(n),o.head.appendChild(n)))}}function xk(t){Sa.D(t),ry("dns-prefetch",t,null)}function bk(t,n){Sa.C(t,n),ry("preconnect",t,n)}function vk(t,n,l){Sa.L(t,n,l);var o=os;if(o&&t&&n){var f='link[rel="preload"][as="'+Ut(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Ut(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Ut(l.imageSizes)+'"]')):f+='[href="'+Ut(t)+'"]';var h=f;switch(n){case"style":h=us(t);break;case"script":h=cs(t)}di.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),di.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(To(h))||n==="script"&&o.querySelector(Eo(h))||(n=o.createElement("link"),sn(n,"link",t),Et(n),o.head.appendChild(n)))}}function wk(t,n){Sa.m(t,n);var l=os;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Ut(o)+'"][href="'+Ut(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=cs(t)}if(!di.has(h)&&(t=x({rel:"modulepreload",href:t},n),di.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Eo(h)))return}o=l.createElement("link"),sn(o,"link",t),Et(o),l.head.appendChild(o)}}}function kk(t,n,l){Sa.S(t,n,l);var o=os;if(o&&t){var f=Ni(o).hoistableStyles,h=us(t);n=n||"default";var v=f.get(h);if(!v){var E={loading:0,preload:null};if(v=o.querySelector(To(h)))E.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=di.get(h))&&Lf(t,l);var I=v=o.createElement("link");Et(I),sn(I,"link",t),I._p=new Promise(function(P,ne){I.onload=P,I.onerror=ne}),I.addEventListener("load",function(){E.loading|=1}),I.addEventListener("error",function(){E.loading|=2}),E.loading|=4,hc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},f.set(h,v)}}}function jk(t,n){Sa.X(t,n);var l=os;if(l&&t){var o=Ni(l).hoistableScripts,f=cs(t),h=o.get(f);h||(h=l.querySelector(Eo(f)),h||(t=x({src:t,async:!0},n),(n=di.get(f))&&If(t,n),h=l.createElement("script"),Et(h),sn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Sk(t,n){Sa.M(t,n);var l=os;if(l&&t){var o=Ni(l).hoistableScripts,f=cs(t),h=o.get(f);h||(h=l.querySelector(Eo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=di.get(f))&&If(t,n),h=l.createElement("script"),Et(h),sn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function sy(t,n,l,o){var f=(f=X.current)?pc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=us(l.href),l=Ni(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=us(l.href);var h=Ni(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(To(t)))&&!h._p&&(v.instance=h,v.state.loading=5),di.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},di.set(t,l),h||Ck(f,t,l,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=cs(l),l=Ni(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function us(t){return'href="'+Ut(t)+'"'}function To(t){return'link[rel="stylesheet"]['+t+"]"}function oy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Ck(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),sn(n,"link",l),Et(n),t.head.appendChild(n))}function cs(t){return'[src="'+Ut(t)+'"]'}function Eo(t){return"script[async]"+t}function uy(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Ut(l.href)+'"]');if(o)return n.instance=o,Et(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Et(o),sn(o,"style",f),hc(o,l.precedence,t),n.instance=o;case"stylesheet":f=us(l.href);var h=t.querySelector(To(f));if(h)return n.state.loading|=4,n.instance=h,Et(h),h;o=oy(l),(f=di.get(f))&&Lf(o,f),h=(t.ownerDocument||t).createElement("link"),Et(h);var v=h;return v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),sn(h,"link",o),n.state.loading|=4,hc(h,l.precedence,t),n.instance=h;case"script":return h=cs(l.src),(f=t.querySelector(Eo(h)))?(n.instance=f,Et(f),f):(o=l,(f=di.get(h))&&(o=x({},l),If(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Et(f),sn(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,hc(o,l.precedence,t));return n.instance}function hc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)h=E;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Lf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function If(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var mc=null;function cy(t,n,l){if(mc===null){var o=new Map,f=mc=new Map;f.set(l,o)}else f=mc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[Ei]||h[Pt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var E=o.get(v);E?E.push(h):o.set(v,[h])}}return o}function dy(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Tk(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function fy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ek(t,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=us(o.href),h=n.querySelector(To(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=gc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,Et(h);return}h=n.ownerDocument||n,o=oy(o),(f=di.get(f))&&Lf(o,f),h=h.createElement("link"),Et(h);var v=h;v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),sn(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=gc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Uf=0;function Ak(t,n){return t.stylesheets&&t.count===0&&xc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Uf===0&&(Uf=62500*ok());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&xc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Uf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function gc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var yc=null;function xc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,yc=new Map,n.forEach(Nk,t),yc=null,gc.call(t))}function Nk(t,n){if(!(n.state.loading&4)){var l=yc.get(t);if(l)var o=l.get(null);else{l=new Map,yc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=gc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var Ao={$$typeof:$,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Dk(t,n,l,o,f,h,v,E,I){this.tag=1,this.containerInfo=t,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=Qi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qi(0),this.hiddenUpdates=Qi(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function py(t,n,l,o,f,h,v,E,I,P,ne,se){return t=new Dk(t,n,l,v,I,P,ne,se,E),n=1,h===!0&&(n|=24),h=dn(3,null,null,n),t.current=h,h.stateNode=t,n=Yr(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},vd(h),t}function hy(t){return t?(t=Ja,t):Ja}function my(t,n,l,o,f,h){f=hy(f),o.context===null?o.context=f:o.pendingContext=f,o=cl(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=dl(t,o,n),l!==null&&(Ln(l,t,n),lo(l,t,n))}function gy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Bf(t,n){gy(t,n),(t=t.alternate)&&gy(t,n)}function yy(t){if(t.tag===13||t.tag===31){var n=sa(t,67108864);n!==null&&Ln(n,t,67108864),Bf(t,67108864)}}function xy(t){if(t.tag===13||t.tag===31){var n=Yn();n=jr(n);var l=sa(t,n);l!==null&&Ln(l,t,n),Bf(t,n)}}var bc=!0;function _k(t,n,l,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=2,qf(t,n,l,o)}finally{oe.p=h,V.T=f}}function Rk(t,n,l,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=8,qf(t,n,l,o)}finally{oe.p=h,V.T=f}}function qf(t,n,l,o){if(bc){var f=Hf(o);if(f===null)Tf(t,n,o,vc,l),vy(t,o);else if(Ok(f,t,n,l,o))o.stopPropagation();else if(vy(t,o),n&4&&-1<Mk.indexOf(t)){for(;f!==null;){var h=Ai(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ci(h.pendingLanes);if(v!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var I=1<<31-rt(v);E.entanglements[1]|=I,v&=~I}Pi(h),(lt&6)===0&&(nc=Dt()+500,ko(0))}}break;case 31:case 13:E=sa(h,2),E!==null&&Ln(E,h,2),ac(),Bf(h,2)}if(h=Hf(o),h===null&&Tf(t,n,o,vc,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Tf(t,n,o,null,l)}}function Hf(t){return t=Ul(t),$f(t)}var vc=null;function $f(t){if(vc=null,t=Jn(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=p(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return vc=t,null}function by(t){switch(t){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(Aa()){case ie:return 2;case ce:return 8;case Ce:case Ue:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Gf=!1,kl=null,jl=null,Sl=null,No=new Map,Do=new Map,Cl=[],Mk="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 vy(t,n){switch(t){case"focusin":case"focusout":kl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Sl=null;break;case"pointerover":case"pointerout":No.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(n.pointerId)}}function _o(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ai(n),n!==null&&yy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Ok(t,n,l,o,f){switch(n){case"focusin":return kl=_o(kl,t,n,l,o,f),!0;case"dragenter":return jl=_o(jl,t,n,l,o,f),!0;case"mouseover":return Sl=_o(Sl,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return No.set(h,_o(No.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Do.set(h,_o(Do.get(h)||null,t,n,l,o,f)),!0}return!1}function wy(t){var n=Jn(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,su(t.priority,function(){xy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,su(t.priority,function(){xy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function wc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Hf(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);Il=o,l.target.dispatchEvent(o),Il=null}else return n=Ai(l),n!==null&&yy(n),t.blockedOn=l,!1;n.shift()}return!0}function ky(t,n,l){wc(t)&&l.delete(n)}function zk(){Gf=!1,kl!==null&&wc(kl)&&(kl=null),jl!==null&&wc(jl)&&(jl=null),Sl!==null&&wc(Sl)&&(Sl=null),No.forEach(ky),Do.forEach(ky)}function kc(t,n){t.blockedOn===n&&(t.blockedOn=null,Gf||(Gf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,zk)))}var jc=null;function jy(t){jc!==t&&(jc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){jc===t&&(jc=null);for(var n=0;n<t.length;n+=3){var l=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if($f(o||l)===null)continue;break}var h=Ai(l);h!==null&&(t.splice(n,3),n-=3,qd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function ds(t){function n(I){return kc(I,t)}kl!==null&&kc(kl,t),jl!==null&&kc(jl,t),Sl!==null&&kc(Sl,t),No.forEach(n),Do.forEach(n);for(var l=0;l<Cl.length;l++){var o=Cl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Cl.length&&(l=Cl[0],l.blockedOn===null);)wy(l),l.blockedOn===null&&Cl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[Lt]||null;if(typeof h=="function")v||jy(l);else if(v){var E=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Lt]||null)E=v.formAction;else if($f(f)!==null)continue}else E=v.action;typeof E=="function"?l[o+1]=E:(l.splice(o,3),o-=3),jy(l)}}}function Sy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Vf(t){this._internalRoot=t}Sc.prototype.render=Vf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Yn();my(l,o,t,n,null,null)},Sc.prototype.unmount=Vf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;my(t.current,2,null,t,null,null),ac(),n[qn]=null}};function Sc(t){this._internalRoot=t}Sc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ss();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Cl.length&&n!==0&&n<Cl[l].priority;l++);Cl.splice(l,0,t),l===0&&wy(t)}};var Cy=i.version;if(Cy!=="19.2.7")throw Error(r(527,Cy,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Lk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cc.isDisabled&&Cc.supportsFiber)try{Ft=Cc.inject(Lk),Tt=Cc}catch{}}return Mo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Rm,h=Mm,v=Om;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=py(t,1,!1,null,null,l,o,null,f,h,v,Sy),t[qn]=n.current,Cf(t),new Vf(n)},Mo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Rm,v=Mm,E=Om,I=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),n=py(t,1,!0,n,l??null,o,f,I,h,v,E,Sy),n.context=hy(null),l=n.current,o=Yn(),o=jr(o),f=cl(o),f.callback=null,dl(l,f,o),l=o,n.current.lanes=l,_a(n,l),Pi(n),t[qn]=n.current,Cf(t),new Sc(n)},Mo.version="19.2.7",Mo}var Ly;function Xk(){if(Ly)return Yf.exports;Ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Yf.exports=Kk(),Yf.exports}var Qk=Xk();function Zk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Jk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ej=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tj={};function Iy(e,i){return(tj.jsx?ej:Jk).test(e)}const nj=/[ \t\n\f\r]/g;function ij(e){return typeof e=="object"?e.type==="text"?Uy(e.value):!1:Uy(e)}function Uy(e){return e.replace(nj,"")===""}class iu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}iu.prototype.normal={};iu.prototype.property={};iu.prototype.space=void 0;function bb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new iu(a,r,i)}function Lp(e){return e.toLowerCase()}class Bn{constructor(i,a){this.attribute=a,this.property=i}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let aj=0;const Ie=br(),$t=br(),Ip=br(),pe=br(),gt=br(),hr=br(),Wn=br();function br(){return 2**++aj}const Up=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:$t,commaOrSpaceSeparated:Wn,commaSeparated:hr,number:pe,overloadedBoolean:Ip,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Up);class uh extends Bn{constructor(i,a,r,u){let c=-1;if(super(i,a),By(this,"space",u),typeof r=="number")for(;++c<Qf.length;){const d=Qf[c];By(this,Qf[c],(r&Up[d])===Up[d])}}}uh.prototype.defined=!0;function By(e,i,a){a&&(e[i]=a)}function vs(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new uh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Lp(r)]=r,a[Lp(c.attribute)]=r}return new iu(i,a,e.space)}const vb=vs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:gt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:pe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:gt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:$t,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function wb(e,i){return i in e?e[i]:i}function kb(e,i){return wb(e,i.toLowerCase())}const lj=vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hr,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:gt,autoFocus:Ie,autoPlay:Ie,blocking:gt,capture:null,charSet:null,checked:Ie,cite:null,className:gt,closedBy:null,colorSpace:null,cols:pe,colSpan:pe,command:null,commandFor:null,content:null,contentEditable:$t,controls:Ie,controlsList:gt,coords:pe|hr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Ip,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:gt,height:pe,hidden:Ip,high:pe,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:gt,itemRef:gt,itemScope:Ie,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:pe,pattern:null,ping:gt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:gt,required:Ie,reversed:Ie,rows:pe,rowSpan:pe,sandbox:gt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:$t,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:hr,part:gt,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:kb}),rj=vs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:gt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hr,g2:hr,glyphName:hr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wn,rev:Wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wn,requiredFeatures:Wn,requiredFonts:Wn,requiredFormats:Wn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wb}),jb=vs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),Sb=vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:kb}),Cb=vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),sj={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},oj=/[A-Z]/g,qy=/-[a-z]/g,uj=/^data[-\w.:]+$/i;function cj(e,i){const a=Lp(i);let r=i,u=Bn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&uj.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(qy,fj);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!qy.test(c)){let d=c.replace(oj,dj);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=uh}return new u(r,i)}function dj(e){return"-"+e.toLowerCase()}function fj(e){return e.charAt(1).toUpperCase()}const pj=bb([vb,lj,jb,Sb,Cb],"html"),ch=bb([vb,rj,jb,Sb,Cb],"svg");function hj(e){return e.join(" ").trim()}var fs={},Zf,Hy;function mj(){if(Hy)return Zf;Hy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
|
|
51
|
+
`,m="/",b="*",x="",j="comment",w="declaration";function T(q,N){if(typeof q!="string")throw new TypeError("First argument must be a string");if(!q)return[];N=N||{};var H=1,$=1;function W(ge){var ue=ge.match(i);ue&&(H+=ue.length);var V=ge.lastIndexOf(g);$=~V?ge.length-V:$+ge.length}function ae(){var ge={line:H,column:$};return function(ue){return ue.position=new D(ge),ee(),ue}}function D(ge){this.start=ge,this.end={line:H,column:$},this.source=N.source}D.prototype.content=q;function Q(ge){var ue=new Error(N.source+":"+H+":"+$+": "+ge);if(ue.reason=ge,ue.filename=N.source,ue.line=H,ue.column=$,ue.source=q,!N.silent)throw ue}function re(ge){var ue=ge.exec(q);if(ue){var V=ue[0];return W(V),q=q.slice(V.length),ue}}function ee(){re(a)}function L(ge){var ue;for(ge=ge||[];ue=te();)ue!==!1&&ge.push(ue);return ge}function te(){var ge=ae();if(!(m!=q.charAt(0)||b!=q.charAt(1))){for(var ue=2;x!=q.charAt(ue)&&(b!=q.charAt(ue)||m!=q.charAt(ue+1));)++ue;if(ue+=2,x===q.charAt(ue-1))return Q("End of comment missing");var V=q.slice(2,ue-2);return $+=2,W(V),q=q.slice(ue),$+=2,ge({type:j,comment:V})}}function de(){var ge=ae(),ue=re(r);if(ue){if(te(),!re(u))return Q("property missing ':'");var V=re(c),oe=ge({type:w,property:R(ue[0].replace(e,x)),value:V?R(V[0].replace(e,x)):x});return re(d),oe}}function Ee(){var ge=[];L(ge);for(var ue;ue=de();)ue!==!1&&(ge.push(ue),L(ge));return ge}return ee(),Ee()}function R(q){return q?q.replace(p,x):x}return Zf=T,Zf}var $y;function gj(){if($y)return fs;$y=1;var e=fs&&fs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fs,"__esModule",{value:!0}),fs.default=a;const i=e(mj());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return fs}var Oo={},Gy;function yj(){if(Gy)return Oo;Gy=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||a.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return Oo.camelCase=g,Oo}var zo,Vy;function xj(){if(Vy)return zo;Vy=1;var e=zo&&zo.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(gj()),a=yj();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,a.camelCase)(p,c)]=g)}),d}return r.default=r,zo=r,zo}var bj=xj();const vj=xb(bj),Tb=Eb("end"),dh=Eb("start");function Eb(e){return i;function i(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wj(e){const i=dh(e),a=Tb(e);if(i&&a)return{start:i,end:a}}function Yo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fy(e.position):"start"in e||"end"in e?Fy(e):"line"in e||"column"in e?Bp(e):""}function Bp(e){return Py(e&&e.line)+":"+Py(e&&e.column)}function Fy(e){return Bp(e&&e.start)+"-"+Bp(e&&e.end)}function Py(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=Yo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const fh={}.hasOwnProperty,kj=new Map,jj=/[A-Z]/g,Sj=new Set(["table","tbody","thead","tfoot","tr"]),Cj=new Set(["td","th"]),Ab="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Tj(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Oj(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Mj(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ch:pj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=Nb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function Nb(e,i,a){if(i.type==="element")return Ej(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return Aj(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Dj(e,i,a);if(i.type==="mdxjsEsm")return Nj(e,i);if(i.type==="root")return _j(e,i,a);if(i.type==="text")return Rj(e,i)}function Ej(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=_b(e,i.tagName,!1),d=zj(e,i);let p=hh(e,i);return Sj.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!ij(g):!0})),Db(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function Aj(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,i.position)}function Nj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);tu(e,i.position)}function Dj(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:_b(e,i.name,!0),d=Lj(e,i),p=hh(e,i);return Db(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function _j(e,i,a){const r={};return ph(r,hh(e,i)),e.create(i,e.Fragment,r,a)}function Rj(e,i){return i.value}function Db(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function ph(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function Mj(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function Oj(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=dh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function zj(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&fh.call(i.properties,u)){const c=Ij(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&Cj.has(i.tagName)?r=p:a[d]=p}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Lj(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else tu(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else tu(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function hh(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:kj;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=Nb(e,c,d);p!==void 0&&a.push(p)}return a}function Ij(e,i,a){const r=cj(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Zk(a):hj(a)),r.property==="style"){let u=typeof a=="object"?a:Uj(e,String(a));return e.stylePropertyNameCase==="css"&&(u=Bj(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?sj[r.property]||r.property:r.attribute,a]}}function Uj(e,i){try{return vj(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=Ab+"#cannot-parse-style-attribute",u}}function _b(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Iy(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=Iy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return fh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);tu(e)}function tu(e,i){const a=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Ab+"#cannot-handle-mdx-estrees-without-createevaluater",a}function Bj(e){const i={};let a;for(a in e)fh.call(e,a)&&(i[qj(a)]=e[a]);return i}function qj(e){let i=e.replace(jj,Hj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Hj(e){return"-"+e.toLowerCase()}const Jf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},$j={};function mh(e,i){const a=$j,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Rb(e,r,u)}function Rb(e,i,a){if(Gj(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Yy(e.children,i,a)}return Array.isArray(e)?Yy(e,i,a):""}function Yy(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Rb(e[u],i,a);return r.join("")}function Gj(e){return!!(e&&typeof e=="object")}const Wy=document.createElement("i");function gh(e){const i="&"+e+";";Wy.innerHTML=i;const a=Wy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Kn(e,i,a,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function fi(e,i){return e.length>0?(Kn(e,e.length,0,i),e):i}const Ky={}.hasOwnProperty;function Mb(e){const i={};let a=-1;for(;++a<e.length;)Vj(i,e[a]);return i}function Vj(e,i){let a;for(a in i){const u=(Ky.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Ky.call(u,d)||(u[d]=[]);const p=c[d];Fj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Fj(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Kn(e,0,0,r)}function Ob(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function ki(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=Rl(/[A-Za-z]/),hn=Rl(/[\dA-Za-z]/),Pj=Rl(/[#-'*+\--9=?A-Z^-~]/);function Vc(e){return e!==null&&(e<32||e===127)}const qp=Rl(/\d/),Yj=Rl(/[\dA-Fa-f]/),Wj=Rl(/[!-/:-@[-`{-~]/);function Me(e){return e!==null&&e<-2}function yt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Zc=Rl(new RegExp("\\p{P}|\\p{S}","u")),mr=Rl(/\s/);function Rl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ws(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&hn(e.charCodeAt(a+1))&&hn(e.charCodeAt(a+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const p=e.charCodeAt(a+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function tt(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return Ke(g)?(e.enter(a),p(g)):i(g)}function p(g){return Ke(g)&&c++<u?(e.consume(g),p):(e.exit(a),i(g))}}const Kj={tokenize:Xj};function Xj(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Me(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const Qj={tokenize:Zj},Xy={tokenize:Jj};function Zj(e){const i=this,a=[];let r=0,u,c,d;return p;function p($){if(r<a.length){const W=a[r];return i.containerState=W[1],e.attempt(W[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const W=i.events.length;let ae=W,D;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){D=i.events[ae][1].end;break}N(r);let Q=W;for(;Q<i.events.length;)i.events[Q][1].end={...D},Q++;return Kn(i.events,ae+1,0,i.events.slice(W)),i.events.length=Q,m($)}return p($)}function m($){if(r===a.length){if(!u)return j($);if(u.currentConstruct&&u.currentConstruct.concrete)return T($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Xy,b,x)($)}function b($){return u&&H(),N(r),j($)}function x($){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,T($)}function j($){return i.containerState={},e.attempt(Xy,w,T)($)}function w($){return r++,a.push([i.currentConstruct,i.containerState]),j($)}function T($){if($===null){u&&H(),N(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R($)}function R($){if($===null){q(e.exit("chunkFlow"),!0),N(0),e.consume($);return}return Me($)?(e.consume($),q(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),R)}function q($,W){const ae=i.sliceStream($);if(W&&ae.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(ae),i.parser.lazy[$.start.line]){let D=u.events.length;for(;D--;)if(u.events[D][1].start.offset<d&&(!u.events[D][1].end||u.events[D][1].end.offset>d))return;const Q=i.events.length;let re=Q,ee,L;for(;re--;)if(i.events[re][0]==="exit"&&i.events[re][1].type==="chunkFlow"){if(ee){L=i.events[re][1].end;break}ee=!0}for(N(r),D=Q;D<i.events.length;)i.events[D][1].end={...L},D++;Kn(i.events,re+1,0,i.events.slice(Q)),i.events.length=D}}function N($){let W=a.length;for(;W-- >$;){const ae=a[W];i.containerState=ae[1],ae[0].exit.call(i,e)}a.length=$}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function Jj(e,i,a){return tt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xs(e){if(e===null||yt(e)||mr(e))return 1;if(Zc(e))return 2}function Jc(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const Hp={name:"attention",resolveAll:eS,tokenize:tS};function eS(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},j={...e[a][1].start};Qy(x,-g),Qy(j,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:j},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=fi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=fi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=fi(m,Jc(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=fi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=fi(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Kn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function tS(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=xs(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=xs(g),x=!b||b===2&&u||a.includes(g),j=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!j)),m._close=!!(c===42?j:j&&(b||!x)),i(g)}}function Qy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const nS={name:"autolink",tokenize:iS};function iS(e,i,a){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return kn(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||hn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||hn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Vc(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):Pj(w)?(e.consume(w),m):a(w)}function b(w){return hn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):j(w)}function j(w){if((w===45||hn(w))&&r++<63){const T=w===45?j:x;return e.consume(w),T}return a(w)}}const au={partial:!0,tokenize:aS};function aS(e,i,a){return r;function r(c){return Ke(c)?tt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Me(c)?i(c):a(c)}}const zb={continuation:{tokenize:rS},exit:sS,name:"blockQuote",tokenize:lS};function lS(e,i,a){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return Ke(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function rS(e,i,a){const r=this;return u;function u(d){return Ke(d)?tt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(zb,i,a)(d)}}function sS(e){e.exit("blockQuote")}const Lb={name:"characterEscape",tokenize:oS};function oS(e,i,a){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return Wj(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Ib={name:"characterReference",tokenize:uS};function uS(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=hn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Yj,b):(e.enter("characterReferenceValue"),c=7,d=qp,b(x))}function b(x){if(x===59&&u){const j=e.exit("characterReferenceValue");return d===hn&&!gh(r.sliceSerialize(j))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Zy={partial:!0,tokenize:dS},Jy={concrete:!0,name:"codeFenced",tokenize:cS};function cS(e,i,a){const r=this,u={partial:!0,tokenize:ae};let c=0,d=0,p;return g;function g(D){return m(D)}function m(D){const Q=r.events[r.events.length-1];return c=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,p=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(D)}function b(D){return D===p?(d++,e.consume(D),b):d<3?a(D):(e.exit("codeFencedFenceSequence"),Ke(D)?tt(e,x,"whitespace")(D):x(D))}function x(D){return D===null||Me(D)?(e.exit("codeFencedFence"),r.interrupt?i(D):e.check(Zy,R,W)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(D))}function j(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(D)):Ke(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,w,"whitespace")(D)):D===96&&D===p?a(D):(e.consume(D),j)}function w(D){return D===null||Me(D)?x(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(D))}function T(D){return D===null||Me(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(D)):D===96&&D===p?a(D):(e.consume(D),T)}function R(D){return e.attempt(u,W,q)(D)}function q(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),N}function N(D){return c>0&&Ke(D)?tt(e,H,"linePrefix",c+1)(D):H(D)}function H(D){return D===null||Me(D)?e.check(Zy,R,W)(D):(e.enter("codeFlowValue"),$(D))}function $(D){return D===null||Me(D)?(e.exit("codeFlowValue"),H(D)):(e.consume(D),$)}function W(D){return e.exit("codeFenced"),i(D)}function ae(D,Q,re){let ee=0;return L;function L(ue){return D.enter("lineEnding"),D.consume(ue),D.exit("lineEnding"),te}function te(ue){return D.enter("codeFencedFence"),Ke(ue)?tt(D,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(D.enter("codeFencedFenceSequence"),Ee(ue)):re(ue)}function Ee(ue){return ue===p?(ee++,D.consume(ue),Ee):ee>=d?(D.exit("codeFencedFenceSequence"),Ke(ue)?tt(D,ge,"whitespace")(ue):ge(ue)):re(ue)}function ge(ue){return ue===null||Me(ue)?(D.exit("codeFencedFence"),Q(ue)):re(ue)}}}function dS(e,i,a){const r=this;return u;function u(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const ep={name:"codeIndented",tokenize:pS},fS={partial:!0,tokenize:hS};function pS(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),tt(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):a(m)}function d(m){return m===null?g(m):Me(m)?e.attempt(fS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Me(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function hS(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):tt(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Me(d)?u(d):a(d)}}const mS={name:"codeText",previous:yS,resolve:gS,tokenize:xS};function gS(e){let i=e.length-4,a=3,r,u;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function yS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xS(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Me(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Me(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class bS{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const u=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&Lo(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),Lo(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Lo(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);Lo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Lo(this.left,a.reverse())}}}function Lo(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Ub(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new bS(e);for(;++a<b.length;){for(;a in i;)a=i[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(g=r[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,vS(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Kn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function vS(e,i){const a=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,j=-1,w=a,T=0,R=0;const q=[R];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++j<p.length;)p[j][0]==="exit"&&p[j-1][0]==="enter"&&p[j][1].type===p[j-1][1].type&&p[j][1].start.line!==p[j][1].end.line&&(R=j+1,q.push(R),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):q.pop(),j=q.length;j--;){const N=p.slice(q[j],q[j+1]),H=c.pop();g.push([H,H+N.length-1]),e.splice(H,2,N)}for(g.reverse(),j=-1;++j<g.length;)m[T+g[j][0]]=T+g[j][1],T+=g[j][1]-g[j][0]-1;return m}const wS={resolve:jS,tokenize:SS},kS={partial:!0,tokenize:CS};function jS(e){return Ub(e),e}function SS(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Me(p)?e.check(kS,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function CS(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),tt(e,c,"linePrefix")}function c(d){if(d===null||Me(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Bb(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(N){return N===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(N),e.exit(c),j):N===null||N===32||N===41||Vc(N)?a(N):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),R(N))}function j(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===62?(e.exit("chunkString"),e.exit(p),j(N)):N===null||N===60||Me(N)?a(N):(e.consume(N),N===92?T:w)}function T(N){return N===60||N===62||N===92?(e.consume(N),w):w(N)}function R(N){return!b&&(N===null||N===41||yt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):b<m&&N===40?(e.consume(N),b++,R):N===41?(e.consume(N),b--,R):N===null||N===32||N===40||Vc(N)?a(N):(e.consume(N),N===92?q:R)}function q(N){return N===40||N===41||N===92?(e.consume(N),R):R(N)}}function qb(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Me(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Me(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Ke(w)),w===92?j:x)}function j(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Hb(e,i,a,r,u,c){let d;return p;function p(j){return j===34||j===39||j===40?(e.enter(r),e.enter(u),e.consume(j),e.exit(u),d=j===40?41:j,g):a(j)}function g(j){return j===d?(e.enter(u),e.consume(j),e.exit(u),e.exit(r),i):(e.enter(c),m(j))}function m(j){return j===d?(e.exit(c),g(d)):j===null?a(j):Me(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),tt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===d||j===null||Me(j)?(e.exit("chunkString"),m(j)):(e.consume(j),j===92?x:b)}function x(j){return j===d||j===92?(e.consume(j),b):b(j)}}function Wo(e,i){let a;return r;function r(u){return Me(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):Ke(u)?tt(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const TS={name:"definition",tokenize:AS},ES={partial:!0,tokenize:NS};function AS(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return qb.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):a(w)}function g(w){return yt(w)?Wo(e,m)(w):m(w)}function m(w){return Bb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(ES,x,x)(w)}function x(w){return Ke(w)?tt(e,j,"whitespace")(w):j(w)}function j(w){return w===null||Me(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function NS(e,i,a){return r;function r(p){return yt(p)?Wo(e,u)(p):a(p)}function u(p){return Hb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Ke(p)?tt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Me(p)?i(p):a(p)}}const DS={name:"hardBreakEscape",tokenize:_S};function _S(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Me(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const RS={name:"headingAtx",resolve:MS,tokenize:OS};function MS(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Kn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function OS(e,i,a){let r=0;return u;function u(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||yt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Me(b)?(e.exit("atxHeading"),i(b)):Ke(b)?tt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||yt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const zS=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ex=["pre","script","style","textarea"],LS={concrete:!0,name:"htmlFlow",resolveTo:BS,tokenize:qS},IS={partial:!0,tokenize:$S},US={partial:!0,tokenize:HS};function BS(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function qS(e,i,a){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),j):C===47?(e.consume(C),c=!0,R):C===63?(e.consume(C),u=3,r.interrupt?i:O):kn(C)?(e.consume(C),d=String.fromCharCode(C),q):a(C)}function j(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,T):kn(C)?(e.consume(C),u=4,r.interrupt?i:O):a(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):a(C)}function T(C){const Y="CDATA[";return C===Y.charCodeAt(p++)?(e.consume(C),p===Y.length?r.interrupt?i:de:T):a(C)}function R(C){return kn(C)?(e.consume(C),d=String.fromCharCode(C),q):a(C)}function q(C){if(C===null||C===47||C===62||yt(C)){const Y=C===47,fe=d.toLowerCase();return!Y&&!c&&ex.includes(fe)?(u=1,r.interrupt?i(C):de(C)):zS.includes(d.toLowerCase())?(u=6,Y?(e.consume(C),N):r.interrupt?i(C):de(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?H(C):$(C))}return C===45||hn(C)?(e.consume(C),d+=String.fromCharCode(C),q):a(C)}function N(C){return C===62?(e.consume(C),r.interrupt?i:de):a(C)}function H(C){return Ke(C)?(e.consume(C),H):L(C)}function $(C){return C===47?(e.consume(C),L):C===58||C===95||kn(C)?(e.consume(C),W):Ke(C)?(e.consume(C),$):L(C)}function W(C){return C===45||C===46||C===58||C===95||hn(C)?(e.consume(C),W):ae(C)}function ae(C){return C===61?(e.consume(C),D):Ke(C)?(e.consume(C),ae):$(C)}function D(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),g=C,Q):Ke(C)?(e.consume(C),D):re(C)}function Q(C){return C===g?(e.consume(C),g=null,ee):C===null||Me(C)?a(C):(e.consume(C),Q)}function re(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||yt(C)?ae(C):(e.consume(C),re)}function ee(C){return C===47||C===62||Ke(C)?$(C):a(C)}function L(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||Me(C)?de(C):Ke(C)?(e.consume(C),te):a(C)}function de(C){return C===45&&u===2?(e.consume(C),V):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),_e):Me(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(IS,z,Ee)(C)):C===null||Me(C)?(e.exit("htmlFlowData"),Ee(C)):(e.consume(C),de)}function Ee(C){return e.check(US,ge,z)(C)}function ge(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Me(C)?Ee(C):(e.enter("htmlFlowData"),de(C))}function V(C){return C===45?(e.consume(C),O):de(C)}function oe(C){return C===47?(e.consume(C),d="",xe):de(C)}function xe(C){if(C===62){const Y=d.toLowerCase();return ex.includes(Y)?(e.consume(C),A):de(C)}return kn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),xe):de(C)}function _e(C){return C===93?(e.consume(C),O):de(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):de(C)}function A(C){return C===null||Me(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function HS(e,i,a){const r=this;return u;function u(d){return Me(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function $S(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(au,i,a)}}const GS={name:"htmlText",tokenize:VS};function VS(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ae):O===63?(e.consume(O),$):kn(O)?(e.consume(O),re):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,T):kn(O)?(e.consume(O),H):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),j):Me(O)?(d=x,oe(O)):(e.consume(O),x)}function j(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?j(O):x(O)}function T(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?R:T):a(O)}function R(O){return O===null?a(O):O===93?(e.consume(O),q):Me(O)?(d=R,oe(O)):(e.consume(O),R)}function q(O){return O===93?(e.consume(O),N):R(O)}function N(O){return O===62?V(O):O===93?(e.consume(O),N):R(O)}function H(O){return O===null||O===62?V(O):Me(O)?(d=H,oe(O)):(e.consume(O),H)}function $(O){return O===null?a(O):O===63?(e.consume(O),W):Me(O)?(d=$,oe(O)):(e.consume(O),$)}function W(O){return O===62?V(O):$(O)}function ae(O){return kn(O)?(e.consume(O),D):a(O)}function D(O){return O===45||hn(O)?(e.consume(O),D):Q(O)}function Q(O){return Me(O)?(d=Q,oe(O)):Ke(O)?(e.consume(O),Q):V(O)}function re(O){return O===45||hn(O)?(e.consume(O),re):O===47||O===62||yt(O)?ee(O):a(O)}function ee(O){return O===47?(e.consume(O),V):O===58||O===95||kn(O)?(e.consume(O),L):Me(O)?(d=ee,oe(O)):Ke(O)?(e.consume(O),ee):V(O)}function L(O){return O===45||O===46||O===58||O===95||hn(O)?(e.consume(O),L):te(O)}function te(O){return O===61?(e.consume(O),de):Me(O)?(d=te,oe(O)):Ke(O)?(e.consume(O),te):ee(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Ee):Me(O)?(d=de,oe(O)):Ke(O)?(e.consume(O),de):(e.consume(O),ge)}function Ee(O){return O===u?(e.consume(O),u=void 0,ue):O===null?a(O):Me(O)?(d=Ee,oe(O)):(e.consume(O),Ee)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||yt(O)?ee(O):(e.consume(O),ge)}function ue(O){return O===47||O===62||yt(O)?ee(O):a(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),xe}function xe(O){return Ke(O)?tt(e,_e,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_e(O)}function _e(O){return e.enter("htmlTextData"),d(O)}}const yh={name:"labelEnd",resolveAll:WS,resolveTo:KS,tokenize:XS},FS={tokenize:QS},PS={tokenize:ZS},YS={tokenize:JS};function WS(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&Kn(e,0,e.length,a),e}function KS(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=a,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=a);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=fi(p,e.slice(c+1,c+r+3)),p=fi(p,[["enter",b,i]]),p=fi(p,Jc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=fi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=fi(p,e.slice(d+1)),p=fi(p,[["exit",g,i]]),Kn(e,c,e.length,p),e}function XS(e,i,a){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(j){return c?c._inactive?x(j):(d=r.parser.defined.includes(ki(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(j),e.exit("labelMarker"),e.exit("labelEnd"),g):a(j)}function g(j){return j===40?e.attempt(FS,b,d?b:x)(j):j===91?e.attempt(PS,b,d?m:x)(j):d?b(j):x(j)}function m(j){return e.attempt(YS,b,x)(j)}function b(j){return i(j)}function x(j){return c._balanced=!0,a(j)}}function QS(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return yt(x)?Wo(e,c)(x):c(x)}function c(x){return x===41?b(x):Bb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return yt(x)?Wo(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Hb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return yt(x)?Wo(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function ZS(e,i,a){const r=this;return u;function u(p){return qb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(ki(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function JS(e,i,a){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const e0={name:"labelStartImage",resolveAll:yh.resolveAll,tokenize:t0};function t0(e,i,a){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):a(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):i(p)}}const n0={name:"labelStartLink",resolveAll:yh.resolveAll,tokenize:i0};function i0(e,i,a){const r=this;return u;function u(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const tp={name:"lineEnding",tokenize:a0};function a0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}const Uc={name:"thematicBreak",tokenize:l0};function l0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Me(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Ke(m)?tt(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:u0},exit:d0,name:"list",tokenize:o0},r0={partial:!0,tokenize:f0},s0={partial:!0,tokenize:c0};function o0(e,i,a){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const T=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:qp(w)){if(r.containerState.type||(r.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Uc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return qp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(au,r.interrupt?a:b,e.attempt(r0,j,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,j(w)}function x(w){return Ke(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),j):a(w)}function j(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function u0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(au,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tt(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!Ke(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(s0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(In,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function c0(e,i,a){const r=this;return tt(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):a(c)}}function d0(e){e.exit(this.containerState.type)}function f0(e,i,a){const r=this;return tt(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!Ke(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const tx={name:"setextUnderline",resolveTo:p0,tokenize:h0};function p0(e,i){let a=e.length,r,u,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(u=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",d,i]),e.splice(c+1,0,["exit",e[r][1],i]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,i]),e}function h0(e,i,a){const r=this;let u;return c;function c(m){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Ke(m)?tt(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Me(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const m0={tokenize:g0};function g0(e){const i=this,a=e.attempt(au,r,e.attempt(this.parser.constructs.flowInitial,u,tt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(wS,u)),"linePrefix")));return a;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const y0={resolveAll:Gb()},x0=$b("string"),b0=$b("text");function $b(e){return{resolveAll:Gb(e==="text"?v0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let j=-1;if(x)for(;++j<x.length;){const w=x[j];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Gb(e){return i;function i(a,r){let u=-1,c;for(;++u<=a.length;)c===void 0?a[u]&&a[u][1].type==="data"&&(c=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==c+2&&(a[c][1].end=a[u-1][1].end,a.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(a,r):a}}function v0(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const w0={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:zb},k0={91:TS},j0={[-2]:ep,[-1]:ep,32:ep},S0={35:RS,42:Uc,45:[tx,Uc],60:LS,61:tx,95:Uc,96:Jy,126:Jy},C0={38:Ib,92:Lb},T0={[-5]:tp,[-4]:tp,[-3]:tp,33:e0,38:Ib,42:Hp,60:[nS,GS],91:n0,92:[DS,Lb],93:yh,95:Hp,96:mS},E0={null:[Hp,y0]},A0={null:[42,95]},N0={null:[]},D0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:A0,contentInitial:k0,disable:N0,document:w0,flow:S0,flowInitial:j0,insideSpan:E0,string:C0,text:T0},Symbol.toStringTag,{value:"Module"}));function _0(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:Q(ae),check:Q(D),consume:H,enter:$,exit:W,interrupt:Q(D,{interrupt:!0})},m={code:null,containerState:{},defineSkip:R,events:[],now:T,parser:e,previous:null,sliceSerialize:j,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=fi(d,te),q(),d[d.length-1]!==null?[]:(re(i,0),m.events=Jc(c,m.events,m),m.events)}function j(te,de){return M0(w(te),de)}function w(te){return R0(d,te)}function T(){const{_bufferIndex:te,_index:de,line:Ee,column:ge,offset:ue}=r;return{_bufferIndex:te,_index:de,line:Ee,column:ge,offset:ue}}function R(te){u[te.line]=te.column,L()}function q(){let te;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<de.length;)N(de.charCodeAt(r._bufferIndex));else N(de)}}function N(te){b=b(te)}function H(te){Me(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function $(te,de){const Ee=de||{};return Ee.type=te,Ee.start=T(),m.events.push(["enter",Ee,m]),p.push(Ee),Ee}function W(te){const de=p.pop();return de.end=T(),m.events.push(["exit",de,m]),de}function ae(te,de){re(te,de.from)}function D(te,de){de.restore()}function Q(te,de){return Ee;function Ee(ge,ue,V){let oe,xe,_e,O;return Array.isArray(ge)?z(ge):"tokenize"in ge?z([ge]):A(ge);function A(X){return ye;function ye(Re){const Fe=Re!==null&&X[Re],jt=Re!==null&&X.null,xt=[...Array.isArray(Fe)?Fe:Fe?[Fe]:[],...Array.isArray(jt)?jt:jt?[jt]:[]];return z(xt)(Re)}}function z(X){return oe=X,xe=0,X.length===0?V:C(X[xe])}function C(X){return ye;function ye(Re){return O=ee(),_e=X,X.partial||(m.currentConstruct=X),X.name&&m.parser.constructs.disable.null.includes(X.name)?fe():X.tokenize.call(de?Object.assign(Object.create(m),de):m,g,Y,fe)(Re)}}function Y(X){return te(_e,O),ue}function fe(X){return O.restore(),++xe<oe.length?C(oe[xe]):V}}}function re(te,de){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Kn(m.events,de,m.events.length-de,te.resolve(m.events.slice(de),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=T(),de=m.previous,Ee=m.currentConstruct,ge=m.events.length,ue=Array.from(p);return{from:ge,restore:V};function V(){r=te,m.previous=de,m.currentConstruct=Ee,m.events.length=ge,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function R0(e,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[e[a].slice(r,c)];else{if(d=e.slice(a,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function M0(e,i){let a=-1;const r=[];let u;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
52
|
+
`;break}case-3:{d=`\r
|
|
53
|
+
`;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function O0(e){const r={constructs:Mb([D0,...(e||{}).extensions||[]]),content:u(Kj),defined:[],document:u(Qj),flow:u(m0),lazy:{},string:u(x0),text:u(b0)};return r;function u(c){return d;function d(p){return _0(r,c,p)}}}function z0(e){for(;!Ub(e););return e}const nx=/[\0\t\n\r]/g;function L0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,j,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(nx.lastIndex=x,m=nx.exec(c),j=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(j),!m){i=c.slice(x);break}if(w===10&&x===j&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<j&&(g.push(c.slice(x,j)),e+=j-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=j+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const I0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function U0(e){return e.replace(I0,B0)}function B0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return Ob(a.slice(c?2:1),c?16:10)}return gh(a)||e}const Vb={}.hasOwnProperty;function q0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),H0(a)(z0(O0(a).document().write(L0()(e,i,!0))))}function H0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(gn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(Ot),blockQuote:c(jt),characterEscape:ee,characterReference:ee,codeFenced:c(xt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(xt,d),codeText:c(on,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Pe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(wt),hardBreakEscape:c(un),hardBreakTrailing:c(un),htmlFlow:c(ze,d),htmlFlowData:ee,htmlText:c(ze,d),htmlTextData:ee,image:c(zt),label:d,link:c(gn),listItem:c(ji),listItemValue:j,listOrdered:c(Kt,x),listUnordered:c(Kt),paragraph:c(Xn),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Ot),strong:c(Ea),thematicBreak:c(Aa)},exit:{atxHeading:g(),atxHeadingSequence:ae,autolink:g(),autolinkEmail:Fe,autolinkProtocol:Re,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:X,characterReference:ye,codeFenced:g(q),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:g(N),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:W,definitionLabelString:H,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ee),htmlFlowData:L,htmlText:g(ge),htmlTextData:L,image:g(oe),label:_e,labelText:xe,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:Y,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(re),setextHeadingLineSequence:Q,setextHeadingText:D,strong:g(),thematicBreak:g()}};Fb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ie){let ce={type:"root",children:[]};const Ce={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},Ue=[];let Xe=-1;for(;++Xe<ie.length;)if(ie[Xe][1].type==="listOrdered"||ie[Xe][1].type==="listUnordered")if(ie[Xe][0]==="enter")Ue.push(Xe);else{const Vt=Ue.pop();Xe=u(ie,Vt,Xe)}for(Xe=-1;++Xe<ie.length;){const Vt=i[ie[Xe][0]];Vb.call(Vt,ie[Xe][1].type)&&Vt[ie[Xe][1].type].call(Object.assign({sliceSerialize:ie[Xe][2].sliceSerialize},Ce),ie[Xe][1])}if(Ce.tokenStack.length>0){const Vt=Ce.tokenStack[Ce.tokenStack.length-1];(Vt[1]||ix).call(Ce,void 0,Vt[0])}for(ce.position={start:El(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:El(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)ce=i.transforms[Xe](ce)||ce;return ce}function u(ie,ce,Ce){let Ue=ce-1,Xe=-1,Vt=!1,Qn,Ft,Tt,ut;for(;++Ue<=Ce;){const rt=ie[Ue];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Xe++:Xe--,ut=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Qn&&!ut&&!Xe&&!Tt&&(Tt=Ue),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Xe&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Xe===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Qn){let Si=Ue;for(Ft=void 0;Si--;){const jn=ie[Si];if(jn[1].type==="lineEnding"||jn[1].type==="lineEndingBlank"){if(jn[0]==="exit")continue;Ft&&(ie[Ft][1].type="lineEndingBlank",Vt=!0),jn[1].type="lineEnding",Ft=Si}else if(!(jn[1].type==="linePrefix"||jn[1].type==="blockQuotePrefix"||jn[1].type==="blockQuotePrefixWhitespace"||jn[1].type==="blockQuoteMarker"||jn[1].type==="listItemIndent"))break}Tt&&(!Ft||Tt<Ft)&&(Qn._spread=!0),Qn.end=Object.assign({},Ft?ie[Ft][1].start:rt[1].end),ie.splice(Ft||Ue,0,["exit",Qn,rt[2]]),Ue++,Ce++}if(rt[1].type==="listItemPrefix"){const Si={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Qn=Si,ie.splice(Ue,0,["enter",Si,rt[2]]),Ue++,Ce++,Tt=void 0,ut=!0}}}return ie[ce][1]._spread=Vt,Ce}function c(ie,ce){return Ce;function Ce(Ue){p.call(this,ie(Ue),Ue),ce&&ce.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ie,ce,Ce){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ce,Ce||void 0]),ie.position={start:El(ce.start),end:void 0}}function g(ie){return ce;function ce(Ce){ie&&ie.call(this,Ce),m.call(this,Ce)}}function m(ie,ce){const Ce=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ie.type&&(ce?ce.call(this,ie,Ue[0]):(Ue[1]||ix).call(this,ie,Ue[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Yo({start:ie.start,end:ie.end})+"): it’s not open");Ce.position.end=El(ie.end)}function b(){return mh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function j(ie){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ie}function T(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ie}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function q(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/(\r?\n|\r)$/g,"")}function H(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ki(this.sliceSerialize(ie)).toLowerCase()}function $(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function W(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function ae(ie){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ce=this.sliceSerialize(ie).length;ce.depth=Ce}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function Q(ie){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ie){const Ce=this.stack[this.stack.length-1].children;let Ue=Ce[Ce.length-1];(!Ue||Ue.type!=="text")&&(Ue=Dt(),Ue.position={start:El(ie.start),end:void 0},Ce.push(Ue)),this.stack.push(Ue)}function L(ie){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ie),ce.position.end=El(ie.end)}function te(ie){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ce.children[ce.children.length-1];Ce.position.end=El(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(ee.call(this,ie),L.call(this,ie))}function de(){this.data.atHardBreak=!0}function Ee(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ge(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ue(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function V(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function oe(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function xe(ie){const ce=this.sliceSerialize(ie),Ce=this.stack[this.stack.length-2];Ce.label=U0(ce),Ce.identifier=ki(ce).toLowerCase()}function _e(){const ie=this.stack[this.stack.length-1],ce=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Ue=ie.children;Ce.children=Ue}else Ce.alt=ce}function O(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function A(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function Y(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ki(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function fe(ie){this.data.characterReferenceType=ie.type}function X(ie){const ce=this.sliceSerialize(ie),Ce=this.data.characterReferenceType;let Ue;Ce?(Ue=Ob(ce,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=gh(ce);const Xe=this.stack[this.stack.length-1];Xe.value+=Ue}function ye(ie){const ce=this.stack.pop();ce.position.end=El(ie.end)}function Re(ie){L.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ie)}function Fe(ie){L.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ie)}function jt(){return{type:"blockquote",children:[]}}function xt(){return{type:"code",lang:null,meta:null,value:""}}function on(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wt(){return{type:"emphasis",children:[]}}function Ot(){return{type:"heading",depth:0,children:[]}}function un(){return{type:"break"}}function ze(){return{type:"html",value:""}}function zt(){return{type:"image",title:null,url:"",alt:null}}function gn(){return{type:"link",title:null,url:"",children:[]}}function Kt(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function ji(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Xn(){return{type:"paragraph",children:[]}}function Ea(){return{type:"strong",children:[]}}function Dt(){return{type:"text",value:""}}function Aa(){return{type:"thematicBreak"}}}function El(e){return{line:e.line,column:e.column,offset:e.offset}}function Fb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Fb(e,r):$0(e,r)}}function $0(e,i){let a;for(a in i)if(Vb.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function ix(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Yo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Yo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Yo({start:i.start,end:i.end})+") is still open")}function G0(e){const i=this;i.parser=a;function a(r){return q0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function V0(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function F0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
54
|
+
`}]}function P0(e,i){const a=i.value?i.value+`
|
|
55
|
+
`:"",r={},u=i.lang?i.lang.split(/\s+/):[];u.length>0&&(r.className=["language-"+u[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(c.data={meta:i.meta}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function Y0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function W0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function K0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=ws(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function X0(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Q0(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Pb(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const u=e.all(i),c=u[0];c&&c.type==="text"?c.value="["+c.value:u.unshift({type:"text",value:"["});const d=u[u.length-1];return d&&d.type==="text"?d.value+=r:u.push({type:"text",value:r}),u}function Z0(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Pb(e,i);const u={src:ws(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"img",properties:u,children:[]};return e.patch(i,c),e.applyData(i,c)}function J0(e,i){const a={src:ws(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function e1(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function t1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Pb(e,i);const u={href:ws(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function n1(e,i){const a={href:ws(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function i1(e,i,a){const r=e.all(i),u=a?a1(a):Yb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
56
|
+
`}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
|
|
57
|
+
`});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function a1(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Yb(a[r])}return i}function Yb(e){const i=e.spread;return i??e.children.length>1}function l1(e,i){const a={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++u<r.length;){const d=r[u];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function r1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function s1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function o1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function u1(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=dh(i.children[1]),g=Tb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function c1(e,i,a){const r=a?a.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],j={},w=d?d[g]:void 0;w&&(j.align=w);let T={type:"element",tagName:c,properties:j,children:[]};x&&(T.children=e.all(x),e.patch(x,T),T=e.applyData(x,T)),m.push(T)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function d1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const ax=9,lx=32;function f1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(rx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(rx(i.slice(u),u>0,!1)),c.join("")}function rx(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===ax||c===lx;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===ax||c===lx;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function p1(e,i){const a={type:"text",value:f1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function h1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const m1={blockquote:V0,break:F0,code:P0,delete:Y0,emphasis:W0,footnoteReference:K0,heading:X0,html:Q0,imageReference:Z0,image:J0,inlineCode:e1,linkReference:t1,link:n1,listItem:i1,list:l1,paragraph:r1,root:s1,strong:o1,table:u1,tableCell:d1,tableRow:c1,text:p1,thematicBreak:h1,toml:Ec,yaml:Ec,definition:Ec,footnoteDefinition:Ec};function Ec(){}const Wb=-1,ed=0,Ko=1,Fc=2,xh=3,bh=4,vh=5,wh=6,Kb=7,Xb=8,g1=typeof self=="object"?self:globalThis,sx=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new g1[e](i)},y1=(e,i)=>{const a=(u,c)=>(e.set(c,u),u),r=u=>{if(e.has(u))return e.get(u);const[c,d]=i[u];switch(c){case ed:case Wb:return a(d,u);case Ko:{const p=a([],u);for(const g of d)p.push(r(g));return p}case Fc:{const p=a({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case xh:return a(new Date(d),u);case bh:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case vh:{const p=a(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case wh:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case Kb:{const{name:p,message:g}=d;return a(sx(p,g),u)}case Xb:return a(BigInt(d),u);case"BigInt":return a(Object(BigInt(d)),u);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return a(new DataView(p),d)}}return a(sx(c,d),u)};return r},ox=e=>y1(new Map,e)(0),dr="",{toString:x1}={},{keys:b1}=Object,Io=e=>{const i=typeof e;if(i!=="object"||!e)return[ed,i];const a=x1.call(e).slice(8,-1);switch(a){case"Array":return[Ko,dr];case"Object":return[Fc,dr];case"Date":return[xh,dr];case"RegExp":return[bh,dr];case"Map":return[vh,dr];case"Set":return[wh,dr];case"DataView":return[Ko,a]}return a.includes("Array")?[Ko,a]:a.includes("Error")?[Kb,a]:[Fc,a]},Ac=([e,i])=>e===ed&&(i==="function"||i==="symbol"),v1=(e,i,a,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return a.set(p,g),g},c=d=>{if(a.has(d))return a.get(d);let[p,g]=Io(d);switch(p){case ed:{let b=d;switch(g){case"bigint":p=Xb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Wb],d)}return u([p,b],d)}case Ko:{if(g){let j=d;return g==="DataView"?j=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(j=new Uint8Array(d)),u([g,[...j]],d)}const b=[],x=u([p,b],d);for(const j of d)b.push(c(j));return x}case Fc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const j of b1(d))(e||!Ac(Io(d[j])))&&b.push([c(j),c(d[j])]);return x}case xh:return u([p,isNaN(d.getTime())?dr:d.toISOString()],d);case bh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case vh:{const b=[],x=u([p,b],d);for(const[j,w]of d)(e||!(Ac(Io(j))||Ac(Io(w))))&&b.push([c(j),c(w)]);return x}case wh:{const b=[],x=u([p,b],d);for(const j of d)(e||!Ac(Io(j)))&&b.push(c(j));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},ux=(e,{json:i,lossy:a}={})=>{const r=[];return v1(!(i||a),!!i,new Map,r)(e),r},Pc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ox(ux(e,i)):structuredClone(e):(e,i)=>ox(ux(e,i));function w1(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function k1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function j1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||w1,r=e.options.footnoteBackLabel||k1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),j=ws(x.toLowerCase());let w=0;const T=[],R=e.footnoteCounts.get(x);for(;R!==void 0&&++w<=R;){T.length>0&&T.push({type:"text",value:" "});let H=typeof a=="string"?a:a(g,w);typeof H=="string"&&(H={type:"text",value:H}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+j+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const q=b[b.length-1];if(q&&q.type==="element"&&q.tagName==="p"){const H=q.children[q.children.length-1];H&&H.type==="text"?H.value+=" ":q.children.push({type:"text",value:" "}),q.children.push(...T)}else b.push(...T);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+j},children:e.wrap(b,!0)};e.patch(m,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Pc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
58
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
|
|
59
|
+
`}]}}const td=(function(e){if(e==null)return E1;if(typeof e=="function")return nd(e);if(typeof e=="object")return Array.isArray(e)?S1(e):C1(e);if(typeof e=="string")return T1(e);throw new Error("Expected function, string, or object as test")});function S1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=td(e[a]);return nd(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function C1(e){const i=e;return nd(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function T1(e){return nd(i);function i(a){return a&&a.type===e}}function nd(e){return i;function i(a,r,u){return!!(A1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function E1(){return!0}function A1(e){return e!==null&&typeof e=="object"&&"type"in e}const Qb=[],N1=!0,$p=!1,D1="skip";function Zb(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=td(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return j;function j(){let w=Qb,T,R,q;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=_1(a(g,b)),w[0]===$p))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==D1)for(R=(r?N.children.length:-1)+d,q=b.concat(N);R>-1&&R<N.children.length;){const H=N.children[R];if(T=p(H,R,q)(),T[0]===$p)return T;R=typeof T[1]=="number"?T[1]:R+d}}return w}}}function _1(e){return Array.isArray(e)?e:typeof e=="number"?[N1,e]:e==null?Qb:[e]}function kh(e,i,a,r){let u,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,u=a):(c=i,d=a,u=r),Zb(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Gp={}.hasOwnProperty,R1={};function M1(e,i){const a=i||R1,r=new Map,u=new Map,c=new Map,d={...m1,...a.handlers},p={all:m,applyData:z1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:O1,wrap:I1};return kh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,j=String(b.identifier).toUpperCase();x.has(j)||x.set(j,b)}}),p;function g(b,x){const j=b.type,w=p.handlers[j];if(Gp.call(p.handlers,j)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(j)){if("children"in b){const{children:R,...q}=b,N=Pc(q);return N.children=p.all(b),N}return Pc(b)}return(p.options.unknownHandler||L1)(p,b,x)}function m(b){const x=[];if("children"in b){const j=b.children;let w=-1;for(;++w<j.length;){const T=p.one(j[w],b);if(T){if(w&&j[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=cx(T.value)),!Array.isArray(T)&&T.type==="element")){const R=T.children[0];R&&R.type==="text"&&(R.value=cx(R.value))}Array.isArray(T)?x.push(...T):x.push(T)}}}return x}}function O1(e,i){e.position&&(i.position=wj(e))}function z1(e,i){let a=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&c&&Object.assign(a.properties,Pc(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function L1(e,i){const a=i.data||{},r="value"in i&&!(Gp.call(a,"hProperties")||Gp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function I1(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
60
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
61
|
+
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
62
|
+
`}),a}function cx(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function dx(e,i){const a=M1(e,i),r=a.one(e,void 0),u=j1(a),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
|
|
63
|
+
`},u),c}function U1(e,i){return e&&"run"in e?async function(a,r){const u=dx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return dx(a,{file:r,...e||i})}}function fx(e){if(e)throw e}var np,px;function B1(){if(px)return np;px=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var j;for(j in m);return typeof j>"u"||e.call(m,j)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return np=function g(){var m,b,x,j,w,T,R=arguments[0],q=1,N=arguments.length,H=!1;for(typeof R=="boolean"&&(H=R,R=arguments[1]||{},q=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});q<N;++q)if(m=arguments[q],m!=null)for(b in m)x=p(R,b),j=p(m,b),R!==j&&(H&&j&&(c(j)||(w=u(j)))?(w?(w=!1,T=x&&u(x)?x:[]):T=x&&c(x)?x:{},d(R,{name:b,newValue:g(H,T,j)})):typeof j<"u"&&d(R,{name:b,newValue:j}));return R},np}var q1=B1();const ip=xb(q1);function Vp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function H1(){const e=[],i={run:a,use:r};return i;function a(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?$1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function $1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Yi={basename:G1,dirname:V1,extname:F1,join:P1,sep:"/"};function G1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');lu(e);let a=0,r=-1,u=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function V1(e){if(lu(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function F1(e){lu(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||a<0||c===0||c===1&&u===a-1&&u===r+1?"":e.slice(u,a)}function P1(...e){let i=-1,a;for(;++i<e.length;)lu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":Y1(a)}function Y1(e){lu(e);const i=e.codePointAt(0)===47;let a=W1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function W1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),u=d,c=0;continue}}else if(a.length>0){a="",r=0,u=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return a}function lu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const K1={cwd:X1};function X1(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q1(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return Z1(e)}function Z1(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(i)}const ap=["history","path","basename","stem","extname","dirname"];class Jb{constructor(i){let a;i?Fp(i)?a={path:i}:typeof i=="string"||J1(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":K1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ap.length;){const c=ap[r];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let u;for(u in a)ap.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Yi.basename(this.path):void 0}set basename(i){rp(i,"basename"),lp(i,"basename"),this.path=Yi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Yi.dirname(this.path):void 0}set dirname(i){hx(this.basename,"dirname"),this.path=Yi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Yi.extname(this.path):void 0}set extname(i){if(lp(i,"extname"),hx(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Fp(i)&&(i=Q1(i)),rp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Yi.basename(this.path,this.extname):void 0}set stem(i){rp(i,"stem"),lp(i,"stem"),this.path=Yi.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const u=this.message(i,a,r);throw u.fatal=!0,u}info(i,a,r){const u=this.message(i,a,r);return u.fatal=void 0,u}message(i,a,r){const u=new mn(i,a,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function lp(e,i){if(e&&e.includes(Yi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Yi.sep+"`")}function rp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function hx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function J1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const eC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),tC={}.hasOwnProperty;class jh extends eC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=H1()}copy(){const i=new jh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(ip(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(up("data",this.frozen),this.namespace[i]=a,this):tC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(up("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=a.call(i,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=Nc(i),r=this.parser||this.Parser;return sp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),sp("process",this.parser||this.Parser),op("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=Nc(i),g=r.parse(p);r.run(g,p,function(b,x,j){if(b||!x||!j)return m(b);const w=x,T=r.stringify(w,j);aC(T)?j.value=T:j.result=T,m(b,j)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),sp("processSync",this.parser||this.Parser),op("processSync",this.compiler||this.Compiler),this.process(i,u),gx("processSync","process",a),r;function u(c,d){a=!0,fx(c),r=d}}run(i,a,r){mx(i),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=Nc(a);u.run(i,g,m);function m(b,x,j){const w=x||i;b?p(b):d?d(w):r(void 0,w,j)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),gx("runSync","run",r),u;function c(d,p){fx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=Nc(a),u=this.compiler||this.Compiler;return op("stringify",u),mx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(up("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=ip(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,j=-1;for(;++x<r.length;)if(r[x][0]===m){j=x;break}if(j===-1)r.push([m,...b]);else if(b.length>0){let[w,...T]=b;const R=r[j][1];Vp(R)&&Vp(w)&&(w=ip(!0,R,w)),r[j]=[m,w,...T]}}}}const nC=new jh().freeze();function sp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function op(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function up(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mx(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Nc(e){return iC(e)?e:new Jb(e)}function iC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aC(e){return typeof e=="string"||lC(e)}function lC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",yx=[],xx={allowDangerousHtml:!0},sC=/^(https?|ircs?|mailto|xmpp)$/i,oC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function uC(e){const i=cC(e),a=dC(e);return fC(i.runSync(i.parse(a),a),e)}function cC(e){const i=e.rehypePlugins||yx,a=e.remarkPlugins||yx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xx}:xx;return nC().use(G0).use(a).use(U1,r).use(i)}function dC(e){const i=e.children||"",a=new Jb;return typeof i=="string"&&(a.value=i),a}function fC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||pC;for(const b of oC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+rC+b.id,void 0);return kh(e,m),Tj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,j){if(b.type==="raw"&&j&&typeof x=="number")return d?j.children.splice(x,1):j.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in Jf)if(Object.hasOwn(Jf,w)&&Object.hasOwn(b.properties,w)){const T=b.properties[w],R=Jf[w];(R===null||R.includes(b.tagName))&&(b.properties[w]=g(String(T||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,j)),w&&j&&typeof x=="number")return p&&b.children?j.children.splice(x,1,...b.children):j.children.splice(x,1),x}}}function pC(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||sC.test(e.slice(0,i))?e:""}function bx(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=a.indexOf(i);for(;u!==-1;)r++,u=a.indexOf(i,u+i.length);return r}function hC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mC(e,i,a){const u=td((a||{}).ignore||[]),c=gC(i);let d=-1;for(;++d<c.length;)Zb(e,"text",p);function p(m,b){let x=-1,j;for(;++x<b.length;){const w=b[x],T=j?j.children:void 0;if(u(w,T?T.indexOf(w):void 0,j))return;j=w}if(j)return g(m,b)}function g(m,b){const x=b[b.length-1],j=c[d][0],w=c[d][1];let T=0;const q=x.children.indexOf(m);let N=!1,H=[];j.lastIndex=0;let $=j.exec(m.value);for(;$;){const W=$.index,ae={index:$.index,input:$.input,stack:[...b,m]};let D=w(...$,ae);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?j.lastIndex=W+1:(T!==W&&H.push({type:"text",value:m.value.slice(T,W)}),Array.isArray(D)?H.push(...D):D&&H.push(D),T=W+$[0].length,N=!0),!j.global)break;$=j.exec(m.value)}return N?(T<m.value.length&&H.push({type:"text",value:m.value.slice(T)}),x.children.splice(q,1,...H)):H=[m],q+H.length}}function gC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const u=a[r];i.push([yC(u[0]),xC(u[1])])}return i}function yC(e){return typeof e=="string"?new RegExp(hC(e),"g"):e}function xC(e){return typeof e=="function"?e:function(){return e}}const cp="phrasing",dp=["autolink","link","image","label"];function bC(){return{transforms:[TC],enter:{literalAutolink:wC,literalAutolinkEmail:fp,literalAutolinkHttp:fp,literalAutolinkWww:fp},exit:{literalAutolink:CC,literalAutolinkEmail:SC,literalAutolinkHttp:kC,literalAutolinkWww:jC}}}function vC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:cp,notInConstruct:dp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:cp,notInConstruct:dp},{character:":",before:"[ps]",after:"\\/",inConstruct:cp,notInConstruct:dp}]}}function wC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fp(e){this.config.enter.autolinkProtocol.call(this,e)}function kC(e){this.config.exit.autolinkProtocol.call(this,e)}function jC(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function SC(e){this.config.exit.autolinkEmail.call(this,e)}function CC(e){this.exit(e)}function TC(e){mC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,EC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),AC]],{ignore:["link","linkReference"]})}function EC(e,i,a,r,u){let c="";if(!ev(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!NC(a)))return!1;const d=DC(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function AC(e,i,a,r){return!ev(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function NC(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function DC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=bx(e,"(");let c=bx(e,")");for(;r!==-1&&u>c;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[e,a]}function ev(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||mr(a)||Zc(a))&&(!i||a!==47)}tv.peek=BC;function _C(){this.buffer()}function RC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function MC(){this.buffer()}function OC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ki(this.sliceSerialize(e)).toLowerCase(),a.label=i}function LC(e){this.exit(e)}function IC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ki(this.sliceSerialize(e)).toLowerCase(),a.label=i}function UC(e){this.exit(e)}function BC(){return"["}function tv(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function qC(){return{enter:{gfmFootnoteCallString:_C,gfmFootnoteCall:RC,gfmFootnoteDefinitionLabelString:MC,gfmFootnoteDefinition:OC},exit:{gfmFootnoteCallString:zC,gfmFootnoteCall:LC,gfmFootnoteDefinitionLabelString:IC,gfmFootnoteDefinition:UC}}}function HC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:tv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
|
|
64
|
+
`:" ")+c.indentLines(c.containerFlow(r,p.current()),i?nv:$C))),m(),g}}function $C(e,i,a){return i===0?e:nv(e,i,a)}function nv(e,i,a){return(a?"":" ")+e}const GC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iv.peek=WC;function VC(){return{canContainEols:["delete"],enter:{strikethrough:PC},exit:{strikethrough:YC}}}function FC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GC}],handlers:{delete:iv}}}function PC(e){this.enter({type:"delete",children:[]},e)}function YC(e){this.exit(e)}function iv(e,i,a,r){const u=a.createTracker(r),c=a.enter("strikethrough");let d=u.move("~~");return d+=a.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function WC(){return"~"}function KC(e){return e.length}function XC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||KC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const R=[],q=[];let N=-1;for(e[b].length>m&&(m=e[b].length);++N<e[b].length;){const H=QC(e[b][N]);if(a.alignDelimiters!==!1){const $=u(H);q[N]=$,(g[N]===void 0||$>g[N])&&(g[N]=$)}R.push(H)}d[b]=R,p[b]=q}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=vx(r[x]);else{const R=vx(r);for(;++x<m;)c[x]=R}x=-1;const j=[],w=[];for(;++x<m;){const R=c[x];let q="",N="";R===99?(q=":",N=":"):R===108?q=":":R===114&&(N=":");let H=a.alignDelimiters===!1?1:Math.max(1,g[x]-q.length-N.length);const $=q+"-".repeat(H)+N;a.alignDelimiters!==!1&&(H=q.length+H+N.length,H>g[x]&&(g[x]=H),w[x]=H),j[x]=$}d.splice(1,0,j),p.splice(1,0,w),b=-1;const T=[];for(;++b<d.length;){const R=d[b],q=p[b];x=-1;const N=[];for(;++x<m;){const H=R[x]||"";let $="",W="";if(a.alignDelimiters!==!1){const ae=g[x]-(q[x]||0),D=c[x];D===114?$=" ".repeat(ae):D===99?ae%2?($=" ".repeat(ae/2+.5),W=" ".repeat(ae/2-.5)):($=" ".repeat(ae/2),W=$):W=" ".repeat(ae)}a.delimiterStart!==!1&&!x&&N.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||x)&&N.push(" "),a.alignDelimiters!==!1&&N.push($),N.push(H),a.alignDelimiters!==!1&&N.push(W),a.padding!==!1&&N.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&N.push("|")}T.push(a.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return T.join(`
|
|
65
|
+
`)}function QC(e){return e==null?"":String(e)}function vx(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function ZC(e,i,a,r){const u=a.enter("blockquote"),c=a.createTracker(r);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(e,c.current()),JC);return u(),d}function JC(e,i,a){return">"+(a?"":" ")+e}function eT(e,i){return wx(e,i.inConstruct,!0)&&!wx(e,i.notInConstruct,!1)}function wx(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function kx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
|
+
`&&eT(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
67
|
+
`}function tT(e,i){const a=String(e);let r=a.indexOf(i),u=r,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++c>d&&(d=c):c=1,u=r+i.length,r=a.indexOf(i,u);return d}function nT(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iT(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function aT(e,i,a,r){const u=iT(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(nT(e,a)){const x=a.enter("codeIndented"),j=a.indentLines(c,lT);return x(),j}const p=a.createTracker(r),g=u.repeat(Math.max(tT(c,u)+1,3)),m=a.enter("codeFenced");let b=p.move(g);if(e.lang){const x=a.enter(`codeFencedLang${d}`);b+=p.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(a.safe(e.meta,{before:b,after:`
|
|
68
|
+
`,encode:["`"],...p.current()})),x()}return b+=p.move(`
|
|
69
|
+
`),c&&(b+=p.move(c+`
|
|
70
|
+
`)),b+=p.move(g),m(),b}function lT(e,i,a){return(a?"":" ")+e}function Sh(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function rT(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
71
|
+
`,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function sT(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function nu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Yc(e,i,a){const r=xs(e),u=xs(i);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}av.peek=oT;function av(e,i,a,r){const u=sT(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Yc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=nu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Yc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+nu(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function oT(e,i,a){return a.options.emphasis||"*"}function uT(e,i){let a=!1;return kh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,$p}),!!((!e.depth||e.depth<3)&&mh(e)&&(i.options.setext||a))}function cT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(uT(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),j=a.containerPhrasing(e,{...c.current(),before:`
|
|
72
|
+
`,after:`
|
|
73
|
+
`});return x(),b(),j+`
|
|
74
|
+
`+(u===1?"=":"-").repeat(j.length-(Math.max(j.lastIndexOf("\r"),j.lastIndexOf(`
|
|
75
|
+
`))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=nu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}lv.peek=dT;function lv(e){return e.value||""}function dT(){return"<"}rv.peek=fT;function rv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function fT(){return"!"}sv.peek=pT;function sv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function pT(){return"!"}ov.peek=hT;function ov(e,i,a){let r=e.value||"",u="`",c=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<a.unsafe.length;){const d=a.unsafe[c],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function hT(){return"`"}function uv(e,i){const a=mh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}cv.peek=mT;function cv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(uv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function mT(e,i,a){return uv(e,a)?"<":"["}dv.peek=gT;function dv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function gT(){return"["}function Ch(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function yT(e){const i=Ch(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function xT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function fv(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function bT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?xT(a):Ch(a);const p=e.ordered?d==="."?")":".":yT(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),fv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const j=e.children[x];if(j&&j.type==="listItem"&&j.children&&j.children[0]&&j.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function vT(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function wT(e,i,a,r){const u=vT(a);let c=a.bulletCurrent||Ch(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,j,w){return j?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function kT(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const jT=td(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ST(e,i,a,r){return(e.children.some(function(d){return jT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function CT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}pv.peek=TT;function pv(e,i,a,r){const u=CT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Yc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=nu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Yc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+nu(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function TT(e,i,a){return a.options.strong||"*"}function ET(e,i,a,r){return a.safe(e.value,r)}function AT(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function NT(e,i,a){const r=(fv(a)+(a.options.ruleSpaces?" ":"")).repeat(AT(a));return a.options.ruleSpaces?r.slice(0,-1):r}const hv={blockquote:ZC,break:kx,code:aT,definition:rT,emphasis:av,hardBreak:kx,heading:cT,html:lv,image:rv,imageReference:sv,inlineCode:ov,link:cv,linkReference:dv,list:bT,listItem:wT,paragraph:kT,root:ST,strong:pv,text:ET,thematicBreak:NT};function DT(){return{enter:{table:_T,tableData:jx,tableHeader:jx,tableRow:MT},exit:{codeText:OT,table:RT,tableData:pp,tableHeader:pp,tableRow:pp}}}function _T(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function RT(e){this.exit(e),this.data.inTable=void 0}function MT(e){this.enter({type:"tableRow",children:[]},e)}function pp(e){this.exit(e)}function jx(e){this.enter({type:"tableCell",children:[]},e)}function OT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,zT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function zT(e,i){return i==="|"?i:e}function LT(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:j,table:d,tableCell:g,tableRow:p}};function d(w,T,R,q){return m(b(w,R,q),w.align)}function p(w,T,R,q){const N=x(w,R,q),H=m([N]);return H.slice(0,H.indexOf(`
|
|
78
|
+
`))}function g(w,T,R,q){const N=R.enter("tableCell"),H=R.enter("phrasing"),$=R.containerPhrasing(w,{...q,before:c,after:c});return H(),N(),$}function m(w,T){return XC(w,{align:T,alignDelimiters:r,padding:a,stringLength:u})}function b(w,T,R){const q=w.children;let N=-1;const H=[],$=T.enter("table");for(;++N<q.length;)H[N]=x(q[N],T,R);return $(),H}function x(w,T,R){const q=w.children;let N=-1;const H=[],$=T.enter("tableRow");for(;++N<q.length;)H[N]=g(q[N],w,T,R);return $(),H}function j(w,T,R){let q=hv.inlineCode(w,T,R);return R.stack.includes("tableCell")&&(q=q.replace(/\|/g,"\\$&")),q}}function IT(){return{exit:{taskListCheckValueChecked:Sx,taskListCheckValueUnchecked:Sx,paragraph:BT}}}function UT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qT}}}function Sx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function BT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const p=u[c];if(p.type==="paragraph"){d=p;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function qT(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);c&&p.move(d);let g=hv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function HT(){return[bC(),qC(),VC(),DT(),IT()]}function $T(e){return{extensions:[vC(),HC(e),FC(),LT(e),UT()]}}const GT={tokenize:KT,partial:!0},mv={tokenize:XT,partial:!0},gv={tokenize:QT,partial:!0},yv={tokenize:ZT,partial:!0},VT={tokenize:JT,partial:!0},xv={name:"wwwAutolink",tokenize:YT,previous:vv},bv={name:"protocolAutolink",tokenize:WT,previous:wv},Ta={name:"emailAutolink",tokenize:PT,previous:kv},Xi={};function FT(){return{text:Xi}}let ur=48;for(;ur<123;)Xi[ur]=Ta,ur++,ur===58?ur=65:ur===91&&(ur=97);Xi[43]=Ta;Xi[45]=Ta;Xi[46]=Ta;Xi[95]=Ta;Xi[72]=[Ta,bv];Xi[104]=[Ta,bv];Xi[87]=[Ta,xv];Xi[119]=[Ta,xv];function PT(e,i,a){const r=this;let u,c;return d;function d(x){return!Pp(x)||!kv.call(r,r.previous)||Th(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Pp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(VT,b,m)(x):x===45||x===95||hn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&kn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function YT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!vv.call(r,r.previous)||Th(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(GT,e.attempt(mv,e.attempt(gv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function WT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&wv.call(r,r.previous)&&!Th(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(kn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const j=u.toLowerCase();if(j==="http"||j==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||Vc(x)||yt(x)||mr(x)||Zc(x)?a(x):e.attempt(mv,e.attempt(gv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function KT(e,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),u):d===46&&r===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function XT(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(yv,g,p)(m):m===null||yt(m)||mr(m)||m!==45&&Zc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function QT(e,i){let a=0,r=0;return u;function u(d){return d===40?(a++,e.consume(d),u):d===41&&r<a?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(yv,i,c)(d):d===null||yt(d)||mr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function ZT(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||yt(p)||mr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||yt(p)||mr(p)?i(p):r(p)}function c(p){return kn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):kn(p)?(e.consume(p),d):a(p)}}function JT(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return hn(c)?a(c):i(c)}}function vv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function wv(e){return!kn(e)}function kv(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||hn(e)}function Th(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const eE={tokenize:oE,partial:!0};function tE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:lE,continuation:{tokenize:rE},exit:sE}},text:{91:{name:"gfmFootnoteCall",tokenize:aE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:nE,resolveTo:iE}}}}function nE(e,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return a(g);const m=ki(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function iE(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function aE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||yt(x))return a(x);if(x===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return u.includes(ki(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return yt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function lE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(T)}function b(T){if(d>999||T===93&&!p||T===null||T===91||yt(T))return a(T);if(T===93){e.exit("chunkString");const R=e.exit("gfmFootnoteDefinitionLabelString");return c=ki(r.sliceSerialize(R)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),j}return yt(T)||(p=!0),d++,e.consume(T),T===92?x:b}function x(T){return T===91||T===92||T===93?(e.consume(T),d++,b):b(T)}function j(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),u.includes(c)||u.push(c),tt(e,w,"gfmFootnoteDefinitionWhitespace")):a(T)}function w(T){return i(T)}}function rE(e,i,a){return e.check(au,i,e.attempt(eE,i,a))}function sE(e){e.exit("gfmFootnoteDefinition")}function oE(e,i,a){const r=this;return tt(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):a(c)}}function uE(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},j=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Kn(j,j.length,0,Jc(w,d.slice(m+1,g),p)),Kn(j,j.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Kn(d,m-1,g-m+3,j),g=m+j.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return j;function j(T){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const R=xs(m);if(T===126)return x>1?g(T):(d.consume(T),x++,w);if(x<2&&!a)return g(T);const q=d.exit("strikethroughSequenceTemporary"),N=xs(T);return q._open=!N||N===2&&!!R,q._close=!R||R===2&&!!N,p(T)}}}class cE{constructor(){this.map=[]}add(i,a,r){dE(this,i,a,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let u=r.pop();for(;u;){for(const c of u)i.push(c);u=r.pop()}this.map.length=0}}function dE(e,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=a,e.map[u][2].push(...r);return}u+=1}e.map.push([i,a,r])}}function fE(e,i){let a=!1;const r=[];for(;i<e.length;){const u=e[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function pE(){return{flow:{null:{name:"table",tokenize:hE,resolveAll:mE}}}}function hE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(L){let te=r.events.length-1;for(;te>-1;){const ge=r.events[te][1].type;if(ge==="lineEnding"||ge==="linePrefix")te--;else break}const de=te>-1?r.events[te][1].type:null,Ee=de==="tableHead"||de==="tableRow"?D:g;return Ee===D&&r.parser.lazy[r.now().line]?a(L):Ee(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?a(L):Me(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):a(L):Ke(L)?tt(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||yt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?j:x)}function j(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(L):(e.enter("tableDelimiterRow"),d=!1,Ke(L)?tt(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):T(L))}function T(L){return L===45||L===58?q(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),R):ae(L)}function R(L){return Ke(L)?tt(e,q,"whitespace")(L):q(L)}function q(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),N):L===45?(c+=1,N(L)):L===null||Me(L)?W(L):ae(L)}function N(L){return L===45?(e.enter("tableDelimiterFiller"),H(L)):ae(L)}function H(L){return L===45?(e.consume(L),H):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(L))}function $(L){return Ke(L)?tt(e,W,"whitespace")(L):W(L)}function W(L){return L===124?T(L):L===null||Me(L)?!d||u!==c?ae(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):ae(L)}function ae(L){return a(L)}function D(L){return e.enter("tableRow"),Q(L)}function Q(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),Q):L===null||Me(L)?(e.exit("tableRow"),i(L)):Ke(L)?tt(e,Q,"whitespace")(L):(e.enter("data"),re(L))}function re(L){return L===null||L===124||yt(L)?(e.exit("data"),Q(L)):(e.consume(L),L===92?ee:re)}function ee(L){return L===92||L===124?(e.consume(L),re):re(L)}}function mE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const j=new cE;for(;++a<e.length;){const w=e[a],T=w[1];w[0]==="enter"?T.type==="tableHead"?(p=!1,g!==0&&(Cx(j,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(a,0,[["enter",m,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(a,0,[["enter",b,i]])),u=T.type==="tableDelimiterRow"?2:b?3:1):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Dc(j,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Dc(j,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):T.type==="tableHead"?(p=!0,g=a):T.type==="tableRow"||T.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=Dc(j,i,c,u,a,x)):d[1]!==0&&(x=Dc(j,i,d,u,a,x)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&Cx(j,i,g,m,b),j.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=fE(i.events,a))}return e}function Dc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},hs(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=hs(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=hs(i.events,a[2]),b=hs(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const j=i.events[a[2]],w=i.events[a[3]];if(j[1].end=Object.assign({},w[1].end),j[1].type="chunkText",j[1].contentType="text",a[3]>a[2]+1){const T=a[2]+1,R=a[3]-a[2]-1;e.add(T,R,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},hs(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function Cx(e,i,a,r,u){const c=[],d=hs(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(a+1,0,c)}function hs(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const gE={name:"tasklistCheck",tokenize:xE};function yE(){return{text:{91:gE}}}function xE(e,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return yt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return Me(g)?i(g):Ke(g)?e.check({tokenize:bE},i,a)(g):a(g)}}function bE(e,i,a){return tt(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function vE(e){return Mb([FT(),tE(),uE(e),pE(),yE()])}const wE={};function kE(e){const i=this,a=e||wE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(vE(a)),c.push(HT()),d.push($T(a))}function jE(e){const i=new Map;for(const a of e){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=CE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function Xo(e,i){return!!(i&&e.includes(i))}function SE(e){var a;if((e==null?void 0:e.status)!=="failed")return null;const i=(a=e.error)==null?void 0:a.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function CE(e){return e&&typeof e=="object"?e:{}}const TE=["summary","message","status","instruction","description","reason","error","text"],Tx=96,EE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),AE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),NE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),jv=new Set(["item/commandExecution/terminalInteraction"]),DE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function _E(e){if(e.event!=="codex.notification")return!1;const i=Ki(e.data);return typeof i.method=="string"&&jv.has(i.method)}function RE(e){if(AE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||EE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Ki(e.data),a=typeof i.method=="string"?i.method:"",r=Ki(i.params),u=Ki(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||jv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||NE.has(c)?null:a}function Sv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?DE.get(a)??Cv(a):r}function gr(e,i=[]){const a=Ki(e),u=[...i,...TE.map(c=>Qo(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=Tx?u:`${u.slice(0,Tx-3)}...`:"查看详情"}function Yp(e,i=new Map){const a=Ki(e),r=typeof a.unreadCount=="number"&&a.unreadCount>0?Math.floor(a.unreadCount):0,c=(Array.isArray(a.senderWorkspaceIds)?Array.from(new Set(a.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:gr({},[p])}}function ME(e){const i=Ki(e),a=Array.isArray(i.offers)?i.offers.map(Ki).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=Qo(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=a.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:gr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function OE(e){const i=Ki(e),a=Qo(i.actionType)??"",r=Ki(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(Qo(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:gr(r,[Qo(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:gr(r,[Cv(a||"agent action")]),meta:"after turn"}}function Cv(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function Qo(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Ki(e){return e&&typeof e=="object"?e:{}}function Wp(e){const i=Kp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Kp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=UE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=IE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function Tv(e,i){const a=Ax(e),r=Ax(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function zE(e,i){if(e.length===0)return"File changed";const a=Tv(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function LE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function IE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:Ex(e),deletions:0};if(i==="delete")return{additions:0,deletions:Ex(e)};let a=0,r=0;for(const u of e.split(`
|
|
79
|
+
`))u.startsWith("+")&&!u.startsWith("+++")?a+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:a,deletions:r}}function Ex(e){const i=e.split(`
|
|
80
|
+
`).length;return e.endsWith(`
|
|
81
|
+
`)?Math.max(0,i-1):i}function UE(e){const i=Kp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Ax(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Kp(e){return e&&typeof e=="object"?e:{}}const Eh=["low","medium","high","xhigh"],BE=["none","minimal",...Eh,"max"];function gs(e){const i=e.trim();return i?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[i]??i:"Use model default"}function Nx(e,i){const a=yr(e),r=yr(i==null?void 0:i.defaultReasoningEffort);return a?a===r?`${gs(a)} (model default)`:gs(a):r?`Auto (model default: ${gs(r)})`:"Auto (follow model default)"}function qE(e,i=""){const a=yr(e==null?void 0:e.defaultReasoningEffort),r=[];if(!e){r.push({value:"",label:"Use model default"});const p=yr(i);return p&&Av(p)&&r.push({value:p,label:`${gs(p)} (configured)`}),r}const c=(Ev(e)??Eh).filter(p=>!Xp(p));a&&!Xp(a)&&!c.includes(a)&&c.unshift(a),a&&c.includes(a)||r.push({value:"",label:"Use model default"});for(const p of c)r.push({value:p===a?"":p,label:p===a?`${gs(p)} (model default)`:gs(p)});return r}function Dx(e,i){const a=yr(e);if(!a||Xp(a))return"";const r=yr(i==null?void 0:i.defaultReasoningEffort);if(r&&a===r)return"";if(!i)return Av(a)?a:"";const u=Ev(i);return u!==null?u.includes(a)?a:"":Eh.includes(a)?a:""}function HE(e,i,a){return a||e!==i?e:null}function Ev(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const i=[];for(const a of e.supportedReasoningEfforts){const r=yr(a==null?void 0:a.reasoningEffort);r&&!i.includes(r)&&i.push(r)}return i}function yr(e){return typeof e=="string"?e.trim():""}function Xp(e){return e.toLowerCase()==="ultra"}function Av(e){return BE.includes(e)}function $E(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Qp="seele:authentication-required",Zp="seele:deployment-status-required",Nv=12,GE=3e3,Jp="seele.activeWorkspaceId",Dv="seele.workspaceOrder",_v="seele.workspaceGroupOrder",Rv="seele.workspaceDrafts",Mv="seele.collapsedWorkspaceGroups",Ov="seele.sidebarWidth",_x=5,Rx=275,VE=236,FE=420,Mx="default",Ox=300,PE=3,YE=10,WE=2,KE=13,XE=1.65,QE=20,ZE=900;class Wi extends Error{constructor(a,r,u,c){super(a);Tc(this,"detail");Tc(this,"status");Tc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const JE=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Uo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function zv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function he(e){return`${zv()}api/${e.replace(/^\/+/,"")}`}function Ah(e=""){return`${zv()}${e.replace(/^\/+/,"")}`}async function Gt(e,i){const a=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),a?`Response: ${a}`:"Response: <empty>"].join(`
|
|
82
|
+
`);return new Wi(r,u,e.status,a)}function Ve(e){return e instanceof Wi?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function cr(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Se(e,i){if(!e.ok)throw await Gt(e,i)}function eA(e){return e instanceof Wi&&e.status===410&&e.body.includes('"turn_not_active"')}function tA(e){return e instanceof Wi&&e.status===409&&e.body.includes('"turn_not_running"')}function nA(e){return e instanceof Wi&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function zx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function iA(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function Nh(e){return Math.max(VE,Math.min(FE,Math.round(e)))}function aA(){try{const e=window.localStorage.getItem(Ov),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?Nh(i):Rx}catch{return Rx}}function lA(e){try{window.localStorage.setItem(Ov,String(Nh(e)))}catch{}}function hp(e){Lv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function rA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function sA(e){if(!e)return;const i=window.getComputedStyle(e),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*PE+r+u,d=a*YE+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function oA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(WE,Math.max(1,i+1))}function uA(e){return Math.ceil(oA(e)*KE*XE+QE)}function Lv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function cA(e){const i=e.getBoundingClientRect(),a=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=a&&p.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:a-c.top,anchorTurnId:u.dataset.turnId}}function dA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function Lx(e,i){Lv(e,()=>{const a=dA(e,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function fA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||Lx(e,i)});Lx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){a||(a=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function pA(){try{return window.localStorage.getItem(Jp)}catch{return null}}function mp(e){try{e?window.localStorage.setItem(Jp,e):window.localStorage.removeItem(Jp)}catch{}}function Iv(){try{const e=window.localStorage.getItem(Dv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Uv(){try{const e=window.localStorage.getItem(_v),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Bv(e){try{window.localStorage.setItem(_v,JSON.stringify(e))}catch{}}function Bc(e){try{window.localStorage.setItem(Dv,JSON.stringify(e))}catch{}}function qv(){try{const e=window.localStorage.getItem(Rv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function Ix(e){return e?qv()[e]??"":""}function gp(e,i){if(e)try{const a=qv();i?a[e]=i:delete a[e],window.localStorage.setItem(Rv,JSON.stringify(a))}catch{}}function hA(){try{const e=window.localStorage.getItem(Mv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function yp(e){try{window.localStorage.setItem(Mv,JSON.stringify(Array.from(e)))}catch{}}function Bo(e){const i=Iv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function _c(e){const i=Uv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:r.createdAt.localeCompare(u.createdAt)})}function xp(e){const i=new Set(e.map(u=>u.id)),a=Iv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Bc([...a,...r])}function bp(e){const i=new Set(e.map(u=>u.id)),a=Uv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Bv([...a,...r])}function mA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function gA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function yA(e,i,a){if(i===a)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===a);return c.splice(p+1,0,d),c}function xA({authEnabled:e,currentUser:i,onLogout:a}){var St,Yr,ll,rl;const[r,u]=_.useState(""),[c,d]=_.useState(new Set),[p,g]=_.useState([]),[m,b]=_.useState([]),[x,j]=_.useState(null),[w,T]=_.useState(null),[R,q]=_.useState("simple"),[N,H]=_.useState(null),[$,W]=_.useState(null),[ae,D]=_.useState(null),[Q,re]=_.useState(!1),[ee,L]=_.useState(!1),[te,de]=_.useState({}),[Ee,ge]=_.useState({}),[ue,V]=_.useState(null),[oe,xe]=_.useState([]),[_e,O]=_.useState(null),[A,z]=_.useState(!1),[C,Y]=_.useState(null),[fe,X]=_.useState("checking"),[ye,Re]=_.useState(null),[Fe,jt]=_.useState(!1),[xt,on]=_.useState(null),[Pe,wt]=_.useState(!1),[Ot,un]=_.useState(null),[ze,zt]=_.useState(!1),[gn,Kt]=_.useState([]),[ji,Xn]=_.useState([]),[Ea,Dt]=_.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Aa,ie]=_.useState({profuseNotificationEnabled:!0}),[ce,Ce]=_.useState([]),[Ue,Xe]=_.useState(null),[Vt,Qn]=_.useState(null),[Ft,Tt]=_.useState(!1),[ut,rt]=_.useState(null),[Si,jn]=_.useState(!1),[rd,wr]=_.useState(null),[kr,Ml]=_.useState(!1),[Ci,Na]=_.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[nn,Da]=_.useState("global"),[bt,Qi]=_.useState(null),[_a,Ol]=_.useState(null),[ks,Ra]=_.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[ru,jr]=_.useState({memory:"",items:[]}),[js,Ss]=_.useState({memory:"",items:[]}),[su,Zn]=_.useState({memory:"",items:[]}),[Pt,Lt]=_.useState([]),[qn,Ti]=_.useState(Uo),[Ma,Oa]=_.useState({description:"",key:"",value:""}),[Sr,Ei]=_.useState(null),[Cs,Jn]=_.useState(()=>new Set),[Ai,Zi]=_.useState(!1),[Ni,Et]=_.useState(!1),[ou,Ts]=_.useState(!1),[cn,Di]=_.useState(null),[uu,cu]=_.useState(!0),[du,za]=_.useState(!1),[Cr,zl]=_.useState(!1),[Xt,It]=_.useState(null),[fu,_i]=_.useState(null),[Ji,Es]=_.useState(null),[Sn,hi]=_.useState(null),[Ut,Tr]=_.useState(null),[La,Er]=_.useState(null),[ei,pu]=_.useState(()=>new Set),[Ll,ti]=_.useState(null),[As,Ar]=_.useState(null),[Ns,Ia]=_.useState(null),[ni,Ri]=_.useState(null),[Ua,yn]=_.useState(null),[Il,Ul]=_.useState(()=>hA()),[Ba,Mi]=_.useState(()=>aA()),[Ds,_s]=_.useState(230),[Oi,Bl]=_.useState(()=>Date.now()),ii=_.useRef(null),qa=_.useRef(null),Ha=_.useRef(null),ai=_.useRef(null),zi=_.useRef(null),ea=_.useRef(!0),Rs=_.useRef(null),Li=_.useRef(null),$a=_.useRef(null),Nr=_.useRef(new Set),Qt=_.useRef(!1),Ii=_.useRef([]),ql=_.useRef(null),Ga=_.useRef(null),Ui=_.useRef(null),Cn=_.useRef(new Map),Zt=_.useRef(new Map),Bi=_.useRef(new Set),ta=_.useRef(new Map),Va=_.useRef(new Map),Fa=_.useRef(new Set),Dr=_.useRef(null),_r=_.useRef(null),Hl=_.useRef(!1),Ms=_.useRef(!1),Ne=p.find(y=>y.id===x),hu=(Ne==null?void 0:Ne.unreadTurnCount)??0,mi=p.find(y=>y.id===cn),Jt=p.find(y=>y.id===bt),Rr=p.find(y=>y.id===Ll),$l=_.useMemo(()=>{const k=_c(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),S=new Map(k.map(U=>[U.id,U])),M=k[0];for(const U of p)(S.get(U.groupId)??M).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[p,m]),at=x!==null?te[x]:null,Pa=(at==null?void 0:at.messages)??[],Mr=(at==null?void 0:at.events)??[],na=LD(zD(Mr),x?Ee[x]:null),Gl=vw(na),Os=(at==null?void 0:at.status)??(Ne==null?void 0:Ne.status)??"idle",Or=rh(Ne,Os),mu=cn!==null?((St=te[cn])==null?void 0:St.status)??(mi==null?void 0:mi.status)??"idle":"idle",sd=rh(mi,mu),Vl=x?Zt.current.get(x)??null:null,gu=_.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),zs=_.useMemo(()=>fN(Pa,Mr,(at==null?void 0:at.turns)??[],(at==null?void 0:at.timelineNodes)??[],Vl,gu),[Vl,at==null?void 0:at.timelineNodes,at==null?void 0:at.turns,Mr,Pa,gu]),Ls=_.useMemo(()=>new Set(Pa.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Pa]),Is=x!==null&&ei.has(x),Us=Vl?(Yr=zs.find(y=>Xo(y.turnIds,Vl)))==null?void 0:Yr.activity:null,zr=Or==="running"||Is?Us&&!kD(Us)?Us:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,od=!zr&&Or==="waiting"&&(Ne!=null&&Ne.nextWakeup)?{title:"Scheduled wakeup",detail:Qc(Ne.nextWakeup,Oi),createdAt:Ne.nextWakeup.wakeAt,tone:"waiting"}:null,ia=zr??od,Fl=_.useMemo(()=>OD(Object.values(te)),[te]),ud=cb(C,Fl);_.useEffect(()=>{Wa(),dd()},[]),_.useEffect(()=>()=>{zi.current!==null&&window.clearTimeout(zi.current)},[]),_.useEffect(()=>{Pl(!1),Pl(!0);const y=window.setInterval(()=>{Pl(!0)},300*1e3);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{const y=window.setInterval(()=>Bl(Date.now()),1e3);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{Fa.current=ei},[ei]),_.useEffect(()=>{ql.current=x},[x]),_.useLayoutEffect(()=>{const y=Ga.current;if(Ga.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const S=ai.current;S&&!S.disabled&&!document.querySelector('[aria-modal="true"]')&&S.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),_.useEffect(()=>{Ii.current=p},[p]),_.useEffect(()=>{x&&mp(x)},[x]),_.useLayoutEffect(()=>{if(!x||hu<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(M=>M.map(U=>U.id===x?{...U,unreadTurnCount:0}:U));try{await v2(x)}catch(M){y||console.error(M)}}},S=()=>void k();return k(),document.addEventListener("visibilitychange",S),()=>{y=!0,document.removeEventListener("visibilitychange",S)}},[x,hu]),_.useEffect(()=>{q("simple"),T(null),x&&(Tn(x),Du(x))},[x]),_.useEffect(()=>{const y=window.setInterval(()=>void cd(),GE);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{u(Ix(x))},[x]),_.useEffect(()=>{!x||Os!=="running"||Fa.current.has(x)||ct(x)},[x,Os,ei]),_.useEffect(()=>{if(!x)return;let y=!1;return P2(x).then(k=>{y||ge(S=>({...S,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),_.useEffect(()=>{!x&&nn==="workspace"&&Da("global")},[x,nn]),_.useEffect(()=>{var y;if(ze){if(!bt&&x){Qi(x);return}bt&&!p.some(k=>k.id===bt)&&Qi(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,ze,bt]),_.useEffect(()=>{if(!ze||i.role!=="admin")return;const y=window.setInterval(()=>void qs(),5e3);return()=>window.clearInterval(y)},[i.role,ze]),_.useEffect(()=>{!ze||nn!=="workspace"||Zn({memory:(Jt==null?void 0:Jt.memory)??"",items:(Jt==null?void 0:Jt.memoryItems)??[]})},[nn,ze,Jt==null?void 0:Jt.id,Jt==null?void 0:Jt.memory,Jt==null?void 0:Jt.memoryItems]),_.useEffect(()=>{if(!Ai)return;x&&aa(x);const y=k=>{k.key==="Escape"&&Zi(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ai]),_.useEffect(()=>{if(!ze)return;const y=k=>{k.key==="Escape"&&zt(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[ze]),_.useEffect(()=>{var k;if(!Ni)return;if(cn&&!p.some(S=>S.id===cn)){Di(x??((k=p[0])==null?void 0:k.id)??null);return}const y=S=>{S.key==="Escape"&&(Xt?It(null):Et(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ni,Xt,cn,p]),_.useEffect(()=>{if(!Sn)return;Tr(null);const y=k=>{k.key==="Escape"&&hi(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Sn]),_.useLayoutEffect(()=>{sA(ai.current)},[r]),_.useLayoutEffect(()=>{const y=Ha.current;if(!y)return;const k=()=>{const M=y.getBoundingClientRect();_s(Math.ceil(M.height+44))};k();const S=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return S==null||S.observe(y),window.addEventListener("resize",k),()=>{S==null||S.disconnect(),window.removeEventListener("resize",k)}},[]),_.useLayoutEffect(()=>{var J,be;const y=qa.current;if(!y)return;const k=Rs.current!==x;Rs.current=x,k&&((J=Ui.current)==null||J.call(Ui),Ui.current=null);const S=Li.current;if(S&&S.conversationId===x){(be=Ui.current)==null||be.call(Ui),Ui.current=fA(y,S),Li.current=null,ea.current=!1;return}if(!k&&!ea.current)return;ea.current=!0,hp(y);const M=requestAnimationFrame(()=>hp(y)),U=window.setTimeout(()=>hp(y),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(U)}},[x,Mr.length,Pa.length]);async function yu(){var k;const y=qa.current;y&&(ea.current=rA(y),!(!x||!((k=at==null?void 0:at.history)!=null&&k.hasMoreBefore))&&(at.loadingOlder||Nr.current.has(x)||y.scrollTop>96||await qr(x)))}function Lr(y){var S,M;if(y.history)return y.history;const k=((S=y.timelineNodes)==null?void 0:S.filter(U=>U.parentId===null).reduce((U,J)=>U===null||J.timelineAt<U.timelineAt||J.timelineAt===U.timelineAt&&J.sequence<U.sequence?J:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=y.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function qi(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Tr(y.url)}async function Ya(y,k){await navigator.clipboard.writeText(k),Er(y),zi.current!==null&&window.clearTimeout(zi.current),zi.current=window.setTimeout(()=>{Er(null),zi.current=null},1800)}function we(y,k,S){const M=Date.now();Es({id:M,tone:y,text:k,detail:S}),window.setTimeout(()=>{Es(U=>(U==null?void 0:U.id)===M?null:U)},S?8e3:2400)}async function Wa(){try{const[y,k]=await Promise.all([eb(),nb()]);X("connected");const S=_c(k);if(b(S),bp(S),y.length>0){const M=Bo(y),U=pA(),J=M.find(be=>be.id===U)??M[0];g(M),xp(M),j(J.id);return}g([]),mp(null),j(null)}catch(y){console.error(y),X("error")}}async function xn(){const[y,k]=await Promise.all([eb(),nb()]),S=Bo(y),M=_c(k);b(M),bp(M),g(S),xp(S)}async function cd(){if(!Qt.current){Qt.current=!0;try{const y=await g2(),k=Ii.current,S=new Set(k.map(Ae=>Ae.id)),M=new Set(y.map(Ae=>Ae.id));if(S.size!==M.size||[...S].some(Ae=>!M.has(Ae))){await xn(),X("connected");return}const U=ql.current,J=U?y.find(Ae=>Ae.id===U)??null:null,be=new Map(y.map(Ae=>[Ae.id,Ae])),Le=Bo(k.map(Ae=>{const ve=be.get(Ae.id);return ve?{...Ae,status:ve.status,statusError:ve.statusError,nextWakeup:ve.nextWakeup,unreadTurnCount:ve.unreadTurnCount,updatedAt:ve.updatedAt}:Ae}));g(Le),xp(Le),X("connected"),J&&!Fa.current.has(J.id)&&et(J.id,Ae=>({...Ae,status:J.status}))}catch(y){console.error(y),X("error")}finally{Qt.current=!1}}}async function dd(){try{const y=await fD();X("connected"),V(y.version)}catch(y){console.error(y),X("error")}}async function Pl(y){try{const k=await pD(y);k&&Y(S=>cb(S,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function xu(){try{const y=await S2();Kt(y),X("connected")}catch(y){console.error(y),X("error")}}async function Ka(y){try{const k=await C2(y);Xn(k),X("connected")}catch(k){console.error(k),Xn([]),X("error")}}async function aa(y){try{const k=await T2(y);Lt(k),X("connected")}catch(k){console.error(k),Lt([]),X("error")}}async function fd(y){try{const k=await E2();Dt(k),Na(k),y||(Ol(null),Ra(k)),X("connected")}catch(k){console.error(k),X("error")}}async function Ir(){if(i.role==="admin")try{ie(await A2()),X("connected")}catch(y){console.error(y),X("error")}}async function Yl(y=!0){try{const k=await I2(y);Ce(k.models),X("connected"),k.refreshing&&window.setTimeout(()=>void Yl(!1),1e3)}catch(k){console.error(k),Ce([]),X("error")}}async function Ur(){try{const y=await D2();Xe(y.codexVersion),Qn(y.codexReleasedAt),X("connected")}catch(y){console.error(y),Xe(null),Qn(null),X("error")}}async function Wl(y=!1){y&&Ml(!0);try{const k=await U2(y);rt(k.job),wr(k.latest),X("connected"),k.job&&k.job.status!=="running"&&$a.current===k.job.id&&($a.current=null,k.job.status==="succeeded"?(await Promise.all([Yl(),Ur()]),we("success",`Codex CLI updated to ${ld(k.job.currentVersion)}`)):we("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),X("error")}finally{y&&Ml(!1)}}async function Bs(){jn(!0);try{const y=await B2();$a.current=y.id,rt(y),X("connected")}catch(y){console.error(y);const k=Ve(y);we("error","Unable to start Codex CLI update",k.detail??k.message)}finally{jn(!1)}}_.useEffect(()=>{if(!Ft||(ut==null?void 0:ut.status)!=="running")return;const y=window.setInterval(()=>void Wl(),1e3);return()=>window.clearInterval(y)},[Ft,ut==null?void 0:ut.id,ut==null?void 0:ut.status]);async function Br(y){try{const k=await q2(y);Ol(k),Ra(k.effective),X("connected")}catch(k){console.error(k),Ol(null),X("error")}}async function bu(){try{const y=await H2();jr(y),Ss(y),X("connected")}catch(y){console.error(y),X("error")}}async function vu(){if(i.role!=="admin"){xe([]);return}try{xe(await d_()),X("connected")}catch(y){console.error(y),X("error")}}async function qs(){if(i.role!=="admin"){O(null);return}z(!0);try{O(await N2()),X("connected")}catch(y){console.error(y),X("error")}finally{z(!1)}}async function wu(y=bt){const k=[xu(),fd(y),Ur(),Yl(),bu()];i.role==="admin"&&(k.push(vu()),k.push(qs()),k.push(Ir())),y&&(k.push(Tn(y)),k.push(Br(y)),k.push(Ka(y)),k.push(aa(y))),await Promise.all(k)}function pd(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;L(!1),Qi(y),Da(i.role==="admin"?"global":y?"workspace":"global"),zt(!0),wu(y)}function hd(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;Qi(y),Da(y?"workspace":"global"),zt(!0),wu(y)}function ku(){var k;L(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;Di(y),_i(null),It(null),Et(!0),y&&bn(y)}async function bn(y){try{const k=await rw(y);if(!k||k.status!=="running")return;za(!0);const S=await sw(y,k);_i(S),await Tn(y),await xn(),S.warmupTurnId&&Ge(y,S.warmupTurnId),we("success","Full-history runtime reset completed")}catch(k){const S=Ve(k);we("error","Full-history runtime reset failed",S.message)}finally{za(!1)}}function Kl(y){Qi(y),Da("workspace"),Tn(y),Br(y),Ka(y),aa(y),Ti(Uo)}async function ju(y){y.preventDefault();try{if(nn==="workspace"&&bt){const k=await lb(bt,K2(ks,Ea,_a));Ol(k.settings),Ra(k.settings.effective),vn(k.conversation),we("success","Workspace settings saved")}else{const k=await $2(Ci);Dt(k),Na(k),bt&&await Br(bt),we("success","Global settings saved")}X("connected")}catch(k){console.error(k),X("error");const S=Ve(k);we("error","Failed to save runtime settings",S.detail??S.message)}}async function Su(y){try{const k=await G2(y);ie(k),X("connected"),we("success","Deployment settings saved")}catch(k){console.error(k),X("error");const S=Ve(k);throw we("error","Failed to save deployment settings",S.detail??S.message),k}}async function Cu(){var S;const y=mi;if(!y){we("error","No workspace selected");return}if((((S=te[y.id])==null?void 0:S.status)??y.status)==="running"){we("error","Stop the running turn before resetting runtime");return}zl(!0),_i(null);try{const M=await sb(y.id);It(M),X("connected")}catch(M){console.error(M),X("error");const U=Ve(M);we("error","Failed to preview runtime reset",U.detail??U.message)}finally{zl(!1)}}async function Tu(y){const k=mi,S=Xt;if(!k||!S||S.conversationId!==k.id){we("error","Reset preview is required");return}za(!0),_i(null);try{const M=await rb(k.id,{warmup:uu,previewFingerprint:S.fingerprint,selectedEntryIds:y});_i(M),It(null),X("connected"),await Tn(k.id),await xn(),M.warmupTurnId&&Ge(k.id,M.warmupTurnId),we("success","Runtime thread reset")}catch(M){console.error(M),X("error");const U=Ve(M);we("error","Failed to reset runtime thread",U.detail??U.message)}finally{za(!1)}}async function Hs(){var M;const y=mi;if(!y){we("error","No workspace selected");return}if((((M=te[y.id])==null?void 0:M.status)??y.status)==="running"){we("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
|
|
83
|
+
|
|
84
|
+
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){za(!0),_i(null);try{const U=await sb(y.id),J=await rb(y.id,{warmup:!1,previewFingerprint:U.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});_i(J),It(null),bt===y.id&&Zn({memory:"",items:[]}),X("connected"),await Tn(y.id),await xn(),we("success","Workspace started from blank context")}catch(U){console.error(U),X("error");const J=Ve(U);we("error","Failed to clear workspace context",J.detail??J.message)}finally{za(!1)}}}async function md(y){const k=mi,S=Xt;if(!k||!S||S.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await V2(k.id,{previewFingerprint:S.fingerprint,selectedEntryIds:y}),X("connected")}catch(M){console.error(M),X("error");const U=Ve(M);throw we("error","Failed to save reset defaults",U.detail??U.message),M}}async function Xa(y,k){try{const S=await lb(y,{[k]:null});Ol(S.settings),Ra(S.settings.effective),vn(S.conversation),X("connected"),we("success","Workspace override reset")}catch(S){console.error(S),X("error"),we("error","Failed to reset workspace override")}}async function $s(y){try{const k=await nD({memory:tD(y),items:y});return jr(k),Ss(k),X("connected"),we("success","Base memory saved"),k.items}catch(k){throw console.error(k),X("error"),we("error","Failed to save memory"),k}}async function Xl(y,k){try{const S=await Ic(y,{memoryItems:k});return vn(S),Zn({memory:S.memory,items:S.memoryItems}),X("connected"),we("success","Workspace memory saved"),S.memoryItems}catch(S){throw console.error(S),X("error"),we("error","Failed to save memory"),S}}async function Gs(y){y.preventDefault();const k=Ma.key.trim();if(k)try{if(nn==="workspace"&&bt){const S=await aD(bt,k,Ma.value,Ma.description);Xn(M=>[...M.filter(U=>U.key!==S.variable.key),S.variable].sort((U,J)=>U.key.localeCompare(J.key))),vn(S.conversation)}else{const S=await iD(k,Ma.value,Ma.description);Kt(M=>[...M.filter(U=>U.key!==S.key),S].sort((U,J)=>U.key.localeCompare(J.key)))}we("success",nn==="workspace"?"Workspace environment saved":"Base environment saved"),Oa({description:"",key:"",value:""}),Ei(null),Jn(S=>{const M=new Set(S);return M.delete(k),M}),X("connected")}catch(S){console.error(S),X("error"),we("error","Failed to save environment")}}async function Eu(y){try{if(nn==="workspace"&&bt){const k=await oD(bt,y);Xn(S=>S.filter(M=>M.key!==y)),vn(k)}else await sD(y),Kt(k=>k.filter(S=>S.key!==y));Sr===y&&(Oa({description:"",key:"",value:""}),Ei(null),Jn(k=>{const S=new Set(k);return S.delete(y),S})),X("connected"),we("success",nn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),X("error"),we("error","Failed to delete environment")}}async function la(y,k){if(k.preventDefault(),!qn.name.trim()){we("error","Knowledge name is required");return}const S=X2(qn);try{const M=qn.id?await cD(y,qn.id,S):await uD(y,S);Lt(U=>[...U.filter(J=>J.id!==M.id),M].sort(ob)),Ti(Uo),X("connected"),we("success","Workspace knowledge saved")}catch(M){console.error(M),X("error"),we("error","Failed to save workspace knowledge")}}async function Qa(y,k){try{await dD(y,k),Lt(S=>S.filter(M=>M.id!==k)),qn.id===k&&Ti(Uo),X("connected"),we("success","Workspace knowledge deleted")}catch(S){console.error(S),X("error"),we("error","Failed to delete workspace knowledge")}}function Vs(y){Da("workspace"),Ti(Q2(y))}function Au(y){Oa({description:y.description,key:y.key,value:""}),Ei(y.key),Jn(k=>{const S=new Set(k);return S.delete(y.key),S}),Fs(y.key,{preserveTypedValue:!0})}function ra(){const y=Sr;Oa({description:"",key:"",value:""}),Ei(null),y&&Jn(k=>{const S=new Set(k);return S.delete(y),S})}async function Nu(y){await Fs(y)}async function Fs(y,k={}){try{const S=nn==="workspace"&&bt?await rD(bt,y):await lD(y);Oa(M=>M.key===y&&(!k.preserveTypedValue||M.value.length===0)?{...M,value:S}:M),Jn(M=>new Set(M).add(y)),X("connected")}catch(S){console.error(S),X("error")}}async function Tn(y){const k=await Rp(y);to(k)}async function Ps(y){try{const k=await Rp(y);bi(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function Du(y){try{T(await mD(y))}catch(k){console.error(k)}}async function Ql(y){if(x)try{const k=await yD(x,y);T(y==="end"?null:k),y==="end"&&q("simple"),we("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&ct(x,{waitMs:15e3}),await xn()}catch(k){we("error","Complex task control failed",Ve(k).detail??Ve(k).message)}}async function Hi(y){if(x)try{H(await gD(x,y))}catch(k){const S=Ve(k);we("error","Failed to load complex task",S.detail??S.message)}}function _u(){Ne&&D({sourceId:Ne.id,name:`${Ne.title} - Clone`,groupId:Ne.groupId})}async function Ys(y){if(y.preventDefault(),!(!ae||!ae.name.trim())){re(!0);try{const k=await xD(ae.sourceId,ae.name.trim(),ae.groupId);g(S=>Bo([k.conversation,...S])),j(k.conversation.id),D(null),L(!1),we(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){we("error","Clone failed",Ve(k).detail??Ve(k).message)}finally{re(!1)}}}async function Hn(){if(Ne)try{const y=await bD(Ne.id);vn(y.conversation),we(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){we("error","Clone retry failed",Ve(y).detail??Ve(y).message)}}async function qr(y,k={}){var Ae,ve,en;const S=te[y],M=(Ae=S==null?void 0:S.history)==null?void 0:Ae.oldestTimelineAt,U=(ve=S==null?void 0:S.history)==null?void 0:ve.oldestTimelineSequence,J=M&&U!==null&&U!==void 0?`${M}|${U}`:U==null?(en=S==null?void 0:S.history)==null?void 0:en.oldestMessageCreatedAt:String(U),be=qa.current;if(!J||!be)return;if(k.preserveAnchor??!0){const ht=cA(be);Li.current={anchorOffset:ht.anchorOffset,conversationId:y,previousScrollHeight:be.scrollHeight,anchorTurnId:ht.anchorTurnId}}else Li.current=null;Nr.current.add(y),et(y,ht=>({...ht,loadingOlder:!0}));try{const ht=await Rp(y,{before:J,limit:Nv});fa(ht)}catch(ht){console.error(ht),Li.current=null}finally{Nr.current.delete(y),et(y,ht=>({...ht,loadingOlder:!1}))}}async function En(y,k){const S=await hD(y,k||void 0);g(M=>{const U=[S,...M];return Bc(U.map(J=>J.id)),U}),j(S.id),L(!1)}function Za(){L(!1),un({mode:"create",groupId:null,title:""})}function Hr(y){un({mode:"rename",groupId:y.id,title:y.title})}function Zl(){var y;L(!1),Re({mode:"create",conversationId:null,title:"",groupId:(Ne==null?void 0:Ne.groupId)??((y=m[0])==null?void 0:y.id)})}async function $r(y){var k;if(y.status!=="running"){wt(!0);try{await wD(y.id),de(M=>{const U={...M};return delete U[y.id],U});const S=p.filter(M=>M.id!==y.id);if(Bc(S.map(M=>M.id)),gp(y.id,""),g(S),x===y.id){const M=((k=S[0])==null?void 0:k.id)??null;mp(M),j(M)}(ye==null?void 0:ye.conversationId)===y.id&&oa(),on(null),we("success","Workspace moved to recycle")}catch(S){const M=Ve(S);we("error","Failed to move workspace to recycle",M.detail??M.message)}finally{wt(!1)}}}async function Ws(y){if(!(y.id===Mx||!window.confirm(`Delete group "${y.title}"?
|
|
85
|
+
|
|
86
|
+
Workspaces in this group will move to Default.`)))try{const S=await j2(y.id),M=_c(S.groups);b(M),bp(M),g(S.conversations),Ul(U=>{const J=new Set(U);return J.delete(y.id),yp(J),J})}catch(S){console.error(S)}}function sa(y){Re({mode:"rename",conversationId:y.id,title:y.title})}function oa(){jt(!1),Re(null)}function ua(){un(null)}async function Ja(y,k){const S=k.trim(),M=p.find(J=>J.id===y);if(!M||!S||S===M.title){oa();return}const U=await Ic(y,{title:S});vn(U),oa()}function gd(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function dn(y){return y instanceof Element&&!!y.closest("input, button")}function Ks(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".session-item[data-workspace-id]"):null}function li(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".workspace-group[data-group-id]"):null}function Ru(y,k,S){const M=Ks(k,S),U=M==null?void 0:M.dataset.workspaceId;if(M&&U&&U!==y){Ri({kind:"workspace",id:U,position:mA(M,S)});return}const J=li(k,S),be=J==null?void 0:J.dataset.groupId;if(!be){Ri(null);return}Ri({kind:"group",id:be})}function Gr(y,k){dn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Dr.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function ca(y,k){const S=Dr.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(Ll!==k){if(M<_x)return;ti(k),Ri(null)}y.preventDefault(),yn({x:y.clientX,y:y.clientY}),Ru(k,y.clientX,y.clientY)}async function Xs(y,k){var be;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Dr.current=null;const S=Ll===k;S&&(Hl.current=!0);const M=ni;if(!S||!M){ti(null),Ri(null),yn(null);return}const U=p.find(Le=>Le.id===k),J=M.kind==="group"?M.id:(be=p.find(Le=>Le.id===M.id))==null?void 0:be.groupId;if(!U||!J){ti(null),Ri(null),yn(null);return}if(g(Le=>{const Ae=M.kind==="workspace"?gA(Le.map(ve=>ve.id===k?{...ve,groupId:J}:ve),k,M.id,M.position):[...Le.filter(ve=>ve.id!==k),{...U,groupId:J}];return Bc(Ae.map(ve=>ve.id)),Ae}),U.groupId!==J)try{const Le=await Ic(k,{groupId:J});vn(Le)}catch(Le){console.error(Le),await xn()}ti(null),Ri(null),yn(null)}function Mu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Dr.current=null,ti(null),Ri(null),yn(null)}function Qs(y,k){y.currentTarget.setPointerCapture(y.pointerId),_r.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Ou(y,k){const S=_r.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(As!==k){if(M<_x)return;Ar(k),Ia(null)}y.preventDefault();const U=li(y.clientX,y.clientY),J=U==null?void 0:U.dataset.groupId;Ia(J&&J!==k?J:null)}function An(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const S=As===k;S&&(y.preventDefault(),Ms.current=!0);const M=Ns;S&&M&&b(U=>{const J=yA(U,k,M);return Bv(J.map(be=>be.id)),J}),_r.current=null,Ar(null),Ia(null)}function el(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),_r.current=null,Ar(null),Ia(null)}function tl(y){const k=y.target.value;Re(S=>S&&{...S,title:k})}function Vr(y){const k=y.target.value;Re(S=>S&&{...S,groupId:k})}function Jl(y){const k=y.target.value;un(S=>S&&{...S,title:k})}async function Nn(y){if(y.preventDefault(),!ye)return;const k=ye.title.trim();if(k){jt(!0);try{if(ye.mode==="create"){await En(k,ye.groupId),oa();return}ye.conversationId&&await Ja(ye.conversationId,k)}catch(S){console.error(S);const M=Ve(S);we("error",ye.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{jt(!1)}}}function an(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),oa())}async function $i(y){if(y.preventDefault(),!Ot)return;const k=Ot.title.trim();if(k)try{if(Ot.mode==="rename"){if(!Ot.groupId)return;const M=await k2(Ot.groupId,{title:k});b(U=>U.map(J=>J.id===M.id?M:J)),ua();return}const S=await w2(k);b(M=>[...M,S]),Ul(M=>{const U=new Set(M);return U.delete(S.id),yp(U),U}),ua()}catch(S){console.error(S)}}function Dn(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),ua())}async function ri(y){y.preventDefault(),await Zs()}function gi(y){u(y),gp(x,y)}function er(y,k){Ix(y).trim()===k&&gp(y,""),x===y&&u(S=>S.trim()===k?"":S)}function yi(y,k){d(S=>{const M=new Set(S);return k?M.add(y):M.delete(y),M})}function tr(y){const k=Ve(y);we("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function Zs(y={}){const k=r.trim();if(!k)return;if(!x){Zl();return}const S=x,M=Zt.current.has(S),U=Bi.current.has(S);if(U)return;if(Or==="running"||Is||M||U){if(y.forceNewTurn&&!w){await Gi(S,k);return}await _n(S,k);return}Bi.current.add(S),yi(S,!0);const J=`local-${Date.now()}`;et(S,Ae=>({...Ae,messages:[...Ae.messages,{id:J,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),fn(S,"running"),si(S,!0);const be=new AbortController;Cn.current.set(S,be);let Le=!1;try{let Ae=null;const ve=he(`conversations/${S}/turns`),en=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:R})});if(en.ok){const ln=await en.json();if(!ln.turnId)throw new Error("Turn did not return a turn id");if(Ae=ln.turnId,(R==="complex"||w)&&(Du(S),q("simple")),!ln.message)throw new Error("Turn did not return the persisted message");nl(S,J,ln.message,Ae),Le=!0,er(S,k)}else{const ln=await iA(en);if(ln){Ae=ln;const oi=await eo(S,ln,k);if(!oi.ok)throw await Gt(oi,{method:"POST",url:he(`conversations/${S}/turns/${ln}/steer`)});const ol=await oi.json();if(!ol.message)throw new Error("Steer did not return the persisted message");nl(S,J,ol.message,ln),Le=!0,er(S,k)}else throw await Gt(en,{method:"POST",url:ve})}if(!Ae)throw await Gt(en,{method:"POST",url:ve});Zt.current.set(S,Ae),await Vi(S,Ae);const ht=he(`conversations/${S}/turns/${Ae}/events`),sl=await fetch(ht,{signal:be.signal});if(!sl.ok||!sl.body)throw await Gt(sl,{method:"GET",url:ht});await Ps(S),await Op(sl.body,ln=>{const oi=Tp(ln,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(S,Wr=>({...Wr,status:ps(oi)??Wr.status,events:Cp(Wr.events,oi)}));const ol=ps(oi);ol&&fn(S,ol)}),await Tn(S),await xn()}catch(Ae){if(Ep(Ae))return;Le||tr(Ae);const ve=nA(Ae);ve&&we("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),Zt.current.has(S)||Va.current.delete(S),et(S,en=>({...en,status:"error",events:[...en.events,{id:en.events.length+1,event:"client.error",data:ve?{message:"Reset thread required",detail:w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:cr(Ae),createdAt:new Date().toISOString()}]})),fn(S,"error"),await xn()}finally{Bi.current.delete(S),yi(S,!1),Zt.current.delete(S),Cn.current.get(S)===be&&Cn.current.delete(S),si(S,!1),await _t(S)}}async function _t(y){const k=ta.current.get(y)??[];if(k.length===0)return;const[S,...M]=k;ta.current.set(y,M),await Ge(y,S)}async function ct(y,k={}){if(Fa.current.has(y))return;const S=new AbortController;Cn.current.set(y,S),si(y,!0);try{const M=k.waitMs?`?waitMs=${k.waitMs}`:"",U=he(`conversations/${y}/turns/current/events${M}`),J=await fetch(U,{signal:S.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:U});await Ps(y),await Op(J.body,be=>{const Le=Tp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Le.turnId&&!Zt.current.has(y)&&Zt.current.set(y,Le.turnId),et(y,ve=>({...ve,status:ps(Le)??ve.status,events:Cp(ve.events,Le)}));const Ae=ps(Le);Ae&&fn(y,Ae)}),await Tn(y),await xn()}catch(M){if(!Ep(M)){if(tA(M)){await Tn(y),await xn();return}et(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:cr(M),createdAt:new Date().toISOString()}]}))}}finally{Zt.current.delete(y),Cn.current.get(y)===S&&Cn.current.delete(y),si(y,!1),await _t(y)}}async function Ge(y,k,S={}){if(Zt.current.has(y)){const U=ta.current.get(y)??[];U.includes(k)||ta.current.set(y,[...U,k]);return}const M=new AbortController;Cn.current.set(y,M),Zt.current.set(y,k),si(y,!0);try{const U=he(`conversations/${y}/turns/${k}/events`),J=await fetch(U,{signal:M.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:U});await Ps(y),await Op(J.body,be=>{const Le=Tp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(y,ve=>({...ve,status:ps(Le)??ve.status,events:Cp(ve.events,Le)}));const Ae=ps(Le);Ae&&fn(y,Ae)}),await Tn(y),await xn()}catch(U){if(!Ep(U)){if(S.recovered&&eA(U)){await Tn(y),await xn();return}et(y,J=>({...J,status:"error",events:[...J.events,{id:J.events.length+1,event:"client.error",data:cr(U),createdAt:new Date().toISOString()}]}))}}finally{Zt.current.delete(y),Cn.current.get(y)===M&&Cn.current.delete(y),si(y,!1),await _t(y)}}async function Gi(y,k){yi(y,!0);let S=!1;const M=`local-queued-${Date.now()}`;et(y,U=>({...U,messages:[...U.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const U=he(`conversations/${y}/turns`),J=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!J.ok)throw await Gt(J,{method:"POST",url:U});const be=await J.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");nl(y,M,be.message,be.turnId),S=!0,er(y,k),Ge(y,be.turnId),await xn(),we("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(U){S||tr(U),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:cr(U),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}async function _n(y,k){yi(y,!0);const S=Zt.current.get(y),M=`local-steer-${Date.now()}`;if(et(y,U=>({...U,messages:[...U.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString(),turnId:S??null}],status:"running"})),!S&&Bi.current.has(y)){Js(y,k,M),yi(y,!1);return}try{const U=he(S?`conversations/${y}/turns/${S}/steer`:`conversations/${y}/turns/steer`),J=await fetch(U,zx(k));if(!J.ok)throw await Gt(J,{method:"POST",url:U});const be=await J.json();if(!be.message)throw new Error("Steer did not return the persisted message");nl(y,M,be.message,S),er(y,k)}catch(U){tr(U),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:cr(U),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}function Js(y,k,S){const M=Va.current.get(y)??[];Va.current.set(y,[...M,{message:k,localMessageId:S}])}async function Vi(y,k){const S=Va.current.get(y)??[];if(S.length!==0){Va.current.delete(y);for(const M of S){const U=await eo(y,k,M.message);if(!U.ok)throw await Gt(U,{method:"POST",url:he(`conversations/${y}/turns/${k}/steer`)});const J=await U.json();J.message&&nl(y,M.localMessageId,J.message,k)}}}async function eo(y,k,S){return fetch(he(`conversations/${y}/turns/${k}/steer`),zx(S))}function nl(y,k,S,M){et(y,U=>({...U,messages:kp(U.messages.filter(J=>J.id!==k),[{...S,turnId:M??S.turnId??null}])}))}async function il(){var S;if(!x||Or!=="running"&&!Is)return;const y=x,k=Zt.current.get(y);(S=Cn.current.get(y))==null||S.abort(),si(y,!1),et(y,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),fn(y,"done");try{const M=he(k?`conversations/${y}/turns/${k}/stop`:`conversations/${y}/turns/interrupt`),U=await fetch(M,{method:"POST"});if(!U.ok&&U.status!==409)throw await Gt(U,{method:"POST",url:M})}catch(M){et(y,U=>({...U,events:[...U.events,{id:U.events.length+1,event:"client.error",data:cr(M),createdAt:new Date().toISOString()}]}))}Zt.current.delete(y)}async function $n(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const S=x;try{const M=he(`conversations/${S}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await Gt(U,{method:"POST",url:M});et(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){et(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:cr(M),createdAt:new Date().toISOString()}]}));const U=Ve(M);we("error","Failed to respond to approval",U.detail??U.message)}}async function da(y,k,S){const M=x,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!M||!U)return!1;try{const J=he(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(U)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?S??y.workspaceChangePayload:void 0})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const Le=await be.json();return vn(Le.conversation),et(M,Ae=>({...Ae,events:[...Ae.events,{id:`${y.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?S??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),we("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(J){console.error(J);const be=Ve(J);return we("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function xi(y,k,S){const M=x;if(!(!M||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(S??y.body)}catch{we("error","Knowledge proposal JSON is invalid");return}const J=he(`conversations/${M}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const Le=await be.json();Lt([...Le.items??[]].sort(ob)),et(M,Ae=>({...Ae,events:[...Ae.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?Le.item:null},createdAt:new Date().toISOString()}]})),we("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const J=Ve(U);we("error","Failed to respond to knowledge proposal",J.detail??J.message)}}function to(y){no(y),de(k=>{const S=k[y.id],M=y.events.map(U=>({id:U.id,turnId:U.turnId,seq:U.seq,event:U.event,data:U.data,createdAt:U.createdAt}));return{...k,[y.id]:{messages:y.messages,events:Oc(M,(S==null?void 0:S.events)??[]),timelineNodes:Sp(y.timelineNodes??[],(S==null?void 0:S.timelineNodes)??[]),turns:jp(y.turns??[],(S==null?void 0:S.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:Lr(y),loadingOlder:!1,fullEventTurnIds:(S==null?void 0:S.fullEventTurnIds)??new Set,loadingEventTurnIds:(S==null?void 0:S.loadingEventTurnIds)??new Set}}})}function fa(y){const k=Lr(y);et(y.id,S=>{var M,U,J;return{...S,messages:kp(y.messages,S.messages),timelineNodes:Sp(y.timelineNodes??[],S.timelineNodes),turns:jp(y.turns??[],S.turns),events:Oc(y.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),S.events),contextVersions:(((M=y.contextVersions)==null?void 0:M.length)??0)>0?y.contextVersions??[]:S.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=S.history)==null?void 0:U.loadedMessageCount)??S.messages.length),loadedEventCount:k.loadedEventCount+(((J=S.history)==null?void 0:J.loadedEventCount)??S.events.length)},loadingOlder:!1}})}function bi(y){const k=Lr(y),S=y.events.map(M=>({id:M.id,turnId:M.turnId,seq:M.seq,event:M.event,data:M.data,createdAt:M.createdAt}));et(y.id,M=>{var U,J,be;return{...M,messages:kp(M.messages,y.messages),timelineNodes:Sp(M.timelineNodes,y.timelineNodes??[]),turns:jp(M.turns,y.turns??[]),events:Oc(S,M.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:M.contextVersions,status:y.status,history:{...M.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((J=M.history)==null?void 0:J.loadedMessageCount)??M.messages.length,M.messages.length,y.messages.length),loadedEventCount:Math.max(((be=M.history)==null?void 0:be.loadedEventCount)??M.events.length,M.events.length,y.events.length)},loadingOlder:!1}})}function et(y,k){de(S=>{const M=S[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...S,[y]:k(M)}})}function fn(y,k){g(S=>S.map(M=>M.id===y?{...M,status:k,updatedAt:new Date().toISOString()}:M))}function no(y){vn(y)}function vn(y){g(k=>Bo(k.map(S=>S.id===y.id?{...S,...y}:S)))}async function al(y,k){const S=k.filter(M=>{const U=te[y];return U&&!U.fullEventTurnIds.has(M)&&!U.loadingEventTurnIds.has(M)});if(S.length!==0){et(y,M=>{const U=new Set(M.loadingEventTurnIds);for(const J of S)U.add(J);return{...M,loadingEventTurnIds:U}});try{const M=await Promise.all(S.map(U=>vD(y,U)));et(y,U=>{const J=new Set(U.fullEventTurnIds),be=new Set(U.loadingEventTurnIds),Le=M.flatMap((Ae,ve)=>{const en=S[ve];return J.add(en),be.delete(en),Ae.map(ht=>({id:ht.id,turnId:ht.turnId,seq:ht.seq,event:ht.event,data:ht.data,createdAt:ht.createdAt}))});return{...U,events:Oc(U.events,Le),fullEventTurnIds:J,loadingEventTurnIds:be}})}catch(M){console.error(M),et(y,U=>{const J=new Set(U.loadingEventTurnIds);for(const be of S)J.delete(be);return{...U,loadingEventTurnIds:J}}),we("error","Failed to load process details")}}}function si(y,k){const S=new Set(Fa.current);k?S.add(y):S.delete(y),Fa.current=S,pu(M=>{const U=new Set(M);return k?U.add(y):U.delete(y),U})}function pa(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Zs({forceNewTurn:y.shiftKey}))}function Yt(y){Ul(k=>{const S=new Set(k);return S.has(y)?S.delete(y):S.add(y),yp(S),S})}function Fr(y){var k;return $E(y.status,(k=y.nextWakeup)==null?void 0:k.status,ei.has(y.id))}function Pr(y){var M;const k=(M=ii.current)==null?void 0:M.getBoundingClientRect(),S=k?y-k.left:y;return Nh(S)}function yd(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Mi(Pr(y.clientX))}function xd(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Mi(Pr(y.clientX)))}function bd(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=Pr(y.clientX);Mi(k),lA(k)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:ii,style:{"--sidebar-width":`${Ba}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":gb(fe),className:`backend-status ${fe}`,"data-label":gb(fe)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Zl,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:$l.map(y=>s.jsxs("section",{className:["workspace-group",As===y.id?"dragging":"",Ns===y.id?"drop-after":"",(ni==null?void 0:ni.kind)==="group"&&ni.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Il.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Ms.current){k.preventDefault(),Ms.current=!1;return}Yt(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Hr(y)},onPointerCancel:el,onPointerDown:k=>Qs(k,y.id),onPointerMove:k=>Ou(k,y.id),onPointerUp:k=>An(k,y.id),type:"button",children:[s.jsx("span",{className:Il.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Hr(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Mx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Ws(y)},title:"Delete group",type:"button",children:"×"}):null]}),Il.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const S=Fr(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===Ll?"dragging":"",(ni==null?void 0:ni.kind)==="workspace"&&ni.id===k.id?`drop-${ni.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:M=>{if(Hl.current){M.preventDefault(),Hl.current=!1;return}j(k.id),L(!1)},onDoubleClick:M=>{dn(M.target)||(M.preventDefault(),sa(k))},onKeyDown:M=>{gd(M.target)||M.key==="Enter"&&(j(k.id),L(!1))},onPointerCancel:Mu,onPointerDown:M=>Gr(M,k.id),onPointerMove:M=>ca(M,k.id),onPointerUp:M=>Xs(M,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Gc(S,k.nextWakeup,Oi),className:`session-status ${S}`,title:Gc(S,k.nextWakeup,Oi)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),S==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Gc(S,k.nextWakeup,Oi),children:Qc(k.nextWakeup,Oi)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,S!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),on(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",ys(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:pd,type:"button",children:s.jsx(Qx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Za,type:"button",children:s.jsx(o2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{Ts(!0),L(!1)},type:"button",children:s.jsx(qc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:ku,type:"button",children:s.jsx(u2,{})}),s.jsx(cN,{usage:ud})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:yd,onPointerMove:xd,onPointerUp:bd,role:"separator",tabIndex:0}),Rr&&Ua?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Ua.x+12}px, ${Ua.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Rr.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",ys(Rr.id)]})]}):null,ye?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:an,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:an,onSubmit:y=>void Nn(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:tl,onKeyDown:an,value:ye.title}),ye.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Vr,onKeyDown:an,value:ye.groupId??((ll=m[0])==null?void 0:ll.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:oa,children:"Cancel"}),s.jsx("button",{disabled:Fe,type:"submit",children:Fe?"Saving...":ye.mode==="create"?"Create":"Save"})]})]})}):null,Ot?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Dn,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Dn,onSubmit:y=>void $i(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:Jl,onKeyDown:Dn,value:Ot.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:ua,children:"Cancel"}),s.jsx("button",{type:"submit",children:Ot.mode==="create"?"Create":"Save"})]})]})}):null,ze?s.jsx(SA,{currentUser:i,conversations:p,editingEnvironmentKey:Sr,deploymentSettings:Aa,environmentDraft:Ma,globalEnvironment:gn,workspaceEnvironment:ji,memorySettings:ru,memorySettingsDraft:js,workspaceMemoryDraft:su,runtimeSettings:Ea,runtimeModels:ce,runtimeCodexVersion:Ue,runtimeCodexReleasedAt:Vt,runtimeCodexUpdating:(ut==null?void 0:ut.status)==="running",runtimeSettingsDraft:Ci,runtimeSettingsScope:nn,settingsWorkspace:Jt,settingsWorkspaceId:bt,systemDiagnostics:_e,systemDiagnosticsLoading:A,workspaceGroups:$l,workspaceRuntimeSettings:_a,workspaceRuntimeSettingsDraft:ks,managedUsers:oe,onCancelEnvironmentEdit:ra,onClose:()=>zt(!1),onCreateUser:async y=>{const k=await f_(y);xe(S=>[...S,k]),we("success","User created")},onDeleteUser:async y=>{await h_(y),xe(k=>k.filter(S=>S.id!==y)),we("success","User deleted")},onSaveDeploymentSettings:Su,onDeleteEnvironment:y=>void Eu(y),onDraftChange:Oa,onEditEnvironment:Au,onRevealEnvironmentValue:y=>void Nu(y),onSaveBaseMemoryItems:y=>$s(y),onSaveResponsibility:async(y,k)=>{try{const S=await Ic(y,{responsibility:k});return vn(S),X("connected"),we("success","Workspace responsibility saved"),S.responsibility}catch(S){throw console.error(S),X("error"),we("error","Failed to save workspace responsibility"),S}},onSaveWorkspaceMemoryItems:y=>bt?Xl(bt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Na,onCodexAccountSwitched:async()=>{we("success","Codex account switched"),(await Tw()).codexAccountsReady&&await Promise.all([Pl(!0),Yl(!0),Ur()])},onUpdateCodexCli:()=>{Tt(!0),Wl(!0)},onRuntimeScopeChange:Da,onSettingsWorkspaceChange:Kl,onSubmitRuntimeSettings:y=>void ju(y),onWorkspaceRuntimeDraftChange:Ra,onWorkspaceRuntimeReset:y=>bt?void Xa(bt,y):void 0,revealedEnvironmentKeys:Cs,onSubmitEnvironment:y=>void Gs(y),onRefreshSystemDiagnostics:()=>void qs(),onUpdateUser:async(y,k)=>{const S=await p_(y,k);xe(M=>M.map(U=>U.id===S.id?S:U)),we("success","User updated")}}):null,Ft?s.jsx(jA,{currentReleasedAt:Vt,currentVersion:Ue,job:ut,latest:rd,latestChecking:kr,starting:Si,onClose:()=>Tt(!1),onRefresh:()=>void Wl(),onStart:()=>void Bs()}):null,Ai&&Ne?s.jsx(bA,{conversation:Ne,clockNow:Oi,knowledgeDraft:qn,workspaceKnowledge:Pt,tokenUsage:na,onCancelKnowledgeEdit:()=>Ti(Uo),onDeleteKnowledge:y=>void Qa(Ne.id,y),onEditKnowledge:Vs,onKnowledgeDraftChange:Ti,onSubmitKnowledge:y=>void la(Ne.id,y),onClose:()=>Zi(!1)}):null,ou?s.jsx(vA,{conversations:p,onClose:()=>Ts(!1),workspaceGroups:$l}):null,Ni?s.jsx(wA,{busy:du,conversation:mi??null,conversationId:cn,preview:(Xt==null?void 0:Xt.conversationId)===cn?Xt:null,previewLoading:Cr,result:fu,status:sd,warmup:uu,workspaceGroups:$l,onClose:()=>Et(!1),onCancelResetPreview:()=>It(null),onPreviewReset:()=>void Cu(),onStartBlankContext:()=>void Hs(),onResetRuntime:y=>void Tu(y),onSaveResetSelection:md,onWorkspaceChange:y=>{Di(y),_i(null),It(null)},onWarmupChange:cu}):null,ae?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!Q&&D(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:Ys,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>D(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:ae.name,onChange:y=>D(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:ae.groupId,onChange:y=>D(k=>k&&{...k,groupId:y.target.value}),children:$l.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:Q,onClick:()=>D(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:Q||!ae.name.trim(),type:"submit",children:Q?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>H(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:N.title}),s.jsxs("p",{children:[mb(N.status),N.startedAt&&N.finishedAt?` · ${e_(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:N.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:N.status==="completed"?"Final plan":"Current plan"}),N.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Nl(N.currentPlan.planMarkdown,Ne)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:N.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:N.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:N.startedAt?He(N.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:N.finishedAt?He(N.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>H(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>W(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:He($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>W(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Fo,{content:$.fullDetail??$.detail??"No additional details.",conversation:Ne,streaming:!1,onPreviewArtifact:hi,onCopyArtifactUrl:qi,copiedArtifactUrl:Ut})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;W(null),Hi(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>W(null),type:"button",children:"Close"})]})]})}):null,xt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Pe||on(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Pe,onClick:()=>on(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:xt.title})," to recycle?"]}),s.jsx("code",{children:xt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Pe,onClick:()=>on(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Pe,onClick:()=>void $r(xt),type:"button",children:Pe?"Moving...":"Move to recycle"})]})]})}):null,Ji?s.jsxs("div",{className:`app-toast ${Ji.tone}`,role:"status",children:[s.jsx("strong",{children:Ji.text}),Ji.detail?s.jsx("pre",{children:Ji.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(s2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ne==null?void 0:Ne.title)??"New workspace"})}),Ne?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",ys(Ne.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ne?s.jsxs(s.Fragment,{children:[Ne.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:ku,title:`当前 Thread 工具集已过期(${Ne.threadCapabilityVersion} / ${Ne.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(lw,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:_u,title:"Clone workspace",type:"button",children:s.jsx(r2,{})}),s.jsxs("button",{className:`context-button has-usage ${Ih(Gl??0)}`,onClick:()=>Zi(!0),style:{"--context-usage":`${ad(Gl??0)}%`},title:na&&Gl!==null?`Context ${Math.round(Gl)}% · ${Un(na.totalTokens)} / ${$c(na.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Gl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:hd,title:"Workspace settings",type:"button",children:s.jsx(Qx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Hi(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:mb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:JD(w,Oi)})]}),s.jsxs("div",{className:"complex-task-actions",children:[zp(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Ql("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void Ql("pause"),type:"button",children:"Pause"}):null,zp(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Ql("resume"),type:"button",children:"Resume"}):null,zp(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Ql("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Ql("end"),type:"button",children:"End task"})]})]}):null,(Ne==null?void 0:Ne.status)==="initialization_failed"&&Ne.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ne.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Hn(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void yu(),ref:qa,style:{scrollPaddingBottom:Ds},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Ds},children:[Pa.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ne!=null&&Ne.cloneLineage&&Ls.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ne.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",He(Ne.cloneLineage.snapshotAt)," · ",Ne.cloneLineage.importedMessageCount," messages"]})]}):null,(rl=at==null?void 0:at.history)!=null&&rl.hasMoreBefore?s.jsx("div",{className:"history-loader",children:at.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,zs.map((y,k)=>{var be,Le,Ae;const S=((be=y.user)==null?void 0:be.type)==="system",M=y.turnIds.some(ve=>Ls.has(ve)),U=zs[k+1],J=M&&(!U||!U.turnIds.some(ve=>Ls.has(ve)));return s.jsxs(_.Fragment,{children:[s.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${S?"system-turn":"user-turn"}`,children:[$o(y.user,Ne,hi,qi,Ut,$n,da,xi,Hi,W),s.jsx(Go,{copied:La===`${S?"system":"user"}-${y.id}-bottom`,content:Vo(y.user),id:`${S?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Ya})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(ve=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),$o(ve,Ne,hi,qi,Ut,$n,da,xi,Hi,W),s.jsx(Go,{copied:La===`user-${ve.id}-bottom`,content:Vo(ve),id:`user-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:Ya})]},ve.id))}):null,(Le=y.acceptedSystemInputs)==null?void 0:Le.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[$o(ve,Ne,hi,qi,Ut,$n,da,xi,Hi,W),s.jsx(Go,{copied:La===`system-${ve.id}-bottom`,content:Vo(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:Ya})]},ve.id)),y.agentItems.length>0?s.jsx(XA,{group:y,conversation:Ne,allowProcessView:!M,copiedFooter:La===`agent-${y.id}-bottom`,copiedArtifactUrl:Ut,running:!M&&Xo(y.turnIds,Vl),onCopyArtifactUrl:qi,onCopyBubble:Ya,onPreviewArtifact:hi,onLoadProcessDetails:ve=>Ne&&!M?al(Ne.id,ve):void 0,onRespondApproval:$n,onRespondWorkspaceChangeProposal:da,onRespondKnowledgeProposal:xi,onOpenComplexTask:Hi,onOpenSystemEvent:W}):null,(Ae=y.trailingSystemItems)==null?void 0:Ae.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[$o(ve,Ne,hi,qi,Ut,$n,da,xi,Hi,W),s.jsx(Go,{copied:La===`system-${ve.id}-bottom`,content:Vo(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:Ya})]},ve.id))]}),J?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:ri,ref:Ha,children:[ia?s.jsxs("div",{className:`global-activity ${ia.tone??"running"}`,children:[zr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void il(),title:"Stop current agent run",type:"button",children:s.jsx(JA,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:ia.title}),ia.detail?s.jsx("small",{children:ia.detail}):null]}),zr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||R==="complex",className:`complex-mode-button ${w||R==="complex"?"active":""}`,disabled:!!w,onClick:()=>q(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":R==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx($v,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":R==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:x!==null&&c.has(x),onChange:y=>gi(y.target.value),onKeyDown:pa,placeholder:"Cmd/Ctrl + Enter",ref:ai,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||x!==null&&c.has(x),type:"submit",children:[s.jsx(eN,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),Sn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>hi(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>hi(null),type:"button",children:"×"}),s.jsx("img",{alt:Sn.name,src:Sn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Sn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Sn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void qi(Sn),type:"button",children:Ut===Sn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function bA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,j]=_.useState("overview"),[w,T]=_.useState(!1),[R,q]=_.useState(!1),[N,H]=_.useState(null),[$,W]=_.useState(null),[ae,D]=_.useState(!1),[Q,re]=_.useState(null),[ee,L]=_.useState(null),[te,de]=_.useState(!1),[Ee,ge]=_.useState(null),[ue,V]=_.useState(null),oe=vw(u),xe=rh(e,e.status),_e=N?qD(N):null;_.useEffect(()=>{T(!1),H(null),W(null),re(null),L(null),ge(null),V(null)},[e.id]),_.useEffect(()=>{x==="additionalContext"&&!Q&&A()},[x,Q]),_.useEffect(()=>{x==="compactions"&&!Ee&&z()},[x,Ee]);const O=()=>{T(!0),q(!0),W(null),F2(e.id).then(C=>H(C)).catch(C=>{const Y=Ve(C);W(Y.detail?`${Y.message}
|
|
87
|
+
${Y.detail}`:Y.message)}).finally(()=>q(!1))},A=()=>{D(!0),L(null),Y2(e.id).then(C=>re(C)).catch(C=>{const Y=Ve(C);L(Y.detail?`${Y.message}
|
|
88
|
+
${Y.detail}`:Y.message)}).finally(()=>D(!1))},z=()=>{de(!0),V(null),W2(e.id).then(C=>ge(C)).catch(C=>{const Y=Ve(C);V(Y.detail?`${Y.message}
|
|
89
|
+
${Y.detail}`:Y.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>j("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>j("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>j("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>j("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>j("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>j("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${xe}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Gc(xe,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:eu(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:Qc(e.nextWakeup,i)}):null,s.jsx(Je,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Je,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(Je,{label:"Name",value:e.title}),s.jsx(Je,{label:"ID",value:`workspaces/${ys(e.id)}`,mono:!0}),s.jsx(Je,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Je,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Je,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Je,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:Nl(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Hv,{items:r,onDelete:d,onEdit:C=>{p(C),j("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Nl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(qA,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:R,onClick:O,type:"button",children:R?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:R,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Un(u.totalTokens)} / ${Un(u.modelContextWindow)}`:Un(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Ih(oe)}`,children:s.jsx("span",{style:{width:`${ad(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${$c(u.inputTokens)} / ${$c(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:$c(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",He(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),R?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):N?s.jsxs(s.Fragment,{children:[_e?s.jsx(YA,{summary:_e}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(N,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ee?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ee!=null&&Ee.length?s.jsx("div",{className:"context-compaction-list",children:Ee.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:He(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:MD(C).map(Y=>s.jsxs("div",{children:[s.jsx("dt",{children:Y.label}),s.jsx("dd",{children:Y.value})]},Y.label))}),s.jsxs("small",{children:[_l(C.id),C.turnId?` · turn ${_l(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ae?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):Q?s.jsx(FA,{preview:Q,refreshing:ae,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function vA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=_.useState([]),[c,d]=_.useState("active"),[p,g]=_.useState(null),[m,b]=_.useState([]),[x,j]=_.useState(!0),[w,T]=_.useState(null),[R,q]=_.useState(null),[N,H]=_.useState(!1),[$,W]=_.useState(!1),[ae,D]=_.useState(new Set),[Q,re]=_.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,L=_.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),de=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==Q.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ee=()=>{var A;re({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),D(new Set),q("create")},ge=()=>{!ee||ee.status!=="active"||(re({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),D(new Set),q("edit"))},ue=async(A,z=c)=>{var C;j(!0),T(null);try{const Y=await tb();u(Y);const fe=Y.filter(ye=>z==="archived"?ye.status==="archived":ye.status!=="archived"),X=(A&&fe.some(ye=>ye.id===A)?A:null)??(p&&fe.some(ye=>ye.id===p)?p:((C=fe[0])==null?void 0:C.id)??null);g(X),b(X?await Lc(X):[])}catch(Y){T(Y instanceof Wi?Y.detail:Y instanceof Error?Y.message:String(Y))}finally{j(!1)}};_.useEffect(()=>{ue()},[]),_.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await tb();u(z),p&&z.some(C=>C.id===p)&&b(await Lc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),T(null);try{b(await Lc(A))}catch(z){T(z instanceof Wi?z.detail:z instanceof Error?z.message:String(z))}},oe=async A=>{var C;if(A===c)return;d(A),T(null);const z=((C=r.find(Y=>A==="archived"?Y.status==="archived":Y.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Lc(z))}catch(Y){T(Y instanceof Wi?Y.detail:Y instanceof Error?Y.message:String(Y))}},xe=async A=>{var z;if(A.preventDefault(),!(!Q.title.trim()||!Q.ownerWorkspaceId)){W(!0),T(null);try{const C=R==="edit"&&ee?await x2(ee.id,{expectedVersion:ee.version,title:Q.title.trim(),publicDescription:Q.publicDescription.trim(),participantWorkspaceIds:Q.participantWorkspaceIds}):await y2({...Q,title:Q.title.trim(),publicDescription:Q.publicDescription.trim()});d("active"),q(null),re({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){T(C instanceof Wi?C.detail:C instanceof Error?C.message:String(C))}finally{W(!1)}}},_e=async()=>{if(!(!ee||ee.status!=="active")){W(!0),T(null);try{const A=await b2(ee.id,ee.version);H(!1),d("active"),await ue(void 0,"active")}catch(A){T(A instanceof Wi?A.detail:A instanceof Error?A.message:String(A))}finally{W(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ee,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(id,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(c2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${ow(A.recipientWorkspaceIds.map(z=>L.get(z)??_l(z)))}`}),s.jsx("time",{children:He(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Nl(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),R?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&q(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:xe,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:R==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:R==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Q.title,onChange:A=>re(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Q.publicDescription,onChange:A=>re(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:Q.ownerWorkspaceId,onChange:A=>re(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[Q.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>D(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>D(new Set(de.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),de.map(A=>{const z=A.conversations,C=z.filter(fe=>Q.participantWorkspaceIds.includes(fe.id)).length,Y=ae.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!Y,className:"collaboration-group-toggle",onClick:()=>D(fe=>{const X=new Set(fe);return X.has(A.id)?X.delete(A.id):X.add(A.id),X}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:Y?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>re(fe=>{const X=z.map(Re=>Re.id),ye=new Set(fe.participantWorkspaceIds);return X.every(Re=>ye.has(Re))?X.forEach(Re=>ye.delete(Re)):X.forEach(Re=>ye.add(Re)),{...fe,participantWorkspaceIds:Array.from(ye)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),Y?null:s.jsx("div",{children:z.map(fe=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:Q.participantWorkspaceIds.includes(fe.id),onChange:X=>re(ye=>({...ye,participantWorkspaceIds:X.target.checked?[...ye.participantWorkspaceIds,fe.id]:ye.participantWorkspaceIds.filter(Re=>Re!==fe.id)})),type:"checkbox"}),s.jsx("span",{children:fe.title})]},fe.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>q(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!Q.title.trim()||!Q.ownerWorkspaceId,type:"submit",children:$?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&H(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>H(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void _e(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function wA({busy:e,conversation:i,conversationId:a,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onStartBlankContext:j,onResetRuntime:w,onSaveResetSelection:T,onWorkspaceChange:R,onWarmupChange:q}){const N=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:H=>H.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:H=>R(H.target.value),value:a??"",children:g.map(H=>s.jsx("optgroup",{label:H.title,children:H.conversations.map($=>s.jsxs("option",{value:$.id,children:[$.title," · workspaces/",ys($.id)]},$.id))},H.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${ys(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:H=>q(H.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:N||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:N||u,onClick:j,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(kA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:T}):null]})})}function kA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=_.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=_.useState(!1),[b,x]=_.useState(!1),[j,w]=_.useState(null),T=_.useRef(null),R=i.entries.filter(L=>d.has(L.id)),q=R.filter(L=>L.role==="user").length,N=R.length-q,H=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),$=H.filter(L=>d.has(L)).length,W=i.entries.length>0&&d.size===i.entries.length;_.useEffect(()=>{T.current&&(T.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const ae=e||b;async function D(L){x(!0),w(null);try{await c(i.entries.filter(te=>L.has(te.id)).map(te=>te.id)),p(L)}catch(te){w(Ve(te).message)}finally{x(!1)}}function Q(L,te){const de=new Set(d);te?de.add(L):de.delete(L),D(de)}function re(){const L=new Set(d);H.forEach(te=>L.add(te)),D(L)}function ee(){const L=new Set(d);H.forEach(te=>{L.has(te)?L.delete(te):L.add(te)}),D(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:ae?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:ae,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:W,disabled:ae||i.entries.length===0,onChange:L=>void D(L.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:T,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[q," user"]}),s.jsxs("span",{children:[N," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:ae||$===H.length,onClick:re,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ae,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,j?s.jsx("span",{className:"reset-preview-selection-error",children:j}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,te)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${te+1}`,checked:d.has(L.id),disabled:ae,onChange:de=>Q(L.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:He(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:ae,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:ae,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function jA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&YD(r.version,m)?PD(r.version):null;return _.useEffect(()=>{const x=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:lh(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?lh(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:He(a.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,j)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:FD(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${j}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function SA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:j,runtimeCodexVersion:w,runtimeCodexReleasedAt:T,runtimeCodexUpdating:R,runtimeSettingsDraft:q,runtimeSettingsScope:N,settingsWorkspace:H,settingsWorkspaceId:$,systemDiagnostics:W,systemDiagnosticsLoading:ae,workspaceGroups:D,workspaceRuntimeSettings:Q,workspaceRuntimeSettingsDraft:re,onCancelEnvironmentEdit:ee,onClose:L,onCreateUser:te,onDeleteUser:de,onDeleteEnvironment:Ee,onDraftChange:ge,onEditEnvironment:ue,onSaveBaseMemoryItems:V,onSaveDeploymentSettings:oe,onSaveResponsibility:xe,onSaveWorkspaceMemoryItems:_e,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:Y,onSettingsWorkspaceChange:fe,onSubmitRuntimeSettings:X,onSubmitEnvironment:ye,onRefreshSystemDiagnostics:Re,onUpdateUser:Fe,onWorkspaceRuntimeDraftChange:jt,onWorkspaceRuntimeReset:xt,revealedEnvironmentKeys:on}){const[Pe,wt]=_.useState("model"),[Ot,un]=_.useState(!1),[ze,zt]=_.useState(null),[gn,Kt]=_.useState(!1),[ji,Xn]=_.useState((H==null?void 0:H.responsibility)??""),[Ea,Dt]=_.useState(!1),Aa=_.useRef(null),ie=N==="workspace"?Object.values((Q==null?void 0:Q.sources)??{}).filter(ce=>ce==="workspace").length:0;return _.useEffect(()=>{N==="global"&&Kt(!1)},[N]),_.useEffect(()=>{Xn((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),_.useEffect(()=>{if(!gn)return;const ce=Ue=>{var Vt;const Xe=Ue.target;Xe instanceof Node&&((Vt=Aa.current)!=null&&Vt.contains(Xe))||Kt(!1)},Ce=Ue=>{Ue.key==="Escape"&&Kt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ce,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ce,!0)}},[gn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:L,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":N==="global",className:N==="global"?"active":void 0,onClick:()=>Y("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:Aa,children:[s.jsx("button",{"aria-checked":N==="workspace","aria-expanded":N==="workspace"?gn:void 0,"aria-label":N==="workspace"?"Settings workspace target":void 0,className:N==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(N!=="workspace"){Y("workspace");return}Kt(ce=>!ce)},role:"radio",type:"button",children:N==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(H==null?void 0:H.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),N==="workspace"&&gn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:D.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ce=>s.jsxs("button",{"aria-selected":Ce.id===$,className:Ce.id===$?"selected":void 0,onClick:()=>{fe(Ce.id),Kt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ce.title}),s.jsxs("small",{children:["workspaces/",Ce.id]})]},Ce.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:L,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Pe==="model"?"active":void 0,onClick:()=>wt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Pe==="responsibility"?"active":void 0,onClick:()=>wt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Pe==="memory"?"active":void 0,onClick:()=>wt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Pe==="environment"?"active":void 0,onClick:()=>wt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Pe==="accounts"?"active":void 0,onClick:()=>wt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Pe==="deployment"?"active":void 0,onClick:()=>wt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{className:Pe==="system"?"active":void 0,onClick:()=>wt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Pe==="users"?"active":void 0,onClick:()=>wt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${N==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:N==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:N==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Pe==="system"?s.jsx(CA,{conversations:i,diagnostics:W,loading:ae,onRefresh:Re}):Pe==="users"?s.jsx(MA,{currentUser:e,users:m,onCreate:te,onDelete:de,onUpdate:Fe}):Pe==="accounts"?s.jsx(RA,{onSwitched:z}):Pe==="deployment"?s.jsx(OA,{settings:a,onSave:oe}):Pe==="model"?s.jsx(zA,{draft:N==="workspace"?re:q,globalSettings:x,models:j,codexVersion:w,codexReleasedAt:T,codexUpdating:R,scope:N,workspaceOverrideCount:ie,settings:N==="workspace"?(Q==null?void 0:Q.effective)??re:x,workspaceSettings:Q,onDraftChange:N==="workspace"?jt:A,onResetWorkspaceSetting:xt,onSubmit:X,onUpdateCodexCli:C}):Pe==="responsibility"?s.jsx(AA,{draft:ji,saving:Ea,scope:N,workspace:H,onDraftChange:Xn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(N!=="workspace"||!H)&&(Dt(!0),xe(H.id,ji).then(Ce=>Xn(Ce)).finally(()=>Dt(!1)))}}):Pe==="memory"?s.jsx(LA,{baseSettings:p,scope:N,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:V,onSaveWorkspaceItems:_e}):s.jsx(BA,{deleteConfirmKey:ze,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:N,workspaceEnvironment:d,valueVisible:Ot,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:zt,onDeleteEnvironment:Ee,onDraftChange:ge,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:ye,onValueVisibleChange:un,revealedEnvironmentKeys:on})]})]})]})})}function CA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=_.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=_.useState(!1),g=_.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=_.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=w,T.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(w)},j=()=>{if(!i||!c.length)return;const w=c[0],T=c.slice(0,5).map($=>`- ${eu($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
|
|
90
|
+
`),R=JSON.stringify(w,null,2),q=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${eu(i.generatedAt)}`,"","## Latest incident","","```json",R.slice(0,2500),"```","","## Recent system log","",T,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
|
|
91
|
+
`),N=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",N),H.searchParams.set("body",q),window.open(H.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Un(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Mp(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?He(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Mp(w.uptimeMs):`${Mp(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Oh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(TA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:j,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(EA,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",eu(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:a?"Loading system information...":"System information is unavailable."})]})}function TA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function EA(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function AA({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function NA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,a)=>i.windowDurationMins-a.windowDurationMins).map(i=>{const a=ad(i.usedPercent),r=Vv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:jw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Sw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function DA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function _A(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function RA({onSwitched:e}){var A;const[i,a]=_.useState(null),[r,u]=_.useState(!0),[c,d]=_.useState(!1),[p,g]=_.useState(!1),[m,b]=_.useState(""),[x,j]=_.useState(!1),[w,T]=_.useState(""),[R,q]=_.useState(null),[N,H]=_.useState(null),[$,W]=_.useState(""),[ae,D]=_.useState(null),[Q,re]=_.useState(null),[ee,L]=_.useState(!1);async function te(){var C;const z=await ib();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&(q(z.login),j(!0))}async function de(z){d(!0),b("");try{a(await ab(z))}catch(C){b(Ve(C).message)}finally{d(!1)}}_.useEffect(()=>{let z=!1;return ib().then(C=>{var Y;z||(a(C),((Y=C.login)==null?void 0:Y.status)==="pending"&&(q(C.login),j(!0)),C.accounts.length>0&&(d(!0),ab(!1).then(fe=>{z||a(fe)}).catch(fe=>{z||b(Ve(fe).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ve(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),_.useEffect(()=>{if(!R||R.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{R2(R.id).then(async Y=>{z||(q(Y),Y.status!=="pending"&&(window.clearInterval(C),Y.status==="succeeded"&&a(fe=>{if(!fe||!Y.account)return fe;const X=fe.accounts.some(ye=>{var Re;return ye.id===((Re=Y.account)==null?void 0:Re.id)})?fe.accounts.map(ye=>{var Re;return ye.id===((Re=Y.account)==null?void 0:Re.id)?Y.account:ye}):[...fe.accounts,Y.account];return{...fe,accounts:X}})))}).catch(Y=>{z||b(Ve(Y).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function Ee(){T(""),q(null),b(""),L(!1),j(!0)}async function ge(z){z.preventDefault(),g(!0),b("");try{q(await _2(w.trim()))}catch(C){b(Ve(C).message)}finally{g(!1)}}async function ue(){if(!R||R.status!=="pending"){j(!1);return}g(!0),b("");try{const z=await M2(R.id);q(z),j(!1)}catch(z){b(Ve(z).message)}finally{g(!1)}}function V(z){H(z),W(z.name),b("")}async function oe(z){if(z.preventDefault(),!N)return;const C=$.trim();if(!C||C===N.name){H(null);return}g(!0),b("");try{await O2(N.id,C),await te(),H(null)}catch(Y){b(Ve(Y).message)}finally{g(!1)}}async function xe(){var z;if(ae){g(!0),b("");try{const C=await L2(ae.id);a(C),D(null),await e()}catch(C){const Y=Ve(C);b((z=Y.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":Y.detail??Y.message)}finally{g(!1)}}}async function _e(){if(Q){g(!0),b("");try{await z2(Q.id),await te(),re(null)}catch(z){b(Ve(z).detail??Ve(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void de(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(R==null?void 0:R.status)==="pending",onClick:Ee,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide active account"}),s.jsx("span",{children:"Switching requires the cloud runtime to be idle. The cloud publishes the selected credential; members pause new work and apply it after any active turn finishes. There is no per-deployment selection."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var Fe,jt;const C=(i==null?void 0:i.activeAccountId)===z.id,Y=(Fe=i==null?void 0:i.accountDetails)==null?void 0:Fe[z.id],fe=((jt=i==null?void 0:i.accountIssues)==null?void 0:jt[z.id])??[],X=fe.length>0,ye=fe.some(xt=>["missing_credential","invalid_credential","credential_unreadable"].includes(xt.code)),Re=[z.email,DA(z.accountType),_A(z.planType)].filter(xt=>!!xt);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${X?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null,X?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:Re.join(" · ")||`Added ${He(z.createdAt)}`}),X?s.jsx("div",{className:"codex-account-issues",role:"status",children:fe.map(xt=>s.jsx("span",{children:xt.message},xt.code))}):null,Y!=null&&Y.usage?s.jsx(NA,{usage:Y.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),Y?s.jsx("small",{className:Y.error?"codex-account-detail-error":"codex-account-refreshed",children:Y.error?`Refresh issue: ${Y.error}`:`Updated ${He(Y.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c||ye,onClick:()=>V(z),title:ye?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:X?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||X,onClick:()=>{b(""),D(z)},type:"button",children:C?"In use":X?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),re(z)},type:"button",children:"Delete"})]})]},z.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&H(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void oe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>H(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>W(z.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>H(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!R&&j(!1),role:"presentation",children:R?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:R.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),R.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:R.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:R.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):R.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=R.account)==null?void 0:A.name)??R.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:R.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:R.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ge(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>j(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>T(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>j(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,ae?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&D(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>D(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:ae.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>D(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void xe(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,Q?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&re(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>re(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:Q.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>re(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void _e(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function MA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=_.useState(null),[g,m]=_.useState(c),[b,x]=_.useState(!1),[j,w]=_.useState(null),[T,R]=_.useState("");function q(){m(c),R(""),p("new")}function N(W){m({username:W.username,password:"",role:W.role,active:W.active}),R(""),p(W)}function H(){b||(p(null),R(""))}async function $(W){if(W.preventDefault(),!!d){x(!0),R("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(ae){R(Ve(ae).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:q,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(W=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:W.username}),W.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",He(W.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${W.role}`,children:W.role}),s.jsx("span",{className:`user-status ${W.active?"active":"disabled"}`,children:W.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${W.username}`,className:"memory-icon-button",onClick:()=>N(W),title:"Edit",type:"button",children:s.jsx(id,{})}),s.jsx("button",{"aria-label":`Delete user ${W.username}`,className:"memory-icon-button memory-item-delete",disabled:W.id===e.id,onClick:()=>{R(""),w(W)},title:"Delete",type:"button",children:"×"})]})]},W.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:H,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:W=>W.stopPropagation(),onSubmit:W=>void $(W),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:H,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:W=>m(ae=>({...ae,username:W.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:W=>m(ae=>({...ae,password:W.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:W=>m(ae=>({...ae,role:W.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:W=>m(ae=>({...ae,active:W.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:H,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,j?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:W=>W.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:j.username}),". Users that own workspaces must be disabled instead."]}),T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(j.id).then(()=>w(null)).catch(W=>R(Ve(W).message))},type:"button",children:"Delete"})]})]})}):null]})}function OA({settings:e,onSave:i}){const[a,r]=_.useState(e),[u,c]=_.useState(!1);return _.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(a).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:a.profuseNotificationEnabled,onChange:d=>r({profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function zA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:j,onUpdateCodexCli:w}){var W;const T=d==="workspace",R=Po(r.model,c),q=Po(u.model,c),N=Po(p.model,c),H=Dx(r.reasoningEffort,R),$=qE(R,r.reasoningEffort);return _.useEffect(()=>{R&&H!==r.reasoningEffort&&b({...r,reasoningEffort:H})},[r,R,H,b]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:j,children:[s.jsxs("label",{className:Mc(T,Al(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Rc,{globalValue:fb(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Al(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(vp,{"aria-label":"Runtime model",onChange:ae=>{const D=Po(ae,c);b({...r,model:ae,reasoningEffort:Dx(r.reasoningEffort,D)})},options:WD(c,r.model),value:r.model||((W=c.find(ae=>ae.isDefault))==null?void 0:W.model)||""})]}),s.jsxs("label",{className:Mc(T,Al(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Rc,{globalValue:Nx(u.reasoningEffort,q),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Al(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(vp,{"aria-label":"Runtime reasoning effort",onChange:ae=>b({...r,reasoningEffort:ae}),options:$,value:H})]}),s.jsxs("label",{className:Mc(T,Al(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Rc,{globalValue:hb(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Al(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(vp,{"aria-label":"Permission mode",onChange:ae=>b({...r,sandbox:ae}),options:JE,value:r.sandbox})]}),s.jsxs("label",{className:Mc(T,Al(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Rc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Al(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:ae=>b({...r,fastMode:ae.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",fb(p.model,c),", reasoning"," ",Nx(p.reasoningEffort,N),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",hb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:lh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function Rc({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:a}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function vp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=_.useState(!1),d=_.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return _.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Al(e,i,a){return e!==i?"workspace":a}function Mc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function LA({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(UA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(IA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function IA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var Q;const[c,d]=_.useState(Jo(a)),[p,g]=_.useState(null),[m,b]=_.useState({key:"",value:""}),[x,j]=_.useState(null),[w,T]=_.useState(null),[R,q]=_.useState(null);_.useEffect(()=>{d(Jo(a))},[a]),_.useEffect(()=>{if(p===null)return;const re=ee=>{ee.key==="Escape"&&(W(),T(null))};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[p]);async function N(re,ee){q(ee);try{const L=await r(re);return d(Jo(L)),L}finally{q(null)}}function H(){T(null),j(null),b({key:"",value:""}),g("new")}function $(re){const ee=c[re];ee&&(T(null),j(null),b({...ee}),g(re))}function W(){g(null),j(null),b({key:"",value:""})}async function ae(re){const ee=c[re],L=(ee==null?void 0:ee.key)||`${re}`;await N(c.filter((te,de)=>de!==re),`delete:${L}`),T(null)}async function D(re){re.preventDefault(),re.stopPropagation();const ee=m.key.trim(),L=eD(ee);if(L){j(L);return}const te=m.value.trim();if(!te){j("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==de&&ge.key.trim()===ee)){j(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ee={...m,key:ee,value:te};p==="new"?await N([...c,Ee],"add"):typeof p=="number"&&await N(c.map((ge,ue)=>ue===p?Ee:ge),`save:${p}`),W()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((re,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${re.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${re.key}>`}),`
|
|
92
|
+
`,s.jsx("span",{children:re.value}),`
|
|
93
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${re.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>$(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>T(ee),children:"×"})]})]},`${ee}-${re.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:W,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:re=>re.stopPropagation(),onSubmit:re=>void D(re),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:W,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:re=>b(ee=>({...ee,key:re.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:re=>b(ee=>({...ee,value:re.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:W,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:R!==null,type:"submit",children:R==="add"||R!=null&&R.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:re=>re.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((Q=c[w])==null?void 0:Q.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:R!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:R!==null,type:"button",onClick:()=>void ae(w),children:"Delete"})]})]})}):null]})}function UA({emptyText:e,items:i}){const a=Jo(i);return a.length?s.jsx("div",{className:"memory-items-list",children:a.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
|
|
94
|
+
`,s.jsx("span",{children:r.value}),`
|
|
95
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function BA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:j,onSubmitEnvironment:w,onValueVisibleChange:T,revealedEnvironmentKeys:R}){const q=i!==null&&R.has(i),N=u==="workspace",H=N?c:r,[$,W]=_.useState(!1);function ae(){p(),b({description:"",key:"",value:""}),T(!1),W(!0)}function D(ee){x(ee),T(!1),W(!0)}function Q(){W(!1),p(),T(!1)}function re(ee){w(ee),W(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:N?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:N?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),N?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Ux,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ae,children:"+"})}),s.jsx(Ux,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:D,variables:H})]}),$?s.jsx("div",{className:"memory-editor-overlay",onClick:Q,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:re,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Q,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...a,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...a,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!q&&!a.value){j(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(f2,{}):s.jsx(d2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...a,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Q,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Ux({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",He(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>a==null?void 0:a(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Hv({items:e,onDelete:i,onEdit:a}){const[r,u]=_.useState(null),[c,d]=_.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:HA(p.kind)}),s.jsx("span",{className:VA(p.status),children:$A(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",GA(p.refreshPolicy)," · updated ",He(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>a(p),title:"Edit knowledge",type:"button",children:s.jsx(id,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function qA({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return a==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Hv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function HA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function $A(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function GA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function VA(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:a=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function FA({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=_.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,PA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Bx(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",He(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Bx(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Un(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Bx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function PA(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function YA({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Je,{label:"Thread",value:e.id,mono:!0}),s.jsx(Je,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Je,{label:"Status",value:e.status}),s.jsx(Je,{label:"Source",value:e.source}),s.jsx(Je,{label:"Created",value:Ho(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Ho(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Ho(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Un(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Un(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Un(e.userMessageCount)} / ${Un(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Un(e.compactionCount)} / ${Un(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:Ho(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Ho(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":bs(i.durationMs)}),s.jsx(Je,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function $o(e,i,a,r,u,c,d,p,g,m){var b,x,j,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":He(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":He(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Fo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":He(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Kx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":He(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:n_(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:He(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Kx,{content:e.message.content}):s.jsx(Fo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(R=>s.jsx("article",{className:"message topic-input","data-hover-time":He(R.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",R.senderName]}),s.jsx("time",{dateTime:R.createdAt,children:He(R.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Fo,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const T=gr({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":He(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(qc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:T})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Gv,{description:e.tool.body,icon:s.jsx($v,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(lN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(iN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(tN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(nN,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(qc,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:He(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Fo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(j=e.tool.rawEvents)!=null&&j.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":He(e.tool.createdAt),title:He(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(qc,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function qx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&WA(e.tool)}function WA(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||!!e.linkedTaskId||e.meta==="approval"}function KA(e){const i=[],a=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?a.push(r):i.push(r);return[...i,...a]}function XA({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:j,onOpenComplexTask:w,onOpenSystemEvent:T}){const R=KA(e.agentItems.filter(qx)),q=e.agentItems.some(te=>!qx(te)),N=a&&(q||e.turnIds.length>0),H=c?"process":"result",[$,W]=_.useState(H),[ae,D]=_.useState(!1),Q=$==="result"?R:e.agentItems,re=oN(Q);_.useEffect(()=>{ae||W(H)},[H,ae]);const ee=c||N||e.stopped,L=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):N?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{D(!0),W(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(QA,{}):s.jsx(ZA,{})}):null}):null,Q.map(te=>s.jsx(_.Fragment,{children:$o(te,i,m,d,u,b,x,j,w,T)},te.id)),$==="result"&&Q.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":q?"No reliable final answer captured":"No result yet"}):null,s.jsx(Go,{copied:r,content:re,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:uN(Q),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:L})}function QA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function ZA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function JA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function $v(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function eN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Gv({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":He(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:a}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function tN({conversation:e,tool:i,onRespond:a}){var q;const r=je((q=i.workspaceChangePayload)==null?void 0:q.content)||i.body,[u,c]=_.useState(r),[d,p]=_.useState(null),[g,m]=_.useState("source"),[b,x]=_.useState(!1),j=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:j?"pending":"preparing",T=w==="pending";_.useEffect(()=>{c(r)},[r]);async function R(N){p(N);try{await a(i,N,N==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Gv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(id,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:N=>N.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",He(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:j?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,T?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:N=>c(N.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Nl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Nl(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void R("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void R("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function nN({tool:e,onRespond:i}){const[a,r]=_.useState(e.body),[u,c]=_.useState(null),[d,p]=_.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Hx(a);return _.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx($x,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx($x,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Hx(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Hx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function wp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function $x({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:wp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:wp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:wp(e.content??e.description)})]})]})})}function iN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=LE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":He(i.createdAt),title:He(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:zE(a,r)})]}),s.jsx(Gx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:aN(p.kind)}),s.jsx("code",{title:p.path,children:Tv(p.path,r)}),s.jsx(Gx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Gx({additions:e,deletions:i,running:a=!1}){return s.jsxs("span",{className:"file-change-stats",children:[a?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function aN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function lN({tool:e,onRespondApproval:i}){var j;const a=ED(e),[r,u]=_.useState(!1),[c,d]=_.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=Kc(e.body)?null:e.body,m=g?RD(g):null,b=m?`${rN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=AD(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":He(e.createdAt),title:He(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(j=e.rawEvents)!=null&&j.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Vx,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:ND(e,a)}),e.output?s.jsx(Vx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(sN,{events:e.rawEvents??[]}):null]})}function rN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Vx({content:e}){const[i,a]=_.useState(!1),r=_D(e,Ox);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:DD(e,Ox)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function sN({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Go({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(lw,{})}):null,s.jsx("time",{dateTime:u,children:He(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Vo(e){return e.type==="message"?e.message.role==="user"?e.message.content:xr(e.message.content):e.type==="assistantText"?xr(e.content):e.type==="turnError"?`Task failed
|
|
96
|
+
|
|
97
|
+
${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
|
|
98
|
+
|
|
99
|
+
`):""}function oN(e){return e.map(Vo).filter(i=>i.trim()).join(`
|
|
100
|
+
|
|
101
|
+
`)}function uN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function cN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(dN,{label:Vv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function Vv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function dN({label:e,window:i}){const a=ad(i.usedPercent),r=Ih(a),u=`${e} usage ${jw(a)} · resets ${Sw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(a),"%"]})})}function fN(e,i,a,r,u,c){const d=[...e].sort(Zo),p=new Map(r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>[D.turnId,D.sequence])),g=new Map(r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>[D.turnId,D.timelineAt])),m=new Map(r.filter(D=>D.nodeType==="user_message"&&D.entityId!==null).map(D=>[D.entityId,D.sequence])),b=new Map(r.filter(D=>D.nodeType==="user_message"&&D.entityId!==null).map(D=>[D.entityId,D.timelineAt])),x=r.filter(D=>D.parentId===null&&D.nodeType==="system_event"),j=x.filter(D=>D.turnId!==null&&D.subtype.startsWith("input:")),w=x.filter(D=>!j.includes(D)),T=new Set(x.flatMap(D=>D.turnId?[D.turnId]:[])),R=jE(i),q=new Map(a.map(D=>[D.id,D])),N=r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>D.turnId),$=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...a.map(D=>D.id),...d.flatMap(D=>D.turnId?[D.turnId]:[]),...i.flatMap(D=>D.turnId?[D.turnId]:[])])].map(D=>{var Pe,wt,Ot,un;const Q=q.get(D),re=d.filter(ze=>ze.turnId===D),ee=re.filter(ze=>ze.role==="user").sort((ze,zt)=>{const gn=b.get(ze.id)??ze.createdAt,Kt=b.get(zt.id)??zt.createdAt;return gn.localeCompare(Kt)||Zo(ze,zt)}),L=re.filter(ze=>ze.role==="assistant"),te=i.filter(ze=>ze.turnId===D).sort(Zo),de=`turn:${D}`,Ee=r.filter(ze=>ze.parentId===de).sort((ze,zt)=>ze.sequence-zt.sequence),ge=(Q==null?void 0:Q.origin)??R.get(D),ue=j.filter(ze=>ze.turnId===D).sort((ze,zt)=>ze.timelineAt.localeCompare(zt.timelineAt)||ze.sequence-zt.sequence).map(ze=>Fx(ze,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?wN(Ee,te,Xo([D],u),c):Pv(te,Xo([D],u),c),oe=L.map(qo),xe=Ee.find(ze=>ze.subtype==="server.complex_task.plan_updated"),_e=te.find(ze=>ze.event==="server.complex_task.plan_updated"),O=(xe==null?void 0:xe.detail)??(_e==null?void 0:_e.data),A=me(me(O).task),z=me(A.currentPlan),C=je(z.planMarkdown),Y=gN(vN(V,oe),C),fe=SE(Q);fe&&Y.push({id:`turn-error-${fe.turnId}`,type:"turnError",createdAt:fe.createdAt,content:fe.content});const X=te.find(ze=>ze.event==="server.wakeup.started"),ye=me(X==null?void 0:X.data),Re=typeof ye.instruction=="string"?ye.instruction.trim():"",Fe=ge==="timeline_event"?te[0]:void 0,jt=T.has(D)?null:Fe?Fv(Fe,(Q==null?void 0:Q.startedAt)??new Date(0).toISOString()):yN(ge)?{id:`system-${D}`,type:"system",createdAt:(Q==null?void 0:Q.startedAt)??((Pe=te[0])==null?void 0:Pe.createdAt)??new Date(0).toISOString(),title:xN(ge??"system"),detail:bN(ge??"system",Re),fullDetail:Re||void 0}:null,xt=zN(te),on=(ee[0]?b.get(ee[0].id):(wt=j.find(ze=>ze.turnId===D))==null?void 0:wt.timelineAt)??g.get(D)??(Q==null?void 0:Q.startedAt)??((Ot=re[0])==null?void 0:Ot.createdAt)??((un=te[0])==null?void 0:un.createdAt)??new Date(0).toISOString();return{id:`turn-${D}`,turnIds:[D],user:jt??(ee[0]?qo(ee[0]):null),followupUsers:ee.slice(1).map(qo),acceptedSystemInputs:ue,agentItems:Y,activity:xt??(Xo([D],u)?{id:-1,title:Y.some(ze=>ze.type==="assistantText"&&ze.streaming)?"Writing response":"Working",createdAt:on,tone:"running"}:null),notificationFailure:ON(te),stopped:te.some(Wv),trailingSystemItems:[],sortAt:on,sortSequence:p.get(D)??null}}),W=d.filter(D=>!D.turnId);$.push(...W.map(D=>({id:`message-${D.id}`,turnIds:[],user:D.role==="user"?qo(D):null,followupUsers:[],agentItems:D.role==="assistant"?[qo(D)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(D.id)??D.createdAt,sortSequence:m.get(D.id)??null})));const ae=new Map(i.map(D=>[String(D.id),D]));return $.push(...w.map(D=>({id:D.id,turnIds:[],user:Fx(D,D.entityType==="event"&&D.entityId?ae.get(D.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:D.timelineAt,sortSequence:D.sequence}))),$.sort((D,Q)=>{const re=D.sortAt.localeCompare(Q.sortAt);return re!==0?re:D.sortSequence!==null||Q.sortSequence!==null?(D.sortSequence??Number.MAX_SAFE_INTEGER)-(Q.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:D,...Q})=>Q)}function Fx(e,i,a){var g,m;if(i||e.entityType==="event")return Fv(i??th(e),e.createdAt);const r=me(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Yp(r,a),x=pN(r.messages,a),j=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(T=>typeof T=="string"&&T.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",j.length>0?j.map(T=>{const R=a.get(T)??T;return`${pr(R)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
|
|
102
|
+
`)}}const u=je(r.complexTaskId)||je(me(r.task).id)||void 0,c=Sv(e.title,e.subtype),d=gr(r,[e.summary,e.contentMarkdown]),p=[`## ${pr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
|
|
103
|
+
`):""].filter(Boolean).join(`
|
|
104
|
+
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function pN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=je(c.id),p=je(c.senderWorkspaceId),g=je(c.contentMarkdown).trim(),m=je(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(je(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Fv(e,i){return e.event==="server.collaboration.topic_created"?hN(e,i):mN(e,i)}function hN(e,i){const a=me(me(e.data).topic),r=je(a.title).trim()||"Untitled Topic",u=je(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=je(a.ownerWorkspaceId),p=c.find(x=>je(x.role)==="owner"||je(x.workspaceId)===d),g=je(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>je(x.role)!=="owner"&&je(x.status)==="active"),b=m.length?m.map(x=>{const j=je(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${pr(j)} (\`${je(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",pr(r),"","**描述**","",pr(u),"","**Owner Workspace**","",`${pr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
105
|
+
`)}}function mN(e,i){const a=me(e.data),r=eh(e.data),u=Sv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:gr(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${pr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
|
|
106
|
+
`)}}function eh(e,i=""){return Array.isArray(e)?e.map(a=>eh(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,eh(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&eu(e)||e}function gN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?xr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?xr(r.message.content).trim()!==a:!0):e}function yN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function xN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function bN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?gw(i,20):"Auto resumed"}function vN(e,i){if(e.some(u=>u.type==="assistantText"))return Wc(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Rh(u.tool)&&_h(a,u.tool)||r.push(u);return Wc([...r,...a])}function wN(e,i,a,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=kN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Ca(x),x)}if(a)for(const m of i)jN(e,m)||c.set(Ca(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Ca(m),m);const p=Pv([...c.values()].sort(Zo),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:SN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:CN(m,r)})}return Wc(p)}function kN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[th(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Dh(u)===e.entityId);return r.length>0?r:[th(e)]}return[]}function th(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":je(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":a,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function jN(e,i){const a=i.id===void 0?null:String(i.id),r=Dh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Dh(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return je(r.id)||je(a.itemId)||null}function SN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function CN(e,i){var r,u;const a=me(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Yp(a,i).title:e.title||yw(e.subtype),body:e.subtype==="input:collaboration_notice"?Yp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||cw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Pv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){AN(r,p);continue}if(p.event==="server.knowledge.decision"){NN(r,p);continue}if(Wv(p)){MN(r);continue}if(p.event==="server.steer"){const T=me(p.data),R=typeof T.message=="string"?T.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:R||"Additional input",messageId:typeof T.messageId=="string"?T.messageId:void 0});continue}const g=QD(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=XD(p.data);if(m!=null&&m.text){const T=m.itemId?d.get(m.itemId)??m.phase:m.phase,R=m.itemId??`phase:${T}`,q=`${u.get(R)??""}${m.text}`,N=tw(q),H=c.get(R)??"",$=N.startsWith(H)?N.slice(H.length):N;if(u.set(R,q),c.set(R,N),$){const W=r[r.length-1];(W==null?void 0:W.type)==="assistantText"&&_N(W,m.itemId,T)?(W.content+=$,W.itemId=W.itemId??m.itemId,W.streamKey=W.streamKey??R,W.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:T,itemId:m.itemId,streamKey:R,streaming:i})}continue}const b=ZD(p.data);if(b!=null&&b.text){const T=xr(b.text),R=b.itemId??`phase:${b.phase}`,q=RN(r,b.itemId,b.phase);if(q>=0){const N=r[q];N.type==="assistantText"&&(T?(N.content=T,N.phase=b.phase,N.itemId=N.itemId??b.itemId,N.streamKey=N.streamKey??R,N.streaming=!1,EN(r,q,b.itemId)):r.splice(q,1))}else T&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:T,phase:b.phase,itemId:b.itemId,streamKey:R,streaming:!1});continue}const x=jD(p,a);if(x){x.rawEvents=[p];const T=Yx(r,x);if(T>=0){Wx(r[T],x);continue}if(Rh(x)&&_h(r,x)||x.kind==="command"&&x.meta==="running"&&Kc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const j=SD(p);if(j){j.rawEvents=[p];const T=Yx(r,j);if(T>=0){Wx(r[T],j);continue}r.push({id:`tool-${j.id}`,type:"tool",createdAt:j.createdAt,tool:j});continue}if(_E(p)){TN(r,p);continue}const w=CD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Wc(r)}function TN(e,i){const a=Dh(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:Kv(u.tool.rawEvents,[i])};return}}}function EN(e,i,a){if(a)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===a&&e.splice(r,1)}}function AN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.payload),d=je(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){g.tool={...g.tool,title:u==="accept"?"Workspace change applied":"Workspace change declined",meta:u==="accept"?"saved":"declined",body:d??g.tool.body,workspaceChangePayload:u==="accept"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function NN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function _h(e,i){const a=Yv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Px(d,i))continue;const p=xr(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Px(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),j=[];return b&&j.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),j.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&j.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...j),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function Px(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Wc(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Rh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)_h(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return DN([...u,...r])}function Rh(e){return typeof Yv(e)=="number"}function Yv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function DN(e){const i=[];for(let a=0;a<e.length;a+=1){const r=e[a],u=e[a+1];if((r==null?void 0:r.type)==="tool"&&r.tool.kind==="responsibility"&&typeof r.tool.responsibilityAnchorOffset!="number"&&(u==null?void 0:u.type)==="assistantText"){i.push({...u,pinnedToResult:!0}),i.push(r),a+=1;continue}i.push(r)}return i}function _N(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function RN(e,i,a){if(i){const r=e.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function Wv(e){return e.event==="server.stop"||e.event==="server.stopped"}function MN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function ON(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=me(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function zN(e){for(let i=e.length-1;i>=0;i-=1){const a=xw(e[i]);if(a)return a}return null}function Yx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[a];if(r.type==="tool"&&r.tool.kind===i.kind&&(i.itemId&&r.tool.itemId===i.itemId||r.tool.body===i.body&&r.tool.meta==="running"))return a}return-1}function Wx(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&Kc(i.body)&&!Kc(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:a?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:a?e.tool.meta:i.meta,output:BD(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Kv(e.tool.rawEvents,i.rawEvents)}}function Kv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Ca(u);return r.has(c)?!1:(r.add(c),!0)})}function qo(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function kp(e,i){const a=new Set,r=[...e,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>Xv(u)?!r.some(c=>LN(c,u)):!0)}function jp(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function Sp(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Xv(e){return e.id.startsWith("local-")}function LN(e,i){if(Xv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const a=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function Oc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Ca(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=Qv(c,d);return p!==0?p:(r.get(Ca(c))??0)-(r.get(Ca(d))??0)})}function Cp(e,i){const a=Ca(i),r=e.findIndex(c=>Ca(c)===a);if(r<0)return[...e,i];if(IN(e[r],i))return e;const u=[...e];return u[r]=i,u}function IN(e,i){return e.turnId===i.turnId&&e.event===i.event&&e.createdAt===i.createdAt&&e.seq===i.seq&&JSON.stringify(e.data)===JSON.stringify(i.data)}function Ca(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Zo(e,i){const a=Qv(e,i);return a!==0?a:UN(e.id,i.id)}function Qv(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const a=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(a)&&!Number.isNaN(r)&&a!==r?a-r:Number.isNaN(a)!==Number.isNaN(r)?Number.isNaN(a)?1:-1:0}function UN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function Tp(e,i){const a=me(e.data);return typeof a.__seq=="number"&&typeof a.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(a,"payload")?{id:typeof a.__eventId=="string"?a.__eventId:`stream:${a.__turnId??"unknown"}:${a.__seq}`,turnId:typeof a.__turnId=="string"?a.__turnId:null,seq:a.__seq,event:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Fo=_.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?tw(i):xr(i),g=a&&!r?PN(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(HN,{content:p,conversation:a}):Nl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(FN,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},BN);function BN(e,i){var a,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((a=e.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Kx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const qN=2;function HN({content:e,conversation:i}){const a=_.useRef(null),[r,u]=_.useState(null),{committedBlocks:c,activeBlock:d}=$N(e);return _.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*qN,j=Math.min(m,x);return b!==null&&j<=b?b:j})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(_.Fragment,{children:Nl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function $N(e){const i=VN(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:GN(a),activeBlock:r}}function GN(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(zc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(zc(i,e.slice(a,m)),a=m,u=!1),g===""&&(zc(i,e.slice(a,d)),a=d)}return a<e.length&&zc(i,e.slice(a)),i}function zc(e,i){i.trim()&&e.push(i)}function VN(e){const i=e.lastIndexOf(`
|
|
107
|
+
`);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
|
|
108
|
+
`&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
|
|
109
|
+
`,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function FN({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function PN(e,i){const a=new Map;for(const r of YN(e)){const u=Zv(r);if(u){const c=Jv(u).toLowerCase(),d=a.get(c);(!d||XN(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>WN(r,i)).filter(r=>r!==null)}function YN(e){const i=[],a=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[a,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function WN(e,i){const a=Zv(e);if(!a||!KN(a))return null;const r=ew(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Jv(r),url:he(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function Zv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function KN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Jv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function ew(e,i){const a=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return a===r||!a.startsWith(`${r}/`)?a:a.slice(r.length+1)}function XN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function xr(e){return e.trim()}function tw(e){return e.trim()}function Ep(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function QN(e){return{a({children:i,href:a}){if(!a)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&e?ZN(a,e):null,c=u??a,d=r||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const a=t2(i);return a?Mh(a.language)==="mermaid"?s.jsx(n2,{code:a.code}):s.jsx(l2,{code:a.code,language:a.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return s.jsx("td",{style:Xx(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:Xx(i),children:a})}}}function ZN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[a]=e.split("#",1),[r]=a.split("?",1),u=JN(r);if(!u)return null;const c=ew(u,i.workspacePath);return he(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function JN(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function Xx(e){return e&&e!=="char"?{textAlign:e}:void 0}function Nl(e,i){const a=e2(e);return s.jsx(uC,{components:QN(i),remarkPlugins:[kE],skipHtml:!0,children:a})}function e2(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
110
|
+
$2`)}function t2(e){var c;const i=_.Children.toArray(e),a=i.length===1&&_.isValidElement(i[0])?i[0]:null;if(!a||a.type!=="code")return null;const u=((c=(a.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:nh(a.props.children).replace(/\n$/,""),language:u}}function nh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(nh).join(""):_.isValidElement(e)?nh(e.props.children):""}const nw="github-light",Ap=new Map,Np=new Map;let Dp=null,_p=null;const iw=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Mh(e){const i=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[i]??i}function aw(e){const i=Mh(e);return!i||i==="text"||i==="txt"?"text":iw.has(i)?i:"text"}function n2({code:e}){const a=`seele-mermaid-${_.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=_.useState(!1),[c,d]=_.useState(()=>Np.get(e)??null),[p,g]=_.useState(null);_.useEffect(()=>{let b=!1,x;const j=Np.get(e);return j?(d(j),g(null),()=>{b=!0}):(g(null),d(null),i2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Np.set(e,w),d(w),g(null))},w=>{if(!b){const T=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(T)},ZE)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Oh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function i2(e,i){return(await(await a2()).render(e,i)).svg}function a2(){return _p||(_p=Ct(()=>import("./mermaid.core-DSU3sJ3I.js").then(e=>e.bp),[],import.meta.url).then(e=>{const i=e.default;return i.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),i})),_p}function l2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=_.useState(!1),[c,d]=_.useState(()=>{if(!Jx(i))return null;const m=Zx(e,i);return Ap.get(m)??null}),p=a?{"--code-block-min-height":`${uA(e)}px`}:void 0;_.useEffect(()=>{let m=!1;if(!Jx(i))return d(null),()=>{m=!0};const b=Zx(e,i),x=Ap.get(b);return x?(d(x),()=>{m=!0}):(d(null),p2(e,i).then(j=>{Ap.set(b,j),m||d(j)}).catch(j=>{console.warn("Failed to highlight code block",j),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Oh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Oh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function r2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function lw(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function s2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function o2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Qx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function u2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function qc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function id(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function c2(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function d2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function f2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Zx(e,i){return`${nw}:${aw(i)}:${e}`}function Jx(e){const i=Mh(e);return!!i&&iw.has(i)}async function p2(e,i){return(await h2()).codeToHtml(e,{lang:aw(i),theme:nw})}function h2(){return Dp||(Dp=m2()),Dp}async function m2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:j},{default:w},{default:T},{default:R},{default:q},{default:N},{default:H},{default:$},{default:W},{default:ae}]=await Promise.all([Ct(()=>import("./core-BRk-g4A9.js"),[],import.meta.url),Ct(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Ct(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Ct(()=>import("./bash-BELqPA7S.js").then(D=>D.b),[],import.meta.url),Ct(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Ct(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Ct(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Ct(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Ct(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Ct(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Ct(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Ct(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Ct(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Ct(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Ct(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Ct(()=>import("./bash-BELqPA7S.js").then(D=>D.s),[],import.meta.url),Ct(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Ct(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Ct(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Ct(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Ct(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Ct(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,j,w,T,R,q,N,H,$,W,ae]})}async function eb(){const e=he("conversations"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).conversations}async function g2(){const e=he("workspace-states"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).workspaces}async function tb(){const e=he("collaboration/topics"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).topics}async function Lc(e){const i=he(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).messages}async function y2(e){const i=he("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(a,{method:"POST",url:i}),(await a.json()).topic}async function x2(e,i){const a=he(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:a}),(await r.json()).topic}async function b2(e,i){const a=he(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Se(r,{method:"POST",url:a}),(await r.json()).topic}async function v2(e){const i=he(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Se(a,{method:"POST",url:i})}async function nb(){const e=he("workspace-groups"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).groups}async function w2(e){const i=he("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Se(a,{method:"POST",url:i}),(await a.json()).group}async function k2(e,i){const a=he(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:a}),(await r.json()).group}async function j2(e){const i=he(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Se(a,{method:"DELETE",url:i}),await a.json()}async function S2(){const e=he("settings/environment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).variables}async function C2(e){const i=he(`conversations/${e}/settings/environment`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).variables}async function T2(e){const i=he(`conversations/${e}/knowledge`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).items}async function E2(){const e=he("settings/runtime"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function A2(){const e=he("settings/deployment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function N2(){const e=he("diagnostics"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function D2(){const e=he("settings/runtime/codex"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function ib(){const e=he("settings/runtime/accounts"),i=await fetch(e);await Se(i,{url:e});const a=await i.json();return vr(),a}async function ab(e=!1){const i=he(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Se(a,{method:"POST",url:i});const r=await a.json();return vr(),r}async function _2(e){const i=he("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Se(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&vr(),r.login}async function R2(e){const i=he(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).login}async function M2(e){const i=he(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Se(a,{method:"POST",url:i}),(await a.json()).login}async function O2(e,i){const a=he(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Se(r,{method:"PATCH",url:a});const u=await r.json();return vr(),u.account}async function z2(e){const i=he(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Se(a,{method:"DELETE",url:i}),vr()}async function L2(e){const i=he(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Se(a,{method:"POST",url:i});const r=await a.json();return vr(),r}async function I2(e=!0){const i=he(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Se(a,{url:i}),await a.json()}async function U2(e=!1){const i=he(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Se(a,{url:i}),await a.json()}async function B2(){const e=he("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Se(i,{method:"POST",url:e}),(await i.json()).job}async function q2(e){const i=he(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).settings}async function H2(){const e=he("settings/memory"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function $2(e){const i=he("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(a,{method:"PUT",url:i}),(await a.json()).settings}async function G2(e){const i=he("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(a,{method:"PUT",url:i}),(await a.json()).settings}async function lb(e,i){const a=he(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PUT",url:a}),await r.json()}async function rb(e,i){const a=he(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"POST",url:a});const u=(await r.json()).job;return sw(e,u)}async function rw(e){const i=he(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).job}async function sw(e,i){let a=i;const r=Date.now()+1800*1e3;for(;a.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await rw(e);if(!u||u.id!==a.id)throw new Error("The runtime reset job is no longer available.");a=u}if(a.status==="failed"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function sb(e){const i=he(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Se(a,{url:i}),await a.json()}async function V2(e,i){const a=he(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"PUT",url:a})}async function F2(e){const i=he(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).result}async function P2(e){const i=he(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Se(a,{url:i});const r=await a.json();return r.event?bw(r.event):null}async function Y2(e){const i=he(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Se(a,{url:i}),await a.json()}async function W2(e){const i=he(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).compactions}function K2(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:HE(e.reasoningEffort,i.reasoningEffort,(a==null?void 0:a.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function X2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:Z2(e.sourceCluesText),requiredEnv:J2(e.requiredEnvText)}}function Q2(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
|
|
111
|
+
`),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
112
|
+
`)}}function Z2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean).map(a=>{const r=a.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():a,providedBy:"user",providedAt:i}})}function J2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[a,...r]=i.split(/\s+-\s+/);return{key:a.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function ob(e,i){const a=ub(i.attention)-ub(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function ub(e){return e==="watch"?2:e==="tracked"?1:0}function Jo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function eD(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function tD(e){return Jo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
113
|
+
`)}async function nD(e){const i=he("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(a,{method:"PUT",url:i}),await a.json()}async function iD(e,i,a){const r=he("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Se(u,{method:"PUT",url:r}),(await u.json()).variable}async function aD(e,i,a,r){const u=he(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await Se(c,{method:"PUT",url:u}),await c.json()}async function lD(e){const i=he(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).variable.value}async function rD(e,i){const a=he(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Se(r,{url:a}),(await r.json()).variable.value}async function sD(e){const i=he(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Se(a,{method:"DELETE",url:i})}async function oD(e,i){const a=he(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Se(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function uD(e,i){const a=he(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"POST",url:a}),(await r.json()).item}async function cD(e,i,a){const r=he(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Se(u,{method:"PATCH",url:r}),(await u.json()).item}async function dD(e,i){const a=he(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Se(r,{method:"DELETE",url:a})}async function fD(){const e=he("meta"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function pD(e){const i=he(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).usage??null}async function hD(e,i){const a=he("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Se(r,{method:"POST",url:a}),(await r.json()).conversation}async function mD(e){const i=he(`conversations/${e}/complex-task`),a=await fetch(i);return await Se(a,{url:i}),(await a.json()).task}async function gD(e,i){const a=he(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Se(r,{url:a}),(await r.json()).task}async function yD(e,i){const a=he(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Se(r,{method:"POST",url:a}),(await r.json()).task}async function xD(e,i,a){const r=he(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Se(u,{method:"POST",url:r}),await u.json()}async function bD(e){const i=he(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Se(a,{method:"POST",url:i}),await a.json()}async function Rp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Nv)),i.before&&a.set("before",i.before);const r=he(`conversations/${e}?${a}`),u=await fetch(r);return await Se(u,{url:r}),(await u.json()).conversation}async function vD(e,i){const a=he(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Se(r,{url:a}),(await r.json()).events}async function Ic(e,i){const a=he(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function wD(e){const i=he(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await Se(a,{method:"DELETE",url:i})}function kD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function ow(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function jD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:VD(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const c=me(e.data),d=je(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=je(c.audience),x=je(c.recipientWorkspaceId),j=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(q=>typeof q=="string"):Array.isArray(c.recipients)?c.recipients.filter(q=>typeof q=="string"):[],w=j.filter(q=>q!=="ALL").map(q=>i.get(q)).filter(q=>!!q);let T="Topic";w.length>0?T=ow(w):j.length===1?T=j[0]==="ALL"?"Topic participants":_l(j[0]):j.length>1?T=`${j.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const R=je(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:R?`Topic ${_l(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?je(c.contentMarkdown)||void 0:je(c.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(g||m)&&je(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=me(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=me(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=me(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",j=Array.isArray(b.options)?b.options.map(w=>{const T=me(w);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
|
|
114
|
+
`):"";return j?`${x}
|
|
115
|
+
|
|
116
|
+
${j}`:x}).join(`
|
|
117
|
+
|
|
118
|
+
`);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=me(e.data);if(je(c.actionType)==="seele_workspace_change"){const p=me(c.payload),g=me(p.payload),m=je(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:hw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=OE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=ME(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=me(e.data),d=me(c.params),p=je(d.tool)||"dynamic tool",g=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:fw(p,!1,g),body:pw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?uw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&je(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=me(e.data),d=me(c.payload),p=je(d.content)||je(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:je(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=me(e.data),d=me(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=me(e.data),d=me(c.task),p=me(d.currentPlan),g=me(c.update),m=je(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:je(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=me(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:je(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=me(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Hc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=me(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:ih(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=GD(c.requestId),p=me(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"){const c=me(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Hc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=me(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Hc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function SD(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=me(i.params),u=me(r.item),c=typeof u.type=="string"?u.type:"item";if(dw(c)||ww(u))return null;const d=a==="item/completed",p=me(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?fw(g,d,p):d?`Finished ${Dl(c)}`:`Working on ${Dl(c)}`,body:g?pw(g,p):mw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?TD(u):"running",topicAction:g==="seele_topics"?uw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&je(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?me(p.payload):void 0}}function uw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function CD(e){if(xw(e)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.workspace_change.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(e.event))return null;const i=RE(e);return i?{id:e.id,kind:"activity",title:yw(i),body:cw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function cw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return gw(i[a].trim(),180);return"Event details are available"}function dw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function TD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Dl(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function fw(e,i,a){if(e==="seele_topics")switch(je(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=je(a.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=Dl(e);return i?`Finished ${r}`:`Running ${r}`}function pw(e,i){if(e==="seele_topics"){const a=je(i.topicId);return a?`Topic ${_l(a)}`:"Topic"}if(e==="seele_wakeup")return je(i.instruction)||(je(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=je(i.type)||"workspace";return hw(a,me(i.payload))}return Dl(e)}function hw(e,i){return e==="responsibility"?je(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function mw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return ms(e[a].trim(),160);return typeof e.id=="string"?`${Dl(i)} ${_l(e.id)}`:Dl(i)}function ED(e){var a;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function AD(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function ND(e,i){var r;if(i==="running")return"Command is still running.";if(i==="approval")return"Waiting for approval before running.";if(i==="stopped")return"Command was stopped.";const a=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function DD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
119
|
+
`);return a.length>i?`${u}
|
|
120
|
+
...`:u}function _D(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function Kc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function RD(e){const i=e.trim();return!i||i.includes(`
|
|
121
|
+
`)?null:ms(i,120)}function ms(e,i){if(e.length<=i)return e;const a=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,a)}...${e.slice(-a)}`}function gw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function yw(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function xw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=me(e.data);if(c.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${_l(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:i,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(e.event==="runtime.compaction.started"){const c=me(e.data);return{id:e.id,title:"Codex compacting context",detail:ih(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=me(e.data);return{id:e.id,title:"Codex context compacted",detail:ih(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=me(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(e.event==="server.wakeup.started"){const c=me(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?ms(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=me(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?ms(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"||r==="item/completed"){const c=me(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:ms(Hc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=ww(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:ms(g,96),createdAt:i,tone:p?"done":"running"};if(!dw(d))return{id:e.id,title:p?`Finished ${Dl(d)}`:`Working on ${Dl(d)}`,detail:mw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=me(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=me(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?bs(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=me(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${db(d)}`:`Finished ${db(d)}`,detail:typeof c.durationMs=="number"?bs(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function ih(e,i){const a=Xc(e.before),r=Xc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${bs(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${fr(a)} → ${fr(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${zh(c)} tokens`)}else a&&u.push(`context ${fr(a)}`);return u.join(" · ")}function MD(e){const i=Xc(e.before),a=Xc(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${fr(i)} → ${fr(a)}`:i?u=`${fr(i)} → unavailable`:a&&(u=`unavailable → ${fr(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":bs(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${zh(r)} tokens`:"No decrease observed"}]}function Xc(e){const i=me(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function fr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${zh(e.totalTokens)} tokens`}function zh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function OD(e){let i=null;for(const a of e)for(const r of a.events){const u=ID(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function cb(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function zD(e){let i=null;for(const a of e){const r=bw(a);r&&(!i||Zo(a,i)>0)&&(i=r)}return i}function bw(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=me(i.params),r=me(a.tokenUsage),u=me(r.last),c=me(r.total),d=Object.keys(u).length>0?u:c,p=pi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:pi(d.inputTokens),cachedInputTokens:pi(d.cachedInputTokens),outputTokens:pi(d.outputTokens),reasoningOutputTokens:pi(d.reasoningOutputTokens),modelContextWindow:pi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function LD(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function vw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function ID(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=me(i.params),r=me(a.rateLimits),u=[r.primary,r.secondary].map(c=>UD(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function UD(e){const i=me(e);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function BD(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Hc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function ww(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Wp(e)[0])==null?void 0:a.path)??null}function me(e){return e&&typeof e=="object"?e:{}}function pi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function je(e){return typeof e=="string"?e:""}function pr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function qD(e){const i=me(e),a=me(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const j=me(b),w=je(j.id)||`turn-${x+1}`,T=Array.isArray(j.items)?j.items:[];c+=T.length,u.push(HD(j,w)),T.forEach(R=>{const q=me(R),N=je(q.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(m+=1)})}),{id:je(a.id),sessionId:je(a.sessionId),status:kw(a.status),source:Lh(a.source),cwd:je(a.cwd),path:je(a.path),preview:je(a.preview),createdAt:pi(a.createdAt),updatedAt:pi(a.updatedAt),recencyAt:pi(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function HD(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>je(me(c).type)).filter(c=>c.length>0))).join(", "),u=$D(a.map(c=>ah(c)).filter(Boolean).join(" "),220);return{id:i,status:kw(e.status),itemsView:je(e.itemsView)||"unknown",itemCount:a.length,startedAt:pi(e.startedAt),completedAt:pi(e.completedAt),durationMs:pi(e.durationMs),itemTypes:r,preview:u,raw:e}}function ah(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(ah).filter(Boolean).join(`
|
|
122
|
+
`);if(!e||typeof e!="object")return"";const i=e,a=je(i.text),r=ah(i.content);return[a,r].filter(Boolean).join(`
|
|
123
|
+
`)}function kw(e){const i=me(e);return je(i.type)||Lh(e)}function $D(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Ho(e){return e===null?"unknown":He(e*1e3)}function GD(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Lh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function VD(e){if(typeof e=="string")return e;const i=me(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
124
|
+
|
|
125
|
+
${r}`:a||r||Lh(e)}function db(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function bs(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Mp(e){if(e<6e4)return bs(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60),r=i%60;return r===0?`${a}h`:`${a}h ${r}m`}function jw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function $c(e){return e===null?"unknown":Un(e)}function ad(e){return Math.max(0,Math.min(100,Math.round(e)))}function Ih(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function Sw(e){return He(e*1e3)}function He(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const a={timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},r=new Intl.DateTimeFormat("en-CA",a).formatToParts(i),u=c=>{var d;return((d=r.find(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function eu(e){const i=He(e);return i?`${i} UTC+08:00`:""}function FD(e){const i=new Date(e);return Number.isNaN(i.getTime())?"--:--:--":new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(i)}function fb(e,i){const a=Po(e,i);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Po(e,i){return e?i.find(a=>a.model===e)??null:i.find(a=>a.isDefault)??i[0]??null}function ld(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function lh(e,i){const a=ld(e);return i?`${a} (${He(i)})`:a}function PD(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(ld(e))}`}function YD(e,i){const a=pb(e),r=pb(i);if(!a||!r)return!1;for(let u=0;u<a.core.length;u+=1)if(a.core[u]!==r.core[u])return a.core[u]>r.core[u];return a.prerelease===r.prerelease?!1:a.prerelease?r.prerelease?a.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function pb(e){if(!e)return null;const i=ld(e).match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);return i?{core:[Number(i[1]),Number(i[2]),Number(i[3])],prerelease:i[4]??null}:null}function WD(e,i){const a=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&a.push({value:i,label:`${i} (unavailable)`}),a.length===0&&a.push({value:"",label:"Models unavailable"}),a}async function Op(e,i){const a=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await a.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
|
|
126
|
+
|
|
127
|
+
`);u=p.pop()??"";for(const g of p){const m=KD(g);m&&i(m)}}}function KD(e){const i=e.split(`
|
|
128
|
+
`),a=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!a||r.length===0)return null;const u=a.slice(7),c=r.join(`
|
|
129
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function XD(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const a=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return a?{text:a,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(p=i.params)==null?void 0:p.itemId}:null}function QD(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"?null:{itemId:a.id,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function ZD(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"||!a.text?null:{itemId:a.id,text:a.text,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function ps(e){var a,r,u,c;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const i=e.data;return i.method==="thread/status/changed"&&((r=(a=i.params)==null?void 0:a.status)==null?void 0:r.type)==="idle"?"done":i.method==="turn/completed"?(c=(u=i.params)==null?void 0:u.turn)!=null&&c.error?"error":"done":null}function ys(e){return e.length<=6?e:e.slice(0,6)}function _l(e){return e.slice(0,8)}function hb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function mb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function zp(e,...i){return i.includes(e)}function JD(e,i){const a=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(a)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function e_(e,i){const a=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(a)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function rh(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function t_(e,i){return`waiting ${Qc(e,i)}`}function Qc(e,i){const a=Date.parse(e.wakeAt);if(Number.isNaN(a))return"waiting";const r=Math.max(0,Math.ceil((a-i)/1e3));if(r<60)return`${r}s`;const u=Math.ceil(r/60);if(u<60)return`${u}m`;const c=Math.ceil(u/60);return c<24?`${c}h`:`${Math.ceil(c/24)}d`}function Gc(e,i=null,a=Date.now()){if(e==="waiting")return i?t_(i,a):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function gb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function n_(e){return e==="assistant"?"Seele":"You"}const i_=document.getElementById("root"),Cw=window.__seeleCodexRoot??Qk.createRoot(i_);window.__seeleCodexRoot=Cw;m_();Cw.render(s.jsx(_.StrictMode,{children:s.jsx(a_,{})}));function a_(){const[e,i]=_.useState(null),[a,r]=_.useState(null),[u,c]=_.useState(""),[d,p]=_.useState("admin"),[g,m]=_.useState(""),[b,x]=_.useState(!1),[j,w]=_.useState("");_.useEffect(()=>{yb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),_.useEffect(()=>{let N=!1,H=0;const $=async()=>{try{const ae=await Tw();if(N)return;r(ae),c(""),H=window.setTimeout($,ae.status==="authorized"&&ae.configurationReady&&ae.codexAccountsReady?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),H=window.setTimeout($,3e3)}},W=()=>{window.clearTimeout(H),$()};return window.addEventListener(Zp,W),$(),()=>{N=!0,window.clearTimeout(H),window.removeEventListener(Zp,W)}},[]),_.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),m(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Qp,N),()=>window.removeEventListener(Qp,N)},[]);async function T(N){N.preventDefault(),x(!0),w("");try{const H=await fetch(he("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!H.ok){w(H.status===401?"Incorrect username or password.":H.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}m(""),i(await yb())}catch{w("Unable to reach Seele.")}finally{x(!1)}}async function R(){await fetch(he("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const q=s_();if(q&&e&&(!e.enabled||e.authenticated)){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return N.role!=="admin"?s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-access-denied",children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Administrator access required"}),s.jsx("p",{children:"This page changes deployment authorization."}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("a",{href:Ah(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void R(),type:"button",children:"Sign out"})]})]})}):s.jsx(r_,{authorization:a,currentUser:N,onLogout:R})}if(!q&&a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(l_,{authorization:a});if(!e||!a&&!q)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(xA,{authEnabled:e.enabled,currentUser:N,onLogout:R})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:T,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>p(N.target.value),value:d})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>m(N.target.value),type:"password",value:g})]}),j?s.jsx("p",{className:"auth-error",role:"alert",children:j}):null,s.jsx("button",{disabled:b||!d||!g,type:"submit",children:b?"Signing in...":"Sign in"})]})]})})}function l_({authorization:e}){const i={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},a=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:i[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:a.title}),s.jsx("p",{className:"deployment-lead",children:a.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?sh(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex account revision"}),s.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,s.jsx("a",{className:"deployment-primary-link",href:o_(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function r_({authorization:e,currentUser:i,onLogout:a}){const[r,u]=_.useState([]),[c,d]=_.useState({}),[p,g]=_.useState(null),[m,b]=_.useState(!0),[x,j]=_.useState("");_.useEffect(()=>{let T=!1,R=0;const q=async()=>{try{const N=await u_();if(T)return;u(N),d(H=>Object.fromEntries(N.map($=>[$.deploymentId,H[$.deploymentId]??$.name]))),j("")}catch(N){T||j(Ve(N).message)}finally{T||(b(!1),R=window.setTimeout(q,5e3))}};return q(),()=>{T=!0,window.clearTimeout(R)}},[]);async function w(T,R){g(T),j("");try{const q=await c_(T,R);u(N=>N.map(H=>H.deploymentId===q.deploymentId?q:H)),d(N=>({...N,[q.deploymentId]:q.name}))}catch(q){j(Ve(q).message)}finally{g(null)}}return s.jsxs("main",{className:"deployment-admin-shell",children:[s.jsxs("header",{className:"deployment-admin-header",children:[s.jsxs("div",{children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Deployments"}),s.jsx("p",{children:"Authorize or revoke Seele instances connected to this cloud deployment."})]}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("span",{children:i.username}),s.jsx("a",{href:Ah(),children:"Open Seele"}),s.jsx("button",{onClick:()=>void a(),type:"button",children:"Sign out"})]})]}),s.jsxs("section",{className:"deployment-admin-summary",children:[s.jsxs("div",{children:[s.jsx("strong",{children:r.length}),s.jsx("span",{children:"Total"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="pending").length}),s.jsx("span",{children:"Pending"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="authorized").length}),s.jsx("span",{children:"Authorized"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="revoked").length}),s.jsx("span",{children:"Revoked"})]})]}),e?s.jsxs("p",{className:"deployment-cloud-identity",children:["This cloud: ",s.jsx("code",{children:e.deploymentId})]}):null,x?s.jsx("p",{className:"deployment-error",role:"alert",children:x}):null,m?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!m&&r.length===0?s.jsx("p",{className:"deployment-admin-empty",children:"No deployment has contacted this cloud yet."}):null,s.jsx("div",{className:"deployment-list",children:r.map(T=>{const R=p===T.deploymentId,q=c[T.deploymentId]??T.name;return s.jsxs("article",{className:"deployment-card",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("span",{className:`deployment-status is-${T.status}`,children:T.status}),s.jsx("h2",{children:T.name}),s.jsx("code",{children:T.deploymentId})]}),s.jsx("button",{className:T.status==="authorized"?"is-danger":"is-primary",disabled:R,onClick:()=>void w(T.deploymentId,{status:T.status==="authorized"?"revoked":"authorized"}),type:"button",children:R?"Saving...":T.status==="authorized"?"Revoke":"Authorize"})]}),s.jsxs("dl",{className:"deployment-card-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Version"}),s.jsx("dd",{children:T.version})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last seen"}),s.jsx("dd",{children:sh(T.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:sh(T.firstSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsx("dd",{children:T.appliedGlobalRevision})]})]}),s.jsxs("form",{className:"deployment-name-form",onSubmit:N=>{N.preventDefault(),w(T.deploymentId,{name:q})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:R,maxLength:80,onChange:N=>d(H=>({...H,[T.deploymentId]:N.target.value})),value:q})]}),s.jsx("button",{disabled:R||!q.trim()||q.trim()===T.name,type:"submit",children:"Save name"})]})]},T.deploymentId)})})]})}function s_(){const e=Ah("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function o_(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function sh(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Tw(){const e=await fetch(he("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function u_(){const e=he("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).deployments}async function c_(e,i){const a=he(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:a});return(await r.json()).deployment}async function yb(){const e=await fetch(he("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function d_(){const e=he("admin/users"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).users}async function f_(e){const i=he("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await Gt(a,{method:"POST",url:i});return(await a.json()).user}async function p_(e,i){const a=he(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:a});return(await r.json()).user}async function h_(e){const i=he(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Gt(a,{method:"DELETE",url:i})}function m_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return a.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Qp)),a.status===503&&r.includes("/api/")&&vr(),a},window.__seeleAuthFetchInstalled=!0}function vr(){window.dispatchEvent(new Event(Zp))}export{Ct as _,Zk as a,hj as b,bx as c,cj as f,xb as g,pj as h,ch as s,ij as w};
|