@seele00/seele 0.1.90 → 0.1.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/package.json +1 -1
  4. package/web/dist/assets/{abnfDiagram-VRR7QNED-DF7L1goG.js → abnfDiagram-VRR7QNED-iVbCDf-k.js} +1 -1
  5. package/web/dist/assets/{arc-D_1bIRe1.js → arc-JMiJ4rr3.js} +1 -1
  6. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-r_FcYjMG.js → architectureDiagram-ZJ3FMSHR-DCm1qEn2.js} +1 -1
  7. package/web/dist/assets/{blockDiagram-677ZJIJ3-DuzRQJU2.js → blockDiagram-677ZJIJ3-DREKknbS.js} +1 -1
  8. package/web/dist/assets/{c4Diagram-LMCZKHZV-Bdc5Bfyz.js → c4Diagram-LMCZKHZV-CRBVnPzq.js} +1 -1
  9. package/web/dist/assets/channel-CGt1ZavO.js +1 -0
  10. package/web/dist/assets/{chunk-2Q5K7J3B-CisGjz8q.js → chunk-2Q5K7J3B-CkxEyqvZ.js} +1 -1
  11. package/web/dist/assets/{chunk-32BRIVSS-BIxwA01r.js → chunk-32BRIVSS-CB0yAoU8.js} +1 -1
  12. package/web/dist/assets/{chunk-5VM5RSS4-ComqKkqn.js → chunk-5VM5RSS4-mKXpYDxH.js} +1 -1
  13. package/web/dist/assets/{chunk-EX3LRPZG-BB4bzNnX.js → chunk-EX3LRPZG-By-Z97DF.js} +1 -1
  14. package/web/dist/assets/{chunk-JWPE2WC7-C9wEnvIa.js → chunk-JWPE2WC7-BwLo02Dp.js} +1 -1
  15. package/web/dist/assets/{chunk-MOJQB5TN-BbRrLD6M.js → chunk-MOJQB5TN-EbU6MBl6.js} +1 -1
  16. package/web/dist/assets/{chunk-RYQCIY6F-DKXCnRKu.js → chunk-RYQCIY6F-DD9Y8Wum.js} +1 -1
  17. package/web/dist/assets/{chunk-V7JOEXUC-JQHfw92B.js → chunk-V7JOEXUC-DcD81gi4.js} +1 -1
  18. package/web/dist/assets/{chunk-VR4S4FIN-BEbJEJoE.js → chunk-VR4S4FIN-DWUywtQy.js} +1 -1
  19. package/web/dist/assets/{chunk-XXDRQBXY-BOW353gZ.js → chunk-XXDRQBXY-CfbHSkHp.js} +1 -1
  20. package/web/dist/assets/classDiagram-OUVF2IWQ-RHNeYK2H.js +1 -0
  21. package/web/dist/assets/classDiagram-v2-EOCWNBFH-RHNeYK2H.js +1 -0
  22. package/web/dist/assets/{core-CzO9snBr.js → core-DnwHDF9S.js} +1 -1
  23. package/web/dist/assets/{cose-bilkent-JH36ORCC-BbeVUtyp.js → cose-bilkent-JH36ORCC-DTMjsSNZ.js} +1 -1
  24. package/web/dist/assets/{cynefin-VYW2F7L2-BDE4qOtD.js → cynefin-VYW2F7L2-BQScOjLb.js} +1 -1
  25. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-CP7X5YM_.js → cynefinDiagram-TSTJHNR4-DsQ_Jv1S.js} +1 -1
  26. package/web/dist/assets/{dagre-VKFMJZFB-DZoUhmJg.js → dagre-VKFMJZFB-CoBazNSr.js} +1 -1
  27. package/web/dist/assets/{diagram-FQU43EPY-DyrmMUO2.js → diagram-FQU43EPY-C2pGJlRE.js} +1 -1
  28. package/web/dist/assets/{diagram-G47NLZAW-Ct3ASvI4.js → diagram-G47NLZAW-DngV_5ZL.js} +1 -1
  29. package/web/dist/assets/{diagram-NH7WQ7WH-CH3P02kI.js → diagram-NH7WQ7WH-CbT7cYnb.js} +1 -1
  30. package/web/dist/assets/{diagram-OA4YK3LP-Brgx0XRL.js → diagram-OA4YK3LP-CQgFDj1M.js} +1 -1
  31. package/web/dist/assets/{diagram-WEI45ONY-BKs-80QV.js → diagram-WEI45ONY-BSceWhV1.js} +1 -1
  32. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-IbW9Myv_.js → ebnfDiagram-CCIWWBDH-DgYBGMFL.js} +1 -1
  33. package/web/dist/assets/{erDiagram-Q63AITRT-CiGShKaX.js → erDiagram-Q63AITRT-BN2Cy22X.js} +1 -1
  34. package/web/dist/assets/{flowDiagram-23GEKE2U-BeeqR6Sb.js → flowDiagram-23GEKE2U-fDP66qf3.js} +1 -1
  35. package/web/dist/assets/{ganttDiagram-NO4QXBWP-CD_hfx9S.js → ganttDiagram-NO4QXBWP-C96QkOk8.js} +1 -1
  36. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-yNN0i97D.js → gitGraphDiagram-IHSO6WYX-DutclwE1.js} +1 -1
  37. package/web/dist/assets/index-H6j_Btq9.js +131 -0
  38. package/web/dist/assets/{infoDiagram-FWYZ7A6U-D0VHLtiR.js → infoDiagram-FWYZ7A6U-Cxc3YVQb.js} +1 -1
  39. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-CgVMGAvL.js → ishikawaDiagram-FXEZZL3T-BEnCjmqJ.js} +1 -1
  40. package/web/dist/assets/{journeyDiagram-5HDEW3XC-jrm9FTSj.js → journeyDiagram-5HDEW3XC-BScd67RO.js} +1 -1
  41. package/web/dist/assets/{kanban-definition-HUTT4EX6-BGXfA-QS.js → kanban-definition-HUTT4EX6-BiWAReQL.js} +1 -1
  42. package/web/dist/assets/{linear-C_CTdv3H.js → linear-DgLbqYdz.js} +1 -1
  43. package/web/dist/assets/{mermaid.core-fvt-s7xJ.js → mermaid.core-ejnGpyjP.js} +4 -4
  44. package/web/dist/assets/{mindmap-definition-LN4V7U3C-BM7xEoSD.js → mindmap-definition-LN4V7U3C-CIktRh3k.js} +1 -1
  45. package/web/dist/assets/{pegDiagram-2B236MQR-BOYnFOcO.js → pegDiagram-2B236MQR-C0VgWt36.js} +1 -1
  46. package/web/dist/assets/{pieDiagram-ENE6RG2P-VFanZA6z.js → pieDiagram-ENE6RG2P-VGApXGBB.js} +1 -1
  47. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DvITxXLG.js → quadrantDiagram-ABIIQ3AL-BZw4Vnp1.js} +1 -1
  48. package/web/dist/assets/{railroadDiagram-RFXS5EU6-CSg5M6n7.js → railroadDiagram-RFXS5EU6-Bh5mwR_2.js} +1 -1
  49. package/web/dist/assets/{requirementDiagram-TGXJPOKE-CYpGrvJQ.js → requirementDiagram-TGXJPOKE-CwvsMflb.js} +1 -1
  50. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-CGmP9DOt.js → sankeyDiagram-HTMAVEWB-Dg2sPge6.js} +1 -1
  51. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-rfC8R3jV.js → sequenceDiagram-DBY2YBRQ-C3mtBN6f.js} +1 -1
  52. package/web/dist/assets/{sizeCapture-X5ZJPWSS-DAaxunyr.js → sizeCapture-X5ZJPWSS-BOAO9X3V.js} +1 -1
  53. package/web/dist/assets/{stateDiagram-2N3HPSRC-Bn_BkRv3.js → stateDiagram-2N3HPSRC-BMWGawYB.js} +1 -1
  54. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-C_CHxKgw.js +1 -0
  55. package/web/dist/assets/{swimlanes-5IMT3BWC-DN7Tcrz5.js → swimlanes-5IMT3BWC-eeI5pSHG.js} +2 -2
  56. package/web/dist/assets/swimlanesDiagram-G3AALYLV-CNbvemzA.js +8 -0
  57. package/web/dist/assets/{timeline-definition-FHXFAJF6-CU_GzLCw.js → timeline-definition-FHXFAJF6-C8wMFR-H.js} +1 -1
  58. package/web/dist/assets/{vennDiagram-L72KCM5P-ct8sWoQj.js → vennDiagram-L72KCM5P-CCG5V8jY.js} +1 -1
  59. package/web/dist/assets/{wardleyDiagram-EHGQE667-CBXXfhuD.js → wardleyDiagram-EHGQE667-JUthxPJ1.js} +1 -1
  60. package/web/dist/assets/{xychartDiagram-FW5EYKEG-CKSIZXup.js → xychartDiagram-FW5EYKEG-DQjrRSzI.js} +1 -1
  61. package/web/dist/index.html +1 -1
  62. package/web/dist/assets/channel-CRmsPRFE.js +0 -1
  63. package/web/dist/assets/classDiagram-OUVF2IWQ-BrVZhF0J.js +0 -1
  64. package/web/dist/assets/classDiagram-v2-EOCWNBFH-BrVZhF0J.js +0 -1
  65. package/web/dist/assets/index-aUVmJEDj.js +0 -129
  66. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-Dz_UKy_6.js +0 -1
  67. package/web/dist/assets/swimlanesDiagram-G3AALYLV-D6-tfiO4.js +0 -8
@@ -0,0 +1,131 @@
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 Hk=Object.defineProperty;var $k=(e,i,a)=>i in e?Hk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var Mc=(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 Gk="modulepreload",Vk=function(e,i){return new URL(e,i).href},ky={},Tt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=Vk(b,r),b in ky)return;ky[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const q=p[R];if(q.href===b&&(!x||q.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const T=document.createElement("link");if(T.rel=x?"stylesheet":Gk,x||(T.as="script"),T.crossOrigin="",T.href=b,m&&T.setAttribute("nonce",m),document.head.appendChild(T),x)return new Promise((R,q)=>{T.addEventListener("load",R),T.addEventListener("error",()=>q(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function wb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Kf={exports:{}},Bo={};/**
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 jy;function Fk(){if(jy)return Bo;jy=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 Bo.Fragment=i,Bo.jsx=a,Bo.jsxs=a,Bo}var Sy;function Pk(){return Sy||(Sy=1,Kf.exports=Fk()),Kf.exports}var s=Pk(),Xf={exports:{}},Be={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var Cy;function Yk(){if(Cy)return Be;Cy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=j&&A[j]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,q={};function N(A,z,C){this.props=A,this.context=z,this.refs=q,this.updater=C||T}N.prototype.isReactComponent={},N.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,z,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function H(){}H.prototype=N.prototype;function $(A,z,C){this.props=A,this.context=z,this.refs=q,this.updater=C||T}var F=$.prototype=new H;F.constructor=$,R(F,N.prototype),F.isPureReactComponent=!0;var ie=Array.isArray;function _(){}var Q={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function ee(A,z,C){var W=C.ref;return{$$typeof:e,type:A,key:z,ref:W!==void 0?W:null,props:C}}function L(A,z){return ee(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function de(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ne=/\/+/g;function ye(A,z){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(_,_):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,z,C,W,fe){var X=typeof A;(X==="undefined"||X==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(X){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),z,C,W,fe)}}if(xe)return fe=fe(A),xe=W===""?"."+ye(A,0):W,ie(fe)?(C="",xe!=null&&(C=xe.replace(Ne,"$&/")+"/"),V(fe,z,C,"",function(Ct){return Ct})):fe!=null&&(te(fe)&&(fe=L(fe,C+(fe.key==null||A&&A.key===fe.key?"":(""+fe.key).replace(Ne,"$&/")+"/")+xe)),z.push(fe)),1;xe=0;var Me=W===""?".":W+":";if(ie(A))for(var Ve=0;Ve<A.length;Ve++)W=A[Ve],X=Me+ye(W,Ve),xe+=V(W,z,C,X,fe);else if(Ve=w(A),typeof Ve=="function")for(A=Ve.call(A),Ve=0;!(W=A.next()).done;)W=W.value,X=Me+ye(W,Ve++),xe+=V(W,z,C,X,fe);else if(X==="object"){if(typeof A.then=="function")return V(ue(A),z,C,W,fe);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return xe}function oe(A,z,C){if(A==null)return A;var W=[],fe=0;return V(A,W,"","",function(X){return z.call(C,X,fe++)}),W}function be(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var Re=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:oe,forEach:function(A,z,C){oe(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return oe(A,function(){z++}),z},toArray:function(A){return oe(A,function(z){return z})||[]},only:function(A){if(!te(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Be.Activity=x,Be.Children=O,Be.Component=N,Be.Fragment=a,Be.Profiler=u,Be.PureComponent=$,Be.StrictMode=r,Be.Suspense=g,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,Be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Q.H.useMemoCache(A)}},Be.cache=function(A){return function(){return A.apply(null,arguments)}},Be.cacheSignal=function(){return null},Be.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=R({},A.props),fe=A.key;if(z!=null)for(X in z.key!==void 0&&(fe=""+z.key),z)!re.call(z,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&z.ref===void 0||(W[X]=z[X]);var X=arguments.length-2;if(X===1)W.children=C;else if(1<X){for(var xe=Array(X),Me=0;Me<X;Me++)xe[Me]=arguments[Me+2];W.children=xe}return ee(A.type,fe,W)},Be.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Be.createElement=function(A,z,C){var W,fe={},X=null;if(z!=null)for(W in z.key!==void 0&&(X=""+z.key),z)re.call(z,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(fe[W]=z[W]);var xe=arguments.length-2;if(xe===1)fe.children=C;else if(1<xe){for(var Me=Array(xe),Ve=0;Ve<xe;Ve++)Me[Ve]=arguments[Ve+2];fe.children=Me}if(A&&A.defaultProps)for(W in xe=A.defaultProps,xe)fe[W]===void 0&&(fe[W]=xe[W]);return ee(A,X,fe)},Be.createRef=function(){return{current:null}},Be.forwardRef=function(A){return{$$typeof:p,render:A}},Be.isValidElement=te,Be.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:be}},Be.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Be.startTransition=function(A){var z=Q.T,C={};Q.T=C;try{var W=A(),fe=Q.S;fe!==null&&fe(C,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(_,Re)}catch(X){Re(X)}finally{z!==null&&C.types!==null&&(z.types=C.types),Q.T=z}},Be.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},Be.use=function(A){return Q.H.use(A)},Be.useActionState=function(A,z,C){return Q.H.useActionState(A,z,C)},Be.useCallback=function(A,z){return Q.H.useCallback(A,z)},Be.useContext=function(A){return Q.H.useContext(A)},Be.useDebugValue=function(){},Be.useDeferredValue=function(A,z){return Q.H.useDeferredValue(A,z)},Be.useEffect=function(A,z){return Q.H.useEffect(A,z)},Be.useEffectEvent=function(A){return Q.H.useEffectEvent(A)},Be.useId=function(){return Q.H.useId()},Be.useImperativeHandle=function(A,z,C){return Q.H.useImperativeHandle(A,z,C)},Be.useInsertionEffect=function(A,z){return Q.H.useInsertionEffect(A,z)},Be.useLayoutEffect=function(A,z){return Q.H.useLayoutEffect(A,z)},Be.useMemo=function(A,z){return Q.H.useMemo(A,z)},Be.useOptimistic=function(A,z){return Q.H.useOptimistic(A,z)},Be.useReducer=function(A,z,C){return Q.H.useReducer(A,z,C)},Be.useRef=function(A){return Q.H.useRef(A)},Be.useState=function(A){return Q.H.useState(A)},Be.useSyncExternalStore=function(A,z,C){return Q.H.useSyncExternalStore(A,z,C)},Be.useTransition=function(){return Q.H.useTransition()},Be.version="19.2.7",Be}var Ty;function oh(){return Ty||(Ty=1,Xf.exports=Yk()),Xf.exports}var D=oh(),Qf={exports:{}},qo={},Zf={exports:{}},Jf={};/**
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 Ey;function Wk(){return Ey||(Ey=1,(function(e){function i(V,oe){var be=V.length;V.push(oe);e:for(;0<be;){var Re=be-1>>>1,O=V[Re];if(0<u(O,oe))V[Re]=oe,V[be]=O,be=Re;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],be=V.pop();if(be!==oe){V[0]=be;e:for(var Re=0,O=V.length,A=O>>>1;Re<A;){var z=2*(Re+1)-1,C=V[z],W=z+1,fe=V[W];if(0>u(C,be))W<O&&0>u(fe,C)?(V[Re]=fe,V[W]=be,Re=W):(V[Re]=C,V[z]=be,Re=z);else if(W<O&&0>u(fe,be))V[Re]=fe,V[W]=be,Re=W;else break e}}return oe}function u(V,oe){var be=V.sortIndex-oe.sortIndex;return be!==0?be:V.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,x=null,j=3,w=!1,T=!1,R=!1,q=!1,N=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function F(V){for(var oe=a(m);oe!==null;){if(oe.callback===null)r(m);else if(oe.startTime<=V)r(m),oe.sortIndex=oe.expirationTime,i(g,oe);else break;oe=a(m)}}function ie(V){if(R=!1,F(V),!T)if(a(g)!==null)T=!0,_||(_=!0,de());else{var oe=a(m);oe!==null&&ue(ie,oe.startTime-V)}}var _=!1,Q=-1,re=5,ee=-1;function L(){return q?!0:!(e.unstable_now()-ee<re)}function te(){if(q=!1,_){var V=e.unstable_now();ee=V;var oe=!0;try{e:{T=!1,R&&(R=!1,H(Q),Q=-1),w=!0;var be=j;try{t:{for(F(V),x=a(g);x!==null&&!(x.expirationTime>V&&L());){var Re=x.callback;if(typeof Re=="function"){x.callback=null,j=x.priorityLevel;var O=Re(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,F(V),oe=!0;break t}x===a(g)&&r(g),F(V)}else r(g);x=a(g)}if(x!==null)oe=!0;else{var A=a(m);A!==null&&ue(ie,A.startTime-V),oe=!1}}break e}finally{x=null,j=be,w=!1}oe=void 0}}finally{oe?de():_=!1}}}var de;if(typeof $=="function")de=function(){$(te)};else if(typeof MessageChannel<"u"){var Ne=new MessageChannel,ye=Ne.port2;Ne.port1.onmessage=te,de=function(){ye.postMessage(null)}}else de=function(){N(te,0)};function ue(V,oe){Q=N(function(){V(e.unstable_now())},oe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(V){switch(j){case 1:case 2:case 3:var oe=3;break;default:oe=j}var be=j;j=oe;try{return V()}finally{j=be}},e.unstable_requestPaint=function(){q=!0},e.unstable_runWithPriority=function(V,oe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var be=j;j=V;try{return oe()}finally{j=be}},e.unstable_scheduleCallback=function(V,oe,be){var Re=e.unstable_now();switch(typeof be=="object"&&be!==null?(be=be.delay,be=typeof be=="number"&&0<be?Re+be:Re):be=Re,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=be+O,V={id:b++,callback:oe,priorityLevel:V,startTime:be,expirationTime:O,sortIndex:-1},be>Re?(V.sortIndex=be,i(m,V),a(g)===null&&V===a(m)&&(R?(H(Q),Q=-1):R=!0,ue(ie,be-Re))):(V.sortIndex=O,i(g,V),T||w||(T=!0,_||(_=!0,de()))),V},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(V){var oe=j;return function(){var be=j;j=oe;try{return V.apply(this,arguments)}finally{j=be}}}})(Jf)),Jf}var Ay;function Kk(){return Ay||(Ay=1,Zf.exports=Wk()),Zf.exports}var ep={exports:{}},dn={};/**
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 Ny;function Xk(){if(Ny)return dn;Ny=1;var e=oh();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,dn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},dn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},dn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},dn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},dn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),j=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},dn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},dn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},dn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},dn.requestFormReset=function(g){r.d.r(g)},dn.unstable_batchedUpdates=function(g,m){return g(m)},dn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},dn.useFormStatus=function(){return d.H.useHostTransitionStatus()},dn.version="19.2.7",dn}var Dy;function Qk(){if(Dy)return ep.exports;Dy=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(),ep.exports=Xk(),ep.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 _y;function Zk(){if(_y)return qo;_y=1;var e=Kk(),i=oh(),a=Qk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,E=f.child;E;){if(E===l){v=!0,l=f,o=h;break}if(E===o){v=!0,o=f,l=h;break}E=E.sibling}if(!v){for(E=h.child;E;){if(E===l){v=!0,l=h,o=f;break}if(E===o){v=!0,o=h,l=f;break}E=E.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),$=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ne=Symbol.for("react.client.reference");function ye(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ne?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case N:return"Profiler";case q:return"StrictMode";case ie:return"Suspense";case _:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case $:return t.displayName||"Context";case H:return(t._context.displayName||"Context")+".Consumer";case F:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return n=t.displayName||null,n!==null?n:ye(t.type)||"Memo";case re:n=t._payload,t=t._init;try{return ye(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,be={pending:!1,data:null,method:null,action:null},Re=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=Re[O],Re[O]=null,O--)}function C(t,n){O++,Re[O]=t.current,t.current=n}var W=A(null),fe=A(null),X=A(null),xe=A(null);function Me(t,n){switch(C(X,n),C(fe,t),C(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Fg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Fg(n),t=Pg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(W),C(W,t)}function Ve(){z(W),z(fe),z(X)}function Ct(t){t.memoizedState!==null&&C(xe,t);var n=W.current,l=Pg(n,t.type);n!==l&&(C(fe,t),C(W,l))}function vt(t){fe.current===t&&(z(W),z(fe)),xe.current===t&&(z(xe),zo._currentValue=be)}var sn,Fe;function jt(t){if(sn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);sn=n&&n[1]||"",Fe=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+sn+t+Fe}var It=!1;function on(t,n){if(!t||It)return"";It=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(J){var K=J}Reflect.construct(t,[],se)}else{try{se.call()}catch(J){K=J}t.call(se.prototype)}}else{try{throw Error()}catch(J){K=J}(se=t())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(J){if(J&&K&&typeof J.stack=="string")return[J.stack,K.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],E=h[1];if(v&&E){var I=v.split(`
45
+ `),Y=E.split(`
46
+ `);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===Y.length)for(o=I.length-1,f=Y.length-1;1<=o&&0<=f&&I[o]!==Y[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==Y[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==Y[f]){var ne=`
47
+ `+I[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{It=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?jt(l):""}function Le(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 on(t.type,!1);case 11:return on(t.type.render,!1);case 1:return on(t.type,!0);case 31:return jt("Activity");default:return""}}function Ut(t){try{var n="",l=null;do n+=Le(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
48
+ Error generating stack: `+o.message+`
49
+ `+o.stack}}var hn=Object.prototype.hasOwnProperty,Kt=e.unstable_scheduleCallback,Si=e.unstable_cancelCallback,Jn=e.unstable_shouldYield,za=e.unstable_requestPaint,Mt=e.unstable_now,La=e.unstable_getCurrentPriorityLevel,ae=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ee=e.unstable_NormalPriority,Ue=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Vt=e.log,ei=e.unstable_setDisableYieldValue,Ft=null,Et=null;function dt(t){if(typeof Vt=="function"&&ei(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(Ft,t)}catch{}}var st=Math.clz32?Math.clz32:hd,Ci=Math.log,wn=Math.LN2;function hd(t){return t>>>=0,t===0?32:31-(Ci(t)/wn|0)|0}var Tr=256,Er=262144,Dl=4194304;function Ti(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 Ia(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?f=Ti(o):(v&=E,v!==0?f=Ti(v):l||(l=E&~t,l!==0&&(f=Ti(l))))):(E=o&~h,E!==0?f=Ti(E):v!==0?f=Ti(v):l||(l=o&~t,l!==0&&(f=Ti(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function en(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Ua(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 wt(){var t=Dl;return Dl<<=1,(Dl&62914560)===0&&(Dl=4194304),t}function na(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function Ba(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function _l(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var E=t.entanglements,I=t.expirationTimes,Y=t.hiddenUpdates;for(l=v&~l;0<l;){var ne=31-st(l),se=1<<ne;E[ne]=0,I[ne]=-1;var K=Y[ne];if(K!==null)for(Y[ne]=null,ne=0;ne<K.length;ne++){var J=K[ne];J!==null&&(J.lane&=-536870913)}l&=~se}o!==0&&_s(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function _s(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 qa(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 pu(t,n){var l=n&-n;return l=(l&42)!==0?1:Ar(l),(l&(t.suspendedLanes|n))!==0?0:l}function Ar(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 Rs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ms(){var t=oe.p;return t!==0?t:(t=window.event,t===void 0?32:my(t.type))}function hu(t,n){var l=oe.p;try{return oe.p=t,n()}finally{oe.p=l}}var ti=Math.random().toString(36).slice(2),Pt="__reactFiber$"+ti,Bt="__reactProps$"+ti,Un="__reactContainer$"+ti,Ei="__reactEvents$"+ti,Ha="__reactListeners$"+ti,$a="__reactHandles$"+ti,Nr="__reactResources$"+ti,Ai="__reactMarker$"+ti;function Os(t){delete t[Pt],delete t[Bt],delete t[Ei],delete t[Ha],delete t[$a]}function ni(t){var n=t[Pt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Un]||l[Pt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Jg(t);t!==null;){if(l=t[Pt])return l;t=Jg(t)}return n}t=l,l=t.parentNode}return null}function Ni(t){if(t=t[Pt]||t[Un]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function ia(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Di(t){var n=t[Nr];return n||(n=t[Nr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function At(t){t[Ai]=!0}var mu=new Set,zs={};function un(t,n){_i(t,n),_i(t+"Capture",n)}function _i(t,n){for(zs[t]=n,t=0;t<n.length;t++)mu.add(n[t])}var gu=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]*$"),yu={},xu={};function Ga(t){return hn.call(xu,t)?!0:hn.call(yu,t)?!1:gu.test(t)?xu[t]=!0:(yu[t]=!0,!1)}function Rl(t,n,l){if(Ga(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 Ml(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 pi(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 mn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hi(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function aa(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ls(t){if(!t._valueTracker){var n=hi(t)?"checked":"value";t._valueTracker=aa(t,n,""+t[n])}}function mi(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=hi(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function Ri(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 bu=/[\n"\\]/g;function Nt(t){return t.replace(bu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Bn(t,n,l,o,f,h,v,E){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+mn(n)):t.value!==""+mn(n)&&(t.value=""+mn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Dr(t,v,mn(n)):l!=null?Dr(t,v,mn(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+mn(E):t.removeAttribute("name")}function Mi(t,n,l,o,f,h,v,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Ls(t);return}l=l!=null?""+mn(l):"",n=n!=null?""+mn(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),Ls(t)}function Dr(t,n,l){n==="number"&&Ri(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function ii(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=""+mn(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 Is(t,n,l){if(n!=null&&(n=""+mn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+mn(l):""}function Ol(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=mn(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),Ls(t)}function Va(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var _r=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 Fa(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||_r.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Rr(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&&Fa(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Fa(t,h,n[h])}function zl(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 vu=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"]]),Mr=/^[\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 gn(t){return Mr.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Xt(){}var Ll=null;function la(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Oi=null,zi=null;function wu(t){var n=Ni(t);if(n&&(t=n.stateNode)){var l=t[Bt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Bn(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="'+Nt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Bt]||null;if(!f)throw Error(r(90));Bn(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&&mi(o)}break e;case"textarea":Is(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&ii(t,!!l.multiple,n,!1)}}}var Il=!1;function Us(t,n,l){if(Il)return t(n,l);Il=!0;try{var o=t(n);return o}finally{if(Il=!1,(Oi!==null||zi!==null)&&(dc(),Oi&&(n=Oi,t=zi,zi=Oi=null,wu(n),t)))for(n=0;n<t.length;n++)wu(t[n])}}function Ul(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Bt]||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 tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bs=!1;if(tn)try{var Bl={};Object.defineProperty(Bl,"passive",{get:function(){Bs=!0}}),window.addEventListener("test",Bl,Bl),window.removeEventListener("test",Bl,Bl)}catch{Bs=!1}var Li=null,Or=null,ra=null;function qs(){if(ra)return ra;var t,n=Or,l=n.length,o,f="value"in Li?Li.value:Li.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return ra=f.slice(t,1<o?1-o:void 0)}function Pa(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 gi(){return!0}function ql(){return!1}function nn(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(l=t[E],this[E]=l?l(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?gi:ql,this.isPropagationStopped=ql,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=gi)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gi)},persist:function(){},isPersistent:gi}),n}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ya=nn(qn),sa=x({},qn,{view:0,detail:0}),Hs=nn(sa),zr,Hl,Wa,Ii=x({},sa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:De,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!==Wa&&(Wa&&t.type==="mousemove"?(zr=t.screenX-Wa.screenX,Hl=t.screenY-Wa.screenY):Hl=zr=0,Wa=t),zr)},movementY:function(t){return"movementY"in t?t.movementY:Hl}}),Ka=nn(Ii),Lr=x({},Ii,{dataTransfer:0}),Ir=nn(Lr),$l=x({},sa,{relatedTarget:0}),Ui=nn($l),Xa=x({},qn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bi=nn(Xa),kn=x({},qn,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),jn=nn(kn),Qa=x({},qn,{data:0}),Za=nn(Qa),Ur={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Br={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"},$s={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gs(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=$s[t])?!!n[t]:!1}function De(){return Gs}var ku=x({},sa,{key:function(t){if(t.key){var n=Ur[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Pa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Br[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:De,charCode:function(t){return t.type==="keypress"?Pa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ai=nn(ku),Qt=x({},Ii,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qr=nn(Qt),Gl=x({},sa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:De}),at=nn(Gl),Ja=x({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hr=nn(Ja),Vl=x({},Ii,{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}),Fl=nn(Vl),Vs=x({},qn,{newState:0,oldState:0}),oa=nn(Vs),md=[9,13,27,32],Fs=tn&&"CompositionEvent"in window,yi=null;tn&&"documentMode"in document&&(yi=document.documentMode);var ju=tn&&"TextEvent"in window&&!yi,$r=tn&&(!Fs||yi&&8<yi&&11>=yi),Gr=" ",Pl=!1;function Su(t,n){switch(t){case"keyup":return md.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ps(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var qi=!1;function Vr(t,n){switch(t){case"compositionend":return Ps(n);case"keypress":return n.which!==32?null:(Pl=!0,Gr);case"textInput":return t=n.data,t===Gr&&Pl?null:t;default:return null}}function gd(t,n){if(qi)return t==="compositionend"||!Fs&&Su(t,n)?(t=qs(),ra=Or=Li=null,qi=!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 $r&&n.locale!=="ko"?null:n.data;default:return null}}var Yl={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 Cu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Yl[t.type]:n==="textarea"}function Tu(t,n,l,o){Oi?zi?zi.push(o):zi=[o]:Oi=o,n=xc(n,"onChange"),0<n.length&&(l=new Ya("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Wl=null,ua=null;function ca(t){Bg(t,0)}function Hi(t){var n=ia(t);if(mi(n))return t}function we(t,n){if(t==="change")return n}var Kl=!1;if(tn){var da;if(tn){var Fr="oninput"in document;if(!Fr){var Pr=document.createElement("div");Pr.setAttribute("oninput","return;"),Fr=typeof Pr.oninput=="function"}da=Fr}else da=!1;Kl=da&&(!document.documentMode||9<document.documentMode)}function Yr(){Wl&&(Wl.detachEvent("onpropertychange",Eu),ua=Wl=null)}function Eu(t){if(t.propertyName==="value"&&Hi(ua)){var n=[];Tu(n,ua,t,la(t)),Us(ca,n)}}function an(t,n,l){t==="focusin"?(Yr(),Wl=n,ua=l,Wl.attachEvent("onpropertychange",Eu)):t==="focusout"&&Yr()}function yd(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Hi(ua)}function xd(t,n){if(t==="click")return Hi(n)}function Wr(t,n){if(t==="input"||t==="change")return Hi(n)}function bd(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var cn=typeof Object.is=="function"?Object.is:bd;function fa(t,n){if(cn(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(!hn.call(n,f)||!cn(t[f],n[f]))return!1}return!0}function Au(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Nu(t,n){var l=Au(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=Au(l)}}function Xl(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Xl(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Kr(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ri(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=Ri(t.document)}return n}function Ql(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 vd=tn&&"documentMode"in document&&11>=document.documentMode,$i=null,Ys=null,Zl=null,Jl=!1;function Ws(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Jl||$i==null||$i!==Ri(o)||(o=$i,"selectionStart"in o&&Ql(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}),Zl&&fa(Zl,o)||(Zl=o,o=xc(Ys,"onSelect"),0<o.length&&(n=new Ya("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=$i)))}function pa(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var el={animationend:pa("Animation","AnimationEnd"),animationiteration:pa("Animation","AnimationIteration"),animationstart:pa("Animation","AnimationStart"),transitionrun:pa("Transition","TransitionRun"),transitionstart:pa("Transition","TransitionStart"),transitioncancel:pa("Transition","TransitionCancel"),transitionend:pa("Transition","TransitionEnd")},Xr={},Du={};tn&&(Du=document.createElement("div").style,"AnimationEvent"in window||(delete el.animationend.animation,delete el.animationiteration.animation,delete el.animationstart.animation),"TransitionEvent"in window||delete el.transitionend.transition);function ha(t){if(Xr[t])return Xr[t];if(!el[t])return t;var n=el[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Du)return Xr[t]=n[l];return t}var _u=ha("animationend"),Ru=ha("animationiteration"),Mu=ha("animationstart"),wd=ha("transitionrun"),kd=ha("transitionstart"),jd=ha("transitioncancel"),Ou=ha("transitionend"),zu=new Map,Ks="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(" ");Ks.push("scrollEnd");function Hn(t,n){zu.set(t,n),un(n,[t])}var Qr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Sn=[],tl=0,Xs=0;function Zr(){for(var t=tl,n=Xs=tl=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 h=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}h!==0&&Cn(l,f,h)}}function Jr(t,n,l,o){Sn[tl++]=t,Sn[tl++]=n,Sn[tl++]=l,Sn[tl++]=o,Xs|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Qs(t,n,l,o){return Jr(t,n,l,o),er(t)}function Gi(t,n){return Jr(t,null,null,n),er(t)}function Cn(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-st(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function er(t){if(50<Ao)throw Ao=0,bf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ma={};function tr(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 Ot(t,n,l,o){return new tr(t,n,l,o)}function Zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xi(t,n){var l=t.alternate;return l===null?(l=Ot(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 Lu(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 es(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")Zs(t)&&(v=1);else if(typeof t=="string")v=Nk(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=Ot(31,l,n,f),t.elementType=ee,t.lanes=h,t;case R:return ga(l.children,f,h,n);case q:v=8,f|=24;break;case N:return t=Ot(12,l,n,f|2),t.elementType=N,t.lanes=h,t;case ie:return t=Ot(13,l,n,f),t.elementType=ie,t.lanes=h,t;case _:return t=Ot(19,l,n,f),t.elementType=_,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case H:v=9;break e;case F:v=11;break e;case Q:v=14;break e;case re:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=Ot(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function ga(t,n,l,o){return t=Ot(7,t,o,n),t.lanes=l,t}function Js(t,n,l){return t=Ot(6,t,null,n),t.lanes=l,t}function eo(t){var n=Ot(18,null,null,0);return n.stateNode=t,n}function ts(t,n,l){return n=Ot(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Iu=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var l=Iu.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Ut(n)},Iu.set(t,n),n)}return{value:t,source:n,stack:Ut(n)}}var nl=[],$n=0,ya=null,nr=0,En=[],yn=0,Vi=null,Gn=1,li="";function bi(t,n){nl[$n++]=nr,nl[$n++]=ya,ya=t,nr=n}function Uu(t,n,l){En[yn++]=Gn,En[yn++]=li,En[yn++]=Vi,Vi=t;var o=Gn;t=li;var f=32-st(o)-1;o&=~(1<<f),l+=1;var h=32-st(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Gn=1<<32-st(n)+f|l<<f|o,li=h+t}else Gn=1<<h|l<<f|o,li=t}function to(t){t.return!==null&&(bi(t,1),Uu(t,1,0))}function no(t){for(;t===ya;)ya=nl[--$n],nl[$n]=null,nr=nl[--$n],nl[$n]=null;for(;t===Vi;)Vi=En[--yn],En[yn]=null,li=En[--yn],En[yn]=null,Gn=En[--yn],En[yn]=null}function Bu(t,n){En[yn++]=Gn,En[yn++]=li,En[yn++]=Vi,Gn=n.id,li=n.overflow,Vi=t}var Yt=null,mt=null,Pe=!1,Fi=null,An=!1,io=Error(r(519));function Pi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wi(Tn(n,t)),io}function ir(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Pt]=t,n[Bt]=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<Do.length;l++)We(Do[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),Mi(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),Ol(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||Gg(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=Xt),n=!0):n=!1,n||Pi(t,!0)}function qu(t){for(Yt=t.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Yt=Yt.return}}function Yi(t){if(t!==Yt)return!1;if(!Pe)return qu(t),Pe=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Of(t.type,t.memoizedProps)),l=!l),l&&mt&&Pi(t),qu(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Zg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Zg(t)}else n===27?(n=mt,xl(t.type)?(t=Bf,Bf=null,mt=t):mt=n):mt=Yt?ui(t.stateNode.nextSibling):null;return!0}function xa(){mt=Yt=null,Pe=!1}function ao(){var t=Fi;return t!==null&&(Mn===null?Mn=t:Mn.push.apply(Mn,t),Fi=null),t}function Wi(t){Fi===null?Fi=[t]:Fi.push(t)}var lo=A(null),Nn=null,Vn=null;function vi(t,n,l){C(lo,n._currentValue),n._currentValue=l}function ri(t){t._currentValue=lo.current,z(lo)}function ns(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 ba(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=f;for(var I=0;I<n.length;I++)if(E.context===n[I]){h.lanes|=l,E=h.alternate,E!==null&&(E.lanes|=l),ns(h.return,l,t),o||(v=null);break e}h=E.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),ns(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 il(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var E=f.type;cn(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(zo):t=[zo])}f=f.return}t!==null&&ba(n,t,l,o),n.flags|=262144}function is(t){for(t=t.firstContext;t!==null;){if(!cn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function va(t){Nn=t,Vn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Dt(t){return ro(Nn,t)}function as(t,n){return Nn===null&&va(t),ro(t,n)}function ro(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Vn===null){if(t===null)throw Error(r(308));Vn=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Vn=Vn.next=n;return l}var Sd=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()})}},ar=e.unstable_scheduleCallback,lr=e.unstable_NormalPriority,bt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function so(){return{controller:new Sd,data:new Map,refCount:0}}function rr(t){t.refCount--,t.refCount===0&&ar(lr,function(){t.controller.abort()})}var sr=null,lt=0,xn=0,al=null;function Fn(t,n){if(sr===null){var l=sr=[];lt=0,xn=Cf(),al={status:"pending",value:void 0,then:function(o){l.push(o)}}}return lt++,n.then(Hu,Hu),n}function Hu(){if(--lt===0&&sr!==null){al!==null&&(al.status="fulfilled");var t=sr;sr=null,xn=0,al=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Ki(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 $u=V.S;V.S=function(t,n){pg=Mt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Fn(t,n),$u!==null&&$u(t,n)};var wa=A(null);function oo(){var t=wa.current;return t!==null?t:gt.pooledCache}function ll(t,n){n===null?C(wa,wa.current):C(wa,n.pool)}function Gu(){var t=oo();return t===null?null:{parent:bt._currentValue,pool:t}}var rl=Error(r(460)),uo=Error(r(474)),or=Error(r(542)),ur={then:function(){}};function co(t){return t=t.status,t==="fulfilled"||t==="rejected"}function fo(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Xt,Xt),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,M(t),t;default:if(typeof n.status=="string")n.then(Xt,Xt);else{if(t=gt,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,M(t),t}throw k=n,rl}}function y(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(k=l,rl):l}}var k=null;function S(){if(k===null)throw Error(r(459));var t=k;return k=null,t}function M(t){if(t===rl||t===or)throw Error(r(483))}var U=null,Z=0;function pe(t){var n=Z;return Z+=1,U===null&&(U=[]),fo(U,t,n)}function Te(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function ve(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 ke(t){function n(G,B){if(t){var P=G.deletions;P===null?(G.deletions=[B],G.flags|=16):P.push(B)}}function l(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=xi(G,B),G.index=0,G.sibling=null,G}function h(G,B,P){return G.index=P,t?(P=G.alternate,P!==null?(P=P.index,P<B?(G.flags|=67108866,B):P):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function E(G,B,P,le){return B===null||B.tag!==6?(B=Js(P,G.mode,le),B.return=G,B):(B=f(B,P),B.return=G,B)}function I(G,B,P,le){var _e=P.type;return _e===R?ne(G,B,P.props.children,le,P.key):B!==null&&(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===re&&y(_e)===B.type)?(B=f(B,P.props),Te(B,P),B.return=G,B):(B=es(P.type,P.key,P.props,null,G.mode,le),Te(B,P),B.return=G,B)}function Y(G,B,P,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==P.containerInfo||B.stateNode.implementation!==P.implementation?(B=ts(P,G.mode,le),B.return=G,B):(B=f(B,P.children||[]),B.return=G,B)}function ne(G,B,P,le,_e){return B===null||B.tag!==7?(B=ga(P,G.mode,le,_e),B.return=G,B):(B=f(B,P),B.return=G,B)}function se(G,B,P){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Js(""+B,G.mode,P),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return P=es(B.type,B.key,B.props,null,G.mode,P),Te(P,B),P.return=G,P;case T:return B=ts(B,G.mode,P),B.return=G,B;case re:return B=y(B),se(G,B,P)}if(ue(B)||de(B))return B=ga(B,G.mode,P,null),B.return=G,B;if(typeof B.then=="function")return se(G,pe(B),P);if(B.$$typeof===$)return se(G,as(G,B),P);ve(G,B)}return null}function K(G,B,P,le){var _e=B!==null?B.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return _e!==null?null:E(G,B,""+P,le);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return P.key===_e?I(G,B,P,le):null;case T:return P.key===_e?Y(G,B,P,le):null;case re:return P=y(P),K(G,B,P,le)}if(ue(P)||de(P))return _e!==null?null:ne(G,B,P,le,null);if(typeof P.then=="function")return K(G,B,pe(P),le);if(P.$$typeof===$)return K(G,B,as(G,P),le);ve(G,P)}return null}function J(G,B,P,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(P)||null,E(B,G,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?P:le.key)||null,I(B,G,le,_e);case T:return G=G.get(le.key===null?P:le.key)||null,Y(B,G,le,_e);case re:return le=y(le),J(G,B,P,le,_e)}if(ue(le)||de(le))return G=G.get(P)||null,ne(B,G,le,_e,null);if(typeof le.then=="function")return J(G,B,P,pe(le),_e);if(le.$$typeof===$)return J(G,B,P,as(B,le),_e);ve(B,le)}return null}function je(G,B,P,le){for(var _e=null,nt=null,Ae=B,Ge=B=0,Ze=null;Ae!==null&&Ge<P.length;Ge++){Ae.index>Ge?(Ze=Ae,Ae=null):Ze=Ae.sibling;var it=K(G,Ae,P[Ge],le);if(it===null){Ae===null&&(Ae=Ze);break}t&&Ae&&it.alternate===null&&n(G,Ae),B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it,Ae=Ze}if(Ge===P.length)return l(G,Ae),Pe&&bi(G,Ge),_e;if(Ae===null){for(;Ge<P.length;Ge++)Ae=se(G,P[Ge],le),Ae!==null&&(B=h(Ae,B,Ge),nt===null?_e=Ae:nt.sibling=Ae,nt=Ae);return Pe&&bi(G,Ge),_e}for(Ae=o(Ae);Ge<P.length;Ge++)Ze=J(Ae,G,Ge,P[Ge],le),Ze!==null&&(t&&Ze.alternate!==null&&Ae.delete(Ze.key===null?Ge:Ze.key),B=h(Ze,B,Ge),nt===null?_e=Ze:nt.sibling=Ze,nt=Ze);return t&&Ae.forEach(function(jl){return n(G,jl)}),Pe&&bi(G,Ge),_e}function ze(G,B,P,le){if(P==null)throw Error(r(151));for(var _e=null,nt=null,Ae=B,Ge=B=0,Ze=null,it=P.next();Ae!==null&&!it.done;Ge++,it=P.next()){Ae.index>Ge?(Ze=Ae,Ae=null):Ze=Ae.sibling;var jl=K(G,Ae,it.value,le);if(jl===null){Ae===null&&(Ae=Ze);break}t&&Ae&&jl.alternate===null&&n(G,Ae),B=h(jl,B,Ge),nt===null?_e=jl:nt.sibling=jl,nt=jl,Ae=Ze}if(it.done)return l(G,Ae),Pe&&bi(G,Ge),_e;if(Ae===null){for(;!it.done;Ge++,it=P.next())it=se(G,it.value,le),it!==null&&(B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return Pe&&bi(G,Ge),_e}for(Ae=o(Ae);!it.done;Ge++,it=P.next())it=J(Ae,G,Ge,it.value,le),it!==null&&(t&&it.alternate!==null&&Ae.delete(it.key===null?Ge:it.key),B=h(it,B,Ge),nt===null?_e=it:nt.sibling=it,nt=it);return t&&Ae.forEach(function(qk){return n(G,qk)}),Pe&&bi(G,Ge),_e}function ht(G,B,P,le){if(typeof P=="object"&&P!==null&&P.type===R&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case w:e:{for(var _e=P.key;B!==null;){if(B.key===_e){if(_e=P.type,_e===R){if(B.tag===7){l(G,B.sibling),le=f(B,P.props.children),le.return=G,G=le;break e}}else if(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===re&&y(_e)===B.type){l(G,B.sibling),le=f(B,P.props),Te(le,P),le.return=G,G=le;break e}l(G,B);break}else n(G,B);B=B.sibling}P.type===R?(le=ga(P.props.children,G.mode,le,P.key),le.return=G,G=le):(le=es(P.type,P.key,P.props,null,G.mode,le),Te(le,P),le.return=G,G=le)}return v(G);case T:e:{for(_e=P.key;B!==null;){if(B.key===_e)if(B.tag===4&&B.stateNode.containerInfo===P.containerInfo&&B.stateNode.implementation===P.implementation){l(G,B.sibling),le=f(B,P.children||[]),le.return=G,G=le;break e}else{l(G,B);break}else n(G,B);B=B.sibling}le=ts(P,G.mode,le),le.return=G,G=le}return v(G);case re:return P=y(P),ht(G,B,P,le)}if(ue(P))return je(G,B,P,le);if(de(P)){if(_e=de(P),typeof _e!="function")throw Error(r(150));return P=_e.call(P),ze(G,B,P,le)}if(typeof P.then=="function")return ht(G,B,pe(P),le);if(P.$$typeof===$)return ht(G,B,as(G,P),le);ve(G,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,B!==null&&B.tag===6?(l(G,B.sibling),le=f(B,P),le.return=G,G=le):(l(G,B),le=Js(P,G.mode,le),le.return=G,G=le),v(G)):l(G,B)}return function(G,B,P,le){try{Z=0;var _e=ht(G,B,P,le);return U=null,_e}catch(Ae){if(Ae===rl||Ae===or)throw Ae;var nt=Ot(29,Ae,null,G.mode);return nt.lanes=le,nt.return=G,nt}finally{}}}var ot=ke(!0),tt=ke(!1),si=!1;function ls(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cd(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 sl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ol(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=er(t),Cn(t,null,l),n}return Jr(t,o,n,l),er(t)}function po(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,qa(t,l)}}function Td(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var Ed=!1;function ho(){if(Ed){var t=al;if(t!==null)throw t}}function mo(t,n,l,o){Ed=!1;var f=t.updateQueue;si=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var I=E,Y=I.next;I.next=null,v===null?h=Y:v.next=Y,v=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,E=ne.lastBaseUpdate,E!==v&&(E===null?ne.firstBaseUpdate=Y:E.next=Y,ne.lastBaseUpdate=I))}if(h!==null){var se=f.baseState;v=0,ne=Y=I=null,E=h;do{var K=E.lane&-536870913,J=K!==E.lane;if(J?(Qe&K)===K:(o&K)===K){K!==0&&K===xn&&(Ed=!0),ne!==null&&(ne=ne.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var je=t,ze=E;K=n;var ht=l;switch(ze.tag){case 1:if(je=ze.payload,typeof je=="function"){se=je.call(ht,se,K);break e}se=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ze.payload,K=typeof je=="function"?je.call(ht,se,K):je,K==null)break e;se=x({},se,K);break e;case 2:si=!0}}K=E.callback,K!==null&&(t.flags|=64,J&&(t.flags|=8192),J=f.callbacks,J===null?f.callbacks=[K]:J.push(K))}else J={lane:K,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ne===null?(Y=ne=J,I=se):ne=ne.next=J,v|=K;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;J=E,E=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);ne===null&&(I=se),f.baseState=I,f.firstBaseUpdate=Y,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),pl|=v,t.lanes=v,t.memoizedState=se}}function Uh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Bh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Uh(l[t],n)}var rs=A(null),Vu=A(0);function qh(t,n){t=Da,C(Vu,t),C(rs,n),Da=t|n.baseLanes}function Ad(){C(Vu,Da),C(rs,rs.current)}function Nd(){Da=Vu.current,z(rs),z(Vu)}var Pn=A(null),oi=null;function ul(t){var n=t.alternate;C(zt,zt.current&1),C(Pn,t),oi===null&&(n===null||rs.current!==null||n.memoizedState!==null)&&(oi=t)}function Dd(t){C(zt,zt.current),C(Pn,t),oi===null&&(oi=t)}function Hh(t){t.tag===22?(C(zt,zt.current),C(Pn,t),oi===null&&(oi=t)):cl()}function cl(){C(zt,zt.current),C(Pn,Pn.current)}function Yn(t){z(Pn),oi===t&&(oi=null),z(zt)}var zt=A(0);function Fu(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||If(l)||Uf(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 ka=0,qe=null,ft=null,qt=null,Pu=!1,ss=!1,cr=!1,Yu=0,go=0,os=null,Dw=0;function _t(){throw Error(r(321))}function _d(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!cn(t[l],n[l]))return!1;return!0}function Rd(t,n,l,o,f,h){return ka=h,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?Sm:Yd,cr=!1,h=l(o,f),cr=!1,ss&&(h=Gh(n,l,o,f)),$h(t),h}function $h(t){V.H=bo;var n=ft!==null&&ft.next!==null;if(ka=0,qt=ft=qe=null,Pu=!1,go=0,os=null,n)throw Error(r(300));t===null||Ht||(t=t.dependencies,t!==null&&is(t)&&(Ht=!0))}function Gh(t,n,l,o){qe=t;var f=0;do{if(ss&&(os=null),go=0,ss=!1,25<=f)throw Error(r(301));if(f+=1,qt=ft=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=Cm,h=n(l,o)}while(ss);return h}function _w(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?yo(n):n,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(qe.flags|=1024),n}function Md(){var t=Yu!==0;return Yu=0,t}function Od(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function zd(t){if(Pu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Pu=!1}ka=0,qt=ft=qe=null,ss=!1,go=Yu=0,os=null}function bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?qe.memoizedState=qt=t:qt=qt.next=t,qt}function Lt(){if(ft===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var n=qt===null?qe.memoizedState:qt.next;if(n!==null)qt=n,ft=t;else{if(t===null)throw qe.alternate===null?Error(r(467)):Error(r(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},qt===null?qe.memoizedState=qt=t:qt=qt.next=t}return qt}function Wu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function yo(t){var n=go;return go+=1,os===null&&(os=[]),t=fo(os,t,n),n=qe,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?Sm:Yd),t}function Ku(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return yo(t);if(t.$$typeof===$)return Dt(t)}throw Error(r(438,String(t)))}function Ld(t){var n=null,l=qe.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Wu(),qe.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=L;return n.index++,l}function ja(t,n){return typeof n=="function"?n(t):n}function Xu(t){var n=Lt();return Id(n,ft,t)}function Id(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var E=v=null,I=null,Y=n,ne=!1;do{var se=Y.lane&-536870913;if(se!==Y.lane?(Qe&se)===se:(ka&se)===se){var K=Y.revertLane;if(K===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),se===xn&&(ne=!0);else if((ka&K)===K){Y=Y.next,K===xn&&(ne=!0);continue}else se={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(E=I=se,v=h):I=I.next=se,qe.lanes|=K,pl|=K;se=Y.action,cr&&l(h,se),h=Y.hasEagerState?Y.eagerState:l(h,se)}else K={lane:se,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(E=I=K,v=h):I=I.next=K,qe.lanes|=se,pl|=se;Y=Y.next}while(Y!==null&&Y!==n);if(I===null?v=h:I.next=E,!cn(h,t.memoizedState)&&(Ht=!0,ne&&(l=al,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Ud(t){var n=Lt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);cn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Vh(t,n,l){var o=qe,f=Lt(),h=Pe;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!cn((ft||f).memoizedState,l);if(v&&(f.memoizedState=l,Ht=!0),f=f.queue,Hd(Yh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||qt!==null&&qt.memoizedState.tag&1){if(o.flags|=2048,us(9,{destroy:void 0},Ph.bind(null,o,f,l,n),null),gt===null)throw Error(r(349));h||(ka&127)!==0||Fh(o,n,l)}return l}function Fh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=qe.updateQueue,n===null?(n=Wu(),qe.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Ph(t,n,l,o){n.value=l,n.getSnapshot=o,Wh(n)&&Kh(t)}function Yh(t,n,l){return l(function(){Wh(n)&&Kh(t)})}function Wh(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!cn(t,l)}catch{return!0}}function Kh(t){var n=Gi(t,2);n!==null&&On(n,t,2)}function Bd(t){var n=bn();if(typeof t=="function"){var l=t;if(t=l(),cr){dt(!0);try{l()}finally{dt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:t},n}function Xh(t,n,l,o){return t.baseState=l,Id(t,ft,typeof o=="function"?o:ja)}function Rw(t,n,l,o,f){if(Ju(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,Qh(n,h)):(h.next=l.next,n.pending=l.next=h)}}function Qh(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var E=l(f,o),I=V.S;I!==null&&I(v,E),Zh(t,n,E)}catch(Y){qd(t,n,Y)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=l(f,o),Zh(t,n,h)}catch(Y){qd(t,n,Y)}}function Zh(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){Jh(t,n,o)},function(o){return qd(t,n,o)}):Jh(t,n,l)}function Jh(t,n,l){n.status="fulfilled",n.value=l,em(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Qh(t,l)))}function qd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,em(n),n=n.next;while(n!==o)}t.action=null}function em(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function tm(t,n){return n}function nm(t,n){if(Pe){var l=gt.formState;if(l!==null){e:{var o=qe;if(Pe){if(mt){t:{for(var f=mt,h=An;f.nodeType!==8;){if(!h){f=null;break t}if(f=ui(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){mt=ui(f.nextSibling),o=f.data==="F!";break e}}Pi(o)}o=!1}o&&(n=l[0])}}return l=bn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tm,lastRenderedState:n},l.queue=o,l=wm.bind(null,qe,o),o.dispatch=l,o=Bd(!1),h=Pd.bind(null,qe,!1,o.queue),o=bn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Rw.bind(null,qe,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function im(t){var n=Lt();return am(n,ft,t)}function am(t,n,l){if(n=Id(t,n,tm)[0],t=Xu(ja)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=yo(n)}catch(v){throw v===rl?or:v}else o=n;n=Lt();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(qe.flags|=2048,us(9,{destroy:void 0},Mw.bind(null,f,l),null)),[o,h,t]}function Mw(t,n){t.action=n}function lm(t){var n=Lt(),l=ft;if(l!==null)return am(n,l,t);Lt(),n=n.memoizedState,l=Lt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function us(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=Wu(),qe.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function rm(){return Lt().memoizedState}function Qu(t,n,l,o){var f=bn();qe.flags|=t,f.memoizedState=us(1|n,{destroy:void 0},l,o===void 0?null:o)}function Zu(t,n,l,o){var f=Lt();o=o===void 0?null:o;var h=f.memoizedState.inst;ft!==null&&o!==null&&_d(o,ft.memoizedState.deps)?f.memoizedState=us(n,h,l,o):(qe.flags|=t,f.memoizedState=us(1|n,h,l,o))}function sm(t,n){Qu(8390656,8,t,n)}function Hd(t,n){Zu(2048,8,t,n)}function Ow(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=Wu(),qe.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function om(t){var n=Lt().memoizedState;return Ow({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function um(t,n){return Zu(4,2,t,n)}function cm(t,n){return Zu(4,4,t,n)}function dm(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 fm(t,n,l){l=l!=null?l.concat([t]):null,Zu(4,4,dm.bind(null,n,t),l)}function $d(){}function pm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&_d(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function hm(t,n){var l=Lt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&_d(n,o[1]))return o[0];if(o=t(),cr){dt(!0);try{t()}finally{dt(!1)}}return l.memoizedState=[o,n],o}function Gd(t,n,l){return l===void 0||(ka&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=mg(),qe.lanes|=t,pl|=t,l)}function mm(t,n,l,o){return cn(l,n)?l:rs.current!==null?(t=Gd(t,l,o),cn(t,n)||(Ht=!0),t):(ka&42)===0||(ka&1073741824)!==0&&(Qe&261930)===0?(Ht=!0,t.memoizedState=l):(t=mg(),qe.lanes|=t,pl|=t,n)}function gm(t,n,l,o,f){var h=oe.p;oe.p=h!==0&&8>h?h:8;var v=V.T,E={};V.T=E,Pd(t,!1,n,l);try{var I=f(),Y=V.S;if(Y!==null&&Y(E,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=Ki(I,o);xo(t,n,ne,Xn(t))}else xo(t,n,o,Xn(t))}catch(se){xo(t,n,{then:function(){},status:"rejected",reason:se},Xn())}finally{oe.p=h,v!==null&&E.types!==null&&(v.types=E.types),V.T=v}}function zw(){}function Vd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=ym(t).queue;gm(t,f,n,be,l===null?zw:function(){return xm(t),l(o)})}function ym(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:be,baseState:be,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:be},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function xm(t){var n=ym(t);n.next===null&&(n=t.alternate.memoizedState),xo(t,n.next.queue,{},Xn())}function Fd(){return Dt(zo)}function bm(){return Lt().memoizedState}function vm(){return Lt().memoizedState}function Lw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xn();t=sl(l);var o=ol(n,t,l);o!==null&&(On(o,n,l),po(o,n,l)),n={cache:so()},t.payload=n;return}n=n.return}}function Iw(t,n,l){var o=Xn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ju(t)?km(n,l):(l=Qs(t,n,l,o),l!==null&&(On(l,t,o),jm(l,n,o)))}function wm(t,n,l){var o=Xn();xo(t,n,l,o)}function xo(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ju(t))km(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,E=h(v,l);if(f.hasEagerState=!0,f.eagerState=E,cn(E,v))return Jr(t,n,f,0),gt===null&&Zr(),!1}catch{}finally{}if(l=Qs(t,n,f,o),l!==null)return On(l,t,o),jm(l,n,o),!0}return!1}function Pd(t,n,l,o){if(o={lane:2,revertLane:Cf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ju(t)){if(n)throw Error(r(479))}else n=Qs(t,l,o,2),n!==null&&On(n,t,2)}function Ju(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function km(t,n){ss=Pu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function jm(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,qa(t,l)}}var bo={readContext:Dt,use:Ku,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};bo.useEffectEvent=_t;var Sm={readContext:Dt,use:Ku,useCallback:function(t,n){return bn().memoizedState=[t,n===void 0?null:n],t},useContext:Dt,useEffect:sm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Qu(4194308,4,dm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Qu(4194308,4,t,n)},useInsertionEffect:function(t,n){Qu(4,2,t,n)},useMemo:function(t,n){var l=bn();n=n===void 0?null:n;var o=t();if(cr){dt(!0);try{t()}finally{dt(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=bn();if(l!==void 0){var f=l(n);if(cr){dt(!0);try{l(n)}finally{dt(!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=Iw.bind(null,qe,t),[o.memoizedState,t]},useRef:function(t){var n=bn();return t={current:t},n.memoizedState=t},useState:function(t){t=Bd(t);var n=t.queue,l=wm.bind(null,qe,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:$d,useDeferredValue:function(t,n){var l=bn();return Gd(l,t,n)},useTransition:function(){var t=Bd(!1);return t=gm.bind(null,qe,t.queue,!0,!1),bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=qe,f=bn();if(Pe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),gt===null)throw Error(r(349));(Qe&127)!==0||Fh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,sm(Yh.bind(null,o,h,t),[t]),o.flags|=2048,us(9,{destroy:void 0},Ph.bind(null,o,h,l,n),null),l},useId:function(){var t=bn(),n=gt.identifierPrefix;if(Pe){var l=li,o=Gn;l=(o&~(1<<32-st(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=Yu++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=Dw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Fd,useFormState:nm,useActionState:nm,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=Pd.bind(null,qe,!0,l),l.dispatch=n,[t,n]},useMemoCache:Ld,useCacheRefresh:function(){return bn().memoizedState=Lw.bind(null,qe)},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)}}},Yd={readContext:Dt,use:Ku,useCallback:pm,useContext:Dt,useEffect:Hd,useImperativeHandle:fm,useInsertionEffect:um,useLayoutEffect:cm,useMemo:hm,useReducer:Xu,useRef:rm,useState:function(){return Xu(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=Lt();return mm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Xu(ja)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Vh,useId:bm,useHostTransitionStatus:Fd,useFormState:im,useActionState:im,useOptimistic:function(t,n){var l=Lt();return Xh(l,ft,t,n)},useMemoCache:Ld,useCacheRefresh:vm};Yd.useEffectEvent=om;var Cm={readContext:Dt,use:Ku,useCallback:pm,useContext:Dt,useEffect:Hd,useImperativeHandle:fm,useInsertionEffect:um,useLayoutEffect:cm,useMemo:hm,useReducer:Ud,useRef:rm,useState:function(){return Ud(ja)},useDebugValue:$d,useDeferredValue:function(t,n){var l=Lt();return ft===null?Gd(l,t,n):mm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Ud(ja)[0],n=Lt().memoizedState;return[typeof t=="boolean"?t:yo(t),n]},useSyncExternalStore:Vh,useId:bm,useHostTransitionStatus:Fd,useFormState:lm,useActionState:lm,useOptimistic:function(t,n){var l=Lt();return ft!==null?Xh(l,ft,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Ld,useCacheRefresh:vm};Cm.useEffectEvent=om;function Wd(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Kd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=sl(o);f.payload=n,l!=null&&(f.callback=l),n=ol(t,f,o),n!==null&&(On(n,t,o),po(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Xn(),f=sl(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=ol(t,f,o),n!==null&&(On(n,t,o),po(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Xn(),o=sl(l);o.tag=2,n!=null&&(o.callback=n),n=ol(t,o,l),n!==null&&(On(n,t,l),po(n,t,l))}};function Tm(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!fa(l,o)||!fa(f,h):!0}function Em(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&&Kd.enqueueReplaceState(n,n.state,null)}function dr(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Am(t){Qr(t)}function Nm(t){console.error(t)}function Dm(t){Qr(t)}function ec(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function _m(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 Xd(t,n,l){return l=sl(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(t,n)},l}function Rm(t){return t=sl(t),t.tag=3,t}function Mm(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){_m(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){_m(n,l,o),typeof f!="function"&&(hl===null?hl=new Set([this]):hl.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function Uw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&il(n,l,f,!0),l=Pn.current,l!==null){switch(l.tag){case 31:case 13:return oi===null?fc():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===ur?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),kf(t,o,f)),!1;case 22:return l.flags|=65536,o===ur?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)),kf(t,o,f)),!1}throw Error(r(435,l.tag))}return kf(t,o,f),fc(),!1}if(Pe)return n=Pn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==io&&(t=Error(r(422),{cause:o}),Wi(Tn(t,l)))):(o!==io&&(n=Error(r(423),{cause:o}),Wi(Tn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Tn(o,l),f=Xd(t.stateNode,o,f),Td(t,f),Rt!==4&&(Rt=2)),!1;var h=Error(r(520),{cause:o});if(h=Tn(h,l),Eo===null?Eo=[h]:Eo.push(h),Rt!==4&&(Rt=2),n===null)return!0;o=Tn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Xd(l.stateNode,o,t),Td(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(hl===null||!hl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Rm(f),Mm(f,t,l,o),Td(l,f),!1}l=l.return}while(l!==null);return!1}var Qd=Error(r(461)),Ht=!1;function ln(t,n,l,o){n.child=t===null?tt(n,null,l,o):ot(n,t.child,l,o)}function Om(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return va(n),o=Rd(t,n,l,v,h,f),E=Md(),t!==null&&!Ht?(Od(t,n,f),Sa(t,n,f)):(Pe&&E&&to(n),n.flags|=1,ln(t,n,o,f),n.child)}function zm(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!Zs(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,Lm(t,n,h,o,f)):(t=es(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!rf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:fa,l(v,o)&&t.ref===n.ref)return Sa(t,n,f)}return n.flags|=1,t=xi(h,o),t.ref=n.ref,t.return=n,n.child=t}function Lm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(fa(h,o)&&t.ref===n.ref)if(Ht=!1,n.pendingProps=o=h,rf(t,f))(t.flags&131072)!==0&&(Ht=!0);else return n.lanes=t.lanes,Sa(t,n,f)}return Zd(t,n,l,o,f)}function Im(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Um(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ll(n,h!==null?h.cachePool:null),h!==null?qh(n,h):Ad(),Hh(n);else return o=n.lanes=536870912,Um(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ll(n,h.cachePool),qh(n,h),cl(),n.memoizedState=null):(t!==null&&ll(n,null),Ad(),cl());return ln(t,n,f,l),n.child}function vo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Um(t,n,l,o,f){var h=oo();return h=h===null?null:{parent:bt._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ll(n,null),Ad(),Hh(n),t!==null&&il(t,n,o,!0),n.childLanes=f,null}function tc(t,n){return n=ic({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Bm(t,n,l){return ot(n,t.child,null,l),t=tc(n,n.pendingProps),t.flags|=2,Yn(n),n.memoizedState=null,t}function Bw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Pe){if(o.mode==="hidden")return t=tc(n,o),n.lanes=536870912,vo(null,t);if(Dd(n),(t=mt)?(t=Qg(t,An),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Vi!==null?{id:Gn,overflow:li}:null,retryLane:536870912,hydrationErrors:null},l=eo(t),l.return=n,n.child=l,Yt=n,mt=null)):t=null,t===null)throw Pi(n);return n.lanes=536870912,null}return tc(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Dd(n),f)if(n.flags&256)n.flags&=-257,n=Bm(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||il(t,n,l,!1),f=(l&t.childLanes)!==0,Ht||f){if(o=gt,o!==null&&(v=pu(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,Gi(t,v),On(o,t,v),Qd;fc(),n=Bm(t,n,l)}else t=h.treeContext,mt=ui(v.nextSibling),Yt=n,Pe=!0,Fi=null,An=!1,t!==null&&Bu(n,t),n=tc(n,o),n.flags|=4096;return n}return t=xi(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function nc(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 Zd(t,n,l,o,f){return va(n),l=Rd(t,n,l,o,void 0,f),o=Md(),t!==null&&!Ht?(Od(t,n,f),Sa(t,n,f)):(Pe&&o&&to(n),n.flags|=1,ln(t,n,l,f),n.child)}function qm(t,n,l,o,f,h){return va(n),n.updateQueue=null,l=Gh(n,o,l,f),$h(t),o=Md(),t!==null&&!Ht?(Od(t,n,h),Sa(t,n,h)):(Pe&&o&&to(n),n.flags|=1,ln(t,n,l,h),n.child)}function Hm(t,n,l,o,f){if(va(n),n.stateNode===null){var h=ma,v=l.contextType;typeof v=="object"&&v!==null&&(h=Dt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Kd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},ls(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Dt(v):ma,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Wd(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Kd.enqueueReplaceState(h,h.state,null),mo(n,o,h,f),ho(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var E=n.memoizedProps,I=dr(l,E);h.props=I;var Y=h.context,ne=l.contextType;v=ma,typeof ne=="object"&&ne!==null&&(v=Dt(ne));var se=l.getDerivedStateFromProps;ne=typeof se=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||Y!==v)&&Em(n,h,o,v),si=!1;var K=n.memoizedState;h.state=K,mo(n,o,h,f),ho(),Y=n.memoizedState,E||K!==Y||si?(typeof se=="function"&&(Wd(n,l,se,o),Y=n.memoizedState),(I=si||Tm(n,l,I,o,K,Y,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=Y),h.props=o,h.state=Y,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Cd(t,n),v=n.memoizedProps,ne=dr(l,v),h.props=ne,se=n.pendingProps,K=h.context,Y=l.contextType,I=ma,typeof Y=="object"&&Y!==null&&(I=Dt(Y)),E=l.getDerivedStateFromProps,(Y=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==se||K!==I)&&Em(n,h,o,I),si=!1,K=n.memoizedState,h.state=K,mo(n,o,h,f),ho();var J=n.memoizedState;v!==se||K!==J||si||t!==null&&t.dependencies!==null&&is(t.dependencies)?(typeof E=="function"&&(Wd(n,l,E,o),J=n.memoizedState),(ne=si||Tm(n,l,ne,o,K,J,I)||t!==null&&t.dependencies!==null&&is(t.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,J,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,J,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),h.props=o,h.state=J,h.context=I,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&K===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,nc(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=ot(n,t.child,null,f),n.child=ot(n,null,l,f)):ln(t,n,l,f),n.memoizedState=h.state,t=n.child):t=Sa(t,n,f),t}function $m(t,n,l,o){return xa(),n.flags|=256,ln(t,n,l,o),n.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(t){return{baseLanes:t,cachePool:Gu()}}function tf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Kn),t}function Gm(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(zt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Pe){if(f?ul(n):cl(),(t=mt)?(t=Qg(t,An),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Vi!==null?{id:Gn,overflow:li}:null,retryLane:536870912,hydrationErrors:null},l=eo(t),l.return=n,n.child=l,Yt=n,mt=null)):t=null,t===null)throw Pi(n);return Uf(t)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(cl(),f=n.mode,E=ic({mode:"hidden",children:E},f),o=ga(o,f,l,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(null,o)):(ul(n),nf(n,E))}var I=t.memoizedState;if(I!==null&&(E=I.dehydrated,E!==null)){if(h)n.flags&256?(ul(n),n.flags&=-257,n=af(t,n,l)):n.memoizedState!==null?(cl(),n.child=t.child,n.flags|=128,n=null):(cl(),E=o.fallback,f=n.mode,o=ic({mode:"visible",children:o.children},f),E=ga(E,f,l,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,ot(n,t.child,null,l),o=n.child,o.memoizedState=ef(l),o.childLanes=tf(t,v,l),n.memoizedState=Jd,n=vo(null,o));else if(ul(n),Uf(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var Y=v.dgst;v=Y,o=Error(r(419)),o.stack="",o.digest=v,Wi({value:o,source:null,stack:null}),n=af(t,n,l)}else if(Ht||il(t,n,l,!1),v=(l&t.childLanes)!==0,Ht||v){if(v=gt,v!==null&&(o=pu(v,l),o!==0&&o!==I.retryLane))throw I.retryLane=o,Gi(t,o),On(v,t,o),Qd;If(E)||fc(),n=af(t,n,l)}else If(E)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,mt=ui(E.nextSibling),Yt=n,Pe=!0,Fi=null,An=!1,t!==null&&Bu(n,t),n=nf(n,o.children),n.flags|=4096);return n}return f?(cl(),E=o.fallback,f=n.mode,I=t.child,Y=I.sibling,o=xi(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,Y!==null?E=xi(Y,E):(E=ga(E,f,l,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,vo(null,o),o=n.child,E=t.child.memoizedState,E===null?E=ef(l):(f=E.cachePool,f!==null?(I=bt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=Gu(),E={baseLanes:E.baseLanes|l,cachePool:f}),o.memoizedState=E,o.childLanes=tf(t,v,l),n.memoizedState=Jd,vo(t.child,o)):(ul(n),l=t.child,t=l.sibling,l=xi(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 nf(t,n){return n=ic({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function ic(t,n){return t=Ot(22,t,null,n),t.lanes=0,t}function af(t,n,l){return ot(n,t.child,null,l),t=nf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Vm(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),ns(t.return,n,l)}function lf(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Fm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=zt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,C(zt,v),ln(t,n,o,l),o=Pe?nr:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Vm(t,l,n);else if(t.tag===19)Vm(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&&Fu(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),lf(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Fu(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}lf(n,!0,l,null,h,o);break;case"together":lf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Sa(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),pl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(il(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=xi(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=xi(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function rf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&is(t)))}function qw(t,n,l){switch(n.tag){case 3:Me(n,n.stateNode.containerInfo),vi(n,bt,t.memoizedState.cache),xa();break;case 27:case 5:Ct(n);break;case 4:Me(n,n.stateNode.containerInfo);break;case 10:vi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ul(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Gm(t,n,l):(ul(n),t=Sa(t,n,l),t!==null?t.sibling:null);ul(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(il(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Fm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(zt,zt.current),o)break;return null;case 22:return n.lanes=0,Im(t,n,l,n.pendingProps);case 24:vi(n,bt,t.memoizedState.cache)}return Sa(t,n,l)}function Pm(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ht=!0;else{if(!rf(t,l)&&(n.flags&128)===0)return Ht=!1,qw(t,n,l);Ht=(t.flags&131072)!==0}else Ht=!1,Pe&&(n.flags&1048576)!==0&&Uu(n,nr,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=y(n.elementType),n.type=t,typeof t=="function")Zs(t)?(o=dr(t,o),n.tag=1,n=Hm(null,n,t,o,l)):(n.tag=0,n=Zd(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===F){n.tag=11,n=Om(null,n,t,o,l);break e}else if(f===Q){n.tag=14,n=zm(null,n,t,o,l);break e}}throw n=ye(t)||t,Error(r(306,n,""))}}return n;case 0:return Zd(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=dr(o,n.pendingProps),Hm(t,n,o,f,l);case 3:e:{if(Me(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,Cd(t,n),mo(n,o,null,l);var v=n.memoizedState;if(o=v.cache,vi(n,bt,o),o!==h.cache&&ba(n,[bt],l,!0),ho(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=$m(t,n,o,l);break e}else if(o!==f){f=Tn(Error(r(424)),n),Wi(f),n=$m(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=ui(t.firstChild),Yt=n,Pe=!0,Fi=null,An=!0,l=tt(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(xa(),o===f){n=Sa(t,n,l);break e}ln(t,n,o,l)}n=n.child}return n;case 26:return nc(t,n),t===null?(l=iy(n.type,null,n.pendingProps,null))?n.memoizedState=l:Pe||(l=n.type,t=n.pendingProps,o=bc(X.current).createElement(l),o[Pt]=n,o[Bt]=t,rn(o,l,t),At(o),n.stateNode=o):n.memoizedState=iy(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ct(n),t===null&&Pe&&(o=n.stateNode=ey(n.type,n.pendingProps,X.current),Yt=n,An=!0,f=mt,xl(n.type)?(Bf=f,mt=ui(o.firstChild)):mt=f),ln(t,n,n.pendingProps.children,l),nc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Pe&&((f=o=mt)&&(o=gk(o,n.type,n.pendingProps,An),o!==null?(n.stateNode=o,Yt=n,mt=ui(o.firstChild),An=!1,f=!0):f=!1),f||Pi(n)),Ct(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Of(f,h)?o=null:v!==null&&Of(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=Rd(t,n,_w,null,null,l),zo._currentValue=f),nc(t,n),ln(t,n,o,l),n.child;case 6:return t===null&&Pe&&((t=l=mt)&&(l=yk(l,n.pendingProps,An),l!==null?(n.stateNode=l,Yt=n,mt=null,t=!0):t=!1),t||Pi(n)),null;case 13:return Gm(t,n,l);case 4:return Me(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=ot(n,null,o,l):ln(t,n,o,l),n.child;case 11:return Om(t,n,n.type,n.pendingProps,l);case 7:return ln(t,n,n.pendingProps,l),n.child;case 8:return ln(t,n,n.pendingProps.children,l),n.child;case 12:return ln(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,vi(n,n.type,o.value),ln(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,va(n),f=Dt(f),o=o(f),n.flags|=1,ln(t,n,o,l),n.child;case 14:return zm(t,n,n.type,n.pendingProps,l);case 15:return Lm(t,n,n.type,n.pendingProps,l);case 19:return Fm(t,n,l);case 31:return Bw(t,n,l);case 22:return Im(t,n,l,n.pendingProps);case 24:return va(n),o=Dt(bt),t===null?(f=oo(),f===null&&(f=gt,h=so(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},ls(n),vi(n,bt,f)):((t.lanes&l)!==0&&(Cd(t,n),mo(n,null,null,l),ho()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),vi(n,bt,o)):(o=h.cache,vi(n,bt,o),o!==f.cache&&ba(n,[bt],l,!0))),ln(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ca(t){t.flags|=4}function sf(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(bg())t.flags|=8192;else throw k=ur,uo}else t.flags&=-16777217}function Ym(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!oy(n))if(bg())t.flags|=8192;else throw k=ur,uo}function ac(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?wt():536870912,t.lanes|=n,ps|=n)}function wo(t,n){if(!Pe)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 kt(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 Hw(t,n,l){var o=n.pendingProps;switch(no(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ri(bt),Ve(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Yi(n)?Ca(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,ao())),kt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(Ca(n),h!==null?(kt(n),Ym(n,h)):(kt(n),sf(n,f,null,o,l))):h?h!==t.memoizedState?(Ca(n),kt(n),Ym(n,h)):(kt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ca(n),kt(n),sf(n,f,t,o,l)),null;case 27:if(vt(n),l=X.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ca(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}t=W.current,Yi(n)?ir(n):(t=ey(f,o,l),n.stateNode=t,Ca(n))}return kt(n),null;case 5:if(vt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ca(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return kt(n),null}if(h=W.current,Yi(n))ir(n);else{var v=bc(X.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Pt]=n,h[Bt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(rn(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ca(n)}}return kt(n),sf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ca(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=X.current,Yi(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Pt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Gg(t.nodeValue,l)),t||Pi(n,!0)}else t=bc(t).createTextNode(o),t[Pt]=n,n.stateNode=t}return kt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=Yi(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Pt]=n}else xa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),t=!1}else l=ao(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Yn(n),n):(Yn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return kt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Yi(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Pt]=n}else xa(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),f=!1}else f=ao(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Yn(n),n):(Yn(n),null)}return Yn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),ac(n,n.updateQueue),kt(n),null);case 4:return Ve(),t===null&&Nf(n.stateNode.containerInfo),kt(n),null;case 10:return ri(n.type),kt(n),null;case 19:if(z(zt),o=n.memoizedState,o===null)return kt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)wo(o,!1);else{if(Rt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Fu(t),h!==null){for(n.flags|=128,wo(o,!1),t=h.updateQueue,n.updateQueue=t,ac(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)Lu(l,t),l=l.sibling;return C(zt,zt.current&1|2),Pe&&bi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Mt()>uc&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304)}else{if(!f)if(t=Fu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,ac(n,t),wo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Pe)return kt(n),null}else 2*Mt()-o.renderingStartTime>uc&&l!==536870912&&(n.flags|=128,f=!0,wo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Mt(),t.sibling=null,l=zt.current,C(zt,f?l&1|2:l&1),Pe&&bi(n,o.treeForkCount),t):(kt(n),null);case 22:case 23:return Yn(n),Nd(),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&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),l=n.updateQueue,l!==null&&ac(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z(wa),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),ri(bt),kt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function $w(t,n){switch(no(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ri(bt),Ve(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return vt(n),null;case 31:if(n.memoizedState!==null){if(Yn(n),n.alternate===null)throw Error(r(340));xa()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Yn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));xa()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(zt),null;case 4:return Ve(),null;case 10:return ri(n.type),null;case 22:case 23:return Yn(n),Nd(),t!==null&&z(wa),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ri(bt),null;case 25:return null;default:return null}}function Wm(t,n){switch(no(n),n.tag){case 3:ri(bt),Ve();break;case 26:case 27:case 5:vt(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&Yn(n);break;case 13:Yn(n);break;case 19:z(zt);break;case 10:ri(n.type);break;case 22:case 23:Yn(n),Nd(),t!==null&&z(wa);break;case 24:ri(bt)}}function ko(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(E){ct(n,n.return,E)}}function dl(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,f=n;var I=l,Y=E;try{Y()}catch(ne){ct(f,I,ne)}}}o=o.next}while(o!==h)}}catch(ne){ct(n,n.return,ne)}}function Km(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{Bh(n,l)}catch(o){ct(t,t.return,o)}}}function Xm(t,n,l){l.props=dr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ct(t,n,o)}}function jo(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 Xi(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 Qm(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 of(t,n,l){try{var o=t.stateNode;ck(o,t.type,l,n),o[Bt]=n}catch(f){ct(t,t.return,f)}}function Zm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xl(t.type)||t.tag===4}function uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Zm(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&&xl(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 cf(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=Xt));else if(o!==4&&(o===27&&xl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(cf(t,n,l),t=t.sibling;t!==null;)cf(t,n,l),t=t.sibling}function lc(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&&xl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(lc(t,n,l),t=t.sibling;t!==null;)lc(t,n,l),t=t.sibling}function Jm(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);rn(n,o,l),n[Pt]=t,n[Bt]=l}catch(h){ct(t,t.return,h)}}var Ta=!1,$t=!1,df=!1,eg=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Gw(t,n){if(t=t.containerInfo,Rf=Tc,t=Kr(t),Ql(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,E=-1,I=-1,Y=0,ne=0,se=t,K=null;t:for(;;){for(var J;se!==l||f!==0&&se.nodeType!==3||(E=v+f),se!==h||o!==0&&se.nodeType!==3||(I=v+o),se.nodeType===3&&(v+=se.nodeValue.length),(J=se.firstChild)!==null;)K=se,se=J;for(;;){if(se===t)break t;if(K===l&&++Y===f&&(E=v),K===h&&++ne===o&&(I=v),(J=se.nextSibling)!==null)break;se=K,K=se.parentNode}se=J}l=E===-1||I===-1?null:{start:E,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Mf={focusedElem:t,selectionRange:l},Tc=!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,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var je=dr(l.type,f);t=o.getSnapshotBeforeUpdate(je,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){ct(l,l.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Lf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Lf(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 tg(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Aa(t,l),o&4&&ko(5,l);break;case 1:if(Aa(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(l,l.return,v)}else{var f=dr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(l,l.return,v)}}o&64&&Km(l),o&512&&jo(l,l.return);break;case 3:if(Aa(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{Bh(t,n)}catch(v){ct(l,l.return,v)}}break;case 27:n===null&&o&4&&Jm(l);case 26:case 5:Aa(t,l),n===null&&o&4&&Qm(l),o&512&&jo(l,l.return);break;case 12:Aa(t,l);break;case 31:Aa(t,l),o&4&&ag(t,l);break;case 13:Aa(t,l),o&4&&lg(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Zw.bind(null,l),xk(t,l))));break;case 22:if(o=l.memoizedState!==null||Ta,!o){n=n!==null&&n.memoizedState!==null||$t,f=Ta;var h=$t;Ta=o,($t=n)&&!h?Na(t,l,(l.subtreeFlags&8772)!==0):Aa(t,l),Ta=f,$t=h}break;case 30:break;default:Aa(t,l)}}function ng(t){var n=t.alternate;n!==null&&(t.alternate=null,ng(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Os(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 St=null,Dn=!1;function Ea(t,n,l){for(l=l.child;l!==null;)ig(t,n,l),l=l.sibling}function ig(t,n,l){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ft,l)}catch{}switch(l.tag){case 26:$t||Xi(l,n),Ea(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$t||Xi(l,n);var o=St,f=Dn;xl(l.type)&&(St=l.stateNode,Dn=!1),Ea(t,n,l),Ro(l.stateNode),St=o,Dn=f;break;case 5:$t||Xi(l,n);case 6:if(o=St,f=Dn,St=null,Ea(t,n,l),St=o,Dn=f,St!==null)if(Dn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(l.stateNode)}catch(h){ct(l,n,h)}else try{St.removeChild(l.stateNode)}catch(h){ct(l,n,h)}break;case 18:St!==null&&(Dn?(t=St,Kg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),ws(t)):Kg(St,l.stateNode));break;case 4:o=St,f=Dn,St=l.stateNode.containerInfo,Dn=!0,Ea(t,n,l),St=o,Dn=f;break;case 0:case 11:case 14:case 15:dl(2,l,n),$t||dl(4,l,n),Ea(t,n,l);break;case 1:$t||(Xi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Xm(l,n,o)),Ea(t,n,l);break;case 21:Ea(t,n,l);break;case 22:$t=(o=$t)||l.memoizedState!==null,Ea(t,n,l),$t=o;break;default:Ea(t,n,l)}}function ag(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ws(t)}catch(l){ct(n,n.return,l)}}}function lg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ws(t)}catch(l){ct(n,n.return,l)}}function Vw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new eg),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new eg),n;default:throw Error(r(435,t.tag))}}function rc(t,n){var l=Vw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Jw.bind(null,t,o);o.then(f,f)}})}function _n(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(xl(E.type)){St=E.stateNode,Dn=!1;break e}break;case 5:St=E.stateNode,Dn=!1;break e;case 3:case 4:St=E.stateNode.containerInfo,Dn=!0;break e}E=E.return}if(St===null)throw Error(r(160));ig(h,v,f),St=null,Dn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)rg(n,t),n=n.sibling}var wi=null;function rg(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_n(n,t),Rn(t),o&4&&(dl(3,t,t.return),ko(3,t),dl(5,t,t.return));break;case 1:_n(n,t),Rn(t),o&512&&($t||l===null||Xi(l,l.return)),o&64&&Ta&&(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=wi;if(_n(n,t),Rn(t),o&512&&($t||l===null||Xi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Ai]||h[Pt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),rn(h,o,l),h[Pt]=t,At(h),o=h;break e;case"link":var v=ry("link","href",f).get(o+(l.href||""));if(v){for(var E=0;E<v.length;E++)if(h=v[E],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(E,1);break t}}h=f.createElement(o),rn(h,o,l),f.head.appendChild(h);break;case"meta":if(v=ry("meta","content",f).get(o+(l.content||""))){for(E=0;E<v.length;E++)if(h=v[E],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(E,1);break t}}h=f.createElement(o),rn(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Pt]=t,At(h),o=h}t.stateNode=o}else sy(f,t.type,t.stateNode);else t.stateNode=ly(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?sy(f,t.type,t.stateNode):ly(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&of(t,t.memoizedProps,l.memoizedProps)}break;case 27:_n(n,t),Rn(t),o&512&&($t||l===null||Xi(l,l.return)),l!==null&&o&4&&of(t,t.memoizedProps,l.memoizedProps);break;case 5:if(_n(n,t),Rn(t),o&512&&($t||l===null||Xi(l,l.return)),t.flags&32){f=t.stateNode;try{Va(f,"")}catch(je){ct(t,t.return,je)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,of(t,f,l!==null?l.memoizedProps:f)),o&1024&&(df=!0);break;case 6:if(_n(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(je){ct(t,t.return,je)}}break;case 3:if(kc=null,f=wi,wi=vc(n.containerInfo),_n(n,t),wi=f,Rn(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{ws(n.containerInfo)}catch(je){ct(t,t.return,je)}df&&(df=!1,sg(t));break;case 4:o=wi,wi=vc(t.stateNode.containerInfo),_n(n,t),Rn(t),wi=o;break;case 12:_n(n,t),Rn(t);break;case 31:_n(n,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 13:_n(n,t),Rn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(oc=Mt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,Y=Ta,ne=$t;if(Ta=Y||f,$t=ne||I,_n(n,t),$t=ne,Ta=Y,Rn(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||I||Ta||$t||fr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){I=l=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=I.stateNode;var se=I.memoizedProps.style,K=se!=null&&se.hasOwnProperty("display")?se.display:null;E.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(je){ct(I,I.return,je)}}}else if(n.tag===6){if(l===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(je){ct(I,I.return,je)}}}else if(n.tag===18){if(l===null){I=n;try{var J=I.stateNode;f?Xg(J,!0):Xg(I.stateNode,!1)}catch(je){ct(I,I.return,je)}}}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,rc(t,l))));break;case 19:_n(n,t),Rn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,rc(t,o)));break;case 30:break;case 21:break;default:_n(n,t),Rn(t)}}function Rn(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(Zm(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=uf(t);lc(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(Va(v,""),l.flags&=-33);var E=uf(t);lc(t,E,v);break;case 3:case 4:var I=l.stateNode.containerInfo,Y=uf(t);cf(t,Y,I);break;default:throw Error(r(161))}}catch(ne){ct(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function sg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;sg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Aa(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)tg(t,n.alternate,n),n=n.sibling}function fr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:dl(4,n,n.return),fr(n);break;case 1:Xi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Xm(n,n.return,l),fr(n);break;case 27:Ro(n.stateNode);case 26:case 5:Xi(n,n.return),fr(n);break;case 22:n.memoizedState===null&&fr(n);break;case 30:fr(n);break;default:fr(n)}t=t.sibling}}function Na(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:Na(f,h,l),ko(4,h);break;case 1:if(Na(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){ct(o,o.return,Y)}if(o=h,f=o.updateQueue,f!==null){var E=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Uh(I[f],E)}catch(Y){ct(o,o.return,Y)}}l&&v&64&&Km(h),jo(h,h.return);break;case 27:Jm(h);case 26:case 5:Na(f,h,l),l&&o===null&&v&4&&Qm(h),jo(h,h.return);break;case 12:Na(f,h,l);break;case 31:Na(f,h,l),l&&v&4&&ag(f,h);break;case 13:Na(f,h,l),l&&v&4&&lg(f,h);break;case 22:h.memoizedState===null&&Na(f,h,l),jo(h,h.return);break;case 30:break;default:Na(f,h,l)}n=n.sibling}}function ff(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&&rr(l))}function pf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&rr(t))}function ki(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)og(t,n,l,o),n=n.sibling}function og(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ki(t,n,l,o),f&2048&&ko(9,n);break;case 1:ki(t,n,l,o);break;case 3:ki(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&&rr(t)));break;case 12:if(f&2048){ki(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,E=h.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ct(n,n.return,I)}}else ki(t,n,l,o);break;case 31:ki(t,n,l,o);break;case 13:ki(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?ki(t,n,l,o):So(t,n):h._visibility&2?ki(t,n,l,o):(h._visibility|=2,cs(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&ff(v,n);break;case 24:ki(t,n,l,o),f&2048&&pf(n.alternate,n);break;default:ki(t,n,l,o)}}function cs(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,E=l,I=o,Y=v.flags;switch(v.tag){case 0:case 11:case 15:cs(h,v,E,I,f),ko(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?cs(h,v,E,I,f):So(h,v):(ne._visibility|=2,cs(h,v,E,I,f)),f&&Y&2048&&ff(v.alternate,v);break;case 24:cs(h,v,E,I,f),f&&Y&2048&&pf(v.alternate,v);break;default:cs(h,v,E,I,f)}n=n.sibling}}function So(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:So(l,o),f&2048&&ff(o.alternate,o);break;case 24:So(l,o),f&2048&&pf(o.alternate,o);break;default:So(l,o)}n=n.sibling}}var Co=8192;function ds(t,n,l){if(t.subtreeFlags&Co)for(t=t.child;t!==null;)ug(t,n,l),t=t.sibling}function ug(t,n,l){switch(t.tag){case 26:ds(t,n,l),t.flags&Co&&t.memoizedState!==null&&Dk(l,wi,t.memoizedState,t.memoizedProps);break;case 5:ds(t,n,l);break;case 3:case 4:var o=wi;wi=vc(t.stateNode.containerInfo),ds(t,n,l),wi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Co,Co=16777216,ds(t,n,l),Co=o):ds(t,n,l));break;default:ds(t,n,l)}}function cg(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 To(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,fg(o,t)}cg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)dg(t),t=t.sibling}function dg(t){switch(t.tag){case 0:case 11:case 15:To(t),t.flags&2048&&dl(9,t,t.return);break;case 3:To(t);break;case 12:To(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,sc(t)):To(t);break;default:To(t)}}function sc(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,fg(o,t)}cg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:dl(8,n,n.return),sc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,sc(n));break;default:sc(n)}t=t.sibling}}function fg(t,n){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:dl(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:rr(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,h=o.return;if(ng(o),o===l){Zt=null;break e}if(f!==null){f.return=h,Zt=f;break e}Zt=h}}}var Fw={getCacheForType:function(t){var n=Dt(bt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Dt(bt).controller.signal}},Pw=typeof WeakMap=="function"?WeakMap:Map,rt=0,gt=null,Ye=null,Qe=0,ut=0,Wn=null,fl=!1,fs=!1,hf=!1,Da=0,Rt=0,pl=0,pr=0,mf=0,Kn=0,ps=0,Eo=null,Mn=null,gf=!1,oc=0,pg=0,uc=1/0,cc=null,hl=null,Wt=0,ml=null,hs=null,_a=0,yf=0,xf=null,hg=null,Ao=0,bf=null;function Xn(){return(rt&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?Cf():Ms()}function mg(){if(Kn===0)if((Qe&536870912)===0||Pe){var t=Er;Er<<=1,(Er&3932160)===0&&(Er=262144),Kn=t}else Kn=536870912;return t=Pn.current,t!==null&&(t.flags|=32),Kn}function On(t,n,l){(t===gt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(ms(t,0),gl(t,Qe,Kn,!1)),Ba(t,l),((rt&2)===0||t!==gt)&&(t===gt&&((rt&2)===0&&(pr|=l),Rt===4&&gl(t,Qe,Kn,!1)),Qi(t))}function gg(t,n,l){if((rt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||en(t,n),f=o?Kw(t,n):wf(t,n,!0),h=o;do{if(f===0){fs&&!o&&gl(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Yw(l)){f=wf(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var E=t;f=Eo;var I=E.current.memoizedState.isDehydrated;if(I&&(ms(E,v).flags|=256),v=wf(E,v,!1),v!==2){if(hf&&!I){E.errorRecoveryDisabledLanes|=h,pr|=h,f=4;break e}h=Mn,Mn=f,h!==null&&(Mn===null?Mn=h:Mn.push.apply(Mn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){ms(t,0),gl(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:gl(o,n,Kn,!fl);break e;case 2:Mn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=oc+300-Mt(),10<f)){if(gl(o,n,Kn,!fl),Ia(o,0,!0)!==0)break e;_a=n,o.timeoutHandle=Yg(yg.bind(null,o,l,Mn,cc,gf,n,Kn,pr,ps,fl,h,"Throttled",-0,0),f);break e}yg(o,l,Mn,cc,gf,n,Kn,pr,ps,fl,h,null,-0,0)}}break}while(!0);Qi(t)}function yg(t,n,l,o,f,h,v,E,I,Y,ne,se,K,J){if(t.timeoutHandle=-1,se=n.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},ug(n,h,se);var je=(h&62914560)===h?oc-Mt():(h&4194048)===h?pg-Mt():0;if(je=_k(se,je),je!==null){_a=h,t.cancelPendingCommit=je(Cg.bind(null,t,n,h,l,o,f,v,E,I,ne,se,null,K,J)),gl(t,h,v,!Y);return}}Cg(t,n,h,l,o,f,v,E,I)}function Yw(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!cn(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function gl(t,n,l,o){n&=~mf,n&=~pr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-st(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&_s(t,l,n)}function dc(){return(rt&6)===0?(No(0),!1):!0}function vf(){if(Ye!==null){if(ut===0)var t=Ye.return;else t=Ye,Vn=Nn=null,zd(t),U=null,Z=0,t=Ye;for(;t!==null;)Wm(t.alternate,t),t=t.return;Ye=null}}function ms(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,pk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),_a=0,vf(),gt=t,Ye=l=xi(t.current,null),Qe=n,ut=0,Wn=null,fl=!1,fs=en(t,n),hf=!1,ps=Kn=mf=pr=pl=Rt=0,Mn=Eo=null,gf=!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),h=1<<f;n|=t[f],o&=~h}return Da=n,Zr(),l}function xg(t,n){qe=null,V.H=bo,n===rl||n===or?(n=S(),ut=3):n===uo?(n=S(),ut=4):ut=n===Qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Wn=n,Ye===null&&(Rt=1,ec(t,Tn(n,t.current)))}function bg(){var t=Pn.current;return t===null?!0:(Qe&4194048)===Qe?oi===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===oi:!1}function vg(){var t=V.H;return V.H=bo,t===null?bo:t}function wg(){var t=V.A;return V.A=Fw,t}function fc(){Rt=4,fl||(Qe&4194048)!==Qe&&Pn.current!==null||(fs=!0),(pl&134217727)===0&&(pr&134217727)===0||gt===null||gl(gt,Qe,Kn,!1)}function wf(t,n,l){var o=rt;rt|=2;var f=vg(),h=wg();(gt!==t||Qe!==n)&&(cc=null,ms(t,n)),n=!1;var v=Rt;e:do try{if(ut!==0&&Ye!==null){var E=Ye,I=Wn;switch(ut){case 8:vf(),v=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(n=!0);var Y=ut;if(ut=0,Wn=null,gs(t,E,I,Y),l&&fs){v=0;break e}break;default:Y=ut,ut=0,Wn=null,gs(t,E,I,Y)}}Ww(),v=Rt;break}catch(ne){xg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,Vn=Nn=null,rt=o,V.H=f,V.A=h,Ye===null&&(gt=null,Qe=0,Zr()),v}function Ww(){for(;Ye!==null;)kg(Ye)}function Kw(t,n){var l=rt;rt|=2;var o=vg(),f=wg();gt!==t||Qe!==n?(cc=null,uc=Mt()+500,ms(t,n)):fs=en(t,n);e:do try{if(ut!==0&&Ye!==null){n=Ye;var h=Wn;t:switch(ut){case 1:ut=0,Wn=null,gs(t,n,h,1);break;case 2:case 9:if(co(h)){ut=0,Wn=null,jg(n);break}n=function(){ut!==2&&ut!==9||gt!==t||(ut=7),Qi(t)},h.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:co(h)?(ut=0,Wn=null,jg(n)):(ut=0,Wn=null,gs(t,n,h,7));break;case 5:var v=null;switch(Ye.tag){case 26:v=Ye.memoizedState;case 5:case 27:var E=Ye;if(v?oy(v):E.stateNode.complete){ut=0,Wn=null;var I=E.sibling;if(I!==null)Ye=I;else{var Y=E.return;Y!==null?(Ye=Y,pc(Y)):Ye=null}break t}}ut=0,Wn=null,gs(t,n,h,5);break;case 6:ut=0,Wn=null,gs(t,n,h,6);break;case 8:vf(),Rt=6;break e;default:throw Error(r(462))}}Xw();break}catch(ne){xg(t,ne)}while(!0);return Vn=Nn=null,V.H=o,V.A=f,rt=l,Ye!==null?0:(gt=null,Qe=0,Zr(),Rt)}function Xw(){for(;Ye!==null&&!Jn();)kg(Ye)}function kg(t){var n=Pm(t.alternate,t,Da);t.memoizedProps=t.pendingProps,n===null?pc(t):Ye=n}function jg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=qm(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=qm(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:zd(n);default:Wm(l,n),n=Ye=Lu(n,Da),n=Pm(l,n,Da)}t.memoizedProps=t.pendingProps,n===null?pc(t):Ye=n}function gs(t,n,l,o){Vn=Nn=null,zd(n),U=null,Z=0;var f=n.return;try{if(Uw(t,f,n,l,Qe)){Rt=1,ec(t,Tn(l,t.current)),Ye=null;return}}catch(h){if(f!==null)throw Ye=f,h;Rt=1,ec(t,Tn(l,t.current)),Ye=null;return}n.flags&32768?(Pe||o===1?t=!0:fs||(Qe&536870912)!==0?t=!1:(fl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Pn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Sg(n,t)):pc(n)}function pc(t){var n=t;do{if((n.flags&32768)!==0){Sg(n,fl);return}t=n.return;var l=Hw(n.alternate,n,Da);if(l!==null){Ye=l;return}if(n=n.sibling,n!==null){Ye=n;return}Ye=n=t}while(n!==null);Rt===0&&(Rt=5)}function Sg(t,n){do{var l=$w(t.alternate,t);if(l!==null){l.flags&=32767,Ye=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=l}while(t!==null);Rt=6,Ye=null}function Cg(t,n,l,o,f,h,v,E,I){t.cancelPendingCommit=null;do hc();while(Wt!==0);if((rt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Xs,_l(t,l,h,v,E,I),t===gt&&(Ye=gt=null,Qe=0),hs=n,ml=t,_a=l,yf=h,xf=f,hg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ek(Ee,function(){return Dg(),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{Gw(t,n,l)}finally{rt=v,oe.p=f,V.T=o}}Wt=1,Tg(),Eg(),Ag()}}function Tg(){if(Wt===1){Wt=0;var t=ml,n=hs,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{rg(n,t);var h=Mf,v=Kr(t.containerInfo),E=h.focusedElem,I=h.selectionRange;if(v!==E&&E&&E.ownerDocument&&Xl(E.ownerDocument.documentElement,E)){if(I!==null&&Ql(E)){var Y=I.start,ne=I.end;if(ne===void 0&&(ne=Y),"selectionStart"in E)E.selectionStart=Y,E.selectionEnd=Math.min(ne,E.value.length);else{var se=E.ownerDocument||document,K=se&&se.defaultView||window;if(K.getSelection){var J=K.getSelection(),je=E.textContent.length,ze=Math.min(I.start,je),ht=I.end===void 0?ze:Math.min(I.end,je);!J.extend&&ze>ht&&(v=ht,ht=ze,ze=v);var G=Nu(E,ze),B=Nu(E,ht);if(G&&B&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==B.node||J.focusOffset!==B.offset)){var P=se.createRange();P.setStart(G.node,G.offset),J.removeAllRanges(),ze>ht?(J.addRange(P),J.extend(B.node,B.offset)):(P.setEnd(B.node,B.offset),J.addRange(P))}}}}for(se=[],J=E;J=J.parentNode;)J.nodeType===1&&se.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<se.length;E++){var le=se[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Tc=!!Rf,Mf=Rf=null}finally{rt=f,oe.p=o,V.T=l}}t.current=n,Wt=2}}function Eg(){if(Wt===2){Wt=0;var t=ml,n=hs,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{tg(t,n.alternate,n)}finally{rt=f,oe.p=o,V.T=l}}Wt=3}}function Ag(){if(Wt===4||Wt===3){Wt=0,za();var t=ml,n=hs,l=_a,o=hg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,hs=ml=null,Ng(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(hl=null),Rs(l),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ft,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=oe.p,oe.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var E=o[v];h(E.value,{componentStack:E.stack})}}finally{V.T=n,oe.p=f}}(_a&3)!==0&&hc(),Qi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===bf?Ao++:(Ao=0,bf=t):Ao=0,No(0)}}function Ng(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,rr(n)))}function hc(){return Tg(),Eg(),Ag(),Dg()}function Dg(){if(Wt!==5)return!1;var t=ml,n=yf;yf=0;var l=Rs(_a),o=V.T,f=oe.p;try{oe.p=32>l?32:l,V.T=null,l=xf,xf=null;var h=ml,v=_a;if(Wt=0,hs=ml=null,_a=0,(rt&6)!==0)throw Error(r(331));var E=rt;if(rt|=4,dg(h.current),og(h,h.current,v,l),rt=E,No(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ft,h)}catch{}return!0}finally{oe.p=f,V.T=o,Ng(t,n)}}function _g(t,n,l){n=Tn(l,n),n=Xd(t.stateNode,n,2),t=ol(t,n,2),t!==null&&(Ba(t,2),Qi(t))}function ct(t,n,l){if(t.tag===3)_g(t,t,l);else for(;n!==null;){if(n.tag===3){_g(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(hl===null||!hl.has(o))){t=Tn(l,t),l=Rm(2),o=ol(n,l,2),o!==null&&(Mm(l,o,n,t),Ba(o,2),Qi(o));break}}n=n.return}}function kf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Pw;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)||(hf=!0,f.add(l),t=Qw.bind(null,t,n,l),n.then(t,t))}function Qw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,gt===t&&(Qe&l)===l&&(Rt===4||Rt===3&&(Qe&62914560)===Qe&&300>Mt()-oc?(rt&2)===0&&ms(t,0):mf|=l,ps===Qe&&(ps=0)),Qi(t)}function Rg(t,n){n===0&&(n=wt()),t=Gi(t,n),t!==null&&(Ba(t,n),Qi(t))}function Zw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Rg(t,l)}function Jw(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),Rg(t,l)}function ek(t,n){return Kt(t,n)}var mc=null,ys=null,jf=!1,gc=!1,Sf=!1,yl=0;function Qi(t){t!==ys&&t.next===null&&(ys===null?mc=ys=t:ys=ys.next=t),gc=!0,jf||(jf=!0,nk())}function No(t,n){if(!Sf&&gc){Sf=!0;do for(var l=!1,o=mc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-st(42|t)+1)-1,h&=f&~(v&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,Lg(o,h))}else h=Qe,h=Ia(o,o===gt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||en(o,h)||(l=!0,Lg(o,h));o=o.next}while(l);Sf=!1}}function tk(){Mg()}function Mg(){gc=jf=!1;var t=0;yl!==0&&fk()&&(t=yl);for(var n=Mt(),l=null,o=mc;o!==null;){var f=o.next,h=Og(o,n);h===0?(o.next=null,l===null?mc=f:l.next=f,f===null&&(ys=l)):(l=o,(t!==0||(h&3)!==0)&&(gc=!0)),o=f}Wt!==0&&Wt!==5||No(t),yl!==0&&(yl=0)}function Og(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-st(h),E=1<<v,I=f[v];I===-1?((E&l)===0||(E&o)!==0)&&(f[v]=Ua(E,n)):I<=n&&(t.expiredLanes|=E),h&=~E}if(n=gt,l=Qe,l=Ia(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&&Si(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||en(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&Si(o),Rs(l)){case 2:case 8:l=ce;break;case 32:l=Ee;break;case 268435456:l=Xe;break;default:l=Ee}return o=zg.bind(null,t),l=Kt(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&Si(o),t.callbackPriority=2,t.callbackNode=null,2}function zg(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(hc()&&t.callbackNode!==l)return null;var o=Qe;return o=Ia(t,t===gt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(gg(t,o,n),Og(t,Mt()),t.callbackNode!=null&&t.callbackNode===l?zg.bind(null,t):null)}function Lg(t,n){if(hc())return null;gg(t,n,!0)}function nk(){hk(function(){(rt&6)!==0?Kt(ae,tk):Mg()})}function Cf(){if(yl===0){var t=xn;t===0&&(t=Tr,Tr<<=1,(Tr&261888)===0&&(Tr=256)),yl=t}return yl}function Ig(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:gn(""+t)}function Ug(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 ik(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Ig((f[Bt]||null).action),v=o.submitter;v&&(n=(n=v[Bt]||null)?Ig(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var E=new Ya("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(yl!==0){var I=v?Ug(f,v):new FormData(f);Vd(l,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(E.preventDefault(),I=v?Ug(f,v):new FormData(f),Vd(l,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var Tf=0;Tf<Ks.length;Tf++){var Ef=Ks[Tf],ak=Ef.toLowerCase(),lk=Ef[0].toUpperCase()+Ef.slice(1);Hn(ak,"on"+lk)}Hn(_u,"onAnimationEnd"),Hn(Ru,"onAnimationIteration"),Hn(Mu,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(wd,"onTransitionRun"),Hn(kd,"onTransitionStart"),Hn(jd,"onTransitionCancel"),Hn(Ou,"onTransitionEnd"),_i("onMouseEnter",["mouseout","mouseover"]),_i("onMouseLeave",["mouseout","mouseover"]),_i("onPointerEnter",["pointerout","pointerover"]),_i("onPointerLeave",["pointerout","pointerover"]),un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),un("onBeforeInput",["compositionend","keypress","textInput","paste"]),un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),rk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Do));function Bg(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var E=o[v],I=E.instance,Y=E.currentTarget;if(E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=Y;try{h(f)}catch(ne){Qr(ne)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(E=o[v],I=E.instance,Y=E.currentTarget,E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=Y;try{h(f)}catch(ne){Qr(ne)}f.currentTarget=null,h=I}}}}function We(t,n){var l=n[Ei];l===void 0&&(l=n[Ei]=new Set);var o=t+"__bubble";l.has(o)||(qg(n,t,2,!1),l.add(o))}function Af(t,n,l){var o=0;n&&(o|=4),qg(l,t,o,n)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Nf(t){if(!t[yc]){t[yc]=!0,mu.forEach(function(l){l!=="selectionchange"&&(rk.has(l)||Af(l,!1,t),Af(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[yc]||(n[yc]=!0,Af("selectionchange",!1,n))}}function qg(t,n,l,o){switch(my(n)){case 2:var f=Ok;break;case 8:f=zk;break;default:f=Vf}l=f.bind(null,n,l,t),f=void 0,!Bs||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 Df(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var E=o.stateNode.containerInfo;if(E===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;E!==null;){if(v=ni(E),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}E=E.parentNode}}o=o.return}Us(function(){var Y=h,ne=la(l),se=[];e:{var K=zu.get(t);if(K!==void 0){var J=Ya,je=t;switch(t){case"keypress":if(Pa(l)===0)break e;case"keydown":case"keyup":J=ai;break;case"focusin":je="focus",J=Ui;break;case"focusout":je="blur",J=Ui;break;case"beforeblur":case"afterblur":J=Ui;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":J=Ka;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=Ir;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=at;break;case _u:case Ru:case Mu:J=Bi;break;case Ou:J=Hr;break;case"scroll":case"scrollend":J=Hs;break;case"wheel":J=Fl;break;case"copy":case"cut":case"paste":J=jn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=qr;break;case"toggle":case"beforetoggle":J=oa}var ze=(n&4)!==0,ht=!ze&&(t==="scroll"||t==="scrollend"),G=ze?K!==null?K+"Capture":null:K;ze=[];for(var B=Y,P;B!==null;){var le=B;if(P=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||P===null||G===null||(le=Ul(B,G),le!=null&&ze.push(_o(B,le,P))),ht)break;B=B.return}0<ze.length&&(K=new J(K,je,null,l,ne),se.push({event:K,listeners:ze}))}}if((n&7)===0){e:{if(K=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",K&&l!==Ll&&(je=l.relatedTarget||l.fromElement)&&(ni(je)||je[Un]))break e;if((J||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,J?(je=l.relatedTarget||l.toElement,J=Y,je=je?ni(je):null,je!==null&&(ht=c(je),ze=je.tag,je!==ht||ze!==5&&ze!==27&&ze!==6)&&(je=null)):(J=null,je=Y),J!==je)){if(ze=Ka,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(ze=qr,le="onPointerLeave",G="onPointerEnter",B="pointer"),ht=J==null?K:ia(J),P=je==null?K:ia(je),K=new ze(le,B+"leave",J,l,ne),K.target=ht,K.relatedTarget=P,le=null,ni(ne)===Y&&(ze=new ze(G,B+"enter",je,l,ne),ze.target=P,ze.relatedTarget=ht,le=ze),ht=le,J&&je)t:{for(ze=sk,G=J,B=je,P=0,le=G;le;le=ze(le))P++;le=0;for(var _e=B;_e;_e=ze(_e))le++;for(;0<P-le;)G=ze(G),P--;for(;0<le-P;)B=ze(B),le--;for(;P--;){if(G===B||B!==null&&G===B.alternate){ze=G;break t}G=ze(G),B=ze(B)}ze=null}else ze=null;J!==null&&Hg(se,K,J,ze,!1),je!==null&&ht!==null&&Hg(se,ht,je,ze,!0)}}e:{if(K=Y?ia(Y):window,J=K.nodeName&&K.nodeName.toLowerCase(),J==="select"||J==="input"&&K.type==="file")var nt=we;else if(Cu(K))if(Kl)nt=Wr;else{nt=yd;var Ae=an}else J=K.nodeName,!J||J.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Y&&zl(Y.elementType)&&(nt=we):nt=xd;if(nt&&(nt=nt(t,Y))){Tu(se,nt,l,ne);break e}Ae&&Ae(t,K,Y),t==="focusout"&&Y&&K.type==="number"&&Y.memoizedProps.value!=null&&Dr(K,"number",K.value)}switch(Ae=Y?ia(Y):window,t){case"focusin":(Cu(Ae)||Ae.contentEditable==="true")&&($i=Ae,Ys=Y,Zl=null);break;case"focusout":Zl=Ys=$i=null;break;case"mousedown":Jl=!0;break;case"contextmenu":case"mouseup":case"dragend":Jl=!1,Ws(se,l,ne);break;case"selectionchange":if(vd)break;case"keydown":case"keyup":Ws(se,l,ne)}var Ge;if(Fs)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 qi?Su(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&($r&&l.locale!=="ko"&&(qi||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&qi&&(Ge=qs()):(Li=ne,Or="value"in Li?Li.value:Li.textContent,qi=!0)),Ae=xc(Y,Ze),0<Ae.length&&(Ze=new Za(Ze,t,null,l,ne),se.push({event:Ze,listeners:Ae}),Ge?Ze.data=Ge:(Ge=Ps(l),Ge!==null&&(Ze.data=Ge)))),(Ge=ju?Vr(t,l):gd(t,l))&&(Ze=xc(Y,"onBeforeInput"),0<Ze.length&&(Ae=new Za("onBeforeInput","beforeinput",null,l,ne),se.push({event:Ae,listeners:Ze}),Ae.data=Ge)),ik(se,t,Y,l,ne)}Bg(se,n)})}function _o(t,n,l){return{instance:t,listener:n,currentTarget:l}}function xc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Ul(t,l),f!=null&&o.unshift(_o(t,f,h)),f=Ul(t,n),f!=null&&o.push(_o(t,f,h))),t.tag===3)return o;t=t.return}return[]}function sk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Hg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var E=l,I=E.alternate,Y=E.stateNode;if(E=E.tag,I!==null&&I===o)break;E!==5&&E!==26&&E!==27||Y===null||(I=Y,f?(Y=Ul(l,h),Y!=null&&v.unshift(_o(l,Y,I))):f||(Y=Ul(l,h),Y!=null&&v.push(_o(l,Y,I)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var ok=/\r\n?/g,uk=/\u0000|\uFFFD/g;function $g(t){return(typeof t=="string"?t:""+t).replace(ok,`
50
+ `).replace(uk,"")}function Gg(t,n){return n=$g(n),$g(t)===n}function pt(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Va(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Va(t,""+o);break;case"className":Ml(t,"class",o);break;case"tabIndex":Ml(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ml(t,l,o);break;case"style":Rr(t,o,h);break;case"data":if(n!=="object"){Ml(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=gn(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof h=="function"&&(l==="formAction"?(n!=="input"&&pt(t,n,"name",f.name,f,null),pt(t,n,"formEncType",f.formEncType,f,null),pt(t,n,"formMethod",f.formMethod,f,null),pt(t,n,"formTarget",f.formTarget,f,null)):(pt(t,n,"encType",f.encType,f,null),pt(t,n,"method",f.method,f,null),pt(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=gn(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Xt);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=gn(""+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),Rl(t,"popover",o);break;case"xlinkActuate":pi(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":pi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":pi(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":pi(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":pi(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":pi(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":pi(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":pi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":pi(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Rl(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=vu.get(l)||l,Rl(t,l,o))}}function _f(t,n,l,o,f,h){switch(l){case"style":Rr(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?Va(t,o):(typeof o=="number"||typeof o=="bigint")&&Va(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=Xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zs.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[Bt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):Rl(t,l,o)}}}function rn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",t),We("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,h,v,l,null)}}f&&pt(t,n,"srcSet",l.srcSet,l,null),o&&pt(t,n,"src",l.src,l,null);return;case"input":We("invalid",t);var E=h=v=f=null,I=null,Y=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":I=ne;break;case"defaultChecked":Y=ne;break;case"value":h=ne;break;case"defaultValue":E=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:pt(t,n,o,ne,l,null)}}Mi(t,h,E,I,Y,v,f,!1);return;case"select":We("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(E=l[f],E!=null))switch(f){case"value":h=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:pt(t,n,f,E,l,null)}n=h,l=v,t.multiple=!!o,n!=null?ii(t,!!o,n,!1):l!=null&&ii(t,!!o,l,!0);return;case"textarea":We("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(E=l[v],E!=null))switch(v){case"value":o=E;break;case"defaultValue":f=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:pt(t,n,v,E,l,null)}Ol(t,o,f,h);return;case"option":for(I in l)if(l.hasOwnProperty(I)&&(o=l[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:pt(t,n,I,o,l,null)}return;case"dialog":We("beforetoggle",t),We("toggle",t),We("cancel",t),We("close",t);break;case"iframe":case"object":We("load",t);break;case"video":case"audio":for(o=0;o<Do.length;o++)We(Do[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(Y in l)if(l.hasOwnProperty(Y)&&(o=l[Y],o!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,Y,o,l,null)}return;default:if(zl(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&_f(t,n,ne,o,l,void 0));return}}for(E in l)l.hasOwnProperty(E)&&(o=l[E],o!=null&&pt(t,n,E,o,l,null))}function ck(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,E=null,I=null,Y=null,ne=null;for(J in l){var se=l[J];if(l.hasOwnProperty(J)&&se!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":I=se;default:o.hasOwnProperty(J)||pt(t,n,J,null,o,se)}}for(var K in o){var J=o[K];if(se=l[K],o.hasOwnProperty(K)&&(J!=null||se!=null))switch(K){case"type":h=J;break;case"name":f=J;break;case"checked":Y=J;break;case"defaultChecked":ne=J;break;case"value":v=J;break;case"defaultValue":E=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:J!==se&&pt(t,n,K,J,o,se)}}Bn(t,v,E,I,Y,ne,h,f);return;case"select":J=v=E=K=null;for(h in l)if(I=l[h],l.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":J=I;default:o.hasOwnProperty(h)||pt(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=l[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":K=h;break;case"defaultValue":E=h;break;case"multiple":v=h;default:h!==I&&pt(t,n,f,h,o,I)}n=E,l=v,o=J,K!=null?ii(t,!!l,K,!1):!!o!=!!l&&(n!=null?ii(t,!!l,n,!0):ii(t,!!l,l?[]:"",!1));return;case"textarea":J=K=null;for(E in l)if(f=l[E],l.hasOwnProperty(E)&&f!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:pt(t,n,E,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":K=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&pt(t,n,v,f,o,h)}Is(t,K,J);return;case"option":for(var je in l)if(K=l[je],l.hasOwnProperty(je)&&K!=null&&!o.hasOwnProperty(je))switch(je){case"selected":t.selected=!1;break;default:pt(t,n,je,null,o,K)}for(I in o)if(K=o[I],J=l[I],o.hasOwnProperty(I)&&K!==J&&(K!=null||J!=null))switch(I){case"selected":t.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:pt(t,n,I,K,o,J)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in l)K=l[ze],l.hasOwnProperty(ze)&&K!=null&&!o.hasOwnProperty(ze)&&pt(t,n,ze,null,o,K);for(Y in o)if(K=o[Y],J=l[Y],o.hasOwnProperty(Y)&&K!==J&&(K!=null||J!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,n));break;default:pt(t,n,Y,K,o,J)}return;default:if(zl(n)){for(var ht in l)K=l[ht],l.hasOwnProperty(ht)&&K!==void 0&&!o.hasOwnProperty(ht)&&_f(t,n,ht,void 0,o,K);for(ne in o)K=o[ne],J=l[ne],!o.hasOwnProperty(ne)||K===J||K===void 0&&J===void 0||_f(t,n,ne,K,o,J);return}}for(var G in l)K=l[G],l.hasOwnProperty(G)&&K!=null&&!o.hasOwnProperty(G)&&pt(t,n,G,null,o,K);for(se in o)K=o[se],J=l[se],!o.hasOwnProperty(se)||K===J||K==null&&J==null||pt(t,n,se,K,o,J)}function Vg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dk(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,E=f.duration;if(h&&E&&Vg(v)){for(v=0,E=f.responseEnd,o+=1;o<l.length;o++){var I=l[o],Y=I.startTime;if(Y>E)break;var ne=I.transferSize,se=I.initiatorType;ne&&Vg(se)&&(I=I.responseEnd,v+=ne*(I<E?1:(E-Y)/(I-Y)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Rf=null,Mf=null;function bc(t){return t.nodeType===9?t:t.ownerDocument}function Fg(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 Pg(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 Of(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 zf=null;function fk(){var t=window.event;return t&&t.type==="popstate"?t===zf?!1:(zf=t,!0):(zf=null,!1)}var Yg=typeof setTimeout=="function"?setTimeout:void 0,pk=typeof clearTimeout=="function"?clearTimeout:void 0,Wg=typeof Promise=="function"?Promise:void 0,hk=typeof queueMicrotask=="function"?queueMicrotask:typeof Wg<"u"?function(t){return Wg.resolve(null).then(t).catch(mk)}:Yg;function mk(t){setTimeout(function(){throw t})}function xl(t){return t==="head"}function Kg(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),ws(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Ro(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Ro(l);for(var h=l.firstChild;h;){var v=h.nextSibling,E=h.nodeName;h[Ai]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&Ro(t.ownerDocument.body);l=f}while(l);ws(n)}function Xg(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 Lf(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":Lf(l),Os(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function gk(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[Ai])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=ui(t.nextSibling),t===null)break}return null}function yk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=ui(t.nextSibling),t===null))return null;return t}function Qg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ui(t.nextSibling),t===null))return null;return t}function If(t){return t.data==="$?"||t.data==="$~"}function Uf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function xk(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 ui(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 Bf=null;function Zg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return ui(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Jg(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 ey(t,n,l){switch(n=bc(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 Ro(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Os(t)}var ci=new Map,ty=new Set;function vc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ra=oe.d;oe.d={f:bk,r:vk,D:wk,C:kk,L:jk,m:Sk,X:Tk,S:Ck,M:Ek};function bk(){var t=Ra.f(),n=dc();return t||n}function vk(t){var n=Ni(t);n!==null&&n.tag===5&&n.type==="form"?xm(n):Ra.r(t)}var xs=typeof document>"u"?null:document;function ny(t,n,l){var o=xs;if(o&&typeof n=="string"&&n){var f=Nt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ty.has(f)||(ty.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),rn(n,"link",t),At(n),o.head.appendChild(n)))}}function wk(t){Ra.D(t),ny("dns-prefetch",t,null)}function kk(t,n){Ra.C(t,n),ny("preconnect",t,n)}function jk(t,n,l){Ra.L(t,n,l);var o=xs;if(o&&t&&n){var f='link[rel="preload"][as="'+Nt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Nt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Nt(l.imageSizes)+'"]')):f+='[href="'+Nt(t)+'"]';var h=f;switch(n){case"style":h=bs(t);break;case"script":h=vs(t)}ci.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),ci.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(Mo(h))||n==="script"&&o.querySelector(Oo(h))||(n=o.createElement("link"),rn(n,"link",t),At(n),o.head.appendChild(n)))}}function Sk(t,n){Ra.m(t,n);var l=xs;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Nt(o)+'"][href="'+Nt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=vs(t)}if(!ci.has(h)&&(t=x({rel:"modulepreload",href:t},n),ci.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Oo(h)))return}o=l.createElement("link"),rn(o,"link",t),At(o),l.head.appendChild(o)}}}function Ck(t,n,l){Ra.S(t,n,l);var o=xs;if(o&&t){var f=Di(o).hoistableStyles,h=bs(t);n=n||"default";var v=f.get(h);if(!v){var E={loading:0,preload:null};if(v=o.querySelector(Mo(h)))E.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=ci.get(h))&&qf(t,l);var I=v=o.createElement("link");At(I),rn(I,"link",t),I._p=new Promise(function(Y,ne){I.onload=Y,I.onerror=ne}),I.addEventListener("load",function(){E.loading|=1}),I.addEventListener("error",function(){E.loading|=2}),E.loading|=4,wc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},f.set(h,v)}}}function Tk(t,n){Ra.X(t,n);var l=xs;if(l&&t){var o=Di(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0},n),(n=ci.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),rn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Ek(t,n){Ra.M(t,n);var l=xs;if(l&&t){var o=Di(l).hoistableScripts,f=vs(t),h=o.get(f);h||(h=l.querySelector(Oo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=ci.get(f))&&Hf(t,n),h=l.createElement("script"),At(h),rn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function iy(t,n,l,o){var f=(f=X.current)?vc(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=bs(l.href),l=Di(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=bs(l.href);var h=Di(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(Mo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),ci.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},ci.set(t,l),h||Ak(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=vs(l),l=Di(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 bs(t){return'href="'+Nt(t)+'"'}function Mo(t){return'link[rel="stylesheet"]['+t+"]"}function ay(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Ak(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}),rn(n,"link",l),At(n),t.head.appendChild(n))}function vs(t){return'[src="'+Nt(t)+'"]'}function Oo(t){return"script[async]"+t}function ly(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Nt(l.href)+'"]');if(o)return n.instance=o,At(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),At(o),rn(o,"style",f),wc(o,l.precedence,t),n.instance=o;case"stylesheet":f=bs(l.href);var h=t.querySelector(Mo(f));if(h)return n.state.loading|=4,n.instance=h,At(h),h;o=ay(l),(f=ci.get(f))&&qf(o,f),h=(t.ownerDocument||t).createElement("link"),At(h);var v=h;return v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),rn(h,"link",o),n.state.loading|=4,wc(h,l.precedence,t),n.instance=h;case"script":return h=vs(l.src),(f=t.querySelector(Oo(h)))?(n.instance=f,At(f),f):(o=l,(f=ci.get(h))&&(o=x({},l),Hf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),At(f),rn(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,wc(o,l.precedence,t));return n.instance}function wc(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)h=E;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function qf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Hf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var kc=null;function ry(t,n,l){if(kc===null){var o=new Map,f=kc=new Map;f.set(l,o)}else f=kc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[Ai]||h[Pt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var E=o.get(v);E?E.push(h):o.set(v,[h])}}return o}function sy(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Nk(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 oy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Dk(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=bs(o.href),h=n.querySelector(Mo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=jc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,At(h);return}h=n.ownerDocument||n,o=ay(o),(f=ci.get(f))&&qf(o,f),h=h.createElement("link"),At(h);var v=h;v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),rn(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=jc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var $f=0;function _k(t,n){return t.stylesheets&&t.count===0&&Cc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&$f===0&&($f=62500*dk());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Cc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>$f?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function jc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Sc=null;function Cc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Sc=new Map,n.forEach(Rk,t),Sc=null,jc.call(t))}function Rk(t,n){if(!(n.state.loading&4)){var l=Sc.get(t);if(l)var o=l.get(null);else{l=new Map,Sc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=jc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var zo={$$typeof:$,Provider:null,Consumer:null,_currentValue:be,_currentValue2:be,_threadCount:0};function Mk(t,n,l,o,f,h,v,E,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=na(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=na(0),this.hiddenUpdates=na(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function uy(t,n,l,o,f,h,v,E,I,Y,ne,se){return t=new Mk(t,n,l,v,I,Y,ne,se,E),n=1,h===!0&&(n|=24),h=Ot(3,null,null,n),t.current=h,h.stateNode=t,n=so(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},ls(h),t}function cy(t){return t?(t=ma,t):ma}function dy(t,n,l,o,f,h){f=cy(f),o.context===null?o.context=f:o.pendingContext=f,o=sl(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=ol(t,o,n),l!==null&&(On(l,t,n),po(l,t,n))}function fy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Gf(t,n){fy(t,n),(t=t.alternate)&&fy(t,n)}function py(t){if(t.tag===13||t.tag===31){var n=Gi(t,67108864);n!==null&&On(n,t,67108864),Gf(t,67108864)}}function hy(t){if(t.tag===13||t.tag===31){var n=Xn();n=Ar(n);var l=Gi(t,n);l!==null&&On(l,t,n),Gf(t,n)}}var Tc=!0;function Ok(t,n,l,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=2,Vf(t,n,l,o)}finally{oe.p=h,V.T=f}}function zk(t,n,l,o){var f=V.T;V.T=null;var h=oe.p;try{oe.p=8,Vf(t,n,l,o)}finally{oe.p=h,V.T=f}}function Vf(t,n,l,o){if(Tc){var f=Ff(o);if(f===null)Df(t,n,o,Ec,l),gy(t,o);else if(Ik(f,t,n,l,o))o.stopPropagation();else if(gy(t,o),n&4&&-1<Lk.indexOf(t)){for(;f!==null;){var h=Ni(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ti(h.pendingLanes);if(v!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var I=1<<31-st(v);E.entanglements[1]|=I,v&=~I}Qi(h),(rt&6)===0&&(uc=Mt()+500,No(0))}}break;case 31:case 13:E=Gi(h,2),E!==null&&On(E,h,2),dc(),Gf(h,2)}if(h=Ff(o),h===null&&Df(t,n,o,Ec,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Df(t,n,o,null,l)}}function Ff(t){return t=la(t),Pf(t)}var Ec=null;function Pf(t){if(Ec=null,t=ni(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 Ec=t,null}function my(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(La()){case ae:return 2;case ce:return 8;case Ee:case Ue:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Yf=!1,bl=null,vl=null,wl=null,Lo=new Map,Io=new Map,kl=[],Lk="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 gy(t,n){switch(t){case"focusin":case"focusout":bl=null;break;case"dragenter":case"dragleave":vl=null;break;case"mouseover":case"mouseout":wl=null;break;case"pointerover":case"pointerout":Lo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(n.pointerId)}}function Uo(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ni(n),n!==null&&py(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Ik(t,n,l,o,f){switch(n){case"focusin":return bl=Uo(bl,t,n,l,o,f),!0;case"dragenter":return vl=Uo(vl,t,n,l,o,f),!0;case"mouseover":return wl=Uo(wl,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return Lo.set(h,Uo(Lo.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Io.set(h,Uo(Io.get(h)||null,t,n,l,o,f)),!0}return!1}function yy(t){var n=ni(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,hu(t.priority,function(){hy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,hu(t.priority,function(){hy(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 Ac(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Ff(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);Ll=o,l.target.dispatchEvent(o),Ll=null}else return n=Ni(l),n!==null&&py(n),t.blockedOn=l,!1;n.shift()}return!0}function xy(t,n,l){Ac(t)&&l.delete(n)}function Uk(){Yf=!1,bl!==null&&Ac(bl)&&(bl=null),vl!==null&&Ac(vl)&&(vl=null),wl!==null&&Ac(wl)&&(wl=null),Lo.forEach(xy),Io.forEach(xy)}function Nc(t,n){t.blockedOn===n&&(t.blockedOn=null,Yf||(Yf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Uk)))}var Dc=null;function by(t){Dc!==t&&(Dc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dc===t&&(Dc=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(Pf(o||l)===null)continue;break}var h=Ni(l);h!==null&&(t.splice(n,3),n-=3,Vd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function ws(t){function n(I){return Nc(I,t)}bl!==null&&Nc(bl,t),vl!==null&&Nc(vl,t),wl!==null&&Nc(wl,t),Lo.forEach(n),Io.forEach(n);for(var l=0;l<kl.length;l++){var o=kl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<kl.length&&(l=kl[0],l.blockedOn===null);)yy(l),l.blockedOn===null&&kl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[Bt]||null;if(typeof h=="function")v||by(l);else if(v){var E=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Bt]||null)E=v.formAction;else if(Pf(f)!==null)continue}else E=v.action;typeof E=="function"?l[o+1]=E:(l.splice(o,3),o-=3),by(l)}}}function vy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Wf(t){this._internalRoot=t}_c.prototype.render=Wf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Xn();dy(l,o,t,n,null,null)},_c.prototype.unmount=Wf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;dy(t.current,2,null,t,null,null),dc(),n[Un]=null}};function _c(t){this._internalRoot=t}_c.prototype.unstable_scheduleHydration=function(t){if(t){var n=Ms();t={blockedOn:null,target:t,priority:n};for(var l=0;l<kl.length&&n!==0&&n<kl[l].priority;l++);kl.splice(l,0,t),l===0&&yy(t)}};var wy=i.version;if(wy!=="19.2.7")throw Error(r(527,wy,"19.2.7"));oe.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Bk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{Ft=Rc.inject(Bk),Et=Rc}catch{}}return qo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Am,h=Nm,v=Dm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=uy(t,1,!1,null,null,l,o,null,f,h,v,vy),t[Un]=n.current,Nf(t),new Wf(n)},qo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Am,v=Nm,E=Dm,I=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(E=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),n=uy(t,1,!0,n,l??null,o,f,I,h,v,E,vy),n.context=cy(null),l=n.current,o=Xn(),o=Ar(o),f=sl(o),f.callback=null,ol(l,f,o),l=o,n.current.lanes=l,Ba(n,l),Qi(n),t[Un]=n.current,Nf(t),new _c(n)},qo.version="19.2.7",qo}var Ry;function Jk(){if(Ry)return Qf.exports;Ry=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(),Qf.exports=Zk(),Qf.exports}var ej=Jk();function tj(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const nj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ij=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,aj={};function My(e,i){return(aj.jsx?ij:nj).test(e)}const lj=/[ \t\n\f\r]/g;function rj(e){return typeof e=="object"?e.type==="text"?Oy(e.value):!1:Oy(e)}function Oy(e){return e.replace(lj,"")===""}class cu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}cu.prototype.normal={};cu.prototype.property={};cu.prototype.space=void 0;function kb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new cu(a,r,i)}function Lp(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 sj=0;const Ie=Sr(),Gt=Sr(),Ip=Sr(),he=Sr(),yt=Sr(),br=Sr(),Qn=Sr();function Sr(){return 2**++sj}const Up=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Gt,commaOrSpaceSeparated:Qn,commaSeparated:br,number:he,overloadedBoolean:Ip,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),tp=Object.keys(Up);class uh extends In{constructor(i,a,r,u){let c=-1;if(super(i,a),zy(this,"space",u),typeof r=="number")for(;++c<tp.length;){const d=tp[c];zy(this,tp[c],(r&Up[d])===Up[d])}}}uh.prototype.defined=!0;function zy(e,i,a){a&&(e[i]=a)}function Ns(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new uh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Lp(r)]=r,a[Lp(c.attribute)]=r}return new cu(i,a,e.space)}const jb=Ns({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:he,ariaColIndex:he,ariaColSpan:he,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:yt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:he,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:he,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:yt,ariaRowCount:he,ariaRowIndex:he,ariaRowSpan:he,ariaSelected:Gt,ariaSetSize:he,ariaSort:null,ariaValueMax:he,ariaValueMin:he,ariaValueNow:he,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Sb(e,i){return i in e?e[i]:i}function Cb(e,i){return Sb(e,i.toLowerCase())}const oj=Ns({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:br,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:yt,autoFocus:Ie,autoPlay:Ie,blocking:yt,capture:null,charSet:null,checked:Ie,cite:null,className:yt,closedBy:null,colorSpace:null,cols:he,colSpan:he,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Ie,controlsList:yt,coords:he|br,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Ip,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:yt,height:he,hidden:Ip,high:he,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:yt,itemRef:yt,itemScope:Ie,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:he,manifest:null,max:null,maxLength:he,media:null,method:null,min:null,minLength:he,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:he,pattern:null,ping:yt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:yt,required:Ie,reversed:Ie,rows:he,rowSpan:he,sandbox:yt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:he,sizes:null,slot:null,span:he,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:he,step:null,style:null,tabIndex:he,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Gt,width:he,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:he,borderColor:null,bottomMargin:he,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:he,leftMargin:he,link:null,longDesc:null,lowSrc:null,marginHeight:he,marginWidth:he,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:he,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:he,valueType:null,version:null,vAlign:null,vLink:null,vSpace:he,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:br,part:yt,prefix:null,property:null,results:he,security:null,unselectable:null},space:"html",transform:Cb}),uj=Ns({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:Qn,accentHeight:he,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:he,amplitude:he,arabicForm:null,ascent:he,attributeName:null,attributeType:null,azimuth:he,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:he,by:null,calcMode:null,capHeight:he,className:yt,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:he,diffuseConstant:he,direction:null,display:null,dur:null,divisor:he,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:he,enableBackground:null,end:null,event:null,exponent:he,externalResourcesRequired:null,fill:null,fillOpacity:he,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:br,g2:br,glyphName:br,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:he,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:he,horizOriginX:he,horizOriginY:he,id:null,ideographic:he,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:he,k:he,k1:he,k2:he,k3:he,k4:he,kernelMatrix:Qn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:he,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:he,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:he,overlineThickness:he,paintOrder:null,panose1:null,path:null,pathLength:he,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:he,pointsAtY:he,pointsAtZ:he,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qn,rev:Qn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qn,requiredFeatures:Qn,requiredFonts:Qn,requiredFormats:Qn,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:he,specularExponent:he,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:he,strikethroughThickness:he,string:null,stroke:null,strokeDashArray:Qn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:he,strokeOpacity:he,strokeWidth:null,style:null,surfaceScale:he,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qn,tabIndex:he,tableValues:null,target:null,targetX:he,targetY:he,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:he,underlineThickness:he,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:he,values:null,vAlphabetic:he,vMathematical:he,vectorEffect:null,vHanging:he,vIdeographic:he,version:null,vertAdvY:he,vertOriginX:he,vertOriginY:he,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:he,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Sb}),Tb=Ns({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()}}),Eb=Ns({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cb}),Ab=Ns({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),cj={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"},dj=/[A-Z]/g,Ly=/-[a-z]/g,fj=/^data[-\w.:]+$/i;function pj(e,i){const a=Lp(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"&&fj.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(Ly,mj);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!Ly.test(c)){let d=c.replace(dj,hj);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=uh}return new u(r,i)}function hj(e){return"-"+e.toLowerCase()}function mj(e){return e.charAt(1).toUpperCase()}const gj=kb([jb,oj,Tb,Eb,Ab],"html"),ch=kb([jb,uj,Tb,Eb,Ab],"svg");function yj(e){return e.join(" ").trim()}var ks={},np,Iy;function xj(){if(Iy)return np;Iy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
+ `,m="/",b="*",x="",j="comment",w="declaration";function T(q,N){if(typeof q!="string")throw new TypeError("First argument must be a string");if(!q)return[];N=N||{};var H=1,$=1;function F(ye){var ue=ye.match(i);ue&&(H+=ue.length);var V=ye.lastIndexOf(g);$=~V?ye.length-V:$+ye.length}function ie(){var ye={line:H,column:$};return function(ue){return ue.position=new _(ye),ee(),ue}}function _(ye){this.start=ye,this.end={line:H,column:$},this.source=N.source}_.prototype.content=q;function Q(ye){var ue=new Error(N.source+":"+H+":"+$+": "+ye);if(ue.reason=ye,ue.filename=N.source,ue.line=H,ue.column=$,ue.source=q,!N.silent)throw ue}function re(ye){var ue=ye.exec(q);if(ue){var V=ue[0];return F(V),q=q.slice(V.length),ue}}function ee(){re(a)}function L(ye){var ue;for(ye=ye||[];ue=te();)ue!==!1&&ye.push(ue);return ye}function te(){var ye=ie();if(!(m!=q.charAt(0)||b!=q.charAt(1))){for(var ue=2;x!=q.charAt(ue)&&(b!=q.charAt(ue)||m!=q.charAt(ue+1));)++ue;if(ue+=2,x===q.charAt(ue-1))return Q("End of comment missing");var V=q.slice(2,ue-2);return $+=2,F(V),q=q.slice(ue),$+=2,ye({type:j,comment:V})}}function de(){var ye=ie(),ue=re(r);if(ue){if(te(),!re(u))return Q("property missing ':'");var V=re(c),oe=ye({type:w,property:R(ue[0].replace(e,x)),value:V?R(V[0].replace(e,x)):x});return re(d),oe}}function Ne(){var ye=[];L(ye);for(var ue;ue=de();)ue!==!1&&(ye.push(ue),L(ye));return ye}return ee(),Ne()}function R(q){return q?q.replace(p,x):x}return np=T,np}var Uy;function bj(){if(Uy)return ks;Uy=1;var e=ks&&ks.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=a;const i=e(xj());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return ks}var Ho={},By;function vj(){if(By)return Ho;By=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||a.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return Ho.camelCase=g,Ho}var $o,qy;function wj(){if(qy)return $o;qy=1;var e=$o&&$o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(bj()),a=vj();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,$o=r,$o}var kj=wj();const jj=wb(kj),Nb=Db("end"),dh=Db("start");function Db(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 Sj(e){const i=dh(e),a=Nb(e);if(i&&a)return{start:i,end:a}}function eu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Hy(e.position):"start"in e||"end"in e?Hy(e):"line"in e||"column"in e?Bp(e):""}function Bp(e){return $y(e&&e.line)+":"+$y(e&&e.column)}function Hy(e){return Bp(e&&e.start)+"-"+Bp(e&&e.end)}function $y(e){return e&&typeof e=="number"?e:1}class pn 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=eu(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}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const fh={}.hasOwnProperty,Cj=new Map,Tj=/[A-Z]/g,Ej=new Set(["table","tbody","thead","tfoot","tr"]),Aj=new Set(["td","th"]),_b="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Nj(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=Ij(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=Lj(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ch:gj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=Rb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function Rb(e,i,a){if(i.type==="element")return Dj(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return _j(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return Mj(e,i,a);if(i.type==="mdxjsEsm")return Rj(e,i);if(i.type==="root")return Oj(e,i,a);if(i.type==="text")return zj(e,i)}function Dj(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=Ob(e,i.tagName,!1),d=Uj(e,i);let p=hh(e,i);return Ej.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!rj(g):!0})),Mb(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function _j(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)}ou(e,i.position)}function Rj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);ou(e,i.position)}function Mj(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ch,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Ob(e,i.name,!0),d=Bj(e,i),p=hh(e,i);return Mb(e,d,c,i),ph(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function Oj(e,i,a){const r={};return ph(r,hh(e,i)),e.create(i,e.Fragment,r,a)}function zj(e,i){return i.value}function Mb(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function ph(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function Lj(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function Ij(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=dh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function Uj(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&fh.call(i.properties,u)){const c=qj(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&Aj.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 Bj(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 ou(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 ou(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function hh(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:Cj;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=Rb(e,c,d);p!==void 0&&a.push(p)}return a}function qj(e,i,a){const r=pj(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?tj(a):yj(a)),r.property==="style"){let u=typeof a=="object"?a:Hj(e,String(a));return e.stylePropertyNameCase==="css"&&(u=$j(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?cj[r.property]||r.property:r.attribute,a]}}function Hj(e,i){try{return jj(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new pn("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=_b+"#cannot-parse-style-attribute",u}}function Ob(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=My(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=My(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return fh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);ou(e)}function ou(e,i){const a=new pn("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=_b+"#cannot-handle-mdx-estrees-without-createevaluater",a}function $j(e){const i={};let a;for(a in e)fh.call(e,a)&&(i[Gj(a)]=e[a]);return i}function Gj(e){let i=e.replace(Tj,Vj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Vj(e){return"-"+e.toLowerCase()}const ip={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"]},Fj={};function mh(e,i){const a=Fj,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return zb(e,r,u)}function zb(e,i,a){if(Pj(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 Gy(e.children,i,a)}return Array.isArray(e)?Gy(e,i,a):""}function Gy(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=zb(e[u],i,a);return r.join("")}function Pj(e){return!!(e&&typeof e=="object")}const Vy=document.createElement("i");function gh(e){const i="&"+e+";";Vy.innerHTML=i;const a=Vy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Zn(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 di(e,i){return e.length>0?(Zn(e,e.length,0,i),e):i}const Fy={}.hasOwnProperty;function Lb(e){const i={};let a=-1;for(;++a<e.length;)Yj(i,e[a]);return i}function Yj(e,i){let a;for(a in i){const u=(Fy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Fy.call(u,d)||(u[d]=[]);const p=c[d];Wj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Wj(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Zn(e,0,0,r)}function Ib(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 ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vn=Nl(/[A-Za-z]/),fn=Nl(/[\dA-Za-z]/),Kj=Nl(/[#-'*+\--9=?A-Z^-~]/);function Zc(e){return e!==null&&(e<32||e===127)}const qp=Nl(/\d/),Xj=Nl(/[\dA-Fa-f]/),Qj=Nl(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const rd=Nl(new RegExp("\\p{P}|\\p{S}","u")),vr=Nl(/\s/);function Nl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Ds(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&fn(e.charCodeAt(a+1))&&fn(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 Zj={tokenize:Jj};function Jj(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 Oe(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const eS={tokenize:tS},Py={tokenize:nS};function tS(e){const i=this,a=[];let r=0,u,c,d;return p;function p($){if(r<a.length){const F=a[r];return i.containerState=F[1],e.attempt(F[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const F=i.events.length;let ie=F,_;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){_=i.events[ie][1].end;break}N(r);let Q=F;for(;Q<i.events.length;)i.events[Q][1].end={..._},Q++;return Zn(i.events,ie+1,0,i.events.slice(F)),i.events.length=Q,m($)}return p($)}function m($){if(r===a.length){if(!u)return j($);if(u.currentConstruct&&u.currentConstruct.concrete)return T($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Py,b,x)($)}function b($){return u&&H(),N(r),j($)}function x($){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,T($)}function j($){return i.containerState={},e.attempt(Py,w,T)($)}function w($){return r++,a.push([i.currentConstruct,i.containerState]),j($)}function T($){if($===null){u&&H(),N(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R($)}function R($){if($===null){q(e.exit("chunkFlow"),!0),N(0),e.consume($);return}return Oe($)?(e.consume($),q(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),R)}function q($,F){const ie=i.sliceStream($);if(F&&ie.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(ie),i.parser.lazy[$.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 Q=i.events.length;let re=Q,ee,L;for(;re--;)if(i.events[re][0]==="exit"&&i.events[re][1].type==="chunkFlow"){if(ee){L=i.events[re][1].end;break}ee=!0}for(N(r),_=Q;_<i.events.length;)i.events[_][1].end={...L},_++;Zn(i.events,re+1,0,i.events.slice(Q)),i.events.length=_}}function N($){let F=a.length;for(;F-- >$;){const ie=a[F];i.containerState=ie[1],ie[0].exit.call(i,e)}a.length=$}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function nS(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 Es(e){if(e===null||xt(e)||vr(e))return 1;if(rd(e))return 2}function sd(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const Hp={name:"attention",resolveAll:iS,tokenize:aS};function iS(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},j={...e[a][1].start};Yy(x,-g),Yy(j,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:j},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=di(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=di(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=di(m,sd(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=di(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=di(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Zn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function aS(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Es(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=Es(g),x=!b||b===2&&u||a.includes(g),j=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!j)),m._close=!!(c===42?j:j&&(b||!x)),i(g)}}function Yy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const lS={name:"autolink",tokenize:rS};function rS(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):m(w)}function d(w){return w===43||w===45||w===46||fn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||fn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Zc(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):Kj(w)?(e.consume(w),m):a(w)}function b(w){return fn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):j(w)}function j(w){if((w===45||fn(w))&&r++<63){const T=w===45?j:x;return e.consume(w),T}return a(w)}}const du={partial:!0,tokenize:sS};function sS(e,i,a){return r;function r(c){return Ke(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Oe(c)?i(c):a(c)}}const Ub={continuation:{tokenize:uS},exit:cS,name:"blockQuote",tokenize:oS};function oS(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 uS(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(Ub,i,a)(d)}}function cS(e){e.exit("blockQuote")}const Bb={name:"characterEscape",tokenize:dS};function dS(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 Qj(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const qb={name:"characterReference",tokenize:fS};function fS(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=fn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Xj,b):(e.enter("characterReferenceValue"),c=7,d=qp,b(x))}function b(x){if(x===59&&u){const j=e.exit("characterReferenceValue");return d===fn&&!gh(r.sliceSerialize(j))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Wy={partial:!0,tokenize:hS},Ky={concrete:!0,name:"codeFenced",tokenize:pS};function pS(e,i,a){const r=this,u={partial:!0,tokenize:ie};let c=0,d=0,p;return g;function g(_){return m(_)}function m(_){const Q=r.events[r.events.length-1];return c=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[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,x,"whitespace")(_):x(_))}function x(_){return _===null||Oe(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(Wy,R,F)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(_))}function j(_){return _===null||Oe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(_)):Ke(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(_)):_===96&&_===p?a(_):(e.consume(_),j)}function w(_){return _===null||Oe(_)?x(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(_))}function T(_){return _===null||Oe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(_)):_===96&&_===p?a(_):(e.consume(_),T)}function R(_){return e.attempt(u,F,q)(_)}function q(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return c>0&&Ke(_)?et(e,H,"linePrefix",c+1)(_):H(_)}function H(_){return _===null||Oe(_)?e.check(Wy,R,F)(_):(e.enter("codeFlowValue"),$(_))}function $(_){return _===null||Oe(_)?(e.exit("codeFlowValue"),H(_)):(e.consume(_),$)}function F(_){return e.exit("codeFenced"),i(_)}function ie(_,Q,re){let ee=0;return L;function L(ue){return _.enter("lineEnding"),_.consume(ue),_.exit("lineEnding"),te}function te(ue){return _.enter("codeFencedFence"),Ke(ue)?et(_,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(_.enter("codeFencedFenceSequence"),Ne(ue)):re(ue)}function Ne(ue){return ue===p?(ee++,_.consume(ue),Ne):ee>=d?(_.exit("codeFencedFenceSequence"),Ke(ue)?et(_,ye,"whitespace")(ue):ye(ue)):re(ue)}function ye(ue){return ue===null||Oe(ue)?(_.exit("codeFencedFence"),Q(ue)):re(ue)}}}function hS(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 ap={name:"codeIndented",tokenize:gS},mS={partial:!0,tokenize:yS};function gS(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):a(m)}function d(m){return m===null?g(m):Oe(m)?e.attempt(mS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function yS(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Oe(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):Oe(d)?u(d):a(d)}}const xS={name:"codeText",previous:vS,resolve:bS,tokenize:wS};function bS(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 vS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wS(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Oe(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class kS{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&&Go(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),Go(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Go(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);Go(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Go(this.left,a.reverse())}}}function Go(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 Hb(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new kS(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,jS(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Zn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function jS(e,i){const a=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,j=-1,w=a,T=0,R=0;const q=[R];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++j<p.length;)p[j][0]==="exit"&&p[j-1][0]==="enter"&&p[j][1].type===p[j-1][1].type&&p[j][1].start.line!==p[j][1].end.line&&(R=j+1,q.push(R),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):q.pop(),j=q.length;j--;){const N=p.slice(q[j],q[j+1]),H=c.pop();g.push([H,H+N.length-1]),e.splice(H,2,N)}for(g.reverse(),j=-1;++j<g.length;)m[T+g[j][0]]=T+g[j][1],T+=g[j][1]-g[j][0]-1;return m}const SS={resolve:TS,tokenize:ES},CS={partial:!0,tokenize:AS};function TS(e){return Hb(e),e}function ES(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):Oe(p)?e.check(CS,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 AS(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||Oe(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 $b(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(N){return N===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(N),e.exit(c),j):N===null||N===32||N===41||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||Oe(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||xt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):b<m&&N===40?(e.consume(N),b++,R):N===41?(e.consume(N),b--,R):N===null||N===32||N===40||Zc(N)?a(N):(e.consume(N),N===92?q:R)}function q(N){return N===40||N===41||N===92?(e.consume(N),R):R(N)}}function Gb(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Oe(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!Ke(w)),w===92?j:x)}function j(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Vb(e,i,a,r,u,c){let d;return p;function p(j){return j===34||j===39||j===40?(e.enter(r),e.enter(u),e.consume(j),e.exit(u),d=j===40?41:j,g):a(j)}function g(j){return j===d?(e.enter(u),e.consume(j),e.exit(u),e.exit(r),i):(e.enter(c),m(j))}function m(j){return j===d?(e.exit(c),g(d)):j===null?a(j):Oe(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===d||j===null||Oe(j)?(e.exit("chunkString"),m(j)):(e.consume(j),j===92?x:b)}function x(j){return j===d||j===92?(e.consume(j),b):b(j)}}function tu(e,i){let a;return r;function r(u){return Oe(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 NS={name:"definition",tokenize:_S},DS={partial:!0,tokenize:RS};function _S(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Gb.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=ji(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 xt(w)?tu(e,m)(w):m(w)}function m(w){return $b(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(DS,x,x)(w)}function x(w){return Ke(w)?et(e,j,"whitespace")(w):j(w)}function j(w){return w===null||Oe(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function RS(e,i,a){return r;function r(p){return xt(p)?tu(e,u)(p):a(p)}function u(p){return Vb(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||Oe(p)?i(p):a(p)}}const MS={name:"hardBreakEscape",tokenize:OS};function OS(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Oe(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const zS={name:"headingAtx",resolve:LS,tokenize:IS};function LS(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"},Zn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function IS(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||xt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Oe(b)?(e.exit("atxHeading"),i(b)):Ke(b)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||xt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const US=["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"],Xy=["pre","script","style","textarea"],BS={concrete:!0,name:"htmlFlow",resolveTo:$S,tokenize:GS},qS={partial:!0,tokenize:FS},HS={partial:!0,tokenize:VS};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 GS(e,i,a){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),j):C===47?(e.consume(C),c=!0,R):C===63?(e.consume(C),u=3,r.interrupt?i:O):vn(C)?(e.consume(C),d=String.fromCharCode(C),q):a(C)}function j(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,T):vn(C)?(e.consume(C),u=4,r.interrupt?i:O):a(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):a(C)}function T(C){const W="CDATA[";return C===W.charCodeAt(p++)?(e.consume(C),p===W.length?r.interrupt?i:de:T):a(C)}function R(C){return vn(C)?(e.consume(C),d=String.fromCharCode(C),q):a(C)}function q(C){if(C===null||C===47||C===62||xt(C)){const W=C===47,fe=d.toLowerCase();return!W&&!c&&Xy.includes(fe)?(u=1,r.interrupt?i(C):de(C)):US.includes(d.toLowerCase())?(u=6,W?(e.consume(C),N):r.interrupt?i(C):de(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?H(C):$(C))}return C===45||fn(C)?(e.consume(C),d+=String.fromCharCode(C),q):a(C)}function N(C){return C===62?(e.consume(C),r.interrupt?i:de):a(C)}function H(C){return Ke(C)?(e.consume(C),H):L(C)}function $(C){return C===47?(e.consume(C),L):C===58||C===95||vn(C)?(e.consume(C),F):Ke(C)?(e.consume(C),$):L(C)}function F(C){return C===45||C===46||C===58||C===95||fn(C)?(e.consume(C),F):ie(C)}function ie(C){return C===61?(e.consume(C),_):Ke(C)?(e.consume(C),ie):$(C)}function _(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),g=C,Q):Ke(C)?(e.consume(C),_):re(C)}function Q(C){return C===g?(e.consume(C),g=null,ee):C===null||Oe(C)?a(C):(e.consume(C),Q)}function re(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||xt(C)?ie(C):(e.consume(C),re)}function ee(C){return C===47||C===62||Ke(C)?$(C):a(C)}function L(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||Oe(C)?de(C):Ke(C)?(e.consume(C),te):a(C)}function de(C){return C===45&&u===2?(e.consume(C),V):C===60&&u===1?(e.consume(C),oe):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),Re):Oe(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(qS,z,Ne)(C)):C===null||Oe(C)?(e.exit("htmlFlowData"),Ne(C)):(e.consume(C),de)}function Ne(C){return e.check(HS,ye,z)(C)}function ye(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Oe(C)?Ne(C):(e.enter("htmlFlowData"),de(C))}function V(C){return C===45?(e.consume(C),O):de(C)}function oe(C){return C===47?(e.consume(C),d="",be):de(C)}function be(C){if(C===62){const W=d.toLowerCase();return Xy.includes(W)?(e.consume(C),A):de(C)}return vn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),be):de(C)}function Re(C){return C===93?(e.consume(C),O):de(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):de(C)}function A(C){return C===null||Oe(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function VS(e,i,a){const r=this;return u;function u(d){return Oe(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 FS(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(du,i,a)}}const PS={name:"htmlText",tokenize:YS};function YS(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ie):O===63?(e.consume(O),$):vn(O)?(e.consume(O),re):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,T):vn(O)?(e.consume(O),H):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),j):Oe(O)?(d=x,oe(O)):(e.consume(O),x)}function j(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?j(O):x(O)}function T(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?R:T):a(O)}function R(O){return O===null?a(O):O===93?(e.consume(O),q):Oe(O)?(d=R,oe(O)):(e.consume(O),R)}function q(O){return O===93?(e.consume(O),N):R(O)}function N(O){return O===62?V(O):O===93?(e.consume(O),N):R(O)}function H(O){return O===null||O===62?V(O):Oe(O)?(d=H,oe(O)):(e.consume(O),H)}function $(O){return O===null?a(O):O===63?(e.consume(O),F):Oe(O)?(d=$,oe(O)):(e.consume(O),$)}function F(O){return O===62?V(O):$(O)}function ie(O){return vn(O)?(e.consume(O),_):a(O)}function _(O){return O===45||fn(O)?(e.consume(O),_):Q(O)}function Q(O){return Oe(O)?(d=Q,oe(O)):Ke(O)?(e.consume(O),Q):V(O)}function re(O){return O===45||fn(O)?(e.consume(O),re):O===47||O===62||xt(O)?ee(O):a(O)}function ee(O){return O===47?(e.consume(O),V):O===58||O===95||vn(O)?(e.consume(O),L):Oe(O)?(d=ee,oe(O)):Ke(O)?(e.consume(O),ee):V(O)}function L(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),L):te(O)}function te(O){return O===61?(e.consume(O),de):Oe(O)?(d=te,oe(O)):Ke(O)?(e.consume(O),te):ee(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Ne):Oe(O)?(d=de,oe(O)):Ke(O)?(e.consume(O),de):(e.consume(O),ye)}function Ne(O){return O===u?(e.consume(O),u=void 0,ue):O===null?a(O):Oe(O)?(d=Ne,oe(O)):(e.consume(O),Ne)}function ye(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||xt(O)?ee(O):(e.consume(O),ye)}function ue(O){return O===47||O===62||xt(O)?ee(O):a(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function oe(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),be}function be(O){return Ke(O)?et(e,Re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):Re(O)}function Re(O){return e.enter("htmlTextData"),d(O)}}const yh={name:"labelEnd",resolveAll:QS,resolveTo:ZS,tokenize:JS},WS={tokenize:e0},KS={tokenize:t0},XS={tokenize:n0};function QS(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&&Zn(e,0,e.length,a),e}function ZS(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=a,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=a);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=di(p,e.slice(c+1,c+r+3)),p=di(p,[["enter",b,i]]),p=di(p,sd(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=di(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=di(p,e.slice(d+1)),p=di(p,[["exit",g,i]]),Zn(e,c,e.length,p),e}function JS(e,i,a){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(j){return c?c._inactive?x(j):(d=r.parser.defined.includes(ji(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(WS,b,d?b:x)(j):j===91?e.attempt(KS,b,d?m:x)(j):d?b(j):x(j)}function m(j){return e.attempt(XS,b,x)(j)}function b(j){return i(j)}function x(j){return c._balanced=!0,a(j)}}function e0(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return xt(x)?tu(e,c)(x):c(x)}function c(x){return x===41?b(x):$b(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return xt(x)?tu(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Vb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return xt(x)?tu(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function t0(e,i,a){const r=this;return u;function u(p){return Gb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function n0(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 i0={name:"labelStartImage",resolveAll:yh.resolveAll,tokenize:a0};function a0(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 l0={name:"labelStartLink",resolveAll:yh.resolveAll,tokenize:r0};function r0(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 lp={name:"lineEnding",tokenize:s0};function s0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Pc={name:"thematicBreak",tokenize:o0};function o0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),Ke(m)?et(e,p,"whitespace")(m):p(m))}}const zn={continuation:{tokenize:f0},exit:h0,name:"list",tokenize:d0},u0={partial:!0,tokenize:m0},c0={partial:!0,tokenize:p0};function d0(e,i,a){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const T=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:qp(w)){if(r.containerState.type||(r.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Pc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return qp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(du,r.interrupt?a:b,e.attempt(u0,j,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,j(w)}function x(w){return Ke(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),j):a(w)}function j(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function f0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(du,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(c0,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 p0(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 h0(e){e.exit(this.containerState.type)}function m0(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 Qy={name:"setextUnderline",resolveTo:g0,tokenize:y0};function g0(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 y0(e,i,a){const r=this;let u;return c;function c(m){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),Ke(m)?et(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const x0={tokenize:b0};function b0(e){const i=this,a=e.attempt(du,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(SS,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 v0={resolveAll:Pb()},w0=Fb("string"),k0=Fb("text");function Fb(e){return{resolveAll:Pb(e==="text"?j0:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let j=-1;if(x)for(;++j<x.length;){const w=x[j];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Pb(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 j0(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const S0={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:Ub},C0={91:NS},T0={[-2]:ap,[-1]:ap,32:ap},E0={35:zS,42:Pc,45:[Qy,Pc],60:BS,61:Qy,95:Pc,96:Ky,126:Ky},A0={38:qb,92:Bb},N0={[-5]:lp,[-4]:lp,[-3]:lp,33:i0,38:qb,42:Hp,60:[lS,PS],91:l0,92:[MS,Bb],93:yh,95:Hp,96:xS},D0={null:[Hp,v0]},_0={null:[42,95]},R0={null:[]},M0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_0,contentInitial:C0,disable:R0,document:S0,flow:E0,flowInitial:T0,insideSpan:D0,string:A0,text:N0},Symbol.toStringTag,{value:"Module"}));function O0(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:Q(ie),check:Q(_),consume:H,enter:$,exit:F,interrupt:Q(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:R,events:[],now:T,parser:e,previous:null,sliceSerialize:j,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=di(d,te),q(),d[d.length-1]!==null?[]:(re(i,0),m.events=sd(c,m.events,m),m.events)}function j(te,de){return L0(w(te),de)}function w(te){return z0(d,te)}function T(){const{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}=r;return{_bufferIndex:te,_index:de,line:Ne,column:ye,offset:ue}}function R(te){u[te.line]=te.column,L()}function q(){let te;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<de.length;)N(de.charCodeAt(r._bufferIndex));else N(de)}}function N(te){b=b(te)}function H(te){Oe(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,L()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function $(te,de){const Ne=de||{};return Ne.type=te,Ne.start=T(),m.events.push(["enter",Ne,m]),p.push(Ne),Ne}function F(te){const de=p.pop();return de.end=T(),m.events.push(["exit",de,m]),de}function ie(te,de){re(te,de.from)}function _(te,de){de.restore()}function Q(te,de){return Ne;function Ne(ye,ue,V){let oe,be,Re,O;return Array.isArray(ye)?z(ye):"tokenize"in ye?z([ye]):A(ye);function A(X){return xe;function xe(Me){const Ve=Me!==null&&X[Me],Ct=Me!==null&&X.null,vt=[...Array.isArray(Ve)?Ve:Ve?[Ve]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return z(vt)(Me)}}function z(X){return oe=X,be=0,X.length===0?V:C(X[be])}function C(X){return xe;function xe(Me){return O=ee(),Re=X,X.partial||(m.currentConstruct=X),X.name&&m.parser.constructs.disable.null.includes(X.name)?fe():X.tokenize.call(de?Object.assign(Object.create(m),de):m,g,W,fe)(Me)}}function W(X){return te(Re,O),ue}function fe(X){return O.restore(),++be<oe.length?C(oe[be]):V}}}function re(te,de){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Zn(m.events,de,m.events.length-de,te.resolve(m.events.slice(de),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=T(),de=m.previous,Ne=m.currentConstruct,ye=m.events.length,ue=Array.from(p);return{from:ye,restore:V};function V(){r=te,m.previous=de,m.currentConstruct=Ne,m.events.length=ye,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function z0(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 L0(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 I0(e){const r={constructs:Lb([M0,...(e||{}).extensions||[]]),content:u(Zj),defined:[],document:u(eS),flow:u(x0),lazy:{},string:u(w0),text:u(k0)};return r;function u(c){return d;function d(p){return O0(r,c,p)}}}function U0(e){for(;!Hb(e););return e}const Zy=/[\0\t\n\r]/g;function B0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,j,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(Zy.lastIndex=x,m=Zy.exec(c),j=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(j),!m){i=c.slice(x);break}if(w===10&&x===j&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<j&&(g.push(c.slice(x,j)),e+=j-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=j+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const q0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function H0(e){return e.replace(q0,$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 Ib(a.slice(c?2:1),c?16:10)}return gh(a)||e}const Yb={}.hasOwnProperty;function G0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),V0(a)(U0(I0(a).document().write(B0()(e,i,!0))))}function V0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(hn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(It),blockQuote:c(Ct),characterEscape:ee,characterReference:ee,codeFenced:c(vt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(vt,d),codeText:c(sn,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Fe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(jt),hardBreakEscape:c(on),hardBreakTrailing:c(on),htmlFlow:c(Le,d),htmlFlowData:ee,htmlText:c(Le,d),htmlTextData:ee,image:c(Ut),label:d,link:c(hn),listItem:c(Si),listItemValue:j,listOrdered:c(Kt,x),listUnordered:c(Kt),paragraph:c(Jn),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(It),strong:c(za),thematicBreak:c(La)},exit:{atxHeading:g(),atxHeadingSequence:ie,autolink:g(),autolinkEmail:Ve,autolinkProtocol:Me,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:X,characterReference:xe,codeFenced:g(q),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:g(N),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:F,definitionLabelString:H,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ne),htmlFlowData:L,htmlText:g(ye),htmlTextData:L,image:g(oe),label:Re,labelText:be,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:W,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(re),setextHeadingLineSequence:Q,setextHeadingText:_,strong:g(),thematicBreak:g()}};Wb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ae){let ce={type:"root",children:[]};const Ee={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},Ue=[];let Xe=-1;for(;++Xe<ae.length;)if(ae[Xe][1].type==="listOrdered"||ae[Xe][1].type==="listUnordered")if(ae[Xe][0]==="enter")Ue.push(Xe);else{const Vt=Ue.pop();Xe=u(ae,Vt,Xe)}for(Xe=-1;++Xe<ae.length;){const Vt=i[ae[Xe][0]];Yb.call(Vt,ae[Xe][1].type)&&Vt[ae[Xe][1].type].call(Object.assign({sliceSerialize:ae[Xe][2].sliceSerialize},Ee),ae[Xe][1])}if(Ee.tokenStack.length>0){const Vt=Ee.tokenStack[Ee.tokenStack.length-1];(Vt[1]||Jy).call(Ee,void 0,Vt[0])}for(ce.position={start:Sl(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Sl(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)ce=i.transforms[Xe](ce)||ce;return ce}function u(ae,ce,Ee){let Ue=ce-1,Xe=-1,Vt=!1,ei,Ft,Et,dt;for(;++Ue<=Ee;){const st=ae[Ue];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?Xe++:Xe--,dt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(ei&&!dt&&!Xe&&!Et&&(Et=Ue),dt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:dt=void 0}if(!Xe&&st[0]==="enter"&&st[1].type==="listItemPrefix"||Xe===-1&&st[0]==="exit"&&(st[1].type==="listUnordered"||st[1].type==="listOrdered")){if(ei){let Ci=Ue;for(Ft=void 0;Ci--;){const wn=ae[Ci];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;Ft&&(ae[Ft][1].type="lineEndingBlank",Vt=!0),wn[1].type="lineEnding",Ft=Ci}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Et&&(!Ft||Et<Ft)&&(ei._spread=!0),ei.end=Object.assign({},Ft?ae[Ft][1].start:st[1].end),ae.splice(Ft||Ue,0,["exit",ei,st[2]]),Ue++,Ee++}if(st[1].type==="listItemPrefix"){const Ci={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};ei=Ci,ae.splice(Ue,0,["enter",Ci,st[2]]),Ue++,Ee++,Et=void 0,dt=!0}}}return ae[ce][1]._spread=Vt,Ee}function c(ae,ce){return Ee;function Ee(Ue){p.call(this,ae(Ue),Ue),ce&&ce.call(this,Ue)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ae,ce,Ee){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([ce,Ee||void 0]),ae.position={start:Sl(ce.start),end:void 0}}function g(ae){return ce;function ce(Ee){ae&&ae.call(this,Ee),m.call(this,Ee)}}function m(ae,ce){const Ee=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ae.type&&(ce?ce.call(this,ae,Ue[0]):(Ue[1]||Jy).call(this,ae,Ue[0]));else throw new Error("Cannot close `"+ae.type+"` ("+eu({start:ae.start,end:ae.end})+"): it’s not open");Ee.position.end=Sl(ae.end)}function b(){return mh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function j(ae){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ae}function T(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ae}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function q(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae.replace(/(\r?\n|\r)$/g,"")}function H(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=ji(this.sliceSerialize(ae)).toLowerCase()}function $(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function F(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function ie(ae){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ee=this.sliceSerialize(ae).length;ce.depth=Ee}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function Q(ae){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function re(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ae){const Ee=this.stack[this.stack.length-1].children;let Ue=Ee[Ee.length-1];(!Ue||Ue.type!=="text")&&(Ue=Mt(),Ue.position={start:Sl(ae.start),end:void 0},Ee.push(Ue)),this.stack.push(Ue)}function L(ae){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ae),ce.position.end=Sl(ae.end)}function te(ae){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=ce.children[ce.children.length-1];Ee.position.end=Sl(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(ee.call(this,ae),L.call(this,ae))}function de(){this.data.atHardBreak=!0}function Ne(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ye(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function ue(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ae}function V(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function oe(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=ce,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function be(ae){const ce=this.sliceSerialize(ae),Ee=this.stack[this.stack.length-2];Ee.label=H0(ce),Ee.identifier=ji(ce).toLowerCase()}function Re(){const ae=this.stack[this.stack.length-1],ce=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ue=ae.children;Ee.children=Ue}else Ee.alt=ce}function O(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ae}function A(){const ae=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ae}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function W(ae){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=ce,Ee.identifier=ji(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function fe(ae){this.data.characterReferenceType=ae.type}function X(ae){const ce=this.sliceSerialize(ae),Ee=this.data.characterReferenceType;let Ue;Ee?(Ue=Ib(ce,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=gh(ce);const Xe=this.stack[this.stack.length-1];Xe.value+=Ue}function xe(ae){const ce=this.stack.pop();ce.position.end=Sl(ae.end)}function Me(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ae)}function Ve(ae){L.call(this,ae);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ae)}function Ct(){return{type:"blockquote",children:[]}}function vt(){return{type:"code",lang:null,meta:null,value:""}}function sn(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function jt(){return{type:"emphasis",children:[]}}function It(){return{type:"heading",depth:0,children:[]}}function on(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Ut(){return{type:"image",title:null,url:"",alt:null}}function hn(){return{type:"link",title:null,url:"",children:[]}}function Kt(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function Si(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function Jn(){return{type:"paragraph",children:[]}}function za(){return{type:"strong",children:[]}}function Mt(){return{type:"text",value:""}}function La(){return{type:"thematicBreak"}}}function Sl(e){return{line:e.line,column:e.column,offset:e.offset}}function Wb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Wb(e,r):F0(e,r)}}function F0(e,i){let a;for(a in i)if(Yb.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 Jy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+eu({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+eu({start:i.start,end:i.end})+") is still open")}function P0(e){const i=this;i.parser=a;function a(r){return G0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Y0(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 W0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
54
+ `}]}function K0(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 X0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Q0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Z0(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Ds(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function J0(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 e1(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Kb(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 t1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Kb(e,i);const u={src:Ds(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 n1(e,i){const a={src:Ds(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 i1(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 a1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Kb(e,i);const u={href:Ds(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 l1(e,i){const a={href:Ds(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 r1(e,i,a){const r=e.all(i),u=a?s1(a):Xb(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
56
+ `}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
57
+ `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function s1(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=Xb(a[r])}return i}function Xb(e){const i=e.spread;return i??e.children.length>1}function o1(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 u1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function c1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function d1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function f1(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=dh(i.children[1]),g=Nb(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 p1(e,i,a){const r=a?a.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],j={},w=d?d[g]:void 0;w&&(j.align=w);let T={type:"element",tagName:c,properties:j,children:[]};x&&(T.children=e.all(x),e.patch(x,T),T=e.applyData(x,T)),m.push(T)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function h1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const ex=9,tx=32;function m1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(nx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(nx(i.slice(u),u>0,!1)),c.join("")}function nx(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===ex||c===tx;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===ex||c===tx;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function g1(e,i){const a={type:"text",value:m1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function y1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const x1={blockquote:Y0,break:W0,code:K0,delete:X0,emphasis:Q0,footnoteReference:Z0,heading:J0,html:e1,imageReference:t1,image:n1,inlineCode:i1,linkReference:a1,link:l1,listItem:r1,list:o1,paragraph:u1,root:c1,strong:d1,table:f1,tableCell:h1,tableRow:p1,text:g1,thematicBreak:y1,toml:Oc,yaml:Oc,definition:Oc,footnoteDefinition:Oc};function Oc(){}const Qb=-1,od=0,nu=1,Jc=2,xh=3,bh=4,vh=5,wh=6,Zb=7,Jb=8,b1=typeof self=="object"?self:globalThis,ix=(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 b1[e](i)},v1=(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 od:case Qb:return a(d,u);case nu:{const p=a([],u);for(const g of d)p.push(r(g));return p}case Jc:{const p=a({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case xh:return a(new Date(d),u);case bh:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case vh:{const p=a(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case wh:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case Zb:{const{name:p,message:g}=d;return a(ix(p,g),u)}case Jb: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(ix(c,d),u)};return r},ax=e=>v1(new Map,e)(0),gr="",{toString:w1}={},{keys:k1}=Object,Vo=e=>{const i=typeof e;if(i!=="object"||!e)return[od,i];const a=w1.call(e).slice(8,-1);switch(a){case"Array":return[nu,gr];case"Object":return[Jc,gr];case"Date":return[xh,gr];case"RegExp":return[bh,gr];case"Map":return[vh,gr];case"Set":return[wh,gr];case"DataView":return[nu,a]}return a.includes("Array")?[nu,a]:a.includes("Error")?[Zb,a]:[Jc,a]},zc=([e,i])=>e===od&&(i==="function"||i==="symbol"),j1=(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]=Vo(d);switch(p){case od:{let b=d;switch(g){case"bigint":p=Jb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Qb],d)}return u([p,b],d)}case nu:{if(g){let j=d;return g==="DataView"?j=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(j=new Uint8Array(d)),u([g,[...j]],d)}const b=[],x=u([p,b],d);for(const j of d)b.push(c(j));return x}case Jc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const j of k1(d))(e||!zc(Vo(d[j])))&&b.push([c(j),c(d[j])]);return x}case xh:return u([p,isNaN(d.getTime())?gr:d.toISOString()],d);case bh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case vh:{const b=[],x=u([p,b],d);for(const[j,w]of d)(e||!(zc(Vo(j))||zc(Vo(w))))&&b.push([c(j),c(w)]);return x}case wh:{const b=[],x=u([p,b],d);for(const j of d)(e||!zc(Vo(j)))&&b.push(c(j));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},lx=(e,{json:i,lossy:a}={})=>{const r=[];return j1(!(i||a),!!i,new Map,r)(e),r},ed=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ax(lx(e,i)):structuredClone(e):(e,i)=>ax(lx(e,i));function S1(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 C1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function T1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||S1,r=e.options.footnoteBackLabel||C1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),j=Ds(x.toLowerCase());let w=0;const T=[],R=e.footnoteCounts.get(x);for(;R!==void 0&&++w<=R;){T.length>0&&T.push({type:"text",value:" "});let H=typeof a=="string"?a:a(g,w);typeof H=="string"&&(H={type:"text",value:H}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+j+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const q=b[b.length-1];if(q&&q.type==="element"&&q.tagName==="p"){const H=q.children[q.children.length-1];H&&H.type==="text"?H.value+=" ":q.children.push({type:"text",value:" "}),q.children.push(...T)}else b.push(...T);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+j},children:e.wrap(b,!0)};e.patch(m,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...ed(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 ud=(function(e){if(e==null)return D1;if(typeof e=="function")return cd(e);if(typeof e=="object")return Array.isArray(e)?E1(e):A1(e);if(typeof e=="string")return N1(e);throw new Error("Expected function, string, or object as test")});function E1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=ud(e[a]);return cd(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function A1(e){const i=e;return cd(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function N1(e){return cd(i);function i(a){return a&&a.type===e}}function cd(e){return i;function i(a,r,u){return!!(_1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function D1(){return!0}function _1(e){return e!==null&&typeof e=="object"&&"type"in e}const ev=[],R1=!0,$p=!1,M1="skip";function tv(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=ud(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return j;function j(){let w=ev,T,R,q;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=O1(a(g,b)),w[0]===$p))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==M1)for(R=(r?N.children.length:-1)+d,q=b.concat(N);R>-1&&R<N.children.length;){const H=N.children[R];if(T=p(H,R,q)(),T[0]===$p)return T;R=typeof T[1]=="number"?T[1]:R+d}}return w}}}function O1(e){return Array.isArray(e)?e:typeof e=="number"?[R1,e]:e==null?ev:[e]}function kh(e,i,a,r){let u,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,u=a):(c=i,d=a,u=r),tv(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Gp={}.hasOwnProperty,z1={};function L1(e,i){const a=i||z1,r=new Map,u=new Map,c=new Map,d={...x1,...a.handlers},p={all:m,applyData:U1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:I1,wrap:q1};return kh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,j=String(b.identifier).toUpperCase();x.has(j)||x.set(j,b)}}),p;function g(b,x){const j=b.type,w=p.handlers[j];if(Gp.call(p.handlers,j)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(j)){if("children"in b){const{children:R,...q}=b,N=ed(q);return N.children=p.all(b),N}return ed(b)}return(p.options.unknownHandler||B1)(p,b,x)}function m(b){const x=[];if("children"in b){const j=b.children;let w=-1;for(;++w<j.length;){const T=p.one(j[w],b);if(T){if(w&&j[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=rx(T.value)),!Array.isArray(T)&&T.type==="element")){const R=T.children[0];R&&R.type==="text"&&(R.value=rx(R.value))}Array.isArray(T)?x.push(...T):x.push(T)}}}return x}}function I1(e,i){e.position&&(i.position=Sj(e))}function U1(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,ed(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function B1(e,i){const a=i.data||{},r="value"in i&&!(Gp.call(a,"hProperties")||Gp.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function q1(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 rx(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function sx(e,i){const a=L1(e,i),r=a.one(e,void 0),u=T1(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 H1(e,i){return e&&"run"in e?async function(a,r){const u=sx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return sx(a,{file:r,...e||i})}}function ox(e){if(e)throw e}var rp,ux;function $1(){if(ux)return rp;ux=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var j;for(j in m);return typeof j>"u"||e.call(m,j)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return rp=function g(){var m,b,x,j,w,T,R=arguments[0],q=1,N=arguments.length,H=!1;for(typeof R=="boolean"&&(H=R,R=arguments[1]||{},q=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});q<N;++q)if(m=arguments[q],m!=null)for(b in m)x=p(R,b),j=p(m,b),R!==j&&(H&&j&&(c(j)||(w=u(j)))?(w?(w=!1,T=x&&u(x)?x:[]):T=x&&c(x)?x:{},d(R,{name:b,newValue:g(H,T,j)})):typeof j<"u"&&d(R,{name:b,newValue:j}));return R},rp}var G1=$1();const sp=wb(G1);function Vp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function V1(){const e=[],i={run:a,use:r};return i;function a(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?F1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function F1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Zi={basename:P1,dirname:Y1,extname:W1,join:K1,sep:"/"};function P1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');fu(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 Y1(e){if(fu(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 W1(e){fu(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 K1(...e){let i=-1,a;for(;++i<e.length;)fu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":X1(a)}function X1(e){fu(e);const i=e.codePointAt(0)===47;let a=Q1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function Q1(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 fu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Z1={cwd:J1};function J1(){return"/"}function Fp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eC(e){if(typeof e=="string")e=new URL(e);else if(!Fp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return tC(e)}function tC(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 op=["history","path","basename","stem","extname","dirname"];class nv{constructor(i){let a;i?Fp(i)?a={path:i}:typeof i=="string"||nC(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":Z1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<op.length;){const c=op[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)op.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Zi.basename(this.path):void 0}set basename(i){cp(i,"basename"),up(i,"basename"),this.path=Zi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Zi.dirname(this.path):void 0}set dirname(i){cx(this.basename,"dirname"),this.path=Zi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Zi.extname(this.path):void 0}set extname(i){if(up(i,"extname"),cx(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=Zi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Fp(i)&&(i=eC(i)),cp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Zi.basename(this.path,this.extname):void 0}set stem(i){cp(i,"stem"),up(i,"stem"),this.path=Zi.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 pn(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 up(e,i){if(e&&e.includes(Zi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Zi.sep+"`")}function cp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function cx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function nC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),aC={}.hasOwnProperty;class jh extends iC{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=V1()}copy(){const i=new jh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(sp(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(pp("data",this.frozen),this.namespace[i]=a,this):aC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(pp("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=Lc(i),r=this.parser||this.Parser;return dp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),dp("process",this.parser||this.Parser),fp("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=Lc(i),g=r.parse(p);r.run(g,p,function(b,x,j){if(b||!x||!j)return m(b);const w=x,T=r.stringify(w,j);sC(T)?j.value=T:j.result=T,m(b,j)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),dp("processSync",this.parser||this.Parser),fp("processSync",this.compiler||this.Compiler),this.process(i,u),fx("processSync","process",a),r;function u(c,d){a=!0,ox(c),r=d}}run(i,a,r){dx(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=Lc(a);u.run(i,g,m);function m(b,x,j){const w=x||i;b?p(b):d?d(w):r(void 0,w,j)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),fx("runSync","run",r),u;function c(d,p){ox(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=Lc(a),u=this.compiler||this.Compiler;return fp("stringify",u),dx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(pp("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=sp(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,j=-1;for(;++x<r.length;)if(r[x][0]===m){j=x;break}if(j===-1)r.push([m,...b]);else if(b.length>0){let[w,...T]=b;const R=r[j][1];Vp(R)&&Vp(w)&&(w=sp(!0,R,w)),r[j]=[m,w,...T]}}}}const lC=new jh().freeze();function dp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pp(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 dx(e){if(!Vp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Lc(e){return rC(e)?e:new nv(e)}function rC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function sC(e){return typeof e=="string"||oC(e)}function oC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",px=[],hx={allowDangerousHtml:!0},cC=/^(https?|ircs?|mailto|xmpp)$/i,dC=[{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 fC(e){const i=pC(e),a=hC(e);return mC(i.runSync(i.parse(a),a),e)}function pC(e){const i=e.rehypePlugins||px,a=e.remarkPlugins||px,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hx}:hx;return lC().use(P0).use(a).use(H1,r).use(i)}function hC(e){const i=e.children||"",a=new nv;return typeof i=="string"&&(a.value=i),a}function mC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||gC;for(const b of dC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+uC+b.id,void 0);return kh(e,m),Nj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,j){if(b.type==="raw"&&j&&typeof x=="number")return d?j.children.splice(x,1):j.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in ip)if(Object.hasOwn(ip,w)&&Object.hasOwn(b.properties,w)){const T=b.properties[w],R=ip[w];(R===null||R.includes(b.tagName))&&(b.properties[w]=g(String(T||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,j)),w&&j&&typeof x=="number")return p&&b.children?j.children.splice(x,1,...b.children):j.children.splice(x,1),x}}}function gC(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||cC.test(e.slice(0,i))?e:""}function mx(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 yC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function xC(e,i,a){const u=ud((a||{}).ignore||[]),c=bC(i);let d=-1;for(;++d<c.length;)tv(e,"text",p);function p(m,b){let x=-1,j;for(;++x<b.length;){const w=b[x],T=j?j.children:void 0;if(u(w,T?T.indexOf(w):void 0,j))return;j=w}if(j)return g(m,b)}function g(m,b){const x=b[b.length-1],j=c[d][0],w=c[d][1];let T=0;const q=x.children.indexOf(m);let N=!1,H=[];j.lastIndex=0;let $=j.exec(m.value);for(;$;){const F=$.index,ie={index:$.index,input:$.input,stack:[...b,m]};let _=w(...$,ie);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?j.lastIndex=F+1:(T!==F&&H.push({type:"text",value:m.value.slice(T,F)}),Array.isArray(_)?H.push(..._):_&&H.push(_),T=F+$[0].length,N=!0),!j.global)break;$=j.exec(m.value)}return N?(T<m.value.length&&H.push({type:"text",value:m.value.slice(T)}),x.children.splice(q,1,...H)):H=[m],q+H.length}}function bC(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([vC(u[0]),wC(u[1])])}return i}function vC(e){return typeof e=="string"?new RegExp(yC(e),"g"):e}function wC(e){return typeof e=="function"?e:function(){return e}}const hp="phrasing",mp=["autolink","link","image","label"];function kC(){return{transforms:[NC],enter:{literalAutolink:SC,literalAutolinkEmail:gp,literalAutolinkHttp:gp,literalAutolinkWww:gp},exit:{literalAutolink:AC,literalAutolinkEmail:EC,literalAutolinkHttp:CC,literalAutolinkWww:TC}}}function jC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hp,notInConstruct:mp},{character:":",before:"[ps]",after:"\\/",inConstruct:hp,notInConstruct:mp}]}}function SC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gp(e){this.config.enter.autolinkProtocol.call(this,e)}function CC(e){this.config.exit.autolinkProtocol.call(this,e)}function TC(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 EC(e){this.config.exit.autolinkEmail.call(this,e)}function AC(e){this.exit(e)}function NC(e){xC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,DC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_C]],{ignore:["link","linkReference"]})}function DC(e,i,a,r,u){let c="";if(!iv(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!RC(a)))return!1;const d=MC(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 _C(e,i,a,r){return!iv(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function RC(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 MC(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=mx(e,"(");let c=mx(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 iv(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||vr(a)||rd(a))&&(!i||a!==47)}av.peek=$C;function OC(){this.buffer()}function zC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LC(){this.buffer()}function IC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function UC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ji(this.sliceSerialize(e)).toLowerCase(),a.label=i}function BC(e){this.exit(e)}function qC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=ji(this.sliceSerialize(e)).toLowerCase(),a.label=i}function HC(e){this.exit(e)}function $C(){return"["}function av(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 GC(){return{enter:{gfmFootnoteCallString:OC,gfmFootnoteCall:zC,gfmFootnoteDefinitionLabelString:LC,gfmFootnoteDefinition:IC},exit:{gfmFootnoteCallString:UC,gfmFootnoteCall:BC,gfmFootnoteDefinitionLabelString:qC,gfmFootnoteDefinition:HC}}}function VC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:av},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
+ `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?lv:FC))),m(),g}}function FC(e,i,a){return i===0?e:lv(e,i,a)}function lv(e,i,a){return(a?"":" ")+e}const PC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rv.peek=QC;function YC(){return{canContainEols:["delete"],enter:{strikethrough:KC},exit:{strikethrough:XC}}}function WC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PC}],handlers:{delete:rv}}}function KC(e){this.enter({type:"delete",children:[]},e)}function XC(e){this.exit(e)}function rv(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 QC(){return"~"}function ZC(e){return e.length}function JC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||ZC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const R=[],q=[];let N=-1;for(e[b].length>m&&(m=e[b].length);++N<e[b].length;){const H=eT(e[b][N]);if(a.alignDelimiters!==!1){const $=u(H);q[N]=$,(g[N]===void 0||$>g[N])&&(g[N]=$)}R.push(H)}d[b]=R,p[b]=q}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=gx(r[x]);else{const R=gx(r);for(;++x<m;)c[x]=R}x=-1;const j=[],w=[];for(;++x<m;){const R=c[x];let q="",N="";R===99?(q=":",N=":"):R===108?q=":":R===114&&(N=":");let H=a.alignDelimiters===!1?1:Math.max(1,g[x]-q.length-N.length);const $=q+"-".repeat(H)+N;a.alignDelimiters!==!1&&(H=q.length+H+N.length,H>g[x]&&(g[x]=H),w[x]=H),j[x]=$}d.splice(1,0,j),p.splice(1,0,w),b=-1;const T=[];for(;++b<d.length;){const R=d[b],q=p[b];x=-1;const N=[];for(;++x<m;){const H=R[x]||"";let $="",F="";if(a.alignDelimiters!==!1){const ie=g[x]-(q[x]||0),_=c[x];_===114?$=" ".repeat(ie):_===99?ie%2?($=" ".repeat(ie/2+.5),F=" ".repeat(ie/2-.5)):($=" ".repeat(ie/2),F=$):F=" ".repeat(ie)}a.delimiterStart!==!1&&!x&&N.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||x)&&N.push(" "),a.alignDelimiters!==!1&&N.push($),N.push(H),a.alignDelimiters!==!1&&N.push(F),a.padding!==!1&&N.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&N.push("|")}T.push(a.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return T.join(`
65
+ `)}function eT(e){return e==null?"":String(e)}function gx(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 tT(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()),nT);return u(),d}function nT(e,i,a){return">"+(a?"":" ")+e}function iT(e,i){return yx(e,i.inConstruct,!0)&&!yx(e,i.notInConstruct,!1)}function yx(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 xx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
66
+ `&&iT(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
+ `}function aT(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 lT(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 rT(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 sT(e,i,a,r){const u=rT(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(lT(e,a)){const x=a.enter("codeIndented"),j=a.indentLines(c,oT);return x(),j}const p=a.createTracker(r),g=u.repeat(Math.max(aT(c,u)+1,3)),m=a.enter("codeFenced");let b=p.move(g);if(e.lang){const x=a.enter(`codeFencedLang${d}`);b+=p.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(a.safe(e.meta,{before:b,after:`
68
+ `,encode:["`"],...p.current()})),x()}return b+=p.move(`
69
+ `),c&&(b+=p.move(c+`
70
+ `)),b+=p.move(g),m(),b}function oT(e,i,a){return(a?"":" ")+e}function Sh(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function uT(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
71
+ `,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function cT(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 uu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function td(e,i,a){const r=Es(e),u=Es(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}}sv.peek=dT;function sv(e,i,a,r){const u=cT(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=td(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=uu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=td(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+uu(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function dT(e,i,a){return a.options.emphasis||"*"}function fT(e,i){let a=!1;return kh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,$p}),!!((!e.depth||e.depth<3)&&mh(e)&&(i.options.setext||a))}function pT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(fT(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),j=a.containerPhrasing(e,{...c.current(),before:`
72
+ `,after:`
73
+ `});return x(),b(),j+`
74
+ `+(u===1?"=":"-").repeat(j.length-(Math.max(j.lastIndexOf("\r"),j.lastIndexOf(`
75
+ `))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
76
+ `,...c.current()});return/^[\t ]/.test(m)&&(m=uu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}ov.peek=hT;function ov(e){return e.value||""}function hT(){return"<"}uv.peek=mT;function uv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function mT(){return"!"}cv.peek=gT;function cv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function gT(){return"!"}dv.peek=yT;function dv(e,i,a){let r=e.value||"",u="`",c=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<a.unsafe.length;){const d=a.unsafe[c],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function yT(){return"`"}function fv(e,i){const a=mh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}pv.peek=xT;function pv(e,i,a,r){const u=Sh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(fv(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function xT(e,i,a){return fv(e,a)?"<":"["}hv.peek=bT;function hv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function bT(){return"["}function Ch(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function vT(e){const i=Ch(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function wT(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 mv(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 kT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?wT(a):Ch(a);const p=e.ordered?d==="."?")":".":vT(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),mv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const j=e.children[x];if(j&&j.type==="listItem"&&j.children&&j.children[0]&&j.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function jT(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 ST(e,i,a,r){const u=jT(a);let c=a.bulletCurrent||Ch(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,j,w){return j?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function CT(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const TT=ud(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ET(e,i,a,r){return(e.children.some(function(d){return TT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function AT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}gv.peek=NT;function gv(e,i,a,r){const u=AT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=td(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=uu(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=td(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+uu(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function NT(e,i,a){return a.options.strong||"*"}function DT(e,i,a,r){return a.safe(e.value,r)}function _T(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 RT(e,i,a){const r=(mv(a)+(a.options.ruleSpaces?" ":"")).repeat(_T(a));return a.options.ruleSpaces?r.slice(0,-1):r}const yv={blockquote:tT,break:xx,code:sT,definition:uT,emphasis:sv,hardBreak:xx,heading:pT,html:ov,image:uv,imageReference:cv,inlineCode:dv,link:pv,linkReference:hv,list:kT,listItem:ST,paragraph:CT,root:ET,strong:gv,text:DT,thematicBreak:RT};function MT(){return{enter:{table:OT,tableData:bx,tableHeader:bx,tableRow:LT},exit:{codeText:IT,table:zT,tableData:yp,tableHeader:yp,tableRow:yp}}}function OT(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 zT(e){this.exit(e),this.data.inTable=void 0}function LT(e){this.enter({type:"tableRow",children:[]},e)}function yp(e){this.exit(e)}function bx(e){this.enter({type:"tableCell",children:[]},e)}function IT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,UT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function UT(e,i){return i==="|"?i:e}function BT(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
77
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:j,table:d,tableCell:g,tableRow:p}};function d(w,T,R,q){return m(b(w,R,q),w.align)}function p(w,T,R,q){const N=x(w,R,q),H=m([N]);return H.slice(0,H.indexOf(`
78
+ `))}function g(w,T,R,q){const N=R.enter("tableCell"),H=R.enter("phrasing"),$=R.containerPhrasing(w,{...q,before:c,after:c});return H(),N(),$}function m(w,T){return JC(w,{align:T,alignDelimiters:r,padding:a,stringLength:u})}function b(w,T,R){const q=w.children;let N=-1;const H=[],$=T.enter("table");for(;++N<q.length;)H[N]=x(q[N],T,R);return $(),H}function x(w,T,R){const q=w.children;let N=-1;const H=[],$=T.enter("tableRow");for(;++N<q.length;)H[N]=g(q[N],w,T,R);return $(),H}function j(w,T,R){let q=yv.inlineCode(w,T,R);return R.stack.includes("tableCell")&&(q=q.replace(/\|/g,"\\$&")),q}}function qT(){return{exit:{taskListCheckValueChecked:vx,taskListCheckValueUnchecked:vx,paragraph:$T}}}function HT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:GT}}}function vx(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 GT(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=yv.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function VT(){return[kC(),GC(),YC(),MT(),qT()]}function FT(e){return{extensions:[jC(),VC(e),WC(),BT(e),HT()]}}const PT={tokenize:ZT,partial:!0},xv={tokenize:JT,partial:!0},bv={tokenize:eE,partial:!0},vv={tokenize:tE,partial:!0},YT={tokenize:nE,partial:!0},wv={name:"wwwAutolink",tokenize:XT,previous:jv},kv={name:"protocolAutolink",tokenize:QT,previous:Sv},Oa={name:"emailAutolink",tokenize:KT,previous:Cv},ta={};function WT(){return{text:ta}}let hr=48;for(;hr<123;)ta[hr]=Oa,hr++,hr===58?hr=65:hr===91&&(hr=97);ta[43]=Oa;ta[45]=Oa;ta[46]=Oa;ta[95]=Oa;ta[72]=[Oa,kv];ta[104]=[Oa,kv];ta[87]=[Oa,wv];ta[119]=[Oa,wv];function KT(e,i,a){const r=this;let u,c;return d;function d(x){return!Pp(x)||!Cv.call(r,r.previous)||Th(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Pp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(YT,b,m)(x):x===45||x===95||fn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&vn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function XT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!jv.call(r,r.previous)||Th(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(PT,e.attempt(xv,e.attempt(bv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function QT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Sv.call(r,r.previous)&&!Th(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(vn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const j=u.toLowerCase();if(j==="http"||j==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||Zc(x)||xt(x)||vr(x)||rd(x)?a(x):e.attempt(xv,e.attempt(bv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function ZT(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 JT(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(vv,g,p)(m):m===null||xt(m)||vr(m)||m!==45&&rd(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function eE(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(vv,i,c)(d):d===null||xt(d)||vr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function tE(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||xt(p)||vr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||xt(p)||vr(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 nE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return fn(c)?a(c):i(c)}}function jv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function Sv(e){return!vn(e)}function Cv(e){return!(e===47||Pp(e))}function Pp(e){return e===43||e===45||e===46||e===95||fn(e)}function Th(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const iE={tokenize:dE,partial:!0};function aE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oE,continuation:{tokenize:uE},exit:cE}},text:{91:{name:"gfmFootnoteCall",tokenize:sE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lE,resolveTo:rE}}}}function lE(e,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return a(g);const m=ji(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function rE(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 sE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||xt(x))return a(x);if(x===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return u.includes(ji(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return xt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function oE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(T)}function b(T){if(d>999||T===93&&!p||T===null||T===91||xt(T))return a(T);if(T===93){e.exit("chunkString");const R=e.exit("gfmFootnoteDefinitionLabelString");return c=ji(r.sliceSerialize(R)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),j}return xt(T)||(p=!0),d++,e.consume(T),T===92?x:b}function x(T){return T===91||T===92||T===93?(e.consume(T),d++,b):b(T)}function j(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),u.includes(c)||u.push(c),et(e,w,"gfmFootnoteDefinitionWhitespace")):a(T)}function w(T){return i(T)}}function uE(e,i,a){return e.check(du,i,e.attempt(iE,i,a))}function cE(e){e.exit("gfmFootnoteDefinition")}function dE(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 fE(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},j=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Zn(j,j.length,0,sd(w,d.slice(m+1,g),p)),Zn(j,j.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Zn(d,m-1,g-m+3,j),g=m+j.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return j;function j(T){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const R=Es(m);if(T===126)return x>1?g(T):(d.consume(T),x++,w);if(x<2&&!a)return g(T);const q=d.exit("strikethroughSequenceTemporary"),N=Es(T);return q._open=!N||N===2&&!!R,q._close=!R||R===2&&!!N,p(T)}}}class pE{constructor(){this.map=[]}add(i,a,r){hE(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 hE(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 mE(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 gE(){return{flow:{null:{name:"table",tokenize:yE,resolveAll:xE}}}}function yE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(L){let te=r.events.length-1;for(;te>-1;){const ye=r.events[te][1].type;if(ye==="lineEnding"||ye==="linePrefix")te--;else break}const de=te>-1?r.events[te][1].type:null,Ne=de==="tableHead"||de==="tableRow"?_:g;return Ne===_&&r.parser.lazy[r.now().line]?a(L):Ne(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?a(L):Oe(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):a(L):Ke(L)?et(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||xt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?j:x)}function j(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(L):(e.enter("tableDelimiterRow"),d=!1,Ke(L)?et(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):T(L))}function T(L){return L===45||L===58?q(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),R):ie(L)}function R(L){return Ke(L)?et(e,q,"whitespace")(L):q(L)}function q(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),N):L===45?(c+=1,N(L)):L===null||Oe(L)?F(L):ie(L)}function N(L){return L===45?(e.enter("tableDelimiterFiller"),H(L)):ie(L)}function H(L){return L===45?(e.consume(L),H):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(L))}function $(L){return Ke(L)?et(e,F,"whitespace")(L):F(L)}function F(L){return L===124?T(L):L===null||Oe(L)?!d||u!==c?ie(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):ie(L)}function ie(L){return a(L)}function _(L){return e.enter("tableRow"),Q(L)}function Q(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),Q):L===null||Oe(L)?(e.exit("tableRow"),i(L)):Ke(L)?et(e,Q,"whitespace")(L):(e.enter("data"),re(L))}function re(L){return L===null||L===124||xt(L)?(e.exit("data"),Q(L)):(e.consume(L),L===92?ee:re)}function ee(L){return L===92||L===124?(e.consume(L),re):re(L)}}function xE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const j=new pE;for(;++a<e.length;){const w=e[a],T=w[1];w[0]==="enter"?T.type==="tableHead"?(p=!1,g!==0&&(wx(j,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(a,0,[["enter",m,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(a,0,[["enter",b,i]])),u=T.type==="tableDelimiterRow"?2:b?3:1):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Ic(j,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Ic(j,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):T.type==="tableHead"?(p=!0,g=a):T.type==="tableRow"||T.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=Ic(j,i,c,u,a,x)):d[1]!==0&&(x=Ic(j,i,d,u,a,x)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&wx(j,i,g,m,b),j.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=mE(i.events,a))}return e}function Ic(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},js(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=js(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=js(i.events,a[2]),b=js(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const j=i.events[a[2]],w=i.events[a[3]];if(j[1].end=Object.assign({},w[1].end),j[1].type="chunkText",j[1].contentType="text",a[3]>a[2]+1){const T=a[2]+1,R=a[3]-a[2]-1;e.add(T,R,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},js(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function wx(e,i,a,r,u){const c=[],d=js(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 js(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const bE={name:"tasklistCheck",tokenize:wE};function vE(){return{text:{91:bE}}}function wE(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 xt(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 Oe(g)?i(g):Ke(g)?e.check({tokenize:kE},i,a)(g):a(g)}}function kE(e,i,a){return et(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function jE(e){return Lb([WT(),aE(),fE(e),gE(),vE()])}const SE={};function CE(e){const i=this,a=e||SE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(jE(a)),c.push(VT()),d.push(FT(a))}function TE(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=AE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function iu(e,i){return!!(i&&e.includes(i))}function EE(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 AE(e){return e&&typeof e=="object"?e:{}}const NE=["summary","message","status","instruction","description","reason","error","text"],kx=96,DE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),_E=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),RE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),Tv=new Set(["item/commandExecution/terminalInteraction"]),ME=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function OE(e){if(e.event!=="codex.notification")return!1;const i=ea(e.data);return typeof i.method=="string"&&Tv.has(i.method)}function zE(e){if(_E.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||DE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ea(e.data),a=typeof i.method=="string"?i.method:"",r=ea(i.params),u=ea(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||Tv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||RE.has(c)?null:a}function Ev(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?ME.get(a)??Av(a):r}function wr(e,i=[]){const a=ea(e),u=[...i,...NE.map(c=>au(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=kx?u:`${u.slice(0,kx-3)}...`:"查看详情"}function Yp(e,i=new Map){const a=ea(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:wr({},[p])}}function LE(e){const i=ea(e),a=Array.isArray(i.offers)?i.offers.map(ea).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=au(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:wr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function IE(e){const i=ea(e),a=au(i.actionType)??"",r=ea(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(au(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:wr(r,[au(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:wr(r,[Av(a||"agent action")]),meta:"after turn"}}function Av(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 au(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ea(e){return e&&typeof e=="object"?e:{}}function Wp(e){const i=Kp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Kp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=HE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=qE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function Nv(e,i){const a=Sx(e),r=Sx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function UE(e,i){if(e.length===0)return"File changed";const a=Nv(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function BE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function qE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:jx(e),deletions:0};if(i==="delete")return{additions:0,deletions:jx(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 jx(e){const i=e.split(`
80
+ `).length;return e.endsWith(`
81
+ `)?Math.max(0,i-1):i}function HE(e){const i=Kp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Sx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Kp(e){return e&&typeof e=="object"?e:{}}const Eh=["low","medium","high","xhigh"],$E=["none","minimal",...Eh,"max"];function Cs(e){const i=e.trim();return i?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[i]??i:"Use model default"}function Cx(e,i){const a=kr(e),r=kr(i==null?void 0:i.defaultReasoningEffort);return a?a===r?`${Cs(a)} (model default)`:Cs(a):r?`Auto (model default: ${Cs(r)})`:"Auto (follow model default)"}function GE(e,i=""){const a=kr(e==null?void 0:e.defaultReasoningEffort),r=[];if(!e){r.push({value:"",label:"Use model default"});const p=kr(i);return p&&_v(p)&&r.push({value:p,label:`${Cs(p)} (configured)`}),r}const c=(Dv(e)??Eh).filter(p=>!Xp(p));a&&!Xp(a)&&!c.includes(a)&&c.unshift(a),a&&c.includes(a)||r.push({value:"",label:"Use model default"});for(const p of c)r.push({value:p===a?"":p,label:p===a?`${Cs(p)} (model default)`:Cs(p)});return r}function Tx(e,i){const a=kr(e);if(!a||Xp(a))return"";const r=kr(i==null?void 0:i.defaultReasoningEffort);if(r&&a===r)return"";if(!i)return _v(a)?a:"";const u=Dv(i);return u!==null?u.includes(a)?a:"":Eh.includes(a)?a:""}function VE(e,i,a){return a||e!==i?e:null}function Dv(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const i=[];for(const a of e.supportedReasoningEfforts){const r=kr(a==null?void 0:a.reasoningEffort);r&&!i.includes(r)&&i.push(r)}return i}function kr(e){return typeof e=="string"?e.trim():""}function Xp(e){return e.toLowerCase()==="ultra"}function _v(e){return $E.includes(e)}function FE(e,i){return{textareaDisabled:!1,sendDisabled:i||!e.trim()}}function PE(e,i){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?i&&!e.complexTaskActive?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function YE(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function Ex(e,i){return e.conversationId===i.conversationId&&e.version===i.version}const Ax=15e3,Nx=[1e3,2e3,5e3,1e4,15e3];function WE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:Ax}:{kind:"none"}:{kind:"probe",waitMs:Ax}}function KE(e){const i=Math.min(Math.max(1,Math.floor(e))-1,Nx.length-1);return Nx[i]}function XE(e){const i=Dx(e),a=Dx(i.conversation),r=i.workspaceStatus??i.status??a.status;return r==="idle"||r==="error"||r==="done"||r==="initialization_failed"?r:"done"}function Dx(e){return e&&typeof e=="object"?e:{}}function QE(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Qp="seele:authentication-required",Zp="seele:deployment-status-required",Rv=12,ZE=3e3,Jp="seele.activeWorkspaceId",Mv="seele.workspaceOrder",Ov="seele.workspaceGroupOrder",zv="seele.workspaceDrafts",Lv="seele.collapsedWorkspaceGroups",Iv="seele.sidebarWidth",_x=5,Rx=275,JE=236,eA=420,Mx="default",Ox=300,tA=3,nA=10,iA=2,aA=13,lA=1.65,rA=20,sA=900;class Ji extends Error{constructor(a,r,u,c){super(a);Mc(this,"detail");Mc(this,"status");Mc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const oA=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Fo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Uv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function ge(e){return`${Uv()}api/${e.replace(/^\/+/,"")}`}function Ah(e=""){return`${Uv()}${e.replace(/^\/+/,"")}`}async function Jt(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 Ji(r,u,e.status,a)}function He(e){return e instanceof Ji?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function mr(e){const i=He(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Ce(e,i){if(!e.ok)throw await Jt(e,i)}function uA(e){return e instanceof Ji&&e.status===410&&e.body.includes('"turn_not_active"')}function cA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"turn_not_running"')}function dA(e){return e instanceof Ji&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function zx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function fA(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function Nh(e){return Math.max(JE,Math.min(eA,Math.round(e)))}function pA(){try{const e=window.localStorage.getItem(Iv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?Nh(i):Rx}catch{return Rx}}function hA(e){try{window.localStorage.setItem(Iv,String(Nh(e)))}catch{}}function xp(e){Bv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function mA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function gA(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*tA+r+u,d=a*nA+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 yA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(iA,Math.max(1,i+1))}function xA(e){return Math.ceil(yA(e)*aA*lA+rA)}function Bv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function bA(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 vA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function Lx(e,i){Bv(e,()=>{const a=vA(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 wA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||Lx(e,i)});Lx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){a||(a=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function kA(){try{return window.localStorage.getItem(Jp)}catch{return null}}function bp(e){try{e?window.localStorage.setItem(Jp,e):window.localStorage.removeItem(Jp)}catch{}}function qv(){try{const e=window.localStorage.getItem(Mv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Hv(){try{const e=window.localStorage.getItem(Ov),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function $v(e){try{window.localStorage.setItem(Ov,JSON.stringify(e))}catch{}}function Yc(e){try{window.localStorage.setItem(Mv,JSON.stringify(e))}catch{}}function Gv(){try{const e=window.localStorage.getItem(zv),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 jA(e){return e?Gv()[e]??"":""}function vp(e,i){if(e)try{const a=Gv();i?a[e]=i:delete a[e],window.localStorage.setItem(zv,JSON.stringify(a))}catch{}}function SA(){try{const e=window.localStorage.getItem(Lv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function wp(e){try{window.localStorage.setItem(Lv,JSON.stringify(Array.from(e)))}catch{}}function Po(e){const i=qv();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 Uc(e){const i=Hv();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 kp(e){const i=new Set(e.map(u=>u.id)),a=qv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Yc([...a,...r])}function jp(e){const i=new Set(e.map(u=>u.id)),a=Hv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));$v([...a,...r])}function CA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function TA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function EA(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 AA({authEnabled:e,currentUser:i,onLogout:a}){var or,ur,co,fo;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,j]=D.useState(null),[w,T]=D.useState(null),[R,q]=D.useState("simple"),[N,H]=D.useState(null),[$,F]=D.useState(null),[ie,_]=D.useState(null),[Q,re]=D.useState(!1),[ee,L]=D.useState(!1),[te,de]=D.useState({}),[Ne,ye]=D.useState({}),[ue,V]=D.useState(null),[oe,be]=D.useState([]),[Re,O]=D.useState(null),[A,z]=D.useState(!1),[C,W]=D.useState(null),[fe,X]=D.useState("checking"),[xe,Me]=D.useState(null),[Ve,Ct]=D.useState(!1),[vt,sn]=D.useState(null),[Fe,jt]=D.useState(!1),[It,on]=D.useState(null),[Le,Ut]=D.useState(!1),[hn,Kt]=D.useState([]),[Si,Jn]=D.useState([]),[za,Mt]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[La,ae]=D.useState({profuseNotificationEnabled:!0}),[ce,Ee]=D.useState([]),[Ue,Xe]=D.useState(null),[Vt,ei]=D.useState(null),[Ft,Et]=D.useState(!1),[dt,st]=D.useState(null),[Ci,wn]=D.useState(!1),[hd,Tr]=D.useState(null),[Er,Dl]=D.useState(!1),[Ti,Ia]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[en,Ua]=D.useState("global"),[wt,na]=D.useState(null),[Ba,_l]=D.useState(null),[_s,qa]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[pu,Ar]=D.useState({memory:"",items:[]}),[Rs,Ms]=D.useState({memory:"",items:[]}),[hu,ti]=D.useState({memory:"",items:[]}),[Pt,Bt]=D.useState([]),[Un,Ei]=D.useState(Fo),[Ha,$a]=D.useState({description:"",key:"",value:""}),[Nr,Ai]=D.useState(null),[Os,ni]=D.useState(()=>new Set),[Ni,ia]=D.useState(!1),[Di,At]=D.useState(!1),[mu,zs]=D.useState(!1),[un,_i]=D.useState(null),[gu,yu]=D.useState(!0),[xu,Ga]=D.useState(!1),[Rl,Ml]=D.useState(!1),[pi,mn]=D.useState(!1),[hi,aa]=D.useState(null),[Ls,mi]=D.useState(null),[Ri,bu]=D.useState(null),[Nt,Bn]=D.useState(null),[Mi,Dr]=D.useState(null),[ii,Is]=D.useState(null),[Ol,Va]=D.useState(()=>new Set),[_r,Fa]=D.useState(null),[Rr,zl]=D.useState(null),[vu,Mr]=D.useState(null),[gn,Xt]=D.useState(null),[Ll,la]=D.useState(null),[Oi,zi]=D.useState(()=>SA()),[wu,Il]=D.useState(()=>pA()),[Us,Ul]=D.useState(230),[tn,Bs]=D.useState(()=>Date.now()),[Bl,Li]=D.useState(0),Or=D.useRef(null),ra=D.useRef(null),qs=D.useRef(null),Pa=D.useRef(null),gi=D.useRef(null),ql=D.useRef(!0),nn=D.useRef(null),qn=D.useRef(null),Ya=D.useRef(null),sa=D.useRef(new Set),Hs=D.useRef(!1),zr=D.useRef([]),Hl=D.useRef(null),Wa=D.useRef(null),Ii=D.useRef(new Map),Ka=D.useRef(new Map),Lr=D.useRef(new Set),Ir=D.useRef(new Map),$l=D.useRef(new Map),Ui=D.useRef(new Map),Xa=D.useRef(new Set),Bi=D.useRef(null),kn=D.useRef(new Map),jn=D.useRef(new Map),Qa=D.useRef(new Map),Za=D.useRef(new Set),Ur=D.useRef(null),Br=D.useRef(null),$s=D.useRef(!1),Gs=D.useRef(!1),De=p.find(y=>y.id===x),ku=(De==null?void 0:De.unreadTurnCount)??0,ai=p.find(y=>y.id===un),Qt=p.find(y=>y.id===wt),qr=p.find(y=>y.id===_r),Gl=D.useMemo(()=>{const k=Uc(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),S=new Map(k.map(U=>[U.id,U])),M=k[0];for(const U of p)(S.get(U.groupId)??M).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[p,m]),at=x!==null?te[x]:null,Ja=(at==null?void 0:at.messages)??[],Hr=(at==null?void 0:at.events)??[],Vl=PD(FD(Hr),x?Ne[x]:null),Fl=jw(Vl),Vs=(at==null?void 0:at.status)??(De==null?void 0:De.status)??"idle",oa=rh(De,Vs),md=un!==null?((or=te[un])==null?void 0:or.status)??(ai==null?void 0:ai.status)??"idle":"idle",Fs=rh(ai,md),yi=x?jn.current.get(x)??null:null,ju=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),$r=D.useMemo(()=>kN(Ja,Hr,(at==null?void 0:at.turns)??[],(at==null?void 0:at.timelineNodes)??[],yi,ju),[yi,at==null?void 0:at.timelineNodes,at==null?void 0:at.turns,Hr,Ja,ju]),Gr=D.useMemo(()=>new Set(Ja.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Ja]),Pl=x!==null&&Ol.has(x),Su=x!==null&&c.has(x),Ps=FE(r,Su),qi=yi?(ur=$r.find(y=>iu(y.turnIds,yi)))==null?void 0:ur.activity:null,Vr=oa==="running"||oa==="initializing"||Pl?qi&&!RD(qi)?qi:{title:oa==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,gd=!Vr&&oa==="waiting"&&(De!=null&&De.nextWakeup)?{title:"Scheduled wakeup",detail:ld(De.nextWakeup,tn),createdAt:De.nextWakeup.wakeAt,tone:"waiting"}:null,Yl=Vr??gd,Cu=D.useMemo(()=>VD(Object.values(te)),[te]),Tu=fb(C,Cu);D.useEffect(()=>{Eu(),xd()},[]),D.useEffect(()=>()=>{gi.current!==null&&window.clearTimeout(gi.current)},[]),D.useEffect(()=>{Wr(!1),Wr(!0);const y=window.setInterval(()=>{Wr(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>Bs(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Za.current=Ol},[Ol]),D.useEffect(()=>{Hl.current=x},[x]),D.useLayoutEffect(()=>{const y=Wa.current;if(Wa.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const S=Pa.current;S&&!S.disabled&&!document.querySelector('[aria-modal="true"]')&&S.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),D.useEffect(()=>{zr.current=p},[p]),D.useEffect(()=>{x&&bp(x)},[x]),D.useLayoutEffect(()=>{if(!x||ku<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(M=>M.map(U=>U.id===x?{...U,unreadTurnCount:0}:U));try{await D2(x)}catch(M){y||console.error(M)}}},S=()=>void k();return k(),document.addEventListener("visibilitychange",S),()=>{y=!0,document.removeEventListener("visibilitychange",S)}},[x,ku]),D.useEffect(()=>{q("simple"),T(null),x&&(Cn(x),ma(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void yd(),ZE);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(jA(x))},[x]),D.useEffect(()=>{if(!x)return;const y=WE({workspaceRunning:Vs==="running",streamLeaseActive:Pl,controllerActive:kn.current.has(x),currentTurnAbsent:Lr.current.has(x),retryAt:$l.current.get(x)??null,now:Date.now()});y.kind==="probe"&&ns(x,{waitMs:y.waitMs})},[x,Pl,Bl,Vs]),D.useEffect(()=>()=>{for(const y of Ui.current.values())window.clearTimeout(y);Ui.current.clear()},[]),D.useEffect(()=>{if(!x)return;let y=!1;return nD(x).then(k=>{y||ye(S=>({...S,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&en==="workspace"&&Ua("global")},[x,en]),D.useEffect(()=>{var y;if(Le){if(!wt&&x){na(x);return}wt&&!p.some(k=>k.id===wt)&&na(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,Le,wt]),D.useEffect(()=>{if(!Le||i.role!=="admin")return;const y=window.setInterval(()=>void Jl(),5e3);return()=>window.clearInterval(y)},[i.role,Le]),D.useEffect(()=>{!Le||en!=="workspace"||ti({memory:(Qt==null?void 0:Qt.memory)??"",items:(Qt==null?void 0:Qt.memoryItems)??[]})},[en,Le,Qt==null?void 0:Qt.id,Qt==null?void 0:Qt.memory,Qt==null?void 0:Qt.memoryItems]),D.useEffect(()=>{if(!Ni)return;x&&fa(x);const y=k=>{k.key==="Escape"&&ia(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ni]),D.useEffect(()=>{if(!Le)return;const y=k=>{k.key==="Escape"&&Ut(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Le]),D.useEffect(()=>{var k;if(!Di)return;if(un&&!p.some(S=>S.id===un)){_i(x??((k=p[0])==null?void 0:k.id)??null);return}const y=S=>{S.key==="Escape"&&(hi?aa(null):At(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Di,hi,un,p]),D.useEffect(()=>{if(!Nt)return;Dr(null);const y=k=>{k.key==="Escape"&&Bn(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Nt]),D.useLayoutEffect(()=>{gA(Pa.current)},[r]),D.useLayoutEffect(()=>{const y=qs.current;if(!y)return;const k=()=>{const M=y.getBoundingClientRect();Ul(Math.ceil(M.height+44))};k();const S=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return S==null||S.observe(y),window.addEventListener("resize",k),()=>{S==null||S.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var Z,pe;const y=ra.current;if(!y)return;const k=nn.current!==x;nn.current=x,k&&((Z=Bi.current)==null||Z.call(Bi),Bi.current=null);const S=qn.current;if(S&&S.conversationId===x){(pe=Bi.current)==null||pe.call(Bi),Bi.current=wA(y,S),qn.current=null,ql.current=!1;return}if(!k&&!ql.current)return;ql.current=!0,xp(y);const M=requestAnimationFrame(()=>xp(y)),U=window.setTimeout(()=>xp(y),120);return()=>{cancelAnimationFrame(M),window.clearTimeout(U)}},[x,Hr.length,Ja.length]);async function Wl(){var k;const y=ra.current;y&&(ql.current=mA(y),!(!x||!((k=at==null?void 0:at.history)!=null&&k.hasMoreBefore))&&(at.loadingOlder||sa.current.has(x)||y.scrollTop>96||await es(x)))}function ua(y){var S,M;if(y.history)return y.history;const k=((S=y.timelineNodes)==null?void 0:S.filter(U=>U.parentId===null).reduce((U,Z)=>U===null||Z.timelineAt<U.timelineAt||Z.timelineAt===U.timelineAt&&Z.sequence<U.sequence?Z:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((M=y.messages[0])==null?void 0:M.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function ca(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Dr(y.url)}async function Hi(y,k){await navigator.clipboard.writeText(k),Is(y),gi.current!==null&&window.clearTimeout(gi.current),gi.current=window.setTimeout(()=>{Is(null),gi.current=null},1800)}function we(y,k,S){const M=Date.now();bu({id:M,tone:y,text:k,detail:S}),window.setTimeout(()=>{bu(U=>(U==null?void 0:U.id)===M?null:U)},S?8e3:2400)}function Kl(y){const k=Ui.current.get(y);k!==void 0&&(window.clearTimeout(k),Ui.current.delete(y))}function da(y){Lr.current.delete(y),Ir.current.delete(y),$l.current.delete(y),Xa.current.delete(y),Kl(y)}function Fr(y){Lr.current.add(y),Ir.current.delete(y),$l.current.delete(y),Xa.current.delete(y),Kl(y)}function Pr(y){Lr.current.add(y),Xa.current.delete(y);const k=(Ir.current.get(y)??0)+1;Ir.current.set(y,k);const S=KE(k);$l.current.set(y,Date.now()+S),Kl(y);const M=window.setTimeout(()=>{Ui.current.delete(y),Li(U=>U+1)},S);Ui.current.set(y,M)}function Yr(y,k){k!=="running"&&da(y)}async function Eu(){try{const[y,k]=await Promise.all([nb(),ab()]);X("connected");const S=Uc(k);if(b(S),jp(S),y.length>0){const M=Po(y),U=kA(),Z=M.find(pe=>pe.id===U)??M[0];g(M),kp(M),j(Z.id);return}g([]),bp(null),j(null)}catch(y){console.error(y),X("error")}}async function an(){const[y,k]=await Promise.all([nb(),ab()]);for(const U of y)Yr(U.id,U.status);const S=Po(y),M=Uc(k);b(M),jp(M),g(S),kp(S)}async function yd(){if(!Hs.current){Hs.current=!0;try{const y=await T2(),k=zr.current,S=new Set(k.map(ve=>ve.id)),M=new Set(y.map(ve=>ve.id));if(S.size!==M.size||[...S].some(ve=>!M.has(ve))){await an(),X("connected");return}const U=Hl.current;for(const ve of y)Yr(ve.id,ve.status);const Z=new Map(y.map(ve=>[ve.id,ve])),pe=U?Z.get(U)??null:null,Te=Po(k.map(ve=>{const ke=Z.get(ve.id);return ke?{...ve,status:ke.status,statusError:ke.statusError,nextWakeup:ke.nextWakeup,unreadTurnCount:ke.unreadTurnCount,updatedAt:ke.updatedAt}:ve}));g(Te),kp(Te),X("connected"),pe&&!Za.current.has(pe.id)&&lt(pe.id,ve=>({...ve,status:pe.status}))}catch(y){console.error(y),X("error")}finally{Hs.current=!1}}}async function xd(){try{const y=await kD();X("connected"),V(y.version)}catch(y){console.error(y),X("error")}}async function Wr(y){try{const k=await jD(y);k&&W(S=>fb(S,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function bd(){try{const y=await O2();Kt(y),X("connected")}catch(y){console.error(y),X("error")}}async function cn(y){try{const k=await z2(y);Jn(k),X("connected")}catch(k){console.error(k),Jn([]),X("error")}}async function fa(y){try{const k=await L2(y);Bt(k),X("connected")}catch(k){console.error(k),Bt([]),X("error")}}async function Au(y){try{const k=await I2();Mt(k),Ia(k),y||(_l(null),qa(k)),X("connected")}catch(k){console.error(k),X("error")}}async function Nu(){if(i.role==="admin")try{ae(await U2()),X("connected")}catch(y){console.error(y),X("error")}}async function Xl(y=!0){try{const k=await Y2(y);Ee(k.models),X("connected"),k.refreshing&&window.setTimeout(()=>void Xl(!1),1e3)}catch(k){console.error(k),Ee([]),X("error")}}async function Kr(){try{const y=await q2();Xe(y.codexVersion),ei(y.codexReleasedAt),X("connected")}catch(y){console.error(y),Xe(null),ei(null),X("error")}}async function Ql(y=!1){y&&Dl(!0);try{const k=await W2(y);st(k.job),Tr(k.latest),X("connected"),k.job&&k.job.status!=="running"&&Ya.current===k.job.id&&(Ya.current=null,k.job.status==="succeeded"?(await Promise.all([Xl(),Kr()]),we("success",`Codex CLI updated to ${pd(k.job.currentVersion)}`)):we("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),X("error")}finally{y&&Dl(!1)}}async function vd(){wn(!0);try{const y=await K2();Ya.current=y.id,st(y),X("connected")}catch(y){console.error(y);const k=He(y);we("error","Unable to start Codex CLI update",k.detail??k.message)}finally{wn(!1)}}D.useEffect(()=>{if(!Ft||(dt==null?void 0:dt.status)!=="running")return;const y=window.setInterval(()=>void Ql(),1e3);return()=>window.clearInterval(y)},[Ft,dt==null?void 0:dt.id,dt==null?void 0:dt.status]);async function $i(y){try{const k=await X2(y);_l(k),qa(k.effective),X("connected")}catch(k){console.error(k),_l(null),X("error")}}async function Ys(){try{const y=await Q2();Ar(y),Ms(y),X("connected")}catch(y){console.error(y),X("error")}}async function Zl(){if(i.role!=="admin"){be([]);return}try{be(await w_()),X("connected")}catch(y){console.error(y),X("error")}}async function Jl(){if(i.role!=="admin"){O(null);return}z(!0);try{O(await B2()),X("connected")}catch(y){console.error(y),X("error")}finally{z(!1)}}async function Ws(y=wt){const k=[bd(),Au(y),Kr(),Xl(),Ys()];i.role==="admin"&&(k.push(Zl()),k.push(Jl()),k.push(Nu())),y&&(k.push(Cn(y)),k.push($i(y)),k.push(cn(y)),k.push(fa(y))),await Promise.all(k)}function pa(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;L(!1),na(y),Ua(i.role==="admin"?"global":y?"workspace":"global"),Ut(!0),Ws(y)}function el(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;na(y),Ua(y?"workspace":"global"),Ut(!0),Ws(y)}function Xr(){var k;L(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;_i(y),mi(null),aa(null),At(!0),y&&Du(y)}async function Du(y){try{const k=await uw(y);if(!k||k.status!=="running")return;Ga(!0);const S=await cw(y,k);mi(S),await Cn(y),await an(),S.warmupTurnId&&ba(y,S.warmupTurnId),we("success","Full-history runtime reset completed")}catch(k){const S=He(k);we("error","Full-history runtime reset failed",S.message)}finally{Ga(!1)}}function ha(y){na(y),Ua("workspace"),Cn(y),$i(y),cn(y),fa(y),Ei(Fo)}async function _u(y){y.preventDefault();try{if(en==="workspace"&&wt){const k=await sb(wt,lD(_s,za,Ba));_l(k.settings),qa(k.settings.effective),Fn(k.conversation),we("success","Workspace settings saved")}else{const k=await Z2(Ti);Mt(k),Ia(k),wt&&await $i(wt),we("success","Global settings saved")}X("connected")}catch(k){console.error(k),X("error");const S=He(k);we("error","Failed to save runtime settings",S.detail??S.message)}}async function Ru(y){try{const k=await J2(y);ae(k),X("connected"),we("success","Deployment settings saved")}catch(k){console.error(k),X("error");const S=He(k);throw we("error","Failed to save deployment settings",S.detail??S.message),k}}async function Mu(){var S;const y=ai;if(!y){we("error","No workspace selected");return}const k=((S=te[y.id])==null?void 0:S.status)??y.status;if(k==="running"||k==="initializing"){we("error","Stop the running turn before resetting runtime");return}mn(!0),mi(null);try{const M=await ub(y.id);aa(M),X("connected")}catch(M){console.error(M),X("error");const U=He(M);we("error","Failed to preview runtime reset",U.detail??U.message)}finally{mn(!1)}}async function wd(y){const k=ai,S=hi;if(!k||!S||S.conversationId!==k.id){we("error","Reset preview is required");return}Ga(!0),mi(null);try{const M=await ob(k.id,{warmup:gu,previewFingerprint:S.fingerprint,selectedEntryIds:y});mi(M),aa(null),X("connected"),await Cn(k.id),await an(),M.warmupTurnId&&ba(k.id,M.warmupTurnId),we("success","Runtime thread reset")}catch(M){console.error(M),X("error");const U=He(M);we("error","Failed to reset runtime thread",U.detail??U.message)}finally{Ga(!1)}}async function kd(){var M;const y=ai;if(!y){we("error","No workspace selected");return}const k=((M=te[y.id])==null?void 0:M.status)??y.status;if(k==="running"||k==="initializing"){we("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
83
+
84
+ This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Ga(!0),mi(null);try{const U=await ub(y.id),Z=await ob(y.id,{warmup:!1,previewFingerprint:U.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});mi(Z),aa(null),wt===y.id&&ti({memory:"",items:[]}),X("connected"),await Cn(y.id),await an(),we("success","Workspace started from blank context")}catch(U){console.error(U),X("error");const Z=He(U);we("error","Failed to clear workspace context",Z.detail??Z.message)}finally{Ga(!1)}}}async function jd(y){const k=ai,S=hi;if(!k||!S||S.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await eD(k.id,{previewFingerprint:S.fingerprint,selectedEntryIds:y}),X("connected")}catch(M){console.error(M),X("error");const U=He(M);throw we("error","Failed to save reset defaults",U.detail??U.message),M}}async function Ou(y,k){try{const S=await sb(y,{[k]:null});_l(S.settings),qa(S.settings.effective),Fn(S.conversation),X("connected"),we("success","Workspace override reset")}catch(S){console.error(S),X("error"),we("error","Failed to reset workspace override")}}async function zu(y){try{const k=await fD({memory:dD(y),items:y});return Ar(k),Ms(k),X("connected"),we("success","Base memory saved"),k.items}catch(k){throw console.error(k),X("error"),we("error","Failed to save memory"),k}}async function Ks(y,k){try{const S=await Vc(y,{memoryItems:k});return Fn(S),ti({memory:S.memory,items:S.memoryItems}),X("connected"),we("success","Workspace memory saved"),S.memoryItems}catch(S){throw console.error(S),X("error"),we("error","Failed to save memory"),S}}async function Hn(y){y.preventDefault();const k=Ha.key.trim();if(k)try{if(en==="workspace"&&wt){const S=await hD(wt,k,Ha.value,Ha.description);Jn(M=>[...M.filter(U=>U.key!==S.variable.key),S.variable].sort((U,Z)=>U.key.localeCompare(Z.key))),Fn(S.conversation)}else{const S=await pD(k,Ha.value,Ha.description);Kt(M=>[...M.filter(U=>U.key!==S.key),S].sort((U,Z)=>U.key.localeCompare(Z.key)))}we("success",en==="workspace"?"Workspace environment saved":"Base environment saved"),$a({description:"",key:"",value:""}),Ai(null),ni(S=>{const M=new Set(S);return M.delete(k),M}),X("connected")}catch(S){console.error(S),X("error"),we("error","Failed to save environment")}}async function Qr(y){try{if(en==="workspace"&&wt){const k=await xD(wt,y);Jn(S=>S.filter(M=>M.key!==y)),Fn(k)}else await yD(y),Kt(k=>k.filter(S=>S.key!==y));Nr===y&&($a({description:"",key:"",value:""}),Ai(null),ni(k=>{const S=new Set(k);return S.delete(y),S})),X("connected"),we("success",en==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),X("error"),we("error","Failed to delete environment")}}async function Sn(y,k){if(k.preventDefault(),!Un.name.trim()){we("error","Knowledge name is required");return}const S=rD(Un);try{const M=Un.id?await vD(y,Un.id,S):await bD(y,S);Bt(U=>[...U.filter(Z=>Z.id!==M.id),M].sort(cb)),Ei(Fo),X("connected"),we("success","Workspace knowledge saved")}catch(M){console.error(M),X("error"),we("error","Failed to save workspace knowledge")}}async function tl(y,k){try{await wD(y,k),Bt(S=>S.filter(M=>M.id!==k)),Un.id===k&&Ei(Fo),X("connected"),we("success","Workspace knowledge deleted")}catch(S){console.error(S),X("error"),we("error","Failed to delete workspace knowledge")}}function Xs(y){Ua("workspace"),Ei(sD(y))}function Zr(y){$a({description:y.description,key:y.key,value:""}),Ai(y.key),ni(k=>{const S=new Set(k);return S.delete(y.key),S}),Gi(y.key,{preserveTypedValue:!0})}function Jr(){const y=Nr;$a({description:"",key:"",value:""}),Ai(null),y&&ni(k=>{const S=new Set(k);return S.delete(y),S})}async function Qs(y){await Gi(y)}async function Gi(y,k={}){try{const S=en==="workspace"&&wt?await gD(wt,y):await mD(y);$a(M=>M.key===y&&(!k.preserveTypedValue||M.value.length===0)?{...M,value:S}:M),ni(M=>new Set(M).add(y)),X("connected")}catch(S){console.error(S),X("error")}}async function Cn(y){const k=await Mp(y);so(k)}async function er(y){try{const k=await Mp(y);sr(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function ma(y){try{T(await CD(y))}catch(k){console.error(k)}}async function tr(y){if(x)try{const k=await ED(x,y);T(y==="end"?null:k),y==="end"&&q("simple"),we("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&ns(x,{waitMs:15e3}),await an()}catch(k){we("error","Complex task control failed",He(k).detail??He(k).message)}}async function Ot(y){if(x)try{H(await TD(x,y))}catch(k){const S=He(k);we("error","Failed to load complex task",S.detail??S.message)}}function Zs(){De&&_({sourceId:De.id,name:`${De.title} - Clone`,groupId:De.groupId})}async function xi(y){if(y.preventDefault(),!(!ie||!ie.name.trim())){re(!0);try{const k=await AD(ie.sourceId,ie.name.trim(),ie.groupId);g(S=>Po([k.conversation,...S])),j(k.conversation.id),_(null),L(!1),we(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){we("error","Clone failed",He(k).detail??He(k).message)}finally{re(!1)}}}async function Lu(){if(De)try{const y=await ND(De.id);Fn(y.conversation),we(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){we("error","Clone retry failed",He(y).detail??He(y).message)}}async function es(y,k={}){var ve,ke,ot;const S=te[y],M=(ve=S==null?void 0:S.history)==null?void 0:ve.oldestTimelineAt,U=(ke=S==null?void 0:S.history)==null?void 0:ke.oldestTimelineSequence,Z=M&&U!==null&&U!==void 0?`${M}|${U}`:U==null?(ot=S==null?void 0:S.history)==null?void 0:ot.oldestMessageCreatedAt:String(U),pe=ra.current;if(!Z||!pe)return;if(k.preserveAnchor??!0){const tt=bA(pe);qn.current={anchorOffset:tt.anchorOffset,conversationId:y,previousScrollHeight:pe.scrollHeight,anchorTurnId:tt.anchorTurnId}}else qn.current=null;sa.current.add(y),lt(y,tt=>({...tt,loadingOlder:!0}));try{const tt=await Mp(y,{before:Z,limit:Rv});rr(tt)}catch(tt){console.error(tt),qn.current=null}finally{sa.current.delete(y),lt(y,tt=>({...tt,loadingOlder:!1}))}}async function ga(y,k){const S=await SD(y,k||void 0);g(M=>{const U=[S,...M];return Yc(U.map(Z=>Z.id)),U}),j(S.id),L(!1)}function Js(){L(!1),on({mode:"create",groupId:null,title:""})}function eo(y){on({mode:"rename",groupId:y.id,title:y.title})}function ts(){var y;L(!1),Me({mode:"create",conversationId:null,title:"",groupId:(De==null?void 0:De.groupId)??((y=m[0])==null?void 0:y.id)})}async function Iu(y){var k;if(y.status!=="running"){jt(!0);try{await _D(y.id),de(M=>{const U={...M};return delete U[y.id],U});const S=p.filter(M=>M.id!==y.id);if(Yc(S.map(M=>M.id)),vp(y.id,""),g(S),x===y.id){const M=((k=S[0])==null?void 0:k.id)??null;bp(M),j(M)}(xe==null?void 0:xe.conversationId)===y.id&&$n(),sn(null),we("success","Workspace moved to recycle")}catch(S){const M=He(S);we("error","Failed to move workspace to recycle",M.detail??M.message)}finally{jt(!1)}}}async function Tn(y){if(!(y.id===Mx||!window.confirm(`Delete group "${y.title}"?
85
+
86
+ Workspaces in this group will move to Default.`)))try{const S=await M2(y.id),M=Uc(S.groups);b(M),jp(M),g(S.conversations),zi(U=>{const Z=new Set(U);return Z.delete(y.id),wp(Z),Z})}catch(S){console.error(S)}}function nl(y){Me({mode:"rename",conversationId:y.id,title:y.title})}function $n(){Ct(!1),Me(null)}function ya(){on(null)}async function nr(y,k){const S=k.trim(),M=p.find(Z=>Z.id===y);if(!M||!S||S===M.title){$n();return}const U=await Vc(y,{title:S});Fn(U),$n()}function En(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function yn(y){return y instanceof Element&&!!y.closest("input, button")}function Vi(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".session-item[data-workspace-id]"):null}function Gn(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".workspace-group[data-group-id]"):null}function li(y,k,S){const M=Vi(k,S),U=M==null?void 0:M.dataset.workspaceId;if(M&&U&&U!==y){Xt({kind:"workspace",id:U,position:CA(M,S)});return}const Z=Gn(k,S),pe=Z==null?void 0:Z.dataset.groupId;if(!pe){Xt(null);return}Xt({kind:"group",id:pe})}function bi(y,k){yn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Ur.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function Uu(y,k){const S=Ur.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(_r!==k){if(M<_x)return;Fa(k),Xt(null)}y.preventDefault(),la({x:y.clientX,y:y.clientY}),li(k,y.clientX,y.clientY)}async function to(y,k){var pe;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ur.current=null;const S=_r===k;S&&($s.current=!0);const M=gn;if(!S||!M){Fa(null),Xt(null),la(null);return}const U=p.find(Te=>Te.id===k),Z=M.kind==="group"?M.id:(pe=p.find(Te=>Te.id===M.id))==null?void 0:pe.groupId;if(!U||!Z){Fa(null),Xt(null),la(null);return}if(g(Te=>{const ve=M.kind==="workspace"?TA(Te.map(ke=>ke.id===k?{...ke,groupId:Z}:ke),k,M.id,M.position):[...Te.filter(ke=>ke.id!==k),{...U,groupId:Z}];return Yc(ve.map(ke=>ke.id)),ve}),U.groupId!==Z)try{const Te=await Vc(k,{groupId:Z});Fn(Te)}catch(Te){console.error(Te),await an()}Fa(null),Xt(null),la(null)}function no(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ur.current=null,Fa(null),Xt(null),la(null)}function Bu(y,k){y.currentTarget.setPointerCapture(y.pointerId),Br.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Yt(y,k){const S=Br.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const M=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(Rr!==k){if(M<_x)return;zl(k),Mr(null)}y.preventDefault();const U=Gn(y.clientX,y.clientY),Z=U==null?void 0:U.dataset.groupId;Mr(Z&&Z!==k?Z:null)}function mt(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const S=Rr===k;S&&(y.preventDefault(),Gs.current=!0);const M=vu;S&&M&&b(U=>{const Z=EA(U,k,M);return $v(Z.map(pe=>pe.id)),Z}),Br.current=null,zl(null),Mr(null)}function Pe(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Br.current=null,zl(null),Mr(null)}function Fi(y){const k=y.target.value;Me(S=>S&&{...S,title:k})}function An(y){const k=y.target.value;Me(S=>S&&{...S,groupId:k})}function io(y){const k=y.target.value;on(S=>S&&{...S,title:k})}async function Pi(y){if(y.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Ct(!0);try{if(xe.mode==="create"){await ga(k,xe.groupId),$n();return}xe.conversationId&&await nr(xe.conversationId,k)}catch(S){console.error(S);const M=He(S);we("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",M.detail??M.message)}finally{Ct(!1)}}}function ir(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),$n())}async function qu(y){if(y.preventDefault(),!It)return;const k=It.title.trim();if(k)try{if(It.mode==="rename"){if(!It.groupId)return;const M=await R2(It.groupId,{title:k});b(U=>U.map(Z=>Z.id===M.id?M:Z)),ya();return}const S=await _2(k);b(M=>[...M,S]),zi(M=>{const U=new Set(M);return U.delete(S.id),wp(U),U}),ya()}catch(S){console.error(S)}}function Yi(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),ya())}async function xa(y){y.preventDefault(),await vi()}function ao(y){x&&Ii.current.set(x,(Ii.current.get(x)??0)+1),u(y),vp(x,y)}function Wi(y,k,S){const M={conversationId:y,version:S};if(!Ex(M,{conversationId:y,version:Ii.current.get(y)??0}))return;vp(y,"");const U=Hl.current;U&&Ex(M,{conversationId:U,version:Ii.current.get(U)??0})&&u(Z=>Z.trim()===k?"":Z)}function lo(y){if(Ka.current.has(y))return null;const k=Symbol(y);return Ka.current.set(y,k),d(S=>{const M=new Set(S);return M.add(y),M}),k}function Nn(y,k){Ka.current.get(y)===k&&(Ka.current.delete(y),d(S=>{const M=new Set(S);return M.delete(y),M}))}function Vn(y){const k=He(y);we("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function vi(y={}){const k=r.trim();if(!k)return;const S=x,M=PE({hasConversation:S!==null,messageSubmitting:S!==null&&Ka.current.has(S),hasActiveTurn:S!==null&&jn.current.has(S),hasConfirmedCurrentTurn:S!==null&&Xa.current.has(S),complexTaskActive:!!w},!!y.forceNewTurn);if(M==="create-workspace"){ts();return}if(M==="blocked"||!S)return;const U=Ii.current.get(S)??0,Z=lo(S);if(!Z)return;if(M==="queue-turn"){await il(S,k,U,Z);return}if(M==="steer-turn"){await is(S,k,U,Z);return}const pe=`local-${Date.now()}`;lt(S,ve=>({...ve,messages:[...ve.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),xn(S,"running"),Ki(S,!0);let Te=!1;try{let ve=null;const ke=ge(`conversations/${S}/turns`),ot=await fetch(ke,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:R})});if(ot.ok){const tt=await ot.json();if(!tt.turnId)throw new Error("Turn did not return a turn id");if(ve=tt.turnId,(R==="complex"||w)&&(ma(S),q("simple")),!tt.message)throw new Error("Turn did not return the persisted message");Dt(S,pe,tt.message,ve),Te=!0,Wi(S,k,U)}else{const tt=await fA(ot);if(tt){ve=tt;const si=await va(S,tt,k);if(!si.ok)throw await Jt(si,{method:"POST",url:ge(`conversations/${S}/turns/${tt}/steer`)});const ls=await si.json();if(!ls.message)throw new Error("Steer did not return the persisted message");Dt(S,pe,ls.message,tt),Te=!0,Wi(S,k,U)}else throw await Jt(ot,{method:"POST",url:ke})}if(!ve)throw await Jt(ot,{method:"POST",url:ke});ba(S,ve),Nn(S,Z)}catch(ve){Te||Vn(ve);const ke=dA(ve);ke&&we("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),lt(S,ot=>({...ot,status:"error",messages:Te?ot.messages:ot.messages.filter(tt=>tt.id!==pe),events:[...ot.events,{id:ot.events.length+1,event:"client.error",data:ke?{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."}:mr(ve),createdAt:new Date().toISOString()}]})),xn(S,"error"),Ki(S,!1),await an()}finally{Nn(S,Z)}}async function ri(y){const k=Qa.current.get(y)??[];if(k.length===0)return;const[S,...M]=k;Qa.current.set(y,M),await ba(y,S)}async function ns(y,k={}){if(Za.current.has(y)||kn.current.has(y))return;Kl(y),$l.current.delete(y);const S=new AbortController;kn.current.set(y,S),Ki(y,!0);try{const M=k.waitMs?`?waitMs=${k.waitMs}`:"",U=ge(`conversations/${y}/turns/current/events${M}`),Z=await fetch(U,{signal:S.signal});if(!Z.ok||!Z.body)throw await Jt(Z,{method:"GET",url:U});da(y),Xa.current.add(y),await er(y),await gb(Z.body,pe=>{const Te=Kx(pe,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Te.turnId&&!jn.current.has(y)&&jn.current.set(y,Te.turnId),lt(y,ke=>({...ke,status:Fc(Te)??ke.status,events:Wx(ke.events,Te)}));const ve=Fc(Te);ve&&xn(y,ve)}),await Cn(y),await an()}catch(M){if(!Qx(M)){if(cA(M)){kn.current.get(y)===S&&Pr(y);return}lt(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:mr(M),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===S&&(Xa.current.delete(y),jn.current.delete(y),kn.current.delete(y),Ki(y,!1),await ri(y))}}async function ba(y,k,S={}){const M=jn.current.get(y);if(M===k)return;if(M||kn.current.has(y)){const Z=Qa.current.get(y)??[];Z.includes(k)||Qa.current.set(y,[...Z,k]);return}da(y);const U=new AbortController;kn.current.set(y,U),jn.current.set(y,k),Ki(y,!0);try{const Z=ge(`conversations/${y}/turns/${k}/events`),pe=await fetch(Z,{signal:U.signal});if(!pe.ok||!pe.body)throw await Jt(pe,{method:"GET",url:Z});await er(y),await gb(pe.body,Te=>{const ve=Kx(Te,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);lt(y,ot=>({...ot,status:Fc(ve)??ot.status,events:Wx(ot.events,ve)}));const ke=Fc(ve);ke&&xn(y,ke)}),await Cn(y),await an()}catch(Z){if(!Qx(Z)){if(S.recovered&&uA(Z)){await Cn(y),await an();return}lt(y,pe=>({...pe,status:"error",events:[...pe.events,{id:pe.events.length+1,event:"client.error",data:mr(Z),createdAt:new Date().toISOString()}]}))}}finally{kn.current.get(y)===U&&(jn.current.get(y)===k&&jn.current.delete(y),kn.current.delete(y),Ki(y,!1),await ri(y))}}async function il(y,k,S,M){let U=!1;const Z=`local-queued-${Date.now()}`;lt(y,pe=>({...pe,messages:[...pe.messages,{id:Z,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const pe=ge(`conversations/${y}/turns`),Te=await fetch(pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue",workMode:R})});if(!Te.ok)throw await Jt(Te,{method:"POST",url:pe});const ve=await Te.json();if(!ve.turnId)throw new Error("Queued turn did not return a turn id");if(!ve.message)throw new Error("Queued turn did not return the persisted message");Dt(y,Z,ve.message,ve.turnId),U=!0,Wi(y,k,S),ba(y,ve.turnId),Nn(y,M),await an(),we("success",ve.queuePosition?`Queued as next turn (${ve.queuePosition})`:"Started new turn")}catch(pe){U||Vn(pe),lt(y,Te=>({...Te,messages:U?Te.messages:Te.messages.filter(ve=>ve.id!==Z),events:[...Te.events,{id:Te.events.length+1,event:"client.error",data:mr(pe),createdAt:new Date().toISOString()}]}))}finally{Nn(y,M)}}async function is(y,k,S,M){const U=jn.current.get(y);let Z=!1;const pe=`local-steer-${Date.now()}`;lt(y,Te=>({...Te,messages:[...Te.messages,{id:pe,role:"user",content:k,createdAt:new Date().toISOString(),turnId:U??null}],status:"running"}));try{const Te=ge(U?`conversations/${y}/turns/${U}/steer`:`conversations/${y}/turns/steer`),ve=await fetch(Te,zx(k));if(!ve.ok)throw await Jt(ve,{method:"POST",url:Te});const ke=await ve.json();if(!ke.message)throw new Error("Steer did not return the persisted message");Dt(y,pe,ke.message,U),Z=!0,Wi(y,k,S),Nn(y,M)}catch(Te){Vn(Te),lt(y,ve=>({...ve,messages:Z?ve.messages:ve.messages.filter(ke=>ke.id!==pe),events:[...ve.events,{id:ve.events.length+1,event:"client.error",data:mr(Te),createdAt:new Date().toISOString()}]}))}finally{Nn(y,M)}}async function va(y,k,S){return fetch(ge(`conversations/${y}/turns/${k}/steer`),zx(S))}function Dt(y,k,S,M){lt(y,U=>({...U,messages:Tp(U.messages.filter(Z=>Z.id!==k),[{...S,turnId:M??S.turnId??null}])}))}async function as(){var M;if(!x||oa!=="running"&&oa!=="initializing"&&!Pl)return;const y=x,k=oa,S=`client-stop-${Date.now()}`;Fr(y),(M=kn.current.get(y))==null||M.abort(),jn.current.delete(y),Qa.current.delete(y),Ki(y,!1),lt(y,U=>({...U,status:"done",events:[...U.events,{id:S,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),xn(y,"done");try{const U=await ro(y);da(y),lt(y,Z=>({...Z,status:U})),xn(y,U),Promise.all([Cn(y),an()]).catch(Z=>{console.warn("Failed to refresh workspace after Stop",Z)})}catch(U){Pr(y),lt(y,pe=>({...pe,status:k==="initializing"?"initializing":"running",events:[...pe.events.filter(Te=>Te.id!==S),{id:pe.events.length+1,event:"client.error",data:mr(U),createdAt:new Date().toISOString()}]})),xn(y,k==="initializing"?"initializing":"running");const Z=He(U);we("error","Stop failed",Z.detail??Z.message);try{await an()}catch(pe){console.warn("Failed to refresh workspace after Stop failed",pe)}}}async function ro(y){const k=ge(`conversations/${y}/turns/interrupt`),S=await fetch(k,{method:"POST"});if(!S.ok)throw await Jt(S,{method:"POST",url:k});return XE(await S.json().catch(()=>null))}async function Sd(){var M;const y=ai;if(!y){we("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${y.title}"?
87
+
88
+ This cancels every current or queued turn and the active complex task, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const S=y.id;Ml(!0),Fr(S),(M=kn.current.get(S))==null||M.abort(),jn.current.delete(S),Qa.current.delete(S),Ki(S,!1);try{const U=await ro(S);da(S),lt(S,Z=>({...Z,status:U})),xn(S,U),await Cn(S),await an(),we("success","Workspace stopped and repaired")}catch(U){Pr(S);const Z=He(U);we("error","Force stop failed",Z.detail??Z.message);try{await an()}catch(pe){console.warn("Failed to refresh workspace after force Stop failed",pe)}}finally{Ml(!1)}}async function ar(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const S=x;try{const M=ge(`conversations/${S}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await Jt(U,{method:"POST",url:M});lt(S,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(M){lt(S,Z=>({...Z,events:[...Z.events,{id:Z.events.length+1,event:"client.error",data:mr(M),createdAt:new Date().toISOString()}]}));const U=He(M);we("error","Failed to respond to approval",U.detail??U.message)}}async function lr(y,k,S){const M=x,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!M||!U)return!1;try{const Z=ge(`conversations/${M}/workspace-change-proposals/${encodeURIComponent(U)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?S??y.workspaceChangePayload:void 0})});if(!pe.ok)throw await Jt(pe,{method:"POST",url:Z});const Te=await pe.json();return Fn(Te.conversation),lt(M,ve=>({...ve,events:[...ve.events,{id:`${y.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?S??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),we("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(Z){console.error(Z);const pe=He(Z);return we("error","Failed to respond to workspace change proposal",pe.detail??pe.message),!1}}async function bt(y,k,S){const M=x;if(!(!M||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(S??y.body)}catch{we("error","Knowledge proposal JSON is invalid");return}const Z=ge(`conversations/${M}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),pe=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!pe.ok)throw await Jt(pe,{method:"POST",url:Z});const Te=await pe.json();Bt([...Te.items??[]].sort(cb)),lt(M,ve=>({...ve,events:[...ve.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?Te.item:null},createdAt:new Date().toISOString()}]})),we("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const Z=He(U);we("error","Failed to respond to knowledge proposal",Z.detail??Z.message)}}function so(y){Yr(y.id,y.status),al(y),de(k=>{const S=k[y.id],M=y.events.map(U=>({id:U.id,turnId:U.turnId,seq:U.seq,event:U.event,data:U.data,createdAt:U.createdAt}));return{...k,[y.id]:{messages:y.messages,events:Hc(M,(S==null?void 0:S.events)??[]),timelineNodes:Ap(y.timelineNodes??[],(S==null?void 0:S.timelineNodes)??[]),turns:Ep(y.turns??[],(S==null?void 0:S.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:ua(y),loadingOlder:!1,fullEventTurnIds:(S==null?void 0:S.fullEventTurnIds)??new Set,loadingEventTurnIds:(S==null?void 0:S.loadingEventTurnIds)??new Set}}})}function rr(y){const k=ua(y);lt(y.id,S=>{var M,U,Z;return{...S,messages:Tp(y.messages,S.messages),timelineNodes:Ap(y.timelineNodes??[],S.timelineNodes),turns:Ep(y.turns??[],S.turns),events:Hc(y.events.map(pe=>({id:pe.id,turnId:pe.turnId,seq:pe.seq,event:pe.event,data:pe.data,createdAt:pe.createdAt})),S.events),contextVersions:(((M=y.contextVersions)==null?void 0:M.length)??0)>0?y.contextVersions??[]:S.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=S.history)==null?void 0:U.loadedMessageCount)??S.messages.length),loadedEventCount:k.loadedEventCount+(((Z=S.history)==null?void 0:Z.loadedEventCount)??S.events.length)},loadingOlder:!1}})}function sr(y){const k=ua(y),S=y.events.map(M=>({id:M.id,turnId:M.turnId,seq:M.seq,event:M.event,data:M.data,createdAt:M.createdAt}));lt(y.id,M=>{var U,Z,pe;return{...M,messages:Tp(M.messages,y.messages),timelineNodes:Ap(M.timelineNodes,y.timelineNodes??[]),turns:Ep(M.turns,y.turns??[]),events:Hc(S,M.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:M.contextVersions,status:y.status,history:{...M.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((Z=M.history)==null?void 0:Z.loadedMessageCount)??M.messages.length,M.messages.length,y.messages.length),loadedEventCount:Math.max(((pe=M.history)==null?void 0:pe.loadedEventCount)??M.events.length,M.events.length,y.events.length)},loadingOlder:!1}})}function lt(y,k){de(S=>{const M=S[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...S,[y]:k(M)}})}function xn(y,k){g(S=>S.map(M=>M.id===y?{...M,status:k,updatedAt:new Date().toISOString()}:M))}function al(y){Fn(y)}function Fn(y){g(k=>Po(k.map(S=>S.id===y.id?{...S,...y}:S)))}async function Hu(y,k){const S=k.filter(M=>{const U=te[y];return U&&!U.fullEventTurnIds.has(M)&&!U.loadingEventTurnIds.has(M)});if(S.length!==0){lt(y,M=>{const U=new Set(M.loadingEventTurnIds);for(const Z of S)U.add(Z);return{...M,loadingEventTurnIds:U}});try{const M=await Promise.all(S.map(U=>DD(y,U)));lt(y,U=>{const Z=new Set(U.fullEventTurnIds),pe=new Set(U.loadingEventTurnIds),Te=M.flatMap((ve,ke)=>{const ot=S[ke];return Z.add(ot),pe.delete(ot),ve.map(tt=>({id:tt.id,turnId:tt.turnId,seq:tt.seq,event:tt.event,data:tt.data,createdAt:tt.createdAt}))});return{...U,events:Hc(U.events,Te),fullEventTurnIds:Z,loadingEventTurnIds:pe}})}catch(M){console.error(M),lt(y,U=>{const Z=new Set(U.loadingEventTurnIds);for(const pe of S)Z.delete(pe);return{...U,loadingEventTurnIds:Z}}),we("error","Failed to load process details")}}}function Ki(y,k){const S=new Set(Za.current);k?S.add(y):S.delete(y),Za.current=S,Va(M=>{const U=new Set(M);return k?U.add(y):U.delete(y),U})}function $u(y){const k=YE({key:y.key,metaKey:y.metaKey,ctrlKey:y.ctrlKey,shiftKey:y.shiftKey,isComposing:y.nativeEvent.isComposing});k&&(y.preventDefault(),vi({forceNewTurn:k.forceNewTurn}))}function wa(y){zi(k=>{const S=new Set(k);return S.has(y)?S.delete(y):S.add(y),wp(S),S})}function oo(y){var k;return QE(y.status,(k=y.nextWakeup)==null?void 0:k.status,Ol.has(y.id))}function ll(y){var M;const k=(M=Or.current)==null?void 0:M.getBoundingClientRect(),S=k?y-k.left:y;return Nh(S)}function Gu(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Il(ll(y.clientX))}function rl(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Il(ll(y.clientX)))}function uo(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=ll(y.clientX);Il(k),hA(k)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:Or,style:{"--sidebar-width":`${wu}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":bb(fe),className:`backend-status ${fe}`,"data-label":bb(fe)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:ts,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Gl.map(y=>s.jsxs("section",{className:["workspace-group",Rr===y.id?"dragging":"",vu===y.id?"drop-after":"",(gn==null?void 0:gn.kind)==="group"&&gn.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Oi.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Gs.current){k.preventDefault(),Gs.current=!1;return}wa(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),eo(y)},onPointerCancel:Pe,onPointerDown:k=>Bu(k,y.id),onPointerMove:k=>Yt(k,y.id),onPointerUp:k=>mt(k,y.id),type:"button",children:[s.jsx("span",{className:Oi.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),eo(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Mx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Tn(y)},title:"Delete group",type:"button",children:"×"}):null]}),Oi.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const S=oo(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===_r?"dragging":"",(gn==null?void 0:gn.kind)==="workspace"&&gn.id===k.id?`drop-${gn.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:M=>{if($s.current){M.preventDefault(),$s.current=!1;return}j(k.id),L(!1)},onDoubleClick:M=>{yn(M.target)||(M.preventDefault(),nl(k))},onKeyDown:M=>{En(M.target)||M.key==="Enter"&&(j(k.id),L(!1))},onPointerCancel:no,onPointerDown:M=>bi(M,k.id),onPointerMove:M=>Uu(M,k.id),onPointerUp:M=>to(M,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Qc(S,k.nextWakeup,tn),className:`session-status ${S}`,title:Qc(S,k.nextWakeup,tn)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),S==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Qc(S,k.nextWakeup,tn),children:ld(k.nextWakeup,tn)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,S!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:M=>{M.stopPropagation(),sn(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",Ts(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:pa,type:"button",children:s.jsx(Jx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Js,type:"button",children:s.jsx(x2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{zs(!0),L(!1)},type:"button",children:s.jsx(Wc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Xr,type:"button",children:s.jsx(b2,{})}),s.jsx(vN,{usage:Tu})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Gu,onPointerMove:rl,onPointerUp:uo,role:"separator",tabIndex:0}),qr&&Ll?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Ll.x+12}px, ${Ll.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:qr.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Ts(qr.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ir,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ir,onSubmit:y=>void Pi(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Fi,onKeyDown:ir,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:An,onKeyDown:ir,value:xe.groupId??((co=m[0])==null?void 0:co.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:$n,children:"Cancel"}),s.jsx("button",{disabled:Ve,type:"submit",children:Ve?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,It?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Yi,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Yi,onSubmit:y=>void qu(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:io,onKeyDown:Yi,value:It.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:ya,children:"Cancel"}),s.jsx("button",{type:"submit",children:It.mode==="create"?"Create":"Save"})]})]})}):null,Le?s.jsx(OA,{currentUser:i,conversations:p,editingEnvironmentKey:Nr,deploymentSettings:La,environmentDraft:Ha,globalEnvironment:hn,workspaceEnvironment:Si,memorySettings:pu,memorySettingsDraft:Rs,workspaceMemoryDraft:hu,runtimeSettings:za,runtimeModels:ce,runtimeCodexVersion:Ue,runtimeCodexReleasedAt:Vt,runtimeCodexUpdating:(dt==null?void 0:dt.status)==="running",runtimeSettingsDraft:Ti,runtimeSettingsScope:en,settingsWorkspace:Qt,settingsWorkspaceId:wt,systemDiagnostics:Re,systemDiagnosticsLoading:A,workspaceGroups:Gl,workspaceRuntimeSettings:Ba,workspaceRuntimeSettingsDraft:_s,managedUsers:oe,onCancelEnvironmentEdit:Jr,onClose:()=>Ut(!1),onCreateUser:async y=>{const k=await k_(y);be(S=>[...S,k]),we("success","User created")},onDeleteUser:async y=>{await S_(y),be(k=>k.filter(S=>S.id!==y)),we("success","User deleted")},onSaveDeploymentSettings:Ru,onDeleteEnvironment:y=>void Qr(y),onDraftChange:$a,onEditEnvironment:Zr,onRevealEnvironmentValue:y=>void Qs(y),onSaveBaseMemoryItems:y=>zu(y),onSaveResponsibility:async(y,k)=>{try{const S=await Vc(y,{responsibility:k});return Fn(S),X("connected"),we("success","Workspace responsibility saved"),S.responsibility}catch(S){throw console.error(S),X("error"),we("error","Failed to save workspace responsibility"),S}},onSaveWorkspaceMemoryItems:y=>wt?Ks(wt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Ia,onCodexAccountSwitched:async()=>{we("success","Codex account switched"),(await Nw()).codexAccountsReady&&await Promise.all([Wr(!0),Xl(!0),Kr()])},onUpdateCodexCli:()=>{Et(!0),Ql(!0)},onRuntimeScopeChange:Ua,onSettingsWorkspaceChange:ha,onSubmitRuntimeSettings:y=>void _u(y),onWorkspaceRuntimeDraftChange:qa,onWorkspaceRuntimeReset:y=>wt?void Ou(wt,y):void 0,revealedEnvironmentKeys:Os,onSubmitEnvironment:y=>void Hn(y),onRefreshSystemDiagnostics:()=>void Jl(),onUpdateUser:async(y,k)=>{const S=await j_(y,k);be(M=>M.map(U=>U.id===S.id?S:U)),we("success","User updated")}}):null,Ft?s.jsx(MA,{currentReleasedAt:Vt,currentVersion:Ue,job:dt,latest:hd,latestChecking:Er,starting:Ci,onClose:()=>Et(!1),onRefresh:()=>void Ql(),onStart:()=>void vd()}):null,Ni&&De?s.jsx(NA,{conversation:De,clockNow:tn,knowledgeDraft:Un,workspaceKnowledge:Pt,tokenUsage:Vl,onCancelKnowledgeEdit:()=>Ei(Fo),onDeleteKnowledge:y=>void tl(De.id,y),onEditKnowledge:Xs,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void Sn(De.id,y),onClose:()=>ia(!1)}):null,mu?s.jsx(DA,{conversations:p,onClose:()=>zs(!1),workspaceGroups:Gl}):null,Di?s.jsx(_A,{busy:xu||Rl,conversation:ai??null,conversationId:un,forceStopBusy:Rl,preview:(hi==null?void 0:hi.conversationId)===un?hi:null,previewLoading:pi,result:Ls,status:Fs,warmup:gu,workspaceGroups:Gl,onClose:()=>At(!1),onCancelResetPreview:()=>aa(null),onForceStop:()=>void Sd(),onPreviewReset:()=>void Mu(),onStartBlankContext:()=>void kd(),onResetRuntime:y=>void wd(y),onSaveResetSelection:jd,onWorkspaceChange:y=>{_i(y),mi(null),aa(null)},onWarmupChange:yu}):null,ie?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!Q&&_(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:xi,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:ie.name,onChange:y=>_(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:ie.groupId,onChange:y=>_(k=>k&&{...k,groupId:y.target.value}),children:Gl.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:Q,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:Q||!ie.name.trim(),type:"submit",children:Q?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>H(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:N.title}),s.jsxs("p",{children:[xb(N.status),N.startedAt&&N.finishedAt?` · ${c_(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:N.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:N.status==="completed"?"Final plan":"Current plan"}),N.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Tl(N.currentPlan.planMarkdown,De)})})}):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:()=>H(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>F(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:$e($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>F(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Zo,{content:$.fullDetail??$.detail??"No additional details.",conversation:De,streaming:!1,onPreviewArtifact:Bn,onCopyArtifactUrl:ca,copiedArtifactUrl:Mi})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;F(null),Ot(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>F(null),type:"button",children:"Close"})]})]})}):null,vt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Fe||sn(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Fe,onClick:()=>sn(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:vt.title})," to recycle?"]}),s.jsx("code",{children:vt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Fe,onClick:()=>sn(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Fe,onClick:()=>void Iu(vt),type:"button",children:Fe?"Moving...":"Move to recycle"})]})]})}):null,Ri?s.jsxs("div",{className:`app-toast ${Ri.tone}`,role:"status",children:[s.jsx("strong",{children:Ri.text}),Ri.detail?s.jsx("pre",{children:Ri.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(y2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(De==null?void 0:De.title)??"New workspace"})}),De?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Ts(De.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:De?s.jsxs(s.Fragment,{children:[De.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Xr,title:`当前 Thread 工具集已过期(${De.threadCapabilityVersion} / ${De.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(ow,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Zs,title:"Clone workspace",type:"button",children:s.jsx(g2,{})}),s.jsxs("button",{className:`context-button has-usage ${Ih(Fl??0)}`,onClick:()=>ia(!0),style:{"--context-usage":`${fd(Fl??0)}%`},title:Vl&&Fl!==null?`Context ${Math.round(Fl)}% · ${Ln(Vl.totalTokens)} / ${Xc(Vl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Fl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:el,title:"Workspace settings",type:"button",children:s.jsx(Jx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Ot(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:xb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:u_(w,tn)})]}),s.jsxs("div",{className:"complex-task-actions",children:[zp(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void tr("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 tr("pause"),type:"button",children:"Pause"}):null,zp(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void tr("resume"),type:"button",children:"Resume"}):null,zp(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void tr("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void tr("end"),type:"button",children:"End task"})]})]}):null,(De==null?void 0:De.status)==="initialization_failed"&&De.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:De.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Lu(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void Wl(),ref:ra,style:{scrollPaddingBottom:Us},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Us},children:[Ja.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:[De!=null&&De.cloneLineage&&Gr.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",De.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(De.cloneLineage.snapshotAt)," · ",De.cloneLineage.importedMessageCount," messages"]})]}):null,(fo=at==null?void 0:at.history)!=null&&fo.hasMoreBefore?s.jsx("div",{className:"history-loader",children:at.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,$r.map((y,k)=>{var pe,Te,ve;const S=((pe=y.user)==null?void 0:pe.type)==="system",M=y.turnIds.some(ke=>Gr.has(ke)),U=$r[k+1],Z=M&&(!U||!U.turnIds.some(ke=>Gr.has(ke)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${M?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${S?"system-turn":"user-turn"}`,children:[Ko(y.user,De,Bn,ca,Mi,ar,lr,bt,Ot,F),s.jsx(Xo,{copied:ii===`${S?"system":"user"}-${y.id}-bottom`,content:Qo(y.user),id:`${S?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Hi})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(ke=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Ko(ke,De,Bn,ca,Mi,ar,lr,bt,Ot,F),s.jsx(Xo,{copied:ii===`user-${ke.id}-bottom`,content:Qo(ke),id:`user-${ke.id}-bottom`,timestamp:ke.createdAt,variant:"outside",onCopy:Hi})]},ke.id))}):null,(Te=y.acceptedSystemInputs)==null?void 0:Te.map(ke=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(ke,De,Bn,ca,Mi,ar,lr,bt,Ot,F),s.jsx(Xo,{copied:ii===`system-${ke.id}-bottom`,content:Qo(ke),id:`system-${ke.id}-bottom`,timestamp:ke.createdAt,variant:"outside",onCopy:Hi})]},ke.id)),y.agentItems.length>0?s.jsx(rN,{group:y,conversation:De,allowProcessView:!M,copiedFooter:ii===`agent-${y.id}-bottom`,copiedArtifactUrl:Mi,running:!M&&iu(y.turnIds,yi),onCopyArtifactUrl:ca,onCopyBubble:Hi,onPreviewArtifact:Bn,onLoadProcessDetails:ke=>De&&!M?Hu(De.id,ke):void 0,onRespondApproval:ar,onRespondWorkspaceChangeProposal:lr,onRespondKnowledgeProposal:bt,onOpenComplexTask:Ot,onOpenSystemEvent:F}):null,(ve=y.trailingSystemItems)==null?void 0:ve.map(ke=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ko(ke,De,Bn,ca,Mi,ar,lr,bt,Ot,F),s.jsx(Xo,{copied:ii===`system-${ke.id}-bottom`,content:Qo(ke),id:`system-${ke.id}-bottom`,timestamp:ke.createdAt,variant:"outside",onCopy:Hi})]},ke.id))]}),Z?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:xa,ref:qs,children:[Yl?s.jsxs("div",{className:`global-activity ${Yl.tone??"running"}`,children:[Vr?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void as(),title:"Stop current workspace activity",type:"button",children:s.jsx(uN,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Yl.title}),Yl.detail?s.jsx("small",{children:Yl.detail}):null]}),Vr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||R==="complex",className:`complex-mode-button ${w||R==="complex"?"active":""}`,disabled:!!w,onClick:()=>q(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":R==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Fv,{}),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:Ps.textareaDisabled,onChange:y=>ao(y.target.value),onKeyDown:$u,placeholder:"Cmd/Ctrl + Enter",ref:Pa,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:Ps.sendDisabled,type:"submit",children:[s.jsx(cN,{}),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"]})]})]})]})]}),Nt?s.jsx("div",{className:"artifact-lightbox",onClick:()=>Bn(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>Bn(null),type:"button",children:"×"}),s.jsx("img",{alt:Nt.name,src:Nt.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:Nt.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:Nt.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void ca(Nt),type:"button",children:Mi===Nt.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function NA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,j]=D.useState("overview"),[w,T]=D.useState(!1),[R,q]=D.useState(!1),[N,H]=D.useState(null),[$,F]=D.useState(null),[ie,_]=D.useState(!1),[Q,re]=D.useState(null),[ee,L]=D.useState(null),[te,de]=D.useState(!1),[Ne,ye]=D.useState(null),[ue,V]=D.useState(null),oe=jw(u),be=rh(e,e.status),Re=N?XD(N):null;D.useEffect(()=>{T(!1),H(null),F(null),re(null),L(null),ye(null),V(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!Q&&A()},[x,Q]),D.useEffect(()=>{x==="compactions"&&!Ne&&z()},[x,Ne]);const O=()=>{T(!0),q(!0),F(null),tD(e.id).then(C=>H(C)).catch(C=>{const W=He(C);F(W.detail?`${W.message}
89
+ ${W.detail}`:W.message)}).finally(()=>q(!1))},A=()=>{_(!0),L(null),iD(e.id).then(C=>re(C)).catch(C=>{const W=He(C);L(W.detail?`${W.message}
90
+ ${W.detail}`:W.message)}).finally(()=>_(!1))},z=()=>{de(!0),V(null),aD(e.id).then(C=>ye(C)).catch(C=>{const W=He(C);V(W.detail?`${W.message}
91
+ ${W.detail}`:W.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>j("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>j("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>j("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>j("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>j("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>j("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${be}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Qc(be,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:su(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:ld(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/${Ts(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:Tl(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(Vv,{items:r,onDelete:d,onEdit:C=>{p(C),j("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Tl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(XA,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:R,onClick:O,type:"button",children:R?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:R,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value:oe===null?"unknown":`${Math.round(oe)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Ln(u.totalTokens)} / ${Ln(u.modelContextWindow)}`:Ln(u.totalTokens),mono:!0}),oe!==null?s.jsx("div",{className:`context-token-bar ${Ih(oe)}`,children:s.jsx("span",{style:{width:`${fd(oe)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Xc(u.inputTokens)} / ${Xc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Xc(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..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):N?s.jsxs(s.Fragment,{children:[Re?s.jsx(iN,{summary:Re}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(N,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:te,onClick:z,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ne?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ne!=null&&Ne.length?s.jsx("div",{className:"context-compaction-list",children:Ne.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(C.completedAt??C.usageObservedAt??C.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${C.status}`,children:C.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:GD(C).map(W=>s.jsxs("div",{children:[s.jsx("dt",{children:W.label}),s.jsx("dd",{children:W.value})]},W.label))}),s.jsxs("small",{children:[Al(C.id),C.turnId?` · turn ${Al(C.turnId)}`:""]})]},C.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ie?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):Q?s.jsx(tN,{preview:Q,refreshing:ie,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function DA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,j]=D.useState(!0),[w,T]=D.useState(null),[R,q]=D.useState(null),[N,H]=D.useState(!1),[$,F]=D.useState(!1),[ie,_]=D.useState(new Set),[Q,re]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(A=>A.id===p)??null,L=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),de=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==Q.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ne=()=>{var A;re({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),_(new Set),q("create")},ye=()=>{!ee||ee.status!=="active"||(re({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),_(new Set),q("edit"))},ue=async(A,z=c)=>{var C;j(!0),T(null);try{const W=await ib();u(W);const fe=W.filter(xe=>z==="archived"?xe.status==="archived":xe.status!=="archived"),X=(A&&fe.some(xe=>xe.id===A)?A:null)??(p&&fe.some(xe=>xe.id===p)?p:((C=fe[0])==null?void 0:C.id)??null);g(X),b(X?await Gc(X):[])}catch(W){T(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}finally{j(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await ib();u(z),p&&z.some(C=>C.id===p)&&b(await Gc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),T(null);try{b(await Gc(A))}catch(z){T(z instanceof Ji?z.detail:z instanceof Error?z.message:String(z))}},oe=async A=>{var C;if(A===c)return;d(A),T(null);const z=((C=r.find(W=>A==="archived"?W.status==="archived":W.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Gc(z))}catch(W){T(W instanceof Ji?W.detail:W instanceof Error?W.message:String(W))}},be=async A=>{var z;if(A.preventDefault(),!(!Q.title.trim()||!Q.ownerWorkspaceId)){F(!0),T(null);try{const C=R==="edit"&&ee?await A2(ee.id,{expectedVersion:ee.version,title:Q.title.trim(),publicDescription:Q.publicDescription.trim(),participantWorkspaceIds:Q.participantWorkspaceIds}):await E2({...Q,title:Q.title.trim(),publicDescription:Q.publicDescription.trim()});d("active"),q(null),re({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){T(C instanceof Ji?C.detail:C instanceof Error?C.message:String(C))}finally{F(!1)}}},Re=async()=>{if(!(!ee||ee.status!=="active")){F(!0),T(null);try{const A=await N2(ee.id,ee.version);H(!1),d("active"),await ue(void 0,"active")}catch(A){T(A instanceof Ji?A.detail:A instanceof Error?A.message:String(A))}finally{F(!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:Ne,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void oe("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void oe("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):te.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):te.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ye,title:"编辑",type:"button",children:s.jsx(dd,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(v2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${dw(A.recipientWorkspaceIds.map(z=>L.get(z)??Al(z)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Tl(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),R?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&q(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:be,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:R==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:R==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Q.title,onChange:A=>re(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Q.publicDescription,onChange:A=>re(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:Q.ownerWorkspaceId,onChange:A=>re(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[Q.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>_(new Set(de.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),de.map(A=>{const z=A.conversations,C=z.filter(fe=>Q.participantWorkspaceIds.includes(fe.id)).length,W=ie.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!W,className:"collaboration-group-toggle",onClick:()=>_(fe=>{const X=new Set(fe);return X.has(A.id)?X.delete(A.id):X.add(A.id),X}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:W?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>re(fe=>{const X=z.map(Me=>Me.id),xe=new Set(fe.participantWorkspaceIds);return X.every(Me=>xe.has(Me))?X.forEach(Me=>xe.delete(Me)):X.forEach(Me=>xe.add(Me)),{...fe,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),W?null:s.jsx("div",{children:z.map(fe=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:Q.participantWorkspaceIds.includes(fe.id),onChange:X=>re(xe=>({...xe,participantWorkspaceIds:X.target.checked?[...xe.participantWorkspaceIds,fe.id]:xe.participantWorkspaceIds.filter(Me=>Me!==fe.id)})),type:"checkbox"}),s.jsx("span",{children:fe.title})]},fe.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>q(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!Q.title.trim()||!Q.ownerWorkspaceId,type:"submit",children:$?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&H(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>H(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void Re(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function _A({busy:e,conversation:i,conversationId:a,forceStopBusy:r,preview:u,previewLoading:c,result:d,status:p,warmup:g,workspaceGroups:m,onCancelResetPreview:b,onClose:x,onForceStop:j,onPreviewReset:w,onStartBlankContext:T,onResetRuntime:R,onSaveResetSelection:q,onWorkspaceChange:N,onWarmupChange:H}){const $=!i||e||p==="running"||p==="initializing";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:x,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:F=>F.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:F=>N(F.target.value),value:a??"",children:m.map(F=>s.jsx("optgroup",{label:F.title,children:F.conversations.map(ie=>s.jsxs("option",{value:ie.id,children:[ie.title," · workspaces/",Ts(ie.id)]},ie.id))},F.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:x,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 ${p}`,children:p})]}),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/${Ts(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:g,onChange:F=>H(F.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:!i||r,onClick:j,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:r?"Stopping & repairing...":"Force stop & repair"}),s.jsx("button",{className:"danger",disabled:$||c,onClick:w,type:"button",children:c?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:$||c,onClick:T,type:"button",children:"Clear memory & start blank"}),p==="running"||p==="initializing"?s.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),d?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:d.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[d.injectedItemCount," visible history items injected"]}),d.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",d.historyBatchCount," chronological batches with ",d.historyCompactionCount," native compactions"]}):null,d.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",d.newThreadId]}),d.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",d.warmupTurnId]}):null]}):null]})}),u?s.jsx(RA,{busy:e,preview:u,warmup:g,onCancel:b,onConfirm:R,onSaveSelection:q}):null]})})}function RA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[j,w]=D.useState(null),T=D.useRef(null),R=i.entries.filter(L=>d.has(L.id)),q=R.filter(L=>L.role==="user").length,N=R.length-q,H=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),$=H.filter(L=>d.has(L)).length,F=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 ie=e||b;async function _(L){x(!0),w(null);try{await c(i.entries.filter(te=>L.has(te.id)).map(te=>te.id)),p(L)}catch(te){w(He(te).message)}finally{x(!1)}}function Q(L,te){const de=new Set(d);te?de.add(L):de.delete(L),_(de)}function re(){const L=new Set(d);H.forEach(te=>L.add(te)),_(L)}function ee(){const L=new Set(d);H.forEach(te=>{L.has(te)?L.delete(te):L.add(te)}),_(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:ie?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:ie,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:F,disabled:ie||i.entries.length===0,onChange:L=>void _(L.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:T,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[q," user"]}),s.jsxs("span",{children:[N," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:ie||$===H.length,onClick:re,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ie,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,j?s.jsx("span",{className:"reset-preview-selection-error",children:j}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,te)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${te+1}`,checked:d.has(L.id),disabled:ie,onChange:de=>Q(L.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:$e(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:ie,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:ie,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function MA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&i_(r.version,m)?n_(r.version):null;return D.useEffect(()=>{const x=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:lh(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?lh(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:$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((x,j)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:t_(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${j}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function OA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:j,runtimeCodexVersion:w,runtimeCodexReleasedAt:T,runtimeCodexUpdating:R,runtimeSettingsDraft:q,runtimeSettingsScope:N,settingsWorkspace:H,settingsWorkspaceId:$,systemDiagnostics:F,systemDiagnosticsLoading:ie,workspaceGroups:_,workspaceRuntimeSettings:Q,workspaceRuntimeSettingsDraft:re,onCancelEnvironmentEdit:ee,onClose:L,onCreateUser:te,onDeleteUser:de,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onSaveBaseMemoryItems:V,onSaveDeploymentSettings:oe,onSaveResponsibility:be,onSaveWorkspaceMemoryItems:Re,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:W,onSettingsWorkspaceChange:fe,onSubmitRuntimeSettings:X,onSubmitEnvironment:xe,onRefreshSystemDiagnostics:Me,onUpdateUser:Ve,onWorkspaceRuntimeDraftChange:Ct,onWorkspaceRuntimeReset:vt,revealedEnvironmentKeys:sn}){const[Fe,jt]=D.useState("model"),[It,on]=D.useState(!1),[Le,Ut]=D.useState(null),[hn,Kt]=D.useState(!1),[Si,Jn]=D.useState((H==null?void 0:H.responsibility)??""),[za,Mt]=D.useState(!1),La=D.useRef(null),ae=N==="workspace"?Object.values((Q==null?void 0:Q.sources)??{}).filter(ce=>ce==="workspace").length:0;return D.useEffect(()=>{N==="global"&&Kt(!1)},[N]),D.useEffect(()=>{Jn((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),D.useEffect(()=>{if(!hn)return;const ce=Ue=>{var Vt;const Xe=Ue.target;Xe instanceof Node&&((Vt=La.current)!=null&&Vt.contains(Xe))||Kt(!1)},Ee=Ue=>{Ue.key==="Escape"&&Kt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ee,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ee,!0)}},[hn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:L,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Fe!=="system"&&Fe!=="users"&&Fe!=="accounts"&&Fe!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":N==="global",className:N==="global"?"active":void 0,onClick:()=>W("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:La,children:[s.jsx("button",{"aria-checked":N==="workspace","aria-expanded":N==="workspace"?hn:void 0,"aria-label":N==="workspace"?"Settings workspace target":void 0,className:N==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(N!=="workspace"){W("workspace");return}Kt(ce=>!ce)},role:"radio",type:"button",children:N==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(H==null?void 0:H.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),N==="workspace"&&hn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:_.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ee=>s.jsxs("button",{"aria-selected":Ee.id===$,className:Ee.id===$?"selected":void 0,onClick:()=>{fe(Ee.id),Kt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ee.title}),s.jsxs("small",{children:["workspaces/",Ee.id]})]},Ee.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:L,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Fe==="model"?"active":void 0,onClick:()=>jt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Fe==="responsibility"?"active":void 0,onClick:()=>jt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Fe==="memory"?"active":void 0,onClick:()=>jt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Fe==="environment"?"active":void 0,onClick:()=>jt("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:Fe==="accounts"?"active":void 0,onClick:()=>jt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Fe==="deployment"?"active":void 0,onClick:()=>jt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{className:Fe==="system"?"active":void 0,onClick:()=>jt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Fe==="users"?"active":void 0,onClick:()=>jt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Fe!=="system"&&Fe!=="users"&&Fe!=="accounts"&&Fe!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${N==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:N==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:N==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Fe==="system"?s.jsx(zA,{conversations:i,diagnostics:F,loading:ie,onRefresh:Me}):Fe==="users"?s.jsx(GA,{currentUser:e,users:m,onCreate:te,onDelete:de,onUpdate:Ve}):Fe==="accounts"?s.jsx($A,{onSwitched:z}):Fe==="deployment"?s.jsx(VA,{settings:a,onSave:oe}):Fe==="model"?s.jsx(FA,{draft:N==="workspace"?re:q,globalSettings:x,models:j,codexVersion:w,codexReleasedAt:T,codexUpdating:R,scope:N,workspaceOverrideCount:ae,settings:N==="workspace"?(Q==null?void 0:Q.effective)??re:x,workspaceSettings:Q,onDraftChange:N==="workspace"?Ct:A,onResetWorkspaceSetting:vt,onSubmit:X,onUpdateCodexCli:C}):Fe==="responsibility"?s.jsx(UA,{draft:Si,saving:za,scope:N,workspace:H,onDraftChange:Jn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(N!=="workspace"||!H)&&(Mt(!0),be(H.id,Si).then(Ee=>Jn(Ee)).finally(()=>Mt(!1)))}}):Fe==="memory"?s.jsx(PA,{baseSettings:p,scope:N,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:V,onSaveWorkspaceItems:Re}):s.jsx(KA,{deleteConfirmKey:Le,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:N,workspaceEnvironment:d,valueVisible:It,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:Ut,onDeleteEnvironment:Ne,onDraftChange:ye,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:xe,onValueVisibleChange:on,revealedEnvironmentKeys:sn})]})]})]})})}function zA({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]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=w,T.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(w)},j=()=>{if(!i||!c.length)return;const w=c[0],T=c.slice(0,5).map($=>`- ${su($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
92
+ `),R=JSON.stringify(w,null,2),q=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${su(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(`
93
+ `),N=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",N),H.searchParams.set("body",q),window.open(H.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[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 · ",Op(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?Op(w.uptimeMs):`${Op(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Oh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(LA,{})}),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(IA,{})}),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," · ",su(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 LA(){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 IA(){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 UA({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=fd(i.usedPercent),r=Yv(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:Tw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Ew(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function qA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function HA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function $A({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),[m,b]=D.useState(""),[x,j]=D.useState(!1),[w,T]=D.useState(""),[R,q]=D.useState(null),[N,H]=D.useState(null),[$,F]=D.useState(""),[ie,_]=D.useState(null),[Q,re]=D.useState(null),[ee,L]=D.useState(!1);async function te(){var C;const z=await lb();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&(q(z.login),j(!0))}async function de(z){d(!0),b("");try{a(await rb(z))}catch(C){b(He(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return lb().then(C=>{var W;z||(a(C),((W=C.login)==null?void 0:W.status)==="pending"&&(q(C.login),j(!0)),C.accounts.length>0&&(d(!0),rb(!1).then(fe=>{z||a(fe)}).catch(fe=>{z||b(He(fe).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(He(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!R||R.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{$2(R.id).then(async W=>{z||(q(W),W.status!=="pending"&&(window.clearInterval(C),W.status==="succeeded"&&a(fe=>{if(!fe||!W.account)return fe;const X=fe.accounts.some(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)})?fe.accounts.map(xe=>{var Me;return xe.id===((Me=W.account)==null?void 0:Me.id)?W.account:xe}):[...fe.accounts,W.account];return{...fe,accounts:X}})))}).catch(W=>{z||b(He(W).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function Ne(){T(""),q(null),b(""),L(!1),j(!0)}async function ye(z){z.preventDefault(),g(!0),b("");try{q(await H2(w.trim()))}catch(C){b(He(C).message)}finally{g(!1)}}async function ue(){if(!R||R.status!=="pending"){j(!1);return}g(!0),b("");try{const z=await G2(R.id);q(z),j(!1)}catch(z){b(He(z).message)}finally{g(!1)}}function V(z){H(z),F(z.name),b("")}async function oe(z){if(z.preventDefault(),!N)return;const C=$.trim();if(!C||C===N.name){H(null);return}g(!0),b("");try{await V2(N.id,C),await te(),H(null)}catch(W){b(He(W).message)}finally{g(!1)}}async function be(){var z;if(ie){g(!0),b("");try{const C=await P2(ie.id);a(C),_(null),await e()}catch(C){const W=He(C);b((z=W.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":W.detail??W.message)}finally{g(!1)}}}async function Re(){if(Q){g(!0),b("");try{await F2(Q.id),await te(),re(null)}catch(z){b(He(z).detail??He(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void de(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(R==null?void 0:R.status)==="pending",onClick:Ne,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide active account"}),s.jsx("span",{children:"Switching requires the cloud runtime to be idle. The cloud publishes the selected credential; members pause new work and apply it after any active turn finishes. There is no per-deployment selection."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var Ve,Ct;const C=(i==null?void 0:i.activeAccountId)===z.id,W=(Ve=i==null?void 0:i.accountDetails)==null?void 0:Ve[z.id],fe=((Ct=i==null?void 0:i.accountIssues)==null?void 0:Ct[z.id])??[],X=fe.length>0,xe=fe.some(vt=>["missing_credential","invalid_credential","credential_unreadable"].includes(vt.code)),Me=[z.email,qA(z.accountType),HA(z.planType)].filter(vt=>!!vt);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${X?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null,X?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:Me.join(" · ")||`Added ${$e(z.createdAt)}`}),X?s.jsx("div",{className:"codex-account-issues",role:"status",children:fe.map(vt=>s.jsx("span",{children:vt.message},vt.code))}):null,W!=null&&W.usage?s.jsx(BA,{usage:W.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),W?s.jsx("small",{className:W.error?"codex-account-detail-error":"codex-account-refreshed",children:W.error?`Refresh issue: ${W.error}`:`Updated ${$e(W.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c||xe,onClick:()=>V(z),title:xe?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:X?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||X,onClick:()=>{b(""),_(z)},type:"button",children:C?"In use":X?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),re(z)},type:"button",children:"Delete"})]})]},z.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&H(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void oe(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>H(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>F(z.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>H(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!R&&j(!1),role:"presentation",children:R?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:R.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),R.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:R.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(R.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:R.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):R.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=R.account)==null?void 0:A.name)??R.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:R.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:R.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ye(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>j(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>T(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>j(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,ie?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:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:ie.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void be(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,Q?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&re(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>re(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:Q.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>re(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void Re(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function GA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[j,w]=D.useState(null),[T,R]=D.useState("");function q(){m(c),R(""),p("new")}function N(F){m({username:F.username,password:"",role:F.role,active:F.active}),R(""),p(F)}function H(){b||(p(null),R(""))}async function $(F){if(F.preventDefault(),!!d){x(!0),R("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(ie){R(He(ie).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:q,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(F=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:F.username}),F.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(F.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${F.role}`,children:F.role}),s.jsx("span",{className:`user-status ${F.active?"active":"disabled"}`,children:F.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${F.username}`,className:"memory-icon-button",onClick:()=>N(F),title:"Edit",type:"button",children:s.jsx(dd,{})}),s.jsx("button",{"aria-label":`Delete user ${F.username}`,className:"memory-icon-button memory-item-delete",disabled:F.id===e.id,onClick:()=>{R(""),w(F)},title:"Delete",type:"button",children:"×"})]})]},F.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:H,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:F=>F.stopPropagation(),onSubmit:F=>void $(F),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:H,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:F=>m(ie=>({...ie,username:F.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:F=>m(ie=>({...ie,password:F.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:F=>m(ie=>({...ie,role:F.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:F=>m(ie=>({...ie,active:F.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:H,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,j?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:F=>F.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(F=>R(He(F).message))},type:"button",children:"Delete"})]})]})}):null]})}function VA({settings:e,onSave:i}){const[a,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(a).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:a.profuseNotificationEnabled,onChange:d=>r({profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function FA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:j,onUpdateCodexCli:w}){var F;const T=d==="workspace",R=Jo(r.model,c),q=Jo(u.model,c),N=Jo(p.model,c),H=Tx(r.reasoningEffort,R),$=GE(R,r.reasoningEffort);return D.useEffect(()=>{R&&H!==r.reasoningEffort&&b({...r,reasoningEffort:H})},[r,R,H,b]),s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:j,children:[s.jsxs("label",{className:qc(T,Cl(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Bc,{globalValue:hb(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Cl(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(Sp,{"aria-label":"Runtime model",onChange:ie=>{const _=Jo(ie,c);b({...r,model:ie,reasoningEffort:Tx(r.reasoningEffort,_)})},options:a_(c,r.model),value:r.model||((F=c.find(ie=>ie.isDefault))==null?void 0:F.model)||""})]}),s.jsxs("label",{className:qc(T,Cl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Bc,{globalValue:Cx(u.reasoningEffort,q),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Cl(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(Sp,{"aria-label":"Runtime reasoning effort",onChange:ie=>b({...r,reasoningEffort:ie}),options:$,value:H})]}),s.jsxs("label",{className:qc(T,Cl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Bc,{globalValue:yb(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Cl(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(Sp,{"aria-label":"Permission mode",onChange:ie=>b({...r,sandbox:ie}),options:oA,value:r.sandbox})]}),s.jsxs("label",{className:qc(T,Cl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Bc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Cl(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:ie=>b({...r,fastMode:ie.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 ",hb(p.model,c),", reasoning"," ",Cx(p.reasoningEffort,N),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",yb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:lh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function Bc({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 Sp({"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 x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Cl(e,i,a){return e!==i?"workspace":a}function qc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function PA({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(WA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(YA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function YA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var Q;const[c,d]=D.useState(ru(a)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,j]=D.useState(null),[w,T]=D.useState(null),[R,q]=D.useState(null);D.useEffect(()=>{d(ru(a))},[a]),D.useEffect(()=>{if(p===null)return;const re=ee=>{ee.key==="Escape"&&(F(),T(null))};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[p]);async function N(re,ee){q(ee);try{const L=await r(re);return d(ru(L)),L}finally{q(null)}}function H(){T(null),j(null),b({key:"",value:""}),g("new")}function $(re){const ee=c[re];ee&&(T(null),j(null),b({...ee}),g(re))}function F(){g(null),j(null),b({key:"",value:""})}async function ie(re){const ee=c[re],L=(ee==null?void 0:ee.key)||`${re}`;await N(c.filter((te,de)=>de!==re),`delete:${L}`),T(null)}async function _(re){re.preventDefault(),re.stopPropagation();const ee=m.key.trim(),L=cD(ee);if(L){j(L);return}const te=m.value.trim();if(!te){j("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ye,ue)=>ue!==de&&ye.key.trim()===ee)){j(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ne={...m,key:ee,value:te};p==="new"?await N([...c,Ne],"add"):typeof p=="number"&&await N(c.map((ye,ue)=>ue===p?Ne:ye),`save:${p}`),F()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((re,ee)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${re.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${re.key}>`}),`
94
+ `,s.jsx("span",{children:re.value}),`
95
+ `,s.jsx("span",{className:"memory-tag",children:`</${re.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>$(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${re.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>T(ee),children:"×"})]})]},`${ee}-${re.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:F,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:re=>re.stopPropagation(),onSubmit:re=>void _(re),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:F,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:re=>b(ee=>({...ee,key:re.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:re=>b(ee=>({...ee,value:re.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:F,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:R!==null,type:"submit",children:R==="add"||R!=null&&R.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:re=>re.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((Q=c[w])==null?void 0:Q.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:R!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:R!==null,type:"button",onClick:()=>void ie(w),children:"Delete"})]})]})}):null]})}function WA({emptyText:e,items:i}){const a=ru(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}>`}),`
96
+ `,s.jsx("span",{children:r.value}),`
97
+ `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function KA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:j,onSubmitEnvironment:w,onValueVisibleChange:T,revealedEnvironmentKeys:R}){const q=i!==null&&R.has(i),N=u==="workspace",H=N?c:r,[$,F]=D.useState(!1);function ie(){p(),b({description:"",key:"",value:""}),T(!1),F(!0)}function _(ee){x(ee),T(!1),F(!0)}function Q(){F(!1),p(),T(!1)}function re(ee){w(ee),F(!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(Ix,{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:ie,children:"+"})}),s.jsx(Ix,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:_,variables:H})]}),$?s.jsx("div",{className:"memory-editor-overlay",onClick:Q,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:re,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Q,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...a,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...a,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!q&&!a.value){j(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(k2,{}):s.jsx(w2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...a,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Q,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Ix({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 Vv({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:QA(p.kind)}),s.jsx("span",{className:eN(p.status),children:ZA(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," · ",JA(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(dd,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function XA({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(Vv,{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 QA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function ZA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function JA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function eN(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 tN({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,nN(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Ux(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:Ux(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 Ux(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function nN(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 iN({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:Wo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Wo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Wo(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:Wo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Wo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":As(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 Ko(e,i,a,r,u,c,d,p,g,m){var b,x,j,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$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(Zo,{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(Xx,{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:f_(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(Xx,{content:e.message.content}):s.jsx(Zo,{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(Zo,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const T=wr({},[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:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Wc,{})}):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(Pv,{description:e.tool.body,icon:s.jsx(Fv,{}),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(mN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(pN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(dN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(fN,{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(Wc,{})}),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(Zo,{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(Wc,{})}):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 Bx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&aN(e.tool)}function aN(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 lN(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 rN({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:j,onOpenComplexTask:w,onOpenSystemEvent:T}){const R=lN(e.agentItems.filter(Bx)),q=e.agentItems.some(te=>!Bx(te)),N=a&&(q||e.turnIds.length>0),H=c?"process":"result",[$,F]=D.useState(H),[ie,_]=D.useState(!1),Q=$==="result"?R:e.agentItems,re=xN(Q);D.useEffect(()=>{ie||F(H)},[H,ie]);const ee=c||N||e.stopped,L=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):N?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),F(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(sN,{}):s.jsx(oN,{})}):null}):null,Q.map(te=>s.jsx(D.Fragment,{children:Ko(te,i,m,d,u,b,x,j,w,T)},te.id)),$==="result"&&Q.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":q?"No reliable final answer captured":"No result yet"}):null,s.jsx(Xo,{copied:r,content:re,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:bN(Q),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:L})}function sN(){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 oN(){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 uN(){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 Fv(){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 cN(){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 Pv({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 dN({conversation:e,tool:i,onRespond:a}){var q;const r=Se((q=i.workspaceChangePayload)==null?void 0:q.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=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)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Pv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(dd,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:N=>N.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:j?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,T?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:N=>c(N.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Tl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Tl(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void R("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void R("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function fN({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",m=g==="pending",b=qx(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})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx(Hx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Hx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{qx(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 qx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function Cp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Hx({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:Cp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:Cp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:Cp(e.content??e.description)})]})]})})}function pN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=BE(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:UE(a,r)})]}),s.jsx($x,{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:hN(p.kind)}),s.jsx("code",{title:p.path,children:Nv(p.path,r)}),s.jsx($x,{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 $x({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 hN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function mN({tool:e,onRespondApproval:i}){var j;const a=ID(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=id(e.body)?null:e.body,m=g?$D(g):null,b=m?`${gN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=UD(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:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(j=e.rawEvents)!=null&&j.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Gx,{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:BD(e,a)}),e.output?s.jsx(Gx,{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(yN,{events:e.rawEvents??[]}):null]})}function gN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Gx({content:e}){const[i,a]=D.useState(!1),r=HD(e,Ox);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:qD(e,Ox)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function yN({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 Xo({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(ow,{})}):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 Qo(e){return e.type==="message"?e.message.role==="user"?e.message.content:jr(e.message.content):e.type==="assistantText"?jr(e.content):e.type==="turnError"?`Task failed
98
+
99
+ ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
100
+
101
+ `):""}function xN(e){return e.map(Qo).filter(i=>i.trim()).join(`
102
+
103
+ `)}function bN(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 vN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(wN,{label:Yv(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 Yv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function wN({label:e,window:i}){const a=fd(i.usedPercent),r=Ih(a),u=`${e} usage ${Tw(a)} · resets ${Ew(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 kN(e,i,a,r,u,c){const d=[...e].sort(lu),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])),m=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])),x=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),j=x.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),w=x.filter(_=>!j.includes(_)),T=new Set(x.flatMap(_=>_.turnId?[_.turnId]:[])),R=TE(i),q=new Map(a.map(_=>[_.id,_])),N=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),$=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...a.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var Fe,jt,It,on;const Q=q.get(_),re=d.filter(Le=>Le.turnId===_),ee=re.filter(Le=>Le.role==="user").sort((Le,Ut)=>{const hn=b.get(Le.id)??Le.createdAt,Kt=b.get(Ut.id)??Ut.createdAt;return hn.localeCompare(Kt)||lu(Le,Ut)}),L=re.filter(Le=>Le.role==="assistant"),te=i.filter(Le=>Le.turnId===_).sort(lu),de=`turn:${_}`,Ne=r.filter(Le=>Le.parentId===de).sort((Le,Ut)=>Le.sequence-Ut.sequence),ye=(Q==null?void 0:Q.origin)??R.get(_),ue=j.filter(Le=>Le.turnId===_).sort((Le,Ut)=>Le.timelineAt.localeCompare(Ut.timelineAt)||Le.sequence-Ut.sequence).map(Le=>Vx(Le,void 0,c)),V=ye==="timeline_event"?[]:r.length>0?_N(Ne,te,iu([_],u),c):Kv(te,iu([_],u),c),oe=L.map(Yo),be=Ne.find(Le=>Le.subtype==="server.complex_task.plan_updated"),Re=te.find(Le=>Le.event==="server.complex_task.plan_updated"),O=(be==null?void 0:be.detail)??(Re==null?void 0:Re.data),A=me(me(O).task),z=me(A.currentPlan),C=Se(z.planMarkdown),W=TN(DN(V,oe),C),fe=EE(Q);fe&&W.push({id:`turn-error-${fe.turnId}`,type:"turnError",createdAt:fe.createdAt,content:fe.content});const X=te.find(Le=>Le.event==="server.wakeup.started"),xe=me(X==null?void 0:X.data),Me=typeof xe.instruction=="string"?xe.instruction.trim():"",Ve=ye==="timeline_event"?te[0]:void 0,Ct=T.has(_)?null:Ve?Wv(Ve,(Q==null?void 0:Q.startedAt)??new Date(0).toISOString()):EN(ye)?{id:`system-${_}`,type:"system",createdAt:(Q==null?void 0:Q.startedAt)??((Fe=te[0])==null?void 0:Fe.createdAt)??new Date(0).toISOString(),title:AN(ye??"system"),detail:NN(ye??"system",Me),fullDetail:Me||void 0}:null,vt=FN(te),sn=(ee[0]?b.get(ee[0].id):(jt=j.find(Le=>Le.turnId===_))==null?void 0:jt.timelineAt)??g.get(_)??(Q==null?void 0:Q.startedAt)??((It=re[0])==null?void 0:It.createdAt)??((on=te[0])==null?void 0:on.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:Ct??(ee[0]?Yo(ee[0]):null),followupUsers:ee.slice(1).map(Yo),acceptedSystemInputs:ue,agentItems:W,activity:vt??(iu([_],u)?{id:-1,title:W.some(Le=>Le.type==="assistantText"&&Le.streaming)?"Writing response":"Working",createdAt:sn,tone:"running"}:null),notificationFailure:VN(te),stopped:te.some(Qv),trailingSystemItems:[],sortAt:sn,sortSequence:p.get(_)??null}}),F=d.filter(_=>!_.turnId);$.push(...F.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?Yo(_):null,followupUsers:[],agentItems:_.role==="assistant"?[Yo(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const ie=new Map(i.map(_=>[String(_.id),_]));return $.push(...w.map(_=>({id:_.id,turnIds:[],user:Vx(_,_.entityType==="event"&&_.entityId?ie.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),$.sort((_,Q)=>{const re=_.sortAt.localeCompare(Q.sortAt);return re!==0?re:_.sortSequence!==null||Q.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(Q.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...Q})=>Q)}function Vx(e,i,a){var g,m;if(i||e.entityType==="event")return Wv(i??th(e),e.createdAt);const r=me(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Yp(r,a),x=jN(r.messages,a),j=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(T=>typeof T=="string"&&T.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",j.length>0?j.map(T=>{const R=a.get(T)??T;return`${xr(R)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
104
+ `)}}const u=Se(r.complexTaskId)||Se(me(r.task).id)||void 0,c=Ev(e.title,e.subtype),d=wr(r,[e.summary,e.contentMarkdown]),p=[`## ${xr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
105
+ `):""].filter(Boolean).join(`
106
+ `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function jN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=Se(c.id),p=Se(c.senderWorkspaceId),g=Se(c.contentMarkdown).trim(),m=Se(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(Se(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Wv(e,i){return e.event==="server.collaboration.topic_created"?SN(e,i):CN(e,i)}function SN(e,i){const a=me(me(e.data).topic),r=Se(a.title).trim()||"Untitled Topic",u=Se(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=Se(a.ownerWorkspaceId),p=c.find(x=>Se(x.role)==="owner"||Se(x.workspaceId)===d),g=Se(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Se(x.role)!=="owner"&&Se(x.status)==="active"),b=m.length?m.map(x=>{const j=Se(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${xr(j)} (\`${Se(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",xr(r),"","**描述**","",xr(u),"","**Owner Workspace**","",`${xr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
107
+ `)}}function CN(e,i){const a=me(e.data),r=eh(e.data),u=Ev(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:wr(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${xr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
108
+ `)}}function eh(e,i=""){return Array.isArray(e)?e.map(a=>eh(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,eh(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&su(e)||e}function TN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?jr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?jr(r.message.content).trim()!==a:!0):e}function EN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function AN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function NN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?bw(i,20):"Auto resumed"}function DN(e,i){if(e.some(u=>u.type==="assistantText"))return nd(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&Rh(u.tool)&&_h(a,u.tool)||r.push(u);return nd([...r,...a])}function _N(e,i,a,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=RN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Ma(x),x)}if(a)for(const m of i)MN(e,m)||c.set(Ma(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Ma(m),m);const p=Kv([...c.values()].sort(lu),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:ON(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:zN(m,r)})}return nd(p)}function RN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[th(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Dh(u)===e.entityId);return r.length>0?r:[th(e)]}return[]}function th(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":Se(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 MN(e,i){const a=i.id===void 0?null:String(i.id),r=Dh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Dh(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return Se(r.id)||Se(a.itemId)||null}function ON(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function zN(e,i){var r,u;const a=me(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Yp(a,i).title:e.title||vw(e.subtype),body:e.subtype==="input:collaboration_notice"?Yp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||pw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Kv(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"){UN(r,p);continue}if(p.event==="server.knowledge.decision"){BN(r,p);continue}if(Qv(p)){GN(r);continue}if(p.event==="server.steer"){const T=me(p.data),R=typeof T.message=="string"?T.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:R||"Additional input",messageId:typeof T.messageId=="string"?T.messageId:void 0});continue}const g=s_(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=r_(p.data);if(m!=null&&m.text){const T=m.itemId?d.get(m.itemId)??m.phase:m.phase,R=m.itemId??`phase:${T}`,q=`${u.get(R)??""}${m.text}`,N=aw(q),H=c.get(R)??"",$=N.startsWith(H)?N.slice(H.length):N;if(u.set(R,q),c.set(R,N),$){const F=r[r.length-1];(F==null?void 0:F.type)==="assistantText"&&HN(F,m.itemId,T)?(F.content+=$,F.itemId=F.itemId??m.itemId,F.streamKey=F.streamKey??R,F.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:T,itemId:m.itemId,streamKey:R,streaming:i})}continue}const b=o_(p.data);if(b!=null&&b.text){const T=jr(b.text),R=b.itemId??`phase:${b.phase}`,q=$N(r,b.itemId,b.phase);if(q>=0){const N=r[q];N.type==="assistantText"&&(T?(N.content=T,N.phase=b.phase,N.itemId=N.itemId??b.itemId,N.streamKey=N.streamKey??R,N.streaming=!1,IN(r,q,b.itemId)):r.splice(q,1))}else T&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:T,phase:b.phase,itemId:b.itemId,streamKey:R,streaming:!1});continue}const x=MD(p,a);if(x){x.rawEvents=[p];const T=Px(r,x);if(T>=0){Yx(r[T],x);continue}if(Rh(x)&&_h(r,x)||x.kind==="command"&&x.meta==="running"&&id(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const j=OD(p);if(j){j.rawEvents=[p];const T=Px(r,j);if(T>=0){Yx(r[T],j);continue}r.push({id:`tool-${j.id}`,type:"tool",createdAt:j.createdAt,tool:j});continue}if(OE(p)){LN(r,p);continue}const w=zD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return nd(r)}function LN(e,i){const a=Dh(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:Zv(u.tool.rawEvents,[i])};return}}}function IN(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 UN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.payload),d=Se(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 BN(e,i){const a=me(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=me(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function _h(e,i){const a=Xv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Fx(d,i))continue;const p=jr(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"||!Fx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),j=[];return b&&j.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),j.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&j.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...j),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function Fx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function nd(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&Rh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)_h(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return qN([...u,...r])}function Rh(e){return typeof Xv(e)=="number"}function Xv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function qN(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 HN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function $N(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 Qv(e){return e.event==="server.stop"||e.event==="server.stopped"}function GN(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 VN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=me(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function FN(e){for(let i=e.length-1;i>=0;i-=1){const a=ww(e[i]);if(a)return a}return null}function Px(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 Yx(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"&&id(i.body)&&!id(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:KD(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Zv(e.tool.rawEvents,i.rawEvents)}}function Zv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Ma(u);return r.has(c)?!1:(r.add(c),!0)})}function Yo(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Tp(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=>Jv(u)?!r.some(c=>PN(c,u)):!0)}function Ep(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 Ap(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 Jv(e){return e.id.startsWith("local-")}function PN(e,i){if(Jv(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 Hc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Ma(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=ew(c,d);return p!==0?p:(r.get(Ma(c))??0)-(r.get(Ma(d))??0)})}function Wx(e,i){const a=Ma(i),r=e.findIndex(c=>Ma(c)===a);if(r<0)return[...e,i];if(YN(e[r],i))return e;const u=[...e];return u[r]=i,u}function YN(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 Ma(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function lu(e,i){const a=ew(e,i);return a!==0?a:WN(e.id,i.id)}function ew(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 WN(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 Kx(e,i){const a=me(e.data);return typeof a.__seq=="number"&&typeof a.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(a,"payload")?{id:typeof a.__eventId=="string"?a.__eventId:`stream:${a.__turnId??"unknown"}:${a.__seq}`,turnId:typeof a.__turnId=="string"?a.__turnId:null,seq:a.__seq,event:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Zo=D.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?aw(i):jr(i),g=a&&!r?n2(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(QN,{content:p,conversation:a}):Tl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(t2,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},KN);function KN(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 Xx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const XN=2;function QN({content:e,conversation:i}){const a=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=ZN(e);return D.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*XN,j=Math.min(m,x);return b!==null&&j<=b?b:j})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Tl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function ZN(e){const i=e2(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:JN(a),activeBlock:r}}function JN(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||($c(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&&($c(i,e.slice(a,m)),a=m,u=!1),g===""&&($c(i,e.slice(a,d)),a=d)}return a<e.length&&$c(i,e.slice(a)),i}function $c(e,i){i.trim()&&e.push(i)}function e2(e){const i=e.lastIndexOf(`
109
+ `);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
110
+ `&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
111
+ `,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 t2({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 n2(e,i){const a=new Map;for(const r of i2(e)){const u=tw(r);if(u){const c=nw(u).toLowerCase(),d=a.get(c);(!d||r2(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>a2(r,i)).filter(r=>r!==null)}function i2(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 a2(e,i){const a=tw(e);if(!a||!l2(a))return null;const r=iw(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:nw(r),url:ge(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function tw(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function l2(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function nw(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function iw(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 r2(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function jr(e){return e.trim()}function aw(e){return e.trim()}function Qx(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function s2(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?o2(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=d2(i);return a?Mh(a.language)==="mermaid"?s.jsx(f2,{code:a.code}):s.jsx(m2,{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:Zx(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:Zx(i),children:a})}}}function o2(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[a]=e.split("#",1),[r]=a.split("?",1),u=u2(r);if(!u)return null;const c=iw(u,i.workspacePath);return ge(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function u2(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function Zx(e){return e&&e!=="char"?{textAlign:e}:void 0}function Tl(e,i){const a=c2(e);return s.jsx(fC,{components:s2(i),remarkPlugins:[CE],skipHtml:!0,children:a})}function c2(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
112
+ $2`)}function d2(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:nh(a.props.children).replace(/\n$/,""),language:u}}function nh(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(nh).join(""):D.isValidElement(e)?nh(e.props.children):""}const lw="github-light",Np=new Map,Dp=new Map;let _p=null,Rp=null;const rw=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Mh(e){const i=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[i]??i}function sw(e){const i=Mh(e);return!i||i==="text"||i==="txt"?"text":rw.has(i)?i:"text"}function f2({code:e}){const a=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Dp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const j=Dp.get(e);return j?(d(j),g(null),()=>{b=!0}):(g(null),d(null),p2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Dp.set(e,w),d(w),g(null))},w=>{if(!b){const T=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(T)},sA)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Oh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function p2(e,i){return(await(await h2()).render(e,i)).svg}function h2(){return Rp||(Rp=Tt(()=>import("./mermaid.core-ejnGpyjP.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})),Rp}function m2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!tb(i))return null;const m=eb(e,i);return Np.get(m)??null}),p=a?{"--code-block-min-height":`${xA(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!tb(i))return d(null),()=>{m=!0};const b=eb(e,i),x=Np.get(b);return x?(d(x),()=>{m=!0}):(d(null),j2(e,i).then(j=>{Np.set(b,j),m||d(j)}).catch(j=>{console.warn("Failed to highlight code block",j),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Oh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Oh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function g2(){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 ow(){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 y2(){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 x2(){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 Jx(){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 b2(){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 Wc(){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 dd(){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 v2(){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 w2(){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 k2(){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 eb(e,i){return`${lw}:${sw(i)}:${e}`}function tb(e){const i=Mh(e);return!!i&&rw.has(i)}async function j2(e,i){return(await S2()).codeToHtml(e,{lang:sw(i),theme:lw})}function S2(){return _p||(_p=C2()),_p}async function C2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:j},{default:w},{default:T},{default:R},{default:q},{default:N},{default:H},{default:$},{default:F},{default:ie}]=await Promise.all([Tt(()=>import("./core-DnwHDF9S.js"),[],import.meta.url),Tt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Tt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),Tt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Tt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Tt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Tt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Tt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Tt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Tt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Tt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Tt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Tt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Tt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Tt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),Tt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Tt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Tt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Tt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Tt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Tt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,j,w,T,R,q,N,H,$,F,ie]})}async function nb(){const e=ge("conversations"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).conversations}async function T2(){const e=ge("workspace-states"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).workspaces}async function ib(){const e=ge("collaboration/topics"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).topics}async function Gc(e){const i=ge(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).messages}async function E2(e){const i=ge("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ce(a,{method:"POST",url:i}),(await a.json()).topic}async function A2(e,i){const a=ge(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ce(r,{method:"PATCH",url:a}),(await r.json()).topic}async function N2(e,i){const a=ge(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Ce(r,{method:"POST",url:a}),(await r.json()).topic}async function D2(e){const i=ge(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Ce(a,{method:"POST",url:i})}async function ab(){const e=ge("workspace-groups"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).groups}async function _2(e){const i=ge("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Ce(a,{method:"POST",url:i}),(await a.json()).group}async function R2(e,i){const a=ge(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ce(r,{method:"PATCH",url:a}),(await r.json()).group}async function M2(e){const i=ge(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Ce(a,{method:"DELETE",url:i}),await a.json()}async function O2(){const e=ge("settings/environment"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).variables}async function z2(e){const i=ge(`conversations/${e}/settings/environment`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).variables}async function L2(e){const i=ge(`conversations/${e}/knowledge`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).items}async function I2(){const e=ge("settings/runtime"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).settings}async function U2(){const e=ge("settings/deployment"),i=await fetch(e);return await Ce(i,{url:e}),(await i.json()).settings}async function B2(){const e=ge("diagnostics"),i=await fetch(e);return await Ce(i,{url:e}),await i.json()}async function q2(){const e=ge("settings/runtime/codex"),i=await fetch(e);return await Ce(i,{url:e}),await i.json()}async function lb(){const e=ge("settings/runtime/accounts"),i=await fetch(e);await Ce(i,{url:e});const a=await i.json();return Cr(),a}async function rb(e=!1){const i=ge(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Ce(a,{method:"POST",url:i});const r=await a.json();return Cr(),r}async function H2(e){const i=ge("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Ce(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&Cr(),r.login}async function $2(e){const i=ge(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).login}async function G2(e){const i=ge(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Ce(a,{method:"POST",url:i}),(await a.json()).login}async function V2(e,i){const a=ge(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Ce(r,{method:"PATCH",url:a});const u=await r.json();return Cr(),u.account}async function F2(e){const i=ge(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Ce(a,{method:"DELETE",url:i}),Cr()}async function P2(e){const i=ge(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Ce(a,{method:"POST",url:i});const r=await a.json();return Cr(),r}async function Y2(e=!0){const i=ge(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ce(a,{url:i}),await a.json()}async function W2(e=!1){const i=ge(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Ce(a,{url:i}),await a.json()}async function K2(){const e=ge("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Ce(i,{method:"POST",url:e}),(await i.json()).job}async function X2(e){const i=ge(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).settings}async function Q2(){const e=ge("settings/memory"),i=await fetch(e);return await Ce(i,{url:e}),await i.json()}async function Z2(e){const i=ge("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ce(a,{method:"PUT",url:i}),(await a.json()).settings}async function J2(e){const i=ge("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ce(a,{method:"PUT",url:i}),(await a.json()).settings}async function sb(e,i){const a=ge(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ce(r,{method:"PUT",url:a}),await r.json()}async function ob(e,i){const a=ge(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ce(r,{method:"POST",url:a});const u=(await r.json()).job;return cw(e,u)}async function uw(e){const i=ge(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).job}async function cw(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 uw(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.status==="cancelled"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function ub(e){const i=ge(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Ce(a,{url:i}),await a.json()}async function eD(e,i){const a=ge(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ce(r,{method:"PUT",url:a})}async function tD(e){const i=ge(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).result}async function nD(e){const i=ge(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Ce(a,{url:i});const r=await a.json();return r.event?kw(r.event):null}async function iD(e){const i=ge(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Ce(a,{url:i}),await a.json()}async function aD(e){const i=ge(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).compactions}function lD(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:VE(e.reasoningEffort,i.reasoningEffort,(a==null?void 0:a.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function rD(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:oD(e.sourceCluesText),requiredEnv:uD(e.requiredEnvText)}}function sD(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(`
113
+ `),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
114
+ `)}}function oD(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 uD(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 cb(e,i){const a=db(i.attention)-db(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function db(e){return e==="watch"?2:e==="tracked"?1:0}function ru(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function cD(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 dD(e){return ru(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
115
+ `)}async function fD(e){const i=ge("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ce(a,{method:"PUT",url:i}),await a.json()}async function pD(e,i,a){const r=ge("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Ce(u,{method:"PUT",url:r}),(await u.json()).variable}async function hD(e,i,a,r){const u=ge(`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 Ce(c,{method:"PUT",url:u}),await c.json()}async function mD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).variable.value}async function gD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Ce(r,{url:a}),(await r.json()).variable.value}async function yD(e){const i=ge(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Ce(a,{method:"DELETE",url:i})}async function xD(e,i){const a=ge(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Ce(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function bD(e,i){const a=ge(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ce(r,{method:"POST",url:a}),(await r.json()).item}async function vD(e,i,a){const r=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Ce(u,{method:"PATCH",url:r}),(await u.json()).item}async function wD(e,i){const a=ge(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Ce(r,{method:"DELETE",url:a})}async function kD(){const e=ge("meta"),i=await fetch(e);return await Ce(i,{url:e}),await i.json()}async function jD(e){const i=ge(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).usage??null}async function SD(e,i){const a=ge("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Ce(r,{method:"POST",url:a}),(await r.json()).conversation}async function CD(e){const i=ge(`conversations/${e}/complex-task`),a=await fetch(i);return await Ce(a,{url:i}),(await a.json()).task}async function TD(e,i){const a=ge(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Ce(r,{url:a}),(await r.json()).task}async function ED(e,i){const a=ge(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Ce(r,{method:"POST",url:a}),(await r.json()).task}async function AD(e,i,a){const r=ge(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Ce(u,{method:"POST",url:r}),await u.json()}async function ND(e){const i=ge(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Ce(a,{method:"POST",url:i}),await a.json()}async function Mp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Rv)),i.before&&a.set("before",i.before);const r=ge(`conversations/${e}?${a}`),u=await fetch(r);return await Ce(u,{url:r}),(await u.json()).conversation}async function DD(e,i){const a=ge(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Ce(r,{url:a}),(await r.json()).events}async function Vc(e,i){const a=ge(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ce(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function _D(e){const i=ge(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await Ce(a,{method:"DELETE",url:i})}function RD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function dw(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function MD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:e_(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const c=me(e.data),d=Se(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=Se(c.audience),x=Se(c.recipientWorkspaceId),j=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(q=>typeof q=="string"):Array.isArray(c.recipients)?c.recipients.filter(q=>typeof q=="string"):[],w=j.filter(q=>q!=="ALL").map(q=>i.get(q)).filter(q=>!!q);let T="Topic";w.length>0?T=dw(w):j.length===1?T=j[0]==="ALL"?"Topic participants":Al(j[0]):j.length>1?T=`${j.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const R=Se(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:R?`Topic ${Al(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?Se(c.contentMarkdown)||void 0:Se(c.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(g||m)&&Se(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=me(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=me(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=me(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",j=Array.isArray(b.options)?b.options.map(w=>{const T=me(w);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
116
+ `):"";return j?`${x}
117
+
118
+ ${j}`:x}).join(`
119
+
120
+ `);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=me(e.data);if(Se(c.actionType)==="seele_workspace_change"){const p=me(c.payload),g=me(p.payload),m=Se(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:yw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Se(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=IE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:Se(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=LE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=me(e.data),d=me(c.params),p=Se(d.tool)||"dynamic tool",g=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:mw(p,!1,g),body:gw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:Se(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?fw(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&Se(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=me(e.data),d=me(c.payload),p=Se(d.content)||Se(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:Se(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:Se(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=me(e.data),d=me(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=me(e.data),d=me(c.task),p=me(d.currentPlan),g=me(c.update),m=Se(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:Se(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=me(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:Se(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=me(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Kc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=me(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:ih(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=JD(c.requestId),p=me(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"){const c=me(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Kc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Se(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=me(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Kc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Wp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:Se(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 OD(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=me(i.params),u=me(r.item),c=typeof u.type=="string"?u.type:"item";if(hw(c)||Sw(u))return null;const d=a==="item/completed",p=me(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?mw(g,d,p):d?`Finished ${El(c)}`:`Working on ${El(c)}`,body:g?gw(g,p):xw(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?LD(u):"running",topicAction:g==="seele_topics"?fw(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&Se(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?me(p.payload):void 0}}function fw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function zD(e){if(ww(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=zE(e);return i?{id:e.id,kind:"activity",title:vw(i),body:pw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function pw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return bw(i[a].trim(),180);return"Event details are available"}function hw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function LD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function El(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function mw(e,i,a){if(e==="seele_topics")switch(Se(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=Se(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=El(e);return i?`Finished ${r}`:`Running ${r}`}function gw(e,i){if(e==="seele_topics"){const a=Se(i.topicId);return a?`Topic ${Al(a)}`:"Topic"}if(e==="seele_wakeup")return Se(i.instruction)||(Se(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=Se(i.type)||"workspace";return yw(a,me(i.payload))}return El(e)}function yw(e,i){return e==="responsibility"?Se(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function xw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Ss(e[a].trim(),160);return typeof e.id=="string"?`${El(i)} ${Al(e.id)}`:El(i)}function ID(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 UD(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function BD(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 qD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
121
+ `);return a.length>i?`${u}
122
+ ...`:u}function HD(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function id(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function $D(e){const i=e.trim();return!i||i.includes(`
123
+ `)?null:Ss(i,120)}function Ss(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 bw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function vw(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 ww(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=me(e.data);if(c.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${Al(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:i,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(e.event==="runtime.compaction.started"){const c=me(e.data);return{id:e.id,title:"Codex compacting context",detail:ih(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=me(e.data);return{id:e.id,title:"Codex context compacted",detail:ih(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=me(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(e.event==="server.wakeup.started"){const c=me(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Ss(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=me(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Ss(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"||r==="item/completed"){const c=me(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:Ss(Kc(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=Sw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:Ss(g,96),createdAt:i,tone:p?"done":"running"};if(!hw(d))return{id:e.id,title:p?`Finished ${El(d)}`:`Working on ${El(d)}`,detail:xw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=me(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=me(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?As(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=me(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${pb(d)}`:`Finished ${pb(d)}`,detail:typeof c.durationMs=="number"?As(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function ih(e,i){const a=ad(e.before),r=ad(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${As(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${yr(a)} → ${yr(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${zh(c)} tokens`)}else a&&u.push(`context ${yr(a)}`);return u.join(" · ")}function GD(e){const i=ad(e.before),a=ad(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${yr(i)} → ${yr(a)}`:i?u=`${yr(i)} → unavailable`:a&&(u=`unavailable → ${yr(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":As(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${zh(r)} tokens`:"No decrease observed"}]}function ad(e){const i=me(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function yr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${zh(e.totalTokens)} tokens`}function zh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function VD(e){let i=null;for(const a of e)for(const r of a.events){const u=YD(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function fb(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function FD(e){let i=null;for(const a of e){const r=kw(a);r&&(!i||lu(a,i)>0)&&(i=r)}return i}function kw(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=me(i.params),r=me(a.tokenUsage),u=me(r.last),c=me(r.total),d=Object.keys(u).length>0?u:c,p=fi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:fi(d.inputTokens),cachedInputTokens:fi(d.cachedInputTokens),outputTokens:fi(d.outputTokens),reasoningOutputTokens:fi(d.reasoningOutputTokens),modelContextWindow:fi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function PD(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function jw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function YD(e){if(e.event!=="codex.notification")return null;const i=me(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=me(i.params),r=me(a.rateLimits),u=[r.primary,r.secondary].map(c=>WD(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function WD(e){const i=me(e);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function KD(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Kc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function Sw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Wp(e)[0])==null?void 0:a.path)??null}function me(e){return e&&typeof e=="object"?e:{}}function fi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Se(e){return typeof e=="string"?e:""}function xr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function XD(e){const i=me(e),a=me(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const j=me(b),w=Se(j.id)||`turn-${x+1}`,T=Array.isArray(j.items)?j.items:[];c+=T.length,u.push(QD(j,w)),T.forEach(R=>{const q=me(R),N=Se(q.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(m+=1)})}),{id:Se(a.id),sessionId:Se(a.sessionId),status:Cw(a.status),source:Lh(a.source),cwd:Se(a.cwd),path:Se(a.path),preview:Se(a.preview),createdAt:fi(a.createdAt),updatedAt:fi(a.updatedAt),recencyAt:fi(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function QD(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>Se(me(c).type)).filter(c=>c.length>0))).join(", "),u=ZD(a.map(c=>ah(c)).filter(Boolean).join(" "),220);return{id:i,status:Cw(e.status),itemsView:Se(e.itemsView)||"unknown",itemCount:a.length,startedAt:fi(e.startedAt),completedAt:fi(e.completedAt),durationMs:fi(e.durationMs),itemTypes:r,preview:u,raw:e}}function ah(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(ah).filter(Boolean).join(`
124
+ `);if(!e||typeof e!="object")return"";const i=e,a=Se(i.text),r=ah(i.content);return[a,r].filter(Boolean).join(`
125
+ `)}function Cw(e){const i=me(e);return Se(i.type)||Lh(e)}function ZD(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Wo(e){return e===null?"unknown":$e(e*1e3)}function JD(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Lh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function e_(e){if(typeof e=="string")return e;const i=me(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
126
+
127
+ ${r}`:a||r||Lh(e)}function pb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function As(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Op(e){if(e<6e4)return As(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 Tw(e){return`${Math.round(e)}%`}function Ln(e){return new Intl.NumberFormat("en-US").format(e)}function Xc(e){return e===null?"unknown":Ln(e)}function fd(e){return Math.max(0,Math.min(100,Math.round(e)))}function Ih(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function Ew(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 su(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function t_(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 hb(e,i){const a=Jo(e,i);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Jo(e,i){return e?i.find(a=>a.model===e)??null:i.find(a=>a.isDefault)??i[0]??null}function pd(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function lh(e,i){const a=pd(e);return i?`${a} (${$e(i)})`:a}function n_(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(pd(e))}`}function i_(e,i){const a=mb(e),r=mb(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 mb(e){if(!e)return null;const i=pd(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 a_(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 gb(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(`
128
+
129
+ `);u=p.pop()??"";for(const g of p){const m=l_(g);m&&i(m)}}}function l_(e){const i=e.split(`
130
+ `),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(`
131
+ `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function r_(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 s_(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 o_(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 Fc(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 Ts(e){return e.length<=6?e:e.slice(0,6)}function Al(e){return e.slice(0,8)}function yb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function xb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function zp(e,...i){return i.includes(e)}function u_(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 c_(e,i){const a=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(a)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function rh(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function d_(e,i){return`waiting ${ld(e,i)}`}function ld(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 Qc(e,i=null,a=Date.now()){if(e==="waiting")return i?d_(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 bb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function f_(e){return e==="assistant"?"Seele":"You"}const p_=document.getElementById("root"),Aw=window.__seeleCodexRoot??ej.createRoot(p_);window.__seeleCodexRoot=Aw;C_();Aw.render(s.jsx(D.StrictMode,{children:s.jsx(h_,{})}));function h_(){const[e,i]=D.useState(null),[a,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState("admin"),[g,m]=D.useState(""),[b,x]=D.useState(!1),[j,w]=D.useState("");D.useEffect(()=>{vb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),D.useEffect(()=>{let N=!1,H=0;const $=async()=>{try{const ie=await Nw();if(N)return;r(ie),c(""),H=window.setTimeout($,ie.status==="authorized"&&ie.configurationReady&&ie.codexAccountsReady?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),H=window.setTimeout($,3e3)}},F=()=>{window.clearTimeout(H),$()};return window.addEventListener(Zp,F),$(),()=>{N=!0,window.clearTimeout(H),window.removeEventListener(Zp,F)}},[]),D.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),m(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Qp,N),()=>window.removeEventListener(Qp,N)},[]);async function T(N){N.preventDefault(),x(!0),w("");try{const H=await fetch(ge("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!H.ok){w(H.status===401?"Incorrect username or password.":H.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}m(""),i(await vb())}catch{w("Unable to reach Seele.")}finally{x(!1)}}async function R(){await fetch(ge("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const q=y_();if(q&&e&&(!e.enabled||e.authenticated)){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return N.role!=="admin"?s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-access-denied",children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Administrator access required"}),s.jsx("p",{children:"This page changes deployment authorization."}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("a",{href:Ah(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void R(),type:"button",children:"Sign out"})]})]})}):s.jsx(g_,{authorization:a,currentUser:N,onLogout:R})}if(!q&&a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(m_,{authorization:a});if(!e||!a&&!q)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(AA,{authEnabled:e.enabled,currentUser:N,onLogout:R})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:T,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>p(N.target.value),value:d})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>m(N.target.value),type:"password",value:g})]}),j?s.jsx("p",{className:"auth-error",role:"alert",children:j}):null,s.jsx("button",{disabled:b||!d||!g,type:"submit",children:b?"Signing in...":"Sign in"})]})]})})}function m_({authorization:e}){const i={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},a=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:i[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:a.title}),s.jsx("p",{className:"deployment-lead",children:a.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?sh(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex account revision"}),s.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,s.jsx("a",{className:"deployment-primary-link",href:x_(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function g_({authorization:e,currentUser:i,onLogout:a}){const[r,u]=D.useState([]),[c,d]=D.useState({}),[p,g]=D.useState(null),[m,b]=D.useState(!0),[x,j]=D.useState("");D.useEffect(()=>{let T=!1,R=0;const q=async()=>{try{const N=await b_();if(T)return;u(N),d(H=>Object.fromEntries(N.map($=>[$.deploymentId,H[$.deploymentId]??$.name]))),j("")}catch(N){T||j(He(N).message)}finally{T||(b(!1),R=window.setTimeout(q,5e3))}};return q(),()=>{T=!0,window.clearTimeout(R)}},[]);async function w(T,R){g(T),j("");try{const q=await v_(T,R);u(N=>N.map(H=>H.deploymentId===q.deploymentId?q:H)),d(N=>({...N,[q.deploymentId]:q.name}))}catch(q){j(He(q).message)}finally{g(null)}}return s.jsxs("main",{className:"deployment-admin-shell",children:[s.jsxs("header",{className:"deployment-admin-header",children:[s.jsxs("div",{children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Deployments"}),s.jsx("p",{children:"Authorize or revoke Seele instances connected to this cloud deployment."})]}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("span",{children:i.username}),s.jsx("a",{href:Ah(),children:"Open Seele"}),s.jsx("button",{onClick:()=>void a(),type:"button",children:"Sign out"})]})]}),s.jsxs("section",{className:"deployment-admin-summary",children:[s.jsxs("div",{children:[s.jsx("strong",{children:r.length}),s.jsx("span",{children:"Total"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="pending").length}),s.jsx("span",{children:"Pending"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="authorized").length}),s.jsx("span",{children:"Authorized"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="revoked").length}),s.jsx("span",{children:"Revoked"})]})]}),e?s.jsxs("p",{className:"deployment-cloud-identity",children:["This cloud: ",s.jsx("code",{children:e.deploymentId})]}):null,x?s.jsx("p",{className:"deployment-error",role:"alert",children:x}):null,m?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!m&&r.length===0?s.jsx("p",{className:"deployment-admin-empty",children:"No deployment has contacted this cloud yet."}):null,s.jsx("div",{className:"deployment-list",children:r.map(T=>{const R=p===T.deploymentId,q=c[T.deploymentId]??T.name;return s.jsxs("article",{className:"deployment-card",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("span",{className:`deployment-status is-${T.status}`,children:T.status}),s.jsx("h2",{children:T.name}),s.jsx("code",{children:T.deploymentId})]}),s.jsx("button",{className:T.status==="authorized"?"is-danger":"is-primary",disabled:R,onClick:()=>void w(T.deploymentId,{status:T.status==="authorized"?"revoked":"authorized"}),type:"button",children:R?"Saving...":T.status==="authorized"?"Revoke":"Authorize"})]}),s.jsxs("dl",{className:"deployment-card-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Version"}),s.jsx("dd",{children:T.version})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last seen"}),s.jsx("dd",{children:sh(T.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:sh(T.firstSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsx("dd",{children:T.appliedGlobalRevision})]})]}),s.jsxs("form",{className:"deployment-name-form",onSubmit:N=>{N.preventDefault(),w(T.deploymentId,{name:q})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:R,maxLength:80,onChange:N=>d(H=>({...H,[T.deploymentId]:N.target.value})),value:q})]}),s.jsx("button",{disabled:R||!q.trim()||q.trim()===T.name,type:"submit",children:"Save name"})]})]},T.deploymentId)})})]})}function y_(){const e=Ah("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function x_(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function sh(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Nw(){const e=await fetch(ge("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function b_(){const e=ge("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Jt(i,{url:e});return(await i.json()).deployments}async function v_(e,i){const a=ge(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Jt(r,{method:"PATCH",url:a});return(await r.json()).deployment}async function vb(){const e=await fetch(ge("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function w_(){const e=ge("admin/users"),i=await fetch(e);if(!i.ok)throw await Jt(i,{url:e});return(await i.json()).users}async function k_(e){const i=ge("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await Jt(a,{method:"POST",url:i});return(await a.json()).user}async function j_(e,i){const a=ge(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Jt(r,{method:"PATCH",url:a});return(await r.json()).user}async function S_(e){const i=ge(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Jt(a,{method:"DELETE",url:i})}function C_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return a.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Qp)),a.status===503&&r.includes("/api/")&&Cr(),a},window.__seeleAuthFetchInstalled=!0}function Cr(){window.dispatchEvent(new Event(Zp))}export{Tt as _,tj as a,yj as b,mx as c,pj as f,wb as g,gj as h,ch as s,rj as w};