@seele00/seele 0.1.84 → 0.1.86
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/scripts/deploy/bootstrap.sh +5 -0
- package/scripts/deploy/seele.env.example +5 -0
- package/scripts/deploy/start.sh +6 -0
- package/web/dist/assets/{abnfDiagram-VRR7QNED-Cn82GDUS.js → abnfDiagram-VRR7QNED-DMqJzP9u.js} +1 -1
- package/web/dist/assets/{arc-tvzVPzI1.js → arc-B2TAPyGv.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Cug2O1nQ.js → architectureDiagram-ZJ3FMSHR-Cw4ti86V.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-BTY5v-bJ.js → blockDiagram-677ZJIJ3-Dtq3ywdh.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-BJNs5aP7.js → c4Diagram-LMCZKHZV-CBjRe38F.js} +1 -1
- package/web/dist/assets/channel-D_juRt5P.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-KUp4Sfig.js → chunk-2Q5K7J3B-BjaqZ7OO.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-jhUOt53y.js → chunk-32BRIVSS-_ylnkEkF.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-fbmjU875.js → chunk-5VM5RSS4-BvwojQhP.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-dLJ1kP4d.js → chunk-EX3LRPZG-D7YXISs3.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-BymZCx_g.js → chunk-JWPE2WC7-jza9PJE4.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-V5eq-FPV.js → chunk-MOJQB5TN-CHexuTld.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-CUZrQZic.js → chunk-RYQCIY6F-CEYMqMoB.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-DKtMKi_U.js → chunk-V7JOEXUC-g7EVRcWB.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-m7bLxESu.js → chunk-VR4S4FIN-RlKji34W.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-Bm8U0C_y.js → chunk-XXDRQBXY-BQPov4Cw.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-Cq04WK2y.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-Cq04WK2y.js +1 -0
- package/web/dist/assets/{core-DZprx5_4.js → core-CbFapvgm.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-CRol0mO8.js → cose-bilkent-JH36ORCC-TG3Jbicf.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-CduHc_GB.js → cynefin-VYW2F7L2-gibg0H7c.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-O4-pgQRf.js → cynefinDiagram-TSTJHNR4-CqzBaZo2.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-6RlGLc6K.js → dagre-VKFMJZFB-CCPtGra1.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-DwVefQ40.js → diagram-FQU43EPY-DU9fxNn3.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-uaeb9mN8.js → diagram-G47NLZAW-BJrszoyg.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-BA1gZXQp.js → diagram-NH7WQ7WH-D_49YugF.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-RiXBC9vL.js → diagram-OA4YK3LP-B_kPSNiQ.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-C5XA4fXX.js → diagram-WEI45ONY-BBRxmN4y.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-DROC9QBd.js → ebnfDiagram-CCIWWBDH-B2xmIFhX.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-BkyyKzdB.js → erDiagram-Q63AITRT-CO43eYtm.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-BVVr-tA3.js → flowDiagram-23GEKE2U-Btdm3Nu_.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-BucvJsRK.js → ganttDiagram-NO4QXBWP-BHLTo5tr.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-CTWOvGF7.js → gitGraphDiagram-IHSO6WYX-CHdjdQC3.js} +1 -1
- package/web/dist/assets/index-C-TmlDHd.js +130 -0
- package/web/dist/assets/index-CRJhQRiY.css +1 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-DA64ocY1.js → infoDiagram-FWYZ7A6U-CTxnBO3L.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-SPklidfq.js → ishikawaDiagram-FXEZZL3T-lS6tr8Mj.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-WU_Zdtdz.js → journeyDiagram-5HDEW3XC-DZNxrVeQ.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-CgR-5gc1.js → kanban-definition-HUTT4EX6-DSAMaccu.js} +1 -1
- package/web/dist/assets/{linear-DHHRPNuH.js → linear-DKy9fpH0.js} +1 -1
- package/web/dist/assets/{mermaid.core-Cfkt_OK7.js → mermaid.core-CkzBAnkw.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-CyqJjiIC.js → mindmap-definition-LN4V7U3C-D8hez1ZN.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-fdl4s8s4.js → pegDiagram-2B236MQR-CVQE9rvE.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-Cd09hRaD.js → pieDiagram-ENE6RG2P-B48rxY9R.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-Dr4Pvd2O.js → quadrantDiagram-ABIIQ3AL-C83Lv0V6.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-ioTcW5MC.js → railroadDiagram-RFXS5EU6-ypZIYcgy.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-BMdn1GKi.js → requirementDiagram-TGXJPOKE-AEmzmVry.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-1eNINUr3.js → sankeyDiagram-HTMAVEWB-D-Qv4K3o.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-Dn3Dnu3a.js → sequenceDiagram-DBY2YBRQ-29FZfl0b.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CKxtjR5U.js → sizeCapture-X5ZJPWSS-COuJJtFu.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-CY-CAphh.js → stateDiagram-2N3HPSRC-Ca1MS4Dv.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-D0c-8pfH.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-BCIdl1Px.js → swimlanes-5IMT3BWC-BzxrP6jI.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-kwnP6dfR.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-Dgx4LDKM.js → timeline-definition-FHXFAJF6-D0FvNpwj.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-CwFN0xIC.js → vennDiagram-L72KCM5P-BOgJm1Ud.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-C52Q_jPT.js → wardleyDiagram-EHGQE667-q2Aj3Dbf.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-Bw9uUEwU.js → xychartDiagram-FW5EYKEG-DTUtfGti.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-CVJCW_yj.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-CQb4XPro.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-CQb4XPro.js +0 -1
- package/web/dist/assets/index-BFFpeTtD.css +0 -1
- package/web/dist/assets/index-DgrjxWzj.js +0 -130
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CvbeoI99.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-BOf8ibsG.js +0 -8
|
@@ -0,0 +1,130 @@
|
|
|
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 Nk=Object.defineProperty;var _k=(e,i,a)=>i in e?Nk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var bc=(e,i,a)=>_k(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 Dk="modulepreload",Rk=function(e,i){return new URL(e,i).href},vy={},jt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(y=>Promise.resolve(y).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=Rk(b,r),b in vy)return;vy[b]=!0;const y=b.endsWith(".css"),j=y?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const z=p[R];if(z.href===b&&(!y||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const T=document.createElement("link");if(T.rel=y?"stylesheet":Dk,y||(T.as="script"),T.crossOrigin="",T.href=b,h&&T.setAttribute("nonce",h),document.head.appendChild(T),y)return new Promise((R,z)=>{T.addEventListener("load",R),T.addEventListener("error",()=>z(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 db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qf={exports:{}},wo={};/**
|
|
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 wy;function Mk(){if(wy)return wo;wy=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 wo.Fragment=i,wo.jsx=a,wo.jsxs=a,wo}var ky;function Ok(){return ky||(ky=1,qf.exports=Mk()),qf.exports}var s=Ok(),Hf={exports:{}},qe={};/**
|
|
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 jy;function zk(){if(jy)return qe;jy=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"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=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,z={};function N(A,L,S){this.props=A,this.context=L,this.refs=z,this.updater=S||T}N.prototype.isReactComponent={},N.prototype.setState=function(A,L){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,L,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function G(){}G.prototype=N.prototype;function B(A,L,S){this.props=A,this.context=L,this.refs=z,this.updater=S||T}var P=B.prototype=new G;P.constructor=B,R(P,N.prototype),P.isPureReactComponent=!0;var se=Array.isArray;function _(){}var X={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function J(A,L,S){var K=S.ref;return{$$typeof:e,type:A,key:L,ref:K!==void 0?K:null,props:S}}function I(A,L){return J(A.type,L,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ce(A){var L={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(S){return L[S]})}var Te=/\/+/g;function ge(A,L){return typeof A=="object"&&A!==null&&A.key!=null?ce(""+A.key):L.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(_,_):(A.status="pending",A.then(function(L){A.status==="pending"&&(A.status="fulfilled",A.value=L)},function(L){A.status==="pending"&&(A.status="rejected",A.reason=L)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,L,S,K,he){var Z=typeof A;(Z==="undefined"||Z==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(Z){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,V(xe(A._payload),L,S,K,he)}}if(xe)return he=he(A),xe=K===""?"."+ge(A,0):K,se(he)?(S="",xe!=null&&(S=xe.replace(Te,"$&/")+"/"),V(he,L,S,"",function(Ot){return Ot})):he!=null&&(te(he)&&(he=I(he,S+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(Te,"$&/")+"/")+xe)),L.push(he)),1;xe=0;var Le=K===""?".":K+":";if(se(A))for(var Xe=0;Xe<A.length;Xe++)K=A[Xe],Z=Le+ge(K,Xe),xe+=V(K,L,S,Z,he);else if(Xe=w(A),typeof Xe=="function")for(A=Xe.call(A),Xe=0;!(K=A.next()).done;)K=K.value,Z=Le+ge(K,Xe++),xe+=V(K,L,S,Z,he);else if(Z==="object"){if(typeof A.then=="function")return V(ue(A),L,S,K,he);throw L=String(A),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,L,S){if(A==null)return A;var K=[],he=0;return V(A,K,"","",function(Z){return L.call(S,Z,he++)}),K}function ye(A){if(A._status===-1){var L=A._result;L=L(),L.then(function(S){(A._status===0||A._status===-1)&&(A._status=1,A._result=S)},function(S){(A._status===0||A._status===-1)&&(A._status=2,A._result=S)}),A._status===-1&&(A._status=0,A._result=L)}if(A._status===1)return A._result.default;throw A._result}var De=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=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(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:oe,forEach:function(A,L,S){oe(A,function(){L.apply(this,arguments)},S)},count:function(A){var L=0;return oe(A,function(){L++}),L},toArray:function(A){return oe(A,function(L){return L})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return qe.Activity=y,qe.Children=O,qe.Component=N,qe.Fragment=a,qe.Profiler=u,qe.PureComponent=B,qe.StrictMode=r,qe.Suspense=g,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,qe.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.H.useMemoCache(A)}},qe.cache=function(A){return function(){return A.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(A,L,S){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var K=R({},A.props),he=A.key;if(L!=null)for(Z in L.key!==void 0&&(he=""+L.key),L)!le.call(L,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&L.ref===void 0||(K[Z]=L[Z]);var Z=arguments.length-2;if(Z===1)K.children=S;else if(1<Z){for(var xe=Array(Z),Le=0;Le<Z;Le++)xe[Le]=arguments[Le+2];K.children=xe}return J(A.type,he,K)},qe.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},qe.createElement=function(A,L,S){var K,he={},Z=null;if(L!=null)for(K in L.key!==void 0&&(Z=""+L.key),L)le.call(L,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(he[K]=L[K]);var xe=arguments.length-2;if(xe===1)he.children=S;else if(1<xe){for(var Le=Array(xe),Xe=0;Xe<xe;Xe++)Le[Xe]=arguments[Xe+2];he.children=Le}if(A&&A.defaultProps)for(K in xe=A.defaultProps,xe)he[K]===void 0&&(he[K]=xe[K]);return J(A,Z,he)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(A){return{$$typeof:p,render:A}},qe.isValidElement=te,qe.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:ye}},qe.memo=function(A,L){return{$$typeof:h,type:A,compare:L===void 0?null:L}},qe.startTransition=function(A){var L=X.T,S={};X.T=S;try{var K=A(),he=X.S;he!==null&&he(S,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(_,De)}catch(Z){De(Z)}finally{L!==null&&S.types!==null&&(L.types=S.types),X.T=L}},qe.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},qe.use=function(A){return X.H.use(A)},qe.useActionState=function(A,L,S){return X.H.useActionState(A,L,S)},qe.useCallback=function(A,L){return X.H.useCallback(A,L)},qe.useContext=function(A){return X.H.useContext(A)},qe.useDebugValue=function(){},qe.useDeferredValue=function(A,L){return X.H.useDeferredValue(A,L)},qe.useEffect=function(A,L){return X.H.useEffect(A,L)},qe.useEffectEvent=function(A){return X.H.useEffectEvent(A)},qe.useId=function(){return X.H.useId()},qe.useImperativeHandle=function(A,L,S){return X.H.useImperativeHandle(A,L,S)},qe.useInsertionEffect=function(A,L){return X.H.useInsertionEffect(A,L)},qe.useLayoutEffect=function(A,L){return X.H.useLayoutEffect(A,L)},qe.useMemo=function(A,L){return X.H.useMemo(A,L)},qe.useOptimistic=function(A,L){return X.H.useOptimistic(A,L)},qe.useReducer=function(A,L,S){return X.H.useReducer(A,L,S)},qe.useRef=function(A){return X.H.useRef(A)},qe.useState=function(A){return X.H.useState(A)},qe.useSyncExternalStore=function(A,L,S){return X.H.useSyncExternalStore(A,L,S)},qe.useTransition=function(){return X.H.useTransition()},qe.version="19.2.7",qe}var Sy;function tm(){return Sy||(Sy=1,Hf.exports=zk()),Hf.exports}var D=tm(),$f={exports:{}},ko={},Gf={exports:{}},Vf={};/**
|
|
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 Cy;function Lk(){return Cy||(Cy=1,(function(e){function i(V,oe){var ye=V.length;V.push(oe);e:for(;0<ye;){var De=ye-1>>>1,O=V[De];if(0<u(O,oe))V[De]=oe,V[ye]=O,ye=De;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],ye=V.pop();if(ye!==oe){V[0]=ye;e:for(var De=0,O=V.length,A=O>>>1;De<A;){var L=2*(De+1)-1,S=V[L],K=L+1,he=V[K];if(0>u(S,ye))K<O&&0>u(he,S)?(V[De]=he,V[K]=ye,De=K):(V[De]=S,V[L]=ye,De=L);else if(K<O&&0>u(he,ye))V[De]=he,V[K]=ye,De=K;else break e}}return oe}function u(V,oe){var ye=V.sortIndex-oe.sortIndex;return ye!==0?ye: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=[],h=[],b=1,y=null,j=3,w=!1,T=!1,R=!1,z=!1,N=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function P(V){for(var oe=a(h);oe!==null;){if(oe.callback===null)r(h);else if(oe.startTime<=V)r(h),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=a(h)}}function se(V){if(R=!1,P(V),!T)if(a(g)!==null)T=!0,_||(_=!0,ce());else{var oe=a(h);oe!==null&&ue(se,oe.startTime-V)}}var _=!1,X=-1,le=5,J=-1;function I(){return z?!0:!(e.unstable_now()-J<le)}function te(){if(z=!1,_){var V=e.unstable_now();J=V;var oe=!0;try{e:{T=!1,R&&(R=!1,G(X),X=-1),w=!0;var ye=j;try{t:{for(P(V),y=a(g);y!==null&&!(y.expirationTime>V&&I());){var De=y.callback;if(typeof De=="function"){y.callback=null,j=y.priorityLevel;var O=De(y.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){y.callback=O,P(V),oe=!0;break t}y===a(g)&&r(g),P(V)}else r(g);y=a(g)}if(y!==null)oe=!0;else{var A=a(h);A!==null&&ue(se,A.startTime-V),oe=!1}}break e}finally{y=null,j=ye,w=!1}oe=void 0}}finally{oe?ce():_=!1}}}var ce;if(typeof B=="function")ce=function(){B(te)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,ge=Te.port2;Te.port1.onmessage=te,ce=function(){ge.postMessage(null)}}else ce=function(){N(te,0)};function ue(V,oe){X=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"):le=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 ye=j;j=oe;try{return V()}finally{j=ye}},e.unstable_requestPaint=function(){z=!0},e.unstable_runWithPriority=function(V,oe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ye=j;j=V;try{return oe()}finally{j=ye}},e.unstable_scheduleCallback=function(V,oe,ye){var De=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,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=ye+O,V={id:b++,callback:oe,priorityLevel:V,startTime:ye,expirationTime:O,sortIndex:-1},ye>De?(V.sortIndex=ye,i(h,V),a(g)===null&&V===a(h)&&(R?(G(X),X=-1):R=!0,ue(se,ye-De))):(V.sortIndex=O,i(g,V),T||w||(T=!0,_||(_=!0,ce()))),V},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(V){var oe=j;return function(){var ye=j;j=oe;try{return V.apply(this,arguments)}finally{j=ye}}}})(Vf)),Vf}var Ty;function Ik(){return Ty||(Ty=1,Gf.exports=Lk()),Gf.exports}var Pf={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 Ey;function Uk(){if(Ey)return pn;Ey=1;var e=tm();function i(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+h+" 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,h,b){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:g,containerInfo:h,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(g,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return c(g,h,null,b)},pn.flushSync=function(g){var h=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=h,r.p=b,r.d.f()}},pn.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(g,h))},pn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},pn.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var b=h.as,y=p(b,h.crossOrigin),j=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?r.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:j,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:y,integrity:j,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},pn.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=p(h.as,h.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(g)},pn.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,y=p(b,h.crossOrigin);r.d.L(g,b,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},pn.preloadModule=function(g,h){if(typeof g=="string")if(h){var b=p(h.as,h.crossOrigin);r.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(g)},pn.requestFormReset=function(g){r.d.r(g)},pn.unstable_batchedUpdates=function(g,h){return g(h)},pn.useFormState=function(g,h,b){return d.H.useFormState(g,h,b)},pn.useFormStatus=function(){return d.H.useHostTransitionStatus()},pn.version="19.2.7",pn}var Ay;function Bk(){if(Ay)return Pf.exports;Ay=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(),Pf.exports=Uk(),Pf.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 Ny;function qk(){if(Ny)return ko;Ny=1;var e=Ik(),i=tm(),a=Bk();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 h(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 m=f.alternate;if(m===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return g(f),t;if(m===o)return g(f),n;m=m.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=m;else{for(var v=!1,E=f.child;E;){if(E===l){v=!0,l=f,o=m;break}if(E===o){v=!0,o=f,l=m;break}E=E.sibling}if(!v){for(E=m.child;E;){if(E===l){v=!0,l=m,o=f;break}if(E===o){v=!0,o=m,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 y=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),B=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ce(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Te=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case N:return"Profiler";case z:return"StrictMode";case se:return"Suspense";case _:return"SuspenseList";case J:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case B:return t.displayName||"Context";case G:return(t._context.displayName||"Context")+".Consumer";case P:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case le: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,ye={pending:!1,data:null,method:null,action:null},De=[],O=-1;function A(t){return{current:t}}function L(t){0>O||(t.current=De[O],De[O]=null,O--)}function S(t,n){O++,De[O]=t.current,t.current=n}var K=A(null),he=A(null),Z=A(null),xe=A(null);function Le(t,n){switch(S(Z,n),S(he,t),S(K,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Gg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Gg(n),t=Vg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(K),S(K,t)}function Xe(){L(K),L(he),L(Z)}function Ot(t){t.memoizedState!==null&&S(xe,t);var n=K.current,l=Vg(n,t.type);n!==l&&(S(he,t),S(K,l))}function Yt(t){he.current===t&&(L(K),L(he)),xe.current===t&&(L(xe),yo._currentValue=ye)}var Pe,Et;function Jt(t){if(Pe===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Pe=n&&n[1]||"",Et=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Pe+t+Et}var zt=!1;function ln(t,n){if(!t||zt)return"";zt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Q){var W=Q}Reflect.construct(t,[],re)}else{try{re.call()}catch(Q){W=Q}t.call(re.prototype)}}else{try{throw Error()}catch(Q){W=Q}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.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 m=o.DetermineComponentFrameRoot(),v=m[0],E=m[1];if(v&&E){var U=v.split(`
|
|
45
|
+
`),F=E.split(`
|
|
46
|
+
`);for(f=o=0;o<U.length&&!U[o].includes("DetermineComponentFrameRoot");)o++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(o===U.length||f===F.length)for(o=U.length-1,f=F.length-1;1<=o&&0<=f&&U[o]!==F[f];)f--;for(;1<=o&&0<=f;o--,f--)if(U[o]!==F[f]){if(o!==1||f!==1)do if(o--,f--,0>f||U[o]!==F[f]){var ie=`
|
|
47
|
+
`+U[o].replace(" at new "," at ");return t.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",t.displayName)),ie}while(1<=o&&0<=f);break}}}finally{zt=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Jt(l):""}function ze(t,n){switch(t.tag){case 26:case 27:case 5:return Jt(t.type);case 16:return Jt("Lazy");case 13:return t.child!==n&&n!==null?Jt("Suspense Fallback"):Jt("Suspense");case 19:return Jt("SuspenseList");case 0:case 15:return ln(t.type,!1);case 11:return ln(t.type.render,!1);case 1:return ln(t.type,!0);case 31:return Jt("Activity");default:return""}}function wt(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 rn=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,hi=e.unstable_cancelCallback,gi=e.unstable_shouldYield,zi=e.unstable_requestPaint,Lt=e.unstable_now,_a=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Ne=e.unstable_LowPriority,Ie=e.unstable_IdlePriority,At=e.log,gn=e.unstable_setDisableYieldValue,tt=null,St=null;function sn(t){if(typeof At=="function"&&gn(t),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(tt,t)}catch{}}var st=Math.clz32?Math.clz32:Qc,Li=Math.log,Un=Math.LN2;function Qc(t){return t>>>=0,t===0?32:31-(Li(t)/Un|0)|0}var Al=256,Nl=262144,Da=4194304;function $t(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 yi(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,m=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~m,o!==0?f=$t(o):(v&=E,v!==0?f=$t(v):l||(l=E&~t,l!==0&&(f=$t(l))))):(E=o&~m,E!==0?f=$t(E):v!==0?f=$t(v):l||(l=o&~t,l!==0&&(f=$t(l)))),f===0?0:n!==0&&n!==f&&(n&m)===0&&(m=f&-f,l=n&-n,m>=l||m===32&&(l&4194048)!==0)?n:f}function ot(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function _l(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 Qo(){var t=Da;return Da<<=1,(Da&62914560)===0&&(Da=4194304),t}function la(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function Ra(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Dl(t,n,l,o,f,m){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,U=t.expirationTimes,F=t.hiddenUpdates;for(l=v&~l;0<l;){var ie=31-st(l),re=1<<ie;E[ie]=0,U[ie]=-1;var W=F[ie];if(W!==null)for(F[ie]=null,ie=0;ie<W.length;ie++){var Q=W[ie];Q!==null&&(Q.lane&=-536870913)}l&=~re}o!==0&&Zo(t,o,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(v&~n))}function Zo(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-st(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function os(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-st(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function Jo(t,n){var l=n&-n;return l=(l&42)!==0?1:fr(l),(l&(t.suspendedLanes|n))!==0?0:l}function fr(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 us(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function pr(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:py(t.type))}function eu(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var kn=Math.random().toString(36).slice(2),bt="__reactFiber$"+kn,Nt="__reactProps$"+kn,Bn="__reactContainer$"+kn,Ii="__reactEvents$"+kn,cs="__reactListeners$"+kn,mr="__reactHandles$"+kn,tu="__reactResources$"+kn,xi="__reactMarker$"+kn;function Rl(t){delete t[bt],delete t[Nt],delete t[Ii],delete t[cs],delete t[mr]}function Ui(t){var n=t[bt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Bn]||l[bt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Qg(t);t!==null;){if(l=t[bt])return l;t=Qg(t)}return n}t=l,l=t.parentNode}return null}function Bi(t){if(t=t[bt]||t[Bn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ra(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Ma(t){var n=t[tu];return n||(n=t[tu]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function _t(t){t[xi]=!0}var bi=new Set,hr={};function qi(t,n){Oa(t,n),Oa(t+"Capture",n)}function Oa(t,n){for(hr[t]=n,t=0;t<n.length;t++)bi.add(n[t])}var Zc=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]*$"),sa={},nu={};function iu(t){return rn.call(nu,t)?!0:rn.call(sa,t)?!1:Zc.test(t)?nu[t]=!0:(sa[t]=!0,!1)}function qn(t,n,l){if(iu(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 ei(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 vi(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 Dt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function za(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function au(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,m=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,m.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 Hn(t){if(!t._valueTracker){var n=za(t)?"checked":"value";t._valueTracker=au(t,n,""+t[n])}}function ti(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=za(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function ni(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 lu=/[\n"\\]/g;function Ft(t){return t.replace(lu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function gr(t,n,l,o,f,m,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=""+Dt(n)):t.value!==""+Dt(n)&&(t.value=""+Dt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?ds(t,v,Dt(n)):l!=null?ds(t,v,Dt(l)):o!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+Dt(E):t.removeAttribute("name")}function La(t,n,l,o,f,m,v,E){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),n!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){Hn(t);return}l=l!=null?""+Dt(l):"",n=n!=null?""+Dt(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),Hn(t)}function ds(t,n,l){n==="number"&&ni(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function wi(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=""+Dt(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 Ia(t,n,l){if(n!=null&&(n=""+Dt(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+Dt(l):""}function yr(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=Dt(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),Hn(t)}function Hi(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var ru=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 Ml(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||ru.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function $n(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&&Ml(t,f,o)}else for(var m in n)n.hasOwnProperty(m)&&Ml(t,m,n[m])}function ii(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 fs=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"]]),Ol=/^[\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 Ol.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Gn(){}var ps=null;function zl(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var oa=null,Ba=null;function $i(t){var n=Bi(t);if(n&&(t=n.stateNode)){var l=t[Nt]||null;e:switch(t=n.stateNode,n.type){case"input":if(gr(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="'+Ft(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Nt]||null;if(!f)throw Error(r(90));gr(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&&ti(o)}break e;case"textarea":Ia(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&wi(t,!!l.multiple,n,!1)}}}var ms=!1;function hs(t,n,l){if(ms)return t(n,l);ms=!0;try{var o=t(n);return o}finally{if(ms=!1,(oa!==null||Ba!==null)&&(Qu(),oa&&(n=oa,t=Ba,Ba=oa=null,$i(n),t)))for(n=0;n<t.length;n++)$i(t[n])}}function Gi(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Nt]||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 ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ll=!1;if(ai)try{var li={};Object.defineProperty(li,"passive",{get:function(){Ll=!0}}),window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{Ll=!1}var Vn=null,xr=null,Vi=null;function br(){if(Vi)return Vi;var t,n=xr,l=n.length,o,f="value"in Vn?Vn.value:Vn.textContent,m=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[m-o];o++);return Vi=f.slice(t,1<o?1-o:void 0)}function qa(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 Ha(){return!0}function gs(){return!1}function en(t){function n(l,o,f,m,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=m,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(l=t[E],this[E]=l?l(m):m[E]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ha:gs,this.isPropagationStopped=gs,this}return y(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=Ha)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ha)},persist:function(){},isPersistent:Ha}),n}var Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=en(Pi),on=y({},Pi,{view:0,detail:0}),un=en(on),$a,Ga,ki,ji=y({},on,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hl,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!==ki&&(ki&&t.type==="mousemove"?($a=t.screenX-ki.screenX,Ga=t.screenY-ki.screenY):Ga=$a=0,ki=t),$a)},movementY:function(t){return"movementY"in t?t.movementY:Ga}}),Il=en(ji),vr=y({},ji,{dataTransfer:0}),ys=en(vr),xs=y({},on,{relatedTarget:0}),Ee=en(xs),su=y({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0}),Si=en(su),Wt=y({},Pi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),bs=en(Wt),Ul=y({},Pi,{data:0}),nt=en(Ul),Va={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wr={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"},Bl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ql(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Bl[t])?!!n[t]:!1}function Hl(){return ql}var kr=y({},on,{key:function(t){if(t.key){var n=Va[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=qa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wr[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hl,charCode:function(t){return t.type==="keypress"?qa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?qa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Jc=en(kr),ed=y({},ji,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pa=en(ed),ou=y({},on,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hl}),vs=en(ou),ws=y({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ks=en(ws),js=y({},ji,{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}),jr=en(js),td=y({},Pi,{newState:0,oldState:0}),$l=en(td),nd=[9,13,27,32],Ss=ai&&"CompositionEvent"in window,Gl=null;ai&&"documentMode"in document&&(Gl=document.documentMode);var Cs=ai&&"TextEvent"in window&&!Gl,Yi=ai&&(!Ss||Gl&&8<Gl&&11>=Gl),Ya=" ",je=!1;function uu(t,n){switch(t){case"keyup":return nd.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cn(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fa=!1;function id(t,n){switch(t){case"compositionend":return cn(n);case"keypress":return n.which!==32?null:(je=!0,Ya);case"textInput":return t=n.data,t===Ya&&je?null:t;default:return null}}function Sr(t,n){if(Fa)return t==="compositionend"||!Ss&&uu(t,n)?(t=br(),Vi=xr=Vn=null,Fa=!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 Yi&&n.locale!=="ko"?null:n.data;default:return null}}var ad={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 Ts(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!ad[t.type]:n==="textarea"}function Cr(t,n,l,o){oa?Ba?Ba.push(o):Ba=[o]:oa=o,n=ac(n,"onChange"),0<n.length&&(l=new Pn("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Vl=null,Fi=null;function Es(t){Ig(t,0)}function Wa(t){var n=ra(t);if(ti(n))return t}function cu(t,n){if(t==="change")return n}var Tr=!1;if(ai){var As;if(ai){var Ns="oninput"in document;if(!Ns){var Er=document.createElement("div");Er.setAttribute("oninput","return;"),Ns=typeof Er.oninput=="function"}As=Ns}else As=!1;Tr=As&&(!document.documentMode||9<document.documentMode)}function Ar(){Vl&&(Vl.detachEvent("onpropertychange",du),Fi=Vl=null)}function du(t){if(t.propertyName==="value"&&Wa(Fi)){var n=[];Cr(n,Fi,t,zl(t)),hs(Es,n)}}function ld(t,n,l){t==="focusin"?(Ar(),Vl=n,Fi=l,Vl.attachEvent("onpropertychange",du)):t==="focusout"&&Ar()}function fu(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Wa(Fi)}function rd(t,n){if(t==="click")return Wa(n)}function sd(t,n){if(t==="input"||t==="change")return Wa(n)}function od(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var yn=typeof Object.is=="function"?Object.is:od;function Pl(t,n){if(yn(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(!rn.call(n,f)||!yn(t[f],n[f]))return!1}return!0}function pu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function mu(t,n){var l=pu(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=pu(l)}}function hu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?hu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function gu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=ni(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=ni(t.document)}return n}function _s(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 ud=ai&&"documentMode"in document&&11>=document.documentMode,Ka=null,Ds=null,Yl=null,Rs=!1;function yu(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Rs||Ka==null||Ka!==ni(o)||(o=Ka,"selectionStart"in o&&_s(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}),Yl&&Pl(Yl,o)||(Yl=o,o=ac(Ds,"onSelect"),0<o.length&&(n=new Pn("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=Ka)))}function ua(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Xa={animationend:ua("Animation","AnimationEnd"),animationiteration:ua("Animation","AnimationIteration"),animationstart:ua("Animation","AnimationStart"),transitionrun:ua("Transition","TransitionRun"),transitionstart:ua("Transition","TransitionStart"),transitioncancel:ua("Transition","TransitionCancel"),transitionend:ua("Transition","TransitionEnd")},Nr={},ri={};ai&&(ri=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function Ci(t){if(Nr[t])return Nr[t];if(!Xa[t])return t;var n=Xa[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in ri)return Nr[t]=n[l];return t}var Ms=Ci("animationend"),Qa=Ci("animationiteration"),Wi=Ci("animationstart"),cd=Ci("transitionrun"),dd=Ci("transitionstart"),fd=Ci("transitioncancel"),xu=Ci("transitionend"),bu=new Map,Os="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(" ");Os.push("scrollEnd");function jn(t,n){bu.set(t,n),qi(n,[t])}var Fl=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)},Sn=[],Za=0,zs=0;function Ti(){for(var t=Za,n=zs=Za=0;n<t;){var l=Sn[n];Sn[n++]=null;var o=Sn[n];Sn[n++]=null;var f=Sn[n];Sn[n++]=null;var m=Sn[n];if(Sn[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}m!==0&&Is(l,f,m)}}function ca(t,n,l,o){Sn[Za++]=t,Sn[Za++]=n,Sn[Za++]=l,Sn[Za++]=o,zs|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Ls(t,n,l,o){return ca(t,n,l,o),_r(t)}function da(t,n){return ca(t,null,null,n),_r(t)}function Is(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,m=t.return;m!==null;)m.childLanes|=l,o=m.alternate,o!==null&&(o.childLanes|=l),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&n!==null&&(f=31-st(l),t=m.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),m):null}function _r(t){if(50<uo)throw uo=0,cf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var fa={};function pd(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 xn(t,n,l,o){return new pd(t,n,l,o)}function Us(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ei(t,n){var l=t.alternate;return l===null?(l=xn(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 vu(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 Dr(t,n,l,o,f,m){var v=0;if(o=t,typeof t=="function")Us(t)&&(v=1);else if(typeof t=="string")v=yk(t,l,K.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case J:return t=xn(31,l,n,f),t.elementType=J,t.lanes=m,t;case R:return pa(l.children,f,m,n);case z:v=8,f|=24;break;case N:return t=xn(12,l,n,f|2),t.elementType=N,t.lanes=m,t;case se:return t=xn(13,l,n,f),t.elementType=se,t.lanes=m,t;case _:return t=xn(19,l,n,f),t.elementType=_,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case B:v=10;break e;case G:v=9;break e;case P:v=11;break e;case X:v=14;break e;case le:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=xn(v,l,n,f),n.elementType=t,n.type=o,n.lanes=m,n}function pa(t,n,l,o){return t=xn(7,t,o,n),t.lanes=l,t}function Bs(t,n,l){return t=xn(6,t,null,n),t.lanes=l,t}function wu(t){var n=xn(18,null,null,0);return n.stateNode=t,n}function qs(t,n,l){return n=xn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var ku=new WeakMap;function Cn(t,n){if(typeof t=="object"&&t!==null){var l=ku.get(t);return l!==void 0?l:(n={value:t,source:n,stack:wt(n)},ku.set(t,n),n)}return{value:t,source:n,stack:wt(n)}}var Ja=[],Ai=0,Rr=null,ma=0,Tn=[],En=0,Yn=null,Kt=1,An="";function si(t,n){Ja[Ai++]=ma,Ja[Ai++]=Rr,Rr=t,ma=n}function Mr(t,n,l){Tn[En++]=Kt,Tn[En++]=An,Tn[En++]=Yn,Yn=t;var o=Kt;t=An;var f=32-st(o)-1;o&=~(1<<f),l+=1;var m=32-st(n)+f;if(30<m){var v=f-f%5;m=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Kt=1<<32-st(n)+f|l<<f|o,An=m+t}else Kt=1<<m|l<<f|o,An=t}function Or(t){t.return!==null&&(si(t,1),Mr(t,1,0))}function el(t){for(;t===Rr;)Rr=Ja[--Ai],Ja[Ai]=null,ma=Ja[--Ai],Ja[Ai]=null;for(;t===Yn;)Yn=Tn[--En],Tn[En]=null,An=Tn[--En],Tn[En]=null,Kt=Tn[--En],Tn[En]=null}function ju(t,n){Tn[En++]=Kt,Tn[En++]=An,Tn[En++]=Yn,Kt=n.id,An=n.overflow,Yn=t}var Gt=null,mt=null,Ye=!1,Ni=null,Xt=!1,Hs=Error(r(519));function Nn(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw it(Cn(n,t)),Hs}function tl(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[bt]=t,n[Nt]=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<fo.length;l++)We(fo[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),yr(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||Hg(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=Gn),n=!0):n=!1,n||Nn(t,!0)}function nl(t){for(Gt=t.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:Xt=!1;return;case 27:case 3:Xt=!0;return;default:Gt=Gt.return}}function il(t){if(t!==Gt)return!1;if(!Ye)return nl(t),Ye=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Cf(t.type,t.memoizedProps)),l=!l),l&&mt&&Nn(t),nl(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Xg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Xg(t)}else n===27?(n=mt,yl(t.type)?(t=_f,_f=null,mt=t):mt=n):mt=Gt?di(t.stateNode.nextSibling):null;return!0}function ha(){mt=Gt=null,Ye=!1}function $s(){var t=Ni;return t!==null&&(Mn===null?Mn=t:Mn.push.apply(Mn,t),Ni=null),t}function it(t){Ni===null?Ni=[t]:Ni.push(t)}var Ki=A(null),Qt=null,_i=null;function dn(t,n,l){S(Ki,n._currentValue),n._currentValue=l}function Di(t){t._currentValue=Ki.current,L(Ki)}function Gs(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 Vs(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var v=f.child;m=m.firstContext;e:for(;m!==null;){var E=m;m=f;for(var U=0;U<n.length;U++)if(E.context===n[U]){m.lanes|=l,E=m.alternate,E!==null&&(E.lanes|=l),Gs(m.return,l,t),o||(v=null);break e}m=E.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,m=v.alternate,m!==null&&(m.lanes|=l),Gs(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 Xi(t,n,l,o){t=null;for(var f=n,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!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;yn(f.pendingProps.value,v.value)||(t!==null?t.push(E):t=[E])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(yo):t=[yo])}f=f.return}t!==null&&Vs(n,t,l,o),n.flags|=262144}function zr(t){for(t=t.firstContext;t!==null;){if(!yn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ga(t){Qt=t,_i=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Vt(t){return Ps(Qt,t)}function Wl(t,n){return Qt===null&&ga(t),Ps(t,n)}function Ps(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},_i===null){if(t===null)throw Error(r(308));_i=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else _i=_i.next=n;return l}var Su=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()})}},Cu=e.unstable_scheduleCallback,x=e.unstable_NormalPriority,k={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function C(){return{controller:new Su,data:new Map,refCount:0}}function M(t){t.refCount--,t.refCount===0&&Cu(x,function(){t.controller.abort()})}var q=null,ee=0,be=0,Ue=null;function Ae(t,n){if(q===null){var l=q=[];ee=0,be=gf(),Ue={status:"pending",value:void 0,then:function(o){l.push(o)}}}return ee++,n.then(Se,Se),n}function Se(){if(--ee===0&&q!==null){Ue!==null&&(Ue.status="fulfilled");var t=q;q=null,be=0,Ue=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function tn(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 kt=V.S;V.S=function(t,n){dg=Lt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Ae(t,n),kt!==null&&kt(t,n)};var oi=A(null);function fn(){var t=oi.current;return t!==null?t:ht.pooledCache}function ui(t,n){n===null?S(oi,oi.current):S(oi,n.pool)}function al(){var t=fn();return t===null?null:{parent:k._currentValue,pool:t}}var Qi=Error(r(460)),md=Error(r(474)),Tu=Error(r(542)),Eu={then:function(){}};function _m(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Dm(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Gn,Gn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Mm(t),t;default:if(typeof n.status=="string")n.then(Gn,Gn);else{if(t=ht,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,Mm(t),t}throw Xl=n,Qi}}function Kl(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Xl=l,Qi):l}}var Xl=null;function Rm(){if(Xl===null)throw Error(r(459));var t=Xl;return Xl=null,t}function Mm(t){if(t===Qi||t===Tu)throw Error(r(483))}var Lr=null,Ys=0;function Au(t){var n=Ys;return Ys+=1,Lr===null&&(Lr=[]),Dm(Lr,t,n)}function Fs(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Nu(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 Om(t){function n($,H){if(t){var Y=$.deletions;Y===null?($.deletions=[H],$.flags|=16):Y.push(H)}}function l($,H){if(!t)return null;for(;H!==null;)n($,H),H=H.sibling;return null}function o($){for(var H=new Map;$!==null;)$.key!==null?H.set($.key,$):H.set($.index,$),$=$.sibling;return H}function f($,H){return $=Ei($,H),$.index=0,$.sibling=null,$}function m($,H,Y){return $.index=Y,t?(Y=$.alternate,Y!==null?(Y=Y.index,Y<H?($.flags|=67108866,H):Y):($.flags|=67108866,H)):($.flags|=1048576,H)}function v($){return t&&$.alternate===null&&($.flags|=67108866),$}function E($,H,Y,ae){return H===null||H.tag!==6?(H=Bs(Y,$.mode,ae),H.return=$,H):(H=f(H,Y),H.return=$,H)}function U($,H,Y,ae){var _e=Y.type;return _e===R?ie($,H,Y.props.children,ae,Y.key):H!==null&&(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===le&&Kl(_e)===H.type)?(H=f(H,Y.props),Fs(H,Y),H.return=$,H):(H=Dr(Y.type,Y.key,Y.props,null,$.mode,ae),Fs(H,Y),H.return=$,H)}function F($,H,Y,ae){return H===null||H.tag!==4||H.stateNode.containerInfo!==Y.containerInfo||H.stateNode.implementation!==Y.implementation?(H=qs(Y,$.mode,ae),H.return=$,H):(H=f(H,Y.children||[]),H.return=$,H)}function ie($,H,Y,ae,_e){return H===null||H.tag!==7?(H=pa(Y,$.mode,ae,_e),H.return=$,H):(H=f(H,Y),H.return=$,H)}function re($,H,Y){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Bs(""+H,$.mode,Y),H.return=$,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case w:return Y=Dr(H.type,H.key,H.props,null,$.mode,Y),Fs(Y,H),Y.return=$,Y;case T:return H=qs(H,$.mode,Y),H.return=$,H;case le:return H=Kl(H),re($,H,Y)}if(ue(H)||ce(H))return H=pa(H,$.mode,Y,null),H.return=$,H;if(typeof H.then=="function")return re($,Au(H),Y);if(H.$$typeof===B)return re($,Wl($,H),Y);Nu($,H)}return null}function W($,H,Y,ae){var _e=H!==null?H.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _e!==null?null:E($,H,""+Y,ae);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:return Y.key===_e?U($,H,Y,ae):null;case T:return Y.key===_e?F($,H,Y,ae):null;case le:return Y=Kl(Y),W($,H,Y,ae)}if(ue(Y)||ce(Y))return _e!==null?null:ie($,H,Y,ae,null);if(typeof Y.then=="function")return W($,H,Au(Y),ae);if(Y.$$typeof===B)return W($,H,Wl($,Y),ae);Nu($,Y)}return null}function Q($,H,Y,ae,_e){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return $=$.get(Y)||null,E(H,$,""+ae,_e);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return $=$.get(ae.key===null?Y:ae.key)||null,U(H,$,ae,_e);case T:return $=$.get(ae.key===null?Y:ae.key)||null,F(H,$,ae,_e);case le:return ae=Kl(ae),Q($,H,Y,ae,_e)}if(ue(ae)||ce(ae))return $=$.get(Y)||null,ie(H,$,ae,_e,null);if(typeof ae.then=="function")return Q($,H,Y,Au(ae),_e);if(ae.$$typeof===B)return Q($,H,Y,Wl(H,ae),_e);Nu(H,ae)}return null}function ve($,H,Y,ae){for(var _e=null,at=null,Ce=H,Ge=H=0,Ze=null;Ce!==null&&Ge<Y.length;Ge++){Ce.index>Ge?(Ze=Ce,Ce=null):Ze=Ce.sibling;var lt=W($,Ce,Y[Ge],ae);if(lt===null){Ce===null&&(Ce=Ze);break}t&&Ce&<.alternate===null&&n($,Ce),H=m(lt,H,Ge),at===null?_e=lt:at.sibling=lt,at=lt,Ce=Ze}if(Ge===Y.length)return l($,Ce),Ye&&si($,Ge),_e;if(Ce===null){for(;Ge<Y.length;Ge++)Ce=re($,Y[Ge],ae),Ce!==null&&(H=m(Ce,H,Ge),at===null?_e=Ce:at.sibling=Ce,at=Ce);return Ye&&si($,Ge),_e}for(Ce=o(Ce);Ge<Y.length;Ge++)Ze=Q(Ce,$,Ge,Y[Ge],ae),Ze!==null&&(t&&Ze.alternate!==null&&Ce.delete(Ze.key===null?Ge:Ze.key),H=m(Ze,H,Ge),at===null?_e=Ze:at.sibling=Ze,at=Ze);return t&&Ce.forEach(function(kl){return n($,kl)}),Ye&&si($,Ge),_e}function Oe($,H,Y,ae){if(Y==null)throw Error(r(151));for(var _e=null,at=null,Ce=H,Ge=H=0,Ze=null,lt=Y.next();Ce!==null&&!lt.done;Ge++,lt=Y.next()){Ce.index>Ge?(Ze=Ce,Ce=null):Ze=Ce.sibling;var kl=W($,Ce,lt.value,ae);if(kl===null){Ce===null&&(Ce=Ze);break}t&&Ce&&kl.alternate===null&&n($,Ce),H=m(kl,H,Ge),at===null?_e=kl:at.sibling=kl,at=kl,Ce=Ze}if(lt.done)return l($,Ce),Ye&&si($,Ge),_e;if(Ce===null){for(;!lt.done;Ge++,lt=Y.next())lt=re($,lt.value,ae),lt!==null&&(H=m(lt,H,Ge),at===null?_e=lt:at.sibling=lt,at=lt);return Ye&&si($,Ge),_e}for(Ce=o(Ce);!lt.done;Ge++,lt=Y.next())lt=Q(Ce,$,Ge,lt.value,ae),lt!==null&&(t&<.alternate!==null&&Ce.delete(lt.key===null?Ge:lt.key),H=m(lt,H,Ge),at===null?_e=lt:at.sibling=lt,at=lt);return t&&Ce.forEach(function(Ak){return n($,Ak)}),Ye&&si($,Ge),_e}function pt($,H,Y,ae){if(typeof Y=="object"&&Y!==null&&Y.type===R&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case w:e:{for(var _e=Y.key;H!==null;){if(H.key===_e){if(_e=Y.type,_e===R){if(H.tag===7){l($,H.sibling),ae=f(H,Y.props.children),ae.return=$,$=ae;break e}}else if(H.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===le&&Kl(_e)===H.type){l($,H.sibling),ae=f(H,Y.props),Fs(ae,Y),ae.return=$,$=ae;break e}l($,H);break}else n($,H);H=H.sibling}Y.type===R?(ae=pa(Y.props.children,$.mode,ae,Y.key),ae.return=$,$=ae):(ae=Dr(Y.type,Y.key,Y.props,null,$.mode,ae),Fs(ae,Y),ae.return=$,$=ae)}return v($);case T:e:{for(_e=Y.key;H!==null;){if(H.key===_e)if(H.tag===4&&H.stateNode.containerInfo===Y.containerInfo&&H.stateNode.implementation===Y.implementation){l($,H.sibling),ae=f(H,Y.children||[]),ae.return=$,$=ae;break e}else{l($,H);break}else n($,H);H=H.sibling}ae=qs(Y,$.mode,ae),ae.return=$,$=ae}return v($);case le:return Y=Kl(Y),pt($,H,Y,ae)}if(ue(Y))return ve($,H,Y,ae);if(ce(Y)){if(_e=ce(Y),typeof _e!="function")throw Error(r(150));return Y=_e.call(Y),Oe($,H,Y,ae)}if(typeof Y.then=="function")return pt($,H,Au(Y),ae);if(Y.$$typeof===B)return pt($,H,Wl($,Y),ae);Nu($,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,H!==null&&H.tag===6?(l($,H.sibling),ae=f(H,Y),ae.return=$,$=ae):(l($,H),ae=Bs(Y,$.mode,ae),ae.return=$,$=ae),v($)):l($,H)}return function($,H,Y,ae){try{Ys=0;var _e=pt($,H,Y,ae);return Lr=null,_e}catch(Ce){if(Ce===Qi||Ce===Tu)throw Ce;var at=xn(29,Ce,null,$.mode);return at.lanes=ae,at.return=$,at}finally{}}}var Ql=Om(!0),zm=Om(!1),ll=!1;function hd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gd(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 rl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function sl(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(rt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=_r(t),Is(t,null,l),n}return ca(t,o,n,l),_r(t)}function Ws(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,os(t,l)}}function yd(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=v:m=m.next=v,l=l.next}while(l!==null);m===null?f=m=n:m=m.next=n}else f=m=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:m,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 xd=!1;function Ks(){if(xd){var t=Ue;if(t!==null)throw t}}function Xs(t,n,l,o){xd=!1;var f=t.updateQueue;ll=!1;var m=f.firstBaseUpdate,v=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var U=E,F=U.next;U.next=null,v===null?m=F:v.next=F,v=U;var ie=t.alternate;ie!==null&&(ie=ie.updateQueue,E=ie.lastBaseUpdate,E!==v&&(E===null?ie.firstBaseUpdate=F:E.next=F,ie.lastBaseUpdate=U))}if(m!==null){var re=f.baseState;v=0,ie=F=U=null,E=m;do{var W=E.lane&-536870913,Q=W!==E.lane;if(Q?(Qe&W)===W:(o&W)===W){W!==0&&W===be&&(xd=!0),ie!==null&&(ie=ie.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ve=t,Oe=E;W=n;var pt=l;switch(Oe.tag){case 1:if(ve=Oe.payload,typeof ve=="function"){re=ve.call(pt,re,W);break e}re=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Oe.payload,W=typeof ve=="function"?ve.call(pt,re,W):ve,W==null)break e;re=y({},re,W);break e;case 2:ll=!0}}W=E.callback,W!==null&&(t.flags|=64,Q&&(t.flags|=8192),Q=f.callbacks,Q===null?f.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ie===null?(F=ie=Q,U=re):ie=ie.next=Q,v|=W;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;Q=E,E=Q.next,Q.next=null,f.lastBaseUpdate=Q,f.shared.pending=null}}while(!0);ie===null&&(U=re),f.baseState=U,f.firstBaseUpdate=F,f.lastBaseUpdate=ie,m===null&&(f.shared.lanes=0),fl|=v,t.lanes=v,t.memoizedState=re}}function Lm(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Im(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Lm(l[t],n)}var Ir=A(null),_u=A(0);function Um(t,n){t=Ca,S(_u,t),S(Ir,n),Ca=t|n.baseLanes}function bd(){S(_u,Ca),S(Ir,Ir.current)}function vd(){Ca=_u.current,L(Ir),L(_u)}var Fn=A(null),ci=null;function ol(t){var n=t.alternate;S(Rt,Rt.current&1),S(Fn,t),ci===null&&(n===null||Ir.current!==null||n.memoizedState!==null)&&(ci=t)}function wd(t){S(Rt,Rt.current),S(Fn,t),ci===null&&(ci=t)}function Bm(t){t.tag===22?(S(Rt,Rt.current),S(Fn,t),ci===null&&(ci=t)):ul()}function ul(){S(Rt,Rt.current),S(Fn,Fn.current)}function Wn(t){L(Fn),ci===t&&(ci=null),L(Rt)}var Rt=A(0);function Du(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Af(l)||Nf(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 ya=0,He=null,dt=null,It=null,Ru=!1,Ur=!1,Zl=!1,Mu=0,Qs=0,Br=null,xw=0;function Ct(){throw Error(r(321))}function kd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!yn(t[l],n[l]))return!1;return!0}function jd(t,n,l,o,f,m){return ya=m,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?kh:Ud,Zl=!1,m=l(o,f),Zl=!1,Ur&&(m=Hm(n,l,o,f)),qm(t),m}function qm(t){V.H=eo;var n=dt!==null&&dt.next!==null;if(ya=0,It=dt=He=null,Ru=!1,Qs=0,Br=null,n)throw Error(r(300));t===null||Ut||(t=t.dependencies,t!==null&&zr(t)&&(Ut=!0))}function Hm(t,n,l,o){He=t;var f=0;do{if(Ur&&(Br=null),Qs=0,Ur=!1,25<=f)throw Error(r(301));if(f+=1,It=dt=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}V.H=jh,m=n(l,o)}while(Ur);return m}function bw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?Zs(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(He.flags|=1024),n}function Sd(){var t=Mu!==0;return Mu=0,t}function Cd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Td(t){if(Ru){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Ru=!1}ya=0,It=dt=He=null,Ur=!1,Qs=Mu=0,Br=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?He.memoizedState=It=t:It=It.next=t,It}function Mt(){if(dt===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=It===null?He.memoizedState:It.next;if(n!==null)It=n,dt=t;else{if(t===null)throw He.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},It===null?He.memoizedState=It=t:It=It.next=t}return It}function Ou(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zs(t){var n=Qs;return Qs+=1,Br===null&&(Br=[]),t=Dm(Br,t,n),n=He,(It===null?n.memoizedState:It.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?kh:Ud),t}function zu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Zs(t);if(t.$$typeof===B)return Vt(t)}throw Error(r(438,String(t)))}function Ed(t){var n=null,l=He.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=He.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=Ou(),He.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]=I;return n.index++,l}function xa(t,n){return typeof n=="function"?n(t):n}function Lu(t){var n=Mt();return Ad(n,dt,t)}function Ad(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,m=o.pending;if(m!==null){if(f!==null){var v=f.next;f.next=m.next,m.next=v}n.baseQueue=f=m,o.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{n=f.next;var E=v=null,U=null,F=n,ie=!1;do{var re=F.lane&-536870913;if(re!==F.lane?(Qe&re)===re:(ya&re)===re){var W=F.revertLane;if(W===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),re===be&&(ie=!0);else if((ya&W)===W){F=F.next,W===be&&(ie=!0);continue}else re={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(E=U=re,v=m):U=U.next=re,He.lanes|=W,fl|=W;re=F.action,Zl&&l(m,re),m=F.hasEagerState?F.eagerState:l(m,re)}else W={lane:re,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},U===null?(E=U=W,v=m):U=U.next=W,He.lanes|=re,fl|=re;F=F.next}while(F!==null&&F!==n);if(U===null?v=m:U.next=E,!yn(m,t.memoizedState)&&(Ut=!0,ie&&(l=Ue,l!==null)))throw l;t.memoizedState=m,t.baseState=v,t.baseQueue=U,o.lastRenderedState=m}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Nd(t){var n=Mt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,m=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do m=t(m,v.action),v=v.next;while(v!==f);yn(m,n.memoizedState)||(Ut=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),l.lastRenderedState=m}return[m,o]}function $m(t,n,l){var o=He,f=Mt(),m=Ye;if(m){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!yn((dt||f).memoizedState,l);if(v&&(f.memoizedState=l,Ut=!0),f=f.queue,Rd(Pm.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||It!==null&&It.memoizedState.tag&1){if(o.flags|=2048,qr(9,{destroy:void 0},Vm.bind(null,o,f,l,n),null),ht===null)throw Error(r(349));m||(ya&127)!==0||Gm(o,n,l)}return l}function Gm(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=He.updateQueue,n===null?(n=Ou(),He.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Vm(t,n,l,o){n.value=l,n.getSnapshot=o,Ym(n)&&Fm(t)}function Pm(t,n,l){return l(function(){Ym(n)&&Fm(t)})}function Ym(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!yn(t,l)}catch{return!0}}function Fm(t){var n=da(t,2);n!==null&&On(n,t,2)}function _d(t){var n=bn();if(typeof t=="function"){var l=t;if(t=l(),Zl){sn(!0);try{l()}finally{sn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:t},n}function Wm(t,n,l,o){return t.baseState=l,Ad(t,dt,typeof o=="function"?o:xa)}function vw(t,n,l,o,f){if(Bu(t))throw Error(r(485));if(t=n.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){m.listeners.push(v)}};V.T!==null?l(!0):m.isTransition=!1,o(m),l=n.pending,l===null?(m.next=n.pending=m,Km(n,m)):(m.next=l.next,n.pending=l.next=m)}}function Km(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var m=V.T,v={};V.T=v;try{var E=l(f,o),U=V.S;U!==null&&U(v,E),Xm(t,n,E)}catch(F){Dd(t,n,F)}finally{m!==null&&v.types!==null&&(m.types=v.types),V.T=m}}else try{m=l(f,o),Xm(t,n,m)}catch(F){Dd(t,n,F)}}function Xm(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){Qm(t,n,o)},function(o){return Dd(t,n,o)}):Qm(t,n,l)}function Qm(t,n,l){n.status="fulfilled",n.value=l,Zm(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Km(t,l)))}function Dd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,Zm(n),n=n.next;while(n!==o)}t.action=null}function Zm(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Jm(t,n){return n}function eh(t,n){if(Ye){var l=ht.formState;if(l!==null){e:{var o=He;if(Ye){if(mt){t:{for(var f=mt,m=Xt;f.nodeType!==8;){if(!m){f=null;break t}if(f=di(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){mt=di(f.nextSibling),o=f.data==="F!";break e}}Nn(o)}o=!1}o&&(n=l[0])}}return l=bn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jm,lastRenderedState:n},l.queue=o,l=bh.bind(null,He,o),o.dispatch=l,o=_d(!1),m=Id.bind(null,He,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=vw.bind(null,He,f,m,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function th(t){var n=Mt();return nh(n,dt,t)}function nh(t,n,l){if(n=Ad(t,n,Jm)[0],t=Lu(xa)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Zs(n)}catch(v){throw v===Qi?Tu:v}else o=n;n=Mt();var f=n.queue,m=f.dispatch;return l!==n.memoizedState&&(He.flags|=2048,qr(9,{destroy:void 0},ww.bind(null,f,l),null)),[o,m,t]}function ww(t,n){t.action=n}function ih(t){var n=Mt(),l=dt;if(l!==null)return nh(n,l,t);Mt(),n=n.memoizedState,l=Mt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function qr(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=Ou(),He.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 ah(){return Mt().memoizedState}function Iu(t,n,l,o){var f=bn();He.flags|=t,f.memoizedState=qr(1|n,{destroy:void 0},l,o===void 0?null:o)}function Uu(t,n,l,o){var f=Mt();o=o===void 0?null:o;var m=f.memoizedState.inst;dt!==null&&o!==null&&kd(o,dt.memoizedState.deps)?f.memoizedState=qr(n,m,l,o):(He.flags|=t,f.memoizedState=qr(1|n,m,l,o))}function lh(t,n){Iu(8390656,8,t,n)}function Rd(t,n){Uu(2048,8,t,n)}function kw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=Ou(),He.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function rh(t){var n=Mt().memoizedState;return kw({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function sh(t,n){return Uu(4,2,t,n)}function oh(t,n){return Uu(4,4,t,n)}function uh(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 ch(t,n,l){l=l!=null?l.concat([t]):null,Uu(4,4,uh.bind(null,n,t),l)}function Md(){}function dh(t,n){var l=Mt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&kd(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function fh(t,n){var l=Mt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&kd(n,o[1]))return o[0];if(o=t(),Zl){sn(!0);try{t()}finally{sn(!1)}}return l.memoizedState=[o,n],o}function Od(t,n,l){return l===void 0||(ya&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=pg(),He.lanes|=t,fl|=t,l)}function ph(t,n,l,o){return yn(l,n)?l:Ir.current!==null?(t=Od(t,l,o),yn(t,n)||(Ut=!0),t):(ya&42)===0||(ya&1073741824)!==0&&(Qe&261930)===0?(Ut=!0,t.memoizedState=l):(t=pg(),He.lanes|=t,fl|=t,n)}function mh(t,n,l,o,f){var m=oe.p;oe.p=m!==0&&8>m?m:8;var v=V.T,E={};V.T=E,Id(t,!1,n,l);try{var U=f(),F=V.S;if(F!==null&&F(E,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=tn(U,o);Js(t,n,ie,Qn(t))}else Js(t,n,o,Qn(t))}catch(re){Js(t,n,{then:function(){},status:"rejected",reason:re},Qn())}finally{oe.p=m,v!==null&&E.types!==null&&(v.types=E.types),V.T=v}}function jw(){}function zd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=hh(t).queue;mh(t,f,n,ye,l===null?jw:function(){return gh(t),l(o)})}function hh(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:ye},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function gh(t){var n=hh(t);n.next===null&&(n=t.alternate.memoizedState),Js(t,n.next.queue,{},Qn())}function Ld(){return Vt(yo)}function yh(){return Mt().memoizedState}function xh(){return Mt().memoizedState}function Sw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Qn();t=rl(l);var o=sl(n,t,l);o!==null&&(On(o,n,l),Ws(o,n,l)),n={cache:C()},t.payload=n;return}n=n.return}}function Cw(t,n,l){var o=Qn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bu(t)?vh(n,l):(l=Ls(t,n,l,o),l!==null&&(On(l,t,o),wh(l,n,o)))}function bh(t,n,l){var o=Qn();Js(t,n,l,o)}function Js(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Bu(t))vh(n,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var v=n.lastRenderedState,E=m(v,l);if(f.hasEagerState=!0,f.eagerState=E,yn(E,v))return ca(t,n,f,0),ht===null&&Ti(),!1}catch{}finally{}if(l=Ls(t,n,f,o),l!==null)return On(l,t,o),wh(l,n,o),!0}return!1}function Id(t,n,l,o){if(o={lane:2,revertLane:gf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Bu(t)){if(n)throw Error(r(479))}else n=Ls(t,l,o,2),n!==null&&On(n,t,2)}function Bu(t){var n=t.alternate;return t===He||n!==null&&n===He}function vh(t,n){Ur=Ru=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function wh(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,os(t,l)}}var eo={readContext:Vt,use:zu,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};eo.useEffectEvent=Ct;var kh={readContext:Vt,use:zu,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Vt,useEffect:lh,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Iu(4194308,4,uh.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Iu(4194308,4,t,n)},useInsertionEffect:function(t,n){Iu(4,2,t,n)},useMemo:function(t,n){var l=bn();n=n===void 0?null:n;var o=t();if(Zl){sn(!0);try{t()}finally{sn(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=bn();if(l!==void 0){var f=l(n);if(Zl){sn(!0);try{l(n)}finally{sn(!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=Cw.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=_d(t);var n=t.queue,l=bh.bind(null,He,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Md,useDeferredValue:function(t,n){var l=bn();return Od(l,t,n)},useTransition:function(){var t=_d(!1);return t=mh.bind(null,He,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=He,f=bn();if(Ye){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),ht===null)throw Error(r(349));(Qe&127)!==0||Gm(o,n,l)}f.memoizedState=l;var m={value:l,getSnapshot:n};return f.queue=m,lh(Pm.bind(null,o,m,t),[t]),o.flags|=2048,qr(9,{destroy:void 0},Vm.bind(null,o,m,l,n),null),l},useId:function(){var t=bn(),n=ht.identifierPrefix;if(Ye){var l=An,o=Kt;l=(o&~(1<<32-st(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Mu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=xw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Ld,useFormState:eh,useActionState:eh,useOptimistic:function(t){var n=bn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Id.bind(null,He,!0,l),l.dispatch=n,[t,n]},useMemoCache:Ed,useCacheRefresh:function(){return bn().memoizedState=Sw.bind(null,He)},useEffectEvent:function(t){var n=bn(),l={impl:t};return n.memoizedState=l,function(){if((rt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Ud={readContext:Vt,use:zu,useCallback:dh,useContext:Vt,useEffect:Rd,useImperativeHandle:ch,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:fh,useReducer:Lu,useRef:ah,useState:function(){return Lu(xa)},useDebugValue:Md,useDeferredValue:function(t,n){var l=Mt();return ph(l,dt.memoizedState,t,n)},useTransition:function(){var t=Lu(xa)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:Zs(t),n]},useSyncExternalStore:$m,useId:yh,useHostTransitionStatus:Ld,useFormState:th,useActionState:th,useOptimistic:function(t,n){var l=Mt();return Wm(l,dt,t,n)},useMemoCache:Ed,useCacheRefresh:xh};Ud.useEffectEvent=rh;var jh={readContext:Vt,use:zu,useCallback:dh,useContext:Vt,useEffect:Rd,useImperativeHandle:ch,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:fh,useReducer:Nd,useRef:ah,useState:function(){return Nd(xa)},useDebugValue:Md,useDeferredValue:function(t,n){var l=Mt();return dt===null?Od(l,t,n):ph(l,dt.memoizedState,t,n)},useTransition:function(){var t=Nd(xa)[0],n=Mt().memoizedState;return[typeof t=="boolean"?t:Zs(t),n]},useSyncExternalStore:$m,useId:yh,useHostTransitionStatus:Ld,useFormState:ih,useActionState:ih,useOptimistic:function(t,n){var l=Mt();return dt!==null?Wm(l,dt,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Ed,useCacheRefresh:xh};jh.useEffectEvent=rh;function Bd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:y({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var qd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Qn(),f=rl(o);f.payload=n,l!=null&&(f.callback=l),n=sl(t,f,o),n!==null&&(On(n,t,o),Ws(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Qn(),f=rl(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=sl(t,f,o),n!==null&&(On(n,t,o),Ws(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Qn(),o=rl(l);o.tag=2,n!=null&&(o.callback=n),n=sl(t,o,l),n!==null&&(On(n,t,l),Ws(n,t,l))}};function Sh(t,n,l,o,f,m,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,v):n.prototype&&n.prototype.isPureReactComponent?!Pl(l,o)||!Pl(f,m):!0}function Ch(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&&qd.enqueueReplaceState(n,n.state,null)}function Jl(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=y({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Th(t){Fl(t)}function Eh(t){console.error(t)}function Ah(t){Fl(t)}function qu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Nh(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 Hd(t,n,l){return l=rl(l),l.tag=3,l.payload={element:null},l.callback=function(){qu(t,n)},l}function _h(t){return t=rl(t),t.tag=3,t}function Dh(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=o.value;t.payload=function(){return f(m)},t.callback=function(){Nh(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Nh(n,l,o),typeof f!="function"&&(pl===null?pl=new Set([this]):pl.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function Tw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&Xi(n,l,f,!0),l=Fn.current,l!==null){switch(l.tag){case 31:case 13:return ci===null?Zu():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===Eu?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),pf(t,o,f)),!1;case 22:return l.flags|=65536,o===Eu?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)),pf(t,o,f)),!1}throw Error(r(435,l.tag))}return pf(t,o,f),Zu(),!1}if(Ye)return n=Fn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Hs&&(t=Error(r(422),{cause:o}),it(Cn(t,l)))):(o!==Hs&&(n=Error(r(423),{cause:o}),it(Cn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Cn(o,l),f=Hd(t.stateNode,o,f),yd(t,f),Tt!==4&&(Tt=2)),!1;var m=Error(r(520),{cause:o});if(m=Cn(m,l),oo===null?oo=[m]:oo.push(m),Tt!==4&&(Tt=2),n===null)return!0;o=Cn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Hd(l.stateNode,o,t),yd(l,t),!1;case 1:if(n=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(pl===null||!pl.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=_h(f),Dh(f,t,l,o),yd(l,f),!1}l=l.return}while(l!==null);return!1}var $d=Error(r(461)),Ut=!1;function nn(t,n,l,o){n.child=t===null?zm(n,null,l,o):Ql(n,t.child,l,o)}function Rh(t,n,l,o,f){l=l.render;var m=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return ga(n),o=jd(t,n,l,v,m,f),E=Sd(),t!==null&&!Ut?(Cd(t,n,f),ba(t,n,f)):(Ye&&E&&Or(n),n.flags|=1,nn(t,n,o,f),n.child)}function Mh(t,n,l,o,f){if(t===null){var m=l.type;return typeof m=="function"&&!Us(m)&&m.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=m,Oh(t,n,m,o,f)):(t=Dr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(m=t.child,!Xd(t,f)){var v=m.memoizedProps;if(l=l.compare,l=l!==null?l:Pl,l(v,o)&&t.ref===n.ref)return ba(t,n,f)}return n.flags|=1,t=Ei(m,o),t.ref=n.ref,t.return=n,n.child=t}function Oh(t,n,l,o,f){if(t!==null){var m=t.memoizedProps;if(Pl(m,o)&&t.ref===n.ref)if(Ut=!1,n.pendingProps=o=m,Xd(t,f))(t.flags&131072)!==0&&(Ut=!0);else return n.lanes=t.lanes,ba(t,n,f)}return Gd(t,n,l,o,f)}function zh(t,n,l,o){var f=o.children,m=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(m=m!==null?m.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&~m}else o=0,n.child=null;return Lh(t,n,m,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ui(n,m!==null?m.cachePool:null),m!==null?Um(n,m):bd(),Bm(n);else return o=n.lanes=536870912,Lh(t,n,m!==null?m.baseLanes|l:l,l,o)}else m!==null?(ui(n,m.cachePool),Um(n,m),ul(),n.memoizedState=null):(t!==null&&ui(n,null),bd(),ul());return nn(t,n,f,l),n.child}function to(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Lh(t,n,l,o,f){var m=fn();return m=m===null?null:{parent:k._currentValue,pool:m},n.memoizedState={baseLanes:l,cachePool:m},t!==null&&ui(n,null),bd(),Bm(n),t!==null&&Xi(t,n,o,!0),n.childLanes=f,null}function Hu(t,n){return n=Gu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Ih(t,n,l){return Ql(n,t.child,null,l),t=Hu(n,n.pendingProps),t.flags|=2,Wn(n),n.memoizedState=null,t}function Ew(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ye){if(o.mode==="hidden")return t=Hu(n,o),n.lanes=536870912,to(null,t);if(wd(n),(t=mt)?(t=Kg(t,Xt),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Yn!==null?{id:Kt,overflow:An}:null,retryLane:536870912,hydrationErrors:null},l=wu(t),l.return=n,n.child=l,Gt=n,mt=null)):t=null,t===null)throw Nn(n);return n.lanes=536870912,null}return Hu(n,o)}var m=t.memoizedState;if(m!==null){var v=m.dehydrated;if(wd(n),f)if(n.flags&256)n.flags&=-257,n=Ih(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ut||Xi(t,n,l,!1),f=(l&t.childLanes)!==0,Ut||f){if(o=ht,o!==null&&(v=Jo(o,l),v!==0&&v!==m.retryLane))throw m.retryLane=v,da(t,v),On(o,t,v),$d;Zu(),n=Ih(t,n,l)}else t=m.treeContext,mt=di(v.nextSibling),Gt=n,Ye=!0,Ni=null,Xt=!1,t!==null&&ju(n,t),n=Hu(n,o),n.flags|=4096;return n}return t=Ei(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function $u(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 Gd(t,n,l,o,f){return ga(n),l=jd(t,n,l,o,void 0,f),o=Sd(),t!==null&&!Ut?(Cd(t,n,f),ba(t,n,f)):(Ye&&o&&Or(n),n.flags|=1,nn(t,n,l,f),n.child)}function Uh(t,n,l,o,f,m){return ga(n),n.updateQueue=null,l=Hm(n,o,l,f),qm(t),o=Sd(),t!==null&&!Ut?(Cd(t,n,m),ba(t,n,m)):(Ye&&o&&Or(n),n.flags|=1,nn(t,n,l,m),n.child)}function Bh(t,n,l,o,f){if(ga(n),n.stateNode===null){var m=fa,v=l.contextType;typeof v=="object"&&v!==null&&(m=Vt(v)),m=new l(o,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=qd,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=o,m.state=n.memoizedState,m.refs={},hd(n),v=l.contextType,m.context=typeof v=="object"&&v!==null?Vt(v):fa,m.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Bd(n,l,v,o),m.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(v=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),v!==m.state&&qd.enqueueReplaceState(m,m.state,null),Xs(n,o,m,f),Ks(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){m=n.stateNode;var E=n.memoizedProps,U=Jl(l,E);m.props=U;var F=m.context,ie=l.contextType;v=fa,typeof ie=="object"&&ie!==null&&(v=Vt(ie));var re=l.getDerivedStateFromProps;ie=typeof re=="function"||typeof m.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ie||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(E||F!==v)&&Ch(n,m,o,v),ll=!1;var W=n.memoizedState;m.state=W,Xs(n,o,m,f),Ks(),F=n.memoizedState,E||W!==F||ll?(typeof re=="function"&&(Bd(n,l,re,o),F=n.memoizedState),(U=ll||Sh(n,l,U,o,W,F,v))?(ie||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=F),m.props=o,m.state=F,m.context=v,o=U):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{m=n.stateNode,gd(t,n),v=n.memoizedProps,ie=Jl(l,v),m.props=ie,re=n.pendingProps,W=m.context,F=l.contextType,U=fa,typeof F=="object"&&F!==null&&(U=Vt(F)),E=l.getDerivedStateFromProps,(F=typeof E=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==re||W!==U)&&Ch(n,m,o,U),ll=!1,W=n.memoizedState,m.state=W,Xs(n,o,m,f),Ks();var Q=n.memoizedState;v!==re||W!==Q||ll||t!==null&&t.dependencies!==null&&zr(t.dependencies)?(typeof E=="function"&&(Bd(n,l,E,o),Q=n.memoizedState),(ie=ll||Sh(n,l,ie,o,W,Q,U)||t!==null&&t.dependencies!==null&&zr(t.dependencies))?(F||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,Q,U),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,Q,U)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Q),m.props=o,m.state=Q,m.context=U,o=ie):(typeof m.componentDidUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&W===t.memoizedState||(n.flags|=1024),o=!1)}return m=o,$u(t,n),o=(n.flags&128)!==0,m||o?(m=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,t!==null&&o?(n.child=Ql(n,t.child,null,f),n.child=Ql(n,null,l,f)):nn(t,n,l,f),n.memoizedState=m.state,t=n.child):t=ba(t,n,f),t}function qh(t,n,l,o){return ha(),n.flags|=256,nn(t,n,l,o),n.child}var Vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pd(t){return{baseLanes:t,cachePool:al()}}function Yd(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Xn),t}function Hh(t,n,l){var o=n.pendingProps,f=!1,m=(n.flags&128)!==0,v;if((v=m)||(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(Ye){if(f?ol(n):ul(),(t=mt)?(t=Kg(t,Xt),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Yn!==null?{id:Kt,overflow:An}:null,retryLane:536870912,hydrationErrors:null},l=wu(t),l.return=n,n.child=l,Gt=n,mt=null)):t=null,t===null)throw Nn(n);return Nf(t)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(ul(),f=n.mode,E=Gu({mode:"hidden",children:E},f),o=pa(o,f,l,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Pd(l),o.childLanes=Yd(t,v,l),n.memoizedState=Vd,to(null,o)):(ol(n),Fd(n,E))}var U=t.memoizedState;if(U!==null&&(E=U.dehydrated,E!==null)){if(m)n.flags&256?(ol(n),n.flags&=-257,n=Wd(t,n,l)):n.memoizedState!==null?(ul(),n.child=t.child,n.flags|=128,n=null):(ul(),E=o.fallback,f=n.mode,o=Gu({mode:"visible",children:o.children},f),E=pa(E,f,l,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,Ql(n,t.child,null,l),o=n.child,o.memoizedState=Pd(l),o.childLanes=Yd(t,v,l),n.memoizedState=Vd,n=to(null,o));else if(ol(n),Nf(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var F=v.dgst;v=F,o=Error(r(419)),o.stack="",o.digest=v,it({value:o,source:null,stack:null}),n=Wd(t,n,l)}else if(Ut||Xi(t,n,l,!1),v=(l&t.childLanes)!==0,Ut||v){if(v=ht,v!==null&&(o=Jo(v,l),o!==0&&o!==U.retryLane))throw U.retryLane=o,da(t,o),On(v,t,o),$d;Af(E)||Zu(),n=Wd(t,n,l)}else Af(E)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,mt=di(E.nextSibling),Gt=n,Ye=!0,Ni=null,Xt=!1,t!==null&&ju(n,t),n=Fd(n,o.children),n.flags|=4096);return n}return f?(ul(),E=o.fallback,f=n.mode,U=t.child,F=U.sibling,o=Ei(U,{mode:"hidden",children:o.children}),o.subtreeFlags=U.subtreeFlags&65011712,F!==null?E=Ei(F,E):(E=pa(E,f,l,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,to(null,o),o=n.child,E=t.child.memoizedState,E===null?E=Pd(l):(f=E.cachePool,f!==null?(U=k._currentValue,f=f.parent!==U?{parent:U,pool:U}:f):f=al(),E={baseLanes:E.baseLanes|l,cachePool:f}),o.memoizedState=E,o.childLanes=Yd(t,v,l),n.memoizedState=Vd,to(t.child,o)):(ol(n),l=t.child,t=l.sibling,l=Ei(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 Fd(t,n){return n=Gu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Gu(t,n){return t=xn(22,t,null,n),t.lanes=0,t}function Wd(t,n,l){return Ql(n,t.child,null,l),t=Fd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function $h(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Gs(t.return,n,l)}function Kd(t,n,l,o,f,m){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:m}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=m)}function Gh(t,n,l){var o=n.pendingProps,f=o.revealOrder,m=o.tail;o=o.children;var v=Rt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,S(Rt,v),nn(t,n,o,l),o=Ye?ma:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&$h(t,l,n);else if(t.tag===19)$h(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&&Du(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Kd(n,!1,f,l,m,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&&Du(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}Kd(n,!0,l,null,m,o);break;case"together":Kd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ba(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),fl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(Xi(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=Ei(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=Ei(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function Xd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&zr(t)))}function Aw(t,n,l){switch(n.tag){case 3:Le(n,n.stateNode.containerInfo),dn(n,k,t.memoizedState.cache),ha();break;case 27:case 5:Ot(n);break;case 4:Le(n,n.stateNode.containerInfo);break;case 10:dn(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,wd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ol(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Hh(t,n,l):(ol(n),t=ba(t,n,l),t!==null?t.sibling:null);ol(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Xi(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Gh(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),S(Rt,Rt.current),o)break;return null;case 22:return n.lanes=0,zh(t,n,l,n.pendingProps);case 24:dn(n,k,t.memoizedState.cache)}return ba(t,n,l)}function Vh(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ut=!0;else{if(!Xd(t,l)&&(n.flags&128)===0)return Ut=!1,Aw(t,n,l);Ut=(t.flags&131072)!==0}else Ut=!1,Ye&&(n.flags&1048576)!==0&&Mr(n,ma,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Kl(n.elementType),n.type=t,typeof t=="function")Us(t)?(o=Jl(t,o),n.tag=1,n=Bh(null,n,t,o,l)):(n.tag=0,n=Gd(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===P){n.tag=11,n=Rh(null,n,t,o,l);break e}else if(f===X){n.tag=14,n=Mh(null,n,t,o,l);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Gd(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=Jl(o,n.pendingProps),Bh(t,n,o,f,l);case 3:e:{if(Le(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var m=n.memoizedState;f=m.element,gd(t,n),Xs(n,o,null,l);var v=n.memoizedState;if(o=v.cache,dn(n,k,o),o!==m.cache&&Vs(n,[k],l,!0),Ks(),o=v.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=qh(t,n,o,l);break e}else if(o!==f){f=Cn(Error(r(424)),n),it(f),n=qh(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(mt=di(t.firstChild),Gt=n,Ye=!0,Ni=null,Xt=!0,l=zm(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(ha(),o===f){n=ba(t,n,l);break e}nn(t,n,o,l)}n=n.child}return n;case 26:return $u(t,n),t===null?(l=ty(n.type,null,n.pendingProps,null))?n.memoizedState=l:Ye||(l=n.type,t=n.pendingProps,o=lc(Z.current).createElement(l),o[bt]=n,o[Nt]=t,an(o,l,t),_t(o),n.stateNode=o):n.memoizedState=ty(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ot(n),t===null&&Ye&&(o=n.stateNode=Zg(n.type,n.pendingProps,Z.current),Gt=n,Xt=!0,f=mt,yl(n.type)?(_f=f,mt=di(o.firstChild)):mt=f),nn(t,n,n.pendingProps.children,l),$u(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ye&&((f=o=mt)&&(o=ak(o,n.type,n.pendingProps,Xt),o!==null?(n.stateNode=o,Gt=n,mt=di(o.firstChild),Xt=!1,f=!0):f=!1),f||Nn(n)),Ot(n),f=n.type,m=n.pendingProps,v=t!==null?t.memoizedProps:null,o=m.children,Cf(f,m)?o=null:v!==null&&Cf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=jd(t,n,bw,null,null,l),yo._currentValue=f),$u(t,n),nn(t,n,o,l),n.child;case 6:return t===null&&Ye&&((t=l=mt)&&(l=lk(l,n.pendingProps,Xt),l!==null?(n.stateNode=l,Gt=n,mt=null,t=!0):t=!1),t||Nn(n)),null;case 13:return Hh(t,n,l);case 4:return Le(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Ql(n,null,o,l):nn(t,n,o,l),n.child;case 11:return Rh(t,n,n.type,n.pendingProps,l);case 7:return nn(t,n,n.pendingProps,l),n.child;case 8:return nn(t,n,n.pendingProps.children,l),n.child;case 12:return nn(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,dn(n,n.type,o.value),nn(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,ga(n),f=Vt(f),o=o(f),n.flags|=1,nn(t,n,o,l),n.child;case 14:return Mh(t,n,n.type,n.pendingProps,l);case 15:return Oh(t,n,n.type,n.pendingProps,l);case 19:return Gh(t,n,l);case 31:return Ew(t,n,l);case 22:return zh(t,n,l,n.pendingProps);case 24:return ga(n),o=Vt(k),t===null?(f=fn(),f===null&&(f=ht,m=C(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),n.memoizedState={parent:o,cache:f},hd(n),dn(n,k,f)):((t.lanes&l)!==0&&(gd(t,n),Xs(n,null,null,l),Ks()),f=t.memoizedState,m=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),dn(n,k,o)):(o=m.cache,dn(n,k,o),o!==f.cache&&Vs(n,[k],l,!0))),nn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function va(t){t.flags|=4}function Qd(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(yg())t.flags|=8192;else throw Xl=Eu,md}else t.flags&=-16777217}function Ph(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ry(n))if(yg())t.flags|=8192;else throw Xl=Eu,md}function Vu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Qo():536870912,t.lanes|=n,Vr|=n)}function no(t,n){if(!Ye)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 xt(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 Nw(t,n,l){var o=n.pendingProps;switch(el(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(n),null;case 1:return xt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Di(k),Xe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(il(n)?va(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,$s())),xt(n),null;case 26:var f=n.type,m=n.memoizedState;return t===null?(va(n),m!==null?(xt(n),Ph(n,m)):(xt(n),Qd(n,f,null,o,l))):m?m!==t.memoizedState?(va(n),xt(n),Ph(n,m)):(xt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&va(n),xt(n),Qd(n,f,t,o,l)),null;case 27:if(Yt(n),l=Z.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&va(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}t=K.current,il(n)?tl(n):(t=Zg(f,o,l),n.stateNode=t,va(n))}return xt(n),null;case 5:if(Yt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&va(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}if(m=K.current,il(n))tl(n);else{var v=lc(Z.current);switch(m){case 1:m=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=v.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}m[bt]=n,m[Nt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)m.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=m;e:switch(an(m,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&&va(n)}}return xt(n),Qd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&va(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=Z.current,il(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Gt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[bt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Hg(t.nodeValue,l)),t||Nn(n,!0)}else t=lc(t).createTextNode(o),t[bt]=n,n.stateNode=t}return xt(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[bt]=n}else ha(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else l=$s(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Wn(n),n):(Wn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return xt(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[bt]=n}else ha(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=$s(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Wn(n),n):(Wn(n),null)}return Wn(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),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Vu(n,n.updateQueue),xt(n),null);case 4:return Xe(),t===null&&vf(n.stateNode.containerInfo),xt(n),null;case 10:return Di(n.type),xt(n),null;case 19:if(L(Rt),o=n.memoizedState,o===null)return xt(n),null;if(f=(n.flags&128)!==0,m=o.rendering,m===null)if(f)no(o,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(m=Du(t),m!==null){for(n.flags|=128,no(o,!1),t=m.updateQueue,n.updateQueue=t,Vu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)vu(l,t),l=l.sibling;return S(Rt,Rt.current&1|2),Ye&&si(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Lt()>Ku&&(n.flags|=128,f=!0,no(o,!1),n.lanes=4194304)}else{if(!f)if(t=Du(m),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Vu(n,t),no(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!Ye)return xt(n),null}else 2*Lt()-o.renderingStartTime>Ku&&l!==536870912&&(n.flags|=128,f=!0,no(o,!1),n.lanes=4194304);o.isBackwards?(m.sibling=n.child,n.child=m):(t=o.last,t!==null?t.sibling=m:n.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Lt(),t.sibling=null,l=Rt.current,S(Rt,f?l&1|2:l&1),Ye&&si(n,o.treeForkCount),t):(xt(n),null);case 22:case 23:return Wn(n),vd(),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&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),l=n.updateQueue,l!==null&&Vu(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&&L(oi),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Di(k),xt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function _w(t,n){switch(el(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Di(k),Xe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Yt(n),null;case 31:if(n.memoizedState!==null){if(Wn(n),n.alternate===null)throw Error(r(340));ha()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Wn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));ha()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return L(Rt),null;case 4:return Xe(),null;case 10:return Di(n.type),null;case 22:case 23:return Wn(n),vd(),t!==null&&L(oi),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Di(k),null;case 25:return null;default:return null}}function Yh(t,n){switch(el(n),n.tag){case 3:Di(k),Xe();break;case 26:case 27:case 5:Yt(n);break;case 4:Xe();break;case 31:n.memoizedState!==null&&Wn(n);break;case 13:Wn(n);break;case 19:L(Rt);break;case 10:Di(n.type);break;case 22:case 23:Wn(n),vd(),t!==null&&L(oi);break;case 24:Di(k)}}function io(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 m=l.create,v=l.inst;o=m(),v.destroy=o}l=l.next}while(l!==f)}}catch(E){ct(n,n.return,E)}}function cl(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var m=f.next;o=m;do{if((o.tag&t)===t){var v=o.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,f=n;var U=l,F=E;try{F()}catch(ie){ct(f,U,ie)}}}o=o.next}while(o!==m)}}catch(ie){ct(n,n.return,ie)}}function Fh(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Im(n,l)}catch(o){ct(t,t.return,o)}}}function Wh(t,n,l){l.props=Jl(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ct(t,n,o)}}function ao(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){ct(t,n,f)}}function Zi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ct(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){ct(t,n,f)}else l.current=null}function Kh(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){ct(t,t.return,f)}}function Zd(t,n,l){try{var o=t.stateNode;Zw(o,t.type,l,n),o[Nt]=n}catch(f){ct(t,t.return,f)}}function Xh(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&yl(t.type)||t.tag===4}function Jd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xh(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&&yl(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 ef(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=Gn));else if(o!==4&&(o===27&&yl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(ef(t,n,l),t=t.sibling;t!==null;)ef(t,n,l),t=t.sibling}function Pu(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&&yl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Pu(t,n,l),t=t.sibling;t!==null;)Pu(t,n,l),t=t.sibling}function Qh(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);an(n,o,l),n[bt]=t,n[Nt]=l}catch(m){ct(t,t.return,m)}}var wa=!1,Bt=!1,tf=!1,Zh=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Dw(t,n){if(t=t.containerInfo,jf=fc,t=gu(t),_s(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,m=o.focusNode;o=o.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var v=0,E=-1,U=-1,F=0,ie=0,re=t,W=null;t:for(;;){for(var Q;re!==l||f!==0&&re.nodeType!==3||(E=v+f),re!==m||o!==0&&re.nodeType!==3||(U=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Q=re.firstChild)!==null;)W=re,re=Q;for(;;){if(re===t)break t;if(W===l&&++F===f&&(E=v),W===m&&++ie===o&&(U=v),(Q=re.nextSibling)!==null)break;re=W,W=re.parentNode}re=Q}l=E===-1||U===-1?null:{start:E,end:U}}else l=null}l=l||{start:0,end:0}}else l=null;for(Sf={focusedElem:t,selectionRange:l},fc=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,m=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&&m!==null){t=void 0,l=n,f=m.memoizedProps,m=m.memoizedState,o=l.stateNode;try{var ve=Jl(l.type,f);t=o.getSnapshotBeforeUpdate(ve,m),o.__reactInternalSnapshotBeforeUpdate=t}catch(Oe){ct(l,l.return,Oe)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Ef(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ef(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,Zt=t;break}Zt=n.return}}function Jh(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:ja(t,l),o&4&&io(5,l);break;case 1:if(ja(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(l,l.return,v)}else{var f=Jl(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(l,l.return,v)}}o&64&&Fh(l),o&512&&ao(l,l.return);break;case 3:if(ja(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{Im(t,n)}catch(v){ct(l,l.return,v)}}break;case 27:n===null&&o&4&&Qh(l);case 26:case 5:ja(t,l),n===null&&o&4&&Kh(l),o&512&&ao(l,l.return);break;case 12:ja(t,l);break;case 31:ja(t,l),o&4&&ng(t,l);break;case 13:ja(t,l),o&4&&ig(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=qw.bind(null,l),rk(t,l))));break;case 22:if(o=l.memoizedState!==null||wa,!o){n=n!==null&&n.memoizedState!==null||Bt,f=wa;var m=Bt;wa=o,(Bt=n)&&!m?Sa(t,l,(l.subtreeFlags&8772)!==0):ja(t,l),wa=f,Bt=m}break;case 30:break;default:ja(t,l)}}function eg(t){var n=t.alternate;n!==null&&(t.alternate=null,eg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Rl(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 vt=null,_n=!1;function ka(t,n,l){for(l=l.child;l!==null;)tg(t,n,l),l=l.sibling}function tg(t,n,l){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(tt,l)}catch{}switch(l.tag){case 26:Bt||Zi(l,n),ka(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bt||Zi(l,n);var o=vt,f=_n;yl(l.type)&&(vt=l.stateNode,_n=!1),ka(t,n,l),mo(l.stateNode),vt=o,_n=f;break;case 5:Bt||Zi(l,n);case 6:if(o=vt,f=_n,vt=null,ka(t,n,l),vt=o,_n=f,vt!==null)if(_n)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(l.stateNode)}catch(m){ct(l,n,m)}else try{vt.removeChild(l.stateNode)}catch(m){ct(l,n,m)}break;case 18:vt!==null&&(_n?(t=vt,Fg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Zr(t)):Fg(vt,l.stateNode));break;case 4:o=vt,f=_n,vt=l.stateNode.containerInfo,_n=!0,ka(t,n,l),vt=o,_n=f;break;case 0:case 11:case 14:case 15:cl(2,l,n),Bt||cl(4,l,n),ka(t,n,l);break;case 1:Bt||(Zi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Wh(l,n,o)),ka(t,n,l);break;case 21:ka(t,n,l);break;case 22:Bt=(o=Bt)||l.memoizedState!==null,ka(t,n,l),Bt=o;break;default:ka(t,n,l)}}function ng(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Zr(t)}catch(l){ct(n,n.return,l)}}}function ig(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Zr(t)}catch(l){ct(n,n.return,l)}}function Rw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Zh),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Zh),n;default:throw Error(r(435,t.tag))}}function Yu(t,n){var l=Rw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Hw.bind(null,t,o);o.then(f,f)}})}function Dn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],m=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(yl(E.type)){vt=E.stateNode,_n=!1;break e}break;case 5:vt=E.stateNode,_n=!1;break e;case 3:case 4:vt=E.stateNode.containerInfo,_n=!0;break e}E=E.return}if(vt===null)throw Error(r(160));tg(m,v,f),vt=null,_n=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ag(n,t),n=n.sibling}var Ri=null;function ag(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Dn(n,t),Rn(t),o&4&&(cl(3,t,t.return),io(3,t),cl(5,t,t.return));break;case 1:Dn(n,t),Rn(t),o&512&&(Bt||l===null||Zi(l,l.return)),o&64&&wa&&(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=Ri;if(Dn(n,t),Rn(t),o&512&&(Bt||l===null||Zi(l,l.return)),o&4){var m=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":m=f.getElementsByTagName("title")[0],(!m||m[xi]||m[bt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(o),f.head.insertBefore(m,f.querySelector("head > title"))),an(m,o,l),m[bt]=t,_t(m),o=m;break e;case"link":var v=ay("link","href",f).get(o+(l.href||""));if(v){for(var E=0;E<v.length;E++)if(m=v[E],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(E,1);break t}}m=f.createElement(o),an(m,o,l),f.head.appendChild(m);break;case"meta":if(v=ay("meta","content",f).get(o+(l.content||""))){for(E=0;E<v.length;E++)if(m=v[E],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(E,1);break t}}m=f.createElement(o),an(m,o,l),f.head.appendChild(m);break;default:throw Error(r(468,o))}m[bt]=t,_t(m),o=m}t.stateNode=o}else ly(f,t.type,t.stateNode);else t.stateNode=iy(f,o,t.memoizedProps);else m!==o?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,o===null?ly(f,t.type,t.stateNode):iy(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Zd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Dn(n,t),Rn(t),o&512&&(Bt||l===null||Zi(l,l.return)),l!==null&&o&4&&Zd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Dn(n,t),Rn(t),o&512&&(Bt||l===null||Zi(l,l.return)),t.flags&32){f=t.stateNode;try{Hi(f,"")}catch(ve){ct(t,t.return,ve)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Zd(t,f,l!==null?l.memoizedProps:f)),o&1024&&(tf=!0);break;case 6:if(Dn(n,t),Rn(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(ve){ct(t,t.return,ve)}}break;case 3:if(oc=null,f=Ri,Ri=rc(n.containerInfo),Dn(n,t),Ri=f,Rn(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{Zr(n.containerInfo)}catch(ve){ct(t,t.return,ve)}tf&&(tf=!1,lg(t));break;case 4:o=Ri,Ri=rc(t.stateNode.containerInfo),Dn(n,t),Rn(t),Ri=o;break;case 12:Dn(n,t),Rn(t);break;case 31:Dn(n,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));break;case 13:Dn(n,t),Rn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Wu=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));break;case 22:f=t.memoizedState!==null;var U=l!==null&&l.memoizedState!==null,F=wa,ie=Bt;if(wa=F||f,Bt=ie||U,Dn(n,t),Bt=ie,wa=F,Rn(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||U||wa||Bt||er(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){U=l=n;try{if(m=U.stateNode,f)v=m.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=U.stateNode;var re=U.memoizedProps.style,W=re!=null&&re.hasOwnProperty("display")?re.display:null;E.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ve){ct(U,U.return,ve)}}}else if(n.tag===6){if(l===null){U=n;try{U.stateNode.nodeValue=f?"":U.memoizedProps}catch(ve){ct(U,U.return,ve)}}}else if(n.tag===18){if(l===null){U=n;try{var Q=U.stateNode;f?Wg(Q,!0):Wg(U.stateNode,!1)}catch(ve){ct(U,U.return,ve)}}}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,Yu(t,l))));break;case 19:Dn(n,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Yu(t,o)));break;case 30:break;case 21:break;default:Dn(n,t),Rn(t)}}function Rn(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(Xh(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,m=Jd(t);Pu(t,m,f);break;case 5:var v=l.stateNode;l.flags&32&&(Hi(v,""),l.flags&=-33);var E=Jd(t);Pu(t,E,v);break;case 3:case 4:var U=l.stateNode.containerInfo,F=Jd(t);ef(t,F,U);break;default:throw Error(r(161))}}catch(ie){ct(t,t.return,ie)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function lg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;lg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function ja(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Jh(t,n.alternate,n),n=n.sibling}function er(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:cl(4,n,n.return),er(n);break;case 1:Zi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Wh(n,n.return,l),er(n);break;case 27:mo(n.stateNode);case 26:case 5:Zi(n,n.return),er(n);break;case 22:n.memoizedState===null&&er(n);break;case 30:er(n);break;default:er(n)}t=t.sibling}}function Sa(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,m=n,v=m.flags;switch(m.tag){case 0:case 11:case 15:Sa(f,m,l),io(4,m);break;case 1:if(Sa(f,m,l),o=m,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){ct(o,o.return,F)}if(o=m,f=o.updateQueue,f!==null){var E=o.stateNode;try{var U=f.shared.hiddenCallbacks;if(U!==null)for(f.shared.hiddenCallbacks=null,f=0;f<U.length;f++)Lm(U[f],E)}catch(F){ct(o,o.return,F)}}l&&v&64&&Fh(m),ao(m,m.return);break;case 27:Qh(m);case 26:case 5:Sa(f,m,l),l&&o===null&&v&4&&Kh(m),ao(m,m.return);break;case 12:Sa(f,m,l);break;case 31:Sa(f,m,l),l&&v&4&&ng(f,m);break;case 13:Sa(f,m,l),l&&v&4&&ig(f,m);break;case 22:m.memoizedState===null&&Sa(f,m,l),ao(m,m.return);break;case 30:break;default:Sa(f,m,l)}n=n.sibling}}function nf(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&&M(l))}function af(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&M(t))}function Mi(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)rg(t,n,l,o),n=n.sibling}function rg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Mi(t,n,l,o),f&2048&&io(9,n);break;case 1:Mi(t,n,l,o);break;case 3:Mi(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&&M(t)));break;case 12:if(f&2048){Mi(t,n,l,o),t=n.stateNode;try{var m=n.memoizedProps,v=m.id,E=m.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){ct(n,n.return,U)}}else Mi(t,n,l,o);break;case 31:Mi(t,n,l,o);break;case 13:Mi(t,n,l,o);break;case 23:break;case 22:m=n.stateNode,v=n.alternate,n.memoizedState!==null?m._visibility&2?Mi(t,n,l,o):lo(t,n):m._visibility&2?Mi(t,n,l,o):(m._visibility|=2,Hr(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&nf(v,n);break;case 24:Mi(t,n,l,o),f&2048&&af(n.alternate,n);break;default:Mi(t,n,l,o)}}function Hr(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=t,v=n,E=l,U=o,F=v.flags;switch(v.tag){case 0:case 11:case 15:Hr(m,v,E,U,f),io(8,v);break;case 23:break;case 22:var ie=v.stateNode;v.memoizedState!==null?ie._visibility&2?Hr(m,v,E,U,f):lo(m,v):(ie._visibility|=2,Hr(m,v,E,U,f)),f&&F&2048&&nf(v.alternate,v);break;case 24:Hr(m,v,E,U,f),f&&F&2048&&af(v.alternate,v);break;default:Hr(m,v,E,U,f)}n=n.sibling}}function lo(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:lo(l,o),f&2048&&nf(o.alternate,o);break;case 24:lo(l,o),f&2048&&af(o.alternate,o);break;default:lo(l,o)}n=n.sibling}}var ro=8192;function $r(t,n,l){if(t.subtreeFlags&ro)for(t=t.child;t!==null;)sg(t,n,l),t=t.sibling}function sg(t,n,l){switch(t.tag){case 26:$r(t,n,l),t.flags&ro&&t.memoizedState!==null&&xk(l,Ri,t.memoizedState,t.memoizedProps);break;case 5:$r(t,n,l);break;case 3:case 4:var o=Ri;Ri=rc(t.stateNode.containerInfo),$r(t,n,l),Ri=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=ro,ro=16777216,$r(t,n,l),ro=o):$r(t,n,l));break;default:$r(t,n,l)}}function og(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 so(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];Zt=o,cg(o,t)}og(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ug(t),t=t.sibling}function ug(t){switch(t.tag){case 0:case 11:case 15:so(t),t.flags&2048&&cl(9,t,t.return);break;case 3:so(t);break;case 12:so(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Fu(t)):so(t);break;default:so(t)}}function Fu(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];Zt=o,cg(o,t)}og(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:cl(8,n,n.return),Fu(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Fu(n));break;default:Fu(n)}t=t.sibling}}function cg(t,n){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:cl(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:M(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Zt=o;else e:for(l=t;Zt!==null;){o=Zt;var f=o.sibling,m=o.return;if(eg(o),o===l){Zt=null;break e}if(f!==null){f.return=m,Zt=f;break e}Zt=m}}}var Mw={getCacheForType:function(t){var n=Vt(k),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Vt(k).controller.signal}},Ow=typeof WeakMap=="function"?WeakMap:Map,rt=0,ht=null,Fe=null,Qe=0,ut=0,Kn=null,dl=!1,Gr=!1,lf=!1,Ca=0,Tt=0,fl=0,tr=0,rf=0,Xn=0,Vr=0,oo=null,Mn=null,sf=!1,Wu=0,dg=0,Ku=1/0,Xu=null,pl=null,Pt=0,ml=null,Pr=null,Ta=0,of=0,uf=null,fg=null,uo=0,cf=null;function Qn(){return(rt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?gf():pr()}function pg(){if(Xn===0)if((Qe&536870912)===0||Ye){var t=Nl;Nl<<=1,(Nl&3932160)===0&&(Nl=262144),Xn=t}else Xn=536870912;return t=Fn.current,t!==null&&(t.flags|=32),Xn}function On(t,n,l){(t===ht&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(Yr(t,0),hl(t,Qe,Xn,!1)),Ra(t,l),((rt&2)===0||t!==ht)&&(t===ht&&((rt&2)===0&&(tr|=l),Tt===4&&hl(t,Qe,Xn,!1)),Ji(t))}function mg(t,n,l){if((rt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||ot(t,n),f=o?Iw(t,n):ff(t,n,!0),m=o;do{if(f===0){Gr&&!o&&hl(t,n,0,!1);break}else{if(l=t.current.alternate,m&&!zw(l)){f=ff(t,n,!1),m=!1;continue}if(f===2){if(m=n,t.errorRecoveryDisabledLanes&m)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=oo;var U=E.current.memoizedState.isDehydrated;if(U&&(Yr(E,v).flags|=256),v=ff(E,v,!1),v!==2){if(lf&&!U){E.errorRecoveryDisabledLanes|=m,tr|=m,f=4;break e}m=Mn,Mn=f,m!==null&&(Mn===null?Mn=m:Mn.push.apply(Mn,m))}f=v}if(m=!1,f!==2)continue}}if(f===1){Yr(t,0),hl(t,n,0,!0);break}e:{switch(o=t,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:hl(o,n,Xn,!dl);break e;case 2:Mn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Wu+300-Lt(),10<f)){if(hl(o,n,Xn,!dl),yi(o,0,!0)!==0)break e;Ta=n,o.timeoutHandle=Pg(hg.bind(null,o,l,Mn,Xu,sf,n,Xn,tr,Vr,dl,m,"Throttled",-0,0),f);break e}hg(o,l,Mn,Xu,sf,n,Xn,tr,Vr,dl,m,null,-0,0)}}break}while(!0);Ji(t)}function hg(t,n,l,o,f,m,v,E,U,F,ie,re,W,Q){if(t.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gn},sg(n,m,re);var ve=(m&62914560)===m?Wu-Lt():(m&4194048)===m?dg-Lt():0;if(ve=bk(re,ve),ve!==null){Ta=m,t.cancelPendingCommit=ve(jg.bind(null,t,n,m,l,o,f,v,E,U,ie,re,null,W,Q)),hl(t,m,v,!F);return}}jg(t,n,m,l,o,f,v,E,U)}function zw(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],m=f.getSnapshot;f=f.value;try{if(!yn(m(),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 hl(t,n,l,o){n&=~rf,n&=~tr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var m=31-st(f),v=1<<m;o[m]=-1,f&=~v}l!==0&&Zo(t,l,n)}function Qu(){return(rt&6)===0?(co(0),!1):!0}function df(){if(Fe!==null){if(ut===0)var t=Fe.return;else t=Fe,_i=Qt=null,Td(t),Lr=null,Ys=0,t=Fe;for(;t!==null;)Yh(t.alternate,t),t=t.return;Fe=null}}function Yr(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,tk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ta=0,df(),ht=t,Fe=l=Ei(t.current,null),Qe=n,ut=0,Kn=null,dl=!1,Gr=ot(t,n),lf=!1,Vr=Xn=rf=tr=fl=Tt=0,Mn=oo=null,sf=!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-st(o),m=1<<f;n|=t[f],o&=~m}return Ca=n,Ti(),l}function gg(t,n){He=null,V.H=eo,n===Qi||n===Tu?(n=Rm(),ut=3):n===md?(n=Rm(),ut=4):ut=n===$d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Kn=n,Fe===null&&(Tt=1,qu(t,Cn(n,t.current)))}function yg(){var t=Fn.current;return t===null?!0:(Qe&4194048)===Qe?ci===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===ci:!1}function xg(){var t=V.H;return V.H=eo,t===null?eo:t}function bg(){var t=V.A;return V.A=Mw,t}function Zu(){Tt=4,dl||(Qe&4194048)!==Qe&&Fn.current!==null||(Gr=!0),(fl&134217727)===0&&(tr&134217727)===0||ht===null||hl(ht,Qe,Xn,!1)}function ff(t,n,l){var o=rt;rt|=2;var f=xg(),m=bg();(ht!==t||Qe!==n)&&(Xu=null,Yr(t,n)),n=!1;var v=Tt;e:do try{if(ut!==0&&Fe!==null){var E=Fe,U=Kn;switch(ut){case 8:df(),v=6;break e;case 3:case 2:case 9:case 6:Fn.current===null&&(n=!0);var F=ut;if(ut=0,Kn=null,Fr(t,E,U,F),l&&Gr){v=0;break e}break;default:F=ut,ut=0,Kn=null,Fr(t,E,U,F)}}Lw(),v=Tt;break}catch(ie){gg(t,ie)}while(!0);return n&&t.shellSuspendCounter++,_i=Qt=null,rt=o,V.H=f,V.A=m,Fe===null&&(ht=null,Qe=0,Ti()),v}function Lw(){for(;Fe!==null;)vg(Fe)}function Iw(t,n){var l=rt;rt|=2;var o=xg(),f=bg();ht!==t||Qe!==n?(Xu=null,Ku=Lt()+500,Yr(t,n)):Gr=ot(t,n);e:do try{if(ut!==0&&Fe!==null){n=Fe;var m=Kn;t:switch(ut){case 1:ut=0,Kn=null,Fr(t,n,m,1);break;case 2:case 9:if(_m(m)){ut=0,Kn=null,wg(n);break}n=function(){ut!==2&&ut!==9||ht!==t||(ut=7),Ji(t)},m.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:_m(m)?(ut=0,Kn=null,wg(n)):(ut=0,Kn=null,Fr(t,n,m,7));break;case 5:var v=null;switch(Fe.tag){case 26:v=Fe.memoizedState;case 5:case 27:var E=Fe;if(v?ry(v):E.stateNode.complete){ut=0,Kn=null;var U=E.sibling;if(U!==null)Fe=U;else{var F=E.return;F!==null?(Fe=F,Ju(F)):Fe=null}break t}}ut=0,Kn=null,Fr(t,n,m,5);break;case 6:ut=0,Kn=null,Fr(t,n,m,6);break;case 8:df(),Tt=6;break e;default:throw Error(r(462))}}Uw();break}catch(ie){gg(t,ie)}while(!0);return _i=Qt=null,V.H=o,V.A=f,rt=l,Fe!==null?0:(ht=null,Qe=0,Ti(),Tt)}function Uw(){for(;Fe!==null&&!gi();)vg(Fe)}function vg(t){var n=Vh(t.alternate,t,Ca);t.memoizedProps=t.pendingProps,n===null?Ju(t):Fe=n}function wg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Uh(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Uh(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Td(n);default:Yh(l,n),n=Fe=vu(n,Ca),n=Vh(l,n,Ca)}t.memoizedProps=t.pendingProps,n===null?Ju(t):Fe=n}function Fr(t,n,l,o){_i=Qt=null,Td(n),Lr=null,Ys=0;var f=n.return;try{if(Tw(t,f,n,l,Qe)){Tt=1,qu(t,Cn(l,t.current)),Fe=null;return}}catch(m){if(f!==null)throw Fe=f,m;Tt=1,qu(t,Cn(l,t.current)),Fe=null;return}n.flags&32768?(Ye||o===1?t=!0:Gr||(Qe&536870912)!==0?t=!1:(dl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Fn.current,o!==null&&o.tag===13&&(o.flags|=16384))),kg(n,t)):Ju(n)}function Ju(t){var n=t;do{if((n.flags&32768)!==0){kg(n,dl);return}t=n.return;var l=Nw(n.alternate,n,Ca);if(l!==null){Fe=l;return}if(n=n.sibling,n!==null){Fe=n;return}Fe=n=t}while(n!==null);Tt===0&&(Tt=5)}function kg(t,n){do{var l=_w(t.alternate,t);if(l!==null){l.flags&=32767,Fe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Fe=t;return}Fe=t=l}while(t!==null);Tt=6,Fe=null}function jg(t,n,l,o,f,m,v,E,U){t.cancelPendingCommit=null;do ec();while(Pt!==0);if((rt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(m=n.lanes|n.childLanes,m|=zs,Dl(t,l,m,v,E,U),t===ht&&(Fe=ht=null,Qe=0),Pr=n,ml=t,Ta=l,of=m,uf=f,fg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,$w(Re,function(){return Ag(),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=rt,rt|=4;try{Dw(t,n,l)}finally{rt=v,oe.p=f,V.T=o}}Pt=1,Sg(),Cg(),Tg()}}function Sg(){if(Pt===1){Pt=0;var t=ml,n=Pr,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=rt;rt|=4;try{ag(n,t);var m=Sf,v=gu(t.containerInfo),E=m.focusedElem,U=m.selectionRange;if(v!==E&&E&&E.ownerDocument&&hu(E.ownerDocument.documentElement,E)){if(U!==null&&_s(E)){var F=U.start,ie=U.end;if(ie===void 0&&(ie=F),"selectionStart"in E)E.selectionStart=F,E.selectionEnd=Math.min(ie,E.value.length);else{var re=E.ownerDocument||document,W=re&&re.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ve=E.textContent.length,Oe=Math.min(U.start,ve),pt=U.end===void 0?Oe:Math.min(U.end,ve);!Q.extend&&Oe>pt&&(v=pt,pt=Oe,Oe=v);var $=mu(E,Oe),H=mu(E,pt);if($&&H&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==H.node||Q.focusOffset!==H.offset)){var Y=re.createRange();Y.setStart($.node,$.offset),Q.removeAllRanges(),Oe>pt?(Q.addRange(Y),Q.extend(H.node,H.offset)):(Y.setEnd(H.node,H.offset),Q.addRange(Y))}}}}for(re=[],Q=E;Q=Q.parentNode;)Q.nodeType===1&&re.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<re.length;E++){var ae=re[E];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}fc=!!jf,Sf=jf=null}finally{rt=f,oe.p=o,V.T=l}}t.current=n,Pt=2}}function Cg(){if(Pt===2){Pt=0;var t=ml,n=Pr,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=rt;rt|=4;try{Jh(t,n.alternate,n)}finally{rt=f,oe.p=o,V.T=l}}Pt=3}}function Tg(){if(Pt===4||Pt===3){Pt=0,zi();var t=ml,n=Pr,l=Ta,o=fg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Pt=5:(Pt=0,Pr=ml=null,Eg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(pl=null),us(l),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(tt,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 m=t.onRecoverableError,v=0;v<o.length;v++){var E=o[v];m(E.value,{componentStack:E.stack})}}finally{V.T=n,oe.p=f}}(Ta&3)!==0&&ec(),Ji(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===cf?uo++:(uo=0,cf=t):uo=0,co(0)}}function Eg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,M(n)))}function ec(){return Sg(),Cg(),Tg(),Ag()}function Ag(){if(Pt!==5)return!1;var t=ml,n=of;of=0;var l=us(Ta),o=V.T,f=oe.p;try{oe.p=32>l?32:l,V.T=null,l=uf,uf=null;var m=ml,v=Ta;if(Pt=0,Pr=ml=null,Ta=0,(rt&6)!==0)throw Error(r(331));var E=rt;if(rt|=4,ug(m.current),rg(m,m.current,v,l),rt=E,co(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(tt,m)}catch{}return!0}finally{oe.p=f,V.T=o,Eg(t,n)}}function Ng(t,n,l){n=Cn(l,n),n=Hd(t.stateNode,n,2),t=sl(t,n,2),t!==null&&(Ra(t,2),Ji(t))}function ct(t,n,l){if(t.tag===3)Ng(t,t,l);else for(;n!==null;){if(n.tag===3){Ng(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(pl===null||!pl.has(o))){t=Cn(l,t),l=_h(2),o=sl(n,l,2),o!==null&&(Dh(l,o,n,t),Ra(o,2),Ji(o));break}}n=n.return}}function pf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Ow;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)||(lf=!0,f.add(l),t=Bw.bind(null,t,n,l),n.then(t,t))}function Bw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ht===t&&(Qe&l)===l&&(Tt===4||Tt===3&&(Qe&62914560)===Qe&&300>Lt()-Wu?(rt&2)===0&&Yr(t,0):rf|=l,Vr===Qe&&(Vr=0)),Ji(t)}function _g(t,n){n===0&&(n=Qo()),t=da(t,n),t!==null&&(Ra(t,n),Ji(t))}function qw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),_g(t,l)}function Hw(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),_g(t,l)}function $w(t,n){return wn(t,n)}var tc=null,Wr=null,mf=!1,nc=!1,hf=!1,gl=0;function Ji(t){t!==Wr&&t.next===null&&(Wr===null?tc=Wr=t:Wr=Wr.next=t),nc=!0,mf||(mf=!0,Vw())}function co(t,n){if(!hf&&nc){hf=!0;do for(var l=!1,o=tc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var m=0;else{var v=o.suspendedLanes,E=o.pingedLanes;m=(1<<31-st(42|t)+1)-1,m&=f&~(v&~E),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Og(o,m))}else m=Qe,m=yi(o,o===ht?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||ot(o,m)||(l=!0,Og(o,m));o=o.next}while(l);hf=!1}}function Gw(){Dg()}function Dg(){nc=mf=!1;var t=0;gl!==0&&ek()&&(t=gl);for(var n=Lt(),l=null,o=tc;o!==null;){var f=o.next,m=Rg(o,n);m===0?(o.next=null,l===null?tc=f:l.next=f,f===null&&(Wr=l)):(l=o,(t!==0||(m&3)!==0)&&(nc=!0)),o=f}Pt!==0&&Pt!==5||co(t),gl!==0&&(gl=0)}function Rg(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var v=31-st(m),E=1<<v,U=f[v];U===-1?((E&l)===0||(E&o)!==0)&&(f[v]=_l(E,n)):U<=n&&(t.expiredLanes|=E),m&=~E}if(n=ht,l=Qe,l=yi(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(ut===2||ut===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&hi(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ot(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&hi(o),us(l)){case 2:case 8:l=me;break;case 32:l=Re;break;case 268435456:l=Ie;break;default:l=Re}return o=Mg.bind(null,t),l=wn(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&hi(o),t.callbackPriority=2,t.callbackNode=null,2}function Mg(t,n){if(Pt!==0&&Pt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(ec()&&t.callbackNode!==l)return null;var o=Qe;return o=yi(t,t===ht?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(mg(t,o,n),Rg(t,Lt()),t.callbackNode!=null&&t.callbackNode===l?Mg.bind(null,t):null)}function Og(t,n){if(ec())return null;mg(t,n,!0)}function Vw(){nk(function(){(rt&6)!==0?wn(ne,Gw):Dg()})}function gf(){if(gl===0){var t=be;t===0&&(t=Al,Al<<=1,(Al&261888)===0&&(Al=256)),gl=t}return gl}function zg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ua(""+t)}function Lg(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 Pw(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var m=zg((f[Nt]||null).action),v=o.submitter;v&&(n=(n=v[Nt]||null)?zg(n.formAction):v.getAttribute("formAction"),n!==null&&(m=n,v=null));var E=new Pn("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(gl!==0){var U=v?Lg(f,v):new FormData(f);zd(l,{pending:!0,data:U,method:f.method,action:m},null,U)}}else typeof m=="function"&&(E.preventDefault(),U=v?Lg(f,v):new FormData(f),zd(l,{pending:!0,data:U,method:f.method,action:m},m,U))},currentTarget:f}]})}}for(var yf=0;yf<Os.length;yf++){var xf=Os[yf],Yw=xf.toLowerCase(),Fw=xf[0].toUpperCase()+xf.slice(1);jn(Yw,"on"+Fw)}jn(Ms,"onAnimationEnd"),jn(Qa,"onAnimationIteration"),jn(Wi,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(cd,"onTransitionRun"),jn(dd,"onTransitionStart"),jn(fd,"onTransitionCancel"),jn(xu,"onTransitionEnd"),Oa("onMouseEnter",["mouseout","mouseover"]),Oa("onMouseLeave",["mouseout","mouseover"]),Oa("onPointerEnter",["pointerout","pointerover"]),Oa("onPointerLeave",["pointerout","pointerover"]),qi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qi("onBeforeInput",["compositionend","keypress","textInput","paste"]),qi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="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(" "),Ww=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function Ig(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 m=void 0;if(n)for(var v=o.length-1;0<=v;v--){var E=o[v],U=E.instance,F=E.currentTarget;if(E=E.listener,U!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=F;try{m(f)}catch(ie){Fl(ie)}f.currentTarget=null,m=U}else for(v=0;v<o.length;v++){if(E=o[v],U=E.instance,F=E.currentTarget,E=E.listener,U!==m&&f.isPropagationStopped())break e;m=E,f.currentTarget=F;try{m(f)}catch(ie){Fl(ie)}f.currentTarget=null,m=U}}}}function We(t,n){var l=n[Ii];l===void 0&&(l=n[Ii]=new Set);var o=t+"__bubble";l.has(o)||(Ug(n,t,2,!1),l.add(o))}function bf(t,n,l){var o=0;n&&(o|=4),Ug(l,t,o,n)}var ic="_reactListening"+Math.random().toString(36).slice(2);function vf(t){if(!t[ic]){t[ic]=!0,bi.forEach(function(l){l!=="selectionchange"&&(Ww.has(l)||bf(l,!1,t),bf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ic]||(n[ic]=!0,bf("selectionchange",!1,n))}}function Ug(t,n,l,o){switch(py(n)){case 2:var f=kk;break;case 8:f=jk;break;default:f=zf}l=f.bind(null,n,l,t),f=void 0,!Ll||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 wf(t,n,l,o,f){var m=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 U=v.tag;if((U===3||U===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;E!==null;){if(v=Ui(E),v===null)return;if(U=v.tag,U===5||U===6||U===26||U===27){o=m=v;continue e}E=E.parentNode}}o=o.return}hs(function(){var F=m,ie=zl(l),re=[];e:{var W=bu.get(t);if(W!==void 0){var Q=Pn,ve=t;switch(t){case"keypress":if(qa(l)===0)break e;case"keydown":case"keyup":Q=Jc;break;case"focusin":ve="focus",Q=Ee;break;case"focusout":ve="blur",Q=Ee;break;case"beforeblur":case"afterblur":Q=Ee;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":Q=Il;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=ys;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=vs;break;case Ms:case Qa:case Wi:Q=Si;break;case xu:Q=ks;break;case"scroll":case"scrollend":Q=un;break;case"wheel":Q=jr;break;case"copy":case"cut":case"paste":Q=bs;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Pa;break;case"toggle":case"beforetoggle":Q=$l}var Oe=(n&4)!==0,pt=!Oe&&(t==="scroll"||t==="scrollend"),$=Oe?W!==null?W+"Capture":null:W;Oe=[];for(var H=F,Y;H!==null;){var ae=H;if(Y=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||Y===null||$===null||(ae=Gi(H,$),ae!=null&&Oe.push(po(H,ae,Y))),pt)break;H=H.return}0<Oe.length&&(W=new Q(W,ve,null,l,ie),re.push({event:W,listeners:Oe}))}}if((n&7)===0){e:{if(W=t==="mouseover"||t==="pointerover",Q=t==="mouseout"||t==="pointerout",W&&l!==ps&&(ve=l.relatedTarget||l.fromElement)&&(Ui(ve)||ve[Bn]))break e;if((Q||W)&&(W=ie.window===ie?ie:(W=ie.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ve=l.relatedTarget||l.toElement,Q=F,ve=ve?Ui(ve):null,ve!==null&&(pt=c(ve),Oe=ve.tag,ve!==pt||Oe!==5&&Oe!==27&&Oe!==6)&&(ve=null)):(Q=null,ve=F),Q!==ve)){if(Oe=Il,ae="onMouseLeave",$="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(Oe=Pa,ae="onPointerLeave",$="onPointerEnter",H="pointer"),pt=Q==null?W:ra(Q),Y=ve==null?W:ra(ve),W=new Oe(ae,H+"leave",Q,l,ie),W.target=pt,W.relatedTarget=Y,ae=null,Ui(ie)===F&&(Oe=new Oe($,H+"enter",ve,l,ie),Oe.target=Y,Oe.relatedTarget=pt,ae=Oe),pt=ae,Q&&ve)t:{for(Oe=Kw,$=Q,H=ve,Y=0,ae=$;ae;ae=Oe(ae))Y++;ae=0;for(var _e=H;_e;_e=Oe(_e))ae++;for(;0<Y-ae;)$=Oe($),Y--;for(;0<ae-Y;)H=Oe(H),ae--;for(;Y--;){if($===H||H!==null&&$===H.alternate){Oe=$;break t}$=Oe($),H=Oe(H)}Oe=null}else Oe=null;Q!==null&&Bg(re,W,Q,Oe,!1),ve!==null&&pt!==null&&Bg(re,pt,ve,Oe,!0)}}e:{if(W=F?ra(F):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var at=cu;else if(Ts(W))if(Tr)at=sd;else{at=fu;var Ce=ld}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?F&&ii(F.elementType)&&(at=cu):at=rd;if(at&&(at=at(t,F))){Cr(re,at,l,ie);break e}Ce&&Ce(t,W,F),t==="focusout"&&F&&W.type==="number"&&F.memoizedProps.value!=null&&ds(W,"number",W.value)}switch(Ce=F?ra(F):window,t){case"focusin":(Ts(Ce)||Ce.contentEditable==="true")&&(Ka=Ce,Ds=F,Yl=null);break;case"focusout":Yl=Ds=Ka=null;break;case"mousedown":Rs=!0;break;case"contextmenu":case"mouseup":case"dragend":Rs=!1,yu(re,l,ie);break;case"selectionchange":if(ud)break;case"keydown":case"keyup":yu(re,l,ie)}var Ge;if(Ss)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 Fa?uu(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(Yi&&l.locale!=="ko"&&(Fa||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Fa&&(Ge=br()):(Vn=ie,xr="value"in Vn?Vn.value:Vn.textContent,Fa=!0)),Ce=ac(F,Ze),0<Ce.length&&(Ze=new nt(Ze,t,null,l,ie),re.push({event:Ze,listeners:Ce}),Ge?Ze.data=Ge:(Ge=cn(l),Ge!==null&&(Ze.data=Ge)))),(Ge=Cs?id(t,l):Sr(t,l))&&(Ze=ac(F,"onBeforeInput"),0<Ze.length&&(Ce=new nt("onBeforeInput","beforeinput",null,l,ie),re.push({event:Ce,listeners:Ze}),Ce.data=Ge)),Pw(re,t,F,l,ie)}Ig(re,n)})}function po(t,n,l){return{instance:t,listener:n,currentTarget:l}}function ac(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Gi(t,l),f!=null&&o.unshift(po(t,f,m)),f=Gi(t,n),f!=null&&o.push(po(t,f,m))),t.tag===3)return o;t=t.return}return[]}function Kw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Bg(t,n,l,o,f){for(var m=n._reactName,v=[];l!==null&&l!==o;){var E=l,U=E.alternate,F=E.stateNode;if(E=E.tag,U!==null&&U===o)break;E!==5&&E!==26&&E!==27||F===null||(U=F,f?(F=Gi(l,m),F!=null&&v.unshift(po(l,F,U))):f||(F=Gi(l,m),F!=null&&v.push(po(l,F,U)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var Xw=/\r\n?/g,Qw=/\u0000|\uFFFD/g;function qg(t){return(typeof t=="string"?t:""+t).replace(Xw,`
|
|
50
|
+
`).replace(Qw,"")}function Hg(t,n){return n=qg(n),qg(t)===n}function ft(t,n,l,o,f,m){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Hi(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Hi(t,""+o);break;case"className":ei(t,"class",o);break;case"tabIndex":ei(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ei(t,l,o);break;case"style":$n(t,o,m);break;case"data":if(n!=="object"){ei(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 m=="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=Gn);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),qn(t,"popover",o);break;case"xlinkActuate":vi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":vi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":vi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":vi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":vi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":vi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":vi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":vi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":vi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":qn(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=fs.get(l)||l,qn(t,l,o))}}function kf(t,n,l,o,f,m){switch(l){case"style":$n(t,o,m);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"?Hi(t,o):(typeof o=="number"||typeof o=="bigint")&&Hi(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=Gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),m=t[Nt]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(n,m,f),typeof o=="function")){typeof m!="function"&&m!==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,""):qn(t,l,o)}}}function an(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,m;for(m in l)if(l.hasOwnProperty(m)){var v=l[m];if(v!=null)switch(m){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,m,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=m=v=f=null,U=null,F=null;for(o in l)if(l.hasOwnProperty(o)){var ie=l[o];if(ie!=null)switch(o){case"name":f=ie;break;case"type":v=ie;break;case"checked":U=ie;break;case"defaultChecked":F=ie;break;case"value":m=ie;break;case"defaultValue":E=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,n));break;default:ft(t,n,o,ie,l,null)}}La(t,m,E,U,F,v,f,!1);return;case"select":We("invalid",t),o=v=m=null;for(f in l)if(l.hasOwnProperty(f)&&(E=l[f],E!=null))switch(f){case"value":m=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:ft(t,n,f,E,l,null)}n=m,l=v,t.multiple=!!o,n!=null?wi(t,!!o,n,!1):l!=null&&wi(t,!!o,l,!0);return;case"textarea":We("invalid",t),m=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":m=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:ft(t,n,v,E,l,null)}yr(t,o,f,m);return;case"option":for(U in l)if(l.hasOwnProperty(U)&&(o=l[U],o!=null))switch(U){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,U,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<fo.length;o++)We(fo[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(F in l)if(l.hasOwnProperty(F)&&(o=l[F],o!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,F,o,l,null)}return;default:if(ii(n)){for(ie in l)l.hasOwnProperty(ie)&&(o=l[ie],o!==void 0&&kf(t,n,ie,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 Zw(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,m=null,v=null,E=null,U=null,F=null,ie=null;for(Q in l){var re=l[Q];if(l.hasOwnProperty(Q)&&re!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":U=re;default:o.hasOwnProperty(Q)||ft(t,n,Q,null,o,re)}}for(var W in o){var Q=o[W];if(re=l[W],o.hasOwnProperty(W)&&(Q!=null||re!=null))switch(W){case"type":m=Q;break;case"name":f=Q;break;case"checked":F=Q;break;case"defaultChecked":ie=Q;break;case"value":v=Q;break;case"defaultValue":E=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:Q!==re&&ft(t,n,W,Q,o,re)}}gr(t,v,E,U,F,ie,m,f);return;case"select":Q=v=E=W=null;for(m in l)if(U=l[m],l.hasOwnProperty(m)&&U!=null)switch(m){case"value":break;case"multiple":Q=U;default:o.hasOwnProperty(m)||ft(t,n,m,null,o,U)}for(f in o)if(m=o[f],U=l[f],o.hasOwnProperty(f)&&(m!=null||U!=null))switch(f){case"value":W=m;break;case"defaultValue":E=m;break;case"multiple":v=m;default:m!==U&&ft(t,n,f,m,o,U)}n=E,l=v,o=Q,W!=null?wi(t,!!l,W,!1):!!o!=!!l&&(n!=null?wi(t,!!l,n,!0):wi(t,!!l,l?[]:"",!1));return;case"textarea":Q=W=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],m=l[v],o.hasOwnProperty(v)&&(f!=null||m!=null))switch(v){case"value":W=f;break;case"defaultValue":Q=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&ft(t,n,v,f,o,m)}Ia(t,W,Q);return;case"option":for(var ve in l)if(W=l[ve],l.hasOwnProperty(ve)&&W!=null&&!o.hasOwnProperty(ve))switch(ve){case"selected":t.selected=!1;break;default:ft(t,n,ve,null,o,W)}for(U in o)if(W=o[U],Q=l[U],o.hasOwnProperty(U)&&W!==Q&&(W!=null||Q!=null))switch(U){case"selected":t.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:ft(t,n,U,W,o,Q)}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)W=l[Oe],l.hasOwnProperty(Oe)&&W!=null&&!o.hasOwnProperty(Oe)&&ft(t,n,Oe,null,o,W);for(F in o)if(W=o[F],Q=l[F],o.hasOwnProperty(F)&&W!==Q&&(W!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,n));break;default:ft(t,n,F,W,o,Q)}return;default:if(ii(n)){for(var pt in l)W=l[pt],l.hasOwnProperty(pt)&&W!==void 0&&!o.hasOwnProperty(pt)&&kf(t,n,pt,void 0,o,W);for(ie in o)W=o[ie],Q=l[ie],!o.hasOwnProperty(ie)||W===Q||W===void 0&&Q===void 0||kf(t,n,ie,W,o,Q);return}}for(var $ in l)W=l[$],l.hasOwnProperty($)&&W!=null&&!o.hasOwnProperty($)&&ft(t,n,$,null,o,W);for(re in o)W=o[re],Q=l[re],!o.hasOwnProperty(re)||W===Q||W==null&&Q==null||ft(t,n,re,W,o,Q)}function $g(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jw(){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],m=f.transferSize,v=f.initiatorType,E=f.duration;if(m&&E&&$g(v)){for(v=0,E=f.responseEnd,o+=1;o<l.length;o++){var U=l[o],F=U.startTime;if(F>E)break;var ie=U.transferSize,re=U.initiatorType;ie&&$g(re)&&(U=U.responseEnd,v+=ie*(U<E?1:(E-F)/(U-F)))}if(--o,n+=8*(m+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 jf=null,Sf=null;function lc(t){return t.nodeType===9?t:t.ownerDocument}function Gg(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 Vg(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 Cf(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 Tf=null;function ek(){var t=window.event;return t&&t.type==="popstate"?t===Tf?!1:(Tf=t,!0):(Tf=null,!1)}var Pg=typeof setTimeout=="function"?setTimeout:void 0,tk=typeof clearTimeout=="function"?clearTimeout:void 0,Yg=typeof Promise=="function"?Promise:void 0,nk=typeof queueMicrotask=="function"?queueMicrotask:typeof Yg<"u"?function(t){return Yg.resolve(null).then(t).catch(ik)}:Pg;function ik(t){setTimeout(function(){throw t})}function yl(t){return t==="head"}function Fg(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),Zr(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")mo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,mo(l);for(var m=l.firstChild;m;){var v=m.nextSibling,E=m.nodeName;m[xi]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=v}}else l==="body"&&mo(t.ownerDocument.body);l=f}while(l);Zr(n)}function Wg(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 Ef(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":Ef(l),Rl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function ak(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[xi])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==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(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=di(t.nextSibling),t===null)break}return null}function lk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=di(t.nextSibling),t===null))return null;return t}function Kg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=di(t.nextSibling),t===null))return null;return t}function Af(t){return t.data==="$?"||t.data==="$~"}function Nf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rk(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 di(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 _f=null;function Xg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return di(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Qg(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 Zg(t,n,l){switch(n=lc(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 mo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Rl(t)}var fi=new Map,Jg=new Set;function rc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ea=oe.d;oe.d={f:sk,r:ok,D:uk,C:ck,L:dk,m:fk,X:mk,S:pk,M:hk};function sk(){var t=Ea.f(),n=Qu();return t||n}function ok(t){var n=Bi(t);n!==null&&n.tag===5&&n.type==="form"?gh(n):Ea.r(t)}var Kr=typeof document>"u"?null:document;function ey(t,n,l){var o=Kr;if(o&&typeof n=="string"&&n){var f=Ft(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Jg.has(f)||(Jg.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function uk(t){Ea.D(t),ey("dns-prefetch",t,null)}function ck(t,n){Ea.C(t,n),ey("preconnect",t,n)}function dk(t,n,l){Ea.L(t,n,l);var o=Kr;if(o&&t&&n){var f='link[rel="preload"][as="'+Ft(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Ft(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Ft(l.imageSizes)+'"]')):f+='[href="'+Ft(t)+'"]';var m=f;switch(n){case"style":m=Xr(t);break;case"script":m=Qr(t)}fi.has(m)||(t=y({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),fi.set(m,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(ho(m))||n==="script"&&o.querySelector(go(m))||(n=o.createElement("link"),an(n,"link",t),_t(n),o.head.appendChild(n)))}}function fk(t,n){Ea.m(t,n);var l=Kr;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Ft(o)+'"][href="'+Ft(t)+'"]',m=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Qr(t)}if(!fi.has(m)&&(t=y({rel:"modulepreload",href:t},n),fi.set(m,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(go(m)))return}o=l.createElement("link"),an(o,"link",t),_t(o),l.head.appendChild(o)}}}function pk(t,n,l){Ea.S(t,n,l);var o=Kr;if(o&&t){var f=Ma(o).hoistableStyles,m=Xr(t);n=n||"default";var v=f.get(m);if(!v){var E={loading:0,preload:null};if(v=o.querySelector(ho(m)))E.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":n},l),(l=fi.get(m))&&Df(t,l);var U=v=o.createElement("link");_t(U),an(U,"link",t),U._p=new Promise(function(F,ie){U.onload=F,U.onerror=ie}),U.addEventListener("load",function(){E.loading|=1}),U.addEventListener("error",function(){E.loading|=2}),E.loading|=4,sc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},f.set(m,v)}}}function mk(t,n){Ea.X(t,n);var l=Kr;if(l&&t){var o=Ma(l).hoistableScripts,f=Qr(t),m=o.get(f);m||(m=l.querySelector(go(f)),m||(t=y({src:t,async:!0},n),(n=fi.get(f))&&Rf(t,n),m=l.createElement("script"),_t(m),an(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function hk(t,n){Ea.M(t,n);var l=Kr;if(l&&t){var o=Ma(l).hoistableScripts,f=Qr(t),m=o.get(f);m||(m=l.querySelector(go(f)),m||(t=y({src:t,async:!0,type:"module"},n),(n=fi.get(f))&&Rf(t,n),m=l.createElement("script"),_t(m),an(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function ty(t,n,l,o){var f=(f=Z.current)?rc(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=Xr(l.href),l=Ma(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=Xr(l.href);var m=Ma(f).hoistableStyles,v=m.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,v),(m=f.querySelector(ho(t)))&&!m._p&&(v.instance=m,v.state.loading=5),fi.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},fi.set(t,l),m||gk(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=Qr(l),l=Ma(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 Xr(t){return'href="'+Ft(t)+'"'}function ho(t){return'link[rel="stylesheet"]['+t+"]"}function ny(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function gk(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}),an(n,"link",l),_t(n),t.head.appendChild(n))}function Qr(t){return'[src="'+Ft(t)+'"]'}function go(t){return"script[async]"+t}function iy(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Ft(l.href)+'"]');if(o)return n.instance=o,_t(o),o;var f=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),_t(o),an(o,"style",f),sc(o,l.precedence,t),n.instance=o;case"stylesheet":f=Xr(l.href);var m=t.querySelector(ho(f));if(m)return n.state.loading|=4,n.instance=m,_t(m),m;o=ny(l),(f=fi.get(f))&&Df(o,f),m=(t.ownerDocument||t).createElement("link"),_t(m);var v=m;return v._p=new Promise(function(E,U){v.onload=E,v.onerror=U}),an(m,"link",o),n.state.loading|=4,sc(m,l.precedence,t),n.instance=m;case"script":return m=Qr(l.src),(f=t.querySelector(go(m)))?(n.instance=f,_t(f),f):(o=l,(f=fi.get(m))&&(o=y({},l),Rf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),_t(f),an(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,sc(o,l.precedence,t));return n.instance}function sc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,m=f,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)m=E;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Df(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var oc=null;function ay(t,n,l){if(oc===null){var o=new Map,f=oc=new Map;f.set(l,o)}else f=oc,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 m=l[f];if(!(m[xi]||m[bt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var v=m.getAttribute(n)||"";v=t+v;var E=o.get(v);E?E.push(m):o.set(v,[m])}}return o}function ly(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function yk(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 ry(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function xk(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=Xr(o.href),m=n.querySelector(ho(f));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=uc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=m,_t(m);return}m=n.ownerDocument||n,o=ny(o),(f=fi.get(f))&&Df(o,f),m=m.createElement("link"),_t(m);var v=m;v._p=new Promise(function(E,U){v.onload=E,v.onerror=U}),an(m,"link",o),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=uc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Mf=0;function bk(t,n){return t.stylesheets&&t.count===0&&dc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+n);0<t.imgBytes&&Mf===0&&(Mf=62500*Jw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&dc(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Mf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cc=null;function dc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cc=new Map,n.forEach(vk,t),cc=null,uc.call(t))}function vk(t,n){if(!(n.state.loading&4)){var l=cc.get(t);if(l)var o=l.get(null);else{l=new Map,cc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var v=f[m];(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"),m=l.get(v)||o,m===o&&l.set(null,f),l.set(v,f),this.count++,o=uc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var yo={$$typeof:B,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function wk(t,n,l,o,f,m,v,E,U){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=la(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=la(0),this.hiddenUpdates=la(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function sy(t,n,l,o,f,m,v,E,U,F,ie,re){return t=new wk(t,n,l,v,U,F,ie,re,E),n=1,m===!0&&(n|=24),m=xn(3,null,null,n),t.current=m,m.stateNode=t,n=C(),n.refCount++,t.pooledCache=n,n.refCount++,m.memoizedState={element:o,isDehydrated:l,cache:n},hd(m),t}function oy(t){return t?(t=fa,t):fa}function uy(t,n,l,o,f,m){f=oy(f),o.context===null?o.context=f:o.pendingContext=f,o=rl(n),o.payload={element:l},m=m===void 0?null:m,m!==null&&(o.callback=m),l=sl(t,o,n),l!==null&&(On(l,t,n),Ws(l,t,n))}function cy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Of(t,n){cy(t,n),(t=t.alternate)&&cy(t,n)}function dy(t){if(t.tag===13||t.tag===31){var n=da(t,67108864);n!==null&&On(n,t,67108864),Of(t,67108864)}}function fy(t){if(t.tag===13||t.tag===31){var n=Qn();n=fr(n);var l=da(t,n);l!==null&&On(l,t,n),Of(t,n)}}var fc=!0;function kk(t,n,l,o){var f=V.T;V.T=null;var m=oe.p;try{oe.p=2,zf(t,n,l,o)}finally{oe.p=m,V.T=f}}function jk(t,n,l,o){var f=V.T;V.T=null;var m=oe.p;try{oe.p=8,zf(t,n,l,o)}finally{oe.p=m,V.T=f}}function zf(t,n,l,o){if(fc){var f=Lf(o);if(f===null)wf(t,n,o,pc,l),my(t,o);else if(Ck(f,t,n,l,o))o.stopPropagation();else if(my(t,o),n&4&&-1<Sk.indexOf(t)){for(;f!==null;){var m=Bi(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=$t(m.pendingLanes);if(v!==0){var E=m;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var U=1<<31-st(v);E.entanglements[1]|=U,v&=~U}Ji(m),(rt&6)===0&&(Ku=Lt()+500,co(0))}}break;case 31:case 13:E=da(m,2),E!==null&&On(E,m,2),Qu(),Of(m,2)}if(m=Lf(o),m===null&&wf(t,n,o,pc,l),m===f)break;f=m}f!==null&&o.stopPropagation()}else wf(t,n,o,null,l)}}function Lf(t){return t=zl(t),If(t)}var pc=null;function If(t){if(pc=null,t=Ui(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 pc=t,null}function py(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(_a()){case ne:return 2;case me:return 8;case Re:case Ne:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Uf=!1,xl=null,bl=null,vl=null,xo=new Map,bo=new Map,wl=[],Sk="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 my(t,n){switch(t){case"focusin":case"focusout":xl=null;break;case"dragenter":case"dragleave":bl=null;break;case"mouseover":case"mouseout":vl=null;break;case"pointerover":case"pointerout":xo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(n.pointerId)}}function vo(t,n,l,o,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:m,targetContainers:[f]},n!==null&&(n=Bi(n),n!==null&&dy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Ck(t,n,l,o,f){switch(n){case"focusin":return xl=vo(xl,t,n,l,o,f),!0;case"dragenter":return bl=vo(bl,t,n,l,o,f),!0;case"mouseover":return vl=vo(vl,t,n,l,o,f),!0;case"pointerover":var m=f.pointerId;return xo.set(m,vo(xo.get(m)||null,t,n,l,o,f)),!0;case"gotpointercapture":return m=f.pointerId,bo.set(m,vo(bo.get(m)||null,t,n,l,o,f)),!0}return!1}function hy(t){var n=Ui(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,eu(t.priority,function(){fy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,eu(t.priority,function(){fy(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 mc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Lf(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);ps=o,l.target.dispatchEvent(o),ps=null}else return n=Bi(l),n!==null&&dy(n),t.blockedOn=l,!1;n.shift()}return!0}function gy(t,n,l){mc(t)&&l.delete(n)}function Tk(){Uf=!1,xl!==null&&mc(xl)&&(xl=null),bl!==null&&mc(bl)&&(bl=null),vl!==null&&mc(vl)&&(vl=null),xo.forEach(gy),bo.forEach(gy)}function hc(t,n){t.blockedOn===n&&(t.blockedOn=null,Uf||(Uf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Tk)))}var gc=null;function yy(t){gc!==t&&(gc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gc===t&&(gc=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(If(o||l)===null)continue;break}var m=Bi(l);m!==null&&(t.splice(n,3),n-=3,zd(m,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function Zr(t){function n(U){return hc(U,t)}xl!==null&&hc(xl,t),bl!==null&&hc(bl,t),vl!==null&&hc(vl,t),xo.forEach(n),bo.forEach(n);for(var l=0;l<wl.length;l++){var o=wl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<wl.length&&(l=wl[0],l.blockedOn===null);)hy(l),l.blockedOn===null&&wl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],m=l[o+1],v=f[Nt]||null;if(typeof m=="function")v||yy(l);else if(v){var E=null;if(m&&m.hasAttribute("formAction")){if(f=m,v=m[Nt]||null)E=v.formAction;else if(If(f)!==null)continue}else E=v.action;typeof E=="function"?l[o+1]=E:(l.splice(o,3),o-=3),yy(l)}}}function xy(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.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 m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.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 Bf(t){this._internalRoot=t}yc.prototype.render=Bf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Qn();uy(l,o,t,n,null,null)},yc.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;uy(t.current,2,null,t,null,null),Qu(),n[Bn]=null}};function yc(t){this._internalRoot=t}yc.prototype.unstable_scheduleHydration=function(t){if(t){var n=pr();t={blockedOn:null,target:t,priority:n};for(var l=0;l<wl.length&&n!==0&&n<wl[l].priority;l++);wl.splice(l,0,t),l===0&&hy(t)}};var by=i.version;if(by!=="19.2.7")throw Error(r(527,by,"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=h(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Ek={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xc.isDisabled&&xc.supportsFiber)try{tt=xc.inject(Ek),St=xc}catch{}}return ko.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Th,m=Eh,v=Ah;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&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=sy(t,1,!1,null,null,l,o,null,f,m,v,xy),t[Bn]=n.current,vf(t),new Bf(n)},ko.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",m=Th,v=Eh,E=Ah,U=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(U=l.formState)),n=sy(t,1,!0,n,l??null,o,f,U,m,v,E,xy),n.context=oy(null),l=n.current,o=Qn(),o=fr(o),f=rl(o),f.callback=null,sl(l,f,o),l=o,n.current.lanes=l,Ra(n,l),Ji(n),t[Bn]=n.current,vf(t),new yc(n)},ko.version="19.2.7",ko}var _y;function Hk(){if(_y)return $f.exports;_y=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(),$f.exports=qk(),$f.exports}var $k=Hk();function Gk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const Vk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yk={};function Dy(e,i){return(Yk.jsx?Pk:Vk).test(e)}const Fk=/[ \t\n\f\r]/g;function Wk(e){return typeof e=="object"?e.type==="text"?Ry(e.value):!1:Ry(e)}function Ry(e){return e.replace(Fk,"")===""}class Wo{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Wo.prototype.normal={};Wo.prototype.property={};Wo.prototype.space=void 0;function fb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new Wo(a,r,i)}function Dp(e){return e.toLowerCase()}class In{constructor(i,a){this.attribute=a,this.property=i}}In.prototype.attribute="";In.prototype.booleanish=!1;In.prototype.boolean=!1;In.prototype.commaOrSpaceSeparated=!1;In.prototype.commaSeparated=!1;In.prototype.defined=!1;In.prototype.mustUseProperty=!1;In.prototype.number=!1;In.prototype.overloadedBoolean=!1;In.prototype.property="";In.prototype.spaceSeparated=!1;In.prototype.space=void 0;let Kk=0;const Be=dr(),qt=dr(),Rp=dr(),de=dr(),gt=dr(),sr=dr(),Zn=dr();function dr(){return 2**++Kk}const Mp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Be,booleanish:qt,commaOrSpaceSeparated:Zn,commaSeparated:sr,number:de,overloadedBoolean:Rp,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),Yf=Object.keys(Mp);class nm extends In{constructor(i,a,r,u){let c=-1;if(super(i,a),My(this,"space",u),typeof r=="number")for(;++c<Yf.length;){const d=Yf[c];My(this,Yf[c],(r&Mp[d])===Mp[d])}}}nm.prototype.defined=!0;function My(e,i,a){a&&(e[i]=a)}function rs(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new nm(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Dp(r)]=r,a[Dp(c.attribute)]=r}return new Wo(i,a,e.space)}const pb=rs({properties:{ariaActiveDescendant:null,ariaAtomic:qt,ariaAutoComplete:null,ariaBusy:qt,ariaChecked:qt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:qt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:qt,ariaFlowTo:gt,ariaGrabbed:qt,ariaHasPopup:null,ariaHidden:qt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:de,ariaLive:null,ariaModal:qt,ariaMultiLine:qt,ariaMultiSelectable:qt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:qt,ariaReadOnly:qt,ariaRelevant:null,ariaRequired:qt,ariaRoleDescription:gt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:qt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function mb(e,i){return i in e?e[i]:i}function hb(e,i){return mb(e,i.toLowerCase())}const Xk=rs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:sr,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:Be,allowPaymentRequest:Be,allowUserMedia:Be,alpha:Be,alt:null,as:null,async:Be,autoCapitalize:null,autoComplete:gt,autoFocus:Be,autoPlay:Be,blocking:gt,capture:null,charSet:null,checked:Be,cite:null,className:gt,closedBy:null,colorSpace:null,cols:de,colSpan:de,command:null,commandFor:null,content:null,contentEditable:qt,controls:Be,controlsList:gt,coords:de|sr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Be,defer:Be,dir:null,dirName:null,disabled:Be,download:Rp,draggable:qt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Be,formTarget:null,headers:gt,height:de,hidden:Rp,high:de,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:Be,inputMode:null,integrity:null,is:null,isMap:Be,itemId:null,itemProp:gt,itemRef:gt,itemScope:Be,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Be,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Be,muted:Be,name:null,nonce:null,noModule:Be,noValidate:Be,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:Be,optimum:de,pattern:null,ping:gt,placeholder:null,playsInline:Be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Be,referrerPolicy:null,rel:gt,required:Be,reversed:Be,rows:de,rowSpan:de,sandbox:gt,scope:null,scoped:Be,seamless:Be,selected:Be,shadowRootClonable:Be,shadowRootCustomElementRegistry:Be,shadowRootDelegatesFocus:Be,shadowRootMode:null,shadowRootSerializable:Be,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:qt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Be,useMap:null,value:qt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Be,declare:Be,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Be,noHref:Be,noShade:Be,noWrap:Be,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:qt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Be,disablePictureInPicture:Be,disableRemotePlayback:Be,exportParts:sr,part:gt,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:hb}),Qk=rs({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:Zn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Be,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:sr,g2:sr,glyphName:sr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Zn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,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:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zn,rev:Zn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zn,requiredFeatures:Zn,requiredFonts:Zn,requiredFormats:Zn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Zn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mb}),gb=rs({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()}}),yb=rs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hb}),xb=rs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Zk={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"},Jk=/[A-Z]/g,Oy=/-[a-z]/g,ej=/^data[-\w.:]+$/i;function tj(e,i){const a=Dp(i);let r=i,u=In;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&ej.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(Oy,ij);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!Oy.test(c)){let d=c.replace(Jk,nj);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=nm}return new u(r,i)}function nj(e){return"-"+e.toLowerCase()}function ij(e){return e.charAt(1).toUpperCase()}const aj=fb([pb,Xk,gb,yb,xb],"html"),im=fb([pb,Qk,gb,yb,xb],"svg");function lj(e){return e.join(" ").trim()}var Jr={},Ff,zy;function rj(){if(zy)return Ff;zy=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
|
+
`,h="/",b="*",y="",j="comment",w="declaration";function T(z,N){if(typeof z!="string")throw new TypeError("First argument must be a string");if(!z)return[];N=N||{};var G=1,B=1;function P(ge){var ue=ge.match(i);ue&&(G+=ue.length);var V=ge.lastIndexOf(g);B=~V?ge.length-V:B+ge.length}function se(){var ge={line:G,column:B};return function(ue){return ue.position=new _(ge),J(),ue}}function _(ge){this.start=ge,this.end={line:G,column:B},this.source=N.source}_.prototype.content=z;function X(ge){var ue=new Error(N.source+":"+G+":"+B+": "+ge);if(ue.reason=ge,ue.filename=N.source,ue.line=G,ue.column=B,ue.source=z,!N.silent)throw ue}function le(ge){var ue=ge.exec(z);if(ue){var V=ue[0];return P(V),z=z.slice(V.length),ue}}function J(){le(a)}function I(ge){var ue;for(ge=ge||[];ue=te();)ue!==!1&&ge.push(ue);return ge}function te(){var ge=se();if(!(h!=z.charAt(0)||b!=z.charAt(1))){for(var ue=2;y!=z.charAt(ue)&&(b!=z.charAt(ue)||h!=z.charAt(ue+1));)++ue;if(ue+=2,y===z.charAt(ue-1))return X("End of comment missing");var V=z.slice(2,ue-2);return B+=2,P(V),z=z.slice(ue),B+=2,ge({type:j,comment:V})}}function ce(){var ge=se(),ue=le(r);if(ue){if(te(),!le(u))return X("property missing ':'");var V=le(c),oe=ge({type:w,property:R(ue[0].replace(e,y)),value:V?R(V[0].replace(e,y)):y});return le(d),oe}}function Te(){var ge=[];I(ge);for(var ue;ue=ce();)ue!==!1&&(ge.push(ue),I(ge));return ge}return J(),Te()}function R(z){return z?z.replace(p,y):y}return Ff=T,Ff}var Ly;function sj(){if(Ly)return Jr;Ly=1;var e=Jr&&Jr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.default=a;const i=e(rj());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:h,value:b}=g;p?u(h,b,g):b&&(c=c||{},c[h]=b)}),c}return Jr}var jo={},Iy;function oj(){if(Iy)return jo;Iy=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(h){return!h||a.test(h)||e.test(h)},d=function(h,b){return b.toUpperCase()},p=function(h,b){return"".concat(b,"-")},g=function(h,b){return b===void 0&&(b={}),c(h)?h:(h=h.toLowerCase(),b.reactCompat?h=h.replace(u,p):h=h.replace(r,p),h.replace(i,d))};return jo.camelCase=g,jo}var So,Uy;function uj(){if(Uy)return So;Uy=1;var e=So&&So.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(sj()),a=oj();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,So=r,So}var cj=uj();const dj=db(cj),bb=vb("end"),am=vb("start");function vb(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 fj(e){const i=am(e),a=bb(e);if(i&&a)return{start:i,end:a}}function Uo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?By(e.position):"start"in e||"end"in e?By(e):"line"in e||"column"in e?Op(e):""}function Op(e){return qy(e&&e.line)+":"+qy(e&&e.column)}function By(e){return Op(e&&e.start)+"-"+Op(e&&e.end)}function qy(e){return e&&typeof e=="number"?e:1}class hn 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=Uo(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}}hn.prototype.file="";hn.prototype.name="";hn.prototype.reason="";hn.prototype.message="";hn.prototype.stack="";hn.prototype.column=void 0;hn.prototype.line=void 0;hn.prototype.ancestors=void 0;hn.prototype.cause=void 0;hn.prototype.fatal=void 0;hn.prototype.place=void 0;hn.prototype.ruleId=void 0;hn.prototype.source=void 0;const lm={}.hasOwnProperty,pj=new Map,mj=/[A-Z]/g,hj=new Set(["table","tbody","thead","tfoot","tr"]),gj=new Set(["td","th"]),wb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yj(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=Cj(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=Sj(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"?im:aj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=kb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function kb(e,i,a){if(i.type==="element")return xj(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return bj(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return wj(e,i,a);if(i.type==="mdxjsEsm")return vj(e,i);if(i.type==="root")return kj(e,i,a);if(i.type==="text")return jj(e,i)}function xj(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=im,e.schema=u),e.ancestors.push(i);const c=Sb(e,i.tagName,!1),d=Tj(e,i);let p=sm(e,i);return hj.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Wk(g):!0})),jb(e,d,c,i),rm(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function bj(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)}Yo(e,i.position)}function vj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Yo(e,i.position)}function wj(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=im,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Sb(e,i.name,!0),d=Ej(e,i),p=sm(e,i);return jb(e,d,c,i),rm(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function kj(e,i,a){const r={};return rm(r,sm(e,i)),e.create(i,e.Fragment,r,a)}function jj(e,i){return i.value}function jb(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function rm(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function Sj(e,i,a){return r;function r(u,c,d,p){const h=Array.isArray(d.children)?a:i;return p?h(c,d,p):h(c,d)}}function Cj(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=am(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 Tj(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&lm.call(i.properties,u)){const c=Aj(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&gj.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 Ej(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 Yo(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 Yo(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function sm(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:pj;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 h=u.get(g)||0;d=g+"-"+h,u.set(g,h+1)}}const p=kb(e,c,d);p!==void 0&&a.push(p)}return a}function Aj(e,i,a){const r=tj(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Gk(a):lj(a)),r.property==="style"){let u=typeof a=="object"?a:Nj(e,String(a));return e.stylePropertyNameCase==="css"&&(u=_j(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Zk[r.property]||r.property:r.attribute,a]}}function Nj(e,i){try{return dj(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new hn("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=wb+"#cannot-parse-style-attribute",u}}function Sb(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=Dy(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=Dy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return lm.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yo(e)}function Yo(e,i){const a=new hn("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=wb+"#cannot-handle-mdx-estrees-without-createevaluater",a}function _j(e){const i={};let a;for(a in e)lm.call(e,a)&&(i[Dj(a)]=e[a]);return i}function Dj(e){let i=e.replace(mj,Rj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Rj(e){return"-"+e.toLowerCase()}const Wf={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"]},Mj={};function om(e,i){const a=Mj,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Cb(e,r,u)}function Cb(e,i,a){if(Oj(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 Hy(e.children,i,a)}return Array.isArray(e)?Hy(e,i,a):""}function Hy(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Cb(e[u],i,a);return r.join("")}function Oj(e){return!!(e&&typeof e=="object")}const $y=document.createElement("i");function um(e){const i="&"+e+";";$y.innerHTML=i;const a=$y.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Jn(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 pi(e,i){return e.length>0?(Jn(e,e.length,0,i),e):i}const Gy={}.hasOwnProperty;function Tb(e){const i={};let a=-1;for(;++a<e.length;)zj(i,e[a]);return i}function zj(e,i){let a;for(a in i){const u=(Gy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Gy.call(u,d)||(u[d]=[]);const p=c[d];Lj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Lj(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Jn(e,0,0,r)}function Eb(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 Oi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=El(/[A-Za-z]/),mn=El(/[\dA-Za-z]/),Ij=El(/[#-'*+\--9=?A-Z^-~]/);function zc(e){return e!==null&&(e<32||e===127)}const zp=El(/\d/),Uj=El(/[\dA-Fa-f]/),Bj=El(/[!-/:-@[-`{-~]/);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 Gc=El(new RegExp("\\p{P}|\\p{S}","u")),or=El(/\s/);function El(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ss(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&mn(e.charCodeAt(a+1))&&mn(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 et(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 qj={tokenize:Hj};function Hj(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"),et(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 $j={tokenize:Gj},Vy={tokenize:Vj};function Gj(e){const i=this,a=[];let r=0,u,c,d;return p;function p(B){if(r<a.length){const P=a[r];return i.containerState=P[1],e.attempt(P[0].continuation,g,h)(B)}return h(B)}function g(B){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&G();const P=i.events.length;let se=P,_;for(;se--;)if(i.events[se][0]==="exit"&&i.events[se][1].type==="chunkFlow"){_=i.events[se][1].end;break}N(r);let X=P;for(;X<i.events.length;)i.events[X][1].end={..._},X++;return Jn(i.events,se+1,0,i.events.slice(P)),i.events.length=X,h(B)}return p(B)}function h(B){if(r===a.length){if(!u)return j(B);if(u.currentConstruct&&u.currentConstruct.concrete)return T(B);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Vy,b,y)(B)}function b(B){return u&&G(),N(r),j(B)}function y(B){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,T(B)}function j(B){return i.containerState={},e.attempt(Vy,w,T)(B)}function w(B){return r++,a.push([i.currentConstruct,i.containerState]),j(B)}function T(B){if(B===null){u&&G(),N(0),e.consume(B);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R(B)}function R(B){if(B===null){z(e.exit("chunkFlow"),!0),N(0),e.consume(B);return}return Me(B)?(e.consume(B),z(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(B),R)}function z(B,P){const se=i.sliceStream(B);if(P&&se.push(null),B.previous=c,c&&(c.next=B),c=B,u.defineSkip(B.start),u.write(se),i.parser.lazy[B.start.line]){let _=u.events.length;for(;_--;)if(u.events[_][1].start.offset<d&&(!u.events[_][1].end||u.events[_][1].end.offset>d))return;const X=i.events.length;let le=X,J,I;for(;le--;)if(i.events[le][0]==="exit"&&i.events[le][1].type==="chunkFlow"){if(J){I=i.events[le][1].end;break}J=!0}for(N(r),_=X;_<i.events.length;)i.events[_][1].end={...I},_++;Jn(i.events,le+1,0,i.events.slice(X)),i.events.length=_}}function N(B){let P=a.length;for(;P-- >B;){const se=a[P];i.containerState=se[1],se[0].exit.call(i,e)}a.length=B}function G(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function Vj(e,i,a){return et(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function as(e){if(e===null||yt(e)||or(e))return 1;if(Gc(e))return 2}function Vc(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 Lp={name:"attention",resolveAll:Pj,tokenize:Yj};function Pj(e,i){let a=-1,r,u,c,d,p,g,h,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 y={...e[r][1].end},j={...e[a][1].start};Py(y,-g),Py(j,g),d={type:g>1?"strongSequence":"emphasisSequence",start:y,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},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=pi(h,[["enter",e[r][1],i],["exit",e[r][1],i]])),h=pi(h,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),h=pi(h,Vc(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),h=pi(h,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,h=pi(h,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Jn(e,r-1,a-r+3,h),a=r+h.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function Yj(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=as(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 h=e.exit("attentionSequence"),b=as(g),y=!b||b===2&&u||a.includes(g),j=!u||u===2&&b||a.includes(r);return h._open=!!(c===42?y:y&&(u||!j)),h._close=!!(c===42?j:j&&(b||!y)),i(g)}}function Py(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const Fj={name:"autolink",tokenize:Wj};function Wj(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 vn(w)?(e.consume(w),d):w===64?a(w):h(w)}function d(w){return w===43||w===45||w===46||mn(w)?(r=1,p(w)):h(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||mn(w))&&r++<32?(e.consume(w),p):(r=0,h(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||zc(w)?a(w):(e.consume(w),g)}function h(w){return w===64?(e.consume(w),b):Ij(w)?(e.consume(w),h):a(w)}function b(w){return mn(w)?y(w):a(w)}function y(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||mn(w))&&r++<63){const T=w===45?j:y;return e.consume(w),T}return a(w)}}const Ko={partial:!0,tokenize:Kj};function Kj(e,i,a){return r;function r(c){return Ke(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Me(c)?i(c):a(c)}}const Ab={continuation:{tokenize:Qj},exit:Zj,name:"blockQuote",tokenize:Xj};function Xj(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 Qj(e,i,a){const r=this;return u;function u(d){return Ke(d)?et(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Ab,i,a)(d)}}function Zj(e){e.exit("blockQuote")}const Nb={name:"characterEscape",tokenize:Jj};function Jj(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 Bj(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const _b={name:"characterReference",tokenize:eS};function eS(e,i,a){const r=this;let u=0,c,d;return p;function p(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),g}function g(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),c=31,d=mn,b(y))}function h(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Uj,b):(e.enter("characterReferenceValue"),c=7,d=zp,b(y))}function b(y){if(y===59&&u){const j=e.exit("characterReferenceValue");return d===mn&&!um(r.sliceSerialize(j))?a(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(y)&&u++<c?(e.consume(y),b):a(y)}}const Yy={partial:!0,tokenize:nS},Fy={concrete:!0,name:"codeFenced",tokenize:tS};function tS(e,i,a){const r=this,u={partial:!0,tokenize:se};let c=0,d=0,p;return g;function g(_){return h(_)}function h(_){const X=r.events[r.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,p=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===p?(d++,e.consume(_),b):d<3?a(_):(e.exit("codeFencedFenceSequence"),Ke(_)?et(e,y,"whitespace")(_):y(_))}function y(_){return _===null||Me(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(Yy,R,P)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(_))}function j(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(_)):Ke(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(_)):_===96&&_===p?a(_):(e.consume(_),j)}function w(_){return _===null||Me(_)?y(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(_))}function T(_){return _===null||Me(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(_)):_===96&&_===p?a(_):(e.consume(_),T)}function R(_){return e.attempt(u,P,z)(_)}function z(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return c>0&&Ke(_)?et(e,G,"linePrefix",c+1)(_):G(_)}function G(_){return _===null||Me(_)?e.check(Yy,R,P)(_):(e.enter("codeFlowValue"),B(_))}function B(_){return _===null||Me(_)?(e.exit("codeFlowValue"),G(_)):(e.consume(_),B)}function P(_){return e.exit("codeFenced"),i(_)}function se(_,X,le){let J=0;return I;function I(ue){return _.enter("lineEnding"),_.consume(ue),_.exit("lineEnding"),te}function te(ue){return _.enter("codeFencedFence"),Ke(ue)?et(_,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):ce(ue)}function ce(ue){return ue===p?(_.enter("codeFencedFenceSequence"),Te(ue)):le(ue)}function Te(ue){return ue===p?(J++,_.consume(ue),Te):J>=d?(_.exit("codeFencedFenceSequence"),Ke(ue)?et(_,ge,"whitespace")(ue):ge(ue)):le(ue)}function ge(ue){return ue===null||Me(ue)?(_.exit("codeFencedFence"),X(ue)):le(ue)}}}function nS(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 Kf={name:"codeIndented",tokenize:aS},iS={partial:!0,tokenize:lS};function aS(e,i,a){const r=this;return u;function u(h){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(h)}function c(h){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(h):a(h)}function d(h){return h===null?g(h):Me(h)?e.attempt(iS,d,g)(h):(e.enter("codeFlowValue"),p(h))}function p(h){return h===null||Me(h)?(e.exit("codeFlowValue"),d(h)):(e.consume(h),p)}function g(h){return e.exit("codeIndented"),i(h)}}function lS(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):et(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 rS={name:"codeText",previous:oS,resolve:sS,tokenize:uS};function sS(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 oS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uS(e,i,a){let r=0,u,c;return d;function d(y){return e.enter("codeText"),e.enter("codeTextSequence"),p(y)}function p(y){return y===96?(e.consume(y),r++,p):(e.exit("codeTextSequence"),g(y))}function g(y){return y===null?a(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),g):y===96?(c=e.enter("codeTextSequence"),u=0,b(y)):Me(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("codeTextData"),h(y))}function h(y){return y===null||y===32||y===96||Me(y)?(e.exit("codeTextData"),g(y)):(e.consume(y),h)}function b(y){return y===96?(e.consume(y),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(y)):(c.type="codeTextData",h(y))}}class cS{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&&Co(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),Co(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Co(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);Co(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Co(this.left,a.reverse())}}}function Co(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 Db(e){const i={};let a=-1,r,u,c,d,p,g,h;const b=new cS(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,dS(b,a)),a=i[a],h=!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 Jn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!h}function dS(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=[],h={};let b,y,j=-1,w=a,T=0,R=0;const z=[R];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),y&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),y=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,z.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):z.pop(),j=z.length;j--;){const N=p.slice(z[j],z[j+1]),G=c.pop();g.push([G,G+N.length-1]),e.splice(G,2,N)}for(g.reverse(),j=-1;++j<g.length;)h[T+g[j][0]]=T+g[j][1],T+=g[j][1]-g[j][0]-1;return h}const fS={resolve:mS,tokenize:hS},pS={partial:!0,tokenize:gS};function mS(e){return Db(e),e}function hS(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(pS,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 gS(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),et(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 Rb(e,i,a,r,u,c,d,p,g){const h=g||Number.POSITIVE_INFINITY;let b=0;return y;function y(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||zc(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<h&&N===40?(e.consume(N),b++,R):N===41?(e.consume(N),b--,R):N===null||N===32||N===40||zc(N)?a(N):(e.consume(N),N===92?z:R)}function z(N){return N===40||N===41||N===92?(e.consume(N),R):R(N)}}function Mb(e,i,a,r,u,c){const d=this;let p=0,g;return h;function h(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"}),y(w))}function y(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:y)}function j(w){return w===91||w===92||w===93?(e.consume(w),p++,y):y(w)}}function Ob(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),h(j))}function h(j){return j===d?(e.exit(c),g(d)):j===null?a(j):Me(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===d||j===null||Me(j)?(e.exit("chunkString"),h(j)):(e.consume(j),j===92?y:b)}function y(j){return j===d||j===92?(e.consume(j),b):b(j)}}function Bo(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)?et(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const yS={name:"definition",tokenize:bS},xS={partial:!0,tokenize:vS};function bS(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Mb.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=Oi(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)?Bo(e,h)(w):h(w)}function h(w){return Rb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(xS,y,y)(w)}function y(w){return Ke(w)?et(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 vS(e,i,a){return r;function r(p){return yt(p)?Bo(e,u)(p):a(p)}function u(p){return Ob(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return Ke(p)?et(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Me(p)?i(p):a(p)}}const wS={name:"hardBreakEscape",tokenize:kS};function kS(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 jS={name:"headingAtx",resolve:SS,tokenize:CS};function SS(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"},Jn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function CS(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)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),h(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function h(b){return b===null||b===35||yt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),h)}}const TS=["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"],Wy=["pre","script","style","textarea"],ES={concrete:!0,name:"htmlFlow",resolveTo:_S,tokenize:DS},AS={partial:!0,tokenize:MS},NS={partial:!0,tokenize:RS};function _S(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 DS(e,i,a){const r=this;let u,c,d,p,g;return h;function h(S){return b(S)}function b(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),y}function y(S){return S===33?(e.consume(S),j):S===47?(e.consume(S),c=!0,R):S===63?(e.consume(S),u=3,r.interrupt?i:O):vn(S)?(e.consume(S),d=String.fromCharCode(S),z):a(S)}function j(S){return S===45?(e.consume(S),u=2,w):S===91?(e.consume(S),u=5,p=0,T):vn(S)?(e.consume(S),u=4,r.interrupt?i:O):a(S)}function w(S){return S===45?(e.consume(S),r.interrupt?i:O):a(S)}function T(S){const K="CDATA[";return S===K.charCodeAt(p++)?(e.consume(S),p===K.length?r.interrupt?i:ce:T):a(S)}function R(S){return vn(S)?(e.consume(S),d=String.fromCharCode(S),z):a(S)}function z(S){if(S===null||S===47||S===62||yt(S)){const K=S===47,he=d.toLowerCase();return!K&&!c&&Wy.includes(he)?(u=1,r.interrupt?i(S):ce(S)):TS.includes(d.toLowerCase())?(u=6,K?(e.consume(S),N):r.interrupt?i(S):ce(S)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(S):c?G(S):B(S))}return S===45||mn(S)?(e.consume(S),d+=String.fromCharCode(S),z):a(S)}function N(S){return S===62?(e.consume(S),r.interrupt?i:ce):a(S)}function G(S){return Ke(S)?(e.consume(S),G):I(S)}function B(S){return S===47?(e.consume(S),I):S===58||S===95||vn(S)?(e.consume(S),P):Ke(S)?(e.consume(S),B):I(S)}function P(S){return S===45||S===46||S===58||S===95||mn(S)?(e.consume(S),P):se(S)}function se(S){return S===61?(e.consume(S),_):Ke(S)?(e.consume(S),se):B(S)}function _(S){return S===null||S===60||S===61||S===62||S===96?a(S):S===34||S===39?(e.consume(S),g=S,X):Ke(S)?(e.consume(S),_):le(S)}function X(S){return S===g?(e.consume(S),g=null,J):S===null||Me(S)?a(S):(e.consume(S),X)}function le(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||yt(S)?se(S):(e.consume(S),le)}function J(S){return S===47||S===62||Ke(S)?B(S):a(S)}function I(S){return S===62?(e.consume(S),te):a(S)}function te(S){return S===null||Me(S)?ce(S):Ke(S)?(e.consume(S),te):a(S)}function ce(S){return S===45&&u===2?(e.consume(S),V):S===60&&u===1?(e.consume(S),oe):S===62&&u===4?(e.consume(S),A):S===63&&u===3?(e.consume(S),O):S===93&&u===5?(e.consume(S),De):Me(S)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(AS,L,Te)(S)):S===null||Me(S)?(e.exit("htmlFlowData"),Te(S)):(e.consume(S),ce)}function Te(S){return e.check(NS,ge,L)(S)}function ge(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),ue}function ue(S){return S===null||Me(S)?Te(S):(e.enter("htmlFlowData"),ce(S))}function V(S){return S===45?(e.consume(S),O):ce(S)}function oe(S){return S===47?(e.consume(S),d="",ye):ce(S)}function ye(S){if(S===62){const K=d.toLowerCase();return Wy.includes(K)?(e.consume(S),A):ce(S)}return vn(S)&&d.length<8?(e.consume(S),d+=String.fromCharCode(S),ye):ce(S)}function De(S){return S===93?(e.consume(S),O):ce(S)}function O(S){return S===62?(e.consume(S),A):S===45&&u===2?(e.consume(S),O):ce(S)}function A(S){return S===null||Me(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),A)}function L(S){return e.exit("htmlFlow"),i(S)}}function RS(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 MS(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Ko,i,a)}}const OS={name:"htmlText",tokenize:zS};function zS(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),h):O===47?(e.consume(O),se):O===63?(e.consume(O),B):vn(O)?(e.consume(O),le):a(O)}function h(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,T):vn(O)?(e.consume(O),G):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function y(O){return O===null?a(O):O===45?(e.consume(O),j):Me(O)?(d=y,oe(O)):(e.consume(O),y)}function j(O){return O===45?(e.consume(O),w):y(O)}function w(O){return O===62?V(O):O===45?j(O):y(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),z):Me(O)?(d=R,oe(O)):(e.consume(O),R)}function z(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 G(O){return O===null||O===62?V(O):Me(O)?(d=G,oe(O)):(e.consume(O),G)}function B(O){return O===null?a(O):O===63?(e.consume(O),P):Me(O)?(d=B,oe(O)):(e.consume(O),B)}function P(O){return O===62?V(O):B(O)}function se(O){return vn(O)?(e.consume(O),_):a(O)}function _(O){return O===45||mn(O)?(e.consume(O),_):X(O)}function X(O){return Me(O)?(d=X,oe(O)):Ke(O)?(e.consume(O),X):V(O)}function le(O){return O===45||mn(O)?(e.consume(O),le):O===47||O===62||yt(O)?J(O):a(O)}function J(O){return O===47?(e.consume(O),V):O===58||O===95||vn(O)?(e.consume(O),I):Me(O)?(d=J,oe(O)):Ke(O)?(e.consume(O),J):V(O)}function I(O){return O===45||O===46||O===58||O===95||mn(O)?(e.consume(O),I):te(O)}function te(O){return O===61?(e.consume(O),ce):Me(O)?(d=te,oe(O)):Ke(O)?(e.consume(O),te):J(O)}function ce(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Te):Me(O)?(d=ce,oe(O)):Ke(O)?(e.consume(O),ce):(e.consume(O),ge)}function Te(O){return O===u?(e.consume(O),u=void 0,ue):O===null?a(O):Me(O)?(d=Te,oe(O)):(e.consume(O),Te)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||yt(O)?J(O):(e.consume(O),ge)}function ue(O){return O===47||O===62||yt(O)?J(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"),ye}function ye(O){return Ke(O)?et(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):De(O)}function De(O){return e.enter("htmlTextData"),d(O)}}const cm={name:"labelEnd",resolveAll:BS,resolveTo:qS,tokenize:HS},LS={tokenize:$S},IS={tokenize:GS},US={tokenize:VS};function BS(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&&Jn(e,0,e.length,a),e}function qS(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}},h={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",h,i]],p=pi(p,e.slice(c+1,c+r+3)),p=pi(p,[["enter",b,i]]),p=pi(p,Vc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=pi(p,[["exit",b,i],e[d-2],e[d-1],["exit",h,i]]),p=pi(p,e.slice(d+1)),p=pi(p,[["exit",g,i]]),Jn(e,c,e.length,p),e}function HS(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?y(j):(d=r.parser.defined.includes(Oi(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(LS,b,d?b:y)(j):j===91?e.attempt(IS,b,d?h:y)(j):d?b(j):y(j)}function h(j){return e.attempt(US,b,y)(j)}function b(j){return i(j)}function y(j){return c._balanced=!0,a(j)}}function $S(e,i,a){return r;function r(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),u}function u(y){return yt(y)?Bo(e,c)(y):c(y)}function c(y){return y===41?b(y):Rb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function d(y){return yt(y)?Bo(e,g)(y):b(y)}function p(y){return a(y)}function g(y){return y===34||y===39||y===40?Ob(e,h,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):b(y)}function h(y){return yt(y)?Bo(e,b)(y):b(y)}function b(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),i):a(y)}}function GS(e,i,a){const r=this;return u;function u(p){return Mb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(Oi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function VS(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 PS={name:"labelStartImage",resolveAll:cm.resolveAll,tokenize:YS};function YS(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 FS={name:"labelStartLink",resolveAll:cm.resolveAll,tokenize:WS};function WS(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 Xf={name:"lineEnding",tokenize:KS};function KS(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:XS};function XS(e,i,a){let r=0,u;return c;function c(h){return e.enter("thematicBreak"),d(h)}function d(h){return u=h,p(h)}function p(h){return h===u?(e.enter("thematicBreakSequence"),g(h)):r>=3&&(h===null||Me(h))?(e.exit("thematicBreak"),i(h)):a(h)}function g(h){return h===u?(e.consume(h),r++,g):(e.exit("thematicBreakSequence"),Ke(h)?et(e,p,"whitespace")(h):p(h))}}const zn={continuation:{tokenize:e0},exit:n0,name:"list",tokenize:JS},QS={partial:!0,tokenize:i0},ZS={partial:!0,tokenize:t0};function JS(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:zp(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(Nc,a,h)(w):h(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return zp(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"),h(w)):a(w)}function h(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Ko,r.interrupt?a:b,e.attempt(QS,j,y))}function b(w){return r.containerState.initialBlankLine=!0,c++,j(w)}function y(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 e0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Ko,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(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(ZS,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(zn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function t0(e,i,a){const r=this;return et(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 n0(e){e.exit(this.containerState.type)}function i0(e,i,a){const r=this;return et(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 Ky={name:"setextUnderline",resolveTo:a0,tokenize:l0};function a0(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 l0(e,i,a){const r=this;let u;return c;function c(h){let b=r.events.length,y;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){y=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||y)?(e.enter("setextHeadingLine"),u=h,d(h)):a(h)}function d(h){return e.enter("setextHeadingLineSequence"),p(h)}function p(h){return h===u?(e.consume(h),p):(e.exit("setextHeadingLineSequence"),Ke(h)?et(e,g,"lineSuffix")(h):g(h))}function g(h){return h===null||Me(h)?(e.exit("setextHeadingLine"),i(h)):a(h)}}const r0={tokenize:s0};function s0(e){const i=this,a=e.attempt(Ko,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(fS,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 o0={resolveAll:Lb()},u0=zb("string"),c0=zb("text");function zb(e){return{resolveAll:Lb(e==="text"?d0: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 h(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 h(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function h(b){if(b===null)return!0;const y=u[b];let j=-1;if(y)for(;++j<y.length;){const w=y[j];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Lb(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 d0(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 h=u[c];if(typeof h=="string"){for(d=h.length;h.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(h===-2)g=!0,p++;else if(h!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const h={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={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(a,0,["enter",h,i],["exit",h,i]),a+=2)}a++}return e}const f0={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:Ab},p0={91:yS},m0={[-2]:Kf,[-1]:Kf,32:Kf},h0={35:jS,42:Nc,45:[Ky,Nc],60:ES,61:Ky,95:Nc,96:Fy,126:Fy},g0={38:_b,92:Nb},y0={[-5]:Xf,[-4]:Xf,[-3]:Xf,33:PS,38:_b,42:Lp,60:[Fj,OS],91:FS,92:[wS,Nb],93:cm,95:Lp,96:rS},x0={null:[Lp,o0]},b0={null:[42,95]},v0={null:[]},w0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:b0,contentInitial:p0,disable:v0,document:f0,flow:h0,flowInitial:m0,insideSpan:x0,string:g0,text:y0},Symbol.toStringTag,{value:"Module"}));function k0(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:X(se),check:X(_),consume:G,enter:B,exit:P,interrupt:X(_,{interrupt:!0})},h={code:null,containerState:{},defineSkip:R,events:[],now:T,parser:e,previous:null,sliceSerialize:j,sliceStream:w,write:y};let b=i.tokenize.call(h,g);return i.resolveAll&&c.push(i),h;function y(te){return d=pi(d,te),z(),d[d.length-1]!==null?[]:(le(i,0),h.events=Vc(c,h.events,h),h.events)}function j(te,ce){return S0(w(te),ce)}function w(te){return j0(d,te)}function T(){const{_bufferIndex:te,_index:ce,line:Te,column:ge,offset:ue}=r;return{_bufferIndex:te,_index:ce,line:Te,column:ge,offset:ue}}function R(te){u[te.line]=te.column,I()}function z(){let te;for(;r._index<d.length;){const ce=d[r._index];if(typeof ce=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<ce.length;)N(ce.charCodeAt(r._bufferIndex));else N(ce)}}function N(te){b=b(te)}function G(te){Me(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,I()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=te}function B(te,ce){const Te=ce||{};return Te.type=te,Te.start=T(),h.events.push(["enter",Te,h]),p.push(Te),Te}function P(te){const ce=p.pop();return ce.end=T(),h.events.push(["exit",ce,h]),ce}function se(te,ce){le(te,ce.from)}function _(te,ce){ce.restore()}function X(te,ce){return Te;function Te(ge,ue,V){let oe,ye,De,O;return Array.isArray(ge)?L(ge):"tokenize"in ge?L([ge]):A(ge);function A(Z){return xe;function xe(Le){const Xe=Le!==null&&Z[Le],Ot=Le!==null&&Z.null,Yt=[...Array.isArray(Xe)?Xe:Xe?[Xe]:[],...Array.isArray(Ot)?Ot:Ot?[Ot]:[]];return L(Yt)(Le)}}function L(Z){return oe=Z,ye=0,Z.length===0?V:S(Z[ye])}function S(Z){return xe;function xe(Le){return O=J(),De=Z,Z.partial||(h.currentConstruct=Z),Z.name&&h.parser.constructs.disable.null.includes(Z.name)?he():Z.tokenize.call(ce?Object.assign(Object.create(h),ce):h,g,K,he)(Le)}}function K(Z){return te(De,O),ue}function he(Z){return O.restore(),++ye<oe.length?S(oe[ye]):V}}}function le(te,ce){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Jn(h.events,ce,h.events.length-ce,te.resolve(h.events.slice(ce),h)),te.resolveTo&&(h.events=te.resolveTo(h.events,h))}function J(){const te=T(),ce=h.previous,Te=h.currentConstruct,ge=h.events.length,ue=Array.from(p);return{from:ge,restore:V};function V(){r=te,h.previous=ce,h.currentConstruct=Te,h.events.length=ge,p=ue,I()}}function I(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function j0(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 S0(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 C0(e){const r={constructs:Tb([w0,...(e||{}).extensions||[]]),content:u(qj),defined:[],document:u($j),flow:u(r0),lazy:{},string:u(u0),text:u(c0)};return r;function u(c){return d;function d(p){return k0(r,c,p)}}}function T0(e){for(;!Db(e););return e}const Xy=/[\0\t\n\r]/g;function E0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let h,b,y,j,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),y=0,i="",a&&(c.charCodeAt(0)===65279&&y++,a=void 0);y<c.length;){if(Xy.lastIndex=y,h=Xy.exec(c),j=h&&h.index!==void 0?h.index:c.length,w=c.charCodeAt(j),!h){i=c.slice(y);break}if(w===10&&y===j&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),y<j&&(g.push(c.slice(y,j)),e+=j-y),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}y=j+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const A0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N0(e){return e.replace(A0,_0)}function _0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return Eb(a.slice(c?2:1),c?16:10)}return um(a)||e}const Ib={}.hasOwnProperty;function D0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),R0(a)(T0(C0(a).document().write(E0()(e,i,!0))))}function R0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(rn),autolinkProtocol:J,autolinkEmail:J,atxHeading:c(zt),blockQuote:c(Ot),characterEscape:J,characterReference:J,codeFenced:c(Yt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Yt,d),codeText:c(Pe,d),codeTextData:J,data:J,codeFlowValue:J,definition:c(Et),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Jt),hardBreakEscape:c(ln),hardBreakTrailing:c(ln),htmlFlow:c(ze,d),htmlFlowData:J,htmlText:c(ze,d),htmlTextData:J,image:c(wt),label:d,link:c(rn),listItem:c(hi),listItemValue:j,listOrdered:c(wn,y),listUnordered:c(wn),paragraph:c(gi),reference:S,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(zt),strong:c(zi),thematicBreak:c(_a)},exit:{atxHeading:g(),atxHeadingSequence:se,autolink:g(),autolinkEmail:Xe,autolinkProtocol:Le,blockQuote:g(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:Z,characterReference:xe,codeFenced:g(z),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:I,codeIndented:g(N),codeText:g(ue),codeTextData:I,data:I,definition:g(),definitionDestinationString:P,definitionLabelString:G,definitionTitleString:B,emphasis:g(),hardBreakEscape:g(ce),hardBreakTrailing:g(ce),htmlFlow:g(Te),htmlFlowData:I,htmlText:g(ge),htmlTextData:I,image:g(oe),label:De,labelText:ye,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:K,resourceDestinationString:O,resourceTitleString:A,resource:L,setextHeading:g(le),setextHeadingLineSequence:X,setextHeadingText:_,strong:g(),thematicBreak:g()}};Ub(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ne){let me={type:"root",children:[]};const Re={stack:[me],tokenStack:[],config:i,enter:p,exit:h,buffer:d,resume:b,data:a},Ne=[];let Ie=-1;for(;++Ie<ne.length;)if(ne[Ie][1].type==="listOrdered"||ne[Ie][1].type==="listUnordered")if(ne[Ie][0]==="enter")Ne.push(Ie);else{const At=Ne.pop();Ie=u(ne,At,Ie)}for(Ie=-1;++Ie<ne.length;){const At=i[ne[Ie][0]];Ib.call(At,ne[Ie][1].type)&&At[ne[Ie][1].type].call(Object.assign({sliceSerialize:ne[Ie][2].sliceSerialize},Re),ne[Ie][1])}if(Re.tokenStack.length>0){const At=Re.tokenStack[Re.tokenStack.length-1];(At[1]||Qy).call(Re,void 0,At[0])}for(me.position={start:jl(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:jl(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<i.transforms.length;)me=i.transforms[Ie](me)||me;return me}function u(ne,me,Re){let Ne=me-1,Ie=-1,At=!1,gn,tt,St,sn;for(;++Ne<=Re;){const st=ne[Ne];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?Ie++:Ie--,sn=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(gn&&!sn&&!Ie&&!St&&(St=Ne),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!Ie&&st[0]==="enter"&&st[1].type==="listItemPrefix"||Ie===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(gn){let Li=Ne;for(tt=void 0;Li--;){const Un=ne[Li];if(Un[1].type==="lineEnding"||Un[1].type==="lineEndingBlank"){if(Un[0]==="exit")continue;tt&&(ne[tt][1].type="lineEndingBlank",At=!0),Un[1].type="lineEnding",tt=Li}else if(!(Un[1].type==="linePrefix"||Un[1].type==="blockQuotePrefix"||Un[1].type==="blockQuotePrefixWhitespace"||Un[1].type==="blockQuoteMarker"||Un[1].type==="listItemIndent"))break}St&&(!tt||St<tt)&&(gn._spread=!0),gn.end=Object.assign({},tt?ne[tt][1].start:st[1].end),ne.splice(tt||Ne,0,["exit",gn,st[2]]),Ne++,Re++}if(st[1].type==="listItemPrefix"){const Li={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};gn=Li,ne.splice(Ne,0,["enter",Li,st[2]]),Ne++,Re++,St=void 0,sn=!0}}}return ne[me][1]._spread=At,Re}function c(ne,me){return Re;function Re(Ne){p.call(this,ne(Ne),Ne),me&&me.call(this,Ne)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ne,me,Re){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([me,Re||void 0]),ne.position={start:jl(me.start),end:void 0}}function g(ne){return me;function me(Re){ne&&ne.call(this,Re),h.call(this,Re)}}function h(ne,me){const Re=this.stack.pop(),Ne=this.tokenStack.pop();if(Ne)Ne[0].type!==ne.type&&(me?me.call(this,ne,Ne[0]):(Ne[1]||Qy).call(this,ne,Ne[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Uo({start:ne.start,end:ne.end})+"): it’s not open");Re.position.end=jl(ne.end)}function b(){return om(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function j(ne){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.lang=ne}function T(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.meta=ne}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function z(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne.replace(/(\r?\n|\r)$/g,"")}function G(ne){const me=this.resume(),Re=this.stack[this.stack.length-1];Re.label=me,Re.identifier=Oi(this.sliceSerialize(ne)).toLowerCase()}function B(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function P(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function se(ne){const me=this.stack[this.stack.length-1];if(!me.depth){const Re=this.sliceSerialize(ne).length;me.depth=Re}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function X(ne){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function le(){this.data.setextHeadingSlurpLineEnding=void 0}function J(ne){const Re=this.stack[this.stack.length-1].children;let Ne=Re[Re.length-1];(!Ne||Ne.type!=="text")&&(Ne=Lt(),Ne.position={start:jl(ne.start),end:void 0},Re.push(Ne)),this.stack.push(Ne)}function I(ne){const me=this.stack.pop();me.value+=this.sliceSerialize(ne),me.position.end=jl(ne.end)}function te(ne){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=me.children[me.children.length-1];Re.position.end=jl(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(me.type)&&(J.call(this,ne),I.call(this,ne))}function ce(){this.data.atHardBreak=!0}function Te(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function ge(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function ue(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.value=ne}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function oe(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=me,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function ye(ne){const me=this.sliceSerialize(ne),Re=this.stack[this.stack.length-2];Re.label=N0(me),Re.identifier=Oi(me).toLowerCase()}function De(){const ne=this.stack[this.stack.length-1],me=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Ne=ne.children;Re.children=Ne}else Re.alt=me}function O(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.url=ne}function A(){const ne=this.resume(),me=this.stack[this.stack.length-1];me.title=ne}function L(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function K(ne){const me=this.resume(),Re=this.stack[this.stack.length-1];Re.label=me,Re.identifier=Oi(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function he(ne){this.data.characterReferenceType=ne.type}function Z(ne){const me=this.sliceSerialize(ne),Re=this.data.characterReferenceType;let Ne;Re?(Ne=Eb(me,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=um(me);const Ie=this.stack[this.stack.length-1];Ie.value+=Ne}function xe(ne){const me=this.stack.pop();me.position.end=jl(ne.end)}function Le(ne){I.call(this,ne);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ne)}function Xe(ne){I.call(this,ne);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ne)}function Ot(){return{type:"blockquote",children:[]}}function Yt(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Jt(){return{type:"emphasis",children:[]}}function zt(){return{type:"heading",depth:0,children:[]}}function ln(){return{type:"break"}}function ze(){return{type:"html",value:""}}function wt(){return{type:"image",title:null,url:"",alt:null}}function rn(){return{type:"link",title:null,url:"",children:[]}}function wn(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function hi(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function gi(){return{type:"paragraph",children:[]}}function zi(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function _a(){return{type:"thematicBreak"}}}function jl(e){return{line:e.line,column:e.column,offset:e.offset}}function Ub(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Ub(e,r):M0(e,r)}}function M0(e,i){let a;for(a in i)if(Ib.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 Qy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Uo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Uo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Uo({start:i.start,end:i.end})+") is still open")}function O0(e){const i=this;i.parser=a;function a(r){return D0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function z0(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 L0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
54
|
+
`}]}function I0(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 U0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function B0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function q0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=ss(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 h={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,h),e.applyData(i,h)}function H0(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 $0(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Bb(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 G0(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Bb(e,i);const u={src:ss(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 V0(e,i){const a={src:ss(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 P0(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 Y0(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Bb(e,i);const u={href:ss(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 F0(e,i){const a={href:ss(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 W0(e,i,a){const r=e.all(i),u=a?K0(a):qb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let y;b&&b.type==="element"&&b.tagName==="p"?y=b:(y={type:"element",tagName:"p",properties:{},children:[]},r.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.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 h={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,h),e.applyData(i,h)}function K0(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=qb(a[r])}return i}function qb(e){const i=e.spread;return i??e.children.length>1}function X0(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 Q0(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Z0(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function J0(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function e1(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=am(i.children[1]),g=bb(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 t1(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 h=[];for(;++g<p;){const y=i.children[g],j={},w=d?d[g]:void 0;w&&(j.align=w);let T={type:"element",tagName:c,properties:j,children:[]};y&&(T.children=e.all(y),e.patch(y,T),T=e.applyData(y,T)),h.push(T)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(i,b),e.applyData(i,b)}function n1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const Zy=9,Jy=32;function i1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(ex(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(ex(i.slice(u),u>0,!1)),c.join("")}function ex(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Zy||c===Jy;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===Zy||c===Jy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function a1(e,i){const a={type:"text",value:i1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function l1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const r1={blockquote:z0,break:L0,code:I0,delete:U0,emphasis:B0,footnoteReference:q0,heading:H0,html:$0,imageReference:G0,image:V0,inlineCode:P0,linkReference:Y0,link:F0,listItem:W0,list:X0,paragraph:Q0,root:Z0,strong:J0,table:e1,tableCell:n1,tableRow:t1,text:a1,thematicBreak:l1,toml:vc,yaml:vc,definition:vc,footnoteDefinition:vc};function vc(){}const Hb=-1,Pc=0,qo=1,Lc=2,dm=3,fm=4,pm=5,mm=6,$b=7,Gb=8,s1=typeof self=="object"?self:globalThis,tx=(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 s1[e](i)},o1=(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 Pc:case Hb:return a(d,u);case qo:{const p=a([],u);for(const g of d)p.push(r(g));return p}case Lc:{const p=a({},u);for(const[g,h]of d)p[r(g)]=r(h);return p}case dm:return a(new Date(d),u);case fm:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case pm:{const p=a(new Map,u);for(const[g,h]of d)p.set(r(g),r(h));return p}case mm:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case $b:{const{name:p,message:g}=d;return a(tx(p,g),u)}case Gb: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(tx(c,d),u)};return r},nx=e=>o1(new Map,e)(0),ar="",{toString:u1}={},{keys:c1}=Object,To=e=>{const i=typeof e;if(i!=="object"||!e)return[Pc,i];const a=u1.call(e).slice(8,-1);switch(a){case"Array":return[qo,ar];case"Object":return[Lc,ar];case"Date":return[dm,ar];case"RegExp":return[fm,ar];case"Map":return[pm,ar];case"Set":return[mm,ar];case"DataView":return[qo,a]}return a.includes("Array")?[qo,a]:a.includes("Error")?[$b,a]:[Lc,a]},wc=([e,i])=>e===Pc&&(i==="function"||i==="symbol"),d1=(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]=To(d);switch(p){case Pc:{let b=d;switch(g){case"bigint":p=Gb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Hb],d)}return u([p,b],d)}case qo:{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=[],y=u([p,b],d);for(const j of d)b.push(c(j));return y}case Lc:{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=[],y=u([p,b],d);for(const j of c1(d))(e||!wc(To(d[j])))&&b.push([c(j),c(d[j])]);return y}case dm:return u([p,isNaN(d.getTime())?ar:d.toISOString()],d);case fm:{const{source:b,flags:y}=d;return u([p,{source:b,flags:y}],d)}case pm:{const b=[],y=u([p,b],d);for(const[j,w]of d)(e||!(wc(To(j))||wc(To(w))))&&b.push([c(j),c(w)]);return y}case mm:{const b=[],y=u([p,b],d);for(const j of d)(e||!wc(To(j)))&&b.push(c(j));return y}}const{message:h}=d;return u([p,{name:g,message:h}],d)};return c},ix=(e,{json:i,lossy:a}={})=>{const r=[];return d1(!(i||a),!!i,new Map,r)(e),r},Ic=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?nx(ix(e,i)):structuredClone(e):(e,i)=>nx(ix(e,i));function f1(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 p1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function m1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||f1,r=e.options.footnoteBackLabel||p1,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 h=e.footnoteById.get(e.footnoteOrder[g]);if(!h)continue;const b=e.all(h),y=String(h.identifier).toUpperCase(),j=ss(y.toLowerCase());let w=0;const T=[],R=e.footnoteCounts.get(y);for(;R!==void 0&&++w<=R;){T.length>0&&T.push({type:"text",value:" "});let G=typeof a=="string"?a:a(g,w);typeof G=="string"&&(G={type:"text",value:G}),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(G)?G:[G]})}const z=b[b.length-1];if(z&&z.type==="element"&&z.tagName==="p"){const G=z.children[z.children.length-1];G&&G.type==="text"?G.value+=" ":z.children.push({type:"text",value:" "}),z.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(h,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Ic(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 Yc=(function(e){if(e==null)return x1;if(typeof e=="function")return Fc(e);if(typeof e=="object")return Array.isArray(e)?h1(e):g1(e);if(typeof e=="string")return y1(e);throw new Error("Expected function, string, or object as test")});function h1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=Yc(e[a]);return Fc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function g1(e){const i=e;return Fc(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function y1(e){return Fc(i);function i(a){return a&&a.type===e}}function Fc(e){return i;function i(a,r,u){return!!(b1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function x1(){return!0}function b1(e){return e!==null&&typeof e=="object"&&"type"in e}const Vb=[],v1=!0,Ip=!1,w1="skip";function Pb(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=Yc(u),d=r?-1:1;p(e,void 0,[])();function p(g,h,b){const y=g&&typeof g=="object"?g:{};if(typeof y.type=="string"){const w=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return j;function j(){let w=Vb,T,R,z;if((!i||c(g,h,b[b.length-1]||void 0))&&(w=k1(a(g,b)),w[0]===Ip))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==w1)for(R=(r?N.children.length:-1)+d,z=b.concat(N);R>-1&&R<N.children.length;){const G=N.children[R];if(T=p(G,R,z)(),T[0]===Ip)return T;R=typeof T[1]=="number"?T[1]:R+d}}return w}}}function k1(e){return Array.isArray(e)?e:typeof e=="number"?[v1,e]:e==null?Vb:[e]}function hm(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),Pb(e,c,p,u);function p(g,h){const b=h[h.length-1],y=b?b.children.indexOf(g):void 0;return d(g,y,b)}}const Up={}.hasOwnProperty,j1={};function S1(e,i){const a=i||j1,r=new Map,u=new Map,c=new Map,d={...r1,...a.handlers},p={all:h,applyData:T1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:C1,wrap:A1};return hm(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const y=b.type==="definition"?r:u,j=String(b.identifier).toUpperCase();y.has(j)||y.set(j,b)}}),p;function g(b,y){const j=b.type,w=p.handlers[j];if(Up.call(p.handlers,j)&&w)return w(p,b,y);if(p.options.passThrough&&p.options.passThrough.includes(j)){if("children"in b){const{children:R,...z}=b,N=Ic(z);return N.children=p.all(b),N}return Ic(b)}return(p.options.unknownHandler||E1)(p,b,y)}function h(b){const y=[];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=ax(T.value)),!Array.isArray(T)&&T.type==="element")){const R=T.children[0];R&&R.type==="text"&&(R.value=ax(R.value))}Array.isArray(T)?y.push(...T):y.push(T)}}}return y}}function C1(e,i){e.position&&(i.position=fj(e))}function T1(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,Ic(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function E1(e,i){const a=i.data||{},r="value"in i&&!(Up.call(a,"hProperties")||Up.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 A1(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 ax(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function lx(e,i){const a=S1(e,i),r=a.one(e,void 0),u=m1(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 N1(e,i){return e&&"run"in e?async function(a,r){const u=lx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return lx(a,{file:r,...e||i})}}function rx(e){if(e)throw e}var Qf,sx;function _1(){if(sx)return Qf;sx=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(h){return typeof Array.isArray=="function"?Array.isArray(h):i.call(h)==="[object Array]"},c=function(h){if(!h||i.call(h)!=="[object Object]")return!1;var b=e.call(h,"constructor"),y=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!b&&!y)return!1;var j;for(j in h);return typeof j>"u"||e.call(h,j)},d=function(h,b){a&&b.name==="__proto__"?a(h,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):h[b.name]=b.newValue},p=function(h,b){if(b==="__proto__")if(e.call(h,b)){if(r)return r(h,b).value}else return;return h[b]};return Qf=function g(){var h,b,y,j,w,T,R=arguments[0],z=1,N=arguments.length,G=!1;for(typeof R=="boolean"&&(G=R,R=arguments[1]||{},z=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});z<N;++z)if(h=arguments[z],h!=null)for(b in h)y=p(R,b),j=p(h,b),R!==j&&(G&&j&&(c(j)||(w=u(j)))?(w?(w=!1,T=y&&u(y)?y:[]):T=y&&c(y)?y:{},d(R,{name:b,newValue:g(G,T,j)})):typeof j<"u"&&d(R,{name:b,newValue:j}));return R},Qf}var D1=_1();const Zf=db(D1);function Bp(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 R1(){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,...h){const b=e[++c];let y=-1;if(g){d(g);return}for(;++y<u.length;)(h[y]===null||h[y]===void 0)&&(h[y]=u[y]);u=h,b?M1(b,p)(...h):d(null,...h)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function M1(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(h){const b=h;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 ta={basename:O1,dirname:z1,extname:L1,join:I1,sep:"/"};function O1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Xo(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 z1(e){if(Xo(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 L1(e){Xo(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 I1(...e){let i=-1,a;for(;++i<e.length;)Xo(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":U1(a)}function U1(e){Xo(e);const i=e.codePointAt(0)===47;let a=B1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function B1(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 Xo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const q1={cwd:H1};function H1(){return"/"}function qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $1(e){if(typeof e=="string")e=new URL(e);else if(!qp(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 G1(e)}function G1(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 Jf=["history","path","basename","stem","extname","dirname"];class Yb{constructor(i){let a;i?qp(i)?a={path:i}:typeof i=="string"||V1(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":q1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jf.length;){const c=Jf[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)Jf.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?ta.basename(this.path):void 0}set basename(i){tp(i,"basename"),ep(i,"basename"),this.path=ta.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?ta.dirname(this.path):void 0}set dirname(i){ox(this.basename,"dirname"),this.path=ta.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?ta.extname(this.path):void 0}set extname(i){if(ep(i,"extname"),ox(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=ta.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){qp(i)&&(i=$1(i)),tp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?ta.basename(this.path,this.extname):void 0}set stem(i){tp(i,"stem"),ep(i,"stem"),this.path=ta.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 hn(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 ep(e,i){if(e&&e.includes(ta.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+ta.sep+"`")}function tp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function ox(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function V1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),Y1={}.hasOwnProperty;class gm extends P1{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=R1()}copy(){const i=new gm;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(Zf(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(ap("data",this.frozen),this.namespace[i]=a,this):Y1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(ap("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=kc(i),r=this.parser||this.Parser;return np("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),np("process",this.parser||this.Parser),ip("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=kc(i),g=r.parse(p);r.run(g,p,function(b,y,j){if(b||!y||!j)return h(b);const w=y,T=r.stringify(w,j);K1(T)?j.value=T:j.result=T,h(b,j)});function h(b,y){b||!y?d(b):c?c(y):a(void 0,y)}}}processSync(i){let a=!1,r;return this.freeze(),np("processSync",this.parser||this.Parser),ip("processSync",this.compiler||this.Compiler),this.process(i,u),cx("processSync","process",a),r;function u(c,d){a=!0,rx(c),r=d}}run(i,a,r){ux(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=kc(a);u.run(i,g,h);function h(b,y,j){const w=y||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),cx("runSync","run",r),u;function c(d,p){rx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=kc(a),u=this.compiler||this.Compiler;return ip("stringify",u),ux(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(ap("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(h){if(typeof h=="function")g(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[b,...y]=h;g(b,y)}else d(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function d(h){if(!("plugins"in h)&&!("settings"in h))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(h.plugins),h.settings&&(u.settings=Zf(!0,u.settings,h.settings))}function p(h){let b=-1;if(h!=null)if(Array.isArray(h))for(;++b<h.length;){const y=h[b];c(y)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function g(h,b){let y=-1,j=-1;for(;++y<r.length;)if(r[y][0]===h){j=y;break}if(j===-1)r.push([h,...b]);else if(b.length>0){let[w,...T]=b;const R=r[j][1];Bp(R)&&Bp(w)&&(w=Zf(!0,R,w)),r[j]=[h,w,...T]}}}}const F1=new gm().freeze();function np(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ap(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 ux(e){if(!Bp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function kc(e){return W1(e)?e:new Yb(e)}function W1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function K1(e){return typeof e=="string"||X1(e)}function X1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Q1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dx=[],fx={allowDangerousHtml:!0},Z1=/^(https?|ircs?|mailto|xmpp)$/i,J1=[{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 eC(e){const i=tC(e),a=nC(e);return iC(i.runSync(i.parse(a),a),e)}function tC(e){const i=e.rehypePlugins||dx,a=e.remarkPlugins||dx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fx}:fx;return F1().use(O0).use(a).use(N1,r).use(i)}function nC(e){const i=e.children||"",a=new Yb;return typeof i=="string"&&(a.value=i),a}function iC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||aC;for(const b of J1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Q1+b.id,void 0);return hm(e,h),yj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function h(b,y,j){if(b.type==="raw"&&j&&typeof y=="number")return d?j.children.splice(y,1):j.children[y]={type:"text",value:b.value},y;if(b.type==="element"){let w;for(w in Wf)if(Object.hasOwn(Wf,w)&&Object.hasOwn(b.properties,w)){const T=b.properties[w],R=Wf[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 y=="number"&&(w=!r(b,y,j)),w&&j&&typeof y=="number")return p&&b.children?j.children.splice(y,1,...b.children):j.children.splice(y,1),y}}}function aC(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||Z1.test(e.slice(0,i))?e:""}function px(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 lC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rC(e,i,a){const u=Yc((a||{}).ignore||[]),c=sC(i);let d=-1;for(;++d<c.length;)Pb(e,"text",p);function p(h,b){let y=-1,j;for(;++y<b.length;){const w=b[y],T=j?j.children:void 0;if(u(w,T?T.indexOf(w):void 0,j))return;j=w}if(j)return g(h,b)}function g(h,b){const y=b[b.length-1],j=c[d][0],w=c[d][1];let T=0;const z=y.children.indexOf(h);let N=!1,G=[];j.lastIndex=0;let B=j.exec(h.value);for(;B;){const P=B.index,se={index:B.index,input:B.input,stack:[...b,h]};let _=w(...B,se);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?j.lastIndex=P+1:(T!==P&&G.push({type:"text",value:h.value.slice(T,P)}),Array.isArray(_)?G.push(..._):_&&G.push(_),T=P+B[0].length,N=!0),!j.global)break;B=j.exec(h.value)}return N?(T<h.value.length&&G.push({type:"text",value:h.value.slice(T)}),y.children.splice(z,1,...G)):G=[h],z+G.length}}function sC(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([oC(u[0]),uC(u[1])])}return i}function oC(e){return typeof e=="string"?new RegExp(lC(e),"g"):e}function uC(e){return typeof e=="function"?e:function(){return e}}const lp="phrasing",rp=["autolink","link","image","label"];function cC(){return{transforms:[yC],enter:{literalAutolink:fC,literalAutolinkEmail:sp,literalAutolinkHttp:sp,literalAutolinkWww:sp},exit:{literalAutolink:gC,literalAutolinkEmail:hC,literalAutolinkHttp:pC,literalAutolinkWww:mC}}}function dC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lp,notInConstruct:rp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lp,notInConstruct:rp},{character:":",before:"[ps]",after:"\\/",inConstruct:lp,notInConstruct:rp}]}}function fC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sp(e){this.config.enter.autolinkProtocol.call(this,e)}function pC(e){this.config.exit.autolinkProtocol.call(this,e)}function mC(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 hC(e){this.config.exit.autolinkEmail.call(this,e)}function gC(e){this.exit(e)}function yC(e){rC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bC]],{ignore:["link","linkReference"]})}function xC(e,i,a,r,u){let c="";if(!Fb(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!vC(a)))return!1;const d=wC(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 bC(e,i,a,r){return!Fb(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function vC(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 wC(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=px(e,"(");let c=px(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 Fb(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||or(a)||Gc(a))&&(!i||a!==47)}Wb.peek=_C;function kC(){this.buffer()}function jC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SC(){this.buffer()}function CC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Oi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function EC(e){this.exit(e)}function AC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Oi(this.sliceSerialize(e)).toLowerCase(),a.label=i}function NC(e){this.exit(e)}function _C(){return"["}function Wb(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 DC(){return{enter:{gfmFootnoteCallString:kC,gfmFootnoteCall:jC,gfmFootnoteDefinitionLabelString:SC,gfmFootnoteDefinition:CC},exit:{gfmFootnoteCallString:TC,gfmFootnoteCall:EC,gfmFootnoteDefinitionLabelString:AC,gfmFootnoteDefinition:NC}}}function RC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Wb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const h=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?Kb:MC))),h(),g}}function MC(e,i,a){return i===0?e:Kb(e,i,a)}function Kb(e,i,a){return(a?"":" ")+e}const OC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xb.peek=BC;function zC(){return{canContainEols:["delete"],enter:{strikethrough:IC},exit:{strikethrough:UC}}}function LC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OC}],handlers:{delete:Xb}}}function IC(e){this.enter({type:"delete",children:[]},e)}function UC(e){this.exit(e)}function Xb(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 BC(){return"~"}function qC(e){return e.length}function HC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||qC,c=[],d=[],p=[],g=[];let h=0,b=-1;for(;++b<e.length;){const R=[],z=[];let N=-1;for(e[b].length>h&&(h=e[b].length);++N<e[b].length;){const G=$C(e[b][N]);if(a.alignDelimiters!==!1){const B=u(G);z[N]=B,(g[N]===void 0||B>g[N])&&(g[N]=B)}R.push(G)}d[b]=R,p[b]=z}let y=-1;if(typeof r=="object"&&"length"in r)for(;++y<h;)c[y]=mx(r[y]);else{const R=mx(r);for(;++y<h;)c[y]=R}y=-1;const j=[],w=[];for(;++y<h;){const R=c[y];let z="",N="";R===99?(z=":",N=":"):R===108?z=":":R===114&&(N=":");let G=a.alignDelimiters===!1?1:Math.max(1,g[y]-z.length-N.length);const B=z+"-".repeat(G)+N;a.alignDelimiters!==!1&&(G=z.length+G+N.length,G>g[y]&&(g[y]=G),w[y]=G),j[y]=B}d.splice(1,0,j),p.splice(1,0,w),b=-1;const T=[];for(;++b<d.length;){const R=d[b],z=p[b];y=-1;const N=[];for(;++y<h;){const G=R[y]||"";let B="",P="";if(a.alignDelimiters!==!1){const se=g[y]-(z[y]||0),_=c[y];_===114?B=" ".repeat(se):_===99?se%2?(B=" ".repeat(se/2+.5),P=" ".repeat(se/2-.5)):(B=" ".repeat(se/2),P=B):P=" ".repeat(se)}a.delimiterStart!==!1&&!y&&N.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&G==="")&&(a.delimiterStart!==!1||y)&&N.push(" "),a.alignDelimiters!==!1&&N.push(B),N.push(G),a.alignDelimiters!==!1&&N.push(P),a.padding!==!1&&N.push(" "),(a.delimiterEnd!==!1||y!==h-1)&&N.push("|")}T.push(a.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return T.join(`
|
|
65
|
+
`)}function $C(e){return e==null?"":String(e)}function mx(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 GC(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()),VC);return u(),d}function VC(e,i,a){return">"+(a?"":" ")+e}function PC(e,i){return hx(e,i.inConstruct,!0)&&!hx(e,i.notInConstruct,!1)}function hx(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 gx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
|
+
`&&PC(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
67
|
+
`}function YC(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 FC(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 WC(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 KC(e,i,a,r){const u=WC(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(FC(e,a)){const y=a.enter("codeIndented"),j=a.indentLines(c,XC);return y(),j}const p=a.createTracker(r),g=u.repeat(Math.max(YC(c,u)+1,3)),h=a.enter("codeFenced");let b=p.move(g);if(e.lang){const y=a.enter(`codeFencedLang${d}`);b+=p.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),y()}if(e.lang&&e.meta){const y=a.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(a.safe(e.meta,{before:b,after:`
|
|
68
|
+
`,encode:["`"],...p.current()})),y()}return b+=p.move(`
|
|
69
|
+
`),c&&(b+=p.move(c+`
|
|
70
|
+
`)),b+=p.move(g),h(),b}function XC(e,i,a){return(a?"":" ")+e}function ym(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 QC(e,i,a,r){const u=ym(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let h=g.move("[");return h+=g.move(a.safe(a.associationId(e),{before:h,after:"]",...g.current()})),h+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),h+=g.move("<"),h+=g.move(a.safe(e.url,{before:h,after:">",...g.current()})),h+=g.move(">")):(p=a.enter("destinationRaw"),h+=g.move(a.safe(e.url,{before:h,after:e.title?" ":`
|
|
71
|
+
`,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),h+=g.move(" "+u),h+=g.move(a.safe(e.title,{before:h,after:u,...g.current()})),h+=g.move(u),p()),d(),h}function ZC(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 Fo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Uc(e,i,a){const r=as(e),u=as(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}}Qb.peek=JC;function Qb(e,i,a,r){const u=ZC(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 h=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),h,u);b.inside&&(g=Fo(h)+g.slice(1));const y=g.charCodeAt(g.length-1),j=Uc(r.after.charCodeAt(0),y,u);j.inside&&(g=g.slice(0,-1)+Fo(y));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function JC(e,i,a){return a.options.emphasis||"*"}function eT(e,i){let a=!1;return hm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Ip}),!!((!e.depth||e.depth<3)&&om(e)&&(i.options.setext||a))}function tT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(eT(e,a)){const b=a.enter("headingSetext"),y=a.enter("phrasing"),j=a.containerPhrasing(e,{...c.current(),before:`
|
|
72
|
+
`,after:`
|
|
73
|
+
`});return y(),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 h=a.containerPhrasing(e,{before:"# ",after:`
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(h)&&(h=Fo(h.charCodeAt(0))+h.slice(1)),h=h?d+" "+h:d,a.options.closeAtx&&(h+=" "+d),g(),p(),h}Zb.peek=nT;function Zb(e){return e.value||""}function nT(){return"<"}Jb.peek=iT;function Jb(e,i,a,r){const u=ym(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let h=g.move("![");return h+=g.move(a.safe(e.alt,{before:h,after:"]",...g.current()})),h+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),h+=g.move("<"),h+=g.move(a.safe(e.url,{before:h,after:">",...g.current()})),h+=g.move(">")):(p=a.enter("destinationRaw"),h+=g.move(a.safe(e.url,{before:h,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),h+=g.move(" "+u),h+=g.move(a.safe(e.title,{before:h,after:u,...g.current()})),h+=g.move(u),p()),h+=g.move(")"),d(),h}function iT(){return"!"}ev.peek=aT;function ev(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 h=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(h+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const y=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!h||h!==y?g+=p.move(y+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function aT(){return"!"}tv.peek=lT;function tv(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 h=g.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(g.index+1)}}return u+r+u}function lT(){return"`"}function nv(e,i){const a=om(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))}iv.peek=rT;function iv(e,i,a,r){const u=ym(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(nv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let y=d.move("<");return y+=d.move(a.containerPhrasing(e,{before:y,after:">",...d.current()})),y+=d.move(">"),p(),a.stack=b,y}p=a.enter("link"),g=a.enter("label");let h=d.move("[");return h+=d.move(a.containerPhrasing(e,{before:h,after:"](",...d.current()})),h+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),h+=d.move("<"),h+=d.move(a.safe(e.url,{before:h,after:">",...d.current()})),h+=d.move(">")):(g=a.enter("destinationRaw"),h+=d.move(a.safe(e.url,{before:h,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),h+=d.move(" "+u),h+=d.move(a.safe(e.title,{before:h,after:u,...d.current()})),h+=d.move(u),g()),h+=d.move(")"),p(),h}function rT(e,i,a){return nv(e,a)?"<":"["}av.peek=sT;function av(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 h=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(h+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const y=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!h||h!==y?g+=p.move(y+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function sT(){return"["}function xm(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 oT(e){const i=xm(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 uT(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 lv(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 cT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?uT(a):xm(a);const p=e.ordered?d==="."?")":".":oT(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),lv(a)===d&&b){let y=-1;for(;++y<e.children.length;){const j=e.children[y];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 h=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),h}function dT(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 fT(e,i,a,r){const u=dT(a);let c=a.bulletCurrent||xm(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"),h=a.indentLines(a.containerFlow(e,p.current()),b);return g(),h;function b(y,j,w){return j?(w?"":" ".repeat(d))+y:(w?c:c+" ".repeat(d-c.length))+y}}function pT(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const mT=Yc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function hT(e,i,a,r){return(e.children.some(function(d){return mT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function gT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}rv.peek=yT;function rv(e,i,a,r){const u=gT(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 h=g.charCodeAt(0),b=Uc(r.before.charCodeAt(r.before.length-1),h,u);b.inside&&(g=Fo(h)+g.slice(1));const y=g.charCodeAt(g.length-1),j=Uc(r.after.charCodeAt(0),y,u);j.inside&&(g=g.slice(0,-1)+Fo(y));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function yT(e,i,a){return a.options.strong||"*"}function xT(e,i,a,r){return a.safe(e.value,r)}function bT(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 vT(e,i,a){const r=(lv(a)+(a.options.ruleSpaces?" ":"")).repeat(bT(a));return a.options.ruleSpaces?r.slice(0,-1):r}const sv={blockquote:GC,break:gx,code:KC,definition:QC,emphasis:Qb,hardBreak:gx,heading:tT,html:Zb,image:Jb,imageReference:ev,inlineCode:tv,link:iv,linkReference:av,list:cT,listItem:fT,paragraph:pT,root:hT,strong:rv,text:xT,thematicBreak:vT};function wT(){return{enter:{table:kT,tableData:yx,tableHeader:yx,tableRow:ST},exit:{codeText:CT,table:jT,tableData:op,tableHeader:op,tableRow:op}}}function kT(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 jT(e){this.exit(e),this.data.inTable=void 0}function ST(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function yx(e){this.enter({type:"tableCell",children:[]},e)}function CT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,TT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function TT(e,i){return i==="|"?i:e}function ET(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,z){return h(b(w,R,z),w.align)}function p(w,T,R,z){const N=y(w,R,z),G=h([N]);return G.slice(0,G.indexOf(`
|
|
78
|
+
`))}function g(w,T,R,z){const N=R.enter("tableCell"),G=R.enter("phrasing"),B=R.containerPhrasing(w,{...z,before:c,after:c});return G(),N(),B}function h(w,T){return HC(w,{align:T,alignDelimiters:r,padding:a,stringLength:u})}function b(w,T,R){const z=w.children;let N=-1;const G=[],B=T.enter("table");for(;++N<z.length;)G[N]=y(z[N],T,R);return B(),G}function y(w,T,R){const z=w.children;let N=-1;const G=[],B=T.enter("tableRow");for(;++N<z.length;)G[N]=g(z[N],w,T,R);return B(),G}function j(w,T,R){let z=sv.inlineCode(w,T,R);return R.stack.includes("tableCell")&&(z=z.replace(/\|/g,"\\$&")),z}}function AT(){return{exit:{taskListCheckValueChecked:xx,taskListCheckValueUnchecked:xx,paragraph:_T}}}function NT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:DT}}}function xx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function _T(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 DT(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=sv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),g;function h(b){return b+d}}function RT(){return[cC(),DC(),zC(),wT(),AT()]}function MT(e){return{extensions:[dC(),RC(e),LC(),ET(e),NT()]}}const OT={tokenize:qT,partial:!0},ov={tokenize:HT,partial:!0},uv={tokenize:$T,partial:!0},cv={tokenize:GT,partial:!0},zT={tokenize:VT,partial:!0},dv={name:"wwwAutolink",tokenize:UT,previous:pv},fv={name:"protocolAutolink",tokenize:BT,previous:mv},Na={name:"emailAutolink",tokenize:IT,previous:hv},aa={};function LT(){return{text:aa}}let nr=48;for(;nr<123;)aa[nr]=Na,nr++,nr===58?nr=65:nr===91&&(nr=97);aa[43]=Na;aa[45]=Na;aa[46]=Na;aa[95]=Na;aa[72]=[Na,fv];aa[104]=[Na,fv];aa[87]=[Na,dv];aa[119]=[Na,dv];function IT(e,i,a){const r=this;let u,c;return d;function d(y){return!Hp(y)||!hv.call(r,r.previous)||bm(r.events)?a(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(y))}function p(y){return Hp(y)?(e.consume(y),p):y===64?(e.consume(y),g):a(y)}function g(y){return y===46?e.check(zT,b,h)(y):y===45||y===95||mn(y)?(c=!0,e.consume(y),g):b(y)}function h(y){return e.consume(y),u=!0,g}function b(y){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(y)):a(y)}}function UT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!pv.call(r,r.previous)||bm(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OT,e.attempt(ov,e.attempt(uv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function BT(e,i,a){const r=this;let u="",c=!1;return d;function d(y){return(y===72||y===104)&&mv.call(r,r.previous)&&!bm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(y),e.consume(y),p):a(y)}function p(y){if(vn(y)&&u.length<5)return u+=String.fromCodePoint(y),e.consume(y),p;if(y===58){const j=u.toLowerCase();if(j==="http"||j==="https")return e.consume(y),g}return a(y)}function g(y){return y===47?(e.consume(y),c?h:(c=!0,g)):a(y)}function h(y){return y===null||zc(y)||yt(y)||or(y)||Gc(y)?a(y):e.attempt(ov,e.attempt(uv,b),a)(y)}function b(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(y)}}function qT(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 HT(e,i,a){let r,u,c;return d;function d(h){return h===46||h===95?e.check(cv,g,p)(h):h===null||yt(h)||or(h)||h!==45&&Gc(h)?g(h):(c=!0,e.consume(h),d)}function p(h){return h===95?r=!0:(u=r,r=void 0),e.consume(h),d}function g(h){return u||r||!c?a(h):i(h)}}function $T(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(cv,i,c)(d):d===null||yt(d)||or(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function GT(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)||or(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||yt(p)||or(p)?i(p):r(p)}function c(p){return vn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):vn(p)?(e.consume(p),d):a(p)}}function VT(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return mn(c)?a(c):i(c)}}function pv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||yt(e)}function mv(e){return!vn(e)}function hv(e){return!(e===47||Hp(e))}function Hp(e){return e===43||e===45||e===46||e===95||mn(e)}function bm(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 PT={tokenize:JT,partial:!0};function YT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XT,continuation:{tokenize:QT},exit:ZT}},text:{91:{name:"gfmFootnoteCall",tokenize:KT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:FT,resolveTo:WT}}}}function FT(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 h=Oi(r.sliceSerialize({start:d.end,end:r.now()}));return h.codePointAt(0)!==94||!c.includes(h.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function WT(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 KT(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),g}function g(y){return y!==94?a(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(y){if(c>999||y===93&&!d||y===null||y===91||yt(y))return a(y);if(y===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return u.includes(Oi(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(y)}return yt(y)||(d=!0),c++,e.consume(y),y===92?b:h}function b(y){return y===91||y===92||y===93?(e.consume(y),c++,h):h(y)}}function XT(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"),h}function h(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=Oi(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?y:b}function y(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),et(e,w,"gfmFootnoteDefinitionWhitespace")):a(T)}function w(T){return i(T)}}function QT(e,i,a){return e.check(Ko,i,e.attempt(PT,i,a))}function ZT(e){e.exit("gfmFootnoteDefinition")}function JT(e,i,a){const r=this;return et(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 eE(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 h=g;for(;h--;)if(d[h][0]==="exit"&&d[h][1].type==="strikethroughSequenceTemporary"&&d[h][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[h][1].end.offset-d[h][1].start.offset){d[g][1].type="strikethroughSequence",d[h][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[h][1].start),end:Object.assign({},d[g][1].end)},y={type:"strikethroughText",start:Object.assign({},d[h][1].end),end:Object.assign({},d[g][1].start)},j=[["enter",b,p],["enter",d[h][1],p],["exit",d[h][1],p],["enter",y,p]],w=p.parser.constructs.insideSpan.null;w&&Jn(j,j.length,0,Vc(w,d.slice(h+1,g),p)),Jn(j,j.length,0,[["exit",y,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Jn(d,h-1,g-h+3,j),g=h+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 h=this.previous,b=this.events;let y=0;return j;function j(T){return h===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const R=as(h);if(T===126)return y>1?g(T):(d.consume(T),y++,w);if(y<2&&!a)return g(T);const z=d.exit("strikethroughSequenceTemporary"),N=as(T);return z._open=!N||N===2&&!!R,z._close=!R||R===2&&!!N,p(T)}}}class tE{constructor(){this.map=[]}add(i,a,r){nE(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 nE(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 iE(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 aE(){return{flow:{null:{name:"table",tokenize:lE,resolveAll:rE}}}}function lE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(I){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 ce=te>-1?r.events[te][1].type:null,Te=ce==="tableHead"||ce==="tableRow"?_:g;return Te===_&&r.parser.lazy[r.now().line]?a(I):Te(I)}function g(I){return e.enter("tableHead"),e.enter("tableRow"),h(I)}function h(I){return I===124||(d=!0,c+=1),b(I)}function b(I){return I===null?a(I):Me(I)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):a(I):Ke(I)?et(e,b,"whitespace")(I):(c+=1,d&&(d=!1,u+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),y(I)))}function y(I){return I===null||I===124||yt(I)?(e.exit("data"),b(I)):(e.consume(I),I===92?j:y)}function j(I){return I===92||I===124?(e.consume(I),y):y(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(I):(e.enter("tableDelimiterRow"),d=!1,Ke(I)?et(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):T(I))}function T(I){return I===45||I===58?z(I):I===124?(d=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),R):se(I)}function R(I){return Ke(I)?et(e,z,"whitespace")(I):z(I)}function z(I){return I===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),N):I===45?(c+=1,N(I)):I===null||Me(I)?P(I):se(I)}function N(I){return I===45?(e.enter("tableDelimiterFiller"),G(I)):se(I)}function G(I){return I===45?(e.consume(I),G):I===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(I))}function B(I){return Ke(I)?et(e,P,"whitespace")(I):P(I)}function P(I){return I===124?T(I):I===null||Me(I)?!d||u!==c?se(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(I)):se(I)}function se(I){return a(I)}function _(I){return e.enter("tableRow"),X(I)}function X(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),X):I===null||Me(I)?(e.exit("tableRow"),i(I)):Ke(I)?et(e,X,"whitespace")(I):(e.enter("data"),le(I))}function le(I){return I===null||I===124||yt(I)?(e.exit("data"),X(I)):(e.consume(I),I===92?J:le)}function J(I){return I===92||I===124?(e.consume(I),le):le(I)}}function rE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,h,b,y;const j=new tE;for(;++a<e.length;){const w=e[a],T=w[1];w[0]==="enter"?T.type==="tableHead"?(p=!1,g!==0&&(bx(j,i,g,h,b),b=void 0,g=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(a,0,[["enter",h,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,y=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],y=jc(j,i,c,u,void 0,y),c=[0,0,0,0]),d[2]=a)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],y=jc(j,i,c,u,void 0,y)),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],y=jc(j,i,c,u,a,y)):d[1]!==0&&(y=jc(j,i,d,u,a,y)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&bx(j,i,g,h,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=iE(i.events,a))}return e}function jc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},ts(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=ts(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 h=ts(i.events,a[2]),b=ts(i.events,a[3]),y={type:p,start:Object.assign({},h),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",y,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",y,i]])}return u!==void 0&&(c.end=Object.assign({},ts(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function bx(e,i,a,r,u){const c=[],d=ts(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 ts(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const sE={name:"tasklistCheck",tokenize:uE};function oE(){return{text:{91:sE}}}function uE(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:cE},i,a)(g):a(g)}}function cE(e,i,a){return et(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function dE(e){return Tb([LT(),YT(),eE(e),aE(),oE()])}const fE={};function pE(e){const i=this,a=e||fE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(dE(a)),c.push(RT()),d.push(MT(a))}function mE(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=gE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function Ho(e,i){return!!(i&&e.includes(i))}function hE(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 gE(e){return e&&typeof e=="object"?e:{}}const yE=["summary","message","status","instruction","description","reason","error","text"],vx=96,xE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),bE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),vE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),gv=new Set(["item/commandExecution/terminalInteraction"]),wE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function kE(e){if(e.event!=="codex.notification")return!1;const i=ia(e.data);return typeof i.method=="string"&&gv.has(i.method)}function jE(e){if(bE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||xE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ia(e.data),a=typeof i.method=="string"?i.method:"",r=ia(i.params),u=ia(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||gv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||vE.has(c)?null:a}function yv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?wE.get(a)??xv(a):r}function ur(e,i=[]){const a=ia(e),u=[...i,...yE.map(c=>$o(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=vx?u:`${u.slice(0,vx-3)}...`:"查看详情"}function $p(e,i=new Map){const a=ia(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:ur({},[p])}}function SE(e){const i=ia(e),a=Array.isArray(i.offers)?i.offers.map(ia).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=$o(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:ur({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function CE(e){const i=ia(e),a=$o(i.actionType)??"",r=ia(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:($o(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:ur(r,[$o(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:ur(r,[xv(a||"agent action")]),meta:"after turn"}}function xv(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 $o(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ia(e){return e&&typeof e=="object"?e:{}}function Gp(e){const i=Vp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Vp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=NE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=AE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function bv(e,i){const a=kx(e),r=kx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function TE(e,i){if(e.length===0)return"File changed";const a=bv(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function EE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function AE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:wx(e),deletions:0};if(i==="delete")return{additions:0,deletions:wx(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 wx(e){const i=e.split(`
|
|
80
|
+
`).length;return e.endsWith(`
|
|
81
|
+
`)?Math.max(0,i-1):i}function NE(e){const i=Vp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function kx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Vp(e){return e&&typeof e=="object"?e:{}}function _E(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Pp="seele:authentication-required",vv=12,DE=3e3,Yp="seele.activeWorkspaceId",wv="seele.workspaceOrder",kv="seele.workspaceGroupOrder",jv="seele.workspaceDrafts",Sv="seele.collapsedWorkspaceGroups",Cv="seele.sidebarWidth",jx=5,Sx=275,RE=236,ME=420,Cx="default",Tx=300,OE=3,zE=10,LE=2,IE=13,UE=1.65,BE=20,qE=900;class na extends Error{constructor(a,r,u,c){super(a);bc(this,"detail");bc(this,"status");bc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const HE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],$E=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Eo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Tv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function fe(e){return`${Tv()}api/${e.replace(/^\/+/,"")}`}function vm(e=""){return`${Tv()}${e.replace(/^\/+/,"")}`}async function Ht(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 na(r,u,e.status,a)}function Ve(e){return e instanceof na?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function ir(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function ke(e,i){if(!e.ok)throw await Ht(e,i)}function GE(e){return e instanceof na&&e.status===410&&e.body.includes('"turn_not_active"')}function VE(e){return e instanceof na&&e.status===409&&e.body.includes('"turn_not_running"')}function PE(e){return e instanceof na&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ex(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function YE(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 wm(e){return Math.max(RE,Math.min(ME,Math.round(e)))}function FE(){try{const e=window.localStorage.getItem(Cv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?wm(i):Sx}catch{return Sx}}function WE(e){try{window.localStorage.setItem(Cv,String(wm(e)))}catch{}}function up(e){Ev(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function KE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function XE(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*OE+r+u,d=a*zE+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 QE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(LE,Math.max(1,i+1))}function ZE(e){return Math.ceil(QE(e)*IE*UE+BE)}function Ev(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function JE(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 eA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function Ax(e,i){Ev(e,()=>{const a=eA(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 tA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||Ax(e,i)});Ax(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 nA(){try{return window.localStorage.getItem(Yp)}catch{return null}}function cp(e){try{e?window.localStorage.setItem(Yp,e):window.localStorage.removeItem(Yp)}catch{}}function Av(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Nv(){try{const e=window.localStorage.getItem(kv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function _v(e){try{window.localStorage.setItem(kv,JSON.stringify(e))}catch{}}function _c(e){try{window.localStorage.setItem(wv,JSON.stringify(e))}catch{}}function Dv(){try{const e=window.localStorage.getItem(jv),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 Nx(e){return e?Dv()[e]??"":""}function dp(e,i){if(e)try{const a=Dv();i?a[e]=i:delete a[e],window.localStorage.setItem(jv,JSON.stringify(a))}catch{}}function iA(){try{const e=window.localStorage.getItem(Sv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function fp(e){try{window.localStorage.setItem(Sv,JSON.stringify(Array.from(e)))}catch{}}function Ao(e){const i=Av();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 Sc(e){const i=Nv();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 pp(e){const i=new Set(e.map(u=>u.id)),a=Av().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));_c([...a,...r])}function mp(e){const i=new Set(e.map(u=>u.id)),a=Nv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));_v([...a,...r])}function aA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function lA(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),h=r==="before"?g:g+1;return d.splice(h,0,p),d}function rA(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 sA({authEnabled:e,currentUser:i,onLogout:a}){var Wl,Ps,Su,Cu;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[h,b]=D.useState([]),[y,j]=D.useState(null),[w,T]=D.useState(null),[R,z]=D.useState("simple"),[N,G]=D.useState(null),[B,P]=D.useState(null),[se,_]=D.useState(null),[X,le]=D.useState(!1),[J,I]=D.useState(!1),[te,ce]=D.useState({}),[Te,ge]=D.useState({}),[ue,V]=D.useState(null),[oe,ye]=D.useState([]),[De,O]=D.useState(null),[A,L]=D.useState(!1),[S,K]=D.useState(null),[he,Z]=D.useState("checking"),[xe,Le]=D.useState(null),[Xe,Ot]=D.useState(!1),[Yt,Pe]=D.useState(null),[Et,Jt]=D.useState(!1),[zt,ln]=D.useState(null),[ze,wt]=D.useState(!1),[rn,wn]=D.useState([]),[hi,gi]=D.useState([]),[zi,Lt]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[_a,ne]=D.useState([]),[me,Re]=D.useState(null),[Ne,Ie]=D.useState(null),[At,gn]=D.useState(!1),[tt,St]=D.useState(null),[sn,st]=D.useState(!1),[Li,Un]=D.useState(null),[Qc,Al]=D.useState(!1),[Nl,Da]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[$t,yi]=D.useState("global"),[ot,_l]=D.useState(null),[Qo,la]=D.useState(null),[Ra,Dl]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Zo,os]=D.useState({memory:"",items:[]}),[Jo,fr]=D.useState({memory:"",items:[]}),[us,pr]=D.useState({memory:"",items:[]}),[eu,kn]=D.useState([]),[bt,Nt]=D.useState(Eo),[Bn,Ii]=D.useState({description:"",key:"",value:""}),[cs,mr]=D.useState(null),[tu,xi]=D.useState(()=>new Set),[Rl,Ui]=D.useState(!1),[Bi,ra]=D.useState(!1),[Ma,_t]=D.useState(!1),[bi,hr]=D.useState(null),[qi,Oa]=D.useState(!0),[Zc,sa]=D.useState(!1),[nu,iu]=D.useState(!1),[qn,ei]=D.useState(null),[vi,Dt]=D.useState(null),[za,au]=D.useState(null),[Hn,ti]=D.useState(null),[ni,lu]=D.useState(null),[Ft,gr]=D.useState(null),[La,ds]=D.useState(()=>new Set),[wi,Ia]=D.useState(null),[yr,Hi]=D.useState(null),[ru,Ml]=D.useState(null),[$n,ii]=D.useState(null),[fs,Ol]=D.useState(null),[Ua,Gn]=D.useState(()=>iA()),[ps,zl]=D.useState(()=>FE()),[oa,Ba]=D.useState(230),[$i,ms]=D.useState(()=>Date.now()),hs=D.useRef(null),Gi=D.useRef(null),ai=D.useRef(null),Ll=D.useRef(null),li=D.useRef(null),Vn=D.useRef(!0),xr=D.useRef(null),Vi=D.useRef(null),br=D.useRef(null),qa=D.useRef(new Set),Ha=D.useRef(!1),gs=D.useRef([]),en=D.useRef(null),Pi=D.useRef(null),Pn=D.useRef(null),on=D.useRef(new Map),un=D.useRef(new Map),$a=D.useRef(new Set),Ga=D.useRef(new Map),ki=D.useRef(new Map),ji=D.useRef(new Set),Il=D.useRef(null),vr=D.useRef(null),ys=D.useRef(!1),xs=D.useRef(!1),Ee=p.find(x=>x.id===y),su=(Ee==null?void 0:Ee.unreadTurnCount)??0,Si=p.find(x=>x.id===bi),Wt=p.find(x=>x.id===ot),bs=p.find(x=>x.id===wi),Ul=D.useMemo(()=>{const k=Sc(h.length>0?h:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(q=>({id:q.id,title:q.title,conversations:[]})),C=new Map(k.map(q=>[q.id,q])),M=k[0];for(const q of p)(C.get(q.groupId)??M).conversations.push(q);return k.filter(q=>q.conversations.length>0||q.id!=="default")},[p,h]),nt=y!==null?te[y]:null,Va=(nt==null?void 0:nt.messages)??[],wr=(nt==null?void 0:nt.events)??[],Bl=T_(C_(wr),y?Te[y]:null),ql=fw(Bl),Hl=(nt==null?void 0:nt.status)??(Ee==null?void 0:Ee.status)??"idle",kr=Jp(Ee,Hl),Jc=bi!==null?((Wl=te[bi])==null?void 0:Wl.status)??(Si==null?void 0:Si.status)??"idle":"idle",ed=Jp(Si,Jc),Pa=y?un.current.get(y)??null:null,ou=D.useMemo(()=>new Map(p.map(x=>[x.id,x.title])),[p]),vs=D.useMemo(()=>tN(Va,wr,(nt==null?void 0:nt.turns)??[],(nt==null?void 0:nt.timelineNodes)??[],Pa,ou),[Pa,nt==null?void 0:nt.timelineNodes,nt==null?void 0:nt.turns,wr,Va,ou]),ws=D.useMemo(()=>new Set(Va.filter(x=>x.origin==="clone"&&x.turnId).map(x=>x.turnId)),[Va]),ks=y!==null&&La.has(y),js=Pa?(Ps=vs.find(x=>Ho(x.turnIds,Pa)))==null?void 0:Ps.activity:null,jr=kr==="running"||ks?js&&!f_(js)?js:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,td=!jr&&kr==="waiting"&&(Ee!=null&&Ee.nextWakeup)?{title:"Scheduled wakeup",detail:$c(Ee.nextWakeup,$i),createdAt:Ee.nextWakeup.wakeAt,tone:"waiting"}:null,$l=jr??td,nd=D.useMemo(()=>S_(Object.values(te)),[te]),Ss=nb(S,nd);D.useEffect(()=>{uu(),id()},[]),D.useEffect(()=>()=>{li.current!==null&&window.clearTimeout(li.current)},[]),D.useEffect(()=>{Sr(!1),Sr(!0);const x=window.setInterval(()=>{Sr(!0)},300*1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{const x=window.setInterval(()=>ms(Date.now()),1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{ji.current=La},[La]),D.useEffect(()=>{en.current=y},[y]),D.useLayoutEffect(()=>{const x=Pi.current;if(Pi.current=y,!y||x===y)return;const k=window.requestAnimationFrame(()=>{const C=Ll.current;C&&!C.disabled&&!document.querySelector('[aria-modal="true"]')&&C.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[y]),D.useEffect(()=>{gs.current=p},[p]),D.useEffect(()=>{y&&cp(y)},[y]),D.useLayoutEffect(()=>{if(!y||su<=0)return;let x=!1;const k=async()=>{if(document.visibilityState==="visible"){g(M=>M.map(q=>q.id===y?{...q,unreadTurnCount:0}:q));try{await u2(y)}catch(M){x||console.error(M)}}},C=()=>void k();return k(),document.addEventListener("visibilitychange",C),()=>{x=!0,document.removeEventListener("visibilitychange",C)}},[y,su]),D.useEffect(()=>{z("simple"),T(null),y&&(ri(y),Ms(y))},[y]),D.useEffect(()=>{const x=window.setInterval(()=>void Fa(),DE);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{u(Nx(y))},[y]),D.useEffect(()=>{!y||Hl!=="running"||ji.current.has(y)||Or(y)},[y,Hl,La]),D.useEffect(()=>{if(!y)return;let x=!1;return L2(y).then(k=>{x||ge(C=>({...C,[y]:k}))}).catch(k=>console.error(k)),()=>{x=!0}},[y]),D.useEffect(()=>{!y&&$t==="workspace"&&yi("global")},[y,$t]),D.useEffect(()=>{var x;if(ze){if(!ot&&y){_l(y);return}ot&&!p.some(k=>k.id===ot)&&_l(y??((x=p[0])==null?void 0:x.id)??null)}},[y,p,ze,ot]),D.useEffect(()=>{if(!ze||i.role!=="admin")return;const x=window.setInterval(()=>void Er(),5e3);return()=>window.clearInterval(x)},[i.role,ze]),D.useEffect(()=>{!ze||$t!=="workspace"||pr({memory:(Wt==null?void 0:Wt.memory)??"",items:(Wt==null?void 0:Wt.memoryItems)??[]})},[$t,ze,Wt==null?void 0:Wt.id,Wt==null?void 0:Wt.memory,Wt==null?void 0:Wt.memoryItems]),D.useEffect(()=>{if(!Rl)return;y&&Cr(y);const x=k=>{k.key==="Escape"&&Ui(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y,Rl]),D.useEffect(()=>{if(!ze)return;const x=k=>{k.key==="Escape"&&wt(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[ze]),D.useEffect(()=>{var k;if(!Bi)return;if(bi&&!p.some(C=>C.id===bi)){hr(y??((k=p[0])==null?void 0:k.id)??null);return}const x=C=>{C.key==="Escape"&&(qn?ei(null):ra(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[y,Bi,qn,bi,p]),D.useEffect(()=>{if(!Hn)return;lu(null);const x=k=>{k.key==="Escape"&&ti(null)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[Hn]),D.useLayoutEffect(()=>{XE(Ll.current)},[r]),D.useLayoutEffect(()=>{const x=ai.current;if(!x)return;const k=()=>{const M=x.getBoundingClientRect();Ba(Math.ceil(M.height+44))};k();const C=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return C==null||C.observe(x),window.addEventListener("resize",k),()=>{C==null||C.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var ee,be;const x=Gi.current;if(!x)return;const k=xr.current!==y;xr.current=y,k&&((ee=Pn.current)==null||ee.call(Pn),Pn.current=null);const C=Vi.current;if(C&&C.conversationId===y){(be=Pn.current)==null||be.call(Pn),Pn.current=tA(x,C),Vi.current=null,Vn.current=!1;return}if(!k&&!Vn.current)return;Vn.current=!0,up(x);const M=requestAnimationFrame(()=>up(x)),q=window.setTimeout(()=>up(x),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(q)}},[y,wr.length,Va.length]);async function Gl(){var k;const x=Gi.current;x&&(Vn.current=KE(x),!(!y||!((k=nt==null?void 0:nt.history)!=null&&k.hasMoreBefore))&&(nt.loadingOlder||qa.current.has(y)||x.scrollTop>96||await xu(y)))}function Cs(x){var C,M;if(x.history)return x.history;const k=((C=x.timelineNodes)==null?void 0:C.filter(q=>q.parentId===null).reduce((q,ee)=>q===null||ee.timelineAt<q.timelineAt||ee.timelineAt===q.timelineAt&&ee.sequence<q.sequence?ee:q,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=x.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:x.messages.length,eventTotal:x.events.length,loadedMessageCount:x.messages.length,loadedEventCount:x.events.length}}async function Yi(x){const k=new URL(x.url,window.location.href).toString();await navigator.clipboard.writeText(k),lu(x.url)}async function Ya(x,k){await navigator.clipboard.writeText(k),gr(x),li.current!==null&&window.clearTimeout(li.current),li.current=window.setTimeout(()=>{gr(null),li.current=null},1800)}function je(x,k,C){const M=Date.now();au({id:M,tone:x,text:k,detail:C}),window.setTimeout(()=>{au(q=>(q==null?void 0:q.id)===M?null:q)},C?8e3:2400)}async function uu(){try{const[x,k]=await Promise.all([Yx(),Wx()]);Z("connected");const C=Sc(k);if(b(C),mp(C),x.length>0){const M=Ao(x),q=nA(),ee=M.find(be=>be.id===q)??M[0];g(M),pp(M),j(ee.id);return}g([]),cp(null),j(null)}catch(x){console.error(x),Z("error")}}async function cn(){const[x,k]=await Promise.all([Yx(),Wx()]),C=Ao(x),M=Sc(k);b(M),mp(M),g(C),pp(C)}async function Fa(){if(!Ha.current){Ha.current=!0;try{const x=await l2(),k=gs.current,C=new Set(k.map(Ae=>Ae.id)),M=new Set(x.map(Ae=>Ae.id));if(C.size!==M.size||[...C].some(Ae=>!M.has(Ae))){await cn(),Z("connected");return}const q=en.current,ee=q?x.find(Ae=>Ae.id===q)??null:null,be=new Map(x.map(Ae=>[Ae.id,Ae])),Ue=Ao(k.map(Ae=>{const Se=be.get(Ae.id);return Se?{...Ae,status:Se.status,statusError:Se.statusError,nextWakeup:Se.nextWakeup,unreadTurnCount:Se.unreadTurnCount,updatedAt:Se.updatedAt}:Ae}));g(Ue),pp(Ue),Z("connected"),ee&&!ji.current.has(ee.id)&&it(ee.id,Ae=>({...Ae,status:ee.status}))}catch(x){console.error(x),Z("error")}finally{Ha.current=!1}}}async function id(){try{const x=await n_();Z("connected"),V(x.version)}catch(x){console.error(x),Z("error")}}async function Sr(x){try{const k=await i_(x);k&&K(C=>nb(C,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function ad(){try{const x=await p2();wn(x),Z("connected")}catch(x){console.error(x),Z("error")}}async function Ts(x){try{const k=await m2(x);gi(k),Z("connected")}catch(k){console.error(k),gi([]),Z("error")}}async function Cr(x){try{const k=await h2(x);kn(k),Z("connected")}catch(k){console.error(k),kn([]),Z("error")}}async function Vl(x){try{const k=await g2();Lt(k),Da(k),x||(la(null),Dl(k)),Z("connected")}catch(k){console.error(k),Z("error")}}async function Fi(x=!0){try{const k=await C2(x);ne(k.models),Z("connected"),k.refreshing&&window.setTimeout(()=>void Fi(!1),1e3)}catch(k){console.error(k),ne([]),Z("error")}}async function Es(){try{const x=await x2();Re(x.codexVersion),Ie(x.codexReleasedAt),Z("connected")}catch(x){console.error(x),Re(null),Ie(null),Z("error")}}async function Wa(x=!1){x&&Al(!0);try{const k=await T2(x);St(k.job),Un(k.latest),Z("connected"),k.job&&k.job.status!=="running"&&br.current===k.job.id&&(br.current=null,k.job.status==="succeeded"?(await Promise.all([Fi(),Es()]),je("success",`Codex CLI updated to ${Xc(k.job.currentVersion)}`)):je("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),Z("error")}finally{x&&Al(!1)}}async function cu(){st(!0);try{const x=await E2();br.current=x.id,St(x),Z("connected")}catch(x){console.error(x);const k=Ve(x);je("error","Unable to start Codex CLI update",k.detail??k.message)}finally{st(!1)}}D.useEffect(()=>{if(!At||(tt==null?void 0:tt.status)!=="running")return;const x=window.setInterval(()=>void Wa(),1e3);return()=>window.clearInterval(x)},[At,tt==null?void 0:tt.id,tt==null?void 0:tt.status]);async function Tr(x){try{const k=await A2(x);la(k),Dl(k.effective),Z("connected")}catch(k){console.error(k),la(null),Z("error")}}async function As(){try{const x=await N2();os(x),fr(x),Z("connected")}catch(x){console.error(x),Z("error")}}async function Ns(){if(i.role!=="admin"){ye([]);return}try{ye(await nD()),Z("connected")}catch(x){console.error(x),Z("error")}}async function Er(){if(i.role!=="admin"){O(null);return}L(!0);try{O(await y2()),Z("connected")}catch(x){console.error(x),Z("error")}finally{L(!1)}}async function Ar(x=ot){const k=[ad(),Vl(x),Es(),Fi(),As()];i.role==="admin"&&(k.push(Ns()),k.push(Er())),x&&(k.push(Tr(x)),k.push(Ts(x)),k.push(Cr(x))),await Promise.all(k)}function du(){var k;const x=y??((k=p[0])==null?void 0:k.id)??null;I(!1),_l(x),yi(i.role==="admin"?"global":x?"workspace":"global"),wt(!0),Ar(x)}function ld(){var k;const x=y??((k=p[0])==null?void 0:k.id)??null;_l(x),yi(x?"workspace":"global"),wt(!0),Ar(x)}function fu(){var k;I(!1);const x=y??((k=p[0])==null?void 0:k.id)??null;hr(x),Dt(null),ei(null),ra(!0),x&&rd(x)}async function rd(x){try{const k=await Zv(x);if(!k||k.status!=="running")return;sa(!0);const C=await Jv(x,k);Dt(C),await ri(x),await cn(),C.warmupTurnId&&el(x,C.warmupTurnId),je("success","Full-history runtime reset completed")}catch(k){const C=Ve(k);je("error","Full-history runtime reset failed",C.message)}finally{sa(!1)}}function sd(x){_l(x),yi("workspace"),Tr(x),Ts(x),Cr(x),Nt(Eo)}async function od(x){x.preventDefault();try{if($t==="workspace"&&ot){const k=await Qx(ot,B2(Ra,zi));la(k.settings),Dl(k.settings.effective),Qt(k.conversation),je("success","Workspace settings saved")}else{const k=await M2(Nl);Lt(k),Da(k),ot&&await Tr(ot),je("success","Global settings saved")}Z("connected")}catch(k){console.error(k),Z("error");const C=Ve(k);je("error","Failed to save runtime settings",C.detail??C.message)}}async function yn(){var C;const x=Si;if(!x){je("error","No workspace selected");return}if((((C=te[x.id])==null?void 0:C.status)??x.status)==="running"){je("error","Stop the running turn before resetting runtime");return}iu(!0),Dt(null);try{const M=await Jx(x.id);ei(M),Z("connected")}catch(M){console.error(M),Z("error");const q=Ve(M);je("error","Failed to preview runtime reset",q.detail??q.message)}finally{iu(!1)}}async function Pl(x){const k=Si,C=qn;if(!k||!C||C.conversationId!==k.id){je("error","Reset preview is required");return}sa(!0),Dt(null);try{const M=await Zx(k.id,{warmup:qi,previewFingerprint:C.fingerprint,selectedEntryIds:x});Dt(M),ei(null),Z("connected"),await ri(k.id),await cn(),M.warmupTurnId&&el(k.id,M.warmupTurnId),je("success","Runtime thread reset")}catch(M){console.error(M),Z("error");const q=Ve(M);je("error","Failed to reset runtime thread",q.detail??q.message)}finally{sa(!1)}}async function pu(){var M;const x=Si;if(!x){je("error","No workspace selected");return}if((((M=te[x.id])==null?void 0:M.status)??x.status)==="running"){je("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${x.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.`)){sa(!0),Dt(null);try{const q=await Jx(x.id),ee=await Zx(x.id,{warmup:!1,previewFingerprint:q.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Dt(ee),ei(null),ot===x.id&&pr({memory:"",items:[]}),Z("connected"),await ri(x.id),await cn(),je("success","Workspace started from blank context")}catch(q){console.error(q),Z("error");const ee=Ve(q);je("error","Failed to clear workspace context",ee.detail??ee.message)}finally{sa(!1)}}}async function mu(x){const k=Si,C=qn;if(!k||!C||C.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await O2(k.id,{previewFingerprint:C.fingerprint,selectedEntryIds:x}),Z("connected")}catch(M){console.error(M),Z("error");const q=Ve(M);throw je("error","Failed to save reset defaults",q.detail??q.message),M}}async function hu(x,k){try{const C=await Qx(x,{[k]:null});la(C.settings),Dl(C.settings.effective),Qt(C.conversation),Z("connected"),je("success","Workspace override reset")}catch(C){console.error(C),Z("error"),je("error","Failed to reset workspace override")}}async function gu(x){try{const k=await Y2({memory:P2(x),items:x});return os(k),fr(k),Z("connected"),je("success","Base memory saved"),k.items}catch(k){throw console.error(k),Z("error"),je("error","Failed to save memory"),k}}async function _s(x,k){try{const C=await Ac(x,{memoryItems:k});return Qt(C),pr({memory:C.memory,items:C.memoryItems}),Z("connected"),je("success","Workspace memory saved"),C.memoryItems}catch(C){throw console.error(C),Z("error"),je("error","Failed to save memory"),C}}async function ud(x){x.preventDefault();const k=Bn.key.trim();if(k)try{if($t==="workspace"&&ot){const C=await W2(ot,k,Bn.value,Bn.description);gi(M=>[...M.filter(q=>q.key!==C.variable.key),C.variable].sort((q,ee)=>q.key.localeCompare(ee.key))),Qt(C.conversation)}else{const C=await F2(k,Bn.value,Bn.description);wn(M=>[...M.filter(q=>q.key!==C.key),C].sort((q,ee)=>q.key.localeCompare(ee.key)))}je("success",$t==="workspace"?"Workspace environment saved":"Base environment saved"),Ii({description:"",key:"",value:""}),mr(null),xi(C=>{const M=new Set(C);return M.delete(k),M}),Z("connected")}catch(C){console.error(C),Z("error"),je("error","Failed to save environment")}}async function Ka(x){try{if($t==="workspace"&&ot){const k=await Z2(ot,x);gi(C=>C.filter(M=>M.key!==x)),Qt(k)}else await Q2(x),wn(k=>k.filter(C=>C.key!==x));cs===x&&(Ii({description:"",key:"",value:""}),mr(null),xi(k=>{const C=new Set(k);return C.delete(x),C})),Z("connected"),je("success",$t==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),Z("error"),je("error","Failed to delete environment")}}async function Ds(x,k){if(k.preventDefault(),!bt.name.trim()){je("error","Knowledge name is required");return}const C=q2(bt);try{const M=bt.id?await e_(x,bt.id,C):await J2(x,C);kn(q=>[...q.filter(ee=>ee.id!==M.id),M].sort(eb)),Nt(Eo),Z("connected"),je("success","Workspace knowledge saved")}catch(M){console.error(M),Z("error"),je("error","Failed to save workspace knowledge")}}async function Yl(x,k){try{await t_(x,k),kn(C=>C.filter(M=>M.id!==k)),bt.id===k&&Nt(Eo),Z("connected"),je("success","Workspace knowledge deleted")}catch(C){console.error(C),Z("error"),je("error","Failed to delete workspace knowledge")}}function Rs(x){yi("workspace"),Nt(H2(x))}function yu(x){Ii({description:x.description,key:x.key,value:""}),mr(x.key),xi(k=>{const C=new Set(k);return C.delete(x.key),C}),Nr(x.key,{preserveTypedValue:!0})}function ua(){const x=cs;Ii({description:"",key:"",value:""}),mr(null),x&&xi(k=>{const C=new Set(k);return C.delete(x),C})}async function Xa(x){await Nr(x)}async function Nr(x,k={}){try{const C=$t==="workspace"&&ot?await X2(ot,x):await K2(x);Ii(M=>M.key===x&&(!k.preserveTypedValue||M.value.length===0)?{...M,value:C}:M),xi(M=>new Set(M).add(x)),Z("connected")}catch(C){console.error(C),Z("error")}}async function ri(x){const k=await Ep(x);il(k)}async function Ci(x){try{const k=await Ep(x);$s(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function Ms(x){try{T(await l_(x))}catch(k){console.error(k)}}async function Qa(x){if(y)try{const k=await s_(y,x);T(x==="end"?null:k),x==="end"&&z("simple"),je("success",x==="start"?"Complex task started":`Task ${x} accepted`),(x==="start"||x==="resume")&&Or(y,{waitMs:15e3}),await cn()}catch(k){je("error","Complex task control failed",Ve(k).detail??Ve(k).message)}}async function Wi(x){if(y)try{G(await r_(y,x))}catch(k){const C=Ve(k);je("error","Failed to load complex task",C.detail??C.message)}}function cd(){Ee&&_({sourceId:Ee.id,name:`${Ee.title} - Clone`,groupId:Ee.groupId})}async function dd(x){if(x.preventDefault(),!(!se||!se.name.trim())){le(!0);try{const k=await o_(se.sourceId,se.name.trim(),se.groupId);g(C=>Ao([k.conversation,...C])),j(k.conversation.id),_(null),I(!1),je(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){je("error","Clone failed",Ve(k).detail??Ve(k).message)}finally{le(!1)}}}async function fd(){if(Ee)try{const x=await u_(Ee.id);Qt(x.conversation),je(x.error?"error":"success",x.error?"Clone retry failed":"Clone initialization restarted",x.error??void 0)}catch(x){je("error","Clone retry failed",Ve(x).detail??Ve(x).message)}}async function xu(x,k={}){var Ae,Se,tn;const C=te[x],M=(Ae=C==null?void 0:C.history)==null?void 0:Ae.oldestTimelineAt,q=(Se=C==null?void 0:C.history)==null?void 0:Se.oldestTimelineSequence,ee=M&&q!==null&&q!==void 0?`${M}|${q}`:q==null?(tn=C==null?void 0:C.history)==null?void 0:tn.oldestMessageCreatedAt:String(q),be=Gi.current;if(!ee||!be)return;if(k.preserveAnchor??!0){const kt=JE(be);Vi.current={anchorOffset:kt.anchorOffset,conversationId:x,previousScrollHeight:be.scrollHeight,anchorTurnId:kt.anchorTurnId}}else Vi.current=null;qa.current.add(x),it(x,kt=>({...kt,loadingOlder:!0}));try{const kt=await Ep(x,{before:ee,limit:vv});ha(kt)}catch(kt){console.error(kt),Vi.current=null}finally{qa.current.delete(x),it(x,kt=>({...kt,loadingOlder:!1}))}}async function bu(x,k){const C=await a_(x,k||void 0);g(M=>{const q=[C,...M];return _c(q.map(ee=>ee.id)),q}),j(C.id),I(!1)}function Os(){I(!1),ln({mode:"create",groupId:null,title:""})}function jn(x){ln({mode:"rename",groupId:x.id,title:x.title})}function Fl(){var x;I(!1),Le({mode:"create",conversationId:null,title:"",groupId:(Ee==null?void 0:Ee.groupId)??((x=h[0])==null?void 0:x.id)})}async function Sn(x){var k;if(x.status!=="running"){Jt(!0);try{await d_(x.id),ce(M=>{const q={...M};return delete q[x.id],q});const C=p.filter(M=>M.id!==x.id);if(_c(C.map(M=>M.id)),dp(x.id,""),g(C),y===x.id){const M=((k=C[0])==null?void 0:k.id)??null;cp(M),j(M)}(xe==null?void 0:xe.conversationId)===x.id&&Ti(),Pe(null),je("success","Workspace moved to recycle")}catch(C){const M=Ve(C);je("error","Failed to move workspace to recycle",M.detail??M.message)}finally{Jt(!1)}}}async function Za(x){if(!(x.id===Cx||!window.confirm(`Delete group "${x.title}"?
|
|
85
|
+
|
|
86
|
+
Workspaces in this group will move to Default.`)))try{const C=await f2(x.id),M=Sc(C.groups);b(M),mp(M),g(C.conversations),Gn(q=>{const ee=new Set(q);return ee.delete(x.id),fp(ee),ee})}catch(C){console.error(C)}}function zs(x){Le({mode:"rename",conversationId:x.id,title:x.title})}function Ti(){Ot(!1),Le(null)}function ca(){ln(null)}async function Ls(x,k){const C=k.trim(),M=p.find(ee=>ee.id===x);if(!M||!C||C===M.title){Ti();return}const q=await Ac(x,{title:C});Qt(q),Ti()}function da(x){return x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement}function Is(x){return x instanceof Element&&!!x.closest("input, button")}function _r(x,k){const C=document.elementFromPoint(x,k);return C instanceof HTMLElement?C.closest(".session-item[data-workspace-id]"):null}function fa(x,k){const C=document.elementFromPoint(x,k);return C instanceof HTMLElement?C.closest(".workspace-group[data-group-id]"):null}function pd(x,k,C){const M=_r(k,C),q=M==null?void 0:M.dataset.workspaceId;if(M&&q&&q!==x){ii({kind:"workspace",id:q,position:aA(M,C)});return}const ee=fa(k,C),be=ee==null?void 0:ee.dataset.groupId;if(!be){ii(null);return}ii({kind:"group",id:be})}function xn(x,k){Is(x.target)||(x.currentTarget.setPointerCapture(x.pointerId),Il.current={id:k,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY})}function Us(x,k){const C=Il.current;if(!C||C.id!==k||C.pointerId!==x.pointerId)return;const M=Math.hypot(x.clientX-C.startX,x.clientY-C.startY);if(wi!==k){if(M<jx)return;Ia(k),ii(null)}x.preventDefault(),Ol({x:x.clientX,y:x.clientY}),pd(k,x.clientX,x.clientY)}async function Ei(x,k){var be;x.preventDefault(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Il.current=null;const C=wi===k;C&&(ys.current=!0);const M=$n;if(!C||!M){Ia(null),ii(null),Ol(null);return}const q=p.find(Ue=>Ue.id===k),ee=M.kind==="group"?M.id:(be=p.find(Ue=>Ue.id===M.id))==null?void 0:be.groupId;if(!q||!ee){Ia(null),ii(null),Ol(null);return}if(g(Ue=>{const Ae=M.kind==="workspace"?lA(Ue.map(Se=>Se.id===k?{...Se,groupId:ee}:Se),k,M.id,M.position):[...Ue.filter(Se=>Se.id!==k),{...q,groupId:ee}];return _c(Ae.map(Se=>Se.id)),Ae}),q.groupId!==ee)try{const Ue=await Ac(k,{groupId:ee});Qt(Ue)}catch(Ue){console.error(Ue),await cn()}Ia(null),ii(null),Ol(null)}function vu(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Il.current=null,Ia(null),ii(null),Ol(null)}function Dr(x,k){x.currentTarget.setPointerCapture(x.pointerId),vr.current={id:k,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY}}function pa(x,k){const C=vr.current;if(!C||C.id!==k||C.pointerId!==x.pointerId)return;const M=Math.hypot(x.clientX-C.startX,x.clientY-C.startY);if(yr!==k){if(M<jx)return;Hi(k),Ml(null)}x.preventDefault();const q=fa(x.clientX,x.clientY),ee=q==null?void 0:q.dataset.groupId;Ml(ee&&ee!==k?ee:null)}function Bs(x,k){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const C=yr===k;C&&(x.preventDefault(),xs.current=!0);const M=ru;C&&M&&b(q=>{const ee=rA(q,k,M);return _v(ee.map(be=>be.id)),ee}),vr.current=null,Hi(null),Ml(null)}function wu(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),vr.current=null,Hi(null),Ml(null)}function qs(x){const k=x.target.value;Le(C=>C&&{...C,title:k})}function ku(x){const k=x.target.value;Le(C=>C&&{...C,groupId:k})}function Cn(x){const k=x.target.value;ln(C=>C&&{...C,title:k})}async function Ja(x){if(x.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Ot(!0);try{if(xe.mode==="create"){await bu(k,xe.groupId),Ti();return}xe.conversationId&&await Ls(xe.conversationId,k)}catch(C){console.error(C);const M=Ve(C);je("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{Ot(!1)}}}function Ai(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Ti())}async function Rr(x){if(x.preventDefault(),!zt)return;const k=zt.title.trim();if(k)try{if(zt.mode==="rename"){if(!zt.groupId)return;const M=await d2(zt.groupId,{title:k});b(q=>q.map(ee=>ee.id===M.id?M:ee)),ca();return}const C=await c2(k);b(M=>[...M,C]),Gn(M=>{const q=new Set(M);return q.delete(C.id),fp(q),q}),ca()}catch(C){console.error(C)}}function ma(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),ca())}async function Tn(x){x.preventDefault(),await si()}function En(x){u(x),dp(y,x)}function Yn(x,k){Nx(x).trim()===k&&dp(x,""),y===x&&u(C=>C.trim()===k?"":C)}function Kt(x,k){d(C=>{const M=new Set(C);return k?M.add(x):M.delete(x),M})}function An(x){const k=Ve(x);je("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function si(x={}){const k=r.trim();if(!k)return;if(!y){Fl();return}const C=y,M=un.current.has(C),q=$a.current.has(C);if(q)return;if(kr==="running"||ks||M||q){if(x.forceNewTurn&&!w){await ju(C,k);return}await Gt(C,k);return}$a.current.add(C),Kt(C,!0);const ee=`local-${Date.now()}`;it(C,Ae=>({...Ae,messages:[...Ae.messages,{id:ee,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),Ki(C,"running"),dn(C,!0);const be=new AbortController;on.current.set(C,be);let Ue=!1;try{let Ae=null;const Se=fe(`conversations/${C}/turns`),tn=await fetch(Se,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:R})});if(tn.ok){const fn=await tn.json();if(!fn.turnId)throw new Error("Turn did not return a turn id");if(Ae=fn.turnId,(R==="complex"||w)&&(Ms(C),z("simple")),!fn.message)throw new Error("Turn did not return the persisted message");Xt(C,ee,fn.message,Ae),Ue=!0,Yn(C,k)}else{const fn=await YE(tn);if(fn){Ae=fn;const ui=await Ni(C,fn,k);if(!ui.ok)throw await Ht(ui,{method:"POST",url:fe(`conversations/${C}/turns/${fn}/steer`)});const al=await ui.json();if(!al.message)throw new Error("Steer did not return the persisted message");Xt(C,ee,al.message,fn),Ue=!0,Yn(C,k)}else throw await Ht(tn,{method:"POST",url:Se})}if(!Ae)throw await Ht(tn,{method:"POST",url:Se});un.current.set(C,Ae),await Ye(C,Ae);const kt=fe(`conversations/${C}/turns/${Ae}/events`),oi=await fetch(kt,{signal:be.signal});if(!oi.ok||!oi.body)throw await Ht(oi,{method:"GET",url:kt});await Ci(C),await Np(oi.body,fn=>{const ui=wp(fn,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);it(C,Qi=>({...Qi,status:es(ui)??Qi.status,events:vp(Qi.events,ui)}));const al=es(ui);al&&Ki(C,al)}),await ri(C),await cn()}catch(Ae){if(kp(Ae))return;Ue||An(Ae);const Se=PE(Ae);Se&&je("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."),un.current.has(C)||ki.current.delete(C),it(C,tn=>({...tn,status:"error",events:[...tn.events,{id:tn.events.length+1,event:"client.error",data:Se?{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."}:ir(Ae),createdAt:new Date().toISOString()}]})),Ki(C,"error"),await cn()}finally{$a.current.delete(C),Kt(C,!1),un.current.delete(C),on.current.get(C)===be&&on.current.delete(C),dn(C,!1),await Mr(C)}}async function Mr(x){const k=Ga.current.get(x)??[];if(k.length===0)return;const[C,...M]=k;Ga.current.set(x,M),await el(x,C)}async function Or(x,k={}){if(ji.current.has(x))return;const C=new AbortController;on.current.set(x,C),dn(x,!0);try{const M=k.waitMs?`?waitMs=${k.waitMs}`:"",q=fe(`conversations/${x}/turns/current/events${M}`),ee=await fetch(q,{signal:C.signal});if(!ee.ok||!ee.body)throw await Ht(ee,{method:"GET",url:q});await Ci(x),await Np(ee.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ue.turnId&&!un.current.has(x)&&un.current.set(x,Ue.turnId),it(x,Se=>({...Se,status:es(Ue)??Se.status,events:vp(Se.events,Ue)}));const Ae=es(Ue);Ae&&Ki(x,Ae)}),await ri(x),await cn()}catch(M){if(!kp(M)){if(VE(M)){await ri(x),await cn();return}it(x,q=>({...q,status:"error",events:[...q.events,{id:q.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}}finally{un.current.delete(x),on.current.get(x)===C&&on.current.delete(x),dn(x,!1),await Mr(x)}}async function el(x,k,C={}){if(un.current.has(x)){const q=Ga.current.get(x)??[];q.includes(k)||Ga.current.set(x,[...q,k]);return}const M=new AbortController;on.current.set(x,M),un.current.set(x,k),dn(x,!0);try{const q=fe(`conversations/${x}/turns/${k}/events`),ee=await fetch(q,{signal:M.signal});if(!ee.ok||!ee.body)throw await Ht(ee,{method:"GET",url:q});await Ci(x),await Np(ee.body,be=>{const Ue=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);it(x,Se=>({...Se,status:es(Ue)??Se.status,events:vp(Se.events,Ue)}));const Ae=es(Ue);Ae&&Ki(x,Ae)}),await ri(x),await cn()}catch(q){if(!kp(q)){if(C.recovered&&GE(q)){await ri(x),await cn();return}it(x,ee=>({...ee,status:"error",events:[...ee.events,{id:ee.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}}finally{un.current.delete(x),on.current.get(x)===M&&on.current.delete(x),dn(x,!1),await Mr(x)}}async function ju(x,k){Kt(x,!0);let C=!1;const M=`local-queued-${Date.now()}`;it(x,q=>({...q,messages:[...q.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const q=fe(`conversations/${x}/turns`),ee=await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!ee.ok)throw await Ht(ee,{method:"POST",url:q});const be=await ee.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");Xt(x,M,be.message,be.turnId),C=!0,Yn(x,k),el(x,be.turnId),await cn(),je("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(q){C||An(q),it(x,ee=>({...ee,events:[...ee.events,{id:ee.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}finally{Kt(x,!1)}}async function Gt(x,k){Kt(x,!0);const C=un.current.get(x),M=`local-steer-${Date.now()}`;if(it(x,q=>({...q,messages:[...q.messages,{id:M,role:"user",content:k,createdAt:new Date().toISOString(),turnId:C??null}],status:"running"})),!C&&$a.current.has(x)){mt(x,k,M),Kt(x,!1);return}try{const q=fe(C?`conversations/${x}/turns/${C}/steer`:`conversations/${x}/turns/steer`),ee=await fetch(q,Ex(k));if(!ee.ok)throw await Ht(ee,{method:"POST",url:q});const be=await ee.json();if(!be.message)throw new Error("Steer did not return the persisted message");Xt(x,M,be.message,C),Yn(x,k)}catch(q){An(q),it(x,ee=>({...ee,events:[...ee.events,{id:ee.events.length+1,event:"client.error",data:ir(q),createdAt:new Date().toISOString()}]}))}finally{Kt(x,!1)}}function mt(x,k,C){const M=ki.current.get(x)??[];ki.current.set(x,[...M,{message:k,localMessageId:C}])}async function Ye(x,k){const C=ki.current.get(x)??[];if(C.length!==0){ki.current.delete(x);for(const M of C){const q=await Ni(x,k,M.message);if(!q.ok)throw await Ht(q,{method:"POST",url:fe(`conversations/${x}/turns/${k}/steer`)});const ee=await q.json();ee.message&&Xt(x,M.localMessageId,ee.message,k)}}}async function Ni(x,k,C){return fetch(fe(`conversations/${x}/turns/${k}/steer`),Ex(C))}function Xt(x,k,C,M){it(x,q=>({...q,messages:yp(q.messages.filter(ee=>ee.id!==k),[{...C,turnId:M??C.turnId??null}])}))}async function Hs(){var C;if(!y||kr!=="running"&&!ks)return;const x=y,k=un.current.get(x);(C=on.current.get(x))==null||C.abort(),dn(x,!1),it(x,M=>({...M,status:"done",events:[...M.events,{id:M.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Ki(x,"done");try{const M=fe(k?`conversations/${x}/turns/${k}/stop`:`conversations/${x}/turns/interrupt`),q=await fetch(M,{method:"POST"});if(!q.ok&&q.status!==409)throw await Ht(q,{method:"POST",url:M})}catch(M){it(x,q=>({...q,events:[...q.events,{id:q.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}))}un.current.delete(x)}async function Nn(x,k){if(!y||!x.approvalTurnId||x.approvalRequestId===void 0)return;const C=y;try{const M=fe(`conversations/${C}/turns/${x.approvalTurnId}/approvals/${encodeURIComponent(String(x.approvalRequestId))}`),q=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!q.ok)throw await Ht(q,{method:"POST",url:M});it(C,ee=>({...ee,events:[...ee.events,{id:ee.events.length+1,event:"server.approval.decision",data:{requestId:x.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){it(C,ee=>({...ee,events:[...ee.events,{id:ee.events.length+1,event:"client.error",data:ir(M),createdAt:new Date().toISOString()}]}));const q=Ve(M);je("error","Failed to respond to approval",q.detail??q.message)}}async function tl(x,k,C){const M=y,q=x.workspaceChangeProposalId??x.responsibilityProposalId;if(!M||!q)return!1;try{const ee=fe(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(q)}`),be=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?C??x.workspaceChangePayload:void 0})});if(!be.ok)throw await Ht(be,{method:"POST",url:ee});const Ue=await be.json();return Qt(Ue.conversation),it(M,Ae=>({...Ae,events:[...Ae.events,{id:`${x.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:q,changeType:x.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?C??x.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),je("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(ee){console.error(ee);const be=Ve(ee);return je("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function nl(x,k,C){const M=y;if(!(!M||!x.knowledgeProposalId))try{let q;if(k==="accept")try{q=JSON.parse(C??x.body)}catch{je("error","Knowledge proposal JSON is invalid");return}const ee=fe(`conversations/${M}/knowledge-proposals/${encodeURIComponent(x.knowledgeProposalId)}`),be=await fetch(ee,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:q})});if(!be.ok)throw await Ht(be,{method:"POST",url:ee});const Ue=await be.json();kn([...Ue.items??[]].sort(eb)),it(M,Ae=>({...Ae,events:[...Ae.events,{id:`${x.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:x.knowledgeProposalId,decision:k,knowledge:k==="accept"?Ue.item:null},createdAt:new Date().toISOString()}]})),je("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(q){console.error(q);const ee=Ve(q);je("error","Failed to respond to knowledge proposal",ee.detail??ee.message)}}function il(x){ce(k=>{const C=k[x.id],M=x.events.map(q=>({id:q.id,turnId:q.turnId,seq:q.seq,event:q.event,data:q.data,createdAt:q.createdAt}));return{...k,[x.id]:{messages:x.messages,events:Cc(M,(C==null?void 0:C.events)??[]),timelineNodes:bp(x.timelineNodes??[],(C==null?void 0:C.timelineNodes)??[]),turns:xp(x.turns??[],(C==null?void 0:C.turns)??[]),contextVersions:x.contextVersions??[],status:x.status,history:Cs(x),loadingOlder:!1,fullEventTurnIds:(C==null?void 0:C.fullEventTurnIds)??new Set,loadingEventTurnIds:(C==null?void 0:C.loadingEventTurnIds)??new Set}}})}function ha(x){const k=Cs(x);it(x.id,C=>{var M,q,ee;return{...C,messages:yp(x.messages,C.messages),timelineNodes:bp(x.timelineNodes??[],C.timelineNodes),turns:xp(x.turns??[],C.turns),events:Cc(x.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),C.events),contextVersions:(((M=x.contextVersions)==null?void 0:M.length)??0)>0?x.contextVersions??[]:C.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((q=C.history)==null?void 0:q.loadedMessageCount)??C.messages.length),loadedEventCount:k.loadedEventCount+(((ee=C.history)==null?void 0:ee.loadedEventCount)??C.events.length)},loadingOlder:!1}})}function $s(x){const k=Cs(x),C=x.events.map(M=>({id:M.id,turnId:M.turnId,seq:M.seq,event:M.event,data:M.data,createdAt:M.createdAt}));it(x.id,M=>{var q,ee,be;return{...M,messages:yp(M.messages,x.messages),timelineNodes:bp(M.timelineNodes,x.timelineNodes??[]),turns:xp(M.turns,x.turns??[]),events:Cc(C,M.events),contextVersions:(((q=x.contextVersions)==null?void 0:q.length)??0)>0?x.contextVersions??[]:M.contextVersions,status:x.status,history:{...M.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((ee=M.history)==null?void 0:ee.loadedMessageCount)??M.messages.length,M.messages.length,x.messages.length),loadedEventCount:Math.max(((be=M.history)==null?void 0:be.loadedEventCount)??M.events.length,M.events.length,x.events.length)},loadingOlder:!1}})}function it(x,k){ce(C=>{const M=C[x]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...C,[x]:k(M)}})}function Ki(x,k){g(C=>C.map(M=>M.id===x?{...M,status:k,updatedAt:new Date().toISOString()}:M))}function Qt(x){g(k=>Ao(k.map(C=>C.id===x.id?{...C,...x}:C)))}async function _i(x,k){const C=k.filter(M=>{const q=te[x];return q&&!q.fullEventTurnIds.has(M)&&!q.loadingEventTurnIds.has(M)});if(C.length!==0){it(x,M=>{const q=new Set(M.loadingEventTurnIds);for(const ee of C)q.add(ee);return{...M,loadingEventTurnIds:q}});try{const M=await Promise.all(C.map(q=>c_(x,q)));it(x,q=>{const ee=new Set(q.fullEventTurnIds),be=new Set(q.loadingEventTurnIds),Ue=M.flatMap((Ae,Se)=>{const tn=C[Se];return ee.add(tn),be.delete(tn),Ae.map(kt=>({id:kt.id,turnId:kt.turnId,seq:kt.seq,event:kt.event,data:kt.data,createdAt:kt.createdAt}))});return{...q,events:Cc(q.events,Ue),fullEventTurnIds:ee,loadingEventTurnIds:be}})}catch(M){console.error(M),it(x,q=>{const ee=new Set(q.loadingEventTurnIds);for(const be of C)ee.delete(be);return{...q,loadingEventTurnIds:ee}}),je("error","Failed to load process details")}}}function dn(x,k){const C=new Set(ji.current);k?C.add(x):C.delete(x),ji.current=C,ds(M=>{const q=new Set(M);return k?q.add(x):q.delete(x),q})}function Di(x){x.key!=="Enter"||!x.metaKey&&!x.ctrlKey||x.nativeEvent.isComposing||(x.preventDefault(),si({forceNewTurn:x.shiftKey}))}function Gs(x){Gn(k=>{const C=new Set(k);return C.has(x)?C.delete(x):C.add(x),fp(C),C})}function Vs(x){var k;return _E(x.status,(k=x.nextWakeup)==null?void 0:k.status,La.has(x.id))}function Xi(x){var M;const k=(M=hs.current)==null?void 0:M.getBoundingClientRect(),C=k?x-k.left:x;return wm(C)}function zr(x){x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),zl(Xi(x.clientX))}function ga(x){x.currentTarget.hasPointerCapture(x.pointerId)&&(x.preventDefault(),zl(Xi(x.clientX)))}function Vt(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const k=Xi(x.clientX);zl(k),WE(k)}return s.jsxs("main",{className:`shell${J?" mobile-sidebar-open":""}`,ref:hs,style:{"--sidebar-width":`${ps}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":ub(he),className:`backend-status ${he}`,"data-label":ub(he)})]}),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:()=>I(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Fl,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Ul.map(x=>s.jsxs("section",{className:["workspace-group",yr===x.id?"dragging":"",ru===x.id?"drop-after":"",($n==null?void 0:$n.kind)==="group"&&$n.id===x.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":x.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Ua.has(x.id),className:"workspace-group-toggle",onClick:k=>{if(xs.current){k.preventDefault(),xs.current=!1;return}Gs(x.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),jn(x)},onPointerCancel:wu,onPointerDown:k=>Dr(k,x.id),onPointerMove:k=>pa(k,x.id),onPointerUp:k=>Bs(k,x.id),type:"button",children:[s.jsx("span",{className:Ua.has(x.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),jn(x)},title:"Double-click to rename",children:x.title})]}),x.id!==Cx?s.jsx("button",{"aria-label":`Delete group ${x.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Za(x)},title:"Delete group",type:"button",children:"×"}):null]}),Ua.has(x.id)?null:s.jsx("div",{className:"workspace-group-items",children:x.conversations.map(k=>{const C=Vs(k);return s.jsxs("div",{className:["session-item",k.id===y?"active":"",k.id===wi?"dragging":"",($n==null?void 0:$n.kind)==="workspace"&&$n.id===k.id?`drop-${$n.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:M=>{if(ys.current){M.preventDefault(),ys.current=!1;return}j(k.id),I(!1)},onDoubleClick:M=>{Is(M.target)||(M.preventDefault(),zs(k))},onKeyDown:M=>{da(M.target)||M.key==="Enter"&&(j(k.id),I(!1))},onPointerCancel:vu,onPointerDown:M=>xn(M,k.id),onPointerMove:M=>Us(M,k.id),onPointerUp:M=>Ei(M,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Oc(C,k.nextWakeup,$i),className:`session-status ${C}`,title:Oc(C,k.nextWakeup,$i)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),C==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Oc(C,k.nextWakeup,$i),children:$c(k.nextWakeup,$i)}):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,C!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),Pe(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",is(k.id)]})]},k.id)})})]},x.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:du,type:"button",children:s.jsx(Gx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Os,type:"button",children:s.jsx(QN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{_t(!0),I(!1)},type:"button",children:s.jsx(Dc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:fu,type:"button",children:s.jsx(ZN,{})}),s.jsx(JA,{usage:Ss})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>I(!1),tabIndex:J?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:zr,onPointerMove:ga,onPointerUp:Vt,role:"separator",tabIndex:0}),bs&&fs?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${fs.x+12}px, ${fs.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:bs.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",is(bs.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Ai,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Ai,onSubmit:x=>void Ja(x),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:qs,onKeyDown:Ai,value:xe.title}),xe.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:ku,onKeyDown:Ai,value:xe.groupId??((Su=h[0])==null?void 0:Su.id)??"",children:h.map(x=>s.jsx("option",{value:x.id,children:x.title},x.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Ti,children:"Cancel"}),s.jsx("button",{disabled:Xe,type:"submit",children:Xe?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,zt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ma,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ma,onSubmit:x=>void Rr(x),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:Cn,onKeyDown:ma,value:zt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:ca,children:"Cancel"}),s.jsx("button",{type:"submit",children:zt.mode==="create"?"Create":"Save"})]})]})}):null,ze?s.jsx(pA,{currentUser:i,conversations:p,editingEnvironmentKey:cs,environmentDraft:Bn,globalEnvironment:rn,workspaceEnvironment:hi,memorySettings:Zo,memorySettingsDraft:Jo,workspaceMemoryDraft:us,runtimeSettings:zi,runtimeModels:_a,runtimeCodexVersion:me,runtimeCodexReleasedAt:Ne,runtimeCodexUpdating:(tt==null?void 0:tt.status)==="running",runtimeSettingsDraft:Nl,runtimeSettingsScope:$t,settingsWorkspace:Wt,settingsWorkspaceId:ot,systemDiagnostics:De,systemDiagnosticsLoading:A,workspaceGroups:Ul,workspaceRuntimeSettings:Qo,workspaceRuntimeSettingsDraft:Ra,managedUsers:oe,onCancelEnvironmentEdit:ua,onClose:()=>wt(!1),onCreateUser:async x=>{const k=await iD(x);ye(C=>[...C,k]),je("success","User created")},onDeleteUser:async x=>{await lD(x),ye(k=>k.filter(C=>C.id!==x)),je("success","User deleted")},onDeleteEnvironment:x=>void Ka(x),onDraftChange:Ii,onEditEnvironment:yu,onRevealEnvironmentValue:x=>void Xa(x),onSaveBaseMemoryItems:x=>gu(x),onSaveResponsibility:async(x,k)=>{try{const C=await Ac(x,{responsibility:k});return Qt(C),Z("connected"),je("success","Workspace responsibility saved"),C.responsibility}catch(C){throw console.error(C),Z("error"),je("error","Failed to save workspace responsibility"),C}},onSaveWorkspaceMemoryItems:x=>ot?_s(ot,x):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Da,onGlobalSettingsImported:async()=>{await Ar(ot),je("success","Global settings imported")},onCodexAccountSwitched:async()=>{await Promise.all([Sr(!0),Fi(!0),Es()]),je("success","Codex account switched")},onUpdateCodexCli:()=>{gn(!0),Wa(!0)},onRuntimeScopeChange:yi,onSettingsWorkspaceChange:sd,onSubmitRuntimeSettings:x=>void od(x),onWorkspaceRuntimeDraftChange:Dl,onWorkspaceRuntimeReset:x=>ot?void hu(ot,x):void 0,revealedEnvironmentKeys:tu,onSubmitEnvironment:x=>void ud(x),onRefreshSystemDiagnostics:()=>void Er(),onUpdateUser:async(x,k)=>{const C=await aD(x,k);ye(M=>M.map(q=>q.id===C.id?C:q)),je("success","User updated")}}):null,At?s.jsx(fA,{currentReleasedAt:Ne,currentVersion:me,job:tt,latest:Li,latestChecking:Qc,starting:sn,onClose:()=>gn(!1),onRefresh:()=>void Wa(),onStart:()=>void cu()}):null,Rl&&Ee?s.jsx(oA,{conversation:Ee,clockNow:$i,knowledgeDraft:bt,workspaceKnowledge:eu,tokenUsage:Bl,onCancelKnowledgeEdit:()=>Nt(Eo),onDeleteKnowledge:x=>void Yl(Ee.id,x),onEditKnowledge:Rs,onKnowledgeDraftChange:Nt,onSubmitKnowledge:x=>void Ds(Ee.id,x),onClose:()=>Ui(!1)}):null,Ma?s.jsx(uA,{conversations:p,onClose:()=>_t(!1),workspaceGroups:Ul}):null,Bi?s.jsx(cA,{busy:Zc,conversation:Si??null,conversationId:bi,preview:(qn==null?void 0:qn.conversationId)===bi?qn:null,previewLoading:nu,result:vi,status:ed,warmup:qi,workspaceGroups:Ul,onClose:()=>ra(!1),onCancelResetPreview:()=>ei(null),onPreviewReset:()=>void yn(),onStartBlankContext:()=>void pu(),onResetRuntime:x=>void Pl(x),onSaveResetSelection:mu,onWorkspaceChange:x=>{hr(x),Dt(null),ei(null)},onWarmupChange:Oa}):null,se?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!X&&_(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:dd,onMouseDown:x=>x.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:()=>_(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:se.name,onChange:x=>_(k=>k&&{...k,name:x.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:se.groupId,onChange:x=>_(k=>k&&{...k,groupId:x.target.value}),children:Ul.map(x=>s.jsx("option",{value:x.id,children:x.title},x.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:X,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:X||!se.name.trim(),type:"submit",children:X?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>G(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:x=>x.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:[ob(N.status),N.startedAt&&N.finishedAt?` · ${V_(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>G(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:Sl(N.currentPlan.planMarkdown,Ee)})})}):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?$e(N.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:N.finishedAt?$e(N.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>G(null),type:"button",children:"Close"})})]})}):null,B?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>P(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:x=>x.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:B.title}),s.jsx("p",{children:$e(B.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>P(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Io,{content:B.fullDetail??B.detail??"No additional details.",conversation:Ee,streaming:!1,onPreviewArtifact:ti,onCopyArtifactUrl:Yi,copiedArtifactUrl:ni})}),s.jsxs("footer",{children:[B.linkedTaskId?s.jsx("button",{onClick:()=>{const x=B.linkedTaskId;P(null),Wi(x)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>P(null),type:"button",children:"Close"})]})]})}):null,Yt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Et||Pe(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:x=>x.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:Et,onClick:()=>Pe(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Yt.title})," to recycle?"]}),s.jsx("code",{children:Yt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Et,onClick:()=>Pe(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Et,onClick:()=>void Sn(Yt),type:"button",children:Et?"Moving...":"Move to recycle"})]})]})}):null,za?s.jsxs("div",{className:`app-toast ${za.tone}`,role:"status",children:[s.jsx("strong",{children:za.text}),za.detail?s.jsx("pre",{children:za.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:()=>I(!0),title:"Workspaces",type:"button",children:s.jsx(XN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ee==null?void 0:Ee.title)??"New workspace"})}),Ee?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",is(Ee.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ee?s.jsxs(s.Fragment,{children:[Ee.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:fu,title:`当前 Thread 工具集已过期(${Ee.threadCapabilityVersion} / ${Ee.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Xv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:cd,title:"Clone workspace",type:"button",children:s.jsx(KN,{})}),s.jsxs("button",{className:`context-button has-usage ${Nm(ql??0)}`,onClick:()=>Ui(!0),style:{"--context-usage":`${Kc(ql??0)}%`},title:Bl&&ql!==null?`Context ${Math.round(ql)}% · ${Ln(Bl.totalTokens)} / ${Mc(Bl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(ql??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:ld,title:"Workspace settings",type:"button",children:s.jsx(Gx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Wi(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:ob(w.status)}),s.jsx("span",{className:"complex-task-duration",children:G_(w,$i)})]}),s.jsxs("div",{className:"complex-task-actions",children:[_p(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Qa("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 Qa("pause"),type:"button",children:"Pause"}):null,_p(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Qa("resume"),type:"button",children:"Resume"}):null,_p(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Qa("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Qa("end"),type:"button",children:"End task"})]})]}):null,(Ee==null?void 0:Ee.status)==="initialization_failed"&&Ee.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ee.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void fd(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void Gl(),ref:Gi,style:{scrollPaddingBottom:oa},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:oa},children:[Va.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:[Ee!=null&&Ee.cloneLineage&&ws.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ee.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Ee.cloneLineage.snapshotAt)," · ",Ee.cloneLineage.importedMessageCount," messages"]})]}):null,(Cu=nt==null?void 0:nt.history)!=null&&Cu.hasMoreBefore?s.jsx("div",{className:"history-loader",children:nt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,vs.map((x,k)=>{var be,Ue,Ae;const C=((be=x.user)==null?void 0:be.type)==="system",M=x.turnIds.some(Se=>ws.has(Se)),q=vs[k+1],ee=M&&(!q||!q.turnIds.some(Se=>ws.has(Se)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":x.id,children:[x.user?s.jsxs("div",{className:`turn-panel ${C?"system-turn":"user-turn"}`,children:[Oo(x.user,Ee,ti,Yi,ni,Nn,tl,nl,Wi,P),s.jsx(zo,{copied:Ft===`${C?"system":"user"}-${x.id}-bottom`,content:Lo(x.user),id:`${C?"system":"user"}-${x.id}-bottom`,timestamp:x.user.createdAt,variant:"outside",onCopy:Ya})]}):null,x.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:x.followupUsers.map(Se=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Oo(Se,Ee,ti,Yi,ni,Nn,tl,nl,Wi,P),s.jsx(zo,{copied:Ft===`user-${Se.id}-bottom`,content:Lo(Se),id:`user-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Ya})]},Se.id))}):null,(Ue=x.acceptedSystemInputs)==null?void 0:Ue.map(Se=>s.jsxs("div",{className:"turn-panel system-turn",children:[Oo(Se,Ee,ti,Yi,ni,Nn,tl,nl,Wi,P),s.jsx(zo,{copied:Ft===`system-${Se.id}-bottom`,content:Lo(Se),id:`system-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Ya})]},Se.id)),x.agentItems.length>0?s.jsx(BA,{group:x,conversation:Ee,allowProcessView:!M,copiedFooter:Ft===`agent-${x.id}-bottom`,copiedArtifactUrl:ni,running:!M&&Ho(x.turnIds,Pa),onCopyArtifactUrl:Yi,onCopyBubble:Ya,onPreviewArtifact:ti,onLoadProcessDetails:Se=>Ee&&!M?_i(Ee.id,Se):void 0,onRespondApproval:Nn,onRespondWorkspaceChangeProposal:tl,onRespondKnowledgeProposal:nl,onOpenComplexTask:Wi,onOpenSystemEvent:P}):null,(Ae=x.trailingSystemItems)==null?void 0:Ae.map(Se=>s.jsxs("div",{className:"turn-panel system-turn",children:[Oo(Se,Ee,ti,Yi,ni,Nn,tl,nl,Wi,P),s.jsx(zo,{copied:Ft===`system-${Se.id}-bottom`,content:Lo(Se),id:`system-${Se.id}-bottom`,timestamp:Se.createdAt,variant:"outside",onCopy:Ya})]},Se.id))]}),ee?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},x.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Tn,ref:ai,children:[$l?s.jsxs("div",{className:`global-activity ${$l.tone??"running"}`,children:[jr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void Hs(),title:"Stop current agent run",type:"button",children:s.jsx($A,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:$l.title}),$l.detail?s.jsx("small",{children:$l.detail}):null]}),jr?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:()=>z(x=>x==="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(Mv,{}),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:y!==null&&c.has(y),onChange:x=>En(x.target.value),onKeyDown:Di,placeholder:"Cmd/Ctrl + Enter",ref:Ll,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||y!==null&&c.has(y),type:"submit",children:[s.jsx(GA,{}),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"]})]})]})]})]}),Hn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>ti(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:x=>x.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>ti(null),type:"button",children:"×"}),s.jsx("img",{alt:Hn.name,src:Hn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Hn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Hn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void Yi(Hn),type:"button",children:ni===Hn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function oA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:h,onClose:b}){const[y,j]=D.useState("overview"),[w,T]=D.useState(!1),[R,z]=D.useState(!1),[N,G]=D.useState(null),[B,P]=D.useState(null),[se,_]=D.useState(!1),[X,le]=D.useState(null),[J,I]=D.useState(null),[te,ce]=D.useState(!1),[Te,ge]=D.useState(null),[ue,V]=D.useState(null),oe=fw(u),ye=Jp(e,e.status),De=N?__(N):null;D.useEffect(()=>{T(!1),G(null),P(null),le(null),I(null),ge(null),V(null)},[e.id]),D.useEffect(()=>{y==="additionalContext"&&!X&&A()},[y,X]),D.useEffect(()=>{y==="compactions"&&!Te&&L()},[y,Te]);const O=()=>{T(!0),z(!0),P(null),z2(e.id).then(S=>G(S)).catch(S=>{const K=Ve(S);P(K.detail?`${K.message}
|
|
87
|
+
${K.detail}`:K.message)}).finally(()=>z(!1))},A=()=>{_(!0),I(null),I2(e.id).then(S=>le(S)).catch(S=>{const K=Ve(S);I(K.detail?`${K.message}
|
|
88
|
+
${K.detail}`:K.message)}).finally(()=>_(!1))},L=()=>{ce(!0),V(null),U2(e.id).then(S=>ge(S)).catch(S=>{const K=Ve(S);V(K.detail?`${K.message}
|
|
89
|
+
${K.detail}`:K.message)}).finally(()=>ce(!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:S=>S.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:y==="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:y==="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:y==="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:y==="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:y==="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:y==="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:y==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Oc(ye,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:Po(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:$c(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/${is(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:Sl(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(Rv,{items:r,onDelete:d,onEdit:S=>{p(S),j("knowledge")}})]})]}):y==="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:Sl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):y==="knowledge"?s.jsx(NA,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:h}):y==="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?`${Ln(u.totalTokens)} / ${Ln(u.modelContextWindow)}`:Ln(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Nm(oe)}`,children:s.jsx("span",{style:{width:`${Kc(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Mc(u.inputTokens)} / ${Mc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Mc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",$e(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..."}):B?s.jsx("pre",{className:"thread-read-error",children:B}):N?s.jsxs(s.Fragment,{children:[De?s.jsx(LA,{summary:De}):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]}):y==="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:L,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Te?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Te!=null&&Te.length?s.jsx("div",{className:"context-compaction-list",children:Te.map(S=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(S.completedAt??S.usageObservedAt??S.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${S.status}`,children:S.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:j_(S).map(K=>s.jsxs("div",{children:[s.jsx("dt",{children:K.label}),s.jsx("dd",{children:K.value})]},K.label))}),s.jsxs("small",{children:[Tl(S.id),S.turnId?` · turn ${Tl(S.turnId)}`:""]})]},S.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."})]})}),se?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):J?s.jsx("pre",{className:"thread-read-error",children:J}):X?s.jsx(OA,{preview:X,refreshing:se,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function uA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[h,b]=D.useState([]),[y,j]=D.useState(!0),[w,T]=D.useState(null),[R,z]=D.useState(null),[N,G]=D.useState(!1),[B,P]=D.useState(!1),[se,_]=D.useState(new Set),[X,le]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),J=r.find(A=>A.id===p)??null,I=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ce=a.map(A=>({...A,conversations:A.conversations.filter(L=>L.id!==X.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Te=()=>{var A;le({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),_(new Set),z("create")},ge=()=>{!J||J.status!=="active"||(le({title:J.title,publicDescription:J.publicDescription,ownerWorkspaceId:J.ownerWorkspaceId,participantWorkspaceIds:J.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),_(new Set),z("edit"))},ue=async(A,L=c)=>{var S;j(!0),T(null);try{const K=await Fx();u(K);const he=K.filter(xe=>L==="archived"?xe.status==="archived":xe.status!=="archived"),Z=(A&&he.some(xe=>xe.id===A)?A:null)??(p&&he.some(xe=>xe.id===p)?p:((S=he[0])==null?void 0:S.id)??null);g(Z),b(Z?await Ec(Z):[])}catch(K){T(K instanceof na?K.detail:K instanceof Error?K.message:String(K))}finally{j(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const L=await Fx();u(L),p&&L.some(S=>S.id===p)&&b(await Ec(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),T(null);try{b(await Ec(A))}catch(L){T(L instanceof na?L.detail:L instanceof Error?L.message:String(L))}},oe=async A=>{var S;if(A===c)return;d(A),T(null);const L=((S=r.find(K=>A==="archived"?K.status==="archived":K.status!=="archived"))==null?void 0:S.id)??null;if(g(L),!L){b([]);return}try{b(await Ec(L))}catch(K){T(K instanceof na?K.detail:K instanceof Error?K.message:String(K))}},ye=async A=>{var L;if(A.preventDefault(),!(!X.title.trim()||!X.ownerWorkspaceId)){P(!0),T(null);try{const S=R==="edit"&&J?await s2(J.id,{expectedVersion:J.version,title:X.title.trim(),publicDescription:X.publicDescription.trim(),participantWorkspaceIds:X.participantWorkspaceIds}):await r2({...X,title:X.title.trim(),publicDescription:X.publicDescription.trim()});d("active"),z(null),le({title:"",publicDescription:"",ownerWorkspaceId:((L=e[0])==null?void 0:L.id)??"",participantWorkspaceIds:[]}),await ue(S.id,"active")}catch(S){T(S instanceof na?S.detail:S instanceof Error?S.message:String(S))}finally{P(!1)}}},De=async()=>{if(!(!J||J.status!=="active")){P(!0),T(null);try{const A=await o2(J.id,J.version);G(!1),d("active"),await ue(void 0,"active")}catch(A){T(A instanceof na?A.detail:A instanceof Error?A.message:String(A))}finally{P(!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:Te,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:"已归档"})]}),y?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:J?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:J.title}),s.jsx("p",{children:J.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:J.status}),J.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${J.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`归档 Topic ${J.title}`,className:"memory-icon-button",onClick:()=>G(!0),title:"归档",type:"button",children:s.jsx(JN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:J.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:h.length===0?s.jsx("p",{children:"还没有消息。"}):h.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${ew(A.recipientWorkspaceIds.map(L=>I.get(L)??Tl(L)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Sl(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:()=>!B&&z(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ye,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:()=>z(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:X.title,onChange:A=>le(L=>({...L,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:X.publicDescription,onChange:A=>le(L=>({...L,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:X.ownerWorkspaceId,onChange:A=>le(L=>({...L,ownerWorkspaceId:A.target.value,participantWorkspaceIds:L.participantWorkspaceIds.filter(S=>S!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(L=>s.jsx("option",{value:L.id,children:L.title},L.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:[X.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>_(new Set(ce.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ce.map(A=>{const L=A.conversations,S=L.filter(he=>X.participantWorkspaceIds.includes(he.id)).length,K=se.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!K,className:"collaboration-group-toggle",onClick:()=>_(he=>{const Z=new Set(he);return Z.has(A.id)?Z.delete(A.id):Z.add(A.id),Z}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:K?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[S,"/",L.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:S===L.length,onChange:()=>le(he=>{const Z=L.map(Le=>Le.id),xe=new Set(he.participantWorkspaceIds);return Z.every(Le=>xe.has(Le))?Z.forEach(Le=>xe.delete(Le)):Z.forEach(Le=>xe.add(Le)),{...he,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),K?null:s.jsx("div",{children:L.map(he=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:X.participantWorkspaceIds.includes(he.id),onChange:Z=>le(xe=>({...xe,participantWorkspaceIds:Z.target.checked?[...xe.participantWorkspaceIds,he.id]:xe.participantWorkspaceIds.filter(Le=>Le!==he.id)})),type:"checkbox"}),s.jsx("span",{children:he.title})]},he.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>z(null),type:"button",children:"取消"}),s.jsx("button",{disabled:B||!X.title.trim()||!X.ownerWorkspaceId,type:"submit",children:B?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&J?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&G(!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:()=>G(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:J.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>G(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:B,onClick:()=>void De(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function cA({busy:e,conversation:i,conversationId:a,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:h,onClose:b,onPreviewReset:y,onStartBlankContext:j,onResetRuntime:w,onSaveResetSelection:T,onWorkspaceChange:R,onWarmupChange:z}){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:G=>G.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:G=>R(G.target.value),value:a??"",children:g.map(G=>s.jsx("optgroup",{label:G.title,children:G.conversations.map(B=>s.jsxs("option",{value:B.id,children:[B.title," · workspaces/",is(B.id)]},B.id))},G.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/${is(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:G=>z(G.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:y,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(dA,{busy:e,preview:r,warmup:p,onCancel:h,onConfirm:w,onSaveSelection:T}):null]})})}function dA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(I=>I.includedByDefault).map(I=>I.id))),[g,h]=D.useState(!1),[b,y]=D.useState(!1),[j,w]=D.useState(null),T=D.useRef(null),R=i.entries.filter(I=>d.has(I.id)),z=R.filter(I=>I.role==="user").length,N=R.length-z,G=i.entries.filter(I=>I.topicRelation!==null).map(I=>I.id),B=G.filter(I=>d.has(I)).length,P=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{T.current&&(T.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const se=e||b;async function _(I){y(!0),w(null);try{await c(i.entries.filter(te=>I.has(te.id)).map(te=>te.id)),p(I)}catch(te){w(Ve(te).message)}finally{y(!1)}}function X(I,te){const ce=new Set(d);te?ce.add(I):ce.delete(I),_(ce)}function le(){const I=new Set(d);G.forEach(te=>I.add(te)),_(I)}function J(){const I=new Set(d);G.forEach(te=>{I.has(te)?I.delete(te):I.add(te)}),_(I)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:se?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:I=>I.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:()=>h(I=>!I),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:se,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:P,disabled:se||i.entries.length===0,onChange:I=>void _(I.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:[z," user"]}),s.jsxs("span",{children:[N," assistant"]}),G.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[B," of ",G.length," Topic input + response"]}),s.jsx("button",{disabled:se||B===G.length,onClick:le,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:se,onClick:J,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((I,te)=>s.jsxs("article",{className:`reset-preview-item ${I.role} ${d.has(I.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${I.role} message ${te+1}`,checked:d.has(I.id),disabled:se,onChange:ce=>X(I.id,ce.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:I.role}),I.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",I.topicRelation]}):null,s.jsx("time",{dateTime:I.createdAt,children:$e(I.createdAt)})]}),s.jsx("pre",{children:I.content})]},I.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:se,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:se,onClick:()=>u(i.entries.filter(I=>d.has(I.id)).map(I=>I.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function fA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const h=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&I_(r.version,h)?L_(r.version):null;return D.useEffect(()=>{const y=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[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:y=>y.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:Zp(h,(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?Zp(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:$e(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((y,j)=>s.jsxs("div",{className:`log-${y.stream}`,children:[s.jsx("time",{children:z_(y.at)}),s.jsx("span",{children:y.text})]},`${y.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 pA({currentUser:e,conversations:i,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:p,managedUsers:g,workspaceMemoryDraft:h,runtimeSettings:b,runtimeModels:y,runtimeCodexVersion:j,runtimeCodexReleasedAt:w,runtimeCodexUpdating:T,runtimeSettingsDraft:R,runtimeSettingsScope:z,settingsWorkspace:N,settingsWorkspaceId:G,systemDiagnostics:B,systemDiagnosticsLoading:P,workspaceGroups:se,workspaceRuntimeSettings:_,workspaceRuntimeSettingsDraft:X,onCancelEnvironmentEdit:le,onClose:J,onCreateUser:I,onDeleteUser:te,onDeleteEnvironment:ce,onDraftChange:Te,onEditEnvironment:ge,onSaveBaseMemoryItems:ue,onSaveResponsibility:V,onSaveWorkspaceMemoryItems:oe,onRevealEnvironmentValue:ye,onRuntimeDraftChange:De,onGlobalSettingsImported:O,onCodexAccountSwitched:A,onUpdateCodexCli:L,onRuntimeScopeChange:S,onSettingsWorkspaceChange:K,onSubmitRuntimeSettings:he,onSubmitEnvironment:Z,onRefreshSystemDiagnostics:xe,onUpdateUser:Le,onWorkspaceRuntimeDraftChange:Xe,onWorkspaceRuntimeReset:Ot,revealedEnvironmentKeys:Yt}){const[Pe,Et]=D.useState("model"),[Jt,zt]=D.useState(!1),[ln,ze]=D.useState(null),[wt,rn]=D.useState(!1),[wn,hi]=D.useState(!1),[gi,zi]=D.useState((N==null?void 0:N.responsibility)??""),[Lt,_a]=D.useState(!1),ne=D.useRef(null),me=z==="workspace"?Object.values((_==null?void 0:_.sources)??{}).filter(Ne=>Ne==="workspace").length:0,Re=e.role==="admin"&&z==="global"&&(Pe==="model"||Pe==="memory"||Pe==="environment");return D.useEffect(()=>{z==="global"&&rn(!1)},[z]),D.useEffect(()=>{zi((N==null?void 0:N.responsibility)??"")},[N==null?void 0:N.id,N==null?void 0:N.responsibility]),D.useEffect(()=>{if(!wt)return;const Ne=At=>{var tt;const gn=At.target;gn instanceof Node&&((tt=ne.current)!=null&&tt.contains(gn))||rn(!1)},Ie=At=>{At.key==="Escape"&&rn(!1)};return document.addEventListener("pointerdown",Ne,!0),document.addEventListener("keydown",Ie,!0),()=>{document.removeEventListener("pointerdown",Ne,!0),document.removeEventListener("keydown",Ie,!0)}},[wt]),s.jsxs("div",{className:"context-panel-overlay settings-overlay",onClick:J,role:"presentation",children:[s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Ne=>Ne.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"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":z==="global",className:z==="global"?"active":void 0,onClick:()=>S("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:ne,children:[s.jsx("button",{"aria-checked":z==="workspace","aria-expanded":z==="workspace"?wt:void 0,"aria-label":z==="workspace"?"Settings workspace target":void 0,className:z==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(z!=="workspace"){S("workspace");return}rn(Ne=>!Ne)},role:"radio",type:"button",children:z==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(N==null?void 0:N.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),z==="workspace"&&wt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:se.map(Ne=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:Ne.title}),Ne.conversations.map(Ie=>s.jsxs("button",{"aria-selected":Ie.id===G,className:Ie.id===G?"selected":void 0,onClick:()=>{K(Ie.id),rn(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ie.title}),s.jsxs("small",{children:["workspaces/",Ie.id]})]},Ie.id))]},Ne.id))}):null]})]}):null]}),s.jsxs("div",{className:"settings-header-actions",children:[Re?s.jsx("button",{className:"settings-transfer-button",onClick:()=>hi(!0),type:"button",children:"Import / Export"}):null,s.jsx("button",{"aria-label":"Close settings panel",onClick:J,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:()=>Et("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:()=>Et("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:()=>Et("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:()=>Et("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:()=>Et("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Login + active account"})]}),s.jsxs("button",{className:Pe==="system"?"active":void 0,onClick:()=>Et("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:()=>Et("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"?s.jsxs("div",{className:`settings-scope-banner ${z==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:z==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:z==="workspace"?`${(N==null?void 0:N.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Pe==="system"?s.jsx(hA,{conversations:i,diagnostics:B,loading:P,onRefresh:xe}):Pe==="users"?s.jsx(jA,{currentUser:e,users:g,onCreate:I,onDelete:te,onUpdate:Le}):Pe==="accounts"?s.jsx(kA,{onSwitched:A}):Pe==="model"?s.jsx(SA,{draft:z==="workspace"?X:R,globalSettings:b,models:y,codexVersion:j,codexReleasedAt:w,codexUpdating:T,scope:z,workspaceOverrideCount:me,settings:z==="workspace"?(_==null?void 0:_.effective)??X:b,workspaceSettings:_,onDraftChange:z==="workspace"?Xe:De,onResetWorkspaceSetting:Ot,onSubmit:he,onUpdateCodexCli:L}):Pe==="responsibility"?s.jsx(xA,{draft:gi,saving:Lt,scope:z,workspace:N,onDraftChange:zi,onSubmit:Ne=>{Ne.preventDefault(),Ne.stopPropagation(),!(z!=="workspace"||!N)&&(_a(!0),V(N.id,gi).then(Ie=>zi(Ie)).finally(()=>_a(!1)))}}):Pe==="memory"?s.jsx(CA,{baseSettings:d,scope:z,workspaceSettings:h,workspaceName:N==null?void 0:N.title,onSaveBaseItems:ue,onSaveWorkspaceItems:oe}):s.jsx(AA,{deleteConfirmKey:ln,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,scope:z,workspaceEnvironment:c,valueVisible:Jt,onCancelEnvironmentEdit:le,onDeleteConfirmChange:ze,onDeleteEnvironment:ce,onDraftChange:Te,onEditEnvironment:ge,onRevealEnvironmentValue:ye,onSubmitEnvironment:Z,onValueVisibleChange:zt,revealedEnvironmentKeys:Yt})]})]})]}),wn?s.jsx(mA,{onClose:()=>hi(!1),onImported:async()=>{await O(),hi(!1)}}):null]})}const No=[{id:"runtime",label:"Runtime",description:"Model, reasoning, fast mode, sandbox, and notifications"},{id:"environment",label:"Environment",description:"Global environment keys, descriptions, and secret values"},{id:"memory",label:"Memory",description:"Global memory items used as the base workspace context"}];function mA({onClose:e,onImported:i}){const[a,r]=D.useState("export"),[u,c]=D.useState(()=>new Set(No.map(B=>B.id))),[d,p]=D.useState(""),[g,h]=D.useState(null),[b,y]=D.useState(!1),[j,w]=D.useState(""),T=g?new Set(No.filter(B=>g[B.id]!==void 0).map(B=>B.id)):new Set;function R(B){r(B),w(""),c(B==="export"?new Set(No.map(P=>P.id)):new Set(T))}function z(B){c(P=>{const se=new Set(P);return se.has(B)?se.delete(B):se.add(B),se})}async function N(B){var se;const P=(se=B.target.files)==null?void 0:se[0];if(B.target.value="",!!P){w("");try{if(P.size>5*1024*1024)throw new Error("The settings file is larger than 5 MB.");const _=JSON.parse(await P.text()),X=Qv(_),le=new Set(No.filter(J=>X[J.id]!==void 0).map(J=>J.id));if(le.size===0)throw new Error("The file does not contain Runtime, Environment, or Memory.");p(P.name),h(X),c(le)}catch(_){p(""),h(null),c(new Set),w(_ instanceof Error?_.message:"Invalid settings file.")}}}async function G(){if(u.size===0){w("Select at least one settings category.");return}y(!0),w("");try{if(a==="export"){const B=await _2(u);R2(B),e()}else{if(!g)throw new Error("Choose a Seele global settings file first.");const B={format:g.format,version:g.version,exportedAt:g.exportedAt,...u.has("runtime")?{runtime:g.runtime}:{},...u.has("environment")?{environment:g.environment}:{},...u.has("memory")?{memory:g.memory}:{}};await D2(B),await i()}}catch(B){w(B instanceof Error?B.message:"Settings transfer failed.")}finally{y(!1)}}return s.jsx("div",{className:"memory-editor-overlay",onClick:B=>{B.stopPropagation(),b||e()},role:"presentation",children:s.jsxs("section",{"aria-label":"Import or export global settings","aria-modal":"true",className:"memory-delete-dialog global-transfer-dialog",onClick:B=>B.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Global Settings Transfer"}),s.jsx("button",{"aria-label":"Close global settings transfer",className:"memory-icon-button",disabled:b,onClick:e,type:"button",children:"×"})]}),s.jsxs("div",{className:"global-transfer-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":a==="export",className:a==="export"?"active":void 0,onClick:()=>R("export"),role:"tab",type:"button",children:"Export"}),s.jsx("button",{"aria-selected":a==="import",className:a==="import"?"active":void 0,onClick:()=>R("import"),role:"tab",type:"button",children:"Import"})]}),a==="import"?s.jsxs("label",{className:"global-transfer-file",children:[s.jsx("span",{children:d||"Choose a .json settings file"}),s.jsx("input",{accept:"application/json,.json",disabled:b,onChange:B=>void N(B),type:"file"})]}):s.jsx("p",{children:"Export selected Global settings into one portable JSON file. Environment export includes secret values; store the file securely."}),s.jsx("div",{className:"global-transfer-options",children:No.map(B=>{const P=b||a==="import"&&!T.has(B.id);return s.jsxs("label",{className:`global-transfer-option ${P?"disabled":""}`,children:[s.jsx("input",{checked:u.has(B.id),disabled:P,onChange:()=>z(B.id),type:"checkbox"}),s.jsxs("span",{children:[s.jsx("strong",{children:B.label}),s.jsx("small",{children:B.description})]})]},B.id)})}),a==="import"&&g?s.jsx("p",{className:"global-transfer-warning",children:"Import replaces the selected Global categories on this deployment. Other settings and all workspace overrides remain unchanged."}):null,j?s.jsx("p",{className:"memory-editor-error",children:j}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:b,onClick:e,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||u.size===0||a==="import"&&!g,onClick:()=>void G(),type:"button",children:b?"Working...":a==="export"?"Export file":"Import selected"})]})]})})}function hA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),h=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{h&&(await navigator.clipboard.writeText(h),p(!0),window.setTimeout(()=>p(!1),1800))},y=()=>{if(!h||!i)return;const w=URL.createObjectURL(new Blob([h],{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(B=>`- ${Po(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
|
|
90
|
+
`),R=JSON.stringify(w,null,2),z=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Po(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),G=new URL("https://github.com/seele-labs/seele-work/issues/new");G.searchParams.set("title",N),G.searchParams.set("body",z),window.open(G.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:[Ln(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 · ",Ap(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?$e(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?Ap(w.uptimeMs):`${Ap(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(Tm,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:y,title:"Download system log report",type:"button",children:s.jsx(gA,{})}),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(yA,{})}),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," · ",Po(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 gA(){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 yA(){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 xA({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 bA({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=Kc(i.usedPercent),r=zv(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:hw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",gw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function vA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function wA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function kA({onSwitched:e}){var A;const[i,a]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[h,b]=D.useState(""),[y,j]=D.useState(!1),[w,T]=D.useState(""),[R,z]=D.useState(null),[N,G]=D.useState(null),[B,P]=D.useState(""),[se,_]=D.useState(null),[X,le]=D.useState(null),[J,I]=D.useState(!1);async function te(){var S;const L=await Kx();a(L),((S=L.login)==null?void 0:S.status)==="pending"&&(z(L.login),j(!0))}async function ce(L){d(!0),b("");try{a(await Xx(L))}catch(S){b(Ve(S).message)}finally{d(!1)}}D.useEffect(()=>{let L=!1;return Kx().then(S=>{var K;L||(a(S),((K=S.login)==null?void 0:K.status)==="pending"&&(z(S.login),j(!0)),S.accounts.length>0&&(d(!0),Xx(!1).then(he=>{L||a(he)}).catch(he=>{L||b(Ve(he).message)}).finally(()=>{L||d(!1)})))}).catch(S=>{L||b(Ve(S).message)}).finally(()=>{L||u(!1)}),()=>{L=!0}},[]),D.useEffect(()=>{if(!R||R.status!=="pending")return;let L=!1;const S=window.setInterval(()=>{v2(R.id).then(async K=>{L||(z(K),K.status!=="pending"&&(window.clearInterval(S),K.status==="succeeded"&&(await te(),await ce(!0))))}).catch(K=>{L||b(Ve(K).message)})},1e3);return()=>{L=!0,window.clearInterval(S)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function Te(){T(""),z(null),b(""),I(!1),j(!0)}async function ge(L){L.preventDefault(),g(!0),b("");try{z(await b2(w.trim()))}catch(S){b(Ve(S).message)}finally{g(!1)}}async function ue(){if(!R||R.status!=="pending"){j(!1);return}g(!0),b("");try{const L=await w2(R.id);z(L),j(!1)}catch(L){b(Ve(L).message)}finally{g(!1)}}function V(L){G(L),P(L.name),b("")}async function oe(L){if(L.preventDefault(),!N)return;const S=B.trim();if(!S||S===N.name){G(null);return}g(!0),b("");try{await k2(N.id,S),G(null),await te()}catch(K){b(Ve(K).message)}finally{g(!1)}}async function ye(){var L;if(se){g(!0),b("");try{const S=await S2(se.id);a(S),_(null),await e()}catch(S){const K=Ve(S);b((L=K.detail)!=null&&L.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":K.detail??K.message)}finally{g(!1)}}}async function De(){if(X){g(!0),b("");try{await j2(X.id),le(null),await te()}catch(L){b(Ve(L).detail??Ve(L).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 isolated Codex logins. Workspaces do not bind to an account; all work uses the single active account."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void ce(!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:Te,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Manual stop-and-switch"}),s.jsx("span",{children:"Switching requires the whole runtime to be idle. Seele stops retained workers, activates the selected credential, then resumes queued work. No automatic switching or parallel accounts."})]}),h?s.jsx("p",{className:"memory-editor-error",children:h}):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(L=>{var Z;const S=(i==null?void 0:i.activeAccountId)===L.id,K=(Z=i==null?void 0:i.accountDetails)==null?void 0:Z[L.id],he=[L.email,vA(L.accountType),wA(L.planType)].filter(xe=>!!xe);return s.jsxs("article",{className:S?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:L.name}),S?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:he.join(" · ")||`Added ${$e(L.createdAt)}`}),K!=null&&K.usage?s.jsx(bA,{usage:K.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),K?s.jsx("small",{className:K.error?"codex-account-detail-error":"codex-account-refreshed",children:K.error?`Refresh issue: ${K.error}`:`Updated ${$e(K.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>V(L),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||S,onClick:()=>{b(""),_(L)},type:"button",children:S?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||S,onClick:()=>{b(""),le(L)},type:"button",children:"Delete"})]})]},L.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&G(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:L=>L.stopPropagation(),onSubmit:L=>void oe(L),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:()=>G(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:L=>P(L.target.value),value:B})]}),h?s.jsx("p",{className:"memory-editor-error",children:h}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>G(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!B.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,y?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:L=>L.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),I(!0),window.setTimeout(()=>I(!1),1500)},type:"button",children:J?"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 and ready. 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:L=>L.stopPropagation(),onSubmit:L=>void ge(L),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 an isolated login profile. Completing login adds it to the list but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:L=>T(L.target.value),placeholder:"For example: Codex backup",value:w})]}),h?s.jsx("p",{className:"memory-editor-error",children:h}):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,se?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&_(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:L=>L.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:()=>_(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch global execution to ",s.jsx("strong",{children:se.name}),"? This succeeds only when every workspace and goal is idle. Retained Codex workers will be stopped; workspace threads and memory stay unchanged."]}),h?s.jsx("p",{className:"memory-editor-error",children:h}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ye(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,X?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&le(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:L=>L.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:()=>le(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:X.name})," and its persisted Codex credential from this Seele deployment? This cannot be undone."]}),h?s.jsx("p",{className:"memory-editor-error",children:h}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>le(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void De(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function jA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,h]=D.useState(c),[b,y]=D.useState(!1),[j,w]=D.useState(null),[T,R]=D.useState("");function z(){h(c),R(""),p("new")}function N(P){h({username:P.username,password:"",role:P.role,active:P.active}),R(""),p(P)}function G(){b||(p(null),R(""))}async function B(P){if(P.preventDefault(),!!d){y(!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(se){R(Ve(se).message)}finally{y(!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:z,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(P=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:P.username}),P.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(P.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${P.role}`,children:P.role}),s.jsx("span",{className:`user-status ${P.active?"active":"disabled"}`,children:P.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${P.username}`,className:"memory-icon-button",onClick:()=>N(P),title:"Edit",type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":`Delete user ${P.username}`,className:"memory-icon-button memory-item-delete",disabled:P.id===e.id,onClick:()=>{R(""),w(P)},title:"Delete",type:"button",children:"×"})]})]},P.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:G,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:P=>P.stopPropagation(),onSubmit:P=>void B(P),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:G,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:P=>h(se=>({...se,username:P.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:P=>h(se=>({...se,password:P.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:P=>h(se=>({...se,role:P.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:P=>h(se=>({...se,active:P.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:G,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:P=>P.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(P=>R(Ve(P).message))},type:"button",children:"Delete"})]})]})}):null]})}function SA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:h,onDraftChange:b,onResetWorkspaceSetting:y,onSubmit:j,onUpdateCodexCli:w}){var R;const T=d==="workspace";return 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:Do(T,ea(r.model,u.model,h==null?void 0:h.sources.model)),children:[s.jsx(_o,{globalValue:lb(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:ea(r.model,u.model,h==null?void 0:h.sources.model),onReset:y}),s.jsx(hp,{"aria-label":"Runtime model",onChange:z=>b({...r,model:z}),options:U_(c,r.model),value:r.model||((R=c.find(z=>z.isDefault))==null?void 0:R.model)||""})]}),s.jsxs("label",{className:Do(T,ea(r.reasoningEffort,u.reasoningEffort,h==null?void 0:h.sources.reasoningEffort)),children:[s.jsx(_o,{globalValue:ab(u.reasoningEffort),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:ea(r.reasoningEffort,u.reasoningEffort,h==null?void 0:h.sources.reasoningEffort),onReset:y}),s.jsx(hp,{"aria-label":"Runtime reasoning effort",onChange:z=>b({...r,reasoningEffort:z}),options:HE,value:r.reasoningEffort})]}),s.jsxs("label",{className:Do(T,ea(r.sandbox,u.sandbox,h==null?void 0:h.sources.sandbox)),children:[s.jsx(_o,{globalValue:sb(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:ea(r.sandbox,u.sandbox,h==null?void 0:h.sources.sandbox),onReset:y}),s.jsx(hp,{"aria-label":"Permission mode",onChange:z=>b({...r,sandbox:z}),options:$E,value:r.sandbox})]}),s.jsxs("label",{className:Do(T,ea(r.fastMode,u.fastMode,h==null?void 0:h.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(_o,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:ea(r.fastMode,u.fastMode,h==null?void 0:h.sources.fastMode),onReset:y}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:z=>b({...r,fastMode:z.target.checked}),type:"checkbox"})]}),s.jsxs("label",{className:Do(T,ea(r.notifyEnabled,u.notifyEnabled,h==null?void 0:h.sources.notifyEnabled),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(_o,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:T,label:"Profuse notification",settingKey:"notifyEnabled",source:ea(r.notifyEnabled,u.notifyEnabled,h==null?void 0:h.sources.notifyEnabled),onReset:y}),s.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),s.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:z=>b({...r,notifyEnabled:z.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 ",lb(p.model,c),", reasoning"," ",ab(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",sb(p.sandbox),", notification"," ",p.notifyEnabled?"on":"off","."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:Zp(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 _o({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 hp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var y;(y=d.current)!=null&&y.contains(b.target)||c(!1)}function h(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",h,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",h,!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 ea(e,i,a){return e!==i?"workspace":a}function Do(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function CA({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(EA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(TA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function TA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var X;const[c,d]=D.useState(Vo(a)),[p,g]=D.useState(null),[h,b]=D.useState({key:"",value:""}),[y,j]=D.useState(null),[w,T]=D.useState(null),[R,z]=D.useState(null);D.useEffect(()=>{d(Vo(a))},[a]),D.useEffect(()=>{if(p===null)return;const le=J=>{J.key==="Escape"&&(P(),T(null))};return document.addEventListener("keydown",le),()=>document.removeEventListener("keydown",le)},[p]);async function N(le,J){z(J);try{const I=await r(le);return d(Vo(I)),I}finally{z(null)}}function G(){T(null),j(null),b({key:"",value:""}),g("new")}function B(le){const J=c[le];J&&(T(null),j(null),b({...J}),g(le))}function P(){g(null),j(null),b({key:"",value:""})}async function se(le){const J=c[le],I=(J==null?void 0:J.key)||`${le}`;await N(c.filter((te,ce)=>ce!==le),`delete:${I}`),T(null)}async function _(le){le.preventDefault(),le.stopPropagation();const J=h.key.trim(),I=V2(J);if(I){j(I);return}const te=h.value.trim();if(!te){j("Value is required.");return}const ce=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==ce&&ge.key.trim()===J)){j(`Key "${J}" already exists. Each memory key must be unique.`);return}const Te={...h,key:J,value:te};p==="new"?await N([...c,Te],"add"):typeof p=="number"&&await N(c.map((ge,ue)=>ue===p?Te:ge),`save:${p}`),P()}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:G,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((le,J)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${le.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${le.key}>`}),`
|
|
92
|
+
`,s.jsx("span",{children:le.value}),`
|
|
93
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${le.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${le.key||J+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>B(J),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${le.key||J+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>T(J),children:"×"})]})]},`${J}-${le.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:P,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:le=>le.stopPropagation(),onSubmit:le=>void _(le),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:P,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:le=>b(J=>({...J,key:le.target.value})),placeholder:"Stable technical key used as the injected tag name",value:h.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:le=>b(J=>({...J,value:le.target.value})),placeholder:"Memory content injected under this key",rows:10,value:h.value})]}),y?s.jsx("p",{className:"memory-editor-error",children:y}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:P,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:le=>le.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:((X=c[w])==null?void 0:X.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 se(w),children:"Delete"})]})]})}):null]})}function EA({emptyText:e,items:i}){const a=Vo(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 AA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:h,onDraftChange:b,onEditEnvironment:y,onRevealEnvironmentValue:j,onSubmitEnvironment:w,onValueVisibleChange:T,revealedEnvironmentKeys:R}){const z=i!==null&&R.has(i),N=u==="workspace",G=N?c:r,[B,P]=D.useState(!1);function se(){p(),b({description:"",key:"",value:""}),T(!1),P(!0)}function _(J){y(J),T(!1),P(!0)}function X(){P(!1),p(),T(!1)}function le(J){w(J),P(!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(_x,{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:se,children:"+"})}),s.jsx(_x,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:J=>g(J),onEdit:_,variables:G})]}),B?s.jsx("div",{className:"memory-editor-overlay",onClick:X,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:J=>J.stopPropagation(),onSubmit:le,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:X,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:J=>b({...a,key:J.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:J=>b({...a,value:J.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&&!z&&!a.value){j(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(t2,{}):s.jsx(e2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:J=>b({...a,description:J.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:X,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:J=>J.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:()=>{h(e),g(null)},children:"Delete"})]})]})}):null]})}function _x({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"," ",$e(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 Rv({items:e,onDelete:i,onEdit:a}){const[r,u]=D.useState(null),[c,d]=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:_A(p.kind)}),s.jsx("span",{className:MA(p.status),children:DA(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," · ",RA(p.refreshPolicy)," · updated ",$e(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(Wc,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function NA({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(Rv,{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 _A(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function DA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function RA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function MA(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 OA({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,zA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),h=r.indexOf(p);return g>=0||h>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(h>=0?h:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Dx(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 ",$e(i.generatedAt)]}),s.jsxs("span",{children:[Ln(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:Dx(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Ln(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Dx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function zA(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 LA({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:Mo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Mo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Mo(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Ln(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Ln(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Ln(e.userMessageCount)} / ${Ln(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Ln(e.compactionCount)} / ${Ln(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:Mo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Mo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":ls(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 Oo(e,i,a,r,u,c,d,p,g,h){var b,y,j,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$e(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":$e(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Io,{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":$e(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Hx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":$e(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:Y_(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:$e(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Hx,{content:e.message.content}):s.jsx(Io,{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":$e(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:$e(R.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Io,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const T=ur({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":$e(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:()=>h==null?void 0:h(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Dc,{})}):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(Ov,{description:e.tool.body,icon:s.jsx(Mv,{}),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(WA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((y=e.tool.fileChanges)!=null&&y.length)?s.jsx(YA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(VA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(PA,{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":$e(e.tool.createdAt),title:$e(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(Dc,{})}),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:$e(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Io,{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":$e(e.tool.createdAt),title:$e(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(Dc,{})}):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 Rx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&IA(e.tool)}function IA(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 UA(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 BA({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:h,onRespondApproval:b,onRespondWorkspaceChangeProposal:y,onRespondKnowledgeProposal:j,onOpenComplexTask:w,onOpenSystemEvent:T}){const R=UA(e.agentItems.filter(Rx)),z=e.agentItems.some(te=>!Rx(te)),N=a&&(z||e.turnIds.length>0),G=c?"process":"result",[B,P]=D.useState(G),[se,_]=D.useState(!1),X=B==="result"?R:e.agentItems,le=QA(X);D.useEffect(()=>{se||P(G)},[G,se]);const J=c||N||e.stopped,I=s.jsxs(s.Fragment,{children:[J?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":B==="result"?"Show process":"Show result",className:"turn-view-toggle",title:B==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),P(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:B==="result"?s.jsx(qA,{}):s.jsx(HA,{})}):null}):null,X.map(te=>s.jsx(D.Fragment,{children:Oo(te,i,h,d,u,b,y,j,w,T)},te.id)),B==="result"&&X.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":z?"No reliable final answer captured":"No result yet"}):null,s.jsx(zo,{copied:r,content:le,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:ZA(X),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:J?"stopped-turn-body has-controls":"stopped-turn-body",children:I})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",J?"has-controls":""].filter(Boolean).join(" "),children:I})}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 HA(){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 $A(){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 Mv(){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 GA(){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 Ov({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":$e(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 VA({conversation:e,tool:i,onRespond:a}){var z;const r=we((z=i.workspaceChangePayload)==null?void 0:z.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,h]=D.useState("source"),[b,y]=D.useState(!1),j=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:j?"pending":"preparing",T=w==="pending";D.useEffect(()=>{c(r)},[r]);async function R(N){p(N);try{await a(i,N,N==="accept"?{content:u}:void 0)&&y(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Ov,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(Wc,{}),onClick:()=>y(!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&&y(!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 · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>y(!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:()=>h("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>h("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:Sl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Sl(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:()=>y(!1),type:"button",children:"Close"})})]})}):null]})}function PA({tool:e,onRespond:i}){const[a,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",h=g==="pending",b=Mx(a);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":$e(e.createdAt),title:$e(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})]}),h?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:y=>r(y.target.value),rows:10,value:a}):b?s.jsx(Ox,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Ox,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),h?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Mx(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 Mx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function gp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Ox({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:gp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:gp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:gp(e.content??e.description)})]})]})})}function YA({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=EE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":$e(i.createdAt),title:$e(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:TE(a,r)})]}),s.jsx(zx,{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:FA(p.kind)}),s.jsx("code",{title:p.path,children:bv(p.path,r)}),s.jsx(zx,{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 zx({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 FA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function WA({tool:e,onRespondApproval:i}){var j;const a=y_(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=qc(e.body)?null:e.body,h=g?k_(g):null,b=h?`${KA(a)} · ${h}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",y=x_(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":$e(e.createdAt),title:$e(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:y})]}),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(Lx,{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:b_(e,a)}),e.output?s.jsx(Lx,{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(XA,{events:e.rawEvents??[]}):null]})}function KA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Lx({content:e}){const[i,a]=D.useState(!1),r=w_(e,Tx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:v_(e,Tx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function XA({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 zo({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(Xv,{})}):null,s.jsx("time",{dateTime:u,children:$e(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 Lo(e){return e.type==="message"?e.message.role==="user"?e.message.content:cr(e.message.content):e.type==="assistantText"?cr(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 QA(e){return e.map(Lo).filter(i=>i.trim()).join(`
|
|
100
|
+
|
|
101
|
+
`)}function ZA(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 JA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(eN,{label:zv(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 zv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function eN({label:e,window:i}){const a=Kc(i.usedPercent),r=Nm(a),u=`${e} usage ${hw(a)} · resets ${gw(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 tN(e,i,a,r,u,c){const d=[...e].sort(Go),p=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.sequence])),g=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.timelineAt])),h=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.sequence])),b=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.timelineAt])),y=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),j=y.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),w=y.filter(_=>!j.includes(_)),T=new Set(y.flatMap(_=>_.turnId?[_.turnId]:[])),R=mE(i),z=new Map(a.map(_=>[_.id,_])),N=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),B=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...a.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var Et,Jt,zt,ln;const X=z.get(_),le=d.filter(ze=>ze.turnId===_),J=le.filter(ze=>ze.role==="user").sort((ze,wt)=>{const rn=b.get(ze.id)??ze.createdAt,wn=b.get(wt.id)??wt.createdAt;return rn.localeCompare(wn)||Go(ze,wt)}),I=le.filter(ze=>ze.role==="assistant"),te=i.filter(ze=>ze.turnId===_).sort(Go),ce=`turn:${_}`,Te=r.filter(ze=>ze.parentId===ce).sort((ze,wt)=>ze.sequence-wt.sequence),ge=(X==null?void 0:X.origin)??R.get(_),ue=j.filter(ze=>ze.turnId===_).sort((ze,wt)=>ze.timelineAt.localeCompare(wt.timelineAt)||ze.sequence-wt.sequence).map(ze=>Ix(ze,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?cN(Te,te,Ho([_],u),c):Iv(te,Ho([_],u),c),oe=I.map(Ro),ye=Te.find(ze=>ze.subtype==="server.complex_task.plan_updated"),De=te.find(ze=>ze.event==="server.complex_task.plan_updated"),O=(ye==null?void 0:ye.detail)??(De==null?void 0:De.data),A=pe(pe(O).task),L=pe(A.currentPlan),S=we(L.planMarkdown),K=lN(uN(V,oe),S),he=hE(X);he&&K.push({id:`turn-error-${he.turnId}`,type:"turnError",createdAt:he.createdAt,content:he.content});const Z=te.find(ze=>ze.event==="server.wakeup.started"),xe=pe(Z==null?void 0:Z.data),Le=typeof xe.instruction=="string"?xe.instruction.trim():"",Xe=ge==="timeline_event"?te[0]:void 0,Ot=T.has(_)?null:Xe?Lv(Xe,(X==null?void 0:X.startedAt)??new Date(0).toISOString()):rN(ge)?{id:`system-${_}`,type:"system",createdAt:(X==null?void 0:X.startedAt)??((Et=te[0])==null?void 0:Et.createdAt)??new Date(0).toISOString(),title:sN(ge??"system"),detail:oN(ge??"system",Le),fullDetail:Le||void 0}:null,Yt=SN(te),Pe=(J[0]?b.get(J[0].id):(Jt=j.find(ze=>ze.turnId===_))==null?void 0:Jt.timelineAt)??g.get(_)??(X==null?void 0:X.startedAt)??((zt=le[0])==null?void 0:zt.createdAt)??((ln=te[0])==null?void 0:ln.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:Ot??(J[0]?Ro(J[0]):null),followupUsers:J.slice(1).map(Ro),acceptedSystemInputs:ue,agentItems:K,activity:Yt??(Ho([_],u)?{id:-1,title:K.some(ze=>ze.type==="assistantText"&&ze.streaming)?"Writing response":"Working",createdAt:Pe,tone:"running"}:null),notificationFailure:jN(te),stopped:te.some(Bv),trailingSystemItems:[],sortAt:Pe,sortSequence:p.get(_)??null}}),P=d.filter(_=>!_.turnId);B.push(...P.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?Ro(_):null,followupUsers:[],agentItems:_.role==="assistant"?[Ro(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:h.get(_.id)??null})));const se=new Map(i.map(_=>[String(_.id),_]));return B.push(...w.map(_=>({id:_.id,turnIds:[],user:Ix(_,_.entityType==="event"&&_.entityId?se.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),B.sort((_,X)=>{const le=_.sortAt.localeCompare(X.sortAt);return le!==0?le:_.sortSequence!==null||X.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(X.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...X})=>X)}function Ix(e,i,a){var g,h;if(i||e.entityType==="event")return Lv(i??Wp(e),e.createdAt);const r=pe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=$p(r,a),y=nN(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:y,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",j.length>0?j.map(T=>{const R=a.get(T)??T;return`${rr(R)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
|
|
102
|
+
`)}}const u=we(r.complexTaskId)||we(pe(r.task).id)||void 0,c=yv(e.title,e.subtype),d=ur(r,[e.summary,e.contentMarkdown]),p=[`## ${rr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((h=e.summary)==null?void 0:h.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 nN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=pe(u),d=we(c.id),p=we(c.senderWorkspaceId),g=we(c.contentMarkdown).trim(),h=we(c.createdAt);!d||a.has(d)||!p||!g||!h||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(we(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:h}))}return r}function Lv(e,i){return e.event==="server.collaboration.topic_created"?iN(e,i):aN(e,i)}function iN(e,i){const a=pe(pe(e.data).topic),r=we(a.title).trim()||"Untitled Topic",u=we(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(pe):[],d=we(a.ownerWorkspaceId),p=c.find(y=>we(y.role)==="owner"||we(y.workspaceId)===d),g=we(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",h=c.filter(y=>we(y.role)!=="owner"&&we(y.status)==="active"),b=h.length?h.map(y=>{const j=we(y.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${rr(j)} (\`${we(y.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",rr(r),"","**描述**","",rr(u),"","**Owner Workspace**","",`${rr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
105
|
+
`)}}function aN(e,i){const a=pe(e.data),r=Fp(e.data),u=yv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:ur(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${rr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
|
|
106
|
+
`)}}function Fp(e,i=""){return Array.isArray(e)?e.map(a=>Fp(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,Fp(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Po(e)||e}function lN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?cr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?cr(r.message.content).trim()!==a:!0):e}function rN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function sN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function oN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?ow(i,20):"Auto resumed"}function uN(e,i){if(e.some(u=>u.type==="assistantText"))return Bc(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Sm(u.tool)&&jm(a,u.tool)||r.push(u);return Bc([...r,...a])}function cN(e,i,a,r){var g;const u=new Map(i.filter(h=>h.id!==void 0).map(h=>[String(h.id),h])),c=new Map,d=new Set;for(const h of e){const b=dN(h,i,u);b.length>0&&d.add(h.id);for(const y of b)c.set(Aa(y),y)}if(a)for(const h of i)fN(e,h)||c.set(Aa(h),h);else if(i.length>0&&!e.some(h=>h.phase==="process"))for(const h of i)c.set(Aa(h),h);const p=Iv([...c.values()].sort(Go),a,r);for(const h of e)if(!d.has(h.id)){if(h.nodeType==="agent_text"&&h.subtype!=="final_answer"&&((g=h.contentMarkdown)!=null&&g.trim())){p.push({id:h.id,type:"assistantText",createdAt:h.createdAt,content:h.contentMarkdown,phase:pN(h),itemId:h.entityType==="codex_item"?h.entityId??void 0:void 0,streaming:a&&h.status==="running"});continue}h.nodeType==="operation"&&p.push({id:h.id,type:"tool",createdAt:h.createdAt,tool:mN(h,r)})}return Bc(p)}function dN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Wp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>km(u)===e.entityId);return r.length>0?r:[Wp(e)]}return[]}function Wp(e){const i=pe(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":we(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 fN(e,i){const a=i.id===void 0?null:String(i.id),r=km(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function km(e){if(e.event!=="codex.notification")return null;const i=pe(e.data),a=pe(i.params),r=pe(a.item);return we(r.id)||we(a.itemId)||null}function pN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function mN(e,i){var r,u;const a=pe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?$p(a,i).title:e.title||uw(e.subtype),body:e.subtype==="input:collaboration_notice"?$p(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||nw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Iv(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"){yN(r,p);continue}if(p.event==="server.knowledge.decision"){xN(r,p);continue}if(Bv(p)){kN(r);continue}if(p.event==="server.steer"){const T=pe(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=H_(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const h=q_(p.data);if(h!=null&&h.text){const T=h.itemId?d.get(h.itemId)??h.phase:h.phase,R=h.itemId??`phase:${T}`,z=`${u.get(R)??""}${h.text}`,N=Yv(z),G=c.get(R)??"",B=N.startsWith(G)?N.slice(G.length):N;if(u.set(R,z),c.set(R,N),B){const P=r[r.length-1];(P==null?void 0:P.type)==="assistantText"&&vN(P,h.itemId,T)?(P.content+=B,P.itemId=P.itemId??h.itemId,P.streamKey=P.streamKey??R,P.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:B,phase:T,itemId:h.itemId,streamKey:R,streaming:i})}continue}const b=$_(p.data);if(b!=null&&b.text){const T=cr(b.text),R=b.itemId??`phase:${b.phase}`,z=wN(r,b.itemId,b.phase);if(z>=0){const N=r[z];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,gN(r,z,b.itemId)):r.splice(z,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 y=p_(p,a);if(y){y.rawEvents=[p];const T=Bx(r,y);if(T>=0){qx(r[T],y);continue}if(Sm(y)&&jm(r,y)||y.kind==="command"&&y.meta==="running"&&qc(y.body))continue;r.push({id:`tool-${y.id}`,type:"tool",createdAt:y.createdAt,tool:y});continue}const j=m_(p);if(j){j.rawEvents=[p];const T=Bx(r,j);if(T>=0){qx(r[T],j);continue}r.push({id:`tool-${j.id}`,type:"tool",createdAt:j.createdAt,tool:j});continue}if(kE(p)){hN(r,p);continue}const w=h_(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Bc(r)}function hN(e,i){const a=km(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:qv(u.tool.rawEvents,[i])};return}}}function gN(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 yN(e,i){const a=pe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=pe(a.payload),d=we(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 xN(e,i){const a=pe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=pe(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 jm(e,i){const a=Uv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Ux(d,i))continue;const p=cr(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"||!Ux(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const h=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,h).trimEnd(),y=d.content.slice(h).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}),y&&j.push({...d,id:`${d.id}:after-tool-${i.id}`,content:y,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 Ux(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Bc(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Sm(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)jm(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return bN([...u,...r])}function Sm(e){return typeof Uv(e)=="number"}function Uv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function bN(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 vN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function wN(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 Bv(e){return e.event==="server.stop"||e.event==="server.stopped"}function kN(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 jN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=pe(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function SN(e){for(let i=e.length-1;i>=0;i-=1){const a=cw(e[i]);if(a)return a}return null}function Bx(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 qx(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"&&qc(i.body)&&!qc(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:N_(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:qv(e.tool.rawEvents,i.rawEvents)}}function qv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Aa(u);return r.has(c)?!1:(r.add(c),!0)})}function Ro(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function yp(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=>Hv(u)?!r.some(c=>CN(c,u)):!0)}function xp(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 bp(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 Hv(e){return e.id.startsWith("local-")}function CN(e,i){if(Hv(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 Cc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Aa(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=$v(c,d);return p!==0?p:(r.get(Aa(c))??0)-(r.get(Aa(d))??0)})}function vp(e,i){const a=Aa(i),r=e.findIndex(c=>Aa(c)===a);if(r<0)return[...e,i];if(TN(e[r],i))return e;const u=[...e];return u[r]=i,u}function TN(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 Aa(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Go(e,i){const a=$v(e,i);return a!==0?a:EN(e.id,i.id)}function $v(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 EN(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 wp(e,i){const a=pe(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 Io=D.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?Yv(i):cr(i),g=a&&!r?zN(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(_N,{content:p,conversation:a}):Sl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(h=>s.jsx(ON,{artifact:h,onPreview:u,onCopyUrl:c,copied:d===h.url},h.id))}):null]})},AN);function AN(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 Hx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const NN=2;function _N({content:e,conversation:i}){const a=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=DN(e);return D.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,h=p.scrollHeight;u(b=>{const y=g*NN,j=Math.min(h,y);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(D.Fragment,{children:Sl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function DN(e){const i=MN(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:RN(a),activeBlock:r}}function RN(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(),h=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Tc(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&&(Tc(i,e.slice(a,h)),a=h,u=!1),g===""&&(Tc(i,e.slice(a,d)),a=d)}return a<e.length&&Tc(i,e.slice(a)),i}function Tc(e,i){i.trim()&&e.push(i)}function MN(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 ON({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 zN(e,i){const a=new Map;for(const r of LN(e)){const u=Gv(r);if(u){const c=Vv(u).toLowerCase(),d=a.get(c);(!d||BN(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>IN(r,i)).filter(r=>r!==null)}function LN(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 IN(e,i){const a=Gv(e);if(!a||!UN(a))return null;const r=Pv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Vv(r),url:fe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function Gv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function UN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Vv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function Pv(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 BN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function cr(e){return e.trim()}function Yv(e){return e.trim()}function kp(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?HN(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=VN(i);return a?Cm(a.language)==="mermaid"?s.jsx(PN,{code:a.code}):s.jsx(WN,{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:$x(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:$x(i),children:a})}}}function HN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[a]=e.split("#",1),[r]=a.split("?",1),u=$N(r);if(!u)return null;const c=Pv(u,i.workspacePath);return fe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function $N(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function $x(e){return e&&e!=="char"?{textAlign:e}:void 0}function Sl(e,i){const a=GN(e);return s.jsx(eC,{components:qN(i),remarkPlugins:[pE],skipHtml:!0,children:a})}function GN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
110
|
+
$2`)}function VN(e){var c;const i=D.Children.toArray(e),a=i.length===1&&D.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:Kp(a.props.children).replace(/\n$/,""),language:u}}function Kp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Kp).join(""):D.isValidElement(e)?Kp(e.props.children):""}const Fv="github-light",jp=new Map,Sp=new Map;let Cp=null,Tp=null;const Wv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Cm(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 Kv(e){const i=Cm(e);return!i||i==="text"||i==="txt"?"text":Wv.has(i)?i:"text"}function PN({code:e}){const a=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Sp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,y;const j=Sp.get(e);return j?(d(j),g(null),()=>{b=!0}):(g(null),d(null),YN(a,e).then(w=>{b||(y!==void 0&&window.clearTimeout(y),Sp.set(e,w),d(w),g(null))},w=>{if(!b){const T=w instanceof Error?w.message:String(w);y=window.setTimeout(()=>{b||g(T)},qE)}}),()=>{b=!0,y!==void 0&&window.clearTimeout(y)})},[e,a]);async function h(){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 h(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Tm,{})})}),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 YN(e,i){return(await(await FN()).render(e,i)).svg}function FN(){return Tp||(Tp=jt(()=>import("./mermaid.core-CkzBAnkw.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})),Tp}function WN({code:e,language:i,reserveHeight:a=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!Px(i))return null;const h=Vx(e,i);return jp.get(h)??null}),p=a?{"--code-block-min-height":`${ZE(e)}px`}:void 0;D.useEffect(()=>{let h=!1;if(!Px(i))return d(null),()=>{h=!0};const b=Vx(e,i),y=jp.get(b);return y?(d(y),()=>{h=!0}):(d(null),n2(e,i).then(j=>{jp.set(b,j),h||d(j)}).catch(j=>{console.warn("Failed to highlight code block",j),h||d(null)}),()=>{h=!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(Tm,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Tm(){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 KN(){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 Xv(){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 XN(){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 QN(){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 Gx(){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 ZN(){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 Dc(){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 Wc(){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 JN(){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 e2(){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 t2(){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 Vx(e,i){return`${Fv}:${Kv(i)}:${e}`}function Px(e){const i=Cm(e);return!!i&&Wv.has(i)}async function n2(e,i){return(await i2()).codeToHtml(e,{lang:Kv(i),theme:Fv})}function i2(){return Cp||(Cp=a2()),Cp}async function a2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:h},{default:b},{default:y},{default:j},{default:w},{default:T},{default:R},{default:z},{default:N},{default:G},{default:B},{default:P},{default:se}]=await Promise.all([jt(()=>import("./core-CbFapvgm.js"),[],import.meta.url),jt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),jt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),jt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),jt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),jt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),jt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),jt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),jt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),jt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),jt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),jt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),jt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),jt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),jt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),jt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),jt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),jt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),jt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,h,b,y,j,w,T,R,z,N,G,B,P,se]})}async function Yx(){const e=fe("conversations"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).conversations}async function l2(){const e=fe("workspace-states"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).workspaces}async function Fx(){const e=fe("collaboration/topics"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).topics}async function Ec(e){const i=fe(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).messages}async function r2(e){const i=fe("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(a,{method:"POST",url:i}),(await a.json()).topic}async function s2(e,i){const a=fe(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:a}),(await r.json()).topic}async function o2(e,i){const a=fe(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await ke(r,{method:"POST",url:a}),(await r.json()).topic}async function u2(e){const i=fe(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await ke(a,{method:"POST",url:i})}async function Wx(){const e=fe("workspace-groups"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).groups}async function c2(e){const i=fe("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await ke(a,{method:"POST",url:i}),(await a.json()).group}async function d2(e,i){const a=fe(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:a}),(await r.json()).group}async function f2(e){const i=fe(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await ke(a,{method:"DELETE",url:i}),await a.json()}async function p2(){const e=fe("settings/environment"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).variables}async function m2(e){const i=fe(`conversations/${e}/settings/environment`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).variables}async function h2(e){const i=fe(`conversations/${e}/knowledge`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).items}async function g2(){const e=fe("settings/runtime"),i=await fetch(e);return await ke(i,{url:e}),(await i.json()).settings}async function y2(){const e=fe("diagnostics"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function x2(){const e=fe("settings/runtime/codex"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Kx(){const e=fe("settings/runtime/accounts"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function Xx(e=!1){const i=fe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});return await ke(a,{method:"POST",url:i}),await a.json()}async function b2(e){const i=fe("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return await ke(a,{method:"POST",url:i}),(await a.json()).login}async function v2(e){const i=fe(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).login}async function w2(e){const i=fe(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await ke(a,{method:"POST",url:i}),(await a.json()).login}async function k2(e,i){const a=fe(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return await ke(r,{method:"PATCH",url:a}),(await r.json()).account}async function j2(e){const i=fe(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await ke(a,{method:"DELETE",url:i})}async function S2(e){const i=fe(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});return await ke(a,{method:"POST",url:i}),await a.json()}async function C2(e=!0){const i=fe(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await ke(a,{url:i}),await a.json()}async function T2(e=!1){const i=fe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await ke(a,{url:i}),await a.json()}async function E2(){const e=fe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await ke(i,{method:"POST",url:e}),(await i.json()).job}async function A2(e){const i=fe(`conversations/${e}/settings/runtime`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).settings}async function N2(){const e=fe("settings/memory"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}function Qv(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid Seele global settings file.");const i=e;if(i.format!=="seele-global-settings"||i.version!==1)throw new Error("Unsupported Seele global settings file or version.");if(typeof i.exportedAt!="string")throw new Error("The settings file is missing its export timestamp.");if(i.runtime!==void 0&&(!i.runtime||typeof i.runtime!="object"||Array.isArray(i.runtime)))throw new Error("The Runtime section is invalid.");if(i.environment!==void 0&&!Array.isArray(i.environment))throw new Error("The Environment section is invalid.");if(i.memory!==void 0&&!Array.isArray(i.memory))throw new Error("The Memory section is invalid.");return e}async function _2(e){const i=fe("settings/global-transfer/export"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime:e.has("runtime"),environment:e.has("environment"),memory:e.has("memory")})});return await ke(a,{method:"POST",url:i}),Qv(await a.json())}async function D2(e){const i=fe("settings/global-transfer/import"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});await ke(a,{method:"PUT",url:i})}function R2(e){const i=e.exportedAt.slice(0,10)||"export",a=new Blob([`${JSON.stringify(e,null,2)}
|
|
111
|
+
`],{type:"application/json"}),r=URL.createObjectURL(a),u=document.createElement("a");u.href=r,u.download=`seele-global-settings-${i}.json`,document.body.append(u),u.click(),u.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}async function M2(e){const i=fe("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(a,{method:"PUT",url:i}),(await a.json()).settings}async function Qx(e,i){const a=fe(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PUT",url:a}),await r.json()}async function Zx(e,i){const a=fe(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"POST",url:a});const u=(await r.json()).job;return Jv(e,u)}async function Zv(e){const i=fe(`conversations/${e}/runtime/reset`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).job}async function Jv(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 Zv(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 Jx(e){const i=fe(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await ke(a,{url:i}),await a.json()}async function O2(e,i){const a=fe(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await ke(r,{method:"PUT",url:a})}async function z2(e){const i=fe(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).result}async function L2(e){const i=fe(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await ke(a,{url:i});const r=await a.json();return r.event?dw(r.event):null}async function I2(e){const i=fe(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await ke(a,{url:i}),await a.json()}async function U2(e){const i=fe(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).compactions}function B2(e,i){return{model:e.model===i.model?null:e.model,reasoningEffort:e.reasoningEffort===i.reasoningEffort?null:e.reasoningEffort,fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox,notifyEnabled:e.notifyEnabled===i.notifyEnabled?null:e.notifyEnabled}}function q2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:$2(e.sourceCluesText),requiredEnv:G2(e.requiredEnvText)}}function H2(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(`
|
|
112
|
+
`),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
113
|
+
`)}}function $2(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 G2(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 eb(e,i){const a=tb(i.attention)-tb(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function tb(e){return e==="watch"?2:e==="tracked"?1:0}function Vo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function V2(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 P2(e){return Vo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
114
|
+
`)}async function Y2(e){const i=fe("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await ke(a,{method:"PUT",url:i}),await a.json()}async function F2(e,i,a){const r=fe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await ke(u,{method:"PUT",url:r}),(await u.json()).variable}async function W2(e,i,a,r){const u=fe(`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 ke(c,{method:"PUT",url:u}),await c.json()}async function K2(e){const i=fe(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).variable.value}async function X2(e,i){const a=fe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await ke(r,{url:a}),(await r.json()).variable.value}async function Q2(e){const i=fe(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await ke(a,{method:"DELETE",url:i})}async function Z2(e,i){const a=fe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await ke(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function J2(e,i){const a=fe(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"POST",url:a}),(await r.json()).item}async function e_(e,i,a){const r=fe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await ke(u,{method:"PATCH",url:r}),(await u.json()).item}async function t_(e,i){const a=fe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await ke(r,{method:"DELETE",url:a})}async function n_(){const e=fe("meta"),i=await fetch(e);return await ke(i,{url:e}),await i.json()}async function i_(e){const i=fe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).usage??null}async function a_(e,i){const a=fe("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await ke(r,{method:"POST",url:a}),(await r.json()).conversation}async function l_(e){const i=fe(`conversations/${e}/complex-task`),a=await fetch(i);return await ke(a,{url:i}),(await a.json()).task}async function r_(e,i){const a=fe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await ke(r,{url:a}),(await r.json()).task}async function s_(e,i){const a=fe(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await ke(r,{method:"POST",url:a}),(await r.json()).task}async function o_(e,i,a){const r=fe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await ke(u,{method:"POST",url:r}),await u.json()}async function u_(e){const i=fe(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await ke(a,{method:"POST",url:i}),await a.json()}async function Ep(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??vv)),i.before&&a.set("before",i.before);const r=fe(`conversations/${e}?${a}`),u=await fetch(r);return await ke(u,{url:r}),(await u.json()).conversation}async function c_(e,i){const a=fe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await ke(r,{url:a}),(await r.json()).events}async function Ac(e,i){const a=fe(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await ke(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function d_(e){const i=fe(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await ke(a,{method:"DELETE",url:i})}function f_(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function ew(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function p_(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:O_(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=pe(e.data),d=we(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",h=e.event==="server.collaboration.message_sent",b=we(c.audience),y=we(c.recipientWorkspaceId),j=y?[y]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(z=>typeof z=="string"):Array.isArray(c.recipients)?c.recipients.filter(z=>typeof z=="string"):[],w=j.filter(z=>z!=="ALL").map(z=>i.get(z)).filter(z=>!!z);let T="Topic";w.length>0?T=ew(w):j.length===1?T=j[0]==="ALL"?"Topic participants":Tl(j[0]):j.length>1?T=`${j.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const R=we(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:R?`Topic ${Tl(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":h?"done":"failed",output:g||h?we(c.contentMarkdown)||void 0:we(c.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(g||h)&&we(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=pe(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=pe(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(h=>{const b=pe(h),y=typeof b.question=="string"?b.question:"Please provide the missing information.",j=Array.isArray(b.options)?b.options.map(w=>{const T=pe(w);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
|
|
115
|
+
`):"";return j?`${y}
|
|
116
|
+
|
|
117
|
+
${j}`:y}).join(`
|
|
118
|
+
|
|
119
|
+
`);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=pe(e.data);if(we(c.actionType)==="seele_workspace_change"){const p=pe(c.payload),g=pe(p.payload),h=we(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:rw(h,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:h,workspaceChangePayload:g}}const d=CE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:we(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=SE(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=pe(e.data),d=pe(c.params),p=we(d.tool)||"dynamic tool",g=pe(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:aw(p,!1,g),body:lw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:we(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?tw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&we(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?pe(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=pe(e.data),d=pe(c.payload),p=we(d.content)||we(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:we(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:we(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=pe(e.data),d=pe(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=pe(e.data),d=pe(c.task),p=pe(d.currentPlan),g=pe(c.update),h=we(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",y=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:h==="edit"?"Plan updated":"Plan rewritten",body:`${y} change${y===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:we(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=pe(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:we(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=pe(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"?Rc(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=pe(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Xp(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=pe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=M_(c.requestId),p=pe(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=pe(e.data),r=a.method,u=pe(a.params);if(r==="item/started"){const c=pe(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:Rc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Gp(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:we(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=pe(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:Rc(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=Gp(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:we(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 m_(e){if(e.event!=="codex.notification")return null;const i=pe(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=pe(i.params),u=pe(r.item),c=typeof u.type=="string"?u.type:"item";if(iw(c)||pw(u))return null;const d=a==="item/completed",p=pe(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?aw(g,d,p):d?`Finished ${Cl(c)}`:`Working on ${Cl(c)}`,body:g?lw(g,p):sw(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?g_(u):"running",topicAction:g==="seele_topics"?tw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&we(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?pe(p.payload):void 0}}function tw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function h_(e){if(cw(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=jE(e);return i?{id:e.id,kind:"activity",title:uw(i),body:nw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function nw(e){const i=pe(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return ow(i[a].trim(),180);return"Event details are available"}function iw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function g_(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Cl(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function aw(e,i,a){if(e==="seele_topics")switch(we(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=we(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=Cl(e);return i?`Finished ${r}`:`Running ${r}`}function lw(e,i){if(e==="seele_topics"){const a=we(i.topicId);return a?`Topic ${Tl(a)}`:"Topic"}if(e==="seele_wakeup")return we(i.instruction)||(we(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=we(i.type)||"workspace";return rw(a,pe(i.payload))}return Cl(e)}function rw(e,i){return e==="responsibility"?we(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function sw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return ns(e[a].trim(),160);return typeof e.id=="string"?`${Cl(i)} ${Tl(e.id)}`:Cl(i)}function y_(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 x_(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function b_(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 v_(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
120
|
+
`);return a.length>i?`${u}
|
|
121
|
+
...`:u}function w_(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function qc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function k_(e){const i=e.trim();return!i||i.includes(`
|
|
122
|
+
`)?null:ns(i,120)}function ns(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 ow(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function uw(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 cw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=pe(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 ${Tl(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=pe(e.data);return{id:e.id,title:"Codex compacting context",detail:Xp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=pe(e.data);return{id:e.id,title:"Codex context compacted",detail:Xp(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=pe(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=pe(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?ns(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=pe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=pe(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?ns(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=pe(e.data),r=a.method,u=pe(a.params);if(r==="item/started"||r==="item/completed"){const c=pe(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:ns(Rc(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=pw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:ns(g,96),createdAt:i,tone:p?"done":"running"};if(!iw(d))return{id:e.id,title:p?`Finished ${Cl(d)}`:`Working on ${Cl(d)}`,detail:sw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=pe(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=pe(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?ls(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=pe(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${ib(d)}`:`Finished ${ib(d)}`,detail:typeof c.durationMs=="number"?ls(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Xp(e,i){const a=Hc(e.before),r=Hc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${ls(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${lr(a)} → ${lr(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Em(c)} tokens`)}else a&&u.push(`context ${lr(a)}`);return u.join(" · ")}function j_(e){const i=Hc(e.before),a=Hc(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${lr(i)} → ${lr(a)}`:i?u=`${lr(i)} → unavailable`:a&&(u=`unavailable → ${lr(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":ls(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Em(r)} tokens`:"No decrease observed"}]}function Hc(e){const i=pe(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function lr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Em(e.totalTokens)} tokens`}function Em(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function S_(e){let i=null;for(const a of e)for(const r of a.events){const u=E_(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function nb(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function C_(e){let i=null;for(const a of e){const r=dw(a);r&&(!i||Go(a,i)>0)&&(i=r)}return i}function dw(e){if(e.event!=="codex.notification")return null;const i=pe(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=pe(i.params),r=pe(a.tokenUsage),u=pe(r.last),c=pe(r.total),d=Object.keys(u).length>0?u:c,p=mi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:mi(d.inputTokens),cachedInputTokens:mi(d.cachedInputTokens),outputTokens:mi(d.outputTokens),reasoningOutputTokens:mi(d.reasoningOutputTokens),modelContextWindow:mi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function T_(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function fw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function E_(e){if(e.event!=="codex.notification")return null;const i=pe(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=pe(i.params),r=pe(a.rateLimits),u=[r.primary,r.secondary].map(c=>A_(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function A_(e){const i=pe(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 N_(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Rc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function pw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Gp(e)[0])==null?void 0:a.path)??null}function pe(e){return e&&typeof e=="object"?e:{}}function mi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function we(e){return typeof e=="string"?e:""}function rr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function __(e){const i=pe(e),a=pe(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,h=0;return r.forEach((b,y)=>{const j=pe(b),w=we(j.id)||`turn-${y+1}`,T=Array.isArray(j.items)?j.items:[];c+=T.length,u.push(D_(j,w)),T.forEach(R=>{const z=pe(R),N=we(z.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(h+=1)})}),{id:we(a.id),sessionId:we(a.sessionId),status:mw(a.status),source:Am(a.source),cwd:we(a.cwd),path:we(a.path),preview:we(a.preview),createdAt:mi(a.createdAt),updatedAt:mi(a.updatedAt),recencyAt:mi(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:h,turns:u}}function D_(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>we(pe(c).type)).filter(c=>c.length>0))).join(", "),u=R_(a.map(c=>Qp(c)).filter(Boolean).join(" "),220);return{id:i,status:mw(e.status),itemsView:we(e.itemsView)||"unknown",itemCount:a.length,startedAt:mi(e.startedAt),completedAt:mi(e.completedAt),durationMs:mi(e.durationMs),itemTypes:r,preview:u,raw:e}}function Qp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Qp).filter(Boolean).join(`
|
|
123
|
+
`);if(!e||typeof e!="object")return"";const i=e,a=we(i.text),r=Qp(i.content);return[a,r].filter(Boolean).join(`
|
|
124
|
+
`)}function mw(e){const i=pe(e);return we(i.type)||Am(e)}function R_(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Mo(e){return e===null?"unknown":$e(e*1e3)}function M_(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Am(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function O_(e){if(typeof e=="string")return e;const i=pe(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
125
|
+
|
|
126
|
+
${r}`:a||r||Am(e)}function ib(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function ls(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ap(e){if(e<6e4)return ls(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 hw(e){return`${Math.round(e)}%`}function Ln(e){return new Intl.NumberFormat("en-US").format(e)}function Mc(e){return e===null?"unknown":Ln(e)}function Kc(e){return Math.max(0,Math.min(100,Math.round(e)))}function Nm(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function gw(e){return $e(e*1e3)}function $e(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 Po(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function z_(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 ab(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function lb(e,i){const a=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Xc(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Zp(e,i){const a=Xc(e);return i?`${a} (${$e(i)})`:a}function L_(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Xc(e))}`}function I_(e,i){const a=rb(e),r=rb(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 rb(e){if(!e)return null;const i=Xc(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 U_(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 Np(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(`
|
|
127
|
+
|
|
128
|
+
`);u=p.pop()??"";for(const g of p){const h=B_(g);h&&i(h)}}}function B_(e){const i=e.split(`
|
|
129
|
+
`),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(`
|
|
130
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function q_(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 H_(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 $_(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 es(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 is(e){return e.length<=6?e:e.slice(0,6)}function Tl(e){return e.slice(0,8)}function sb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function ob(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function _p(e,...i){return i.includes(e)}function G_(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 V_(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 Jp(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 P_(e,i){return`waiting ${$c(e,i)}`}function $c(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 Oc(e,i=null,a=Date.now()){if(e==="waiting")return i?P_(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 ub(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function Y_(e){return e==="assistant"?"Seele":"You"}const F_=document.getElementById("root"),yw=window.__seeleCodexRoot??$k.createRoot(F_);window.__seeleCodexRoot=yw;rD();yw.render(s.jsx(D.StrictMode,{children:s.jsx(W_,{})}));function W_(){const[e,i]=D.useState(null),[a,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState("admin"),[g,h]=D.useState(""),[b,y]=D.useState(!1),[j,w]=D.useState("");D.useEffect(()=>{cb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),D.useEffect(()=>{let N=!1,G=0;const B=async()=>{try{const P=await J_();if(N)return;r(P),c(""),G=window.setTimeout(B,P.status==="authorized"?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),G=window.setTimeout(B,3e3)}};return B(),()=>{N=!0,window.clearTimeout(G)}},[]),D.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),h(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Pp,N),()=>window.removeEventListener(Pp,N)},[]);async function T(N){N.preventDefault(),y(!0),w("");try{const G=await fetch(fe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!G.ok){w(G.status===401?"Incorrect username or password.":G.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}h(""),i(await cb())}catch{w("Unable to reach Seele.")}finally{y(!1)}}async function R(){await fetch(fe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const z=Q_();if(z&&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:vm(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void R(),type:"button",children:"Sign out"})]})]})}):s.jsx(X_,{authorization:a,currentUser:N,onLogout:R})}if(!z&&a&&a.status!=="authorized")return s.jsx(K_,{authorization:a});if(!e||!a&&!z)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(sA,{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=>h(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 K_({authorization:e}){const a={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."}}[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?em(e.lastCheckedAt):"Starting"})]})]}),e.lastError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError}):null,s.jsx("a",{className:"deployment-primary-link",href:Z_(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function X_({authorization:e,currentUser:i,onLogout:a}){const[r,u]=D.useState([]),[c,d]=D.useState({}),[p,g]=D.useState(null),[h,b]=D.useState(!0),[y,j]=D.useState("");D.useEffect(()=>{let T=!1,R=0;const z=async()=>{try{const N=await eD();if(T)return;u(N),d(G=>Object.fromEntries(N.map(B=>[B.deploymentId,G[B.deploymentId]??B.name]))),j("")}catch(N){T||j(Ve(N).message)}finally{T||(b(!1),R=window.setTimeout(z,5e3))}};return z(),()=>{T=!0,window.clearTimeout(R)}},[]);async function w(T,R){g(T),j("");try{const z=await tD(T,R);u(N=>N.map(G=>G.deploymentId===z.deploymentId?z:G)),d(N=>({...N,[z.deploymentId]:z.name}))}catch(z){j(Ve(z).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:vm(),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,y?s.jsx("p",{className:"deployment-error",role:"alert",children:y}):null,h?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!h&&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,z=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:em(T.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:em(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:z})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:R,maxLength:80,onChange:N=>d(G=>({...G,[T.deploymentId]:N.target.value})),value:z})]}),s.jsx("button",{disabled:R||!z.trim()||z.trim()===T.name,type:"submit",children:"Save name"})]})]},T.deploymentId)})})]})}function Q_(){const e=vm("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function Z_(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function em(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function J_(){const e=await fetch(fe("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function eD(){const e=fe("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Ht(i,{url:e});return(await i.json()).deployments}async function tD(e,i){const a=fe(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Ht(r,{method:"PATCH",url:a});return(await r.json()).deployment}async function cb(){const e=await fetch(fe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function nD(){const e=fe("admin/users"),i=await fetch(e);if(!i.ok)throw await Ht(i,{url:e});return(await i.json()).users}async function iD(e){const i=fe("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await Ht(a,{method:"POST",url:i});return(await a.json()).user}async function aD(e,i){const a=fe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Ht(r,{method:"PATCH",url:a});return(await r.json()).user}async function lD(e){const i=fe(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Ht(a,{method:"DELETE",url:i})}function rD(){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(Pp)),a},window.__seeleAuthFetchInstalled=!0}export{jt as _,Gk as a,lj as b,px as c,tj as f,db as g,aj as h,im as s,Wk as w};
|