@seele00/seele-work 0.1.121 → 0.1.122

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 (70) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/libexec/seele-workspace-observe +0 -0
  4. package/package.json +1 -1
  5. package/release-manifest.json +128 -128
  6. package/web/dist/assets/{abnfDiagram-VRR7QNED-CNOZzheE.js → abnfDiagram-VRR7QNED-CvSHAcxA.js} +1 -1
  7. package/web/dist/assets/{arc-iaPHnNC_.js → arc-Dc55dDJU.js} +1 -1
  8. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Ci7_T28Q.js → architectureDiagram-ZJ3FMSHR-BNP4vpkl.js} +1 -1
  9. package/web/dist/assets/{blockDiagram-677ZJIJ3-DkZT_5L5.js → blockDiagram-677ZJIJ3-9vDGTnTr.js} +1 -1
  10. package/web/dist/assets/{c4Diagram-LMCZKHZV-Dd_Ilg_Z.js → c4Diagram-LMCZKHZV-Cr7fjjC3.js} +1 -1
  11. package/web/dist/assets/channel-CSPgjC-h.js +1 -0
  12. package/web/dist/assets/{chunk-2Q5K7J3B-CJ7tKMu_.js → chunk-2Q5K7J3B-B_q1Hnhp.js} +1 -1
  13. package/web/dist/assets/{chunk-32BRIVSS-BDObgqtg.js → chunk-32BRIVSS-mH97AQ-i.js} +1 -1
  14. package/web/dist/assets/{chunk-5VM5RSS4-MZPhgw4K.js → chunk-5VM5RSS4-BCHDM1lP.js} +1 -1
  15. package/web/dist/assets/{chunk-EX3LRPZG-Dv9RziIX.js → chunk-EX3LRPZG-Cieu7fIb.js} +1 -1
  16. package/web/dist/assets/{chunk-JWPE2WC7-ENc9cTCL.js → chunk-JWPE2WC7-TK1mszzj.js} +1 -1
  17. package/web/dist/assets/{chunk-MOJQB5TN-C79z3dkg.js → chunk-MOJQB5TN-DSLw0PS8.js} +1 -1
  18. package/web/dist/assets/{chunk-RYQCIY6F-Dq-RYifP.js → chunk-RYQCIY6F-B4GDh27L.js} +1 -1
  19. package/web/dist/assets/{chunk-V7JOEXUC-DsxHTdw9.js → chunk-V7JOEXUC-CmqGIPJ-.js} +1 -1
  20. package/web/dist/assets/{chunk-VR4S4FIN-CbWlGMJ2.js → chunk-VR4S4FIN-DnZFUrrj.js} +1 -1
  21. package/web/dist/assets/{chunk-XXDRQBXY-D4jGtb2v.js → chunk-XXDRQBXY-5ilRMeEJ.js} +1 -1
  22. package/web/dist/assets/classDiagram-OUVF2IWQ-CZvmPtSY.js +1 -0
  23. package/web/dist/assets/classDiagram-v2-EOCWNBFH-CZvmPtSY.js +1 -0
  24. package/web/dist/assets/{core-7aF5Cmf0.js → core-BhqdvYWU.js} +1 -1
  25. package/web/dist/assets/{cose-bilkent-JH36ORCC-C2L_g50e.js → cose-bilkent-JH36ORCC-SR1Ltf09.js} +1 -1
  26. package/web/dist/assets/{cynefin-VYW2F7L2-7JqzdEPt.js → cynefin-VYW2F7L2-BAv9iIsB.js} +1 -1
  27. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-Bx92ZJZM.js → cynefinDiagram-TSTJHNR4-Dno8NG-G.js} +1 -1
  28. package/web/dist/assets/{dagre-VKFMJZFB-CsewlPea.js → dagre-VKFMJZFB-CuMRZRId.js} +1 -1
  29. package/web/dist/assets/{diagram-FQU43EPY-E6CTtkk2.js → diagram-FQU43EPY-3K3KNW3c.js} +1 -1
  30. package/web/dist/assets/{diagram-G47NLZAW-Btalfx5v.js → diagram-G47NLZAW-DYvuyKEj.js} +1 -1
  31. package/web/dist/assets/{diagram-NH7WQ7WH-CdajPukC.js → diagram-NH7WQ7WH-D2AlkfNF.js} +1 -1
  32. package/web/dist/assets/{diagram-OA4YK3LP-BeRsVaAI.js → diagram-OA4YK3LP-DkHsJK82.js} +1 -1
  33. package/web/dist/assets/{diagram-WEI45ONY-D2dPE18A.js → diagram-WEI45ONY-CaiImQqN.js} +1 -1
  34. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-B3TUzoDv.js → ebnfDiagram-CCIWWBDH-g0yDvi9d.js} +1 -1
  35. package/web/dist/assets/{erDiagram-Q63AITRT-90Ohq06c.js → erDiagram-Q63AITRT-f2nAtu3g.js} +1 -1
  36. package/web/dist/assets/{flowDiagram-23GEKE2U-xCymTI-C.js → flowDiagram-23GEKE2U-Ckub2npG.js} +1 -1
  37. package/web/dist/assets/{ganttDiagram-NO4QXBWP-CNED0Px0.js → ganttDiagram-NO4QXBWP-BOr72u19.js} +1 -1
  38. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-BYBXg8UA.js → gitGraphDiagram-IHSO6WYX-DKlhkJwB.js} +1 -1
  39. package/web/dist/assets/{index-DxOW60R2.css → index-83Kyb2-Q.css} +1 -1
  40. package/web/dist/assets/index-D4FVYp35.js +131 -0
  41. package/web/dist/assets/{infoDiagram-FWYZ7A6U-97OL-vlk.js → infoDiagram-FWYZ7A6U-DBDsSnvO.js} +1 -1
  42. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BfX3EoE0.js → ishikawaDiagram-FXEZZL3T-B5jLDeMS.js} +1 -1
  43. package/web/dist/assets/{journeyDiagram-5HDEW3XC-C1s8x9j3.js → journeyDiagram-5HDEW3XC-Buge0-dC.js} +1 -1
  44. package/web/dist/assets/{kanban-definition-HUTT4EX6-AVoHiiZ3.js → kanban-definition-HUTT4EX6-n7YmfjlE.js} +1 -1
  45. package/web/dist/assets/{linear-C5VAVZpp.js → linear-5gVQWXr1.js} +1 -1
  46. package/web/dist/assets/{mermaid.core-B1OGaSdL.js → mermaid.core-DgCBkrfs.js} +4 -4
  47. package/web/dist/assets/{mindmap-definition-LN4V7U3C-Dwmj5qnV.js → mindmap-definition-LN4V7U3C-CsNZZS6J.js} +1 -1
  48. package/web/dist/assets/{pegDiagram-2B236MQR-EvLJRqWN.js → pegDiagram-2B236MQR-D_aW6q9s.js} +1 -1
  49. package/web/dist/assets/{pieDiagram-ENE6RG2P-CasTnBnO.js → pieDiagram-ENE6RG2P-Biz1y5YB.js} +1 -1
  50. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-BkR6bcHj.js → quadrantDiagram-ABIIQ3AL-CgBddvxb.js} +1 -1
  51. package/web/dist/assets/{railroadDiagram-RFXS5EU6-BquZEJQa.js → railroadDiagram-RFXS5EU6-B1mXmgoB.js} +1 -1
  52. package/web/dist/assets/{requirementDiagram-TGXJPOKE-BnOTqWtl.js → requirementDiagram-TGXJPOKE-B7U8ykgc.js} +1 -1
  53. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BE6Mn1yO.js → sankeyDiagram-HTMAVEWB-BvQ-3gz6.js} +1 -1
  54. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-DhlW7FOb.js → sequenceDiagram-DBY2YBRQ-DpAHO8Yh.js} +1 -1
  55. package/web/dist/assets/{sizeCapture-X5ZJPWSS-B0pdLbfH.js → sizeCapture-X5ZJPWSS-C6d20Bny.js} +1 -1
  56. package/web/dist/assets/{stateDiagram-2N3HPSRC-B5KgZyvz.js → stateDiagram-2N3HPSRC-st3Y4Kyp.js} +1 -1
  57. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BHcjFyfQ.js +1 -0
  58. package/web/dist/assets/{swimlanes-5IMT3BWC-Bv23kAbv.js → swimlanes-5IMT3BWC-BMIqpyFC.js} +2 -2
  59. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BtyU7JSW.js +8 -0
  60. package/web/dist/assets/{timeline-definition-FHXFAJF6-CJWNFZeS.js → timeline-definition-FHXFAJF6-COuE4DE6.js} +1 -1
  61. package/web/dist/assets/{vennDiagram-L72KCM5P-Cgc_luKn.js → vennDiagram-L72KCM5P-C1E8fAEj.js} +1 -1
  62. package/web/dist/assets/{wardleyDiagram-EHGQE667-CYclSCOh.js → wardleyDiagram-EHGQE667-BVea9E6G.js} +1 -1
  63. package/web/dist/assets/{xychartDiagram-FW5EYKEG-C4WK1mKk.js → xychartDiagram-FW5EYKEG-BAGDTiT7.js} +1 -1
  64. package/web/dist/index.html +2 -2
  65. package/web/dist/assets/channel-DMG74RMF.js +0 -1
  66. package/web/dist/assets/classDiagram-OUVF2IWQ-DwC1BNnn.js +0 -1
  67. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DwC1BNnn.js +0 -1
  68. package/web/dist/assets/index-DWUX_rZS.js +0 -131
  69. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BarzfUeH.js +0 -1
  70. package/web/dist/assets/swimlanesDiagram-G3AALYLV-DNRSolVb.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 Vk=Object.defineProperty;var Gk=(e,i,a)=>i in e?Vk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var $c=(e,i,a)=>Gk(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 Fk="modulepreload",Pk=function(e,i){return new URL(e,i).href},Cy={},Et=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(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const p=document.getElementsByTagName("link"),y=document.querySelector("meta[property=csp-nonce]"),m=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));u=d(a.map(b=>{if(b=Pk(b,r),b in Cy)return;Cy[b]=!0;const x=b.endsWith(".css"),S=x?'[rel="stylesheet"]':"";if(!!r)for(let R=p.length-1;R>=0;R--){const $=p[R];if($.href===b&&(!x||$.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${S}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":Fk,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((R,$)=>{E.addEventListener("load",R),E.addEventListener("error",()=>$(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 Cb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jf={exports:{}},Fo={};/**
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 Ty;function Yk(){if(Ty)return Fo;Ty=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 Fo.Fragment=i,Fo.jsx=a,Fo.jsxs=a,Fo}var Ey;function Wk(){return Ey||(Ey=1,Jf.exports=Yk()),Jf.exports}var s=Wk(),ep={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 Ay;function Kk(){if(Ay)return Be;Ay=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"),y=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=S&&A[S]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,$={};function M(A,z,C){this.props=A,this.context=z,this.refs=$,this.updater=C||E}M.prototype.isReactComponent={},M.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")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function H(){}H.prototype=M.prototype;function q(A,z,C){this.props=A,this.context=z,this.refs=$,this.updater=C||E}var F=q.prototype=new H;F.constructor=q,R(F,M.prototype),F.isPureReactComponent=!0;var ie=Array.isArray;function D(){}var X={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function J(A,z,C){var W=C.ref;return{$$typeof:e,type:A,key:z,ref:W!==void 0?W:null,props:C}}function U(A,z){return J(A.type,z,A.props)}function te(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ue(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var je=/\/+/g;function xe(A,z){return typeof A=="object"&&A!==null&&A.key!=null?ue(""+A.key):z.toString(36)}function ce(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(D,D):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function G(A,z,C,W,he){var ge=typeof A;(ge==="undefined"||ge==="boolean")&&(A=null);var ke=!1;if(A===null)ke=!0;else switch(ge){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(A.$$typeof){case e:case i:ke=!0;break;case b:return ke=A._init,G(ke(A._payload),z,C,W,he)}}if(ke)return he=he(A),ke=W===""?"."+xe(A,0):W,ie(he)?(C="",ke!=null&&(C=ke.replace(je,"$&/")+"/"),G(he,z,C,"",function(vt){return vt})):he!=null&&(te(he)&&(he=U(he,C+(he.key==null||A&&A.key===he.key?"":(""+he.key).replace(je,"$&/")+"/")+ke)),z.push(he)),1;ke=0;var oe=W===""?".":W+":";if(ie(A))for(var Oe=0;Oe<A.length;Oe++)W=A[Oe],ge=oe+xe(W,Oe),ke+=G(W,z,C,ge,he);else if(Oe=w(A),typeof Oe=="function")for(A=Oe.call(A),Oe=0;!(W=A.next()).done;)W=W.value,ge=oe+xe(W,Oe++),ke+=G(W,z,C,ge,he);else if(ge==="object"){if(typeof A.then=="function")return G(ce(A),z,C,W,he);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 ke}function se(A,z,C){if(A==null)return A;var W=[],he=0;return G(A,W,"","",function(ge){return z.call(C,ge,he++)}),W}function we(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 Me=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:se,forEach:function(A,z,C){se(A,function(){z.apply(this,arguments)},C)},count:function(A){var z=0;return se(A,function(){z++}),z},toArray:function(A){return se(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=M,Be.Fragment=a,Be.Profiler=u,Be.PureComponent=q,Be.StrictMode=r,Be.Suspense=y,Be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.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),he=A.key;if(z!=null)for(ge in z.key!==void 0&&(he=""+z.key),z)!ae.call(z,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&z.ref===void 0||(W[ge]=z[ge]);var ge=arguments.length-2;if(ge===1)W.children=C;else if(1<ge){for(var ke=Array(ge),oe=0;oe<ge;oe++)ke[oe]=arguments[oe+2];W.children=ke}return J(A.type,he,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,he={},ge=null;if(z!=null)for(W in z.key!==void 0&&(ge=""+z.key),z)ae.call(z,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(he[W]=z[W]);var ke=arguments.length-2;if(ke===1)he.children=C;else if(1<ke){for(var oe=Array(ke),Oe=0;Oe<ke;Oe++)oe[Oe]=arguments[Oe+2];he.children=oe}if(A&&A.defaultProps)for(W in ke=A.defaultProps,ke)he[W]===void 0&&(he[W]=ke[W]);return J(A,ge,he)},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:we}},Be.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Be.startTransition=function(A){var z=X.T,C={};X.T=C;try{var W=A(),he=X.S;he!==null&&he(C,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(D,Me)}catch(ge){Me(ge)}finally{z!==null&&C.types!==null&&(z.types=C.types),X.T=z}},Be.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Be.use=function(A){return X.H.use(A)},Be.useActionState=function(A,z,C){return X.H.useActionState(A,z,C)},Be.useCallback=function(A,z){return X.H.useCallback(A,z)},Be.useContext=function(A){return X.H.useContext(A)},Be.useDebugValue=function(){},Be.useDeferredValue=function(A,z){return X.H.useDeferredValue(A,z)},Be.useEffect=function(A,z){return X.H.useEffect(A,z)},Be.useEffectEvent=function(A){return X.H.useEffectEvent(A)},Be.useId=function(){return X.H.useId()},Be.useImperativeHandle=function(A,z,C){return X.H.useImperativeHandle(A,z,C)},Be.useInsertionEffect=function(A,z){return X.H.useInsertionEffect(A,z)},Be.useLayoutEffect=function(A,z){return X.H.useLayoutEffect(A,z)},Be.useMemo=function(A,z){return X.H.useMemo(A,z)},Be.useOptimistic=function(A,z){return X.H.useOptimistic(A,z)},Be.useReducer=function(A,z,C){return X.H.useReducer(A,z,C)},Be.useRef=function(A){return X.H.useRef(A)},Be.useState=function(A){return X.H.useState(A)},Be.useSyncExternalStore=function(A,z,C){return X.H.useSyncExternalStore(A,z,C)},Be.useTransition=function(){return X.H.useTransition()},Be.version="19.2.7",Be}var Ny;function uh(){return Ny||(Ny=1,ep.exports=Kk()),ep.exports}var N=uh(),tp={exports:{}},Po={},np={exports:{}},ip={};/**
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 Dy;function Xk(){return Dy||(Dy=1,(function(e){function i(G,se){var we=G.length;G.push(se);e:for(;0<we;){var Me=we-1>>>1,O=G[Me];if(0<u(O,se))G[Me]=se,G[we]=O,we=Me;else break e}}function a(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var se=G[0],we=G.pop();if(we!==se){G[0]=we;e:for(var Me=0,O=G.length,A=O>>>1;Me<A;){var z=2*(Me+1)-1,C=G[z],W=z+1,he=G[W];if(0>u(C,we))W<O&&0>u(he,C)?(G[Me]=he,G[W]=we,Me=W):(G[Me]=C,G[z]=we,Me=z);else if(W<O&&0>u(he,we))G[Me]=he,G[W]=we,Me=W;else break e}}return se}function u(G,se){var we=G.sortIndex-se.sortIndex;return we!==0?we:G.id-se.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 y=[],m=[],b=1,x=null,S=3,w=!1,E=!1,R=!1,$=!1,M=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function F(G){for(var se=a(m);se!==null;){if(se.callback===null)r(m);else if(se.startTime<=G)r(m),se.sortIndex=se.expirationTime,i(y,se);else break;se=a(m)}}function ie(G){if(R=!1,F(G),!E)if(a(y)!==null)E=!0,D||(D=!0,ue());else{var se=a(m);se!==null&&ce(ie,se.startTime-G)}}var D=!1,X=-1,ae=5,J=-1;function U(){return $?!0:!(e.unstable_now()-J<ae)}function te(){if($=!1,D){var G=e.unstable_now();J=G;var se=!0;try{e:{E=!1,R&&(R=!1,H(X),X=-1),w=!0;var we=S;try{t:{for(F(G),x=a(y);x!==null&&!(x.expirationTime>G&&U());){var Me=x.callback;if(typeof Me=="function"){x.callback=null,S=x.priorityLevel;var O=Me(x.expirationTime<=G);if(G=e.unstable_now(),typeof O=="function"){x.callback=O,F(G),se=!0;break t}x===a(y)&&r(y),F(G)}else r(y);x=a(y)}if(x!==null)se=!0;else{var A=a(m);A!==null&&ce(ie,A.startTime-G),se=!1}}break e}finally{x=null,S=we,w=!1}se=void 0}}finally{se?ue():D=!1}}}var ue;if(typeof q=="function")ue=function(){q(te)};else if(typeof MessageChannel<"u"){var je=new MessageChannel,xe=je.port2;je.port1.onmessage=te,ue=function(){xe.postMessage(null)}}else ue=function(){M(te,0)};function ce(G,se){X=M(function(){G(e.unstable_now())},se)}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(G){G.callback=null},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(G){switch(S){case 1:case 2:case 3:var se=3;break;default:se=S}var we=S;S=se;try{return G()}finally{S=we}},e.unstable_requestPaint=function(){$=!0},e.unstable_runWithPriority=function(G,se){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var we=S;S=G;try{return se()}finally{S=we}},e.unstable_scheduleCallback=function(G,se,we){var Me=e.unstable_now();switch(typeof we=="object"&&we!==null?(we=we.delay,we=typeof we=="number"&&0<we?Me+we:Me):we=Me,G){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=we+O,G={id:b++,callback:se,priorityLevel:G,startTime:we,expirationTime:O,sortIndex:-1},we>Me?(G.sortIndex=we,i(m,G),a(y)===null&&G===a(m)&&(R?(H(X),X=-1):R=!0,ce(ie,we-Me))):(G.sortIndex=O,i(y,G),E||w||(E=!0,D||(D=!0,ue()))),G},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(G){var se=S;return function(){var we=S;S=se;try{return G.apply(this,arguments)}finally{S=we}}}})(ip)),ip}var Ry;function Qk(){return Ry||(Ry=1,np.exports=Xk()),np.exports}var ap={exports:{}},on={};/**
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 _y;function Zk(){if(_y)return on;_y=1;var e=uh();function i(y){var m="https://react.dev/errors/"+y;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 #"+y+"; 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(y,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:y,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return on.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,on.createPortal=function(y,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(y,m,null,b)},on.flushSync=function(y){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,y)return y()}finally{d.T=m,r.p=b,r.d.f()}},on.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(y,m))},on.prefetchDNS=function(y){typeof y=="string"&&r.d.D(y)},on.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),S=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:w}):b==="script"&&r.d.X(y,{crossOrigin:x,integrity:S,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},on.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(y,{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(y)},on.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(y,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})}},on.preloadModule=function(y,m){if(typeof y=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(y,{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(y)},on.requestFormReset=function(y){r.d.r(y)},on.unstable_batchedUpdates=function(y,m){return y(m)},on.useFormState=function(y,m,b){return d.H.useFormState(y,m,b)},on.useFormStatus=function(){return d.H.useHostTransitionStatus()},on.version="19.2.7",on}var My;function Jk(){if(My)return ap.exports;My=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(),ap.exports=Zk(),ap.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 Oy;function eS(){if(Oy)return Po;Oy=1;var e=Qk(),i=uh(),a=Jk();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 y(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 y(f),t;if(h===o)return y(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,T=f.child;T;){if(T===l){v=!0,l=f,o=h;break}if(T===o){v=!0,o=f,l=h;break}T=T.sibling}if(!v){for(T=h.child;T;){if(T===l){v=!0,l=h,o=f;break}if(T===o){v=!0,o=h,l=f;break}T=T.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,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),q=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var je=Symbol.for("react.client.reference");function xe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===je?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case M:return"Profiler";case $:return"StrictMode";case ie:return"Suspense";case D:return"SuspenseList";case J:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case q: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 X:return n=t.displayName||null,n!==null?n:xe(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return xe(t(n))}catch{}}return null}var ce=Array.isArray,G=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we={pending:!1,data:null,method:null,action:null},Me=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=Me[O],Me[O]=null,O--)}function C(t,n){O++,Me[O]=t.current,t.current=n}var W=A(null),he=A(null),ge=A(null),ke=A(null);function oe(t,n){switch(C(ge,n),C(he,t),C(W,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Wg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Wg(n),t=Kg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(W),C(W,t)}function Oe(){z(W),z(he),z(ge)}function vt(t){t.memoizedState!==null&&C(ke,t);var n=W.current,l=Kg(n,t.type);n!==l&&(C(he,t),C(W,l))}function St(t){he.current===t&&(z(W),z(he)),ke.current===t&&(z(ke),Ho._currentValue=we)}var yn,Ke;function mt(t){if(yn===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);yn=n&&n[1]||"",Ke=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+yn+t+Ke}var tn=!1;function xn(t,n){if(!t||tn)return"";tn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Z){var Q=Z}Reflect.construct(t,[],re)}else{try{re.call()}catch(Z){Q=Z}t.call(re.prototype)}}else{try{throw Error()}catch(Z){Q=Z}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Z){if(Z&&Q&&typeof Z.stack=="string")return[Z.stack,Q.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],T=h[1];if(v&&T){var L=v.split(`
45
+ `),Y=T.split(`
46
+ `);for(f=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(o===L.length||f===Y.length)for(o=L.length-1,f=Y.length-1;1<=o&&0<=f&&L[o]!==Y[f];)f--;for(;1<=o&&0<=f;o--,f--)if(L[o]!==Y[f]){if(o!==1||f!==1)do if(o--,f--,0>f||L[o]!==Y[f]){var ee=`
47
+ `+L[o].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),ee}while(1<=o&&0<=f);break}}}finally{tn=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?mt(l):""}function Ie(t,n){switch(t.tag){case 26:case 27:case 5:return mt(t.type);case 16:return mt("Lazy");case 13:return t.child!==n&&n!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return xn(t.type,!1);case 11:return xn(t.type.render,!1);case 1:return xn(t.type,!0);case 31:return mt("Activity");default:return""}}function Bt(t){try{var n="",l=null;do n+=Ie(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
48
+ Error generating stack: `+o.message+`
49
+ `+o.stack}}var jt=Object.prototype.hasOwnProperty,Pt=e.unstable_scheduleCallback,Ii=e.unstable_cancelCallback,yi=e.unstable_shouldYield,$l=e.unstable_requestPaint,Ct=e.unstable_now,oa=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Ne=e.unstable_NormalPriority,qe=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Yt=e.log,Qn=e.unstable_setDisableYieldValue,Xt=null,At=null;function Qt(t){if(typeof Yt=="function"&&Qn(t),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(Xt,t)}catch{}}var st=Math.clz32?Math.clz32:Sd,Nt=Math.log,bn=Math.LN2;function Sd(t){return t>>>=0,t===0?32:31-(Nt(t)/bn|0)|0}var Vl=256,Lr=262144,Ir=4194304;function ua(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 Gl(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 T=o&134217727;return T!==0?(o=T&~h,o!==0?f=ua(o):(v&=T,v!==0?f=ua(v):l||(l=T&~t,l!==0&&(f=ua(l))))):(T=o&~h,T!==0?f=ua(T):v!==0?f=ua(v):l||(l=o&~t,l!==0&&(f=ua(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 Va(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function qs(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 vn(){var t=Ir;return Ir<<=1,(Ir&62914560)===0&&(Ir=4194304),t}function Ui(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function dt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Fl(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 T=t.entanglements,L=t.expirationTimes,Y=t.hiddenUpdates;for(l=v&~l;0<l;){var ee=31-st(l),re=1<<ee;T[ee]=0,L[ee]=-1;var Q=Y[ee];if(Q!==null)for(Y[ee]=null,ee=0;ee<Q.length;ee++){var Z=Q[ee];Z!==null&&(Z.lane&=-536870913)}l&=~re}o!==0&&Hs(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Hs(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 Ga(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 $s(t,n){var l=n&-n;return l=(l&42)!==0?1:ca(l),(l&(t.suspendedLanes|n))!==0?0:l}function ca(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 Vs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Gs(){var t=se.p;return t!==0?t:(t=window.event,t===void 0?32:xy(t.type))}function bu(t,n){var l=se.p;try{return se.p=t,n()}finally{se.p=l}}var xi=Math.random().toString(36).slice(2),Wt="__reactFiber$"+xi,Zt="__reactProps$"+xi,Fa="__reactContainer$"+xi,da="__reactEvents$"+xi,Pa="__reactListeners$"+xi,Ya="__reactHandles$"+xi,fa="__reactResources$"+xi,Zn="__reactMarker$"+xi;function Pl(t){delete t[Wt],delete t[Zt],delete t[da],delete t[Pa],delete t[Ya]}function bi(t){var n=t[Wt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Fa]||l[Wt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=ny(t);t!==null;){if(l=t[Wt])return l;t=ny(t)}return n}t=l,l=t.parentNode}return null}function Wa(t){if(t=t[Wt]||t[Fa]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function vi(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Bi(t){var n=t[fa];return n||(n=t[fa]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Dt(t){t[Zn]=!0}var Ur=new Set,Br={};function pa(t,n){ha(t,n),ha(t+"Capture",n)}function ha(t,n){for(Br[t]=n,t=0;t<n.length;t++)Ur.add(n[t])}var qi=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]*$"),qr={},Fs={};function jd(t){return jt.call(Fs,t)?!0:jt.call(qr,t)?!1:qi.test(t)?Fs[t]=!0:(qr[t]=!0,!1)}function Hr(t,n,l){if(jd(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 ma(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 Jn(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 nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vu(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function wu(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 ei(t){if(!t._valueTracker){var n=vu(t)?"checked":"value";t._valueTracker=wu(t,n,""+t[n])}}function Hi(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=vu(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function $r(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 $i=/[\n"\\]/g;function Jt(t){return t.replace($i,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Vr(t,n,l,o,f,h,v,T){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=""+nn(n)):t.value!==""+nn(n)&&(t.value=""+nn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?qn(t,v,nn(n)):l!=null?qn(t,v,nn(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?t.name=""+nn(T):t.removeAttribute("name")}function ti(t,n,l,o,f,h,v,T){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)){ei(t);return}l=l!=null?""+nn(l):"",n=n!=null?""+nn(n):l,T||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=T?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),ei(t)}function qn(t,n,l){n==="number"&&$r(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function wn(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=""+nn(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 Ps(t,n,l){if(n!=null&&(n=""+nn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+nn(l):""}function Ka(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(ce(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=nn(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),ei(t)}function ga(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var Gr=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 ku(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||Gr.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function Yl(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&&ku(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&ku(t,h,n[h])}function ya(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 Ys=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"]]),Ws=/^[\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 Wl(t){return Ws.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function kn(){}var Sn=null;function ni(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Vi=null,ii=null;function Xa(t){var n=Wa(t);if(n&&(t=n.stateNode)){var l=t[Zt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Vr(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="'+Jt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Zt]||null;if(!f)throw Error(r(90));Vr(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&&Hi(o)}break e;case"textarea":Ps(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&wn(t,!!l.multiple,n,!1)}}}var Kl=!1;function Tt(t,n,l){if(Kl)return t(n,l);Kl=!0;try{var o=t(n);return o}finally{if(Kl=!1,(Vi!==null||ii!==null)&&(vc(),Vi&&(n=Vi,t=ii,ii=Vi=null,Xa(n),t)))for(n=0;n<t.length;n++)Xa(t[n])}}function wi(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Zt]||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 ki=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xl=!1;if(ki)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Xl=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Xl=!1}var Gi=null,Si=null,Fr=null;function Su(){if(Fr)return Fr;var t,n=Si,l=n.length,o,f="value"in Gi?Gi.value:Gi.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 Fr=f.slice(t,1<o?1-o:void 0)}function Pr(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 Ql(){return!0}function Zl(){return!1}function an(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 T in t)t.hasOwnProperty(T)&&(l=t[T],this[T]=l?l(h):h[T]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Ql:Zl,this.isPropagationStopped=Zl,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=Ql)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),n}var ji={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ci=an(ji),Fi=x({},ji,{view:0,detail:0}),ju=an(Fi),xa,Jl,ba,Za=x({},Fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nl,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!==ba&&(ba&&t.type==="mousemove"?(xa=t.screenX-ba.screenX,Jl=t.screenY-ba.screenY):Jl=xa=0,ba=t),xa)},movementY:function(t){return"movementY"in t?t.movementY:Jl}}),Yr=an(Za),er=x({},Za,{dataTransfer:0}),Cu=an(er),tr=x({},Fi,{relatedTarget:0}),va=an(tr),Wr=x({},ji,{animationName:0,elapsedTime:0,pseudoElement:0}),Kr=an(Wr),nr=x({},ji,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ja=an(nr),el=x({},ji,{data:0}),Ti=an(el),jn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cn={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"},tl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ir(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=tl[t])?!!n[t]:!1}function nl(){return ir}var Xr=x({},Fi,{key:function(t){if(t.key){var n=jn[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Pr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Cn[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nl,charCode:function(t){return t.type==="keypress"?Pr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Ks=an(Xr),Xs=x({},Za,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ar=an(Xs),Re=x({},Fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nl}),Tu=an(Re),ai=x({},ji,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ot=an(ai),Qs=x({},Za,{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}),wa=an(Qs),Qr=x({},ji,{newState:0,oldState:0}),lt=an(Qr),il=[9,13,27,32],al=ki&&"CompositionEvent"in window,Ei=null;ki&&"documentMode"in document&&(Ei=document.documentMode);var lr=ki&&"TextEvent"in window&&!Ei,Zr=ki&&(!al||Ei&&8<Ei&&11>=Ei),Pi=" ",Eu=!1;function Au(t,n){switch(t){case"keyup":return il.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ll(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ka=!1;function Zs(t,n){switch(t){case"compositionend":return ll(n);case"keypress":return n.which!==32?null:(Eu=!0,Pi);case"textInput":return t=n.data,t===Pi&&Eu?null:t;default:return null}}function Js(t,n){if(ka)return t==="compositionend"||!al&&Au(t,n)?(t=Su(),Fr=Si=Gi=null,ka=!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 Zr&&n.locale!=="ko"?null:n.data;default:return null}}var Jr={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 Nu(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Jr[t.type]:n==="textarea"}function eo(t,n,l,o){Vi?ii?ii.push(o):ii=[o]:Vi=o,n=Ec(n,"onChange"),0<n.length&&(l=new Ci("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var Sa=null,Yi=null;function Cd(t){$g(t,0)}function Wi(t){var n=vi(t);if(Hi(n))return t}function Du(t,n){if(t==="change")return n}var Ru=!1;if(ki){var to;if(ki){var rr="oninput"in document;if(!rr){var Ki=document.createElement("div");Ki.setAttribute("oninput","return;"),rr=typeof Ki.oninput=="function"}to=rr}else to=!1;Ru=to&&(!document.documentMode||9<document.documentMode)}function rl(){Sa&&(Sa.detachEvent("onpropertychange",Se),Yi=Sa=null)}function Se(t){if(t.propertyName==="value"&&Wi(Yi)){var n=[];eo(n,Yi,t,ni(t)),Tt(Cd,n)}}function es(t,n,l){t==="focusin"?(rl(),Sa=n,Yi=l,Sa.attachEvent("onpropertychange",Se)):t==="focusout"&&rl()}function sr(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Wi(Yi)}function _u(t,n){if(t==="click")return Wi(n)}function no(t,n){if(t==="input"||t==="change")return Wi(n)}function io(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var fn=typeof Object.is=="function"?Object.is:io;function zt(t,n){if(fn(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(!jt.call(n,f)||!fn(t[f],n[f]))return!1}return!0}function Mu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ou(t,n){var l=Mu(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=Mu(l)}}function or(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?or(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function zu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=$r(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=$r(t.document)}return n}function ts(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 ao=ki&&"documentMode"in document&&11>=document.documentMode,sl=null,lo=null,Xi=null,ur=!1;function ns(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ur||sl==null||sl!==$r(o)||(o=sl,"selectionStart"in o&&ts(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}),Xi&&zt(Xi,o)||(Xi=o,o=Ec(lo,"onSelect"),0<o.length&&(n=new Ci("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=sl)))}function ja(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Qi={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionrun:ja("Transition","TransitionRun"),transitionstart:ja("Transition","TransitionStart"),transitioncancel:ja("Transition","TransitionCancel"),transitionend:ja("Transition","TransitionEnd")},ro={},Lu={};ki&&(Lu=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function Ai(t){if(ro[t])return ro[t];if(!Qi[t])return t;var n=Qi[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Lu)return ro[t]=n[l];return t}var so=Ai("animationend"),Iu=Ai("animationiteration"),Uu=Ai("animationstart"),Bu=Ai("transitionrun"),Td=Ai("transitionstart"),Ed=Ai("transitioncancel"),qu=Ai("transitionend"),Hu=new Map,oo="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(" ");oo.push("scrollEnd");function Hn(t,n){Hu.set(t,n),pa(n,[t])}var is=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)},Tn=[],ol=0,uo=0;function as(){for(var t=ol,n=uo=ol=0;n<t;){var l=Tn[n];Tn[n++]=null;var o=Tn[n];Tn[n++]=null;var f=Tn[n];Tn[n++]=null;var h=Tn[n];if(Tn[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&&$u(l,f,h)}}function ls(t,n,l,o){Tn[ol++]=t,Tn[ol++]=n,Tn[ol++]=l,Tn[ol++]=o,uo|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function co(t,n,l,o){return ls(t,n,l,o),rs(t)}function Ca(t,n){return ls(t,null,null,n),rs(t)}function $u(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 rs(t){if(50<Oo)throw Oo=0,Sf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ul={};function Ad(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 pn(t,n,l,o){return new Ad(t,n,l,o)}function ss(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Lt(t,n){var l=t.alternate;return l===null?(l=pn(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 fo(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 cr(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")ss(t)&&(v=1);else if(typeof t=="string")v=Rk(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case J:return t=pn(31,l,n,f),t.elementType=J,t.lanes=h,t;case R:return $n(l.children,f,h,n);case $:v=8,f|=24;break;case M:return t=pn(12,l,n,f|2),t.elementType=M,t.lanes=h,t;case ie:return t=pn(13,l,n,f),t.elementType=ie,t.lanes=h,t;case D:return t=pn(19,l,n,f),t.elementType=D,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case q:v=10;break e;case H:v=9;break e;case F:v=11;break e;case X:v=14;break e;case ae:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=pn(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function $n(t,n,l,o){return t=pn(7,t,o,n),t.lanes=l,t}function Ni(t,n,l){return t=pn(6,t,null,n),t.lanes=l,t}function Vu(t){var n=pn(18,null,null,0);return n.stateNode=t,n}function po(t,n,l){return n=pn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Gu=new WeakMap;function En(t,n){if(typeof t=="object"&&t!==null){var l=Gu.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Bt(n)},Gu.set(t,n),n)}return{value:t,source:n,stack:Bt(n)}}var cl=[],Zi=0,os=null,dl=0,hn=[],An=0,Ji=null,li=1,ln="";function Nn(t,n){cl[Zi++]=dl,cl[Zi++]=os,os=t,dl=n}function Fu(t,n,l){hn[An++]=li,hn[An++]=ln,hn[An++]=Ji,Ji=t;var o=li;t=ln;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,li=1<<32-st(n)+f|l<<f|o,ln=h+t}else li=1<<h|l<<f|o,ln=t}function us(t){t.return!==null&&(Nn(t,1),Fu(t,1,0))}function cs(t){for(;t===os;)os=cl[--Zi],cl[Zi]=null,dl=cl[--Zi],cl[Zi]=null;for(;t===Ji;)Ji=hn[--An],hn[An]=null,ln=hn[--An],hn[An]=null,li=hn[--An],hn[An]=null}function Pu(t,n){hn[An++]=li,hn[An++]=ln,hn[An++]=Ji,li=n.id,ln=n.overflow,Ji=t}var qt=null,gt=null,Fe=!1,ea=null,Dn=!1,ho=Error(r(519));function ta(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dr(En(n,t)),ho}function Yu(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[Wt]=t,n[Zt]=o,l){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(l=0;l<Lo.length;l++)Ye(Lo[l],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),ti(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Ka(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||Pg(n.textContent,l)?(o.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),o.onScroll!=null&&Ye("scroll",n),o.onScrollEnd!=null&&Ye("scrollend",n),o.onClick!=null&&(n.onclick=kn),n=!0):n=!1,n||ta(t,!0)}function Wu(t){for(qt=t.return;qt;)switch(qt.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:qt=qt.return}}function fl(t){if(t!==qt)return!1;if(!Fe)return Wu(t),Fe=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Uf(t.type,t.memoizedProps)),l=!l),l&&gt&&ta(t),Wu(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));gt=ty(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));gt=ty(t)}else n===27?(n=gt,Nl(t.type)?(t=Vf,Vf=null,gt=t):gt=n):gt=qt?pi(t.stateNode.nextSibling):null;return!0}function Ta(){gt=qt=null,Fe=!1}function mo(){var t=ea;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),ea=null),t}function dr(t){ea===null?ea=[t]:ea.push(t)}var go=A(null),ri=null,Di=null;function si(t,n,l){C(go,n._currentValue),n._currentValue=l}function Ri(t){t._currentValue=go.current,z(go)}function yo(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 pl(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 T=h;h=f;for(var L=0;L<n.length;L++)if(T.context===n[L]){h.lanes|=l,T=h.alternate,T!==null&&(T.lanes|=l),yo(h.return,l,t),o||(v=null);break e}h=T.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),yo(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 hl(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 T=f.type;fn(f.pendingProps.value,v.value)||(t!==null?t.push(T):t=[T])}}else if(f===ke.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Ho):t=[Ho])}f=f.return}t!==null&&pl(n,t,l,o),n.flags|=262144}function _i(t){for(t=t.firstContext;t!==null;){if(!fn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Mi(t){ri=t,Di=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ht(t){return xo(ri,t)}function fr(t,n){return ri===null&&Mi(t),xo(t,n)}function xo(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Di===null){if(t===null)throw Error(r(308));Di=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Di=Di.next=n;return l}var pr=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()})}},Nd=e.unstable_scheduleCallback,Dd=e.unstable_NormalPriority,Rt={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ml(){return{controller:new pr,data:new Map,refCount:0}}function hr(t){t.refCount--,t.refCount===0&&Nd(Dd,function(){t.controller.abort()})}var gl=null,bo=0,oi=0,ui=null;function mr(t,n){if(gl===null){var l=gl=[];bo=0,oi=Nf(),ui={status:"pending",value:void 0,then:function(o){l.push(o)}}}return bo++,n.then(Ku,Ku),n}function Ku(){if(--bo===0&&gl!==null){ui!==null&&(ui.status="fulfilled");var t=gl;gl=null,oi=0,ui=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Rd(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 Xu=G.S;G.S=function(t,n){gg=Ct(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&mr(t,n),Xu!==null&&Xu(t,n)};var et=A(null);function ci(){var t=et.current;return t!==null?t:yt.pooledCache}function ds(t,n){n===null?C(et,et.current):C(et,n.pool)}function Rn(){var t=ci();return t===null?null:{parent:Rt._currentValue,pool:t}}var yl=Error(r(460)),di=Error(r(474)),fs=Error(r(542)),gr={then:function(){}};function Qu(t){return t=t.status,t==="fulfilled"||t==="rejected"}function ps(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(kn,kn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,vo(t),t;default:if(typeof n.status=="string")n.then(kn,kn);else{if(t=yt,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,vo(t),t}throw Aa=n,yl}}function Ea(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Aa=l,yl):l}}var Aa=null;function Zu(){if(Aa===null)throw Error(r(459));var t=Aa;return Aa=null,t}function vo(t){if(t===yl||t===fs)throw Error(r(483))}var Na=null,xl=0;function yr(t){var n=xl;return xl+=1,Na===null&&(Na=[]),ps(Na,t,n)}function g(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function k(t,n){throw n.$$typeof===S?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function j(t){function n(V,B){if(t){var P=V.deletions;P===null?(V.deletions=[B],V.flags|=16):P.push(B)}}function l(V,B){if(!t)return null;for(;B!==null;)n(V,B),B=B.sibling;return null}function o(V){for(var B=new Map;V!==null;)V.key!==null?B.set(V.key,V):B.set(V.index,V),V=V.sibling;return B}function f(V,B){return V=Lt(V,B),V.index=0,V.sibling=null,V}function h(V,B,P){return V.index=P,t?(P=V.alternate,P!==null?(P=P.index,P<B?(V.flags|=67108866,B):P):(V.flags|=67108866,B)):(V.flags|=1048576,B)}function v(V){return t&&V.alternate===null&&(V.flags|=67108866),V}function T(V,B,P,le){return B===null||B.tag!==6?(B=Ni(P,V.mode,le),B.return=V,B):(B=f(B,P),B.return=V,B)}function L(V,B,P,le){var _e=P.type;return _e===R?ee(V,B,P.props.children,le,P.key):B!==null&&(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ea(_e)===B.type)?(B=f(B,P.props),g(B,P),B.return=V,B):(B=cr(P.type,P.key,P.props,null,V.mode,le),g(B,P),B.return=V,B)}function Y(V,B,P,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==P.containerInfo||B.stateNode.implementation!==P.implementation?(B=po(P,V.mode,le),B.return=V,B):(B=f(B,P.children||[]),B.return=V,B)}function ee(V,B,P,le,_e){return B===null||B.tag!==7?(B=$n(P,V.mode,le,_e),B.return=V,B):(B=f(B,P),B.return=V,B)}function re(V,B,P){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Ni(""+B,V.mode,P),B.return=V,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return P=cr(B.type,B.key,B.props,null,V.mode,P),g(P,B),P.return=V,P;case E:return B=po(B,V.mode,P),B.return=V,B;case ae:return B=Ea(B),re(V,B,P)}if(ce(B)||ue(B))return B=$n(B,V.mode,P,null),B.return=V,B;if(typeof B.then=="function")return re(V,yr(B),P);if(B.$$typeof===q)return re(V,fr(V,B),P);k(V,B)}return null}function Q(V,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:T(V,B,""+P,le);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return P.key===_e?L(V,B,P,le):null;case E:return P.key===_e?Y(V,B,P,le):null;case ae:return P=Ea(P),Q(V,B,P,le)}if(ce(P)||ue(P))return _e!==null?null:ee(V,B,P,le,null);if(typeof P.then=="function")return Q(V,B,yr(P),le);if(P.$$typeof===q)return Q(V,B,fr(V,P),le);k(V,P)}return null}function Z(V,B,P,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return V=V.get(P)||null,T(B,V,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return V=V.get(le.key===null?P:le.key)||null,L(B,V,le,_e);case E:return V=V.get(le.key===null?P:le.key)||null,Y(B,V,le,_e);case ae:return le=Ea(le),Z(V,B,P,le,_e)}if(ce(le)||ue(le))return V=V.get(P)||null,ee(B,V,le,_e,null);if(typeof le.then=="function")return Z(V,B,P,yr(le),_e);if(le.$$typeof===q)return Z(V,B,P,fr(B,le),_e);k(B,le)}return null}function Ce(V,B,P,le){for(var _e=null,it=null,De=B,Ve=B=0,Ze=null;De!==null&&Ve<P.length;Ve++){De.index>Ve?(Ze=De,De=null):Ze=De.sibling;var at=Q(V,De,P[Ve],le);if(at===null){De===null&&(De=Ze);break}t&&De&&at.alternate===null&&n(V,De),B=h(at,B,Ve),it===null?_e=at:it.sibling=at,it=at,De=Ze}if(Ve===P.length)return l(V,De),Fe&&Nn(V,Ve),_e;if(De===null){for(;Ve<P.length;Ve++)De=re(V,P[Ve],le),De!==null&&(B=h(De,B,Ve),it===null?_e=De:it.sibling=De,it=De);return Fe&&Nn(V,Ve),_e}for(De=o(De);Ve<P.length;Ve++)Ze=Z(De,V,Ve,P[Ve],le),Ze!==null&&(t&&Ze.alternate!==null&&De.delete(Ze.key===null?Ve:Ze.key),B=h(Ze,B,Ve),it===null?_e=Ze:it.sibling=Ze,it=Ze);return t&&De.forEach(function(Ol){return n(V,Ol)}),Fe&&Nn(V,Ve),_e}function Le(V,B,P,le){if(P==null)throw Error(r(151));for(var _e=null,it=null,De=B,Ve=B=0,Ze=null,at=P.next();De!==null&&!at.done;Ve++,at=P.next()){De.index>Ve?(Ze=De,De=null):Ze=De.sibling;var Ol=Q(V,De,at.value,le);if(Ol===null){De===null&&(De=Ze);break}t&&De&&Ol.alternate===null&&n(V,De),B=h(Ol,B,Ve),it===null?_e=Ol:it.sibling=Ol,it=Ol,De=Ze}if(at.done)return l(V,De),Fe&&Nn(V,Ve),_e;if(De===null){for(;!at.done;Ve++,at=P.next())at=re(V,at.value,le),at!==null&&(B=h(at,B,Ve),it===null?_e=at:it.sibling=at,it=at);return Fe&&Nn(V,Ve),_e}for(De=o(De);!at.done;Ve++,at=P.next())at=Z(De,V,Ve,at.value,le),at!==null&&(t&&at.alternate!==null&&De.delete(at.key===null?Ve:at.key),B=h(at,B,Ve),it===null?_e=at:it.sibling=at,it=at);return t&&De.forEach(function($k){return n(V,$k)}),Fe&&Nn(V,Ve),_e}function ht(V,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(V,B.sibling),le=f(B,P.props.children),le.return=V,V=le;break e}}else if(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&Ea(_e)===B.type){l(V,B.sibling),le=f(B,P.props),g(le,P),le.return=V,V=le;break e}l(V,B);break}else n(V,B);B=B.sibling}P.type===R?(le=$n(P.props.children,V.mode,le,P.key),le.return=V,V=le):(le=cr(P.type,P.key,P.props,null,V.mode,le),g(le,P),le.return=V,V=le)}return v(V);case E: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(V,B.sibling),le=f(B,P.children||[]),le.return=V,V=le;break e}else{l(V,B);break}else n(V,B);B=B.sibling}le=po(P,V.mode,le),le.return=V,V=le}return v(V);case ae:return P=Ea(P),ht(V,B,P,le)}if(ce(P))return Ce(V,B,P,le);if(ue(P)){if(_e=ue(P),typeof _e!="function")throw Error(r(150));return P=_e.call(P),Le(V,B,P,le)}if(typeof P.then=="function")return ht(V,B,yr(P),le);if(P.$$typeof===q)return ht(V,B,fr(V,P),le);k(V,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,B!==null&&B.tag===6?(l(V,B.sibling),le=f(B,P),le.return=V,V=le):(l(V,B),le=Ni(P,V.mode,le),le.return=V,V=le),v(V)):l(V,B)}return function(V,B,P,le){try{xl=0;var _e=ht(V,B,P,le);return Na=null,_e}catch(De){if(De===yl||De===fs)throw De;var it=pn(29,De,null,V.mode);return it.lanes=le,it.return=V,it}finally{}}}var _=j(!0),I=j(!1),K=!1;function fe(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ae(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 be(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ve(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=rs(t),$u(t,null,l),n}return ls(t,o,n,l),rs(t)}function ot(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,Ga(t,l)}}function tt(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 xr=!1;function bl(){if(xr){var t=ui;if(t!==null)throw t}}function wo(t,n,l,o){xr=!1;var f=t.updateQueue;K=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var L=T,Y=L.next;L.next=null,v===null?h=Y:v.next=Y,v=L;var ee=t.alternate;ee!==null&&(ee=ee.updateQueue,T=ee.lastBaseUpdate,T!==v&&(T===null?ee.firstBaseUpdate=Y:T.next=Y,ee.lastBaseUpdate=L))}if(h!==null){var re=f.baseState;v=0,ee=Y=L=null,T=h;do{var Q=T.lane&-536870913,Z=Q!==T.lane;if(Z?(Qe&Q)===Q:(o&Q)===Q){Q!==0&&Q===oi&&(xr=!0),ee!==null&&(ee=ee.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Ce=t,Le=T;Q=n;var ht=l;switch(Le.tag){case 1:if(Ce=Le.payload,typeof Ce=="function"){re=Ce.call(ht,re,Q);break e}re=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Le.payload,Q=typeof Ce=="function"?Ce.call(ht,re,Q):Ce,Q==null)break e;re=x({},re,Q);break e;case 2:K=!0}}Q=T.callback,Q!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[Q]:Z.push(Q))}else Z={lane:Q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ee===null?(Y=ee=Z,L=re):ee=ee.next=Z,v|=Q;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;Z=T,T=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);ee===null&&(L=re),f.baseState=L,f.firstBaseUpdate=Y,f.lastBaseUpdate=ee,h===null&&(f.shared.lanes=0),jl|=v,t.lanes=v,t.memoizedState=re}}function Hh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function $h(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Hh(l[t],n)}var hs=A(null),Ju=A(0);function Vh(t,n){t=Ua,C(Ju,t),C(hs,n),Ua=t|n.baseLanes}function _d(){C(Ju,Ua),C(hs,hs.current)}function Md(){Ua=Ju.current,z(hs),z(Ju)}var Vn=A(null),fi=null;function vl(t){var n=t.alternate;C(It,It.current&1),C(Vn,t),fi===null&&(n===null||hs.current!==null||n.memoizedState!==null)&&(fi=t)}function Od(t){C(It,It.current),C(Vn,t),fi===null&&(fi=t)}function Gh(t){t.tag===22?(C(It,It.current),C(Vn,t),fi===null&&(fi=t)):wl()}function wl(){C(It,It.current),C(Vn,Vn.current)}function Gn(t){z(Vn),fi===t&&(fi=null),z(It)}var It=A(0);function ec(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Hf(l)||$f(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 Da=0,He=null,ft=null,$t=null,tc=!1,ms=!1,br=!1,nc=0,ko=0,gs=null,_w=0;function _t(){throw Error(r(321))}function zd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!fn(t[l],n[l]))return!1;return!0}function Ld(t,n,l,o,f,h){return Da=h,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=t===null||t.memoizedState===null?Em:Qd,br=!1,h=l(o,f),br=!1,ms&&(h=Ph(n,l,o,f)),Fh(t),h}function Fh(t){G.H=Co;var n=ft!==null&&ft.next!==null;if(Da=0,$t=ft=He=null,tc=!1,ko=0,gs=null,n)throw Error(r(300));t===null||Vt||(t=t.dependencies,t!==null&&_i(t)&&(Vt=!0))}function Ph(t,n,l,o){He=t;var f=0;do{if(ms&&(gs=null),ko=0,ms=!1,25<=f)throw Error(r(301));if(f+=1,$t=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)}G.H=Am,h=n(l,o)}while(ms);return h}function Mw(){var t=G.H,n=t.useState()[0];return n=typeof n.then=="function"?So(n):n,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(He.flags|=1024),n}function Id(){var t=nc!==0;return nc=0,t}function Ud(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Bd(t){if(tc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}tc=!1}Da=0,$t=ft=He=null,ms=!1,ko=nc=0,gs=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?He.memoizedState=$t=t:$t=$t.next=t,$t}function Ut(){if(ft===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var n=$t===null?He.memoizedState:$t.next;if(n!==null)$t=n,ft=t;else{if(t===null)throw He.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},$t===null?He.memoizedState=$t=t:$t=$t.next=t}return $t}function ic(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(t){var n=ko;return ko+=1,gs===null&&(gs=[]),t=ps(gs,t,n),n=He,($t===null?n.memoizedState:$t.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?Em:Qd),t}function ac(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return So(t);if(t.$$typeof===q)return Ht(t)}throw Error(r(438,String(t)))}function qd(t){var n=null,l=He.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=He.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=ic(),He.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=U;return n.index++,l}function Ra(t,n){return typeof n=="function"?n(t):n}function lc(t){var n=Ut();return Hd(n,ft,t)}function Hd(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 T=v=null,L=null,Y=n,ee=!1;do{var re=Y.lane&-536870913;if(re!==Y.lane?(Qe&re)===re:(Da&re)===re){var Q=Y.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),re===oi&&(ee=!0);else if((Da&Q)===Q){Y=Y.next,Q===oi&&(ee=!0);continue}else re={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(T=L=re,v=h):L=L.next=re,He.lanes|=Q,jl|=Q;re=Y.action,br&&l(h,re),h=Y.hasEagerState?Y.eagerState:l(h,re)}else Q={lane:re,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(T=L=Q,v=h):L=L.next=Q,He.lanes|=re,jl|=re;Y=Y.next}while(Y!==null&&Y!==n);if(L===null?v=h:L.next=T,!fn(h,t.memoizedState)&&(Vt=!0,ee&&(l=ui,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=L,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function $d(t){var n=Ut(),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);fn(h,n.memoizedState)||(Vt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function Yh(t,n,l){var o=He,f=Ut(),h=Fe;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!fn((ft||f).memoizedState,l);if(v&&(f.memoizedState=l,Vt=!0),f=f.queue,Fd(Xh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||$t!==null&&$t.memoizedState.tag&1){if(o.flags|=2048,ys(9,{destroy:void 0},Kh.bind(null,o,f,l,n),null),yt===null)throw Error(r(349));h||(Da&127)!==0||Wh(o,n,l)}return l}function Wh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=He.updateQueue,n===null?(n=ic(),He.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function Kh(t,n,l,o){n.value=l,n.getSnapshot=o,Qh(n)&&Zh(t)}function Xh(t,n,l){return l(function(){Qh(n)&&Zh(t)})}function Qh(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!fn(t,l)}catch{return!0}}function Zh(t){var n=Ca(t,2);n!==null&&Ln(n,t,2)}function Vd(t){var n=mn();if(typeof t=="function"){var l=t;if(t=l(),br){Qt(!0);try{l()}finally{Qt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:t},n}function Jh(t,n,l,o){return t.baseState=l,Hd(t,ft,typeof o=="function"?o:Ra)}function Ow(t,n,l,o,f){if(oc(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)}};G.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,em(n,h)):(h.next=l.next,n.pending=l.next=h)}}function em(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=G.T,v={};G.T=v;try{var T=l(f,o),L=G.S;L!==null&&L(v,T),tm(t,n,T)}catch(Y){Gd(t,n,Y)}finally{h!==null&&v.types!==null&&(h.types=v.types),G.T=h}}else try{h=l(f,o),tm(t,n,h)}catch(Y){Gd(t,n,Y)}}function tm(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){nm(t,n,o)},function(o){return Gd(t,n,o)}):nm(t,n,l)}function nm(t,n,l){n.status="fulfilled",n.value=l,im(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,em(t,l)))}function Gd(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,im(n),n=n.next;while(n!==o)}t.action=null}function im(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function am(t,n){return n}function lm(t,n){if(Fe){var l=yt.formState;if(l!==null){e:{var o=He;if(Fe){if(gt){t:{for(var f=gt,h=Dn;f.nodeType!==8;){if(!h){f=null;break t}if(f=pi(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){gt=pi(f.nextSibling),o=f.data==="F!";break e}}ta(o)}o=!1}o&&(n=l[0])}}return l=mn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:am,lastRenderedState:n},l.queue=o,l=jm.bind(null,He,o),o.dispatch=l,o=Vd(!1),h=Xd.bind(null,He,!1,o.queue),o=mn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=Ow.bind(null,He,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function rm(t){var n=Ut();return sm(n,ft,t)}function sm(t,n,l){if(n=Hd(t,n,am)[0],t=lc(Ra)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=So(n)}catch(v){throw v===yl?fs:v}else o=n;n=Ut();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(He.flags|=2048,ys(9,{destroy:void 0},zw.bind(null,f,l),null)),[o,h,t]}function zw(t,n){t.action=n}function om(t){var n=Ut(),l=ft;if(l!==null)return sm(n,l,t);Ut(),n=n.memoizedState,l=Ut();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function ys(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=ic(),He.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function um(){return Ut().memoizedState}function rc(t,n,l,o){var f=mn();He.flags|=t,f.memoizedState=ys(1|n,{destroy:void 0},l,o===void 0?null:o)}function sc(t,n,l,o){var f=Ut();o=o===void 0?null:o;var h=f.memoizedState.inst;ft!==null&&o!==null&&zd(o,ft.memoizedState.deps)?f.memoizedState=ys(n,h,l,o):(He.flags|=t,f.memoizedState=ys(1|n,h,l,o))}function cm(t,n){rc(8390656,8,t,n)}function Fd(t,n){sc(2048,8,t,n)}function Lw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=ic(),He.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function dm(t){var n=Ut().memoizedState;return Lw({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function fm(t,n){return sc(4,2,t,n)}function pm(t,n){return sc(4,4,t,n)}function hm(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 mm(t,n,l){l=l!=null?l.concat([t]):null,sc(4,4,hm.bind(null,n,t),l)}function Pd(){}function gm(t,n){var l=Ut();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&zd(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function ym(t,n){var l=Ut();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&zd(n,o[1]))return o[0];if(o=t(),br){Qt(!0);try{t()}finally{Qt(!1)}}return l.memoizedState=[o,n],o}function Yd(t,n,l){return l===void 0||(Da&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=xg(),He.lanes|=t,jl|=t,l)}function xm(t,n,l,o){return fn(l,n)?l:hs.current!==null?(t=Yd(t,l,o),fn(t,n)||(Vt=!0),t):(Da&42)===0||(Da&1073741824)!==0&&(Qe&261930)===0?(Vt=!0,t.memoizedState=l):(t=xg(),He.lanes|=t,jl|=t,n)}function bm(t,n,l,o,f){var h=se.p;se.p=h!==0&&8>h?h:8;var v=G.T,T={};G.T=T,Xd(t,!1,n,l);try{var L=f(),Y=G.S;if(Y!==null&&Y(T,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ee=Rd(L,o);jo(t,n,ee,Yn(t))}else jo(t,n,o,Yn(t))}catch(re){jo(t,n,{then:function(){},status:"rejected",reason:re},Yn())}finally{se.p=h,v!==null&&T.types!==null&&(v.types=T.types),G.T=v}}function Iw(){}function Wd(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=vm(t).queue;bm(t,f,n,we,l===null?Iw:function(){return wm(t),l(o)})}function vm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:we},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function wm(t){var n=vm(t);n.next===null&&(n=t.alternate.memoizedState),jo(t,n.next.queue,{},Yn())}function Kd(){return Ht(Ho)}function km(){return Ut().memoizedState}function Sm(){return Ut().memoizedState}function Uw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Yn();t=be(l);var o=ve(n,t,l);o!==null&&(Ln(o,n,l),ot(o,n,l)),n={cache:ml()},t.payload=n;return}n=n.return}}function Bw(t,n,l){var o=Yn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},oc(t)?Cm(n,l):(l=co(t,n,l,o),l!==null&&(Ln(l,t,o),Tm(l,n,o)))}function jm(t,n,l){var o=Yn();jo(t,n,l,o)}function jo(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(oc(t))Cm(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,T=h(v,l);if(f.hasEagerState=!0,f.eagerState=T,fn(T,v))return ls(t,n,f,0),yt===null&&as(),!1}catch{}finally{}if(l=co(t,n,f,o),l!==null)return Ln(l,t,o),Tm(l,n,o),!0}return!1}function Xd(t,n,l,o){if(o={lane:2,revertLane:Nf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},oc(t)){if(n)throw Error(r(479))}else n=co(t,l,o,2),n!==null&&Ln(n,t,2)}function oc(t){var n=t.alternate;return t===He||n!==null&&n===He}function Cm(t,n){ms=tc=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function Tm(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,Ga(t,l)}}var Co={readContext:Ht,use:ac,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};Co.useEffectEvent=_t;var Em={readContext:Ht,use:ac,useCallback:function(t,n){return mn().memoizedState=[t,n===void 0?null:n],t},useContext:Ht,useEffect:cm,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,rc(4194308,4,hm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return rc(4194308,4,t,n)},useInsertionEffect:function(t,n){rc(4,2,t,n)},useMemo:function(t,n){var l=mn();n=n===void 0?null:n;var o=t();if(br){Qt(!0);try{t()}finally{Qt(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=mn();if(l!==void 0){var f=l(n);if(br){Qt(!0);try{l(n)}finally{Qt(!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=Bw.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=mn();return t={current:t},n.memoizedState=t},useState:function(t){t=Vd(t);var n=t.queue,l=jm.bind(null,He,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Pd,useDeferredValue:function(t,n){var l=mn();return Yd(l,t,n)},useTransition:function(){var t=Vd(!1);return t=bm.bind(null,He,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=He,f=mn();if(Fe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),yt===null)throw Error(r(349));(Qe&127)!==0||Wh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,cm(Xh.bind(null,o,h,t),[t]),o.flags|=2048,ys(9,{destroy:void 0},Kh.bind(null,o,h,l,n),null),l},useId:function(){var t=mn(),n=yt.identifierPrefix;if(Fe){var l=ln,o=li;l=(o&~(1<<32-st(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=nc++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=_w++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Kd,useFormState:lm,useActionState:lm,useOptimistic:function(t){var n=mn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Xd.bind(null,He,!0,l),l.dispatch=n,[t,n]},useMemoCache:qd,useCacheRefresh:function(){return mn().memoizedState=Uw.bind(null,He)},useEffectEvent:function(t){var n=mn(),l={impl:t};return n.memoizedState=l,function(){if((rt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Qd={readContext:Ht,use:ac,useCallback:gm,useContext:Ht,useEffect:Fd,useImperativeHandle:mm,useInsertionEffect:fm,useLayoutEffect:pm,useMemo:ym,useReducer:lc,useRef:um,useState:function(){return lc(Ra)},useDebugValue:Pd,useDeferredValue:function(t,n){var l=Ut();return xm(l,ft.memoizedState,t,n)},useTransition:function(){var t=lc(Ra)[0],n=Ut().memoizedState;return[typeof t=="boolean"?t:So(t),n]},useSyncExternalStore:Yh,useId:km,useHostTransitionStatus:Kd,useFormState:rm,useActionState:rm,useOptimistic:function(t,n){var l=Ut();return Jh(l,ft,t,n)},useMemoCache:qd,useCacheRefresh:Sm};Qd.useEffectEvent=dm;var Am={readContext:Ht,use:ac,useCallback:gm,useContext:Ht,useEffect:Fd,useImperativeHandle:mm,useInsertionEffect:fm,useLayoutEffect:pm,useMemo:ym,useReducer:$d,useRef:um,useState:function(){return $d(Ra)},useDebugValue:Pd,useDeferredValue:function(t,n){var l=Ut();return ft===null?Yd(l,t,n):xm(l,ft.memoizedState,t,n)},useTransition:function(){var t=$d(Ra)[0],n=Ut().memoizedState;return[typeof t=="boolean"?t:So(t),n]},useSyncExternalStore:Yh,useId:km,useHostTransitionStatus:Kd,useFormState:om,useActionState:om,useOptimistic:function(t,n){var l=Ut();return ft!==null?Jh(l,ft,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:qd,useCacheRefresh:Sm};Am.useEffectEvent=dm;function Zd(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 Jd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Yn(),f=be(o);f.payload=n,l!=null&&(f.callback=l),n=ve(t,f,o),n!==null&&(Ln(n,t,o),ot(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Yn(),f=be(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=ve(t,f,o),n!==null&&(Ln(n,t,o),ot(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Yn(),o=be(l);o.tag=2,n!=null&&(o.callback=n),n=ve(t,o,l),n!==null&&(Ln(n,t,l),ot(n,t,l))}};function Nm(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?!zt(l,o)||!zt(f,h):!0}function Dm(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&&Jd.enqueueReplaceState(n,n.state,null)}function vr(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Rm(t){is(t)}function _m(t){console.error(t)}function Mm(t){is(t)}function uc(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Om(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 ef(t,n,l){return l=be(l),l.tag=3,l.payload={element:null},l.callback=function(){uc(t,n)},l}function zm(t){return t=be(t),t.tag=3,t}function Lm(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(){Om(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Om(n,l,o),typeof f!="function"&&(Cl===null?Cl=new Set([this]):Cl.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})})}function qw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&hl(n,l,f,!0),l=Vn.current,l!==null){switch(l.tag){case 31:case 13:return fi===null?wc():l.alternate===null&&Mt===0&&(Mt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===gr?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),Tf(t,o,f)),!1;case 22:return l.flags|=65536,o===gr?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)),Tf(t,o,f)),!1}throw Error(r(435,l.tag))}return Tf(t,o,f),wc(),!1}if(Fe)return n=Vn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==ho&&(t=Error(r(422),{cause:o}),dr(En(t,l)))):(o!==ho&&(n=Error(r(423),{cause:o}),dr(En(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=En(o,l),f=ef(t.stateNode,o,f),tt(t,f),Mt!==4&&(Mt=2)),!1;var h=Error(r(520),{cause:o});if(h=En(h,l),Mo===null?Mo=[h]:Mo.push(h),Mt!==4&&(Mt=2),n===null)return!0;o=En(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=ef(l.stateNode,o,t),tt(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"&&(Cl===null||!Cl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=zm(f),Lm(f,t,l,o),tt(l,f),!1}l=l.return}while(l!==null);return!1}var tf=Error(r(461)),Vt=!1;function rn(t,n,l,o){n.child=t===null?I(n,null,l,o):_(n,t.child,l,o)}function Im(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var T in o)T!=="ref"&&(v[T]=o[T])}else v=o;return Mi(n),o=Ld(t,n,l,v,h,f),T=Id(),t!==null&&!Vt?(Ud(t,n,f),_a(t,n,f)):(Fe&&T&&us(n),n.flags|=1,rn(t,n,o,f),n.child)}function Um(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!ss(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,Bm(t,n,h,o,f)):(t=cr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!cf(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:zt,l(v,o)&&t.ref===n.ref)return _a(t,n,f)}return n.flags|=1,t=Lt(h,o),t.ref=n.ref,t.return=n,n.child=t}function Bm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(zt(h,o)&&t.ref===n.ref)if(Vt=!1,n.pendingProps=o=h,cf(t,f))(t.flags&131072)!==0&&(Vt=!0);else return n.lanes=t.lanes,_a(t,n,f)}return nf(t,n,l,o,f)}function qm(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 Hm(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ds(n,h!==null?h.cachePool:null),h!==null?Vh(n,h):_d(),Gh(n);else return o=n.lanes=536870912,Hm(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ds(n,h.cachePool),Vh(n,h),wl(),n.memoizedState=null):(t!==null&&ds(n,null),_d(),wl());return rn(t,n,f,l),n.child}function To(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Hm(t,n,l,o,f){var h=ci();return h=h===null?null:{parent:Rt._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ds(n,null),_d(),Gh(n),t!==null&&hl(t,n,o,!0),n.childLanes=f,null}function cc(t,n){return n=fc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function $m(t,n,l){return _(n,t.child,null,l),t=cc(n,n.pendingProps),t.flags|=2,Gn(n),n.memoizedState=null,t}function Hw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Fe){if(o.mode==="hidden")return t=cc(n,o),n.lanes=536870912,To(null,t);if(Od(n),(t=gt)?(t=ey(t,Dn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ji!==null?{id:li,overflow:ln}:null,retryLane:536870912,hydrationErrors:null},l=Vu(t),l.return=n,n.child=l,qt=n,gt=null)):t=null,t===null)throw ta(n);return n.lanes=536870912,null}return cc(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(Od(n),f)if(n.flags&256)n.flags&=-257,n=$m(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Vt||hl(t,n,l,!1),f=(l&t.childLanes)!==0,Vt||f){if(o=yt,o!==null&&(v=$s(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,Ca(t,v),Ln(o,t,v),tf;wc(),n=$m(t,n,l)}else t=h.treeContext,gt=pi(v.nextSibling),qt=n,Fe=!0,ea=null,Dn=!1,t!==null&&Pu(n,t),n=cc(n,o),n.flags|=4096;return n}return t=Lt(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function dc(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 nf(t,n,l,o,f){return Mi(n),l=Ld(t,n,l,o,void 0,f),o=Id(),t!==null&&!Vt?(Ud(t,n,f),_a(t,n,f)):(Fe&&o&&us(n),n.flags|=1,rn(t,n,l,f),n.child)}function Vm(t,n,l,o,f,h){return Mi(n),n.updateQueue=null,l=Ph(n,o,l,f),Fh(t),o=Id(),t!==null&&!Vt?(Ud(t,n,h),_a(t,n,h)):(Fe&&o&&us(n),n.flags|=1,rn(t,n,l,h),n.child)}function Gm(t,n,l,o,f){if(Mi(n),n.stateNode===null){var h=ul,v=l.contextType;typeof v=="object"&&v!==null&&(h=Ht(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Jd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},fe(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Ht(v):ul,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Zd(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&&Jd.enqueueReplaceState(h,h.state,null),wo(n,o,h,f),bl(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var T=n.memoizedProps,L=vr(l,T);h.props=L;var Y=h.context,ee=l.contextType;v=ul,typeof ee=="object"&&ee!==null&&(v=Ht(ee));var re=l.getDerivedStateFromProps;ee=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",T=n.pendingProps!==T,ee||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T||Y!==v)&&Dm(n,h,o,v),K=!1;var Q=n.memoizedState;h.state=Q,wo(n,o,h,f),bl(),Y=n.memoizedState,T||Q!==Y||K?(typeof re=="function"&&(Zd(n,l,re,o),Y=n.memoizedState),(L=K||Nm(n,l,L,o,Q,Y,v))?(ee||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=L):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,Ae(t,n),v=n.memoizedProps,ee=vr(l,v),h.props=ee,re=n.pendingProps,Q=h.context,Y=l.contextType,L=ul,typeof Y=="object"&&Y!==null&&(L=Ht(Y)),T=l.getDerivedStateFromProps,(Y=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||Q!==L)&&Dm(n,h,o,L),K=!1,Q=n.memoizedState,h.state=Q,wo(n,o,h,f),bl();var Z=n.memoizedState;v!==re||Q!==Z||K||t!==null&&t.dependencies!==null&&_i(t.dependencies)?(typeof T=="function"&&(Zd(n,l,T,o),Z=n.memoizedState),(ee=K||Nm(n,l,ee,o,Q,Z,L)||t!==null&&t.dependencies!==null&&_i(t.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Z,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Z,L)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Z),h.props=o,h.state=Z,h.context=L,o=ee):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&Q===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&Q===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,dc(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=_(n,t.child,null,f),n.child=_(n,null,l,f)):rn(t,n,l,f),n.memoizedState=h.state,t=n.child):t=_a(t,n,f),t}function Fm(t,n,l,o){return Ta(),n.flags|=256,rn(t,n,l,o),n.child}var af={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(t){return{baseLanes:t,cachePool:Rn()}}function rf(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Pn),t}function Pm(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:(It.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Fe){if(f?vl(n):wl(),(t=gt)?(t=ey(t,Dn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Ji!==null?{id:li,overflow:ln}:null,retryLane:536870912,hydrationErrors:null},l=Vu(t),l.return=n,n.child=l,qt=n,gt=null)):t=null,t===null)throw ta(n);return $f(t)?n.lanes=32:n.lanes=536870912,null}var T=o.children;return o=o.fallback,f?(wl(),f=n.mode,T=fc({mode:"hidden",children:T},f),o=$n(o,f,l,null),T.return=n,o.return=n,T.sibling=o,n.child=T,o=n.child,o.memoizedState=lf(l),o.childLanes=rf(t,v,l),n.memoizedState=af,To(null,o)):(vl(n),sf(n,T))}var L=t.memoizedState;if(L!==null&&(T=L.dehydrated,T!==null)){if(h)n.flags&256?(vl(n),n.flags&=-257,n=of(t,n,l)):n.memoizedState!==null?(wl(),n.child=t.child,n.flags|=128,n=null):(wl(),T=o.fallback,f=n.mode,o=fc({mode:"visible",children:o.children},f),T=$n(T,f,l,null),T.flags|=2,o.return=n,T.return=n,o.sibling=T,n.child=o,_(n,t.child,null,l),o=n.child,o.memoizedState=lf(l),o.childLanes=rf(t,v,l),n.memoizedState=af,n=To(null,o));else if(vl(n),$f(T)){if(v=T.nextSibling&&T.nextSibling.dataset,v)var Y=v.dgst;v=Y,o=Error(r(419)),o.stack="",o.digest=v,dr({value:o,source:null,stack:null}),n=of(t,n,l)}else if(Vt||hl(t,n,l,!1),v=(l&t.childLanes)!==0,Vt||v){if(v=yt,v!==null&&(o=$s(v,l),o!==0&&o!==L.retryLane))throw L.retryLane=o,Ca(t,o),Ln(v,t,o),tf;Hf(T)||wc(),n=of(t,n,l)}else Hf(T)?(n.flags|=192,n.child=t.child,n=null):(t=L.treeContext,gt=pi(T.nextSibling),qt=n,Fe=!0,ea=null,Dn=!1,t!==null&&Pu(n,t),n=sf(n,o.children),n.flags|=4096);return n}return f?(wl(),T=o.fallback,f=n.mode,L=t.child,Y=L.sibling,o=Lt(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,Y!==null?T=Lt(Y,T):(T=$n(T,f,l,null),T.flags|=2),T.return=n,o.return=n,o.sibling=T,n.child=o,To(null,o),o=n.child,T=t.child.memoizedState,T===null?T=lf(l):(f=T.cachePool,f!==null?(L=Rt._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=Rn(),T={baseLanes:T.baseLanes|l,cachePool:f}),o.memoizedState=T,o.childLanes=rf(t,v,l),n.memoizedState=af,To(t.child,o)):(vl(n),l=t.child,t=l.sibling,l=Lt(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 sf(t,n){return n=fc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function fc(t,n){return t=pn(22,t,null,n),t.lanes=0,t}function of(t,n,l){return _(n,t.child,null,l),t=sf(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Ym(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),yo(t.return,n,l)}function uf(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 Wm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=It.current,T=(v&2)!==0;if(T?(v=v&1|2,n.flags|=128):v&=1,C(It,v),rn(t,n,o,l),o=Fe?dl:0,!T&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ym(t,l,n);else if(t.tag===19)Ym(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&&ec(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),uf(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&&ec(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}uf(n,!0,l,null,h,o);break;case"together":uf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function _a(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),jl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(hl(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=Lt(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=Lt(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function cf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&_i(t)))}function $w(t,n,l){switch(n.tag){case 3:oe(n,n.stateNode.containerInfo),si(n,Rt,t.memoizedState.cache),Ta();break;case 27:case 5:vt(n);break;case 4:oe(n,n.stateNode.containerInfo);break;case 10:si(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Od(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(vl(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Pm(t,n,l):(vl(n),t=_a(t,n,l),t!==null?t.sibling:null);vl(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(hl(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Wm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(It,It.current),o)break;return null;case 22:return n.lanes=0,qm(t,n,l,n.pendingProps);case 24:si(n,Rt,t.memoizedState.cache)}return _a(t,n,l)}function Km(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Vt=!0;else{if(!cf(t,l)&&(n.flags&128)===0)return Vt=!1,$w(t,n,l);Vt=(t.flags&131072)!==0}else Vt=!1,Fe&&(n.flags&1048576)!==0&&Fu(n,dl,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Ea(n.elementType),n.type=t,typeof t=="function")ss(t)?(o=vr(t,o),n.tag=1,n=Gm(null,n,t,o,l)):(n.tag=0,n=nf(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===F){n.tag=11,n=Im(null,n,t,o,l);break e}else if(f===X){n.tag=14,n=Um(null,n,t,o,l);break e}}throw n=xe(t)||t,Error(r(306,n,""))}}return n;case 0:return nf(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=vr(o,n.pendingProps),Gm(t,n,o,f,l);case 3:e:{if(oe(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,Ae(t,n),wo(n,o,null,l);var v=n.memoizedState;if(o=v.cache,si(n,Rt,o),o!==h.cache&&pl(n,[Rt],l,!0),bl(),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=Fm(t,n,o,l);break e}else if(o!==f){f=En(Error(r(424)),n),dr(f),n=Fm(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(gt=pi(t.firstChild),qt=n,Fe=!0,ea=null,Dn=!0,l=I(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Ta(),o===f){n=_a(t,n,l);break e}rn(t,n,o,l)}n=n.child}return n;case 26:return dc(t,n),t===null?(l=ry(n.type,null,n.pendingProps,null))?n.memoizedState=l:Fe||(l=n.type,t=n.pendingProps,o=Ac(ge.current).createElement(l),o[Wt]=n,o[Zt]=t,sn(o,l,t),Dt(o),n.stateNode=o):n.memoizedState=ry(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return vt(n),t===null&&Fe&&(o=n.stateNode=iy(n.type,n.pendingProps,ge.current),qt=n,Dn=!0,f=gt,Nl(n.type)?(Vf=f,gt=pi(o.firstChild)):gt=f),rn(t,n,n.pendingProps.children,l),dc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Fe&&((f=o=gt)&&(o=xk(o,n.type,n.pendingProps,Dn),o!==null?(n.stateNode=o,qt=n,gt=pi(o.firstChild),Dn=!1,f=!0):f=!1),f||ta(n)),vt(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Uf(f,h)?o=null:v!==null&&Uf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=Ld(t,n,Mw,null,null,l),Ho._currentValue=f),dc(t,n),rn(t,n,o,l),n.child;case 6:return t===null&&Fe&&((t=l=gt)&&(l=bk(l,n.pendingProps,Dn),l!==null?(n.stateNode=l,qt=n,gt=null,t=!0):t=!1),t||ta(n)),null;case 13:return Pm(t,n,l);case 4:return oe(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=_(n,null,o,l):rn(t,n,o,l),n.child;case 11:return Im(t,n,n.type,n.pendingProps,l);case 7:return rn(t,n,n.pendingProps,l),n.child;case 8:return rn(t,n,n.pendingProps.children,l),n.child;case 12:return rn(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,si(n,n.type,o.value),rn(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,Mi(n),f=Ht(f),o=o(f),n.flags|=1,rn(t,n,o,l),n.child;case 14:return Um(t,n,n.type,n.pendingProps,l);case 15:return Bm(t,n,n.type,n.pendingProps,l);case 19:return Wm(t,n,l);case 31:return Hw(t,n,l);case 22:return qm(t,n,l,n.pendingProps);case 24:return Mi(n),o=Ht(Rt),t===null?(f=ci(),f===null&&(f=yt,h=ml(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},fe(n),si(n,Rt,f)):((t.lanes&l)!==0&&(Ae(t,n),wo(n,null,null,l),bl()),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),si(n,Rt,o)):(o=h.cache,si(n,Rt,o),o!==f.cache&&pl(n,[Rt],l,!0))),rn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ma(t){t.flags|=4}function df(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(kg())t.flags|=8192;else throw Aa=gr,di}else t.flags&=-16777217}function Xm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!dy(n))if(kg())t.flags|=8192;else throw Aa=gr,di}function pc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?vn():536870912,t.lanes|=n,ws|=n)}function Eo(t,n){if(!Fe)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 wt(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 Vw(t,n,l){var o=n.pendingProps;switch(cs(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(n),null;case 1:return wt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Ri(Rt),Oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(fl(n)?Ma(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,mo())),wt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(Ma(n),h!==null?(wt(n),Xm(n,h)):(wt(n),df(n,f,null,o,l))):h?h!==t.memoizedState?(Ma(n),wt(n),Xm(n,h)):(wt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&Ma(n),wt(n),df(n,f,t,o,l)),null;case 27:if(St(n),l=ge.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ma(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return wt(n),null}t=W.current,fl(n)?Yu(n):(t=iy(f,o,l),n.stateNode=t,Ma(n))}return wt(n),null;case 5:if(St(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&Ma(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return wt(n),null}if(h=W.current,fl(n))Yu(n);else{var v=Ac(ge.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[Wt]=n,h[Zt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(sn(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Ma(n)}}return wt(n),df(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&Ma(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=ge.current,fl(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=qt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Wt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Pg(t.nodeValue,l)),t||ta(n,!0)}else t=Ac(t).createTextNode(o),t[Wt]=n,n.stateNode=t}return wt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=fl(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[Wt]=n}else Ta(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),t=!1}else l=mo(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Gn(n),n):(Gn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return wt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=fl(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[Wt]=n}else Ta(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),f=!1}else f=mo(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Gn(n),n):(Gn(n),null)}return Gn(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),pc(n,n.updateQueue),wt(n),null);case 4:return Oe(),t===null&&Mf(n.stateNode.containerInfo),wt(n),null;case 10:return Ri(n.type),wt(n),null;case 19:if(z(It),o=n.memoizedState,o===null)return wt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)Eo(o,!1);else{if(Mt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=ec(t),h!==null){for(n.flags|=128,Eo(o,!1),t=h.updateQueue,n.updateQueue=t,pc(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)fo(l,t),l=l.sibling;return C(It,It.current&1|2),Fe&&Nn(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Ct()>xc&&(n.flags|=128,f=!0,Eo(o,!1),n.lanes=4194304)}else{if(!f)if(t=ec(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,pc(n,t),Eo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Fe)return wt(n),null}else 2*Ct()-o.renderingStartTime>xc&&l!==536870912&&(n.flags|=128,f=!0,Eo(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=Ct(),t.sibling=null,l=It.current,C(It,f?l&1|2:l&1),Fe&&Nn(n,o.treeForkCount),t):(wt(n),null);case 22:case 23:return Gn(n),Md(),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&&(wt(n),n.subtreeFlags&6&&(n.flags|=8192)):wt(n),l=n.updateQueue,l!==null&&pc(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(et),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Ri(Rt),wt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Gw(t,n){switch(cs(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ri(Rt),Oe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return St(n),null;case 31:if(n.memoizedState!==null){if(Gn(n),n.alternate===null)throw Error(r(340));Ta()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Gn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Ta()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(It),null;case 4:return Oe(),null;case 10:return Ri(n.type),null;case 22:case 23:return Gn(n),Md(),t!==null&&z(et),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Ri(Rt),null;case 25:return null;default:return null}}function Qm(t,n){switch(cs(n),n.tag){case 3:Ri(Rt),Oe();break;case 26:case 27:case 5:St(n);break;case 4:Oe();break;case 31:n.memoizedState!==null&&Gn(n);break;case 13:Gn(n);break;case 19:z(It);break;case 10:Ri(n.type);break;case 22:case 23:Gn(n),Md(),t!==null&&z(et);break;case 24:Ri(Rt)}}function Ao(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(T){ct(n,n.return,T)}}function kl(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,T=v.destroy;if(T!==void 0){v.destroy=void 0,f=n;var L=l,Y=T;try{Y()}catch(ee){ct(f,L,ee)}}}o=o.next}while(o!==h)}}catch(ee){ct(n,n.return,ee)}}function Zm(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{$h(n,l)}catch(o){ct(t,t.return,o)}}}function Jm(t,n,l){l.props=vr(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){ct(t,n,o)}}function No(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 na(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 eg(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 ff(t,n,l){try{var o=t.stateNode;fk(o,t.type,l,n),o[Zt]=n}catch(f){ct(t,t.return,f)}}function tg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Nl(t.type)||t.tag===4}function pf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||tg(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&&Nl(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 hf(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=kn));else if(o!==4&&(o===27&&Nl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(hf(t,n,l),t=t.sibling;t!==null;)hf(t,n,l),t=t.sibling}function hc(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&&Nl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(hc(t,n,l),t=t.sibling;t!==null;)hc(t,n,l),t=t.sibling}function ng(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);sn(n,o,l),n[Wt]=t,n[Zt]=l}catch(h){ct(t,t.return,h)}}var Oa=!1,Gt=!1,mf=!1,ig=typeof WeakSet=="function"?WeakSet:Set,en=null;function Fw(t,n){if(t=t.containerInfo,Lf=zc,t=zu(t),ts(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,T=-1,L=-1,Y=0,ee=0,re=t,Q=null;t:for(;;){for(var Z;re!==l||f!==0&&re.nodeType!==3||(T=v+f),re!==h||o!==0&&re.nodeType!==3||(L=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Z=re.firstChild)!==null;)Q=re,re=Z;for(;;){if(re===t)break t;if(Q===l&&++Y===f&&(T=v),Q===h&&++ee===o&&(L=v),(Z=re.nextSibling)!==null)break;re=Q,Q=re.parentNode}re=Z}l=T===-1||L===-1?null:{start:T,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(If={focusedElem:t,selectionRange:l},zc=!1,en=n;en!==null;)if(n=en,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,en=t;else for(;en!==null;){switch(n=en,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 Ce=vr(l.type,f);t=o.getSnapshotBeforeUpdate(Ce,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Le){ct(l,l.return,Le)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)qf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":qf(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,en=t;break}en=n.return}}function ag(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:La(t,l),o&4&&Ao(5,l);break;case 1:if(La(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){ct(l,l.return,v)}else{var f=vr(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ct(l,l.return,v)}}o&64&&Zm(l),o&512&&No(l,l.return);break;case 3:if(La(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{$h(t,n)}catch(v){ct(l,l.return,v)}}break;case 27:n===null&&o&4&&ng(l);case 26:case 5:La(t,l),n===null&&o&4&&eg(l),o&512&&No(l,l.return);break;case 12:La(t,l);break;case 31:La(t,l),o&4&&sg(t,l);break;case 13:La(t,l),o&4&&og(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=ek.bind(null,l),vk(t,l))));break;case 22:if(o=l.memoizedState!==null||Oa,!o){n=n!==null&&n.memoizedState!==null||Gt,f=Oa;var h=Gt;Oa=o,(Gt=n)&&!h?Ia(t,l,(l.subtreeFlags&8772)!==0):La(t,l),Oa=f,Gt=h}break;case 30:break;default:La(t,l)}}function lg(t){var n=t.alternate;n!==null&&(t.alternate=null,lg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Pl(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var kt=null,_n=!1;function za(t,n,l){for(l=l.child;l!==null;)rg(t,n,l),l=l.sibling}function rg(t,n,l){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(Xt,l)}catch{}switch(l.tag){case 26:Gt||na(l,n),za(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Gt||na(l,n);var o=kt,f=_n;Nl(l.type)&&(kt=l.stateNode,_n=!1),za(t,n,l),Uo(l.stateNode),kt=o,_n=f;break;case 5:Gt||na(l,n);case 6:if(o=kt,f=_n,kt=null,za(t,n,l),kt=o,_n=f,kt!==null)if(_n)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(l.stateNode)}catch(h){ct(l,n,h)}else try{kt.removeChild(l.stateNode)}catch(h){ct(l,n,h)}break;case 18:kt!==null&&(_n?(t=kt,Zg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ns(t)):Zg(kt,l.stateNode));break;case 4:o=kt,f=_n,kt=l.stateNode.containerInfo,_n=!0,za(t,n,l),kt=o,_n=f;break;case 0:case 11:case 14:case 15:kl(2,l,n),Gt||kl(4,l,n),za(t,n,l);break;case 1:Gt||(na(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Jm(l,n,o)),za(t,n,l);break;case 21:za(t,n,l);break;case 22:Gt=(o=Gt)||l.memoizedState!==null,za(t,n,l),Gt=o;break;default:za(t,n,l)}}function sg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ns(t)}catch(l){ct(n,n.return,l)}}}function og(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ns(t)}catch(l){ct(n,n.return,l)}}function Pw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new ig),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new ig),n;default:throw Error(r(435,t.tag))}}function mc(t,n){var l=Pw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=tk.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,T=v;e:for(;T!==null;){switch(T.tag){case 27:if(Nl(T.type)){kt=T.stateNode,_n=!1;break e}break;case 5:kt=T.stateNode,_n=!1;break e;case 3:case 4:kt=T.stateNode.containerInfo,_n=!0;break e}T=T.return}if(kt===null)throw Error(r(160));rg(h,v,f),kt=null,_n=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ug(n,t),n=n.sibling}var Oi=null;function ug(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(kl(3,t,t.return),Ao(3,t),kl(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&(Gt||l===null||na(l,l.return)),o&64&&Oa&&(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=Oi;if(Mn(n,t),On(t),o&512&&(Gt||l===null||na(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[Zn]||h[Wt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),sn(h,o,l),h[Wt]=t,Dt(h),o=h;break e;case"link":var v=uy("link","href",f).get(o+(l.href||""));if(v){for(var T=0;T<v.length;T++)if(h=v[T],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(T,1);break t}}h=f.createElement(o),sn(h,o,l),f.head.appendChild(h);break;case"meta":if(v=uy("meta","content",f).get(o+(l.content||""))){for(T=0;T<v.length;T++)if(h=v[T],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(T,1);break t}}h=f.createElement(o),sn(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Wt]=t,Dt(h),o=h}t.stateNode=o}else cy(f,t.type,t.stateNode);else t.stateNode=oy(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?cy(f,t.type,t.stateNode):oy(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&ff(t,t.memoizedProps,l.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&(Gt||l===null||na(l,l.return)),l!==null&&o&4&&ff(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&(Gt||l===null||na(l,l.return)),t.flags&32){f=t.stateNode;try{ga(f,"")}catch(Ce){ct(t,t.return,Ce)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,ff(t,f,l!==null?l.memoizedProps:f)),o&1024&&(mf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(Ce){ct(t,t.return,Ce)}}break;case 3:if(Rc=null,f=Oi,Oi=Nc(n.containerInfo),Mn(n,t),Oi=f,On(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{Ns(n.containerInfo)}catch(Ce){ct(t,t.return,Ce)}mf&&(mf=!1,cg(t));break;case 4:o=Oi,Oi=Nc(t.stateNode.containerInfo),Mn(n,t),On(t),Oi=o;break;case 12:Mn(n,t),On(t);break;case 31:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,mc(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(yc=Ct()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,mc(t,o)));break;case 22:f=t.memoizedState!==null;var L=l!==null&&l.memoizedState!==null,Y=Oa,ee=Gt;if(Oa=Y||f,Gt=ee||L,Mn(n,t),Gt=ee,Oa=Y,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||L||Oa||Gt||wr(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){L=l=n;try{if(h=L.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{T=L.stateNode;var re=L.memoizedProps.style,Q=re!=null&&re.hasOwnProperty("display")?re.display:null;T.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ce){ct(L,L.return,Ce)}}}else if(n.tag===6){if(l===null){L=n;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(Ce){ct(L,L.return,Ce)}}}else if(n.tag===18){if(l===null){L=n;try{var Z=L.stateNode;f?Jg(Z,!0):Jg(L.stateNode,!1)}catch(Ce){ct(L,L.return,Ce)}}}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,mc(t,l))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,mc(t,o)));break;case 30:break;case 21:break;default:Mn(n,t),On(t)}}function On(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(tg(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=pf(t);hc(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(ga(v,""),l.flags&=-33);var T=pf(t);hc(t,T,v);break;case 3:case 4:var L=l.stateNode.containerInfo,Y=pf(t);hf(t,Y,L);break;default:throw Error(r(161))}}catch(ee){ct(t,t.return,ee)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function cg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;cg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function La(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)ag(t,n.alternate,n),n=n.sibling}function wr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:kl(4,n,n.return),wr(n);break;case 1:na(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Jm(n,n.return,l),wr(n);break;case 27:Uo(n.stateNode);case 26:case 5:na(n,n.return),wr(n);break;case 22:n.memoizedState===null&&wr(n);break;case 30:wr(n);break;default:wr(n)}t=t.sibling}}function Ia(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:Ia(f,h,l),Ao(4,h);break;case 1:if(Ia(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 T=o.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)Hh(L[f],T)}catch(Y){ct(o,o.return,Y)}}l&&v&64&&Zm(h),No(h,h.return);break;case 27:ng(h);case 26:case 5:Ia(f,h,l),l&&o===null&&v&4&&eg(h),No(h,h.return);break;case 12:Ia(f,h,l);break;case 31:Ia(f,h,l),l&&v&4&&sg(f,h);break;case 13:Ia(f,h,l),l&&v&4&&og(f,h);break;case 22:h.memoizedState===null&&Ia(f,h,l),No(h,h.return);break;case 30:break;default:Ia(f,h,l)}n=n.sibling}}function gf(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&&hr(l))}function yf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&hr(t))}function zi(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)dg(t,n,l,o),n=n.sibling}function dg(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:zi(t,n,l,o),f&2048&&Ao(9,n);break;case 1:zi(t,n,l,o);break;case 3:zi(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&&hr(t)));break;case 12:if(f&2048){zi(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,T=h.onPostCommit;typeof T=="function"&&T(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(L){ct(n,n.return,L)}}else zi(t,n,l,o);break;case 31:zi(t,n,l,o);break;case 13:zi(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?zi(t,n,l,o):Do(t,n):h._visibility&2?zi(t,n,l,o):(h._visibility|=2,xs(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&gf(v,n);break;case 24:zi(t,n,l,o),f&2048&&yf(n.alternate,n);break;default:zi(t,n,l,o)}}function xs(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,T=l,L=o,Y=v.flags;switch(v.tag){case 0:case 11:case 15:xs(h,v,T,L,f),Ao(8,v);break;case 23:break;case 22:var ee=v.stateNode;v.memoizedState!==null?ee._visibility&2?xs(h,v,T,L,f):Do(h,v):(ee._visibility|=2,xs(h,v,T,L,f)),f&&Y&2048&&gf(v.alternate,v);break;case 24:xs(h,v,T,L,f),f&&Y&2048&&yf(v.alternate,v);break;default:xs(h,v,T,L,f)}n=n.sibling}}function Do(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:Do(l,o),f&2048&&gf(o.alternate,o);break;case 24:Do(l,o),f&2048&&yf(o.alternate,o);break;default:Do(l,o)}n=n.sibling}}var Ro=8192;function bs(t,n,l){if(t.subtreeFlags&Ro)for(t=t.child;t!==null;)fg(t,n,l),t=t.sibling}function fg(t,n,l){switch(t.tag){case 26:bs(t,n,l),t.flags&Ro&&t.memoizedState!==null&&_k(l,Oi,t.memoizedState,t.memoizedProps);break;case 5:bs(t,n,l);break;case 3:case 4:var o=Oi;Oi=Nc(t.stateNode.containerInfo),bs(t,n,l),Oi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Ro,Ro=16777216,bs(t,n,l),Ro=o):bs(t,n,l));break;default:bs(t,n,l)}}function pg(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 _o(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];en=o,mg(o,t)}pg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hg(t),t=t.sibling}function hg(t){switch(t.tag){case 0:case 11:case 15:_o(t),t.flags&2048&&kl(9,t,t.return);break;case 3:_o(t);break;case 12:_o(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,gc(t)):_o(t);break;default:_o(t)}}function gc(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];en=o,mg(o,t)}pg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:kl(8,n,n.return),gc(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,gc(n));break;default:gc(n)}t=t.sibling}}function mg(t,n){for(;en!==null;){var l=en;switch(l.tag){case 0:case 11:case 15:kl(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:hr(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,en=o;else e:for(l=t;en!==null;){o=en;var f=o.sibling,h=o.return;if(lg(o),o===l){en=null;break e}if(f!==null){f.return=h,en=f;break e}en=h}}}var Yw={getCacheForType:function(t){var n=Ht(Rt),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Ht(Rt).controller.signal}},Ww=typeof WeakMap=="function"?WeakMap:Map,rt=0,yt=null,Pe=null,Qe=0,ut=0,Fn=null,Sl=!1,vs=!1,xf=!1,Ua=0,Mt=0,jl=0,kr=0,bf=0,Pn=0,ws=0,Mo=null,zn=null,vf=!1,yc=0,gg=0,xc=1/0,bc=null,Cl=null,Kt=0,Tl=null,ks=null,Ba=0,wf=0,kf=null,yg=null,Oo=0,Sf=null;function Yn(){return(rt&2)!==0&&Qe!==0?Qe&-Qe:G.T!==null?Nf():Gs()}function xg(){if(Pn===0)if((Qe&536870912)===0||Fe){var t=Lr;Lr<<=1,(Lr&3932160)===0&&(Lr=262144),Pn=t}else Pn=536870912;return t=Vn.current,t!==null&&(t.flags|=32),Pn}function Ln(t,n,l){(t===yt&&(ut===2||ut===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),El(t,Qe,Pn,!1)),dt(t,l),((rt&2)===0||t!==yt)&&(t===yt&&((rt&2)===0&&(kr|=l),Mt===4&&El(t,Qe,Pn,!1)),ia(t))}function bg(t,n,l){if((rt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||Va(t,n),f=o?Qw(t,n):Cf(t,n,!0),h=o;do{if(f===0){vs&&!o&&El(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Kw(l)){f=Cf(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 T=t;f=Mo;var L=T.current.memoizedState.isDehydrated;if(L&&(Ss(T,v).flags|=256),v=Cf(T,v,!1),v!==2){if(xf&&!L){T.errorRecoveryDisabledLanes|=h,kr|=h,f=4;break e}h=zn,zn=f,h!==null&&(zn===null?zn=h:zn.push.apply(zn,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){Ss(t,0),El(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:El(o,n,Pn,!Sl);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=yc+300-Ct(),10<f)){if(El(o,n,Pn,!Sl),Gl(o,0,!0)!==0)break e;Ba=n,o.timeoutHandle=Xg(vg.bind(null,o,l,zn,bc,vf,n,Pn,kr,ws,Sl,h,"Throttled",-0,0),f);break e}vg(o,l,zn,bc,vf,n,Pn,kr,ws,Sl,h,null,-0,0)}}break}while(!0);ia(t)}function vg(t,n,l,o,f,h,v,T,L,Y,ee,re,Q,Z){if(t.timeoutHandle=-1,re=n.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},fg(n,h,re);var Ce=(h&62914560)===h?yc-Ct():(h&4194048)===h?gg-Ct():0;if(Ce=Mk(re,Ce),Ce!==null){Ba=h,t.cancelPendingCommit=Ce(Ag.bind(null,t,n,h,l,o,f,v,T,L,ee,re,null,Q,Z)),El(t,h,v,!Y);return}}Ag(t,n,h,l,o,f,v,T,L)}function Kw(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(!fn(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 El(t,n,l,o){n&=~bf,n&=~kr,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&&Hs(t,l,n)}function vc(){return(rt&6)===0?(zo(0),!1):!0}function jf(){if(Pe!==null){if(ut===0)var t=Pe.return;else t=Pe,Di=ri=null,Bd(t),Na=null,xl=0,t=Pe;for(;t!==null;)Qm(t.alternate,t),t=t.return;Pe=null}}function Ss(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,mk(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Ba=0,jf(),yt=t,Pe=l=Lt(t.current,null),Qe=n,ut=0,Fn=null,Sl=!1,vs=Va(t,n),xf=!1,ws=Pn=bf=kr=jl=Mt=0,zn=Mo=null,vf=!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 Ua=n,as(),l}function wg(t,n){He=null,G.H=Co,n===yl||n===fs?(n=Zu(),ut=3):n===di?(n=Zu(),ut=4):ut=n===tf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Fn=n,Pe===null&&(Mt=1,uc(t,En(n,t.current)))}function kg(){var t=Vn.current;return t===null?!0:(Qe&4194048)===Qe?fi===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===fi:!1}function Sg(){var t=G.H;return G.H=Co,t===null?Co:t}function jg(){var t=G.A;return G.A=Yw,t}function wc(){Mt=4,Sl||(Qe&4194048)!==Qe&&Vn.current!==null||(vs=!0),(jl&134217727)===0&&(kr&134217727)===0||yt===null||El(yt,Qe,Pn,!1)}function Cf(t,n,l){var o=rt;rt|=2;var f=Sg(),h=jg();(yt!==t||Qe!==n)&&(bc=null,Ss(t,n)),n=!1;var v=Mt;e:do try{if(ut!==0&&Pe!==null){var T=Pe,L=Fn;switch(ut){case 8:jf(),v=6;break e;case 3:case 2:case 9:case 6:Vn.current===null&&(n=!0);var Y=ut;if(ut=0,Fn=null,js(t,T,L,Y),l&&vs){v=0;break e}break;default:Y=ut,ut=0,Fn=null,js(t,T,L,Y)}}Xw(),v=Mt;break}catch(ee){wg(t,ee)}while(!0);return n&&t.shellSuspendCounter++,Di=ri=null,rt=o,G.H=f,G.A=h,Pe===null&&(yt=null,Qe=0,as()),v}function Xw(){for(;Pe!==null;)Cg(Pe)}function Qw(t,n){var l=rt;rt|=2;var o=Sg(),f=jg();yt!==t||Qe!==n?(bc=null,xc=Ct()+500,Ss(t,n)):vs=Va(t,n);e:do try{if(ut!==0&&Pe!==null){n=Pe;var h=Fn;t:switch(ut){case 1:ut=0,Fn=null,js(t,n,h,1);break;case 2:case 9:if(Qu(h)){ut=0,Fn=null,Tg(n);break}n=function(){ut!==2&&ut!==9||yt!==t||(ut=7),ia(t)},h.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Qu(h)?(ut=0,Fn=null,Tg(n)):(ut=0,Fn=null,js(t,n,h,7));break;case 5:var v=null;switch(Pe.tag){case 26:v=Pe.memoizedState;case 5:case 27:var T=Pe;if(v?dy(v):T.stateNode.complete){ut=0,Fn=null;var L=T.sibling;if(L!==null)Pe=L;else{var Y=T.return;Y!==null?(Pe=Y,kc(Y)):Pe=null}break t}}ut=0,Fn=null,js(t,n,h,5);break;case 6:ut=0,Fn=null,js(t,n,h,6);break;case 8:jf(),Mt=6;break e;default:throw Error(r(462))}}Zw();break}catch(ee){wg(t,ee)}while(!0);return Di=ri=null,G.H=o,G.A=f,rt=l,Pe!==null?0:(yt=null,Qe=0,as(),Mt)}function Zw(){for(;Pe!==null&&!yi();)Cg(Pe)}function Cg(t){var n=Km(t.alternate,t,Ua);t.memoizedProps=t.pendingProps,n===null?kc(t):Pe=n}function Tg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Vm(l,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Vm(l,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Bd(n);default:Qm(l,n),n=Pe=fo(n,Ua),n=Km(l,n,Ua)}t.memoizedProps=t.pendingProps,n===null?kc(t):Pe=n}function js(t,n,l,o){Di=ri=null,Bd(n),Na=null,xl=0;var f=n.return;try{if(qw(t,f,n,l,Qe)){Mt=1,uc(t,En(l,t.current)),Pe=null;return}}catch(h){if(f!==null)throw Pe=f,h;Mt=1,uc(t,En(l,t.current)),Pe=null;return}n.flags&32768?(Fe||o===1?t=!0:vs||(Qe&536870912)!==0?t=!1:(Sl=t=!0,(o===2||o===9||o===3||o===6)&&(o=Vn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Eg(n,t)):kc(n)}function kc(t){var n=t;do{if((n.flags&32768)!==0){Eg(n,Sl);return}t=n.return;var l=Vw(n.alternate,n,Ua);if(l!==null){Pe=l;return}if(n=n.sibling,n!==null){Pe=n;return}Pe=n=t}while(n!==null);Mt===0&&(Mt=5)}function Eg(t,n){do{var l=Gw(t.alternate,t);if(l!==null){l.flags&=32767,Pe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Pe=t;return}Pe=t=l}while(t!==null);Mt=6,Pe=null}function Ag(t,n,l,o,f,h,v,T,L){t.cancelPendingCommit=null;do Sc();while(Kt!==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|=uo,Fl(t,l,h,v,T,L),t===yt&&(Pe=yt=null,Qe=0),ks=n,Tl=t,Ba=l,wf=h,kf=f,yg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,nk(Ne,function(){return Mg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=G.T,G.T=null,f=se.p,se.p=2,v=rt,rt|=4;try{Fw(t,n,l)}finally{rt=v,se.p=f,G.T=o}}Kt=1,Ng(),Dg(),Rg()}}function Ng(){if(Kt===1){Kt=0;var t=Tl,n=ks,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=G.T,G.T=null;var o=se.p;se.p=2;var f=rt;rt|=4;try{ug(n,t);var h=If,v=zu(t.containerInfo),T=h.focusedElem,L=h.selectionRange;if(v!==T&&T&&T.ownerDocument&&or(T.ownerDocument.documentElement,T)){if(L!==null&&ts(T)){var Y=L.start,ee=L.end;if(ee===void 0&&(ee=Y),"selectionStart"in T)T.selectionStart=Y,T.selectionEnd=Math.min(ee,T.value.length);else{var re=T.ownerDocument||document,Q=re&&re.defaultView||window;if(Q.getSelection){var Z=Q.getSelection(),Ce=T.textContent.length,Le=Math.min(L.start,Ce),ht=L.end===void 0?Le:Math.min(L.end,Ce);!Z.extend&&Le>ht&&(v=ht,ht=Le,Le=v);var V=Ou(T,Le),B=Ou(T,ht);if(V&&B&&(Z.rangeCount!==1||Z.anchorNode!==V.node||Z.anchorOffset!==V.offset||Z.focusNode!==B.node||Z.focusOffset!==B.offset)){var P=re.createRange();P.setStart(V.node,V.offset),Z.removeAllRanges(),Le>ht?(Z.addRange(P),Z.extend(B.node,B.offset)):(P.setEnd(B.node,B.offset),Z.addRange(P))}}}}for(re=[],Z=T;Z=Z.parentNode;)Z.nodeType===1&&re.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<re.length;T++){var le=re[T];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}zc=!!Lf,If=Lf=null}finally{rt=f,se.p=o,G.T=l}}t.current=n,Kt=2}}function Dg(){if(Kt===2){Kt=0;var t=Tl,n=ks,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=G.T,G.T=null;var o=se.p;se.p=2;var f=rt;rt|=4;try{ag(t,n.alternate,n)}finally{rt=f,se.p=o,G.T=l}}Kt=3}}function Rg(){if(Kt===4||Kt===3){Kt=0,$l();var t=Tl,n=ks,l=Ba,o=yg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Kt=5:(Kt=0,ks=Tl=null,_g(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Cl=null),Vs(l),n=n.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(Xt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=G.T,f=se.p,se.p=2,G.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var T=o[v];h(T.value,{componentStack:T.stack})}}finally{G.T=n,se.p=f}}(Ba&3)!==0&&Sc(),ia(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===Sf?Oo++:(Oo=0,Sf=t):Oo=0,zo(0)}}function _g(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,hr(n)))}function Sc(){return Ng(),Dg(),Rg(),Mg()}function Mg(){if(Kt!==5)return!1;var t=Tl,n=wf;wf=0;var l=Vs(Ba),o=G.T,f=se.p;try{se.p=32>l?32:l,G.T=null,l=kf,kf=null;var h=Tl,v=Ba;if(Kt=0,ks=Tl=null,Ba=0,(rt&6)!==0)throw Error(r(331));var T=rt;if(rt|=4,hg(h.current),dg(h,h.current,v,l),rt=T,zo(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(Xt,h)}catch{}return!0}finally{se.p=f,G.T=o,_g(t,n)}}function Og(t,n,l){n=En(l,n),n=ef(t.stateNode,n,2),t=ve(t,n,2),t!==null&&(dt(t,2),ia(t))}function ct(t,n,l){if(t.tag===3)Og(t,t,l);else for(;n!==null;){if(n.tag===3){Og(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Cl===null||!Cl.has(o))){t=En(l,t),l=zm(2),o=ve(n,l,2),o!==null&&(Lm(l,o,n,t),dt(o,2),ia(o));break}}n=n.return}}function Tf(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new Ww;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)||(xf=!0,f.add(l),t=Jw.bind(null,t,n,l),n.then(t,t))}function Jw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,yt===t&&(Qe&l)===l&&(Mt===4||Mt===3&&(Qe&62914560)===Qe&&300>Ct()-yc?(rt&2)===0&&Ss(t,0):bf|=l,ws===Qe&&(ws=0)),ia(t)}function zg(t,n){n===0&&(n=vn()),t=Ca(t,n),t!==null&&(dt(t,n),ia(t))}function ek(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),zg(t,l)}function tk(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),zg(t,l)}function nk(t,n){return Pt(t,n)}var jc=null,Cs=null,Ef=!1,Cc=!1,Af=!1,Al=0;function ia(t){t!==Cs&&t.next===null&&(Cs===null?jc=Cs=t:Cs=Cs.next=t),Cc=!0,Ef||(Ef=!0,ak())}function zo(t,n){if(!Af&&Cc){Af=!0;do for(var l=!1,o=jc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,T=o.pingedLanes;h=(1<<31-st(42|t)+1)-1,h&=f&~(v&~T),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,Bg(o,h))}else h=Qe,h=Gl(o,o===yt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||Va(o,h)||(l=!0,Bg(o,h));o=o.next}while(l);Af=!1}}function ik(){Lg()}function Lg(){Cc=Ef=!1;var t=0;Al!==0&&hk()&&(t=Al);for(var n=Ct(),l=null,o=jc;o!==null;){var f=o.next,h=Ig(o,n);h===0?(o.next=null,l===null?jc=f:l.next=f,f===null&&(Cs=l)):(l=o,(t!==0||(h&3)!==0)&&(Cc=!0)),o=f}Kt!==0&&Kt!==5||zo(t),Al!==0&&(Al=0)}function Ig(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-st(h),T=1<<v,L=f[v];L===-1?((T&l)===0||(T&o)!==0)&&(f[v]=qs(T,n)):L<=n&&(t.expiredLanes|=T),h&=~T}if(n=yt,l=Qe,l=Gl(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&&Ii(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Va(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&Ii(o),Vs(l)){case 2:case 8:l=de;break;case 32:l=Ne;break;case 268435456:l=Xe;break;default:l=Ne}return o=Ug.bind(null,t),l=Pt(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&Ii(o),t.callbackPriority=2,t.callbackNode=null,2}function Ug(t,n){if(Kt!==0&&Kt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Sc()&&t.callbackNode!==l)return null;var o=Qe;return o=Gl(t,t===yt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(bg(t,o,n),Ig(t,Ct()),t.callbackNode!=null&&t.callbackNode===l?Ug.bind(null,t):null)}function Bg(t,n){if(Sc())return null;bg(t,n,!0)}function ak(){gk(function(){(rt&6)!==0?Pt(ne,ik):Lg()})}function Nf(){if(Al===0){var t=oi;t===0&&(t=Vl,Vl<<=1,(Vl&261888)===0&&(Vl=256)),Al=t}return Al}function qg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wl(""+t)}function Hg(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 lk(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=qg((f[Zt]||null).action),v=o.submitter;v&&(n=(n=v[Zt]||null)?qg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var T=new Ci("action","action",null,o,f);t.push({event:T,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Al!==0){var L=v?Hg(f,v):new FormData(f);Wd(l,{pending:!0,data:L,method:f.method,action:h},null,L)}}else typeof h=="function"&&(T.preventDefault(),L=v?Hg(f,v):new FormData(f),Wd(l,{pending:!0,data:L,method:f.method,action:h},h,L))},currentTarget:f}]})}}for(var Df=0;Df<oo.length;Df++){var Rf=oo[Df],rk=Rf.toLowerCase(),sk=Rf[0].toUpperCase()+Rf.slice(1);Hn(rk,"on"+sk)}Hn(so,"onAnimationEnd"),Hn(Iu,"onAnimationIteration"),Hn(Uu,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(Bu,"onTransitionRun"),Hn(Td,"onTransitionStart"),Hn(Ed,"onTransitionCancel"),Hn(qu,"onTransitionEnd"),ha("onMouseEnter",["mouseout","mouseover"]),ha("onMouseLeave",["mouseout","mouseover"]),ha("onPointerEnter",["pointerout","pointerover"]),ha("onPointerLeave",["pointerout","pointerover"]),pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pa("onBeforeInput",["compositionend","keypress","textInput","paste"]),pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),ok=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function $g(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 T=o[v],L=T.instance,Y=T.currentTarget;if(T=T.listener,L!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=Y;try{h(f)}catch(ee){is(ee)}f.currentTarget=null,h=L}else for(v=0;v<o.length;v++){if(T=o[v],L=T.instance,Y=T.currentTarget,T=T.listener,L!==h&&f.isPropagationStopped())break e;h=T,f.currentTarget=Y;try{h(f)}catch(ee){is(ee)}f.currentTarget=null,h=L}}}}function Ye(t,n){var l=n[da];l===void 0&&(l=n[da]=new Set);var o=t+"__bubble";l.has(o)||(Vg(n,t,2,!1),l.add(o))}function _f(t,n,l){var o=0;n&&(o|=4),Vg(l,t,o,n)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function Mf(t){if(!t[Tc]){t[Tc]=!0,Ur.forEach(function(l){l!=="selectionchange"&&(ok.has(l)||_f(l,!1,t),_f(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Tc]||(n[Tc]=!0,_f("selectionchange",!1,n))}}function Vg(t,n,l,o){switch(xy(n)){case 2:var f=Lk;break;case 8:f=Ik;break;default:f=Wf}l=f.bind(null,n,l,t),f=void 0,!Xl||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 Of(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 T=o.stateNode.containerInfo;if(T===f)break;if(v===4)for(v=o.return;v!==null;){var L=v.tag;if((L===3||L===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;T!==null;){if(v=bi(T),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){o=h=v;continue e}T=T.parentNode}}o=o.return}Tt(function(){var Y=h,ee=ni(l),re=[];e:{var Q=Hu.get(t);if(Q!==void 0){var Z=Ci,Ce=t;switch(t){case"keypress":if(Pr(l)===0)break e;case"keydown":case"keyup":Z=Ks;break;case"focusin":Ce="focus",Z=va;break;case"focusout":Ce="blur",Z=va;break;case"beforeblur":case"afterblur":Z=va;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Yr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Cu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Tu;break;case so:case Iu:case Uu:Z=Kr;break;case qu:Z=Ot;break;case"scroll":case"scrollend":Z=ju;break;case"wheel":Z=wa;break;case"copy":case"cut":case"paste":Z=Ja;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=ar;break;case"toggle":case"beforetoggle":Z=lt}var Le=(n&4)!==0,ht=!Le&&(t==="scroll"||t==="scrollend"),V=Le?Q!==null?Q+"Capture":null:Q;Le=[];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||V===null||(le=wi(B,V),le!=null&&Le.push(Io(B,le,P))),ht)break;B=B.return}0<Le.length&&(Q=new Z(Q,Ce,null,l,ee),re.push({event:Q,listeners:Le}))}}if((n&7)===0){e:{if(Q=t==="mouseover"||t==="pointerover",Z=t==="mouseout"||t==="pointerout",Q&&l!==Sn&&(Ce=l.relatedTarget||l.fromElement)&&(bi(Ce)||Ce[Fa]))break e;if((Z||Q)&&(Q=ee.window===ee?ee:(Q=ee.ownerDocument)?Q.defaultView||Q.parentWindow:window,Z?(Ce=l.relatedTarget||l.toElement,Z=Y,Ce=Ce?bi(Ce):null,Ce!==null&&(ht=c(Ce),Le=Ce.tag,Ce!==ht||Le!==5&&Le!==27&&Le!==6)&&(Ce=null)):(Z=null,Ce=Y),Z!==Ce)){if(Le=Yr,le="onMouseLeave",V="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Le=ar,le="onPointerLeave",V="onPointerEnter",B="pointer"),ht=Z==null?Q:vi(Z),P=Ce==null?Q:vi(Ce),Q=new Le(le,B+"leave",Z,l,ee),Q.target=ht,Q.relatedTarget=P,le=null,bi(ee)===Y&&(Le=new Le(V,B+"enter",Ce,l,ee),Le.target=P,Le.relatedTarget=ht,le=Le),ht=le,Z&&Ce)t:{for(Le=uk,V=Z,B=Ce,P=0,le=V;le;le=Le(le))P++;le=0;for(var _e=B;_e;_e=Le(_e))le++;for(;0<P-le;)V=Le(V),P--;for(;0<le-P;)B=Le(B),le--;for(;P--;){if(V===B||B!==null&&V===B.alternate){Le=V;break t}V=Le(V),B=Le(B)}Le=null}else Le=null;Z!==null&&Gg(re,Q,Z,Le,!1),Ce!==null&&ht!==null&&Gg(re,ht,Ce,Le,!0)}}e:{if(Q=Y?vi(Y):window,Z=Q.nodeName&&Q.nodeName.toLowerCase(),Z==="select"||Z==="input"&&Q.type==="file")var it=Du;else if(Nu(Q))if(Ru)it=no;else{it=sr;var De=es}else Z=Q.nodeName,!Z||Z.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Y&&ya(Y.elementType)&&(it=Du):it=_u;if(it&&(it=it(t,Y))){eo(re,it,l,ee);break e}De&&De(t,Q,Y),t==="focusout"&&Y&&Q.type==="number"&&Y.memoizedProps.value!=null&&qn(Q,"number",Q.value)}switch(De=Y?vi(Y):window,t){case"focusin":(Nu(De)||De.contentEditable==="true")&&(sl=De,lo=Y,Xi=null);break;case"focusout":Xi=lo=sl=null;break;case"mousedown":ur=!0;break;case"contextmenu":case"mouseup":case"dragend":ur=!1,ns(re,l,ee);break;case"selectionchange":if(ao)break;case"keydown":case"keyup":ns(re,l,ee)}var Ve;if(al)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 ka?Au(t,l)&&(Ze="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ze="onCompositionStart");Ze&&(Zr&&l.locale!=="ko"&&(ka||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&ka&&(Ve=Su()):(Gi=ee,Si="value"in Gi?Gi.value:Gi.textContent,ka=!0)),De=Ec(Y,Ze),0<De.length&&(Ze=new Ti(Ze,t,null,l,ee),re.push({event:Ze,listeners:De}),Ve?Ze.data=Ve:(Ve=ll(l),Ve!==null&&(Ze.data=Ve)))),(Ve=lr?Zs(t,l):Js(t,l))&&(Ze=Ec(Y,"onBeforeInput"),0<Ze.length&&(De=new Ti("onBeforeInput","beforeinput",null,l,ee),re.push({event:De,listeners:Ze}),De.data=Ve)),lk(re,t,Y,l,ee)}$g(re,n)})}function Io(t,n,l){return{instance:t,listener:n,currentTarget:l}}function Ec(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=wi(t,l),f!=null&&o.unshift(Io(t,f,h)),f=wi(t,n),f!=null&&o.push(Io(t,f,h))),t.tag===3)return o;t=t.return}return[]}function uk(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Gg(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var T=l,L=T.alternate,Y=T.stateNode;if(T=T.tag,L!==null&&L===o)break;T!==5&&T!==26&&T!==27||Y===null||(L=Y,f?(Y=wi(l,h),Y!=null&&v.unshift(Io(l,Y,L))):f||(Y=wi(l,h),Y!=null&&v.push(Io(l,Y,L)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var ck=/\r\n?/g,dk=/\u0000|\uFFFD/g;function Fg(t){return(typeof t=="string"?t:""+t).replace(ck,`
50
+ `).replace(dk,"")}function Pg(t,n){return n=Fg(n),Fg(t)===n}function pt(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||ga(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&ga(t,""+o);break;case"className":ma(t,"class",o);break;case"tabIndex":ma(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ma(t,l,o);break;case"style":Yl(t,o,h);break;case"data":if(n!=="object"){ma(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=Wl(""+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=Wl(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=kn);break;case"onScroll":o!=null&&Ye("scroll",t);break;case"onScrollEnd":o!=null&&Ye("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=Wl(""+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":Ye("beforetoggle",t),Ye("toggle",t),Hr(t,"popover",o);break;case"xlinkActuate":Jn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Jn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Jn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Jn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Jn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Jn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Hr(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=Ys.get(l)||l,Hr(t,l,o))}}function zf(t,n,l,o,f,h){switch(l){case"style":Yl(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"?ga(t,o):(typeof o=="number"||typeof o=="bigint")&&ga(t,""+o);break;case"onScroll":o!=null&&Ye("scroll",t);break;case"onScrollEnd":o!=null&&Ye("scrollend",t);break;case"onClick":o!=null&&(t.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Br.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[Zt]||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,""):Hr(t,l,o)}}}function sn(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",t),Ye("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":Ye("invalid",t);var T=h=v=f=null,L=null,Y=null;for(o in l)if(l.hasOwnProperty(o)){var ee=l[o];if(ee!=null)switch(o){case"name":f=ee;break;case"type":v=ee;break;case"checked":L=ee;break;case"defaultChecked":Y=ee;break;case"value":h=ee;break;case"defaultValue":T=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,n));break;default:pt(t,n,o,ee,l,null)}}ti(t,h,T,L,Y,v,f,!1);return;case"select":Ye("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(T=l[f],T!=null))switch(f){case"value":h=T;break;case"defaultValue":v=T;break;case"multiple":o=T;default:pt(t,n,f,T,l,null)}n=h,l=v,t.multiple=!!o,n!=null?wn(t,!!o,n,!1):l!=null&&wn(t,!!o,l,!0);return;case"textarea":Ye("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(T=l[v],T!=null))switch(v){case"value":o=T;break;case"defaultValue":f=T;break;case"children":h=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:pt(t,n,v,T,l,null)}Ka(t,o,f,h);return;case"option":for(L in l)if(l.hasOwnProperty(L)&&(o=l[L],o!=null))switch(L){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:pt(t,n,L,o,l,null)}return;case"dialog":Ye("beforetoggle",t),Ye("toggle",t),Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":Ye("load",t);break;case"video":case"audio":for(o=0;o<Lo.length;o++)Ye(Lo[o],t);break;case"image":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"embed":case"source":case"link":Ye("error",t),Ye("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(ya(n)){for(ee in l)l.hasOwnProperty(ee)&&(o=l[ee],o!==void 0&&zf(t,n,ee,o,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(o=l[T],o!=null&&pt(t,n,T,o,l,null))}function fk(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,T=null,L=null,Y=null,ee=null;for(Z in l){var re=l[Z];if(l.hasOwnProperty(Z)&&re!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":L=re;default:o.hasOwnProperty(Z)||pt(t,n,Z,null,o,re)}}for(var Q in o){var Z=o[Q];if(re=l[Q],o.hasOwnProperty(Q)&&(Z!=null||re!=null))switch(Q){case"type":h=Z;break;case"name":f=Z;break;case"checked":Y=Z;break;case"defaultChecked":ee=Z;break;case"value":v=Z;break;case"defaultValue":T=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==re&&pt(t,n,Q,Z,o,re)}}Vr(t,v,T,L,Y,ee,h,f);return;case"select":Z=v=T=Q=null;for(h in l)if(L=l[h],l.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Z=L;default:o.hasOwnProperty(h)||pt(t,n,h,null,o,L)}for(f in o)if(h=o[f],L=l[f],o.hasOwnProperty(f)&&(h!=null||L!=null))switch(f){case"value":Q=h;break;case"defaultValue":T=h;break;case"multiple":v=h;default:h!==L&&pt(t,n,f,h,o,L)}n=T,l=v,o=Z,Q!=null?wn(t,!!l,Q,!1):!!o!=!!l&&(n!=null?wn(t,!!l,n,!0):wn(t,!!l,l?[]:"",!1));return;case"textarea":Z=Q=null;for(T in l)if(f=l[T],l.hasOwnProperty(T)&&f!=null&&!o.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:pt(t,n,T,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":Q=f;break;case"defaultValue":Z=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)}Ps(t,Q,Z);return;case"option":for(var Ce in l)if(Q=l[Ce],l.hasOwnProperty(Ce)&&Q!=null&&!o.hasOwnProperty(Ce))switch(Ce){case"selected":t.selected=!1;break;default:pt(t,n,Ce,null,o,Q)}for(L in o)if(Q=o[L],Z=l[L],o.hasOwnProperty(L)&&Q!==Z&&(Q!=null||Z!=null))switch(L){case"selected":t.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:pt(t,n,L,Q,o,Z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Le in l)Q=l[Le],l.hasOwnProperty(Le)&&Q!=null&&!o.hasOwnProperty(Le)&&pt(t,n,Le,null,o,Q);for(Y in o)if(Q=o[Y],Z=l[Y],o.hasOwnProperty(Y)&&Q!==Z&&(Q!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:pt(t,n,Y,Q,o,Z)}return;default:if(ya(n)){for(var ht in l)Q=l[ht],l.hasOwnProperty(ht)&&Q!==void 0&&!o.hasOwnProperty(ht)&&zf(t,n,ht,void 0,o,Q);for(ee in o)Q=o[ee],Z=l[ee],!o.hasOwnProperty(ee)||Q===Z||Q===void 0&&Z===void 0||zf(t,n,ee,Q,o,Z);return}}for(var V in l)Q=l[V],l.hasOwnProperty(V)&&Q!=null&&!o.hasOwnProperty(V)&&pt(t,n,V,null,o,Q);for(re in o)Q=o[re],Z=l[re],!o.hasOwnProperty(re)||Q===Z||Q==null&&Z==null||pt(t,n,re,Q,o,Z)}function Yg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pk(){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,T=f.duration;if(h&&T&&Yg(v)){for(v=0,T=f.responseEnd,o+=1;o<l.length;o++){var L=l[o],Y=L.startTime;if(Y>T)break;var ee=L.transferSize,re=L.initiatorType;ee&&Yg(re)&&(L=L.responseEnd,v+=ee*(L<T?1:(T-Y)/(L-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 Lf=null,If=null;function Ac(t){return t.nodeType===9?t:t.ownerDocument}function Wg(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 Kg(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 Uf(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 Bf=null;function hk(){var t=window.event;return t&&t.type==="popstate"?t===Bf?!1:(Bf=t,!0):(Bf=null,!1)}var Xg=typeof setTimeout=="function"?setTimeout:void 0,mk=typeof clearTimeout=="function"?clearTimeout:void 0,Qg=typeof Promise=="function"?Promise:void 0,gk=typeof queueMicrotask=="function"?queueMicrotask:typeof Qg<"u"?function(t){return Qg.resolve(null).then(t).catch(yk)}:Xg;function yk(t){setTimeout(function(){throw t})}function Nl(t){return t==="head"}function Zg(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),Ns(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Uo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,Uo(l);for(var h=l.firstChild;h;){var v=h.nextSibling,T=h.nodeName;h[Zn]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&Uo(t.ownerDocument.body);l=f}while(l);Ns(n)}function Jg(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 qf(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":qf(l),Pl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function xk(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[Zn])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=pi(t.nextSibling),t===null)break}return null}function bk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=pi(t.nextSibling),t===null))return null;return t}function ey(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=pi(t.nextSibling),t===null))return null;return t}function Hf(t){return t.data==="$?"||t.data==="$~"}function $f(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function vk(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 pi(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 Vf=null;function ty(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return pi(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function ny(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 iy(t,n,l){switch(n=Ac(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 Uo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Pl(t)}var hi=new Map,ay=new Set;function Nc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var qa=se.d;se.d={f:wk,r:kk,D:Sk,C:jk,L:Ck,m:Tk,X:Ak,S:Ek,M:Nk};function wk(){var t=qa.f(),n=vc();return t||n}function kk(t){var n=Wa(t);n!==null&&n.tag===5&&n.type==="form"?wm(n):qa.r(t)}var Ts=typeof document>"u"?null:document;function ly(t,n,l){var o=Ts;if(o&&typeof n=="string"&&n){var f=Jt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),ay.has(f)||(ay.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),sn(n,"link",t),Dt(n),o.head.appendChild(n)))}}function Sk(t){qa.D(t),ly("dns-prefetch",t,null)}function jk(t,n){qa.C(t,n),ly("preconnect",t,n)}function Ck(t,n,l){qa.L(t,n,l);var o=Ts;if(o&&t&&n){var f='link[rel="preload"][as="'+Jt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Jt(l.imageSizes)+'"]')):f+='[href="'+Jt(t)+'"]';var h=f;switch(n){case"style":h=Es(t);break;case"script":h=As(t)}hi.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),hi.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(Bo(h))||n==="script"&&o.querySelector(qo(h))||(n=o.createElement("link"),sn(n,"link",t),Dt(n),o.head.appendChild(n)))}}function Tk(t,n){qa.m(t,n);var l=Ts;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Jt(o)+'"][href="'+Jt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=As(t)}if(!hi.has(h)&&(t=x({rel:"modulepreload",href:t},n),hi.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(qo(h)))return}o=l.createElement("link"),sn(o,"link",t),Dt(o),l.head.appendChild(o)}}}function Ek(t,n,l){qa.S(t,n,l);var o=Ts;if(o&&t){var f=Bi(o).hoistableStyles,h=Es(t);n=n||"default";var v=f.get(h);if(!v){var T={loading:0,preload:null};if(v=o.querySelector(Bo(h)))T.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=hi.get(h))&&Gf(t,l);var L=v=o.createElement("link");Dt(L),sn(L,"link",t),L._p=new Promise(function(Y,ee){L.onload=Y,L.onerror=ee}),L.addEventListener("load",function(){T.loading|=1}),L.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Dc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:T},f.set(h,v)}}}function Ak(t,n){qa.X(t,n);var l=Ts;if(l&&t){var o=Bi(l).hoistableScripts,f=As(t),h=o.get(f);h||(h=l.querySelector(qo(f)),h||(t=x({src:t,async:!0},n),(n=hi.get(f))&&Ff(t,n),h=l.createElement("script"),Dt(h),sn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Nk(t,n){qa.M(t,n);var l=Ts;if(l&&t){var o=Bi(l).hoistableScripts,f=As(t),h=o.get(f);h||(h=l.querySelector(qo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=hi.get(f))&&Ff(t,n),h=l.createElement("script"),Dt(h),sn(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ry(t,n,l,o){var f=(f=ge.current)?Nc(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=Es(l.href),l=Bi(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=Es(l.href);var h=Bi(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(Bo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),hi.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},hi.set(t,l),h||Dk(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=As(l),l=Bi(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 Es(t){return'href="'+Jt(t)+'"'}function Bo(t){return'link[rel="stylesheet"]['+t+"]"}function sy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function Dk(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),sn(n,"link",l),Dt(n),t.head.appendChild(n))}function As(t){return'[src="'+Jt(t)+'"]'}function qo(t){return"script[async]"+t}function oy(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Jt(l.href)+'"]');if(o)return n.instance=o,Dt(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"),Dt(o),sn(o,"style",f),Dc(o,l.precedence,t),n.instance=o;case"stylesheet":f=Es(l.href);var h=t.querySelector(Bo(f));if(h)return n.state.loading|=4,n.instance=h,Dt(h),h;o=sy(l),(f=hi.get(f))&&Gf(o,f),h=(t.ownerDocument||t).createElement("link"),Dt(h);var v=h;return v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),sn(h,"link",o),n.state.loading|=4,Dc(h,l.precedence,t),n.instance=h;case"script":return h=As(l.src),(f=t.querySelector(qo(h)))?(n.instance=f,Dt(f),f):(o=l,(f=hi.get(h))&&(o=x({},l),Ff(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Dt(f),sn(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Dc(o,l.precedence,t));return n.instance}function Dc(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 T=o[v];if(T.dataset.precedence===n)h=T;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 Gf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Ff(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Rc=null;function uy(t,n,l){if(Rc===null){var o=new Map,f=Rc=new Map;f.set(l,o)}else f=Rc,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[Zn]||h[Wt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var T=o.get(v);T?T.push(h):o.set(v,[h])}}return o}function cy(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function Rk(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 dy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function _k(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=Es(o.href),h=n.querySelector(Bo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=_c.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,Dt(h);return}h=n.ownerDocument||n,o=sy(o),(f=hi.get(f))&&Gf(o,f),h=h.createElement("link"),Dt(h);var v=h;v._p=new Promise(function(T,L){v.onload=T,v.onerror=L}),sn(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=_c.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Pf=0;function Mk(t,n){return t.stylesheets&&t.count===0&&Oc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&Oc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Pf===0&&(Pf=62500*pk());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Oc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Pf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function _c(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Mc=null;function Oc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Mc=new Map,n.forEach(Ok,t),Mc=null,_c.call(t))}function Ok(t,n){if(!(n.state.loading&4)){var l=Mc.get(t);if(l)var o=l.get(null);else{l=new Map,Mc.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=_c.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 Ho={$$typeof:q,Provider:null,Consumer:null,_currentValue:we,_currentValue2:we,_threadCount:0};function zk(t,n,l,o,f,h,v,T,L){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=Ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ui(0),this.hiddenUpdates=Ui(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function fy(t,n,l,o,f,h,v,T,L,Y,ee,re){return t=new zk(t,n,l,v,L,Y,ee,re,T),n=1,h===!0&&(n|=24),h=pn(3,null,null,n),t.current=h,h.stateNode=t,n=ml(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},fe(h),t}function py(t){return t?(t=ul,t):ul}function hy(t,n,l,o,f,h){f=py(f),o.context===null?o.context=f:o.pendingContext=f,o=be(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=ve(t,o,n),l!==null&&(Ln(l,t,n),ot(l,t,n))}function my(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Yf(t,n){my(t,n),(t=t.alternate)&&my(t,n)}function gy(t){if(t.tag===13||t.tag===31){var n=Ca(t,67108864);n!==null&&Ln(n,t,67108864),Yf(t,67108864)}}function yy(t){if(t.tag===13||t.tag===31){var n=Yn();n=ca(n);var l=Ca(t,n);l!==null&&Ln(l,t,n),Yf(t,n)}}var zc=!0;function Lk(t,n,l,o){var f=G.T;G.T=null;var h=se.p;try{se.p=2,Wf(t,n,l,o)}finally{se.p=h,G.T=f}}function Ik(t,n,l,o){var f=G.T;G.T=null;var h=se.p;try{se.p=8,Wf(t,n,l,o)}finally{se.p=h,G.T=f}}function Wf(t,n,l,o){if(zc){var f=Kf(o);if(f===null)Of(t,n,o,Lc,l),by(t,o);else if(Bk(f,t,n,l,o))o.stopPropagation();else if(by(t,o),n&4&&-1<Uk.indexOf(t)){for(;f!==null;){var h=Wa(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=ua(h.pendingLanes);if(v!==0){var T=h;for(T.pendingLanes|=2,T.entangledLanes|=2;v;){var L=1<<31-st(v);T.entanglements[1]|=L,v&=~L}ia(h),(rt&6)===0&&(xc=Ct()+500,zo(0))}}break;case 31:case 13:T=Ca(h,2),T!==null&&Ln(T,h,2),vc(),Yf(h,2)}if(h=Kf(o),h===null&&Of(t,n,o,Lc,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else Of(t,n,o,null,l)}}function Kf(t){return t=ni(t),Xf(t)}var Lc=null;function Xf(t){if(Lc=null,t=bi(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 Lc=t,null}function xy(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(oa()){case ne:return 2;case de:return 8;case Ne:case qe:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Qf=!1,Dl=null,Rl=null,_l=null,$o=new Map,Vo=new Map,Ml=[],Uk="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 by(t,n){switch(t){case"focusin":case"focusout":Dl=null;break;case"dragenter":case"dragleave":Rl=null;break;case"mouseover":case"mouseout":_l=null;break;case"pointerover":case"pointerout":$o.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(n.pointerId)}}function Go(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=Wa(n),n!==null&&gy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Bk(t,n,l,o,f){switch(n){case"focusin":return Dl=Go(Dl,t,n,l,o,f),!0;case"dragenter":return Rl=Go(Rl,t,n,l,o,f),!0;case"mouseover":return _l=Go(_l,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return $o.set(h,Go($o.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Vo.set(h,Go(Vo.get(h)||null,t,n,l,o,f)),!0}return!1}function vy(t){var n=bi(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,bu(t.priority,function(){yy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,bu(t.priority,function(){yy(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 Ic(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=Kf(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);Sn=o,l.target.dispatchEvent(o),Sn=null}else return n=Wa(l),n!==null&&gy(n),t.blockedOn=l,!1;n.shift()}return!0}function wy(t,n,l){Ic(t)&&l.delete(n)}function qk(){Qf=!1,Dl!==null&&Ic(Dl)&&(Dl=null),Rl!==null&&Ic(Rl)&&(Rl=null),_l!==null&&Ic(_l)&&(_l=null),$o.forEach(wy),Vo.forEach(wy)}function Uc(t,n){t.blockedOn===n&&(t.blockedOn=null,Qf||(Qf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,qk)))}var Bc=null;function ky(t){Bc!==t&&(Bc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Bc===t&&(Bc=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(Xf(o||l)===null)continue;break}var h=Wa(l);h!==null&&(t.splice(n,3),n-=3,Wd(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function Ns(t){function n(L){return Uc(L,t)}Dl!==null&&Uc(Dl,t),Rl!==null&&Uc(Rl,t),_l!==null&&Uc(_l,t),$o.forEach(n),Vo.forEach(n);for(var l=0;l<Ml.length;l++){var o=Ml[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Ml.length&&(l=Ml[0],l.blockedOn===null);)vy(l),l.blockedOn===null&&Ml.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[Zt]||null;if(typeof h=="function")v||ky(l);else if(v){var T=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Zt]||null)T=v.formAction;else if(Xf(f)!==null)continue}else T=v.action;typeof T=="function"?l[o+1]=T:(l.splice(o,3),o-=3),ky(l)}}}function Sy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Zf(t){this._internalRoot=t}qc.prototype.render=Zf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Yn();hy(l,o,t,n,null,null)},qc.prototype.unmount=Zf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;hy(t.current,2,null,t,null,null),vc(),n[Fa]=null}};function qc(t){this._internalRoot=t}qc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Gs();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Ml.length&&n!==0&&n<Ml[l].priority;l++);Ml.splice(l,0,t),l===0&&vy(t)}};var jy=i.version;if(jy!=="19.2.7")throw Error(r(527,jy,"19.2.7"));se.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 Hk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hc.isDisabled&&Hc.supportsFiber)try{Xt=Hc.inject(Hk),At=Hc}catch{}}return Po.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=Rm,h=_m,v=Mm;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=fy(t,1,!1,null,null,l,o,null,f,h,v,Sy),t[Fa]=n.current,Mf(t),new Zf(n)},Po.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=Rm,v=_m,T=Mm,L=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&&(T=l.onRecoverableError),l.formState!==void 0&&(L=l.formState)),n=fy(t,1,!0,n,l??null,o,f,L,h,v,T,Sy),n.context=py(null),l=n.current,o=Yn(),o=ca(o),f=be(o),f.callback=null,ve(l,f,o),l=o,n.current.lanes=l,dt(n,l),ia(n),t[Fa]=n.current,Mf(t),new qc(n)},Po.version="19.2.7",Po}var zy;function tS(){if(zy)return tp.exports;zy=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(),tp.exports=eS(),tp.exports}var nS=tS();function iS(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const aS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rS={};function Ly(e,i){return(rS.jsx?lS:aS).test(e)}const sS=/[ \t\n\f\r]/g;function oS(e){return typeof e=="object"?e.type==="text"?Iy(e.value):!1:Iy(e)}function Iy(e){return e.replace(sS,"")===""}class gu{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}gu.prototype.normal={};gu.prototype.property={};gu.prototype.space=void 0;function Tb(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new gu(a,r,i)}function Bp(e){return e.toLowerCase()}class Bn{constructor(i,a){this.attribute=a,this.property=i}}Bn.prototype.attribute="";Bn.prototype.booleanish=!1;Bn.prototype.boolean=!1;Bn.prototype.commaOrSpaceSeparated=!1;Bn.prototype.commaSeparated=!1;Bn.prototype.defined=!1;Bn.prototype.mustUseProperty=!1;Bn.prototype.number=!1;Bn.prototype.overloadedBoolean=!1;Bn.prototype.property="";Bn.prototype.spaceSeparated=!1;Bn.prototype.space=void 0;let uS=0;const Ue=Or(),Ft=Or(),qp=Or(),pe=Or(),xt=Or(),Nr=Or(),Wn=Or();function Or(){return 2**++uS}const Hp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ue,booleanish:Ft,commaOrSpaceSeparated:Wn,commaSeparated:Nr,number:pe,overloadedBoolean:qp,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),lp=Object.keys(Hp);class ch extends Bn{constructor(i,a,r,u){let c=-1;if(super(i,a),Uy(this,"space",u),typeof r=="number")for(;++c<lp.length;){const d=lp[c];Uy(this,lp[c],(r&Hp[d])===Hp[d])}}}ch.prototype.defined=!0;function Uy(e,i,a){a&&(e[i]=a)}function Us(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new ch(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[Bp(r)]=r,a[Bp(c.attribute)]=r}return new gu(i,a,e.space)}const Eb=Us({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:xt,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:pe,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:xt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:Ft,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Ab(e,i){return i in e?e[i]:i}function Nb(e,i){return Ab(e,i.toLowerCase())}const cS=Us({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nr,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:Ue,allowPaymentRequest:Ue,allowUserMedia:Ue,alpha:Ue,alt:null,as:null,async:Ue,autoCapitalize:null,autoComplete:xt,autoFocus:Ue,autoPlay:Ue,blocking:xt,capture:null,charSet:null,checked:Ue,cite:null,className:xt,closedBy:null,colorSpace:null,cols:pe,colSpan:pe,command:null,commandFor:null,content:null,contentEditable:Ft,controls:Ue,controlsList:xt,coords:pe|Nr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ue,defer:Ue,dir:null,dirName:null,disabled:Ue,download:qp,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ue,formTarget:null,headers:xt,height:pe,hidden:qp,high:pe,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inert:Ue,inputMode:null,integrity:null,is:null,isMap:Ue,itemId:null,itemProp:xt,itemRef:xt,itemScope:Ue,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ue,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Ue,muted:Ue,name:null,nonce:null,noModule:Ue,noValidate:Ue,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:Ue,optimum:pe,pattern:null,ping:xt,placeholder:null,playsInline:Ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ue,referrerPolicy:null,rel:xt,required:Ue,reversed:Ue,rows:pe,rowSpan:pe,sandbox:xt,scope:null,scoped:Ue,seamless:Ue,selected:Ue,shadowRootClonable:Ue,shadowRootCustomElementRegistry:Ue,shadowRootDelegatesFocus:Ue,shadowRootMode:null,shadowRootSerializable:Ue,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Ue,useMap:null,value:Ft,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ue,declare:Ue,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Ue,noHref:Ue,noShade:Ue,noWrap:Ue,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ue,disablePictureInPicture:Ue,disableRemotePlayback:Ue,exportParts:Nr,part:xt,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:Nb}),dS=Us({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Wn,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nr,g2:Nr,glyphName:Nr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:pe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wn,rev:Wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wn,requiredFeatures:Wn,requiredFonts:Wn,requiredFormats:Wn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ab}),Db=Us({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()}}),Rb=Us({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Nb}),_b=Us({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),fS={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"},pS=/[A-Z]/g,By=/-[a-z]/g,hS=/^data[-\w.:]+$/i;function mS(e,i){const a=Bp(i);let r=i,u=Bn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&hS.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(By,yS);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!By.test(c)){let d=c.replace(pS,gS);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=ch}return new u(r,i)}function gS(e){return"-"+e.toLowerCase()}function yS(e){return e.charAt(1).toUpperCase()}const xS=Tb([Eb,cS,Db,Rb,_b],"html"),dh=Tb([Eb,dS,Db,Rb,_b],"svg");function bS(e){return e.join(" ").trim()}var Ds={},rp,qy;function vS(){if(qy)return rp;qy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,y=`
51
+ `,m="/",b="*",x="",S="comment",w="declaration";function E($,M){if(typeof $!="string")throw new TypeError("First argument must be a string");if(!$)return[];M=M||{};var H=1,q=1;function F(xe){var ce=xe.match(i);ce&&(H+=ce.length);var G=xe.lastIndexOf(y);q=~G?xe.length-G:q+xe.length}function ie(){var xe={line:H,column:q};return function(ce){return ce.position=new D(xe),J(),ce}}function D(xe){this.start=xe,this.end={line:H,column:q},this.source=M.source}D.prototype.content=$;function X(xe){var ce=new Error(M.source+":"+H+":"+q+": "+xe);if(ce.reason=xe,ce.filename=M.source,ce.line=H,ce.column=q,ce.source=$,!M.silent)throw ce}function ae(xe){var ce=xe.exec($);if(ce){var G=ce[0];return F(G),$=$.slice(G.length),ce}}function J(){ae(a)}function U(xe){var ce;for(xe=xe||[];ce=te();)ce!==!1&&xe.push(ce);return xe}function te(){var xe=ie();if(!(m!=$.charAt(0)||b!=$.charAt(1))){for(var ce=2;x!=$.charAt(ce)&&(b!=$.charAt(ce)||m!=$.charAt(ce+1));)++ce;if(ce+=2,x===$.charAt(ce-1))return X("End of comment missing");var G=$.slice(2,ce-2);return q+=2,F(G),$=$.slice(ce),q+=2,xe({type:S,comment:G})}}function ue(){var xe=ie(),ce=ae(r);if(ce){if(te(),!ae(u))return X("property missing ':'");var G=ae(c),se=xe({type:w,property:R(ce[0].replace(e,x)),value:G?R(G[0].replace(e,x)):x});return ae(d),se}}function je(){var xe=[];U(xe);for(var ce;ce=ue();)ce!==!1&&(xe.push(ce),U(xe));return xe}return J(),je()}function R($){return $?$.replace(p,x):x}return rp=E,rp}var Hy;function wS(){if(Hy)return Ds;Hy=1;var e=Ds&&Ds.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=a;const i=e(vS());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(y=>{if(y.type!=="declaration")return;const{property:m,value:b}=y;p?u(m,b,y):b&&(c=c||{},c[m]=b)}),c}return Ds}var Yo={},$y;function kS(){if($y)return Yo;$y=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.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,"-")},y=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 Yo.camelCase=y,Yo}var Wo,Vy;function SS(){if(Vy)return Wo;Vy=1;var e=Wo&&Wo.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(wS()),a=kS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,y){p&&y&&(d[(0,a.camelCase)(p,c)]=y)}),d}return r.default=r,Wo=r,Wo}var jS=SS();const CS=Cb(jS),Mb=Ob("end"),fh=Ob("start");function Ob(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 TS(e){const i=fh(e),a=Mb(e);if(i&&a)return{start:i,end:a}}function ru(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gy(e.position):"start"in e||"end"in e?Gy(e):"line"in e||"column"in e?$p(e):""}function $p(e){return Fy(e&&e.line)+":"+Fy(e&&e.column)}function Gy(e){return $p(e&&e.start)+"-"+$p(e&&e.end)}function Fy(e){return e&&typeof e=="number"?e:1}class dn 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 y=r.indexOf(":");y===-1?c.ruleId=r:(c.source=r.slice(0,y),c.ruleId=r.slice(y+1))}if(!c.place&&c.ancestors&&c.ancestors){const y=c.ancestors[c.ancestors.length-1];y&&(c.place=y.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=ru(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}}dn.prototype.file="";dn.prototype.name="";dn.prototype.reason="";dn.prototype.message="";dn.prototype.stack="";dn.prototype.column=void 0;dn.prototype.line=void 0;dn.prototype.ancestors=void 0;dn.prototype.cause=void 0;dn.prototype.fatal=void 0;dn.prototype.place=void 0;dn.prototype.ruleId=void 0;dn.prototype.source=void 0;const ph={}.hasOwnProperty,ES=new Map,AS=/[A-Z]/g,NS=new Set(["table","tbody","thead","tfoot","tr"]),DS=new Set(["td","th"]),zb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function RS(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=BS(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=US(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"?dh:xS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=Lb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function Lb(e,i,a){if(i.type==="element")return _S(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return MS(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return zS(e,i,a);if(i.type==="mdxjsEsm")return OS(e,i);if(i.type==="root")return LS(e,i,a);if(i.type==="text")return IS(e,i)}function _S(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=dh,e.schema=u),e.ancestors.push(i);const c=Ub(e,i.tagName,!1),d=qS(e,i);let p=mh(e,i);return NS.has(i.tagName)&&(p=p.filter(function(y){return typeof y=="string"?!oS(y):!0})),Ib(e,d,c,i),hh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function MS(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)}hu(e,i.position)}function OS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);hu(e,i.position)}function zS(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=dh,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Ub(e,i.name,!0),d=HS(e,i),p=mh(e,i);return Ib(e,d,c,i),hh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function LS(e,i,a){const r={};return hh(r,mh(e,i)),e.create(i,e.Fragment,r,a)}function IS(e,i){return i.value}function Ib(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function hh(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function US(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 BS(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),y=fh(r);return i(u,c,d,p,{columnNumber:y?y.column-1:void 0,fileName:e,lineNumber:y?y.line:void 0},void 0)}}function qS(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&ph.call(i.properties,u)){const c=$S(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&DS.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 HS(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 hu(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 hu(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function mh(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:ES;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const y=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(y){const m=u.get(y)||0;d=y+"-"+m,u.set(y,m+1)}}const p=Lb(e,c,d);p!==void 0&&a.push(p)}return a}function $S(e,i,a){const r=mS(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?iS(a):bS(a)),r.property==="style"){let u=typeof a=="object"?a:VS(e,String(a));return e.stylePropertyNameCase==="css"&&(u=GS(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?fS[r.property]||r.property:r.attribute,a]}}function VS(e,i){try{return CS(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new dn("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=zb+"#cannot-parse-style-attribute",u}}function Ub(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=Ly(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=Ly(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return ph.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);hu(e)}function hu(e,i){const a=new dn("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=zb+"#cannot-handle-mdx-estrees-without-createevaluater",a}function GS(e){const i={};let a;for(a in e)ph.call(e,a)&&(i[FS(a)]=e[a]);return i}function FS(e){let i=e.replace(AS,PS);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function PS(e){return"-"+e.toLowerCase()}const sp={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"]},YS={};function gh(e,i){const a=YS,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Bb(e,r,u)}function Bb(e,i,a){if(WS(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 Py(e.children,i,a)}return Array.isArray(e)?Py(e,i,a):""}function Py(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=Bb(e[u],i,a);return r.join("")}function WS(e){return!!(e&&typeof e=="object")}const Yy=document.createElement("i");function yh(e){const i="&"+e+";";Yy.innerHTML=i;const a=Yy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function Kn(e,i,a,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function mi(e,i){return e.length>0?(Kn(e,e.length,0,i),e):i}const Wy={}.hasOwnProperty;function qb(e){const i={};let a=-1;for(;++a<e.length;)KS(i,e[a]);return i}function KS(e,i){let a;for(a in i){const u=(Wy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Wy.call(u,d)||(u[d]=[]);const p=c[d];XS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function XS(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);Kn(e,0,0,r)}function Hb(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 Li(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gn=Hl(/[A-Za-z]/),cn=Hl(/[\dA-Za-z]/),QS=Hl(/[#-'*+\--9=?A-Z^-~]/);function sd(e){return e!==null&&(e<32||e===127)}const Vp=Hl(/\d/),ZS=Hl(/[\dA-Fa-f]/),JS=Hl(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function bt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const md=Hl(new RegExp("\\p{P}|\\p{S}","u")),Dr=Hl(/\s/);function Hl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function Bs(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&cn(e.charCodeAt(a+1))&&cn(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 nt(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(y){return We(y)?(e.enter(a),p(y)):i(y)}function p(y){return We(y)&&c++<u?(e.consume(y),p):(e.exit(a),i(y))}}const ej={tokenize:tj};function tj(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"),nt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const y=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=y),a=y,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return ze(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const nj={tokenize:ij},Ky={tokenize:aj};function ij(e){const i=this,a=[];let r=0,u,c,d;return p;function p(q){if(r<a.length){const F=a[r];return i.containerState=F[1],e.attempt(F[0].continuation,y,m)(q)}return m(q)}function y(q){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const F=i.events.length;let ie=F,D;for(;ie--;)if(i.events[ie][0]==="exit"&&i.events[ie][1].type==="chunkFlow"){D=i.events[ie][1].end;break}M(r);let X=F;for(;X<i.events.length;)i.events[X][1].end={...D},X++;return Kn(i.events,ie+1,0,i.events.slice(F)),i.events.length=X,m(q)}return p(q)}function m(q){if(r===a.length){if(!u)return S(q);if(u.currentConstruct&&u.currentConstruct.concrete)return E(q);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Ky,b,x)(q)}function b(q){return u&&H(),M(r),S(q)}function x(q){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,E(q)}function S(q){return i.containerState={},e.attempt(Ky,w,E)(q)}function w(q){return r++,a.push([i.currentConstruct,i.containerState]),S(q)}function E(q){if(q===null){u&&H(),M(0),e.consume(q);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),R(q)}function R(q){if(q===null){$(e.exit("chunkFlow"),!0),M(0),e.consume(q);return}return ze(q)?(e.consume(q),$(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(q),R)}function $(q,F){const ie=i.sliceStream(q);if(F&&ie.push(null),q.previous=c,c&&(c.next=q),c=q,u.defineSkip(q.start),u.write(ie),i.parser.lazy[q.start.line]){let D=u.events.length;for(;D--;)if(u.events[D][1].start.offset<d&&(!u.events[D][1].end||u.events[D][1].end.offset>d))return;const X=i.events.length;let ae=X,J,U;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(J){U=i.events[ae][1].end;break}J=!0}for(M(r),D=X;D<i.events.length;)i.events[D][1].end={...U},D++;Kn(i.events,ae+1,0,i.events.slice(X)),i.events.length=D}}function M(q){let F=a.length;for(;F-- >q;){const ie=a[F];i.containerState=ie[1],ie[0].exit.call(i,e)}a.length=q}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function aj(e,i,a){return nt(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ls(e){if(e===null||bt(e)||Dr(e))return 1;if(md(e))return 2}function gd(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 Gp={name:"attention",resolveAll:lj,tokenize:rj};function lj(e,i){let a=-1,r,u,c,d,p,y,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;y=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},S={...e[a][1].start};Xy(x,-y),Xy(S,y),d={type:y>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:y>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:S},c={type:y>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:y>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=mi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=mi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=mi(m,gd(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=mi(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=mi(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,Kn(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function rj(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Ls(r);let c;return d;function d(y){return c=y,e.enter("attentionSequence"),p(y)}function p(y){if(y===c)return e.consume(y),p;const m=e.exit("attentionSequence"),b=Ls(y),x=!b||b===2&&u||a.includes(y),S=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!S)),m._close=!!(c===42?S:S&&(b||!x)),i(y)}}function Xy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const sj={name:"autolink",tokenize:oj};function oj(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 gn(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||cn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,y):(w===43||w===45||w===46||cn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function y(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||sd(w)?a(w):(e.consume(w),y)}function m(w){return w===64?(e.consume(w),b):QS(w)?(e.consume(w),m):a(w)}function b(w){return cn(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):S(w)}function S(w){if((w===45||cn(w))&&r++<63){const E=w===45?S:x;return e.consume(w),E}return a(w)}}const yu={partial:!0,tokenize:uj};function uj(e,i,a){return r;function r(c){return We(c)?nt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||ze(c)?i(c):a(c)}}const $b={continuation:{tokenize:dj},exit:fj,name:"blockQuote",tokenize:cj};function cj(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 We(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function dj(e,i,a){const r=this;return u;function u(d){return We(d)?nt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt($b,i,a)(d)}}function fj(e){e.exit("blockQuote")}const Vb={name:"characterEscape",tokenize:pj};function pj(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 JS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Gb={name:"characterReference",tokenize:hj};function hj(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"),y}function y(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=cn,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=ZS,b):(e.enter("characterReferenceValue"),c=7,d=Vp,b(x))}function b(x){if(x===59&&u){const S=e.exit("characterReferenceValue");return d===cn&&!yh(r.sliceSerialize(S))?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 Qy={partial:!0,tokenize:gj},Zy={concrete:!0,name:"codeFenced",tokenize:mj};function mj(e,i,a){const r=this,u={partial:!0,tokenize:ie};let c=0,d=0,p;return y;function y(D){return m(D)}function m(D){const X=r.events[r.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,p=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(D)}function b(D){return D===p?(d++,e.consume(D),b):d<3?a(D):(e.exit("codeFencedFenceSequence"),We(D)?nt(e,x,"whitespace")(D):x(D))}function x(D){return D===null||ze(D)?(e.exit("codeFencedFence"),r.interrupt?i(D):e.check(Qy,R,F)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),S(D))}function S(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(D)):We(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),nt(e,w,"whitespace")(D)):D===96&&D===p?a(D):(e.consume(D),S)}function w(D){return D===null||ze(D)?x(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(D))}function E(D){return D===null||ze(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(D)):D===96&&D===p?a(D):(e.consume(D),E)}function R(D){return e.attempt(u,F,$)(D)}function $(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),M}function M(D){return c>0&&We(D)?nt(e,H,"linePrefix",c+1)(D):H(D)}function H(D){return D===null||ze(D)?e.check(Qy,R,F)(D):(e.enter("codeFlowValue"),q(D))}function q(D){return D===null||ze(D)?(e.exit("codeFlowValue"),H(D)):(e.consume(D),q)}function F(D){return e.exit("codeFenced"),i(D)}function ie(D,X,ae){let J=0;return U;function U(ce){return D.enter("lineEnding"),D.consume(ce),D.exit("lineEnding"),te}function te(ce){return D.enter("codeFencedFence"),We(ce)?nt(D,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):ue(ce)}function ue(ce){return ce===p?(D.enter("codeFencedFenceSequence"),je(ce)):ae(ce)}function je(ce){return ce===p?(J++,D.consume(ce),je):J>=d?(D.exit("codeFencedFenceSequence"),We(ce)?nt(D,xe,"whitespace")(ce):xe(ce)):ae(ce)}function xe(ce){return ce===null||ze(ce)?(D.exit("codeFencedFence"),X(ce)):ae(ce)}}}function gj(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 op={name:"codeIndented",tokenize:xj},yj={partial:!0,tokenize:bj};function xj(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),nt(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?y(m):ze(m)?e.attempt(yj,d,y)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||ze(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function y(m){return e.exit("codeIndented"),i(m)}}function bj(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):nt(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):ze(d)?u(d):a(d)}}const vj={name:"codeText",previous:kj,resolve:wj,tokenize:Sj};function wj(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 kj(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Sj(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"),y(x))}function y(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),y):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):ze(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||ze(x)?(e.exit("codeTextData"),y(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 jj{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&&Ko(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),Ko(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Ko(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);Ko(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Ko(this.left,a.reverse())}}}function Ko(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 Fb(e){const i={};let a=-1,r,u,c,d,p,y,m;const b=new jj(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"&&(y=r[1]._tokenizer.events,c=0,c<y.length&&y[c][1].type==="lineEndingBlank"&&(c+=2),c<y.length&&y[c][1].type==="content"))for(;++c<y.length&&y[c][1].type!=="content";)y[c][1].type==="chunkText"&&(y[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,Cj(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return Kn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function Cj(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,y=[],m={};let b,x,S=-1,w=a,E=0,R=0;const $=[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;++S<p.length;)p[S][0]==="exit"&&p[S-1][0]==="enter"&&p[S][1].type===p[S-1][1].type&&p[S][1].start.line!==p[S][1].end.line&&(R=S+1,$.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):$.pop(),S=$.length;S--;){const M=p.slice($[S],$[S+1]),H=c.pop();y.push([H,H+M.length-1]),e.splice(H,2,M)}for(y.reverse(),S=-1;++S<y.length;)m[E+y[S][0]]=E+y[S][1],E+=y[S][1]-y[S][0]-1;return m}const Tj={resolve:Aj,tokenize:Nj},Ej={partial:!0,tokenize:Dj};function Aj(e){return Fb(e),e}function Nj(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):ze(p)?e.check(Ej,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 Dj(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),nt(e,c,"linePrefix")}function c(d){if(d===null||ze(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 Pb(e,i,a,r,u,c,d,p,y){const m=y||Number.POSITIVE_INFINITY;let b=0;return x;function x(M){return M===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(M),e.exit(c),S):M===null||M===32||M===41||sd(M)?a(M):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),R(M))}function S(M){return M===62?(e.enter(c),e.consume(M),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===62?(e.exit("chunkString"),e.exit(p),S(M)):M===null||M===60||ze(M)?a(M):(e.consume(M),M===92?E:w)}function E(M){return M===60||M===62||M===92?(e.consume(M),w):w(M)}function R(M){return!b&&(M===null||M===41||bt(M))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(M)):b<m&&M===40?(e.consume(M),b++,R):M===41?(e.consume(M),b--,R):M===null||M===32||M===40||sd(M)?a(M):(e.consume(M),M===92?$:R)}function $(M){return M===40||M===41||M===92?(e.consume(M),R):R(M)}}function Yb(e,i,a,r,u,c){const d=this;let p=0,y;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&&!y||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):ze(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||ze(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),y||(y=!We(w)),w===92?S:x)}function S(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Wb(e,i,a,r,u,c){let d;return p;function p(S){return S===34||S===39||S===40?(e.enter(r),e.enter(u),e.consume(S),e.exit(u),d=S===40?41:S,y):a(S)}function y(S){return S===d?(e.enter(u),e.consume(S),e.exit(u),e.exit(r),i):(e.enter(c),m(S))}function m(S){return S===d?(e.exit(c),y(d)):S===null?a(S):ze(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),nt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===d||S===null||ze(S)?(e.exit("chunkString"),m(S)):(e.consume(S),S===92?x:b)}function x(S){return S===d||S===92?(e.consume(S),b):b(S)}}function su(e,i){let a;return r;function r(u){return ze(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):We(u)?nt(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const Rj={name:"definition",tokenize:Mj},_j={partial:!0,tokenize:Oj};function Mj(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Yb.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=Li(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),y):a(w)}function y(w){return bt(w)?su(e,m)(w):m(w)}function m(w){return Pb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(_j,x,x)(w)}function x(w){return We(w)?nt(e,S,"whitespace")(w):S(w)}function S(w){return w===null||ze(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function Oj(e,i,a){return r;function r(p){return bt(p)?su(e,u)(p):a(p)}function u(p){return Wb(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return We(p)?nt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||ze(p)?i(p):a(p)}}const zj={name:"hardBreakEscape",tokenize:Lj};function Lj(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return ze(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const Ij={name:"headingAtx",resolve:Uj,tokenize:Bj};function Uj(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},Kn(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function Bj(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||bt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),y(b)):b===null||ze(b)?(e.exit("atxHeading"),i(b)):We(b)?nt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function y(b){return b===35?(e.consume(b),y):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||bt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const qj=["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"],Jy=["pre","script","style","textarea"],Hj={concrete:!0,name:"htmlFlow",resolveTo:Gj,tokenize:Fj},$j={partial:!0,tokenize:Yj},Vj={partial:!0,tokenize:Pj};function Gj(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 Fj(e,i,a){const r=this;let u,c,d,p,y;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),S):C===47?(e.consume(C),c=!0,R):C===63?(e.consume(C),u=3,r.interrupt?i:O):gn(C)?(e.consume(C),d=String.fromCharCode(C),$):a(C)}function S(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,E):gn(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 E(C){const W="CDATA[";return C===W.charCodeAt(p++)?(e.consume(C),p===W.length?r.interrupt?i:ue:E):a(C)}function R(C){return gn(C)?(e.consume(C),d=String.fromCharCode(C),$):a(C)}function $(C){if(C===null||C===47||C===62||bt(C)){const W=C===47,he=d.toLowerCase();return!W&&!c&&Jy.includes(he)?(u=1,r.interrupt?i(C):ue(C)):qj.includes(d.toLowerCase())?(u=6,W?(e.consume(C),M):r.interrupt?i(C):ue(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(C):c?H(C):q(C))}return C===45||cn(C)?(e.consume(C),d+=String.fromCharCode(C),$):a(C)}function M(C){return C===62?(e.consume(C),r.interrupt?i:ue):a(C)}function H(C){return We(C)?(e.consume(C),H):U(C)}function q(C){return C===47?(e.consume(C),U):C===58||C===95||gn(C)?(e.consume(C),F):We(C)?(e.consume(C),q):U(C)}function F(C){return C===45||C===46||C===58||C===95||cn(C)?(e.consume(C),F):ie(C)}function ie(C){return C===61?(e.consume(C),D):We(C)?(e.consume(C),ie):q(C)}function D(C){return C===null||C===60||C===61||C===62||C===96?a(C):C===34||C===39?(e.consume(C),y=C,X):We(C)?(e.consume(C),D):ae(C)}function X(C){return C===y?(e.consume(C),y=null,J):C===null||ze(C)?a(C):(e.consume(C),X)}function ae(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||bt(C)?ie(C):(e.consume(C),ae)}function J(C){return C===47||C===62||We(C)?q(C):a(C)}function U(C){return C===62?(e.consume(C),te):a(C)}function te(C){return C===null||ze(C)?ue(C):We(C)?(e.consume(C),te):a(C)}function ue(C){return C===45&&u===2?(e.consume(C),G):C===60&&u===1?(e.consume(C),se):C===62&&u===4?(e.consume(C),A):C===63&&u===3?(e.consume(C),O):C===93&&u===5?(e.consume(C),Me):ze(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check($j,z,je)(C)):C===null||ze(C)?(e.exit("htmlFlowData"),je(C)):(e.consume(C),ue)}function je(C){return e.check(Vj,xe,z)(C)}function xe(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ce}function ce(C){return C===null||ze(C)?je(C):(e.enter("htmlFlowData"),ue(C))}function G(C){return C===45?(e.consume(C),O):ue(C)}function se(C){return C===47?(e.consume(C),d="",we):ue(C)}function we(C){if(C===62){const W=d.toLowerCase();return Jy.includes(W)?(e.consume(C),A):ue(C)}return gn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),we):ue(C)}function Me(C){return C===93?(e.consume(C),O):ue(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):ue(C)}function A(C){return C===null||ze(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function Pj(e,i,a){const r=this;return u;function u(d){return ze(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 Yj(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(yu,i,a)}}const Wj={name:"htmlText",tokenize:Kj};function Kj(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),y}function y(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),ie):O===63?(e.consume(O),q):gn(O)?(e.consume(O),ae):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):gn(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),S):ze(O)?(d=x,se(O)):(e.consume(O),x)}function S(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?G(O):O===45?S(O):x(O)}function E(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?R:E):a(O)}function R(O){return O===null?a(O):O===93?(e.consume(O),$):ze(O)?(d=R,se(O)):(e.consume(O),R)}function $(O){return O===93?(e.consume(O),M):R(O)}function M(O){return O===62?G(O):O===93?(e.consume(O),M):R(O)}function H(O){return O===null||O===62?G(O):ze(O)?(d=H,se(O)):(e.consume(O),H)}function q(O){return O===null?a(O):O===63?(e.consume(O),F):ze(O)?(d=q,se(O)):(e.consume(O),q)}function F(O){return O===62?G(O):q(O)}function ie(O){return gn(O)?(e.consume(O),D):a(O)}function D(O){return O===45||cn(O)?(e.consume(O),D):X(O)}function X(O){return ze(O)?(d=X,se(O)):We(O)?(e.consume(O),X):G(O)}function ae(O){return O===45||cn(O)?(e.consume(O),ae):O===47||O===62||bt(O)?J(O):a(O)}function J(O){return O===47?(e.consume(O),G):O===58||O===95||gn(O)?(e.consume(O),U):ze(O)?(d=J,se(O)):We(O)?(e.consume(O),J):G(O)}function U(O){return O===45||O===46||O===58||O===95||cn(O)?(e.consume(O),U):te(O)}function te(O){return O===61?(e.consume(O),ue):ze(O)?(d=te,se(O)):We(O)?(e.consume(O),te):J(O)}function ue(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,je):ze(O)?(d=ue,se(O)):We(O)?(e.consume(O),ue):(e.consume(O),xe)}function je(O){return O===u?(e.consume(O),u=void 0,ce):O===null?a(O):ze(O)?(d=je,se(O)):(e.consume(O),je)}function xe(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||bt(O)?J(O):(e.consume(O),xe)}function ce(O){return O===47||O===62||bt(O)?J(O):a(O)}function G(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function se(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),we}function we(O){return We(O)?nt(e,Me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):Me(O)}function Me(O){return e.enter("htmlTextData"),d(O)}}const xh={name:"labelEnd",resolveAll:Jj,resolveTo:e0,tokenize:t0},Xj={tokenize:n0},Qj={tokenize:i0},Zj={tokenize:a0};function Jj(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&Kn(e,0,e.length,a),e}function e0(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 y={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",y,i],["enter",m,i]],p=mi(p,e.slice(c+1,c+r+3)),p=mi(p,[["enter",b,i]]),p=mi(p,gd(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=mi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=mi(p,e.slice(d+1)),p=mi(p,[["exit",y,i]]),Kn(e,c,e.length,p),e}function t0(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(S){return c?c._inactive?x(S):(d=r.parser.defined.includes(Li(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(S),e.exit("labelMarker"),e.exit("labelEnd"),y):a(S)}function y(S){return S===40?e.attempt(Xj,b,d?b:x)(S):S===91?e.attempt(Qj,b,d?m:x)(S):d?b(S):x(S)}function m(S){return e.attempt(Zj,b,x)(S)}function b(S){return i(S)}function x(S){return c._balanced=!0,a(S)}}function n0(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 bt(x)?su(e,c)(x):c(x)}function c(x){return x===41?b(x):Pb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return bt(x)?su(e,y)(x):b(x)}function p(x){return a(x)}function y(x){return x===34||x===39||x===40?Wb(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return bt(x)?su(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 i0(e,i,a){const r=this;return u;function u(p){return Yb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(Li(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function a0(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 l0={name:"labelStartImage",resolveAll:xh.resolveAll,tokenize:r0};function r0(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 s0={name:"labelStartLink",resolveAll:xh.resolveAll,tokenize:o0};function o0(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 up={name:"lineEnding",tokenize:u0};function u0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),nt(e,i,"linePrefix")}}const nd={name:"thematicBreak",tokenize:c0};function c0(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"),y(m)):r>=3&&(m===null||ze(m))?(e.exit("thematicBreak"),i(m)):a(m)}function y(m){return m===u?(e.consume(m),r++,y):(e.exit("thematicBreakSequence"),We(m)?nt(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:h0},exit:g0,name:"list",tokenize:p0},d0={partial:!0,tokenize:y0},f0={partial:!0,tokenize:m0};function p0(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 E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:Vp(w)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(nd,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),y(w)}return a(w)}function y(w){return Vp(w)&&++d<10?(e.consume(w),y):(!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(yu,r.interrupt?a:b,e.attempt(d0,S,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,S(w)}function x(w){return We(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),S):a(w)}function S(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function h0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nt(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!We(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(f0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,nt(e,e.attempt(In,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function m0(e,i,a){const r=this;return nt(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 g0(e){e.exit(this.containerState.type)}function y0(e,i,a){const r=this;return nt(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!We(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const ex={name:"setextUnderline",resolveTo:x0,tokenize:b0};function x0(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 b0(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"),We(m)?nt(e,y,"lineSuffix")(m):y(m))}function y(m){return m===null||ze(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const v0={tokenize:w0};function w0(e){const i=this,a=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,u,nt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(Tj,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 k0={resolveAll:Xb()},S0=Kb("string"),j0=Kb("text");function Kb(e){return{resolveAll:Xb(e==="text"?C0: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),y}function y(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),y)}function m(b){if(b===null)return!0;const x=u[b];let S=-1;if(x)for(;++S<x.length;){const w=x[S];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Xb(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 C0(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,y;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)y=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||y||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 T0={42:In,43:In,45:In,48:In,49:In,50:In,51:In,52:In,53:In,54:In,55:In,56:In,57:In,62:$b},E0={91:Rj},A0={[-2]:op,[-1]:op,32:op},N0={35:Ij,42:nd,45:[ex,nd],60:Hj,61:ex,95:nd,96:Zy,126:Zy},D0={38:Gb,92:Vb},R0={[-5]:up,[-4]:up,[-3]:up,33:l0,38:Gb,42:Gp,60:[sj,Wj],91:s0,92:[zj,Vb],93:xh,95:Gp,96:vj},_0={null:[Gp,k0]},M0={null:[42,95]},O0={null:[]},z0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:M0,contentInitial:E0,disable:O0,document:T0,flow:N0,flowInitial:A0,insideSpan:_0,string:D0,text:R0},Symbol.toStringTag,{value:"Module"}));function L0(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 y={attempt:X(ie),check:X(D),consume:H,enter:q,exit:F,interrupt:X(D,{interrupt:!0})},m={code:null,containerState:{},defineSkip:R,events:[],now:E,parser:e,previous:null,sliceSerialize:S,sliceStream:w,write:x};let b=i.tokenize.call(m,y);return i.resolveAll&&c.push(i),m;function x(te){return d=mi(d,te),$(),d[d.length-1]!==null?[]:(ae(i,0),m.events=gd(c,m.events,m),m.events)}function S(te,ue){return U0(w(te),ue)}function w(te){return I0(d,te)}function E(){const{_bufferIndex:te,_index:ue,line:je,column:xe,offset:ce}=r;return{_bufferIndex:te,_index:ue,line:je,column:xe,offset:ce}}function R(te){u[te.line]=te.column,U()}function $(){let te;for(;r._index<d.length;){const ue=d[r._index];if(typeof ue=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<ue.length;)M(ue.charCodeAt(r._bufferIndex));else M(ue)}}function M(te){b=b(te)}function H(te){ze(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,U()):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 q(te,ue){const je=ue||{};return je.type=te,je.start=E(),m.events.push(["enter",je,m]),p.push(je),je}function F(te){const ue=p.pop();return ue.end=E(),m.events.push(["exit",ue,m]),ue}function ie(te,ue){ae(te,ue.from)}function D(te,ue){ue.restore()}function X(te,ue){return je;function je(xe,ce,G){let se,we,Me,O;return Array.isArray(xe)?z(xe):"tokenize"in xe?z([xe]):A(xe);function A(ge){return ke;function ke(oe){const Oe=oe!==null&&ge[oe],vt=oe!==null&&ge.null,St=[...Array.isArray(Oe)?Oe:Oe?[Oe]:[],...Array.isArray(vt)?vt:vt?[vt]:[]];return z(St)(oe)}}function z(ge){return se=ge,we=0,ge.length===0?G:C(ge[we])}function C(ge){return ke;function ke(oe){return O=J(),Me=ge,ge.partial||(m.currentConstruct=ge),ge.name&&m.parser.constructs.disable.null.includes(ge.name)?he():ge.tokenize.call(ue?Object.assign(Object.create(m),ue):m,y,W,he)(oe)}}function W(ge){return te(Me,O),ce}function he(ge){return O.restore(),++we<se.length?C(se[we]):G}}}function ae(te,ue){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Kn(m.events,ue,m.events.length-ue,te.resolve(m.events.slice(ue),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function J(){const te=E(),ue=m.previous,je=m.currentConstruct,xe=m.events.length,ce=Array.from(p);return{from:xe,restore:G};function G(){r=te,m.previous=ue,m.currentConstruct=je,m.events.length=xe,p=ce,U()}}function U(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function I0(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 U0(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 B0(e){const r={constructs:qb([z0,...(e||{}).extensions||[]]),content:u(ej),defined:[],document:u(nj),flow:u(v0),lazy:{},string:u(S0),text:u(j0)};return r;function u(c){return d;function d(p){return L0(r,c,p)}}}function q0(e){for(;!Fb(e););return e}const tx=/[\0\t\n\r]/g;function H0(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const y=[];let m,b,x,S,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(tx.lastIndex=x,m=tx.exec(c),S=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(S),!m){i=c.slice(x);break}if(w===10&&x===S&&r)y.push(-3),r=void 0;else switch(r&&(y.push(-5),r=void 0),x<S&&(y.push(c.slice(x,S)),e+=S-x),w){case 0:{y.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,y.push(-2);e++<b;)y.push(-1);break}case 10:{y.push(-4),e=1;break}default:r=!0,e=1}x=S+1}return p&&(r&&y.push(-5),i&&y.push(i),y.push(null)),y}}const $0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V0(e){return e.replace($0,G0)}function G0(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return Hb(a.slice(c?2:1),c?16:10)}return yh(a)||e}const Qb={}.hasOwnProperty;function F0(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),P0(a)(q0(B0(a).document().write(H0()(e,i,!0))))}function P0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(jt),autolinkProtocol:J,autolinkEmail:J,atxHeading:c(tn),blockQuote:c(vt),characterEscape:J,characterReference:J,codeFenced:c(St),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(St,d),codeText:c(yn,d),codeTextData:J,data:J,codeFlowValue:J,definition:c(Ke),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(mt),hardBreakEscape:c(xn),hardBreakTrailing:c(xn),htmlFlow:c(Ie,d),htmlFlowData:J,htmlText:c(Ie,d),htmlTextData:J,image:c(Bt),label:d,link:c(jt),listItem:c(Ii),listItemValue:S,listOrdered:c(Pt,x),listUnordered:c(Pt),paragraph:c(yi),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(tn),strong:c($l),thematicBreak:c(oa)},exit:{atxHeading:y(),atxHeadingSequence:ie,autolink:y(),autolinkEmail:Oe,autolinkProtocol:oe,blockQuote:y(),characterEscapeValue:U,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:ge,characterReference:ke,codeFenced:y($),codeFencedFence:R,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:U,codeIndented:y(M),codeText:y(ce),codeTextData:U,data:U,definition:y(),definitionDestinationString:F,definitionLabelString:H,definitionTitleString:q,emphasis:y(),hardBreakEscape:y(ue),hardBreakTrailing:y(ue),htmlFlow:y(je),htmlFlowData:U,htmlText:y(xe),htmlTextData:U,image:y(se),label:Me,labelText:we,lineEnding:te,link:y(G),listItem:y(),listOrdered:y(),listUnordered:y(),paragraph:y(),referenceString:W,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:y(ae),setextHeadingLineSequence:X,setextHeadingText:D,strong:y(),thematicBreak:y()}};Zb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(ne){let de={type:"root",children:[]};const Ne={stack:[de],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},qe=[];let Xe=-1;for(;++Xe<ne.length;)if(ne[Xe][1].type==="listOrdered"||ne[Xe][1].type==="listUnordered")if(ne[Xe][0]==="enter")qe.push(Xe);else{const Yt=qe.pop();Xe=u(ne,Yt,Xe)}for(Xe=-1;++Xe<ne.length;){const Yt=i[ne[Xe][0]];Qb.call(Yt,ne[Xe][1].type)&&Yt[ne[Xe][1].type].call(Object.assign({sliceSerialize:ne[Xe][2].sliceSerialize},Ne),ne[Xe][1])}if(Ne.tokenStack.length>0){const Yt=Ne.tokenStack[Ne.tokenStack.length-1];(Yt[1]||nx).call(Ne,void 0,Yt[0])}for(de.position={start:zl(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:zl(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)de=i.transforms[Xe](de)||de;return de}function u(ne,de,Ne){let qe=de-1,Xe=-1,Yt=!1,Qn,Xt,At,Qt;for(;++qe<=Ne;){const st=ne[qe];switch(st[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{st[0]==="enter"?Xe++:Xe--,Qt=void 0;break}case"lineEndingBlank":{st[0]==="enter"&&(Qn&&!Qt&&!Xe&&!At&&(At=qe),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=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(Qn){let Nt=qe;for(Xt=void 0;Nt--;){const bn=ne[Nt];if(bn[1].type==="lineEnding"||bn[1].type==="lineEndingBlank"){if(bn[0]==="exit")continue;Xt&&(ne[Xt][1].type="lineEndingBlank",Yt=!0),bn[1].type="lineEnding",Xt=Nt}else if(!(bn[1].type==="linePrefix"||bn[1].type==="blockQuotePrefix"||bn[1].type==="blockQuotePrefixWhitespace"||bn[1].type==="blockQuoteMarker"||bn[1].type==="listItemIndent"))break}At&&(!Xt||At<Xt)&&(Qn._spread=!0),Qn.end=Object.assign({},Xt?ne[Xt][1].start:st[1].end),ne.splice(Xt||qe,0,["exit",Qn,st[2]]),qe++,Ne++}if(st[1].type==="listItemPrefix"){const Nt={type:"listItem",_spread:!1,start:Object.assign({},st[1].start),end:void 0};Qn=Nt,ne.splice(qe,0,["enter",Nt,st[2]]),qe++,Ne++,At=void 0,Qt=!0}}}return ne[de][1]._spread=Yt,Ne}function c(ne,de){return Ne;function Ne(qe){p.call(this,ne(qe),qe),de&&de.call(this,qe)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ne,de,Ne){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Ne||void 0]),ne.position={start:zl(de.start),end:void 0}}function y(ne){return de;function de(Ne){ne&&ne.call(this,Ne),m.call(this,Ne)}}function m(ne,de){const Ne=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==ne.type&&(de?de.call(this,ne,qe[0]):(qe[1]||nx).call(this,ne,qe[0]));else throw new Error("Cannot close `"+ne.type+"` ("+ru({start:ne.start,end:ne.end})+"): it’s not open");Ne.position.end=zl(ne.end)}function b(){return gh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function S(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function E(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function R(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function $(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function H(ne){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=de,Ne.identifier=Li(this.sliceSerialize(ne)).toLowerCase()}function q(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function F(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function ie(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Ne=this.sliceSerialize(ne).length;de.depth=Ne}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function X(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function J(ne){const Ne=this.stack[this.stack.length-1].children;let qe=Ne[Ne.length-1];(!qe||qe.type!=="text")&&(qe=Ct(),qe.position={start:zl(ne.start),end:void 0},Ne.push(qe)),this.stack.push(qe)}function U(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=zl(ne.end)}function te(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=de.children[de.children.length-1];Ne.position.end=zl(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(de.type)&&(J.call(this,ne),U.call(this,ne))}function ue(){this.data.atHardBreak=!0}function je(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function xe(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function ce(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function G(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function se(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function we(ne){const de=this.sliceSerialize(ne),Ne=this.stack[this.stack.length-2];Ne.label=V0(de),Ne.identifier=Li(de).toLowerCase()}function Me(){const ne=this.stack[this.stack.length-1],de=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const qe=ne.children;Ne.children=qe}else Ne.alt=de}function O(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function A(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function W(ne){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=de,Ne.identifier=Li(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function he(ne){this.data.characterReferenceType=ne.type}function ge(ne){const de=this.sliceSerialize(ne),Ne=this.data.characterReferenceType;let qe;Ne?(qe=Hb(de,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=yh(de);const Xe=this.stack[this.stack.length-1];Xe.value+=qe}function ke(ne){const de=this.stack.pop();de.position.end=zl(ne.end)}function oe(ne){U.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function Oe(ne){U.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function vt(){return{type:"blockquote",children:[]}}function St(){return{type:"code",lang:null,meta:null,value:""}}function yn(){return{type:"inlineCode",value:""}}function Ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function mt(){return{type:"emphasis",children:[]}}function tn(){return{type:"heading",depth:0,children:[]}}function xn(){return{type:"break"}}function Ie(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function jt(){return{type:"link",title:null,url:"",children:[]}}function Pt(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function Ii(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function yi(){return{type:"paragraph",children:[]}}function $l(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function oa(){return{type:"thematicBreak"}}}function zl(e){return{line:e.line,column:e.column,offset:e.offset}}function Zb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?Zb(e,r):Y0(e,r)}}function Y0(e,i){let a;for(a in i)if(Qb.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 nx(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+ru({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+ru({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+ru({start:i.start,end:i.end})+") is still open")}function W0(e){const i=this;i.parser=a;function a(r){return F0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function K0(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 X0(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
54
+ `}]}function Q0(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 Z0(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function J0(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function e1(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=Bs(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 y={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,y);const m={type:"element",tagName:"sup",properties:{},children:[y]};return e.patch(i,m),e.applyData(i,m)}function t1(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 n1(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Jb(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 i1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Jb(e,i);const u={src:Bs(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 a1(e,i){const a={src:Bs(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 l1(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 r1(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Jb(e,i);const u={href:Bs(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 s1(e,i){const a={href:Bs(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 o1(e,i,a){const r=e.all(i),u=a?u1(a):ev(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 y=r[r.length-1];y&&(u||y.type!=="element"||y.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 u1(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=ev(a[r])}return i}function ev(e){const i=e.spread;return i??e.children.length>1}function c1(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 d1(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function f1(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function p1(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function h1(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=fh(i.children[1]),y=Mb(i.children[i.children.length-1]);p&&y&&(d.position={start:p,end:y}),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 m1(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 y=-1;const m=[];for(;++y<p;){const x=i.children[y],S={},w=d?d[y]:void 0;w&&(S.align=w);let E={type:"element",tagName:c,properties:S,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function g1(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const ix=9,ax=32;function y1(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(lx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(lx(i.slice(u),u>0,!1)),c.join("")}function lx(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===ix||c===ax;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===ix||c===ax;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function x1(e,i){const a={type:"text",value:y1(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function b1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const v1={blockquote:K0,break:X0,code:Q0,delete:Z0,emphasis:J0,footnoteReference:e1,heading:t1,html:n1,imageReference:i1,image:a1,inlineCode:l1,linkReference:r1,link:s1,listItem:o1,list:c1,paragraph:d1,root:f1,strong:p1,table:h1,tableCell:g1,tableRow:m1,text:x1,thematicBreak:b1,toml:Vc,yaml:Vc,definition:Vc,footnoteDefinition:Vc};function Vc(){}const tv=-1,yd=0,ou=1,od=2,bh=3,vh=4,wh=5,kh=6,nv=7,iv=8,w1=typeof self=="object"?self:globalThis,rx=(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 w1[e](i)},k1=(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 yd:case tv:return a(d,u);case ou:{const p=a([],u);for(const y of d)p.push(r(y));return p}case od:{const p=a({},u);for(const[y,m]of d)p[r(y)]=r(m);return p}case bh:return a(new Date(d),u);case vh:{const{source:p,flags:y}=d;return a(new RegExp(p,y),u)}case wh:{const p=a(new Map,u);for(const[y,m]of d)p.set(r(y),r(m));return p}case kh:{const p=a(new Set,u);for(const y of d)p.add(r(y));return p}case nv:{const{name:p,message:y}=d;return a(rx(p,y),u)}case iv: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(rx(c,d),u)};return r},sx=e=>k1(new Map,e)(0),Cr="",{toString:S1}={},{keys:j1}=Object,Xo=e=>{const i=typeof e;if(i!=="object"||!e)return[yd,i];const a=S1.call(e).slice(8,-1);switch(a){case"Array":return[ou,Cr];case"Object":return[od,Cr];case"Date":return[bh,Cr];case"RegExp":return[vh,Cr];case"Map":return[wh,Cr];case"Set":return[kh,Cr];case"DataView":return[ou,a]}return a.includes("Array")?[ou,a]:a.includes("Error")?[nv,a]:[od,a]},Gc=([e,i])=>e===yd&&(i==="function"||i==="symbol"),C1=(e,i,a,r)=>{const u=(d,p)=>{const y=r.push(d)-1;return a.set(p,y),y},c=d=>{if(a.has(d))return a.get(d);let[p,y]=Xo(d);switch(p){case yd:{let b=d;switch(y){case"bigint":p=iv,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+y);b=null;break;case"undefined":return u([tv],d)}return u([p,b],d)}case ou:{if(y){let S=d;return y==="DataView"?S=new Uint8Array(d.buffer):y==="ArrayBuffer"&&(S=new Uint8Array(d)),u([y,[...S]],d)}const b=[],x=u([p,b],d);for(const S of d)b.push(c(S));return x}case od:{if(y)switch(y){case"BigInt":return u([y,d.toString()],d);case"Boolean":case"Number":case"String":return u([y,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const S of j1(d))(e||!Gc(Xo(d[S])))&&b.push([c(S),c(d[S])]);return x}case bh:return u([p,isNaN(d.getTime())?Cr:d.toISOString()],d);case vh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case wh:{const b=[],x=u([p,b],d);for(const[S,w]of d)(e||!(Gc(Xo(S))||Gc(Xo(w))))&&b.push([c(S),c(w)]);return x}case kh:{const b=[],x=u([p,b],d);for(const S of d)(e||!Gc(Xo(S)))&&b.push(c(S));return x}}const{message:m}=d;return u([p,{name:y,message:m}],d)};return c},ox=(e,{json:i,lossy:a}={})=>{const r=[];return C1(!(i||a),!!i,new Map,r)(e),r},ud=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?sx(ox(e,i)):structuredClone(e):(e,i)=>sx(ox(e,i));function T1(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 E1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function A1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||T1,r=e.options.footnoteBackLabel||E1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let y=-1;for(;++y<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[y]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),S=Bs(x.toLowerCase());let w=0;const E=[],R=e.footnoteCounts.get(x);for(;R!==void 0&&++w<=R;){E.length>0&&E.push({type:"text",value:" "});let H=typeof a=="string"?a:a(y,w);typeof H=="string"&&(H={type:"text",value:H}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(y,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const $=b[b.length-1];if($&&$.type==="element"&&$.tagName==="p"){const H=$.children[$.children.length-1];H&&H.type==="text"?H.value+=" ":$.children.push({type:"text",value:" "}),$.children.push(...E)}else b.push(...E);const M={type:"element",tagName:"li",properties:{id:i+"fn-"+S},children:e.wrap(b,!0)};e.patch(m,M),p.push(M)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...ud(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 xd=(function(e){if(e==null)return _1;if(typeof e=="function")return bd(e);if(typeof e=="object")return Array.isArray(e)?N1(e):D1(e);if(typeof e=="string")return R1(e);throw new Error("Expected function, string, or object as test")});function N1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=xd(e[a]);return bd(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function D1(e){const i=e;return bd(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function R1(e){return bd(i);function i(a){return a&&a.type===e}}function bd(e){return i;function i(a,r,u){return!!(M1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function _1(){return!0}function M1(e){return e!==null&&typeof e=="object"&&"type"in e}const av=[],O1=!0,Fp=!1,z1="skip";function lv(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=xd(u),d=r?-1:1;p(e,void 0,[])();function p(y,m,b){const x=y&&typeof y=="object"?y:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(y.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=av,E,R,$;if((!i||c(y,m,b[b.length-1]||void 0))&&(w=L1(a(y,b)),w[0]===Fp))return w;if("children"in y&&y.children){const M=y;if(M.children&&w[0]!==z1)for(R=(r?M.children.length:-1)+d,$=b.concat(M);R>-1&&R<M.children.length;){const H=M.children[R];if(E=p(H,R,$)(),E[0]===Fp)return E;R=typeof E[1]=="number"?E[1]:R+d}}return w}}}function L1(e){return Array.isArray(e)?e:typeof e=="number"?[O1,e]:e==null?av:[e]}function Sh(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),lv(e,c,p,u);function p(y,m){const b=m[m.length-1],x=b?b.children.indexOf(y):void 0;return d(y,x,b)}}const Pp={}.hasOwnProperty,I1={};function U1(e,i){const a=i||I1,r=new Map,u=new Map,c=new Map,d={...v1,...a.handlers},p={all:m,applyData:q1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:y,options:a,patch:B1,wrap:$1};return Sh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,S=String(b.identifier).toUpperCase();x.has(S)||x.set(S,b)}}),p;function y(b,x){const S=b.type,w=p.handlers[S];if(Pp.call(p.handlers,S)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(S)){if("children"in b){const{children:R,...$}=b,M=ud($);return M.children=p.all(b),M}return ud(b)}return(p.options.unknownHandler||H1)(p,b,x)}function m(b){const x=[];if("children"in b){const S=b.children;let w=-1;for(;++w<S.length;){const E=p.one(S[w],b);if(E){if(w&&S[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=ux(E.value)),!Array.isArray(E)&&E.type==="element")){const R=E.children[0];R&&R.type==="text"&&(R.value=ux(R.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function B1(e,i){e.position&&(i.position=TS(e))}function q1(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,ud(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function H1(e,i){const a=i.data||{},r="value"in i&&!(Pp.call(a,"hProperties")||Pp.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 $1(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 ux(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function cx(e,i){const a=U1(e,i),r=a.one(e,void 0),u=A1(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 V1(e,i){return e&&"run"in e?async function(a,r){const u=cx(a,{file:r,...i});await e.run(u,r)}:function(a,r){return cx(a,{file:r,...e||i})}}function dx(e){if(e)throw e}var cp,fx;function G1(){if(fx)return cp;fx=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 S;for(S in m);return typeof S>"u"||e.call(m,S)},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 cp=function y(){var m,b,x,S,w,E,R=arguments[0],$=1,M=arguments.length,H=!1;for(typeof R=="boolean"&&(H=R,R=arguments[1]||{},$=2),(R==null||typeof R!="object"&&typeof R!="function")&&(R={});$<M;++$)if(m=arguments[$],m!=null)for(b in m)x=p(R,b),S=p(m,b),R!==S&&(H&&S&&(c(S)||(w=u(S)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(R,{name:b,newValue:y(H,E,S)})):typeof S<"u"&&d(R,{name:b,newValue:S}));return R},cp}var F1=G1();const dp=Cb(F1);function Yp(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 P1(){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(y,...m){const b=e[++c];let x=-1;if(y){d(y);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?Y1(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 Y1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let y;p&&d.push(u);try{y=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(y&&y.then&&typeof y.then=="function"?y.then(c,u):y instanceof Error?u(y):c(y))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const aa={basename:W1,dirname:K1,extname:X1,join:Q1,sep:"/"};function W1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');xu(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 K1(e){if(xu(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 X1(e){xu(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 Q1(...e){let i=-1,a;for(;++i<e.length;)xu(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":Z1(a)}function Z1(e){xu(e);const i=e.codePointAt(0)===47;let a=J1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function J1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,y;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(y=a.lastIndexOf("/"),y!==a.length-1){y<0?(a="",r=0):(a=a.slice(0,y),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 xu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const eC={cwd:tC};function tC(){return"/"}function Wp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nC(e){if(typeof e=="string")e=new URL(e);else if(!Wp(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 iC(e)}function iC(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 fp=["history","path","basename","stem","extname","dirname"];class rv{constructor(i){let a;i?Wp(i)?a={path:i}:typeof i=="string"||aC(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":eC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<fp.length;){const c=fp[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)fp.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?aa.basename(this.path):void 0}set basename(i){hp(i,"basename"),pp(i,"basename"),this.path=aa.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?aa.dirname(this.path):void 0}set dirname(i){px(this.basename,"dirname"),this.path=aa.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?aa.extname(this.path):void 0}set extname(i){if(pp(i,"extname"),px(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=aa.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Wp(i)&&(i=nC(i)),hp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?aa.basename(this.path,this.extname):void 0}set stem(i){hp(i,"stem"),pp(i,"stem"),this.path=aa.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 dn(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 pp(e,i){if(e&&e.includes(aa.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+aa.sep+"`")}function hp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function px(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function aC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lC=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),rC={}.hasOwnProperty;class jh extends lC{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=P1()}copy(){const i=new jh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(dp(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(yp("data",this.frozen),this.namespace[i]=a,this):rC.call(this.namespace,i)&&this.namespace[i]||void 0:i?(yp("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=Fc(i),r=this.parser||this.Parser;return mp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),mp("process",this.parser||this.Parser),gp("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=Fc(i),y=r.parse(p);r.run(y,p,function(b,x,S){if(b||!x||!S)return m(b);const w=x,E=r.stringify(w,S);uC(E)?S.value=E:S.result=E,m(b,S)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),mp("processSync",this.parser||this.Parser),gp("processSync",this.compiler||this.Compiler),this.process(i,u),mx("processSync","process",a),r;function u(c,d){a=!0,dx(c),r=d}}run(i,a,r){hx(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 y=Fc(a);u.run(i,y,m);function m(b,x,S){const w=x||i;b?p(b):d?d(w):r(void 0,w,S)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),mx("runSync","run",r),u;function c(d,p){dx(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=Fc(a),u=this.compiler||this.Compiler;return gp("stringify",u),hx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(yp("use",this.frozen),i!=null)if(typeof i=="function")y(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")y(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;y(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=dp(!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 y(m,b){let x=-1,S=-1;for(;++x<r.length;)if(r[x][0]===m){S=x;break}if(S===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const R=r[S][1];Yp(R)&&Yp(w)&&(w=dp(!0,R,w)),r[S]=[m,w,...E]}}}}const sC=new jh().freeze();function mp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function yp(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 hx(e){if(!Yp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function mx(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Fc(e){return oC(e)?e:new rv(e)}function oC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uC(e){return typeof e=="string"||cC(e)}function cC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const dC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gx=[],yx={allowDangerousHtml:!0},fC=/^(https?|ircs?|mailto|xmpp)$/i,pC=[{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 hC(e){const i=mC(e),a=gC(e);return yC(i.runSync(i.parse(a),a),e)}function mC(e){const i=e.rehypePlugins||gx,a=e.remarkPlugins||gx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yx}:yx;return sC().use(W0).use(a).use(V1,r).use(i)}function gC(e){const i=e.children||"",a=new rv;return typeof i=="string"&&(a.value=i),a}function yC(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,y=i.urlTransform||xC;for(const b of pC)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+dC+b.id,void 0);return Sh(e,m),RS(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,S){if(b.type==="raw"&&S&&typeof x=="number")return d?S.children.splice(x,1):S.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in sp)if(Object.hasOwn(sp,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],R=sp[w];(R===null||R.includes(b.tagName))&&(b.properties[w]=y(String(E||""),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,S)),w&&S&&typeof x=="number")return p&&b.children?S.children.splice(x,1,...b.children):S.children.splice(x,1),x}}}function xC(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||fC.test(e.slice(0,i))?e:""}function xx(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 bC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function vC(e,i,a){const u=xd((a||{}).ignore||[]),c=wC(i);let d=-1;for(;++d<c.length;)lv(e,"text",p);function p(m,b){let x=-1,S;for(;++x<b.length;){const w=b[x],E=S?S.children:void 0;if(u(w,E?E.indexOf(w):void 0,S))return;S=w}if(S)return y(m,b)}function y(m,b){const x=b[b.length-1],S=c[d][0],w=c[d][1];let E=0;const $=x.children.indexOf(m);let M=!1,H=[];S.lastIndex=0;let q=S.exec(m.value);for(;q;){const F=q.index,ie={index:q.index,input:q.input,stack:[...b,m]};let D=w(...q,ie);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?S.lastIndex=F+1:(E!==F&&H.push({type:"text",value:m.value.slice(E,F)}),Array.isArray(D)?H.push(...D):D&&H.push(D),E=F+q[0].length,M=!0),!S.global)break;q=S.exec(m.value)}return M?(E<m.value.length&&H.push({type:"text",value:m.value.slice(E)}),x.children.splice($,1,...H)):H=[m],$+H.length}}function wC(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([kC(u[0]),SC(u[1])])}return i}function kC(e){return typeof e=="string"?new RegExp(bC(e),"g"):e}function SC(e){return typeof e=="function"?e:function(){return e}}const xp="phrasing",bp=["autolink","link","image","label"];function jC(){return{transforms:[RC],enter:{literalAutolink:TC,literalAutolinkEmail:vp,literalAutolinkHttp:vp,literalAutolinkWww:vp},exit:{literalAutolink:DC,literalAutolinkEmail:NC,literalAutolinkHttp:EC,literalAutolinkWww:AC}}}function CC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:bp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:xp,notInConstruct:bp},{character:":",before:"[ps]",after:"\\/",inConstruct:xp,notInConstruct:bp}]}}function TC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vp(e){this.config.enter.autolinkProtocol.call(this,e)}function EC(e){this.config.exit.autolinkProtocol.call(this,e)}function AC(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 NC(e){this.config.exit.autolinkEmail.call(this,e)}function DC(e){this.exit(e)}function RC(e){vC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_C],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),MC]],{ignore:["link","linkReference"]})}function _C(e,i,a,r,u){let c="";if(!sv(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!OC(a)))return!1;const d=zC(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 MC(e,i,a,r){return!sv(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function OC(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 zC(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=xx(e,"(");let c=xx(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 sv(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Dr(a)||md(a))&&(!i||a!==47)}ov.peek=GC;function LC(){this.buffer()}function IC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function UC(){this.buffer()}function BC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function qC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Li(this.sliceSerialize(e)).toLowerCase(),a.label=i}function HC(e){this.exit(e)}function $C(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Li(this.sliceSerialize(e)).toLowerCase(),a.label=i}function VC(e){this.exit(e)}function GC(){return"["}function ov(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 FC(){return{enter:{gfmFootnoteCallString:LC,gfmFootnoteCall:IC,gfmFootnoteDefinitionLabelString:UC,gfmFootnoteDefinition:BC},exit:{gfmFootnoteCallString:qC,gfmFootnoteCall:HC,gfmFootnoteDefinitionLabelString:$C,gfmFootnoteDefinition:VC}}}function PC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:ov},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let y=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return y+=p.move(c.safe(c.associationId(r),{before:y,after:"]"})),b(),y+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),y+=p.move((i?`
64
+ `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?uv:YC))),m(),y}}function YC(e,i,a){return i===0?e:uv(e,i,a)}function uv(e,i,a){return(a?"":" ")+e}const WC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];cv.peek=JC;function KC(){return{canContainEols:["delete"],enter:{strikethrough:QC},exit:{strikethrough:ZC}}}function XC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WC}],handlers:{delete:cv}}}function QC(e){this.enter({type:"delete",children:[]},e)}function ZC(e){this.exit(e)}function cv(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 JC(){return"~"}function eT(e){return e.length}function tT(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||eT,c=[],d=[],p=[],y=[];let m=0,b=-1;for(;++b<e.length;){const R=[],$=[];let M=-1;for(e[b].length>m&&(m=e[b].length);++M<e[b].length;){const H=nT(e[b][M]);if(a.alignDelimiters!==!1){const q=u(H);$[M]=q,(y[M]===void 0||q>y[M])&&(y[M]=q)}R.push(H)}d[b]=R,p[b]=$}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=bx(r[x]);else{const R=bx(r);for(;++x<m;)c[x]=R}x=-1;const S=[],w=[];for(;++x<m;){const R=c[x];let $="",M="";R===99?($=":",M=":"):R===108?$=":":R===114&&(M=":");let H=a.alignDelimiters===!1?1:Math.max(1,y[x]-$.length-M.length);const q=$+"-".repeat(H)+M;a.alignDelimiters!==!1&&(H=$.length+H+M.length,H>y[x]&&(y[x]=H),w[x]=H),S[x]=q}d.splice(1,0,S),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const R=d[b],$=p[b];x=-1;const M=[];for(;++x<m;){const H=R[x]||"";let q="",F="";if(a.alignDelimiters!==!1){const ie=y[x]-($[x]||0),D=c[x];D===114?q=" ".repeat(ie):D===99?ie%2?(q=" ".repeat(ie/2+.5),F=" ".repeat(ie/2-.5)):(q=" ".repeat(ie/2),F=q):F=" ".repeat(ie)}a.delimiterStart!==!1&&!x&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&H==="")&&(a.delimiterStart!==!1||x)&&M.push(" "),a.alignDelimiters!==!1&&M.push(q),M.push(H),a.alignDelimiters!==!1&&M.push(F),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&M.push("|")}E.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return E.join(`
65
+ `)}function nT(e){return e==null?"":String(e)}function bx(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 iT(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()),aT);return u(),d}function aT(e,i,a){return">"+(a?"":" ")+e}function lT(e,i){return vx(e,i.inConstruct,!0)&&!vx(e,i.notInConstruct,!1)}function vx(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 wx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
66
+ `&&lT(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
+ `}function rT(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 sT(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 oT(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 uT(e,i,a,r){const u=oT(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(sT(e,a)){const x=a.enter("codeIndented"),S=a.indentLines(c,cT);return x(),S}const p=a.createTracker(r),y=u.repeat(Math.max(rT(c,u)+1,3)),m=a.enter("codeFenced");let b=p.move(y);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(y),m(),b}function cT(e,i,a){return(a?"":" ")+e}function Ch(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 dT(e,i,a,r){const u=Ch(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const y=a.createTracker(r);let m=y.move("[");return m+=y.move(a.safe(a.associationId(e),{before:m,after:"]",...y.current()})),m+=y.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=y.move("<"),m+=y.move(a.safe(e.url,{before:m,after:">",...y.current()})),m+=y.move(">")):(p=a.enter("destinationRaw"),m+=y.move(a.safe(e.url,{before:m,after:e.title?" ":`
71
+ `,...y.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=y.move(" "+u),m+=y.move(a.safe(e.title,{before:m,after:u,...y.current()})),m+=y.move(u),p()),d(),m}function fT(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 mu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function cd(e,i,a){const r=Ls(e),u=Ls(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}}dv.peek=pT;function dv(e,i,a,r){const u=fT(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let y=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=y.charCodeAt(0),b=cd(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(y=mu(m)+y.slice(1));const x=y.charCodeAt(y.length-1),S=cd(r.after.charCodeAt(0),x,u);S.inside&&(y=y.slice(0,-1)+mu(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+y+w}function pT(e,i,a){return a.options.emphasis||"*"}function hT(e,i){let a=!1;return Sh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Fp}),!!((!e.depth||e.depth<3)&&gh(e)&&(i.options.setext||a))}function mT(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(hT(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),S=a.containerPhrasing(e,{...c.current(),before:`
72
+ `,after:`
73
+ `});return x(),b(),S+`
74
+ `+(u===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
75
+ `))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),y=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
76
+ `,...c.current()});return/^[\t ]/.test(m)&&(m=mu(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),y(),p(),m}fv.peek=gT;function fv(e){return e.value||""}function gT(){return"<"}pv.peek=yT;function pv(e,i,a,r){const u=Ch(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const y=a.createTracker(r);let m=y.move("![");return m+=y.move(a.safe(e.alt,{before:m,after:"]",...y.current()})),m+=y.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=y.move("<"),m+=y.move(a.safe(e.url,{before:m,after:">",...y.current()})),m+=y.move(">")):(p=a.enter("destinationRaw"),m+=y.move(a.safe(e.url,{before:m,after:e.title?" ":")",...y.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=y.move(" "+u),m+=y.move(a.safe(e.title,{before:m,after:u,...y.current()})),m+=y.move(u),p()),m+=y.move(")"),d(),m}function yT(){return"!"}hv.peek=xT;function hv(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let y=p.move("![");const m=a.safe(e.alt,{before:y,after:"]",...p.current()});y+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:y,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?y+=p.move(x+"]"):u==="shortcut"?y=y.slice(0,-1):y+=p.move("]"),y}function xT(){return"!"}mv.peek=bT;function mv(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 y;if(d.atBreak)for(;y=p.exec(r);){let m=y.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(y.index+1)}}return u+r+u}function bT(){return"`"}function gv(e,i){const a=gh(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))}yv.peek=vT;function yv(e,i,a,r){const u=Ch(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,y;if(gv(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"),y=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),y(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(y=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(y=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),y(),e.title&&(y=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),y()),m+=d.move(")"),p(),m}function vT(e,i,a){return gv(e,a)?"<":"["}xv.peek=wT;function xv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let y=p.move("[");const m=a.containerPhrasing(e,{before:y,after:"]",...p.current()});y+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:y,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?y+=p.move(x+"]"):u==="shortcut"?y=y.slice(0,-1):y+=p.move("]"),y}function wT(){return"["}function Th(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 kT(e){const i=Th(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 ST(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 bv(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 jT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?ST(a):Th(a);const p=e.ordered?d==="."?")":".":kT(a);let y=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&&(y=!0),bv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const S=e.children[x];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){y=!0;break}}}}y&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function CT(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 TT(e,i,a,r){const u=CT(a);let c=a.bulletCurrent||Th(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 y=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return y(),m;function b(x,S,w){return S?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function ET(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const AT=xd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function NT(e,i,a,r){return(e.children.some(function(d){return AT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function DT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}vv.peek=RT;function vv(e,i,a,r){const u=DT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let y=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=y.charCodeAt(0),b=cd(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(y=mu(m)+y.slice(1));const x=y.charCodeAt(y.length-1),S=cd(r.after.charCodeAt(0),x,u);S.inside&&(y=y.slice(0,-1)+mu(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:S.outside,before:b.outside},p+y+w}function RT(e,i,a){return a.options.strong||"*"}function _T(e,i,a,r){return a.safe(e.value,r)}function MT(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 OT(e,i,a){const r=(bv(a)+(a.options.ruleSpaces?" ":"")).repeat(MT(a));return a.options.ruleSpaces?r.slice(0,-1):r}const wv={blockquote:iT,break:wx,code:uT,definition:dT,emphasis:dv,hardBreak:wx,heading:mT,html:fv,image:pv,imageReference:hv,inlineCode:mv,link:yv,linkReference:xv,list:jT,listItem:TT,paragraph:ET,root:NT,strong:vv,text:_T,thematicBreak:OT};function zT(){return{enter:{table:LT,tableData:kx,tableHeader:kx,tableRow:UT},exit:{codeText:BT,table:IT,tableData:wp,tableHeader:wp,tableRow:wp}}}function LT(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 IT(e){this.exit(e),this.data.inTable=void 0}function UT(e){this.enter({type:"tableRow",children:[]},e)}function wp(e){this.exit(e)}function kx(e){this.enter({type:"tableCell",children:[]},e)}function BT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,qT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function qT(e,i){return i==="|"?i:e}function HT(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:S,table:d,tableCell:y,tableRow:p}};function d(w,E,R,$){return m(b(w,R,$),w.align)}function p(w,E,R,$){const M=x(w,R,$),H=m([M]);return H.slice(0,H.indexOf(`
78
+ `))}function y(w,E,R,$){const M=R.enter("tableCell"),H=R.enter("phrasing"),q=R.containerPhrasing(w,{...$,before:c,after:c});return H(),M(),q}function m(w,E){return tT(w,{align:E,alignDelimiters:r,padding:a,stringLength:u})}function b(w,E,R){const $=w.children;let M=-1;const H=[],q=E.enter("table");for(;++M<$.length;)H[M]=x($[M],E,R);return q(),H}function x(w,E,R){const $=w.children;let M=-1;const H=[],q=E.enter("tableRow");for(;++M<$.length;)H[M]=y($[M],w,E,R);return q(),H}function S(w,E,R){let $=wv.inlineCode(w,E,R);return R.stack.includes("tableCell")&&($=$.replace(/\|/g,"\\$&")),$}}function $T(){return{exit:{taskListCheckValueChecked:Sx,taskListCheckValueUnchecked:Sx,paragraph:GT}}}function VT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:FT}}}function Sx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function GT(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 FT(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 y=wv.listItem(e,i,a,{...r,...p.current()});return c&&(y=y.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),y;function m(b){return b+d}}function PT(){return[jC(),FC(),KC(),zT(),$T()]}function YT(e){return{extensions:[CC(),PC(e),XC(),HT(e),VT()]}}const WT={tokenize:eE,partial:!0},kv={tokenize:tE,partial:!0},Sv={tokenize:nE,partial:!0},jv={tokenize:iE,partial:!0},KT={tokenize:aE,partial:!0},Cv={name:"wwwAutolink",tokenize:ZT,previous:Ev},Tv={name:"protocolAutolink",tokenize:JT,previous:Av},$a={name:"emailAutolink",tokenize:QT,previous:Nv},sa={};function XT(){return{text:sa}}let Sr=48;for(;Sr<123;)sa[Sr]=$a,Sr++,Sr===58?Sr=65:Sr===91&&(Sr=97);sa[43]=$a;sa[45]=$a;sa[46]=$a;sa[95]=$a;sa[72]=[$a,Tv];sa[104]=[$a,Tv];sa[87]=[$a,Cv];sa[119]=[$a,Cv];function QT(e,i,a){const r=this;let u,c;return d;function d(x){return!Kp(x)||!Nv.call(r,r.previous)||Eh(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Kp(x)?(e.consume(x),p):x===64?(e.consume(x),y):a(x)}function y(x){return x===46?e.check(KT,b,m)(x):x===45||x===95||cn(x)?(c=!0,e.consume(x),y):b(x)}function m(x){return e.consume(x),u=!0,y}function b(x){return c&&u&&gn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function ZT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!Ev.call(r,r.previous)||Eh(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WT,e.attempt(kv,e.attempt(Sv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function JT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&Av.call(r,r.previous)&&!Eh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(gn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const S=u.toLowerCase();if(S==="http"||S==="https")return e.consume(x),y}return a(x)}function y(x){return x===47?(e.consume(x),c?m:(c=!0,y)):a(x)}function m(x){return x===null||sd(x)||bt(x)||Dr(x)||md(x)?a(x):e.attempt(kv,e.attempt(Sv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function eE(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 tE(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(jv,y,p)(m):m===null||bt(m)||Dr(m)||m!==45&&md(m)?y(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 y(m){return u||r||!c?a(m):i(m)}}function nE(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(jv,i,c)(d):d===null||bt(d)||Dr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function iE(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||bt(p)||Dr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||bt(p)||Dr(p)?i(p):r(p)}function c(p){return gn(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):gn(p)?(e.consume(p),d):a(p)}}function aE(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return cn(c)?a(c):i(c)}}function Ev(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||bt(e)}function Av(e){return!gn(e)}function Nv(e){return!(e===47||Kp(e))}function Kp(e){return e===43||e===45||e===46||e===95||cn(e)}function Eh(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 lE={tokenize:pE,partial:!0};function rE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cE,continuation:{tokenize:dE},exit:fE}},text:{91:{name:"gfmFootnoteCall",tokenize:uE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sE,resolveTo:oE}}}}function sE(e,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const y=r.events[u][1];if(y.type==="labelImage"){d=y;break}if(y.type==="gfmFootnoteCall"||y.type==="labelLink"||y.type==="label"||y.type==="image"||y.type==="link")break}return p;function p(y){if(!d||!d._balanced)return a(y);const m=Li(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(y):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),i(y))}}function oE(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 uE(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"),y}function y(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||bt(x))return a(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteCallString");return u.includes(Li(r.sliceSerialize(S)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return bt(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 cE(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return y;function y(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||bt(E))return a(E);if(E===93){e.exit("chunkString");const R=e.exit("gfmFootnoteDefinitionLabelString");return c=Li(r.sliceSerialize(R)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),S}return bt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function S(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),nt(e,w,"gfmFootnoteDefinitionWhitespace")):a(E)}function w(E){return i(E)}}function dE(e,i,a){return e.check(yu,i,e.attempt(lE,i,a))}function fE(e){e.exit("gfmFootnoteDefinition")}function pE(e,i,a){const r=this;return nt(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 hE(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 y=-1;for(;++y<d.length;)if(d[y][0]==="enter"&&d[y][1].type==="strikethroughSequenceTemporary"&&d[y][1]._close){let m=y;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[y][1].end.offset-d[y][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[y][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[y][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[y][1].start)},S=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Kn(S,S.length,0,gd(w,d.slice(m+1,y),p)),Kn(S,S.length,0,[["exit",x,p],["enter",d[y][1],p],["exit",d[y][1],p],["exit",b,p]]),Kn(d,m-1,y-m+3,S),y=m+S.length-2;break}}for(y=-1;++y<d.length;)d[y][1].type==="strikethroughSequenceTemporary"&&(d[y][1].type="data");return d}function c(d,p,y){const m=this.previous,b=this.events;let x=0;return S;function S(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?y(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const R=Ls(m);if(E===126)return x>1?y(E):(d.consume(E),x++,w);if(x<2&&!a)return y(E);const $=d.exit("strikethroughSequenceTemporary"),M=Ls(E);return $._open=!M||M===2&&!!R,$._close=!R||R===2&&!!M,p(E)}}}class mE{constructor(){this.map=[]}add(i,a,r){gE(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 gE(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 yE(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 xE(){return{flow:{null:{name:"table",tokenize:bE,resolveAll:vE}}}}function bE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(U){let te=r.events.length-1;for(;te>-1;){const xe=r.events[te][1].type;if(xe==="lineEnding"||xe==="linePrefix")te--;else break}const ue=te>-1?r.events[te][1].type:null,je=ue==="tableHead"||ue==="tableRow"?D:y;return je===D&&r.parser.lazy[r.now().line]?a(U):je(U)}function y(U){return e.enter("tableHead"),e.enter("tableRow"),m(U)}function m(U){return U===124||(d=!0,c+=1),b(U)}function b(U){return U===null?a(U):ze(U)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),w):a(U):We(U)?nt(e,b,"whitespace")(U):(c+=1,d&&(d=!1,u+=1),U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(U)))}function x(U){return U===null||U===124||bt(U)?(e.exit("data"),b(U)):(e.consume(U),U===92?S:x)}function S(U){return U===92||U===124?(e.consume(U),x):x(U)}function w(U){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(U):(e.enter("tableDelimiterRow"),d=!1,We(U)?nt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):E(U))}function E(U){return U===45||U===58?$(U):U===124?(d=!0,e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),R):ie(U)}function R(U){return We(U)?nt(e,$,"whitespace")(U):$(U)}function $(U){return U===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),M):U===45?(c+=1,M(U)):U===null||ze(U)?F(U):ie(U)}function M(U){return U===45?(e.enter("tableDelimiterFiller"),H(U)):ie(U)}function H(U){return U===45?(e.consume(U),H):U===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(U),e.exit("tableDelimiterMarker"),q):(e.exit("tableDelimiterFiller"),q(U))}function q(U){return We(U)?nt(e,F,"whitespace")(U):F(U)}function F(U){return U===124?E(U):U===null||ze(U)?!d||u!==c?ie(U):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(U)):ie(U)}function ie(U){return a(U)}function D(U){return e.enter("tableRow"),X(U)}function X(U){return U===124?(e.enter("tableCellDivider"),e.consume(U),e.exit("tableCellDivider"),X):U===null||ze(U)?(e.exit("tableRow"),i(U)):We(U)?nt(e,X,"whitespace")(U):(e.enter("data"),ae(U))}function ae(U){return U===null||U===124||bt(U)?(e.exit("data"),X(U)):(e.consume(U),U===92?J:ae)}function J(U){return U===92||U===124?(e.consume(U),ae):ae(U)}}function vE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,y=0,m,b,x;const S=new mE;for(;++a<e.length;){const w=e[a],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,y!==0&&(jx(S,i,y,m,b),b=void 0,y=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",m,i]])):E.type==="tableRow"||E.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({},E.start),end:Object.assign({},E.end)},S.add(a,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Pc(S,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Pc(S,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):E.type==="tableHead"?(p=!0,y=a):E.type==="tableRow"||E.type==="tableDelimiterRow"?(y=a,c[1]!==0?(d[0]=d[1],x=Pc(S,i,c,u,a,x)):d[1]!==0&&(x=Pc(S,i,d,u,a,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=a)}for(y!==0&&jx(S,i,y,m,b),S.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=yE(i.events,a))}return e}function Pc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},Rs(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const y=Rs(i.events,a[1]);if(c={type:d,start:Object.assign({},y),end:Object.assign({},y)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Rs(i.events,a[2]),b=Rs(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 S=i.events[a[2]],w=i.events[a[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",a[3]>a[2]+1){const E=a[2]+1,R=a[3]-a[2]-1;e.add(E,R,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Rs(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function jx(e,i,a,r,u){const c=[],d=Rs(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 Rs(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const wE={name:"tasklistCheck",tokenize:SE};function kE(){return{text:{91:wE}}}function SE(e,i,a){const r=this;return u;function u(y){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(y):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(y),e.exit("taskListCheckMarker"),c)}function c(y){return bt(y)?(e.enter("taskListCheckValueUnchecked"),e.consume(y),e.exit("taskListCheckValueUnchecked"),d):y===88||y===120?(e.enter("taskListCheckValueChecked"),e.consume(y),e.exit("taskListCheckValueChecked"),d):a(y)}function d(y){return y===93?(e.enter("taskListCheckMarker"),e.consume(y),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(y)}function p(y){return ze(y)?i(y):We(y)?e.check({tokenize:jE},i,a)(y):a(y)}}function jE(e,i,a){return nt(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function CE(e){return qb([XT(),rE(),hE(e),xE(),kE()])}const TE={};function EE(e){const i=this,a=e||TE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(CE(a)),c.push(PT()),d.push(YT(a))}function AE(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=DE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function uu(e,i){return!!(i&&e.includes(i))}function NE(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 DE(e){return e&&typeof e=="object"?e:{}}const RE=["summary","message","status","instruction","description","reason","error","text"],Cx=96,_E=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),ME=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),OE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),Dv=new Set(["item/commandExecution/terminalInteraction"]),zE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function LE(e){if(e.event!=="codex.notification")return!1;const i=ra(e.data);return typeof i.method=="string"&&Dv.has(i.method)}function IE(e){if(ME.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||_E.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=ra(e.data),a=typeof i.method=="string"?i.method:"",r=ra(i.params),u=ra(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||Dv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||OE.has(c)?null:a}function Rv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?zE.get(a)??_v(a):r}function Rr(e,i=[]){const a=ra(e),u=[...i,...RE.map(c=>cu(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=Cx?u:`${u.slice(0,Cx-3)}...`:"查看详情"}function Xp(e,i=new Map){const a=ra(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(y=>typeof y=="string").map(y=>y.trim()).filter(Boolean))):[]).map(y=>i.get(y)??y),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:Rr({},[p])}}function UE(e){const i=ra(e),a=Array.isArray(i.offers)?i.offers.map(ra).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=cu(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:Rr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function BE(e){const i=ra(e),a=cu(i.actionType)??"",r=ra(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(cu(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:Rr(r,[cu(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:Rr(r,[_v(a||"agent action")]),meta:"after turn"}}function _v(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 cu(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function ra(e){return e&&typeof e=="object"?e:{}}function Qp(e){const i=Zp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Zp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=VE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=$E(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function Mv(e,i){const a=Ex(e),r=Ex(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function qE(e,i){if(e.length===0)return"File changed";const a=Mv(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function HE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function $E(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:Tx(e),deletions:0};if(i==="delete")return{additions:0,deletions:Tx(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 Tx(e){const i=e.split(`
80
+ `).length;return e.endsWith(`
81
+ `)?Math.max(0,i-1):i}function VE(e){const i=Zp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function Ex(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Zp(e){return e&&typeof e=="object"?e:{}}const Ah=["low","medium","high","xhigh"],GE=["none","minimal",...Ah,"max"];function Os(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 Ax(e,i){const a=_r(e),r=_r(i==null?void 0:i.defaultReasoningEffort);return a?a===r?`${Os(a)} (model default)`:Os(a):r?`Auto (model default: ${Os(r)})`:"Auto (follow model default)"}function FE(e,i=""){const a=_r(e==null?void 0:e.defaultReasoningEffort),r=[];if(!e){r.push({value:"",label:"Use model default"});const p=_r(i);return p&&zv(p)&&r.push({value:p,label:`${Os(p)} (configured)`}),r}const c=(Ov(e)??Ah).filter(p=>!Jp(p));a&&!Jp(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?`${Os(p)} (model default)`:Os(p)});return r}function Nx(e,i){const a=_r(e);if(!a||Jp(a))return"";const r=_r(i==null?void 0:i.defaultReasoningEffort);if(r&&a===r)return"";if(!i)return zv(a)?a:"";const u=Ov(i);return u!==null?u.includes(a)?a:"":Ah.includes(a)?a:""}function PE(e,i,a){return a||e!==i?e:null}function Ov(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const i=[];for(const a of e.supportedReasoningEfforts){const r=_r(a==null?void 0:a.reasoningEffort);r&&!i.includes(r)&&i.push(r)}return i}function _r(e){return typeof e=="string"?e.trim():""}function Jp(e){return e.toLowerCase()==="ultra"}function zv(e){return GE.includes(e)}function YE(e,i){return{textareaDisabled:!1,sendDisabled:i||!e.trim()}}function WE(e,i){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?i&&!e.complexTaskActive?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function KE(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function Dx(e,i){return e.conversationId===i.conversationId&&e.version===i.version}function XE(e,i,a){return e===401&&!a&&i==="authentication_required"?"reauthenticate":"ignore"}const Rx=15e3,_x=[1e3,2e3,5e3,1e4,15e3];function QE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:Rx}:{kind:"none"}:{kind:"probe",waitMs:Rx}}function ZE(e){const i=Math.min(Math.max(1,Math.floor(e))-1,_x.length-1);return _x[i]}function JE(e){const i=Mx(e),a=Mx(i.conversation),r=i.workspaceStatus??i.status??a.status;return r==="idle"||r==="error"||r==="done"||r==="initialization_failed"?r:"done"}function Mx(e){return e&&typeof e=="object"?e:{}}function eA(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}function Xn(e,i){if(!e.deploymentId||!e.userId||!i)throw new Error("Browser storage requires deployment, user, and preference identities.");return["seele","v1",encodeURIComponent(e.deploymentId),encodeURIComponent(e.userId),encodeURIComponent(i)].join(":")}function Nh(e,i){const a=[],r=new Set;for(const u of[...e,...i])r.has(u)||(r.add(u),a.push(u));return a}function Ox(e,i,a){return Nh([i,...e.filter(r=>r!==i)],a)}function tA(e,i){return e.filter(a=>a!==i)}function nA(e,i){const a=e.code==="ArrowUp"?-1:e.code==="ArrowDown"?1:null;return a!==null&&e.metaKey&&e.shiftKey&&e.leftShiftPressed&&!e.ctrlKey&&!e.altKey?{type:"move",direction:a}:i?e.key==="Escape"?{type:"cancel"}:e.code==="Space"&&!e.repeat?{type:"confirm"}:null:null}function Tr(e){return`${e.kind}:${e.id}`}function iA(e,i){return e.flatMap(a=>[{kind:"group",id:a.id},...i.has(a.id)?[]:a.conversations.map(r=>({kind:"workspace",id:r.id}))])}function aA(e,i,a,r){if(e.length===0)return null;const u=i?Tr(i):null;let c=u?e.findIndex(d=>Tr(d)===u):-1;return c<0&&a&&(c=e.findIndex(d=>d.kind==="workspace"&&d.id===a)),c<0?r>0?e[0]:e[e.length-1]:e[(c+r+e.length)%e.length]}function lA(e,i){return i??e}function rA(e,i){return e==="saved"||i==="accept"?"saved":"declined"}const sA=/^[a-z][a-z\d+.-]*:/i,oA=/^L([1-9]\d*)(?:C([1-9]\d*))?$/i;function uA(e,i){const a=e.trim();if(!a||a.startsWith("#")||a.startsWith("?")||a.startsWith("/api/")||sA.test(a))return null;const r=a.indexOf("#"),u=r>=0?a.slice(0,r):a,c=r>=0?a.slice(r+1):"",d=u.indexOf("?"),p=d>=0?u.slice(0,d):u,y=cA(p);if(!y)return null;const m=c.match(oA);return{path:Lv(y,i),...m?{line:Number(m[1])}:{},...m!=null&&m[2]?{column:Number(m[2])}:{}}}function Lv(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 cA(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}const eh="seele:authentication-required",th="seele:deployment-status-required",Iv=12,dA=3e3,Uv="activeWorkspaceId",Dh="workspaceOrder",Bv="workspaceGroupOrder",qv="workspaceDrafts",Hv="collapsedWorkspaceGroups",$v="sidebarWidth",zx=5,Lx=275,fA=236,pA=420,Ix="default",Ux=300,hA=3,mA=10,gA=2,yA=13,xA=1.65,bA=20,vA=900;class la extends Error{constructor(a,r,u,c){super(a);$c(this,"detail");$c(this,"status");$c(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const wA=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Qo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Rh(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function ye(e){return`${Rh()}api/${e.replace(/^\/+/,"")}`}async function un(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 la(r,u,e.status,a)}function Ge(e){return e instanceof la?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function jr(e){const i=Ge(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Ee(e,i){if(!e.ok)throw await un(e,i)}function kA(e){return e instanceof la&&e.status===410&&e.body.includes('"turn_not_active"')}function SA(e){return e instanceof la&&e.status===409&&e.body.includes('"turn_not_running"')}function jA(e){return e instanceof la&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Bx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function CA(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 _h(e){return Math.max(fA,Math.min(pA,Math.round(e)))}function TA(e){try{const i=window.localStorage.getItem(Xn(e,$v)),a=i?Number.parseInt(i,10):Number.NaN;return Number.isFinite(a)?_h(a):Lx}catch{return Lx}}function EA(e,i){try{window.localStorage.setItem(Xn(e,$v),String(_h(i)))}catch{}}function kp(e){Vv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function AA(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function NA(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*hA+r+u,d=a*mA+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 DA(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(gA,Math.max(1,i+1))}function RA(e){return Math.ceil(DA(e)*yA*xA+bA)}function Vv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function _A(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 MA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function qx(e,i){Vv(e,()=>{const a=MA(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 OA(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||qx(e,i)});qx(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 zA(e){try{return window.localStorage.getItem(Xn(e,Uv))}catch{return null}}function Sp(e,i){const a=Xn(e,Uv);try{i?window.localStorage.setItem(a,i):window.localStorage.removeItem(a)}catch{}}function _s(e){try{const i=window.localStorage.getItem(Xn(e,Dh)),a=i?JSON.parse(i):[];return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function Gv(e){try{const i=window.localStorage.getItem(Xn(e,Bv)),a=i?JSON.parse(i):[];return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function Fv(e,i){try{window.localStorage.setItem(Xn(e,Bv),JSON.stringify(i))}catch{}}function eu(e,i){try{window.localStorage.setItem(Xn(e,Dh),JSON.stringify(i))}catch{}}function Pv(e){try{const i=window.localStorage.getItem(Xn(e,qv)),a=i?JSON.parse(i):{};return!a||typeof a!="object"||Array.isArray(a)?{}:Object.fromEntries(Object.entries(a).filter(r=>typeof r[0]=="string"&&typeof r[1]=="string"))}catch{return{}}}function LA(e,i){return i?Pv(e)[i]??"":""}function jp(e,i,a){if(i)try{const r=Pv(e);a?r[i]=a:delete r[i],window.localStorage.setItem(Xn(e,qv),JSON.stringify(r))}catch{}}function IA(e){try{const i=window.localStorage.getItem(Xn(e,Hv)),a=i?JSON.parse(i):[];return new Set(Array.isArray(a)?a.filter(r=>typeof r=="string"):[])}catch{return new Set}}function Cp(e,i){try{window.localStorage.setItem(Xn(e,Hv),JSON.stringify(Array.from(i)))}catch{}}function Ll(e,i){const a=_s(e);if(a.length===0)return i;const r=new Map(a.map((u,c)=>[u,c]));return[...i].sort((u,c)=>{const d=r.get(u.id),p=r.get(c.id);return d!==void 0&&p!==void 0?d-p:d!==void 0?-1:p!==void 0?1:0})}function Yc(e,i){const a=Gv(e);if(a.length===0)return i;const r=new Map(a.map((u,c)=>[u,c]));return[...i].sort((u,c)=>{const d=r.get(u.id),p=r.get(c.id);return d!==void 0&&p!==void 0?d-p:d!==void 0?-1:p!==void 0?1:u.createdAt.localeCompare(c.createdAt)})}function Wc(e,i){const a=_s(e),r=Nh(a,i.map(u=>u.id));JSON.stringify(r)!==JSON.stringify(a)&&eu(e,r)}function Tp(e,i){const a=new Set(i.map(c=>c.id)),r=Gv(e).filter(c=>a.has(c)),u=i.map(c=>c.id).filter(c=>!r.includes(c));Fv(e,[...r,...u])}function UA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function BA(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),y=d.findIndex(b=>b.id===a),m=r==="before"?y:y+1;return d.splice(m,0,p),d}function qA(e,i,a){if(i===a)return e;const r=e.findIndex(y=>y.id===i),u=e.findIndex(y=>y.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(y=>y.id===a);return c.splice(p+1,0,d),c}function HA({authEnabled:e,currentUser:i,deploymentId:a,onLogout:r}){var vo,Na,xl,yr;const u=N.useMemo(()=>({deploymentId:a,userId:i.id}),[a,i.id]),[c,d]=N.useState(""),[p,y]=N.useState(new Set),[m,b]=N.useState([]),[x,S]=N.useState([]),[w,E]=N.useState(null),[R,$]=N.useState(null),[M,H]=N.useState("simple"),[q,F]=N.useState(null),[ie,D]=N.useState(null),[X,ae]=N.useState(null),[J,U]=N.useState(!1),[te,ue]=N.useState(!1),[je,xe]=N.useState({}),[ce,G]=N.useState({}),[se,we]=N.useState(null),[Me,O]=N.useState([]),[A,z]=N.useState(null),[C,W]=N.useState(!1),[he,ge]=N.useState(null),[ke,oe]=N.useState("checking"),[Oe,vt]=N.useState(null),[St,yn]=N.useState(!1),[Ke,mt]=N.useState(null),[tn,xn]=N.useState(!1),[Ie,Bt]=N.useState(null),[jt,Pt]=N.useState(!1),[Ii,yi]=N.useState([]),[$l,Ct]=N.useState([]),[oa,ne]=N.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[de,Ne]=N.useState({profuseNotificationEnabled:!1,publicUrl:null}),[qe,Xe]=N.useState([]),[Yt,Qn]=N.useState(null),[Xt,At]=N.useState(null),[Qt,st]=N.useState(!1),[Nt,bn]=N.useState(null),[Sd,Vl]=N.useState(!1),[Lr,Ir]=N.useState(null),[ua,Gl]=N.useState(!1),[Va,qs]=N.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[vn,Ui]=N.useState("global"),[dt,Fl]=N.useState(null),[Hs,Ga]=N.useState(null),[$s,ca]=N.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[Vs,Gs]=N.useState({memory:"",items:[]}),[bu,xi]=N.useState({memory:"",items:[]}),[Wt,Zt]=N.useState({memory:"",items:[]}),[Fa,da]=N.useState([]),[Pa,Ya]=N.useState(Qo),[fa,Zn]=N.useState({description:"",key:"",value:""}),[Pl,bi]=N.useState(null),[Wa,vi]=N.useState(()=>new Set),[Bi,Dt]=N.useState(!1),[Ur,Br]=N.useState(!1),[pa,ha]=N.useState(!1),[qi,qr]=N.useState(null),[Fs,jd]=N.useState(!0),[Hr,ma]=N.useState(!1),[Jn,nn]=N.useState(!1),[vu,wu]=N.useState(!1),[ei,Hi]=N.useState(null),[$r,$i]=N.useState(null),[Jt,Vr]=N.useState(null),[ti,qn]=N.useState(null),[wn,Ps]=N.useState(null),[Ka,ga]=N.useState(null),[Gr,ku]=N.useState(()=>new Set),[Yl,ya]=N.useState(null),[Ys,Ws]=N.useState(null),[Wl,kn]=N.useState(null),[Sn,ni]=N.useState(null),[Vi,ii]=N.useState(null),[Xa,Kl]=N.useState(()=>IA(u)),[Tt,wi]=N.useState(null),[ki,Xl]=N.useState(()=>TA(u)),[Qa,Gi]=N.useState(230),[Si,Fr]=N.useState(()=>Date.now()),[Su,Pr]=N.useState(0),Ql=N.useRef(null),Zl=N.useRef(null),an=N.useRef(null),ji=N.useRef(null),Ci=N.useRef(null),Fi=N.useRef(!0),ju=N.useRef(null),xa=N.useRef(null),Jl=N.useRef(null),ba=N.useRef(new Set),Za=N.useRef(!1),Yr=N.useRef([]),er=N.useRef(null),Cu=N.useRef(null),tr=N.useRef(new Map),va=N.useRef(new Map),Wr=N.useRef(new Set),Kr=N.useRef(new Map),nr=N.useRef(new Map),Ja=N.useRef(new Map),el=N.useRef(new Set),Ti=N.useRef(null),jn=N.useRef(new Map),Cn=N.useRef(new Map),tl=N.useRef(new Map),ir=N.useRef(new Set),nl=N.useRef(null),Xr=N.useRef(null),Ks=N.useRef(!1),Xs=N.useRef(!1),ar=N.useRef(!1),Re=m.find(g=>g.id===w),Tu=(Re==null?void 0:Re.unreadTurnCount)??0,ai=m.find(g=>g.id===qi),Ot=m.find(g=>g.id===dt),Qs=m.find(g=>g.id===Yl),wa=N.useMemo(()=>{const k=Yc(u,x.length>0?x:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(I=>({id:I.id,title:I.title,conversations:[]})),j=new Map(k.map(I=>[I.id,I])),_=k[0];for(const I of m)(j.get(I.groupId)??_).conversations.push(I);return k.filter(I=>I.conversations.length>0||I.id!=="default")},[m,x]),Qr=N.useMemo(()=>iA(wa,Xa),[Xa,wa]),lt=w!==null?je[w]:null,il=(lt==null?void 0:lt.messages)??[],al=(lt==null?void 0:lt.events)??[],Ei=aR(iR(al),w?ce[w]:null),lr=Cw(Ei),Zr=(lt==null?void 0:lt.status)??(Re==null?void 0:Re.status)??"idle",Pi=oh(Re,Zr),Eu=qi!==null?((vo=je[qi])==null?void 0:vo.status)??(ai==null?void 0:ai.status)??"idle":"idle",Au=oh(ai,Eu),ll=w?Cn.current.get(w)??null:null,ka=N.useMemo(()=>new Map(m.map(g=>[g.id,g.title])),[m]),Zs=N.useMemo(()=>zN(il,al,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],ll,ka),[ll,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,al,il,ka]),Js=N.useMemo(()=>new Set(il.filter(g=>g.origin==="clone"&&g.turnId).map(g=>g.turnId)),[il]),Jr=w!==null&&Gr.has(w),Nu=w!==null&&p.has(w),eo=YE(c,Nu),Sa=ll?(Na=Zs.find(g=>uu(g.turnIds,ll)))==null?void 0:Na.activity:null,Yi=Pi==="running"||Pi==="initializing"||Jr?Sa&&!GD(Sa)?Sa:{title:Pi==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Cd=!Yi&&Pi==="waiting"&&(Re!=null&&Re.nextWakeup)?{title:"Scheduled wakeup",detail:hd(Re.nextWakeup,Si),createdAt:Re.nextWakeup.wakeAt,tone:"waiting"}:null,Wi=Yi??Cd,Du=N.useMemo(()=>nR(Object.values(je)),[je]),Ru=gb(he,Du);N.useEffect(()=>{fn(),Ou()},[]),N.useEffect(()=>()=>{Ci.current!==null&&window.clearTimeout(Ci.current)},[]),N.useEffect(()=>{or(!1),or(!0);const g=window.setInterval(()=>{or(!0)},300*1e3);return()=>window.clearInterval(g)},[]),N.useEffect(()=>{const g=window.setInterval(()=>Fr(Date.now()),1e3);return()=>window.clearInterval(g)},[]),N.useEffect(()=>{ir.current=Gr},[Gr]),N.useEffect(()=>{er.current=w},[w]),N.useLayoutEffect(()=>{const g=Cu.current;if(Cu.current=w,!w||g===w)return;const k=window.requestAnimationFrame(()=>{const j=ji.current;j&&!j.disabled&&!document.querySelector('[aria-modal="true"]')&&j.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[w]),N.useEffect(()=>{Yr.current=m},[m]),N.useEffect(()=>{const g=Xn(u,Dh),k=j=>{j.key===g&&b(_=>Ll(u,_))};return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[u]),N.useEffect(()=>{w&&Sp(u,w)},[w,u]),N.useLayoutEffect(()=>{if(!w||Tu<=0)return;let g=!1;const k=async()=>{if(document.visibilityState==="visible"){b(_=>_.map(I=>I.id===w?{...I,unreadTurnCount:0}:I));try{await $2(w)}catch(_){g||console.error(_)}}},j=()=>void k();return k(),document.addEventListener("visibilitychange",j),()=>{g=!0,document.removeEventListener("visibilitychange",j)}},[w,Tu]),N.useEffect(()=>{H("simple"),$(null),w&&(Lt(w),cr(w))},[w]),N.useEffect(()=>{const g=window.setInterval(()=>void Mu(),dA);return()=>window.clearInterval(g)},[]),N.useEffect(()=>{d(LA(u,w))},[w]),N.useEffect(()=>{if(!w)return;const g=QE({workspaceRunning:Zr==="running",streamLeaseActive:Jr,controllerActive:jn.current.has(w),currentTurnAbsent:Wr.current.has(w),retryAt:nr.current.get(w)??null,now:Date.now()});g.kind==="probe"&&xo(w,{waitMs:g.waitMs})},[w,Jr,Su,Zr]),N.useEffect(()=>()=>{for(const g of Ja.current.values())window.clearTimeout(g);Ja.current.clear()},[]),N.useEffect(()=>{if(!w)return;let g=!1;return hD(w).then(k=>{g||G(j=>({...j,[w]:k}))}).catch(k=>console.error(k)),()=>{g=!0}},[w]),N.useEffect(()=>{!w&&vn==="workspace"&&Ui("global")},[w,vn]),N.useEffect(()=>{var g;if(jt){if(!dt&&w){Fl(w);return}dt&&!m.some(k=>k.id===dt)&&Fl(w??((g=m[0])==null?void 0:g.id)??null)}},[w,m,jt,dt]),N.useEffect(()=>{if(!jt||i.role!=="admin")return;const g=window.setInterval(()=>void Ai(),5e3);return()=>window.clearInterval(g)},[i.role,jt]),N.useEffect(()=>{!jt||vn!=="workspace"||Zt({memory:(Ot==null?void 0:Ot.memory)??"",items:(Ot==null?void 0:Ot.memoryItems)??[]})},[vn,jt,Ot==null?void 0:Ot.id,Ot==null?void 0:Ot.memory,Ot==null?void 0:Ot.memoryItems]),N.useEffect(()=>{if(!Bi)return;w&&ao(w);const g=k=>{k.key==="Escape"&&Dt(!1)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[w,Bi]),N.useEffect(()=>{if(!jt)return;const g=k=>{k.key==="Escape"&&Pt(!1)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[jt]),N.useEffect(()=>{var k;if(!Ur)return;if(qi&&!m.some(j=>j.id===qi)){qr(w??((k=m[0])==null?void 0:k.id)??null);return}const g=j=>{j.key==="Escape"&&(ei?Hi(null):Br(!1))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[w,Ur,ei,qi,m]),N.useEffect(()=>{if(!ti)return;Ps(null);const g=k=>{k.key==="Escape"&&qn(null)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[ti]),N.useEffect(()=>{const g=I=>{if(I.code==="ShiftLeft"){ar.current=!0;return}const K=nA({code:I.code,key:I.key,metaKey:I.metaKey,shiftKey:I.shiftKey,ctrlKey:I.ctrlKey,altKey:I.altKey,leftShiftPressed:ar.current,repeat:I.repeat},Tt!==null);if((K==null?void 0:K.type)==="move"){I.preventDefault(),ue(!0),wi(fe=>aA(Qr,fe,er.current,K.direction));return}if((K==null?void 0:K.type)==="cancel"){wi(null);return}if(!((K==null?void 0:K.type)!=="confirm"||!Tt||us(I.target))){if(I.preventDefault(),Tt.kind==="group"){gr(Tt.id);return}Zi(Tt.id),wi(null),ue(!1)}},k=I=>{I.code==="ShiftLeft"&&(ar.current=!1)},j=()=>{ar.current=!1},_=()=>wi(null);return window.addEventListener("keydown",g,!0),window.addEventListener("keyup",k,!0),window.addEventListener("blur",j),window.addEventListener("pointerdown",_),()=>{window.removeEventListener("keydown",g,!0),window.removeEventListener("keyup",k,!0),window.removeEventListener("blur",j),window.removeEventListener("pointerdown",_)}},[Tt,Qr]),N.useEffect(()=>{Tt&&!Qr.some(g=>Tr(g)===Tr(Tt))&&wi(null)},[Tt,Qr]),N.useLayoutEffect(()=>{if(!Tt)return;const g=Tr(Tt),k=document.querySelector(`[data-keyboard-focus-key="${CSS.escape(g)}"]`);k==null||k.focus({preventScroll:!0}),k==null||k.scrollIntoView({block:"nearest"})},[Tt]),N.useLayoutEffect(()=>{NA(ji.current)},[c]),N.useLayoutEffect(()=>{const g=an.current;if(!g)return;const k=()=>{const _=g.getBoundingClientRect();Gi(Math.ceil(_.height+44))};k();const j=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return j==null||j.observe(g),window.addEventListener("resize",k),()=>{j==null||j.disconnect(),window.removeEventListener("resize",k)}},[]),N.useLayoutEffect(()=>{var K,fe;const g=Zl.current;if(!g)return;const k=ju.current!==w;ju.current=w,k&&((K=Ti.current)==null||K.call(Ti),Ti.current=null);const j=xa.current;if(j&&j.conversationId===w){(fe=Ti.current)==null||fe.call(Ti),Ti.current=OA(g,j),xa.current=null,Fi.current=!1;return}if(!k&&!Fi.current)return;Fi.current=!0,kp(g);const _=requestAnimationFrame(()=>kp(g)),I=window.setTimeout(()=>kp(g),120);return()=>{cancelAnimationFrame(_),window.clearTimeout(I)}},[w,al.length,il.length]);async function to(){var k;const g=Zl.current;g&&(Fi.current=AA(g),!(!w||!((k=lt==null?void 0:lt.history)!=null&&k.hasMoreBefore))&&(lt.loadingOlder||ba.current.has(w)||g.scrollTop>96||await En(w)))}function rr(g){var j,_;if(g.history)return g.history;const k=((j=g.timelineNodes)==null?void 0:j.filter(I=>I.parentId===null).reduce((I,K)=>I===null||K.timelineAt<I.timelineAt||K.timelineAt===I.timelineAt&&K.sequence<I.sequence?K:I,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((_=g.messages[0])==null?void 0:_.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:g.messages.length,eventTotal:g.events.length,loadedMessageCount:g.messages.length,loadedEventCount:g.events.length}}async function Ki(g){const k=new URL(g.url,window.location.href).toString();await navigator.clipboard.writeText(k),Ps(g.url)}async function rl(g,k){await navigator.clipboard.writeText(k),ga(g),Ci.current!==null&&window.clearTimeout(Ci.current),Ci.current=window.setTimeout(()=>{ga(null),Ci.current=null},1800)}function Se(g,k,j){const _=Date.now();Vr({id:_,tone:g,text:k,detail:j}),window.setTimeout(()=>{Vr(I=>(I==null?void 0:I.id)===_?null:I)},j?8e3:2400)}function es(g){const k=Ja.current.get(g);k!==void 0&&(window.clearTimeout(k),Ja.current.delete(g))}function sr(g){Wr.current.delete(g),Kr.current.delete(g),nr.current.delete(g),el.current.delete(g),es(g)}function _u(g){Wr.current.add(g),Kr.current.delete(g),nr.current.delete(g),el.current.delete(g),es(g)}function no(g){Wr.current.add(g),el.current.delete(g);const k=(Kr.current.get(g)??0)+1;Kr.current.set(g,k);const j=ZE(k);nr.current.set(g,Date.now()+j),es(g);const _=window.setTimeout(()=>{Ja.current.delete(g),Pr(I=>I+1)},j);Ja.current.set(g,_)}function io(g,k){k!=="running"&&sr(g)}async function fn(){try{const[g,k]=await Promise.all([rb(),ob()]);oe("connected");const j=Yc(u,k);if(S(j),Tp(u,j),g.length>0){const _=Ll(u,g),I=zA(u),K=_.find(fe=>fe.id===I)??_[0];b(_),Wc(u,_),E(K.id);return}b([]),Sp(u,null),E(null)}catch(g){console.error(g),oe("error")}}async function zt(){const[g,k]=await Promise.all([rb(),ob()]);for(const I of g)io(I.id,I.status);const j=Ll(u,g),_=Yc(u,k);S(_),Tp(u,_),b(j),Wc(u,j)}async function Mu(){if(!Za.current){Za.current=!0;try{const g=await U2(),k=Yr.current,j=new Set(k.map(be=>be.id)),_=new Set(g.map(be=>be.id));if(j.size!==_.size||[...j].some(be=>!_.has(be))){await zt(),oe("connected");return}const I=er.current;for(const be of g)io(be.id,be.status);const K=new Map(g.map(be=>[be.id,be])),fe=I?K.get(I)??null:null,Ae=Ll(u,k.map(be=>{const ve=K.get(be.id);return ve?{...be,status:ve.status,statusError:ve.statusError,nextWakeup:ve.nextWakeup,unreadTurnCount:ve.unreadTurnCount,updatedAt:ve.updatedAt}:be}));b(Ae),Wc(u,Ae),oe("connected"),fe&&!ir.current.has(fe.id)&&et(fe.id,be=>({...be,status:fe.status}))}catch(g){console.error(g),oe("error")}finally{Za.current=!1}}}async function Ou(){try{const g=await OD();oe("connected"),we(g.version)}catch(g){console.error(g),oe("error")}}async function or(g){try{const k=await zD(g);k&&ge(j=>gb(j,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function zu(){try{const g=await P2();yi(g),oe("connected")}catch(g){console.error(g),oe("error")}}async function ts(g){try{const k=await Y2(g);Ct(k),oe("connected")}catch(k){console.error(k),Ct([]),oe("error")}}async function ao(g){try{const k=await W2(g);da(k),oe("connected")}catch(k){console.error(k),da([]),oe("error")}}async function sl(g){try{const k=await K2();ne(k),qs(k),g||(Ga(null),ca(k)),oe("connected")}catch(k){console.error(k),oe("error")}}async function lo(){if(i.role==="admin")try{Ne(await X2()),oe("connected")}catch(g){console.error(g),oe("error")}}async function Xi(g=!0){try{const k=await lD(g);Xe(k.models),oe("connected"),k.refreshing&&window.setTimeout(()=>void Xi(!1),1e3)}catch(k){console.error(k),Xe([]),oe("error")}}async function ur(){try{const g=await Z2();Qn(g.codexVersion),At(g.codexReleasedAt),oe("connected")}catch(g){console.error(g),Qn(null),At(null),oe("error")}}async function ns(g=!1){g&&Gl(!0);try{const k=await rD(g);bn(k.job),Ir(k.latest),oe("connected"),k.job&&k.job.status!=="running"&&Jl.current===k.job.id&&(Jl.current=null,k.job.status==="succeeded"?(await Promise.all([Xi(),ur()]),Se("success",`Codex CLI updated to ${kd(k.job.currentVersion)}`)):Se("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),oe("error")}finally{g&&Gl(!1)}}async function ja(){Vl(!0);try{const g=await sD();Jl.current=g.id,bn(g),oe("connected")}catch(g){console.error(g);const k=Ge(g);Se("error","Unable to start Codex CLI update",k.detail??k.message)}finally{Vl(!1)}}N.useEffect(()=>{if(!Qt||(Nt==null?void 0:Nt.status)!=="running")return;const g=window.setInterval(()=>void ns(),1e3);return()=>window.clearInterval(g)},[Qt,Nt==null?void 0:Nt.id,Nt==null?void 0:Nt.status]);async function Qi(g){try{const k=await oD(g);Ga(k),ca(k.effective),oe("connected")}catch(k){console.error(k),Ga(null),oe("error")}}async function ro(){try{const g=await uD();Gs(g),xi(g),oe("connected")}catch(g){console.error(g),oe("error")}}async function Lu(){if(i.role!=="admin"){O([]);return}try{O(await DR()),oe("connected")}catch(g){console.error(g),oe("error")}}async function Ai(){if(i.role!=="admin"){z(null);return}W(!0);try{z(await Q2()),oe("connected")}catch(g){console.error(g),oe("error")}finally{W(!1)}}async function so(g=dt){const k=[zu(),sl(g),ur(),Xi(),ro()];i.role==="admin"&&(k.push(Lu()),k.push(Ai()),k.push(lo())),g&&(k.push(Lt(g)),k.push(Qi(g)),k.push(ts(g)),k.push(ao(g))),await Promise.all(k)}function Iu(){var k;const g=w??((k=m[0])==null?void 0:k.id)??null;ue(!1),Fl(g),Ui(i.role==="admin"?"global":g?"workspace":"global"),Pt(!0),so(g)}function Uu(){var k;const g=w??((k=m[0])==null?void 0:k.id)??null;Fl(g),Ui(g?"workspace":"global"),Pt(!0),so(g)}function Bu(){var k;ue(!1);const g=w??((k=m[0])==null?void 0:k.id)??null;qr(g),$i(null),Hi(null),Br(!0),g&&Td(g)}async function Td(g){try{const k=await dw(g);if(!k||k.status!=="running")return;ma(!0);const j=await fw(g,k);$i(j),await Lt(g),await zt(),j.warmupTurnId&&pr(g,j.warmupTurnId),Se("success","Full-history runtime reset completed")}catch(k){const j=Ge(k);Se("error","Full-history runtime reset failed",j.message)}finally{ma(!1)}}function Ed(g){Fl(g),Ui("workspace"),Lt(g),Qi(g),ts(g),ao(g),Ya(Qo)}async function qu(g){g.preventDefault();try{if(vn==="workspace"&&dt){const k=(Ot==null?void 0:Ot.status)==="running",j=await db(dt,yD($s,oa,Hs));Ga(j.settings),ca(j.settings.effective),Rn(j.conversation),Se("success","Workspace settings saved",k?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const k=await cD(Va);ne(k),qs(k),dt&&await Qi(dt),Se("success","Global settings saved")}oe("connected")}catch(k){console.error(k),oe("error");const j=Ge(k);Se("error","Failed to save runtime settings",j.detail??j.message)}}async function Hu(g){try{const k=await dD(g);Ne(k),oe("connected"),Se("success","Deployment settings saved")}catch(k){console.error(k),oe("error");const j=Ge(k);throw Se("error","Failed to save deployment settings",j.detail??j.message),k}}async function oo(){var j;const g=ai;if(!g){Se("error","No workspace selected");return}const k=((j=je[g.id])==null?void 0:j.status)??g.status;if(k==="running"||k==="initializing"){Se("error","Stop the running turn before resetting runtime");return}wu(!0),$i(null);try{const _=await pb(g.id);Hi(_),oe("connected")}catch(_){console.error(_),oe("error");const I=Ge(_);Se("error","Failed to preview runtime reset",I.detail??I.message)}finally{wu(!1)}}async function Hn(g){const k=ai,j=ei;if(!k||!j||j.conversationId!==k.id){Se("error","Reset preview is required");return}nn(!0),$i(null);try{const _=await fb(k.id,{warmup:Fs,previewFingerprint:j.fingerprint,selectedEntryIds:g});$i(_),Hi(null),oe("connected"),await Lt(k.id),await zt(),_.warmupTurnId&&pr(k.id,_.warmupTurnId),Se("success","Runtime thread reset")}catch(_){console.error(_),oe("error");const I=Ge(_);Se("error","Failed to reset runtime thread",I.detail??I.message)}finally{nn(!1)}}async function is(){var _;const g=ai;if(!g){Se("error","No workspace selected");return}const k=((_=je[g.id])==null?void 0:_.status)??g.status;if(k==="running"||k==="initializing"){Se("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${g.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.`)){ma(!0),$i(null);try{const I=await pb(g.id),K=await fb(g.id,{warmup:!1,previewFingerprint:I.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});$i(K),Hi(null),dt===g.id&&Zt({memory:"",items:[]}),oe("connected"),await Lt(g.id),await zt(),Se("success","Workspace started from blank context")}catch(I){console.error(I),oe("error");const K=Ge(I);Se("error","Failed to clear workspace context",K.detail??K.message)}finally{ma(!1)}}}async function Tn(g){const k=ai,j=ei;if(!k||!j||j.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await fD(k.id,{previewFingerprint:j.fingerprint,selectedEntryIds:g}),oe("connected")}catch(_){console.error(_),oe("error");const I=Ge(_);throw Se("error","Failed to save reset defaults",I.detail??I.message),_}}async function ol(g,k){try{const j=await db(g,{[k]:null});Ga(j.settings),ca(j.settings.effective),Rn(j.conversation),oe("connected"),Se("success","Workspace override reset")}catch(j){console.error(j),oe("error"),Se("error","Failed to reset workspace override")}}async function uo(g){try{const k=await jD({memory:SD(g),items:g});return Gs(k),xi(k),oe("connected"),Se("success","Base memory saved"),k.items}catch(k){throw console.error(k),oe("error"),Se("error","Failed to save memory"),k}}async function as(g,k){try{const j=await ed(g,{memoryItems:k});return Rn(j),Zt({memory:j.memory,items:j.memoryItems}),oe("connected"),Se("success","Workspace memory saved"),j.memoryItems}catch(j){throw console.error(j),oe("error"),Se("error","Failed to save memory"),j}}async function ls(g){g.preventDefault();const k=fa.key.trim();if(k)try{if(vn==="workspace"&&dt){const j=await TD(dt,k,fa.value,fa.description);Ct(_=>[..._.filter(I=>I.key!==j.variable.key),j.variable].sort((I,K)=>I.key.localeCompare(K.key))),Rn(j.conversation)}else{const j=await CD(k,fa.value,fa.description);yi(_=>[..._.filter(I=>I.key!==j.key),j].sort((I,K)=>I.key.localeCompare(K.key)))}Se("success",vn==="workspace"?"Workspace environment saved":"Base environment saved"),Zn({description:"",key:"",value:""}),bi(null),vi(j=>{const _=new Set(j);return _.delete(k),_}),oe("connected")}catch(j){console.error(j),oe("error"),Se("error","Failed to save environment")}}async function co(g){try{if(vn==="workspace"&&dt){const k=await DD(dt,g);Ct(j=>j.filter(_=>_.key!==g)),Rn(k)}else await ND(g),yi(k=>k.filter(j=>j.key!==g));Pl===g&&(Zn({description:"",key:"",value:""}),bi(null),vi(k=>{const j=new Set(k);return j.delete(g),j})),oe("connected"),Se("success",vn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),oe("error"),Se("error","Failed to delete environment")}}async function Ca(g,k){if(k.preventDefault(),!Pa.name.trim()){Se("error","Knowledge name is required");return}const j=xD(Pa);try{const _=Pa.id?await _D(g,Pa.id,j):await RD(g,j);da(I=>[...I.filter(K=>K.id!==_.id),_].sort(hb)),Ya(Qo),oe("connected"),Se("success","Workspace knowledge saved")}catch(_){console.error(_),oe("error"),Se("error","Failed to save workspace knowledge")}}async function $u(g,k){try{await MD(g,k),da(j=>j.filter(_=>_.id!==k)),Pa.id===k&&Ya(Qo),oe("connected"),Se("success","Workspace knowledge deleted")}catch(j){console.error(j),oe("error"),Se("error","Failed to delete workspace knowledge")}}function rs(g){Ui("workspace"),Ya(bD(g))}function ul(g){Zn({description:g.description,key:g.key,value:""}),bi(g.key),vi(k=>{const j=new Set(k);return j.delete(g.key),j}),ss(g.key,{preserveTypedValue:!0})}function Ad(){const g=Pl;Zn({description:"",key:"",value:""}),bi(null),g&&vi(k=>{const j=new Set(k);return j.delete(g),j})}async function pn(g){await ss(g)}async function ss(g,k={}){try{const j=vn==="workspace"&&dt?await AD(dt,g):await ED(g);Zn(_=>_.key===g&&(!k.preserveTypedValue||_.value.length===0)?{..._,value:j}:_),vi(_=>new Set(_).add(g)),oe("connected")}catch(j){console.error(j),oe("error")}}async function Lt(g){const k=await Lp(g);Ku(k)}async function fo(g){try{const k=await Lp(g);Xu(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function cr(g){try{$(await ID(g))}catch(k){console.error(k)}}async function $n(g){if(w)try{const k=await BD(w,g);$(g==="end"?null:k),g==="end"&&H("simple"),Se("success",g==="start"?"Complex task started":`Task ${g} accepted`),(g==="start"||g==="resume")&&xo(w,{waitMs:15e3}),await zt()}catch(k){Se("error","Complex task control failed",Ge(k).detail??Ge(k).message)}}async function Ni(g){if(w)try{F(await UD(w,g))}catch(k){const j=Ge(k);Se("error","Failed to load complex task",j.detail??j.message)}}function Vu(){Re&&ae({sourceId:Re.id,name:`${Re.title} - Clone`,groupId:Re.groupId})}async function po(g){if(g.preventDefault(),!(!X||!X.name.trim())){U(!0);try{const k=await qD(X.sourceId,X.name.trim(),X.groupId);b(j=>{const _=[k.conversation,...j];return eu(u,Ox(_s(u),k.conversation.id,_.map(I=>I.id))),Ll(u,_)}),E(k.conversation.id),ae(null),ue(!1),Se(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){Se("error","Clone failed",Ge(k).detail??Ge(k).message)}finally{U(!1)}}}async function Gu(){if(Re)try{const g=await HD(Re.id);Rn(g.conversation),Se(g.error?"error":"success",g.error?"Clone retry failed":"Clone initialization restarted",g.error??void 0)}catch(g){Se("error","Clone retry failed",Ge(g).detail??Ge(g).message)}}async function En(g,k={}){var be,ve,ot;const j=je[g],_=(be=j==null?void 0:j.history)==null?void 0:be.oldestTimelineAt,I=(ve=j==null?void 0:j.history)==null?void 0:ve.oldestTimelineSequence,K=_&&I!==null&&I!==void 0?`${_}|${I}`:I==null?(ot=j==null?void 0:j.history)==null?void 0:ot.oldestMessageCreatedAt:String(I),fe=Zl.current;if(!K||!fe)return;if(k.preserveAnchor??!0){const tt=_A(fe);xa.current={anchorOffset:tt.anchorOffset,conversationId:g,previousScrollHeight:fe.scrollHeight,anchorTurnId:tt.anchorTurnId}}else xa.current=null;ba.current.add(g),et(g,tt=>({...tt,loadingOlder:!0}));try{const tt=await Lp(g,{before:K,limit:Iv});Rd(tt)}catch(tt){console.error(tt),xa.current=null}finally{ba.current.delete(g),et(g,tt=>({...tt,loadingOlder:!1}))}}async function cl(g,k){const j=await LD(g,k||void 0);b(_=>{const I=[j,..._];return eu(u,Ox(_s(u),j.id,I.map(K=>K.id))),Ll(u,I)}),E(j.id),ue(!1)}function Zi(g){g!==er.current&&(xe(k=>{if(!(g in k))return k;const j={...k};return delete j[g],j}),E(g))}function os(){ue(!1),Bt({mode:"create",groupId:null,title:""})}function dl(g){Bt({mode:"rename",groupId:g.id,title:g.title})}function hn(){var g;ue(!1),vt({mode:"create",conversationId:null,title:"",groupId:(Re==null?void 0:Re.groupId)??((g=x[0])==null?void 0:g.id)})}async function An(g){var k;if(g.status!=="running"){xn(!0);try{await VD(g.id),xe(_=>{const I={..._};return delete I[g.id],I});const j=Yr.current.filter(_=>_.id!==g.id);if(eu(u,tA(_s(u),g.id)),jp(u,g.id,""),b(j),w===g.id){const _=((k=j[0])==null?void 0:k.id)??null;Sp(u,_),E(_)}(Oe==null?void 0:Oe.conversationId)===g.id&&ln(),mt(null),Se("success","Workspace moved to recycle")}catch(j){const _=Ge(j);Se("error","Failed to move workspace to recycle",_.detail??_.message)}finally{xn(!1)}}}async function Ji(g){if(!(g.id===Ix||!window.confirm(`Delete group "${g.title}"?
85
+
86
+ Workspaces in this group will move to Default.`)))try{const j=await F2(g.id),_=Yc(u,j.groups);S(_),Tp(u,_);const I=Ll(u,j.conversations);b(I),Wc(u,I),Kl(K=>{const fe=new Set(K);return fe.delete(g.id),Cp(u,fe),fe})}catch(j){console.error(j)}}function li(g){vt({mode:"rename",conversationId:g.id,title:g.title})}function ln(){yn(!1),vt(null)}function Nn(){Bt(null)}async function Fu(g,k){const j=k.trim(),_=m.find(K=>K.id===g);if(!_||!j||j===_.title){ln();return}const I=await ed(g,{title:j});Rn(I),ln()}function us(g){return g instanceof HTMLInputElement||g instanceof HTMLTextAreaElement}function cs(g){return g instanceof Element&&!!g.closest("input, button")}function Pu(g,k){const j=document.elementFromPoint(g,k);return j instanceof HTMLElement?j.closest(".session-item[data-workspace-id]"):null}function qt(g,k){const j=document.elementFromPoint(g,k);return j instanceof HTMLElement?j.closest(".workspace-group[data-group-id]"):null}function gt(g,k,j){const _=Pu(k,j),I=_==null?void 0:_.dataset.workspaceId;if(_&&I&&I!==g){ni({kind:"workspace",id:I,position:UA(_,j)});return}const K=qt(k,j),fe=K==null?void 0:K.dataset.groupId;if(!fe){ni(null);return}ni({kind:"group",id:fe})}function Fe(g,k){cs(g.target)||(g.currentTarget.setPointerCapture(g.pointerId),nl.current={id:k,pointerId:g.pointerId,startX:g.clientX,startY:g.clientY})}function ea(g,k){const j=nl.current;if(!j||j.id!==k||j.pointerId!==g.pointerId)return;const _=Math.hypot(g.clientX-j.startX,g.clientY-j.startY);if(Yl!==k){if(_<zx)return;ya(k),ni(null)}g.preventDefault(),ii({x:g.clientX,y:g.clientY}),gt(k,g.clientX,g.clientY)}async function Dn(g,k){var fe;g.preventDefault(),g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),nl.current=null;const j=Yl===k;j&&(Ks.current=!0);const _=Sn;if(!j||!_){ya(null),ni(null),ii(null);return}const I=m.find(Ae=>Ae.id===k),K=_.kind==="group"?_.id:(fe=m.find(Ae=>Ae.id===_.id))==null?void 0:fe.groupId;if(!I||!K){ya(null),ni(null),ii(null);return}if(b(Ae=>{const be=_.kind==="workspace"?BA(Ae.map(ve=>ve.id===k?{...ve,groupId:K}:ve),k,_.id,_.position):[...Ae.filter(ve=>ve.id!==k),{...I,groupId:K}];return eu(u,Nh(be.map(ve=>ve.id),_s(u))),be}),I.groupId!==K)try{const Ae=await ed(k,{groupId:K});Rn(Ae)}catch(Ae){console.error(Ae),await zt()}ya(null),ni(null),ii(null)}function ho(g){g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),nl.current=null,ya(null),ni(null),ii(null)}function ta(g,k){g.currentTarget.setPointerCapture(g.pointerId),Xr.current={id:k,pointerId:g.pointerId,startX:g.clientX,startY:g.clientY}}function Yu(g,k){const j=Xr.current;if(!j||j.id!==k||j.pointerId!==g.pointerId)return;const _=Math.hypot(g.clientX-j.startX,g.clientY-j.startY);if(Ys!==k){if(_<zx)return;Ws(k),kn(null)}g.preventDefault();const I=qt(g.clientX,g.clientY),K=I==null?void 0:I.dataset.groupId;kn(K&&K!==k?K:null)}function Wu(g,k){g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId);const j=Ys===k;j&&(g.preventDefault(),Xs.current=!0);const _=Wl;j&&_&&S(I=>{const K=qA(I,k,_);return Fv(u,K.map(fe=>fe.id)),K}),Xr.current=null,Ws(null),kn(null)}function fl(g){g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId),Xr.current=null,Ws(null),kn(null)}function Ta(g){const k=g.target.value;vt(j=>j&&{...j,title:k})}function mo(g){const k=g.target.value;vt(j=>j&&{...j,groupId:k})}function dr(g){const k=g.target.value;Bt(j=>j&&{...j,title:k})}async function go(g){if(g.preventDefault(),!Oe)return;const k=Oe.title.trim();if(k){yn(!0);try{if(Oe.mode==="create"){await cl(k,Oe.groupId),ln();return}Oe.conversationId&&await Fu(Oe.conversationId,k)}catch(j){console.error(j);const _=Ge(j);Se("error",Oe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",_.detail??_.message)}finally{yn(!1)}}}function ri(g){g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),ln())}async function Di(g){if(g.preventDefault(),!Ie)return;const k=Ie.title.trim();if(k)try{if(Ie.mode==="rename"){if(!Ie.groupId)return;const _=await G2(Ie.groupId,{title:k});S(I=>I.map(K=>K.id===_.id?_:K)),Nn();return}const j=await V2(k);S(_=>[..._,j]),Kl(_=>{const I=new Set(_);return I.delete(j.id),Cp(u,I),I}),Nn()}catch(j){console.error(j)}}function si(g){g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),Nn())}async function Ri(g){g.preventDefault(),await Ht()}function yo(g){w&&tr.current.set(w,(tr.current.get(w)??0)+1),d(g),jp(u,w,g)}function pl(g,k,j){const _={conversationId:g,version:j};if(!Dx(_,{conversationId:g,version:tr.current.get(g)??0}))return;jp(u,g,"");const I=er.current;I&&Dx(_,{conversationId:I,version:tr.current.get(I)??0})&&d(K=>K.trim()===k?"":K)}function hl(g){if(va.current.has(g))return null;const k=Symbol(g);return va.current.set(g,k),y(j=>{const _=new Set(j);return _.add(g),_}),k}function _i(g,k){va.current.get(g)===k&&(va.current.delete(g),y(j=>{const _=new Set(j);return _.delete(g),_}))}function Mi(g){const k=Ge(g);Se("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function Ht(g={}){const k=c.trim();if(!k)return;const j=w,_=WE({hasConversation:j!==null,messageSubmitting:j!==null&&va.current.has(j),hasActiveTurn:j!==null&&Cn.current.has(j),hasConfirmedCurrentTurn:j!==null&&el.current.has(j),complexTaskActive:!!R},!!g.forceNewTurn);if(_==="create-workspace"){hn();return}if(_==="blocked"||!j)return;const I=tr.current.get(j)??0,K=hl(j);if(!K)return;if(_==="queue-turn"){await Nd(j,k,I,K);return}if(_==="steer-turn"){await Dd(j,k,I,K);return}const fe=`local-${Date.now()}`;et(j,be=>({...be,messages:[...be.messages,{id:fe,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),ci(j,"running"),di(j,!0);let Ae=!1;try{let be=null;const ve=ye(`conversations/${j}/turns`),ot=await fetch(ve,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(ot.ok){const tt=await ot.json();if(!tt.turnId)throw new Error("Turn did not return a turn id");if(be=tt.turnId,(M==="complex"||R)&&(cr(j),H("simple")),!tt.message)throw new Error("Turn did not return the persisted message");ml(j,fe,tt.message,be),Ae=!0,pl(j,k,I)}else{const tt=await CA(ot);if(tt){be=tt;const xr=await Rt(j,tt,k);if(!xr.ok)throw await un(xr,{method:"POST",url:ye(`conversations/${j}/turns/${tt}/steer`)});const bl=await xr.json();if(!bl.message)throw new Error("Steer did not return the persisted message");ml(j,fe,bl.message,tt),Ae=!0,pl(j,k,I)}else throw await un(ot,{method:"POST",url:ve})}if(!be)throw await un(ot,{method:"POST",url:ve});pr(j,be),_i(j,K)}catch(be){Ae||Mi(be);const ve=jA(be);ve&&Se("error","Reset thread required",R?"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."),et(j,ot=>({...ot,status:"error",messages:Ae?ot.messages:ot.messages.filter(tt=>tt.id!==fe),events:[...ot.events,{id:ot.events.length+1,event:"client.error",data:ve?{message:"Reset thread required",detail:R?"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."}:jr(be),createdAt:new Date().toISOString()}]})),ci(j,"error"),di(j,!1),await zt()}finally{_i(j,K)}}async function fr(g){const k=tl.current.get(g)??[];if(k.length===0)return;const[j,..._]=k;tl.current.set(g,_),await pr(g,j)}async function xo(g,k={}){if(ir.current.has(g)||jn.current.has(g))return;es(g),nr.current.delete(g);const j=new AbortController;jn.current.set(g,j),di(g,!0);try{const _=k.waitMs?`?waitMs=${k.waitMs}`:"",I=ye(`conversations/${g}/turns/current/events${_}`),K=await fetch(I,{signal:j.signal});if(!K.ok||!K.body)throw await un(K,{method:"GET",url:I});sr(g),el.current.add(g),await fo(g),await vb(K.body,fe=>{const Ae=Jx(fe,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ae.turnId&&!Cn.current.has(g)&&Cn.current.set(g,Ae.turnId),et(g,ve=>({...ve,status:td(Ae)??ve.status,events:Zx(ve.events,Ae)}));const be=td(Ae);be&&ci(g,be)}),await Lt(g),await zt()}catch(_){if(!tb(_)){if(SA(_)){jn.current.get(g)===j&&no(g);return}et(g,I=>({...I,status:"error",events:[...I.events,{id:I.events.length+1,event:"client.error",data:jr(_),createdAt:new Date().toISOString()}]}))}}finally{jn.current.get(g)===j&&(el.current.delete(g),Cn.current.delete(g),jn.current.delete(g),di(g,!1),await fr(g))}}async function pr(g,k,j={}){const _=Cn.current.get(g);if(_===k)return;if(_||jn.current.has(g)){const K=tl.current.get(g)??[];K.includes(k)||tl.current.set(g,[...K,k]);return}sr(g);const I=new AbortController;jn.current.set(g,I),Cn.current.set(g,k),di(g,!0);try{const K=ye(`conversations/${g}/turns/${k}/events`),fe=await fetch(K,{signal:I.signal});if(!fe.ok||!fe.body)throw await un(fe,{method:"GET",url:K});await fo(g),await vb(fe.body,Ae=>{const be=Jx(Ae,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(g,ot=>({...ot,status:td(be)??ot.status,events:Zx(ot.events,be)}));const ve=td(be);ve&&ci(g,ve)}),await Lt(g),await zt()}catch(K){if(!tb(K)){if(j.recovered&&kA(K)){await Lt(g),await zt();return}et(g,fe=>({...fe,status:"error",events:[...fe.events,{id:fe.events.length+1,event:"client.error",data:jr(K),createdAt:new Date().toISOString()}]}))}}finally{jn.current.get(g)===I&&(Cn.current.get(g)===k&&Cn.current.delete(g),jn.current.delete(g),di(g,!1),await fr(g))}}async function Nd(g,k,j,_){let I=!1;const K=`local-queued-${Date.now()}`;et(g,fe=>({...fe,messages:[...fe.messages,{id:K,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const fe=ye(`conversations/${g}/turns`),Ae=await fetch(fe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue",workMode:M})});if(!Ae.ok)throw await un(Ae,{method:"POST",url:fe});const be=await Ae.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");ml(g,K,be.message,be.turnId),I=!0,pl(g,k,j),pr(g,be.turnId),_i(g,_),await zt(),Se("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(fe){I||Mi(fe),et(g,Ae=>({...Ae,messages:I?Ae.messages:Ae.messages.filter(be=>be.id!==K),events:[...Ae.events,{id:Ae.events.length+1,event:"client.error",data:jr(fe),createdAt:new Date().toISOString()}]}))}finally{_i(g,_)}}async function Dd(g,k,j,_){const I=Cn.current.get(g);let K=!1;const fe=`local-steer-${Date.now()}`;et(g,Ae=>({...Ae,messages:[...Ae.messages,{id:fe,role:"user",content:k,createdAt:new Date().toISOString(),turnId:I??null}],status:"running"}));try{const Ae=ye(I?`conversations/${g}/turns/${I}/steer`:`conversations/${g}/turns/steer`),be=await fetch(Ae,Bx(k));if(!be.ok)throw await un(be,{method:"POST",url:Ae});const ve=await be.json();if(!ve.message)throw new Error("Steer did not return the persisted message");ml(g,fe,ve.message,I),K=!0,pl(g,k,j),_i(g,_)}catch(Ae){Mi(Ae),et(g,be=>({...be,messages:K?be.messages:be.messages.filter(ve=>ve.id!==fe),events:[...be.events,{id:be.events.length+1,event:"client.error",data:jr(Ae),createdAt:new Date().toISOString()}]}))}finally{_i(g,_)}}async function Rt(g,k,j){return fetch(ye(`conversations/${g}/turns/${k}/steer`),Bx(j))}function ml(g,k,j,_){et(g,I=>({...I,messages:Np(I.messages.filter(K=>K.id!==k),[{...j,turnId:_??j.turnId??null}])}))}async function hr(){var _;if(!w||Pi!=="running"&&Pi!=="initializing"&&!Jr)return;const g=w,k=Pi,j=`client-stop-${Date.now()}`;_u(g),(_=jn.current.get(g))==null||_.abort(),Cn.current.delete(g),tl.current.delete(g),di(g,!1),et(g,I=>({...I,status:"done",events:[...I.events,{id:j,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),ci(g,"done");try{const I=await gl(g);sr(g),et(g,K=>({...K,status:I})),ci(g,I),Promise.all([Lt(g),zt()]).catch(K=>{console.warn("Failed to refresh workspace after Stop",K)})}catch(I){no(g),et(g,fe=>({...fe,status:k==="initializing"?"initializing":"running",events:[...fe.events.filter(Ae=>Ae.id!==j),{id:fe.events.length+1,event:"client.error",data:jr(I),createdAt:new Date().toISOString()}]})),ci(g,k==="initializing"?"initializing":"running");const K=Ge(I);Se("error","Stop failed",K.detail??K.message);try{await zt()}catch(fe){console.warn("Failed to refresh workspace after Stop failed",fe)}}}async function gl(g){const k=ye(`conversations/${g}/turns/interrupt`),j=await fetch(k,{method:"POST"});if(!j.ok)throw await un(j,{method:"POST",url:k});return JE(await j.json().catch(()=>null))}async function bo(){var _;const g=ai;if(!g){Se("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${g.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 j=g.id;nn(!0),_u(j),(_=jn.current.get(j))==null||_.abort(),Cn.current.delete(j),tl.current.delete(j),di(j,!1);try{const I=await gl(j);sr(j),et(j,K=>({...K,status:I})),ci(j,I),await Lt(j),await zt(),Se("success","Workspace stopped and repaired")}catch(I){no(j);const K=Ge(I);Se("error","Force stop failed",K.detail??K.message);try{await zt()}catch(fe){console.warn("Failed to refresh workspace after force Stop failed",fe)}}finally{nn(!1)}}async function oi(g,k){if(!w||!g.approvalTurnId||g.approvalRequestId===void 0)return;const j=w;try{const _=ye(`conversations/${j}/turns/${g.approvalTurnId}/approvals/${encodeURIComponent(String(g.approvalRequestId))}`),I=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!I.ok)throw await un(I,{method:"POST",url:_});et(j,K=>({...K,events:[...K.events,{id:K.events.length+1,event:"server.approval.decision",data:{requestId:g.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(_){et(j,K=>({...K,events:[...K.events,{id:K.events.length+1,event:"client.error",data:jr(_),createdAt:new Date().toISOString()}]}));const I=Ge(_);Se("error","Failed to respond to approval",I.detail??I.message)}}async function ui(g,k,j){const _=w,I=g.workspaceChangeProposalId??g.responsibilityProposalId;if(!_||!I)return!1;try{const K=ye(`conversations/${_}/workspace-change-proposals/${encodeURIComponent(I)}`),fe=await fetch(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?j??g.workspaceChangePayload:void 0})});if(!fe.ok)throw await un(fe,{method:"POST",url:K});const Ae=await fe.json(),be=lA(k,Ae.decision),ve=be==="accept"?Ae.payload??j??g.workspaceChangePayload:null;return Rn(Ae.conversation),et(_,ot=>({...ot,events:[...ot.events,{id:`${g.id}:${be}`,event:"server.workspace_change.decision",data:{proposalId:I,changeType:g.workspaceChangeType??"responsibility",decision:be,payload:ve},createdAt:new Date().toISOString()}]})),Se("success",be==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(K){console.error(K);const fe=Ge(K);return Se("error","Failed to respond to workspace change proposal",fe.detail??fe.message),!1}}async function mr(g,k,j){const _=w;if(!(!_||!g.knowledgeProposalId))try{let I;if(k==="accept")try{I=JSON.parse(j??g.body)}catch{Se("error","Knowledge proposal JSON is invalid");return}const K=ye(`conversations/${_}/knowledge-proposals/${encodeURIComponent(g.knowledgeProposalId)}`),fe=await fetch(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:I})});if(!fe.ok)throw await un(fe,{method:"POST",url:K});const Ae=await fe.json();da([...Ae.items??[]].sort(hb)),et(_,be=>({...be,events:[...be.events,{id:`${g.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:g.knowledgeProposalId,decision:k,knowledge:k==="accept"?Ae.item:null},createdAt:new Date().toISOString()}]})),Se("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(I){console.error(I);const K=Ge(I);Se("error","Failed to respond to knowledge proposal",K.detail??K.message)}}function Ku(g){io(g.id,g.status),ds(g),xe(k=>{const j=k[g.id],_=g.events.map(I=>({id:I.id,turnId:I.turnId,seq:I.seq,event:I.event,data:I.data,createdAt:I.createdAt}));return{...k,[g.id]:{messages:g.messages,events:Qc(_,(j==null?void 0:j.events)??[]),timelineNodes:Rp(g.timelineNodes??[],(j==null?void 0:j.timelineNodes)??[]),turns:Dp(g.turns??[],(j==null?void 0:j.turns)??[]),contextVersions:g.contextVersions??[],status:g.status,history:rr(g),loadingOlder:!1,fullEventTurnIds:(j==null?void 0:j.fullEventTurnIds)??new Set,loadingEventTurnIds:(j==null?void 0:j.loadingEventTurnIds)??new Set}}})}function Rd(g){const k=rr(g);et(g.id,j=>{var _,I,K;return{...j,messages:Np(g.messages,j.messages),timelineNodes:Rp(g.timelineNodes??[],j.timelineNodes),turns:Dp(g.turns??[],j.turns),events:Qc(g.events.map(fe=>({id:fe.id,turnId:fe.turnId,seq:fe.seq,event:fe.event,data:fe.data,createdAt:fe.createdAt})),j.events),contextVersions:(((_=g.contextVersions)==null?void 0:_.length)??0)>0?g.contextVersions??[]:j.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((I=j.history)==null?void 0:I.loadedMessageCount)??j.messages.length),loadedEventCount:k.loadedEventCount+(((K=j.history)==null?void 0:K.loadedEventCount)??j.events.length)},loadingOlder:!1}})}function Xu(g){const k=rr(g),j=g.events.map(_=>({id:_.id,turnId:_.turnId,seq:_.seq,event:_.event,data:_.data,createdAt:_.createdAt}));et(g.id,_=>{var I,K,fe;return{..._,messages:Np(_.messages,g.messages),timelineNodes:Rp(_.timelineNodes,g.timelineNodes??[]),turns:Dp(_.turns,g.turns??[]),events:Qc(j,_.events),contextVersions:(((I=g.contextVersions)==null?void 0:I.length)??0)>0?g.contextVersions??[]:_.contextVersions,status:g.status,history:{..._.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((K=_.history)==null?void 0:K.loadedMessageCount)??_.messages.length,_.messages.length,g.messages.length),loadedEventCount:Math.max(((fe=_.history)==null?void 0:fe.loadedEventCount)??_.events.length,_.events.length,g.events.length)},loadingOlder:!1}})}function et(g,k){xe(j=>{const _=j[g]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...j,[g]:k(_)}})}function ci(g,k){b(j=>j.map(_=>_.id===g?{..._,status:k,updatedAt:new Date().toISOString()}:_))}function ds(g){Rn(g)}function Rn(g){b(k=>Ll(u,k.map(j=>j.id===g.id?{...j,...g}:j)))}async function yl(g,k){const j=k.filter(_=>{const I=je[g];return I&&!I.fullEventTurnIds.has(_)&&!I.loadingEventTurnIds.has(_)});if(j.length!==0){et(g,_=>{const I=new Set(_.loadingEventTurnIds);for(const K of j)I.add(K);return{..._,loadingEventTurnIds:I}});try{const _=await Promise.all(j.map(I=>$D(g,I)));et(g,I=>{const K=new Set(I.fullEventTurnIds),fe=new Set(I.loadingEventTurnIds),Ae=_.flatMap((be,ve)=>{const ot=j[ve];return K.add(ot),fe.delete(ot),be.map(tt=>({id:tt.id,turnId:tt.turnId,seq:tt.seq,event:tt.event,data:tt.data,createdAt:tt.createdAt}))});return{...I,events:Qc(I.events,Ae),fullEventTurnIds:K,loadingEventTurnIds:fe}})}catch(_){console.error(_),et(g,I=>{const K=new Set(I.loadingEventTurnIds);for(const fe of j)K.delete(fe);return{...I,loadingEventTurnIds:K}}),Se("error","Failed to load process details")}}}function di(g,k){const j=new Set(ir.current);k?j.add(g):j.delete(g),ir.current=j,ku(_=>{const I=new Set(_);return k?I.add(g):I.delete(g),I})}function fs(g){const k=KE({key:g.key,metaKey:g.metaKey,ctrlKey:g.ctrlKey,shiftKey:g.shiftKey,isComposing:g.nativeEvent.isComposing});k&&(g.preventDefault(),Ht({forceNewTurn:k.forceNewTurn}))}function gr(g){Kl(k=>{const j=new Set(k);return j.has(g)?j.delete(g):j.add(g),Cp(u,j),j})}function Qu(g){var k;return eA(g.status,(k=g.nextWakeup)==null?void 0:k.status,Gr.has(g.id))}function ps(g){var _;const k=(_=Ql.current)==null?void 0:_.getBoundingClientRect(),j=k?g-k.left:g;return _h(j)}function Ea(g){g.preventDefault(),g.currentTarget.setPointerCapture(g.pointerId),Xl(ps(g.clientX))}function Aa(g){g.currentTarget.hasPointerCapture(g.pointerId)&&(g.preventDefault(),Xl(ps(g.clientX)))}function Zu(g){g.currentTarget.hasPointerCapture(g.pointerId)&&g.currentTarget.releasePointerCapture(g.pointerId);const k=ps(g.clientX);Xl(k),EA(u,k)}return s.jsxs("main",{className:`shell${te?" mobile-sidebar-open":""}`,ref:Ql,style:{"--sidebar-width":`${ki}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"}),se?i.role==="admin"?s.jsxs("a",{"aria-label":`Open Seele Host control for Work v${se}`,className:"work-version-link",href:`${Rh()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",se,s.jsx("span",{"aria-hidden":"true",children:"↗"})]}):s.jsxs("span",{children:["v",se]}):null,s.jsx("span",{"aria-label":Sb(ke),className:`backend-status ${ke}`,"data-label":Sb(ke)})]}),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:r,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:()=>ue(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:hn,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:wa.map(g=>s.jsxs("section",{className:["workspace-group",Ys===g.id?"dragging":"",Wl===g.id?"drop-after":"",(Sn==null?void 0:Sn.kind)==="group"&&Sn.id===g.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":g.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!Xa.has(g.id),className:(Tt==null?void 0:Tt.kind)==="group"&&Tt.id===g.id?"workspace-group-toggle keyboard-focused":"workspace-group-toggle","data-keyboard-focus-key":Tr({kind:"group",id:g.id}),onClick:k=>{if(Xs.current){k.preventDefault(),Xs.current=!1;return}gr(g.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),dl(g)},onPointerCancel:fl,onPointerDown:k=>ta(k,g.id),onPointerMove:k=>Yu(k,g.id),onPointerUp:k=>Wu(k,g.id),type:"button",children:[s.jsx("span",{className:Xa.has(g.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),dl(g)},title:"Double-click to rename",children:g.title})]}),g.id!==Ix?s.jsx("button",{"aria-label":`Delete group ${g.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Ji(g)},title:"Delete group",type:"button",children:"×"}):null]}),Xa.has(g.id)?null:s.jsx("div",{className:"workspace-group-items",children:g.conversations.map(k=>{const j=Qu(k);return s.jsxs("div",{className:["session-item",(Tt==null?void 0:Tt.kind)==="workspace"&&Tt.id===k.id?"keyboard-focused":"",k.id===w?"active":"",k.id===Yl?"dragging":"",(Sn==null?void 0:Sn.kind)==="workspace"&&Sn.id===k.id?`drop-${Sn.position}`:""].filter(Boolean).join(" "),"data-keyboard-focus-key":Tr({kind:"workspace",id:k.id}),"data-workspace-id":k.id,onClick:_=>{if(Ks.current){_.preventDefault(),Ks.current=!1;return}Zi(k.id),ue(!1)},onDoubleClick:_=>{cs(_.target)||(_.preventDefault(),li(k))},onKeyDown:_=>{us(_.target)||_.key==="Enter"&&(Zi(k.id),ue(!1))},onPointerCancel:ho,onPointerDown:_=>Fe(_,k.id),onPointerMove:_=>ea(_,k.id),onPointerUp:_=>Dn(_,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":rd(j,k.nextWakeup,Si),className:`session-status ${j}`,title:rd(j,k.nextWakeup,Si)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),j==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:rd(j,k.nextWakeup,Si),children:hd(k.nextWakeup,Si)}):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,j!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:_=>{_.stopPropagation(),mt(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",zs(k.id)]})]},k.id)})})]},g.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:Iu,type:"button",children:s.jsx(ib,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:os,type:"button",children:s.jsx(D2,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{ha(!0),ue(!1)},type:"button",children:s.jsx(id,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Bu,type:"button",children:s.jsx(R2,{})}),s.jsx(MN,{usage:Ru})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ue(!1),tabIndex:te?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Ea,onPointerMove:Aa,onPointerUp:Zu,role:"separator",tabIndex:0}),Qs&&Vi?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Vi.x+12}px, ${Vi.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Qs.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",zs(Qs.id)]})]}):null,Oe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ri,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ri,onSubmit:g=>void go(g),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Ta,onKeyDown:ri,value:Oe.title}),Oe.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:mo,onKeyDown:ri,value:Oe.groupId??((xl=x[0])==null?void 0:xl.id)??"",children:x.map(g=>s.jsx("option",{value:g.id,children:g.title},g.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:ln,children:"Cancel"}),s.jsx("button",{disabled:St,type:"submit",children:St?"Saving...":Oe.mode==="create"?"Create":"Save"})]})]})}):null,Ie?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:si,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:si,onSubmit:g=>void Di(g),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:dr,onKeyDown:si,value:Ie.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Nn,children:"Cancel"}),s.jsx("button",{type:"submit",children:Ie.mode==="create"?"Create":"Save"})]})]})}):null,jt?s.jsx(YA,{currentUser:i,conversations:m,editingEnvironmentKey:Pl,deploymentSettings:de,environmentDraft:fa,globalEnvironment:Ii,workspaceEnvironment:$l,memorySettings:Vs,memorySettingsDraft:bu,workspaceMemoryDraft:Wt,runtimeSettings:oa,runtimeModels:qe,runtimeCodexVersion:Yt,runtimeCodexReleasedAt:Xt,runtimeCodexUpdating:(Nt==null?void 0:Nt.status)==="running",runtimeSettingsDraft:Va,runtimeSettingsScope:vn,settingsWorkspace:Ot,settingsWorkspaceId:dt,systemDiagnostics:A,systemDiagnosticsLoading:C,workspaceGroups:wa,workspaceRuntimeSettings:Hs,workspaceRuntimeSettingsDraft:$s,managedUsers:Me,onCancelEnvironmentEdit:Ad,onClose:()=>Pt(!1),onCreateUser:async g=>{const k=await RR(g);O(j=>[...j,k]),Se("success","User created")},onDeleteUser:async g=>{await MR(g),O(k=>k.filter(j=>j.id!==g)),Se("success","User deleted")},onSaveDeploymentSettings:Hu,onDeleteEnvironment:g=>void co(g),onDraftChange:Zn,onEditEnvironment:ul,onRevealEnvironmentValue:g=>void pn(g),onSaveBaseMemoryItems:g=>uo(g),onSaveResponsibility:async(g,k)=>{try{const j=await ed(g,{responsibility:k});return Rn(j),oe("connected"),Se("success","Workspace responsibility saved"),j.responsibility}catch(j){throw console.error(j),oe("error"),Se("error","Failed to save workspace responsibility"),j}},onSaveWorkspaceMemoryItems:g=>dt?as(dt,g):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:qs,onCodexAccountSwitched:async()=>{Se("success","Codex account switched"),(await Rw()).codexAccountsReady&&await Promise.all([or(!0),Xi(!0),ur()])},onUpdateCodexCli:()=>{st(!0),ns(!0)},onRuntimeScopeChange:Ui,onSettingsWorkspaceChange:Ed,onSubmitRuntimeSettings:g=>void qu(g),onWorkspaceRuntimeDraftChange:ca,onWorkspaceRuntimeReset:g=>dt?void ol(dt,g):void 0,revealedEnvironmentKeys:Wa,onSubmitEnvironment:g=>void ls(g),onRefreshSystemDiagnostics:()=>void Ai(),onUpdateUser:async(g,k)=>{const j=await _R(g,k);O(_=>_.map(I=>I.id===j.id?j:I)),Se("success","User updated")}}):null,Qt?s.jsx(PA,{currentReleasedAt:Xt,currentVersion:Yt,job:Nt,latest:Lr,latestChecking:ua,starting:Sd,onClose:()=>st(!1),onRefresh:()=>void ns(),onStart:()=>void ja()}):null,Bi&&Re?s.jsx($A,{conversation:Re,clockNow:Si,knowledgeDraft:Pa,workspaceKnowledge:Fa,tokenUsage:Ei,onCancelKnowledgeEdit:()=>Ya(Qo),onDeleteKnowledge:g=>void $u(Re.id,g),onEditKnowledge:rs,onKnowledgeDraftChange:Ya,onSubmitKnowledge:g=>void Ca(Re.id,g),onClose:()=>Dt(!1)}):null,pa?s.jsx(VA,{conversations:m,onClose:()=>ha(!1),workspaceGroups:wa}):null,Ur?s.jsx(GA,{busy:Hr||Jn,conversation:ai??null,conversationId:qi,forceStopBusy:Jn,preview:(ei==null?void 0:ei.conversationId)===qi?ei:null,previewLoading:vu,result:$r,status:Au,warmup:Fs,workspaceGroups:wa,onClose:()=>Br(!1),onCancelResetPreview:()=>Hi(null),onForceStop:()=>void bo(),onPreviewReset:()=>void oo(),onStartBlankContext:()=>void is(),onResetRuntime:g=>void Hn(g),onSaveResetSelection:Tn,onWorkspaceChange:g=>{qr(g),$i(null),Hi(null)},onWarmupChange:jd}):null,X?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!J&&ae(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:po,onMouseDown:g=>g.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:()=>ae(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:X.name,onChange:g=>ae(k=>k&&{...k,name:g.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:X.groupId,onChange:g=>ae(k=>k&&{...k,groupId:g.target.value}),children:wa.map(g=>s.jsx("option",{value:g.id,children:g.title},g.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:J,onClick:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:J||!X.name.trim(),type:"submit",children:J?"Cloning...":"Clone"})]})]})}):null,q?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>F(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:g=>g.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:q.title}),s.jsxs("p",{children:[kb(q.status),q.startedAt&&q.finishedAt?` · ${kR(q.startedAt,q.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>F(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:q.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:q.status==="completed"?"Final plan":"Current plan"}),q.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:Ul(q.currentPlan.planMarkdown,Re)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:q.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:q.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:q.startedAt?$e(q.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:q.finishedAt?$e(q.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>F(null),type:"button",children:"Close"})})]})}):null,ie?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>D(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:g=>g.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:ie.title}),s.jsx("p",{children:$e(ie.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>D(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(au,{content:ie.fullDetail??ie.detail??"No additional details.",conversation:Re,streaming:!1,onPreviewArtifact:qn,onCopyArtifactUrl:Ki,copiedArtifactUrl:wn})}),s.jsxs("footer",{children:[ie.linkedTaskId?s.jsx("button",{onClick:()=>{const g=ie.linkedTaskId;D(null),Ni(g)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>D(null),type:"button",children:"Close"})]})]})}):null,Ke?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{tn||mt(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:g=>g.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:tn,onClick:()=>mt(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Ke.title})," to recycle?"]}),s.jsx("code",{children:Ke.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:tn,onClick:()=>mt(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:tn,onClick:()=>void An(Ke),type:"button",children:tn?"Moving...":"Move to recycle"})]})]})}):null,Jt?s.jsxs("div",{className:`app-toast ${Jt.tone}`,role:"status",children:[s.jsx("strong",{children:Jt.text}),Jt.detail?s.jsx("pre",{children:Jt.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:()=>ue(!0),title:"Workspaces",type:"button",children:s.jsx(N2,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Re==null?void 0:Re.title)??"New workspace"})}),Re?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",zs(Re.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Re?s.jsxs(s.Fragment,{children:[Re.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Bu,title:`当前 Thread 工具集已过期(${Re.threadCapabilityVersion} / ${Re.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(cw,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Vu,title:"Clone workspace",type:"button",children:s.jsx(A2,{})}),s.jsxs("button",{className:`context-button has-usage ${qh(lr??0)}`,onClick:()=>Dt(!0),style:{"--context-usage":`${wd(lr??0)}%`},title:Ei&&lr!==null?`Context ${Math.round(lr)}% · ${Un(Ei.totalTokens)} / ${ld(Ei.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(lr??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:Uu,title:"Workspace settings",type:"button",children:s.jsx(ib,{})})]}):null})]}),R?s.jsxs("section",{className:`complex-task-bar ${R.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void Ni(R.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:R.title}),s.jsx("span",{className:"complex-task-state",children:kb(R.status)}),s.jsx("span",{className:"complex-task-duration",children:wR(R,Si)})]}),s.jsxs("div",{className:"complex-task-actions",children:[Up(R.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!R.objective||!R.currentPlan,onClick:()=>void $n("start"),title:R.objective&&R.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,R.status==="active"?s.jsx("button",{onClick:()=>void $n("pause"),type:"button",children:"Pause"}):null,Up(R.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void $n("resume"),type:"button",children:"Resume"}):null,Up(R.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void $n("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void $n("end"),type:"button",children:"End task"})]})]}):null,(Re==null?void 0:Re.status)==="initialization_failed"&&Re.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Re.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Gu(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void to(),ref:Zl,style:{scrollPaddingBottom:Qa},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Qa},children:[il.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:[Re!=null&&Re.cloneLineage&&Js.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Re.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Re.cloneLineage.snapshotAt)," · ",Re.cloneLineage.importedMessageCount," messages"]})]}):null,(yr=lt==null?void 0:lt.history)!=null&&yr.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,Zs.map((g,k)=>{var fe,Ae,be;const j=((fe=g.user)==null?void 0:fe.type)==="system",_=g.turnIds.some(ve=>Js.has(ve)),I=Zs[k+1],K=_&&(!I||!I.turnIds.some(ve=>Js.has(ve)));return s.jsxs(N.Fragment,{children:[s.jsxs("section",{className:`turn-group${_?" clone-history-turn":""}`,"data-turn-id":g.id,children:[g.user?s.jsxs("div",{className:`turn-panel ${j?"system-turn":"user-turn"}`,children:[tu(g.user,Re,qn,Ki,wn,oi,ui,mr,Ni,D),s.jsx(nu,{copied:Ka===`${j?"system":"user"}-${g.id}-bottom`,content:iu(g.user),id:`${j?"system":"user"}-${g.id}-bottom`,timestamp:g.user.createdAt,variant:"outside",onCopy:rl})]}):null,g.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:g.followupUsers.map(ve=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),tu(ve,Re,qn,Ki,wn,oi,ui,mr,Ni,D),s.jsx(nu,{copied:Ka===`user-${ve.id}-bottom`,content:iu(ve),id:`user-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:rl})]},ve.id))}):null,(Ae=g.acceptedSystemInputs)==null?void 0:Ae.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[tu(ve,Re,qn,Ki,wn,oi,ui,mr,Ni,D),s.jsx(nu,{copied:Ka===`system-${ve.id}-bottom`,content:iu(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:rl})]},ve.id)),g.agentItems.length>0?s.jsx(bN,{group:g,conversation:Re,allowProcessView:!_,copiedFooter:Ka===`agent-${g.id}-bottom`,copiedArtifactUrl:wn,running:!_&&uu(g.turnIds,ll),onCopyArtifactUrl:Ki,onCopyBubble:rl,onPreviewArtifact:qn,onLoadProcessDetails:ve=>Re&&!_?yl(Re.id,ve):void 0,onRespondApproval:oi,onRespondWorkspaceChangeProposal:ui,onRespondKnowledgeProposal:mr,onOpenComplexTask:Ni,onOpenSystemEvent:D}):null,(be=g.trailingSystemItems)==null?void 0:be.map(ve=>s.jsxs("div",{className:"turn-panel system-turn",children:[tu(ve,Re,qn,Ki,wn,oi,ui,mr,Ni,D),s.jsx(nu,{copied:Ka===`system-${ve.id}-bottom`,content:iu(ve),id:`system-${ve.id}-bottom`,timestamp:ve.createdAt,variant:"outside",onCopy:rl})]},ve.id))]}),K?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},g.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Ri,ref:an,children:[Wi?s.jsxs("div",{className:`global-activity ${Wi.tone??"running"}`,children:[Yi?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void hr(),title:"Stop current workspace activity",type:"button",children:s.jsx(kN,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Wi.title}),Wi.detail?s.jsx("small",{children:Wi.detail}):null]}),Yi?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":R?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!R||M==="complex",className:`complex-mode-button ${R||M==="complex"?"active":""}`,disabled:!!R,onClick:()=>H(g=>g==="complex"?"simple":"complex"),title:R?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Wv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:R?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:eo.textareaDisabled,onChange:g=>yo(g.target.value),onKeyDown:fs,placeholder:"Cmd/Ctrl + Enter",ref:ji,value:c}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:eo.sendDisabled,type:"submit",children:[s.jsx(SN,{}),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"]})]})]})]})]}),ti?s.jsx("div",{className:"artifact-lightbox",onClick:()=>qn(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:g=>g.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>qn(null),type:"button",children:"×"}),s.jsx("img",{alt:ti.name,src:ti.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:ti.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:ti.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void Ki(ti),type:"button",children:wn===ti.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function $A({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:y,onSubmitKnowledge:m,onClose:b}){const[x,S]=N.useState("overview"),[w,E]=N.useState(!1),[R,$]=N.useState(!1),[M,H]=N.useState(null),[q,F]=N.useState(null),[ie,D]=N.useState(!1),[X,ae]=N.useState(null),[J,U]=N.useState(null),[te,ue]=N.useState(!1),[je,xe]=N.useState(null),[ce,G]=N.useState(null),se=Cw(u),we=oh(e,e.status),Me=M?oR(M):null;N.useEffect(()=>{E(!1),H(null),F(null),ae(null),U(null),xe(null),G(null)},[e.id]),N.useEffect(()=>{x==="additionalContext"&&!X&&A()},[x,X]),N.useEffect(()=>{x==="compactions"&&!je&&z()},[x,je]);const O=()=>{E(!0),$(!0),F(null),pD(e.id).then(C=>H(C)).catch(C=>{const W=Ge(C);F(W.detail?`${W.message}
89
+ ${W.detail}`:W.message)}).finally(()=>$(!1))},A=()=>{D(!0),U(null),mD(e.id).then(C=>ae(C)).catch(C=>{const W=Ge(C);U(W.detail?`${W.message}
90
+ ${W.detail}`:W.message)}).finally(()=>D(!1))},z=()=>{ue(!0),G(null),gD(e.id).then(C=>xe(C)).catch(C=>{const W=Ge(C);G(W.detail?`${W.message}
91
+ ${W.detail}`:W.message)}).finally(()=>ue(!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:()=>S("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:()=>S("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:()=>S("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:()=>S("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:()=>S("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:()=>S("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 ${we}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:rd(we,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:pu(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:hd(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/${zs(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:Ul(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(Yv,{items:r,onDelete:d,onEdit:C=>{p(C),S("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:Ul(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(uN,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:y,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:()=>E(!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:se===null?"unknown":`${Math.round(se)}%`,mono:!0}),s.jsx(Je,{label:"Latest usage",value:u.modelContextWindow?`${Un(u.totalTokens)} / ${Un(u.modelContextWindow)}`:Un(u.totalTokens),mono:!0}),se!==null?s.jsx("div",{className:`context-token-bar ${qh(se)}`,children:s.jsx("span",{style:{width:`${wd(se)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${ld(u.inputTokens)} / ${ld(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:ld(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..."}):q?s.jsx("pre",{className:"thread-read-error",children:q}):M?s.jsxs(s.Fragment,{children:[Me?s.jsx(gN,{summary:Me}):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(M,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"})]}),ce?s.jsx("pre",{className:"thread-read-error",children:ce}):te&&!je?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):je!=null&&je.length?s.jsx("div",{className:"context-compaction-list",children:je.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:tR(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:[ql(C.id),C.turnId?` · turn ${ql(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..."}):J?s.jsx("pre",{className:"thread-read-error",children:J}):X?s.jsx(hN,{preview:X,refreshing:ie,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function VA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=N.useState([]),[c,d]=N.useState("active"),[p,y]=N.useState(null),[m,b]=N.useState([]),[x,S]=N.useState(!0),[w,E]=N.useState(null),[R,$]=N.useState(null),[M,H]=N.useState(!1),[q,F]=N.useState(!1),[ie,D]=N.useState(new Set),[X,ae]=N.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),J=r.find(A=>A.id===p)??null,U=N.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),te=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ue=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==X.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),je=()=>{var A;ae({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),D(new Set),$("create")},xe=()=>{!J||J.status!=="active"||(ae({title:J.title,publicDescription:J.publicDescription,ownerWorkspaceId:J.ownerWorkspaceId,participantWorkspaceIds:J.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),D(new Set),$("edit"))},ce=async(A,z=c)=>{var C;S(!0),E(null);try{const W=await sb();u(W);const he=W.filter(ke=>z==="archived"?ke.status==="archived":ke.status!=="archived"),ge=(A&&he.some(ke=>ke.id===A)?A:null)??(p&&he.some(ke=>ke.id===p)?p:((C=he[0])==null?void 0:C.id)??null);y(ge),b(ge?await Jc(ge):[])}catch(W){E(W instanceof la?W.detail:W instanceof Error?W.message:String(W))}finally{S(!1)}};N.useEffect(()=>{ce()},[]),N.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await sb();u(z),p&&z.some(C=>C.id===p)&&b(await Jc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const G=async A=>{y(A),E(null);try{b(await Jc(A))}catch(z){E(z instanceof la?z.detail:z instanceof Error?z.message:String(z))}},se=async A=>{var C;if(A===c)return;d(A),E(null);const z=((C=r.find(W=>A==="archived"?W.status==="archived":W.status!=="archived"))==null?void 0:C.id)??null;if(y(z),!z){b([]);return}try{b(await Jc(z))}catch(W){E(W instanceof la?W.detail:W instanceof Error?W.message:String(W))}},we=async A=>{var z;if(A.preventDefault(),!(!X.title.trim()||!X.ownerWorkspaceId)){F(!0),E(null);try{const C=R==="edit"&&J?await q2(J.id,{expectedVersion:J.version,title:X.title.trim(),publicDescription:X.publicDescription.trim(),participantWorkspaceIds:X.participantWorkspaceIds}):await B2({...X,title:X.title.trim(),publicDescription:X.publicDescription.trim()});d("active"),$(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ce(C.id,"active")}catch(C){E(C instanceof la?C.detail:C instanceof Error?C.message:String(C))}finally{F(!1)}}},Me=async()=>{if(!(!J||J.status!=="active")){F(!0),E(null);try{const A=await H2(J.id,J.version);H(!1),d("active"),await ce(void 0,"active")}catch(A){E(A instanceof la?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:je,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 se("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void se("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 G(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:J?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:J.title}),s.jsx("p",{children:J.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:J.status}),J.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${J.title}`,className:"memory-icon-button",onClick:xe,title:"编辑",type:"button",children:s.jsx(vd,{})}),s.jsx("button",{"aria-label":`归档 Topic ${J.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(_2,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:J.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children: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")?"发给全部参与者":`发给 ${pw(A.recipientWorkspaceIds.map(z=>U.get(z)??ql(z)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Ul(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:we,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:()=>$(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:X.title,onChange:A=>ae(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:X.publicDescription,onChange:A=>ae(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:R==="edit",value:X.ownerWorkspaceId,onChange:A=>ae(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:[X.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>D(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>D(new Set(ue.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ue.map(A=>{const z=A.conversations,C=z.filter(he=>X.participantWorkspaceIds.includes(he.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:()=>D(he=>{const ge=new Set(he);return ge.has(A.id)?ge.delete(A.id):ge.add(A.id),ge}),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:()=>ae(he=>{const ge=z.map(oe=>oe.id),ke=new Set(he.participantWorkspaceIds);return ge.every(oe=>ke.has(oe))?ge.forEach(oe=>ke.delete(oe)):ge.forEach(oe=>ke.add(oe)),{...he,participantWorkspaceIds:Array.from(ke)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),W?null:s.jsx("div",{children:z.map(he=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:X.participantWorkspaceIds.includes(he.id),onChange:ge=>ae(ke=>({...ke,participantWorkspaceIds:ge.target.checked?[...ke.participantWorkspaceIds,he.id]:ke.participantWorkspaceIds.filter(oe=>oe!==he.id)})),type:"checkbox"}),s.jsx("span",{children:he.title})]},he.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>$(null),type:"button",children:"取消"}),s.jsx("button",{disabled:q||!X.title.trim()||!X.ownerWorkspaceId,type:"submit",children:q?"正在保存...":R==="edit"?"保存":"创建 Topic"})]})]})}):null,M&&J?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!q&&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:J.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:q,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:q,onClick:()=>void Me(),type:"button",children:q?"正在归档...":"归档"})]})]})}):null]})})}function GA({busy:e,conversation:i,conversationId:a,forceStopBusy:r,preview:u,previewLoading:c,result:d,status:p,warmup:y,workspaceGroups:m,onCancelResetPreview:b,onClose:x,onForceStop:S,onPreviewReset:w,onStartBlankContext:E,onResetRuntime:R,onSaveResetSelection:$,onWorkspaceChange:M,onWarmupChange:H}){const q=!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=>M(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/",zs(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/${zs(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:y,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:S,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:q||c,onClick:w,type:"button",children:c?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:q||c,onClick:E,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(FA,{busy:e,preview:u,warmup:y,onCancel:b,onConfirm:R,onSaveSelection:$}):null]})})}function FA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=N.useState(()=>new Set(i.entries.filter(U=>U.includedByDefault).map(U=>U.id))),[y,m]=N.useState(!1),[b,x]=N.useState(!1),[S,w]=N.useState(null),E=N.useRef(null),R=i.entries.filter(U=>d.has(U.id)),$=R.filter(U=>U.role==="user").length,M=R.length-$,H=i.entries.filter(U=>U.topicRelation!==null).map(U=>U.id),q=H.filter(U=>d.has(U)).length,F=i.entries.length>0&&d.size===i.entries.length;N.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const ie=e||b;async function D(U){x(!0),w(null);try{await c(i.entries.filter(te=>U.has(te.id)).map(te=>te.id)),p(U)}catch(te){w(Ge(te).message)}finally{x(!1)}}function X(U,te){const ue=new Set(d);te?ue.add(U):ue.delete(U),D(ue)}function ae(){const U=new Set(d);H.forEach(te=>U.add(te)),D(U)}function J(){const U=new Set(d);H.forEach(te=>{U.has(te)?U.delete(te):U.add(te)}),D(U)}return s.jsx("div",{className:`reset-preview-overlay ${y?"expanded":""}`,onClick:ie?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${y?"expanded":""}`,onClick:U=>U.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":y?"Restore reset preview size":"Expand reset preview",onClick:()=>m(U=>!U),title:y?"Restore size":"Expand",type:"button",children:y?"⊡":"⛶"}),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:U=>void D(U.target.checked?new Set(i.entries.map(te=>te.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[$," user"]}),s.jsxs("span",{children:[M," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[q," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:ie||q===H.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:ie,onClick:J,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,S?s.jsx("span",{className:"reset-preview-selection-error",children:S}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((U,te)=>s.jsxs("article",{className:`reset-preview-item ${U.role} ${d.has(U.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${U.role} message ${te+1}`,checked:d.has(U.id),disabled:ie,onChange:ue=>X(U.id,ue.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:U.role}),U.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",U.topicRelation]}):null,s.jsx("time",{dateTime:U.createdAt,children:$e(U.createdAt)})]}),s.jsx("pre",{children:U.content})]},U.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(U=>d.has(U.id)).map(U=>U.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function PA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:y}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&mR(r.version,m)?hR(r.version):null;return N.useEffect(()=>{const x=S=>{S.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:sh(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?sh(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,S)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:pR(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${S}`)):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:y,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function YA({currentUser:e,conversations:i,deploymentSettings:a,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:y,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:S,runtimeCodexVersion:w,runtimeCodexReleasedAt:E,runtimeCodexUpdating:R,runtimeSettingsDraft:$,runtimeSettingsScope:M,settingsWorkspace:H,settingsWorkspaceId:q,systemDiagnostics:F,systemDiagnosticsLoading:ie,workspaceGroups:D,workspaceRuntimeSettings:X,workspaceRuntimeSettingsDraft:ae,onCancelEnvironmentEdit:J,onClose:U,onCreateUser:te,onDeleteUser:ue,onDeleteEnvironment:je,onDraftChange:xe,onEditEnvironment:ce,onSaveBaseMemoryItems:G,onSaveDeploymentSettings:se,onSaveResponsibility:we,onSaveWorkspaceMemoryItems:Me,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:W,onSettingsWorkspaceChange:he,onSubmitRuntimeSettings:ge,onSubmitEnvironment:ke,onRefreshSystemDiagnostics:oe,onUpdateUser:Oe,onWorkspaceRuntimeDraftChange:vt,onWorkspaceRuntimeReset:St,revealedEnvironmentKeys:yn}){const[Ke,mt]=N.useState("model"),[tn,xn]=N.useState(!1),[Ie,Bt]=N.useState(null),[jt,Pt]=N.useState(!1),[Ii,yi]=N.useState((H==null?void 0:H.responsibility)??""),[$l,Ct]=N.useState(!1),oa=N.useRef(null),ne=M==="workspace"?Object.values((X==null?void 0:X.sources)??{}).filter(de=>de==="workspace").length:0;return N.useEffect(()=>{M==="global"&&Pt(!1)},[M]),N.useEffect(()=>{yi((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),N.useEffect(()=>{if(!jt)return;const de=qe=>{var Yt;const Xe=qe.target;Xe instanceof Node&&((Yt=oa.current)!=null&&Yt.contains(Xe))||Pt(!1)},Ne=qe=>{qe.key==="Escape"&&Pt(!1)};return document.addEventListener("pointerdown",de,!0),document.addEventListener("keydown",Ne,!0),()=>{document.removeEventListener("pointerdown",de,!0),document.removeEventListener("keydown",Ne,!0)}},[jt]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:U,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:de=>de.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"}),Ke!=="system"&&Ke!=="users"&&Ke!=="accounts"&&Ke!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":M==="global",className:M==="global"?"active":void 0,onClick:()=>W("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:oa,children:[s.jsx("button",{"aria-checked":M==="workspace","aria-expanded":M==="workspace"?jt:void 0,"aria-label":M==="workspace"?"Settings workspace target":void 0,className:M==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(M!=="workspace"){W("workspace");return}Pt(de=>!de)},role:"radio",type:"button",children:M==="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"}),M==="workspace"&&jt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:D.map(de=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:de.title}),de.conversations.map(Ne=>s.jsxs("button",{"aria-selected":Ne.id===q,className:Ne.id===q?"selected":void 0,onClick:()=>{he(Ne.id),Pt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ne.title}),s.jsxs("small",{children:["workspaces/",Ne.id]})]},Ne.id))]},de.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:U,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:Ke==="model"?"active":void 0,onClick:()=>mt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ke==="responsibility"?"active":void 0,onClick:()=>mt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ke==="memory"?"active":void 0,onClick:()=>mt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Ke==="environment"?"active":void 0,onClick:()=>mt("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:Ke==="accounts"?"active":void 0,onClick:()=>mt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Ke==="deployment"?"active":void 0,onClick:()=>mt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{onClick:()=>{window.location.assign(`${Rh()}admin/host`)},type:"button",children:[s.jsx("span",{children:"Work Operations"}),s.jsx("small",{children:"Versions, restart, logs"})]}),s.jsxs("button",{className:Ke==="system"?"active":void 0,onClick:()=>mt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ke==="users"?"active":void 0,onClick:()=>mt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ke!=="system"&&Ke!=="users"&&Ke!=="accounts"&&Ke!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${M==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:M==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:M==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ke==="system"?s.jsx(WA,{conversations:i,diagnostics:F,loading:ie,onRefresh:oe}):Ke==="users"?s.jsx(nN,{currentUser:e,users:m,onCreate:te,onDelete:ue,onUpdate:Oe}):Ke==="accounts"?s.jsx(tN,{onSwitched:z}):Ke==="deployment"?s.jsx(iN,{settings:a,onSave:se}):Ke==="model"?s.jsx(aN,{draft:M==="workspace"?ae:$,globalSettings:x,models:S,codexVersion:w,codexReleasedAt:E,codexUpdating:R,scope:M,workspaceOverrideCount:ne,settings:M==="workspace"?(X==null?void 0:X.effective)??ae:x,workspaceSettings:X,onDraftChange:M==="workspace"?vt:A,onResetWorkspaceSetting:St,onSubmit:ge,onUpdateCodexCli:C}):Ke==="responsibility"?s.jsx(QA,{draft:Ii,saving:$l,scope:M,workspace:H,onDraftChange:yi,onSubmit:de=>{de.preventDefault(),de.stopPropagation(),!(M!=="workspace"||!H)&&(Ct(!0),we(H.id,Ii).then(Ne=>yi(Ne)).finally(()=>Ct(!1)))}}):Ke==="memory"?s.jsx(lN,{baseSettings:p,scope:M,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:G,onSaveWorkspaceItems:Me}):s.jsx(oN,{deleteConfirmKey:Ie,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:M,workspaceEnvironment:d,valueVisible:tn,onCancelEnvironmentEdit:J,onDeleteConfirmChange:Bt,onDeleteEnvironment:je,onDraftChange:xe,onEditEnvironment:ce,onRevealEnvironmentValue:O,onSubmitEnvironment:ke,onValueVisibleChange:xn,revealedEnvironmentKeys:yn})]})]})]})})}function WA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=N.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=N.useState(!1),y=N.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=N.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"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},S=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map(q=>`- ${pu(q.createdAt)} · ${q.level.toUpperCase()} · ${q.event} · ${q.summary}`).join(`
92
+ `),R=JSON.stringify(w,null,2),$=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${pu(i.generatedAt)}`,"","## Latest incident","","```json",R.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
93
+ `),M=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",M),H.searchParams.set("body",$),window.open(H.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[Un(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Ip(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:y.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?Ip(w.uptimeMs):`${Ip(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(Ih,{})}),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(KA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:S,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(XA,{})}),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," · ",pu(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:[y.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 KA(){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 XA(){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 QA({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 ZA({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=wd(i.usedPercent),r=Xv(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:Aw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",Nw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function JA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function eN(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function tN({onSwitched:e}){var A;const[i,a]=N.useState(null),[r,u]=N.useState(!0),[c,d]=N.useState(!1),[p,y]=N.useState(!1),[m,b]=N.useState(""),[x,S]=N.useState(!1),[w,E]=N.useState(""),[R,$]=N.useState(null),[M,H]=N.useState(null),[q,F]=N.useState(""),[ie,D]=N.useState(null),[X,ae]=N.useState(null),[J,U]=N.useState(!1);async function te(){var C;const z=await ub();a(z),((C=z.login)==null?void 0:C.status)==="pending"&&($(z.login),S(!0))}async function ue(z){d(!0),b("");try{a(await cb(z))}catch(C){b(Ge(C).message)}finally{d(!1)}}N.useEffect(()=>{let z=!1;return ub().then(C=>{var W;z||(a(C),((W=C.login)==null?void 0:W.status)==="pending"&&($(C.login),S(!0)),C.accounts.length>0&&(d(!0),cb(!1).then(he=>{z||a(he)}).catch(he=>{z||b(Ge(he).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ge(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),N.useEffect(()=>{if(!R||R.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{eD(R.id).then(async W=>{z||($(W),W.status!=="pending"&&(window.clearInterval(C),W.status==="succeeded"&&a(he=>{if(!he||!W.account)return he;const ge=he.accounts.some(ke=>{var oe;return ke.id===((oe=W.account)==null?void 0:oe.id)})?he.accounts.map(ke=>{var oe;return ke.id===((oe=W.account)==null?void 0:oe.id)?W.account:ke}):[...he.accounts,W.account];return{...he,accounts:ge}})))}).catch(W=>{z||b(Ge(W).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[R==null?void 0:R.id,R==null?void 0:R.status]);function je(){E(""),$(null),b(""),U(!1),S(!0)}async function xe(z){z.preventDefault(),y(!0),b("");try{$(await J2(w.trim()))}catch(C){b(Ge(C).message)}finally{y(!1)}}async function ce(){if(!R||R.status!=="pending"){S(!1);return}y(!0),b("");try{const z=await tD(R.id);$(z),S(!1)}catch(z){b(Ge(z).message)}finally{y(!1)}}function G(z){H(z),F(z.name),b("")}async function se(z){if(z.preventDefault(),!M)return;const C=q.trim();if(!C||C===M.name){H(null);return}y(!0),b("");try{await nD(M.id,C),await te(),H(null)}catch(W){b(Ge(W).message)}finally{y(!1)}}async function we(){var z;if(ie){y(!0),b("");try{const C=await aD(ie.id);a(C),D(null),await e()}catch(C){const W=Ge(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{y(!1)}}}async function Me(){if(X){y(!0),b("");try{await iD(X.id),await te(),ae(null)}catch(z){b(Ge(z).detail??Ge(z).message)}finally{y(!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 ue(!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:je,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 Oe,vt;const C=(i==null?void 0:i.activeAccountId)===z.id,W=(Oe=i==null?void 0:i.accountDetails)==null?void 0:Oe[z.id],he=((vt=i==null?void 0:i.accountIssues)==null?void 0:vt[z.id])??[],ge=he.length>0,ke=he.some(St=>["missing_credential","invalid_credential","credential_unreadable"].includes(St.code)),oe=[z.email,JA(z.accountType),eN(z.planType)].filter(St=>!!St);return s.jsxs("article",{className:`codex-account-card${C?" active":""}${ge?" 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,ge?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsx("small",{children:oe.join(" · ")||`Added ${$e(z.createdAt)}`}),ge?s.jsx("div",{className:"codex-account-issues",role:"status",children:he.map(St=>s.jsx("span",{children:St.message},St.code))}):null,W!=null&&W.usage?s.jsx(ZA,{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||ke,onClick:()=>G(z),title:ke?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:ge?"Repair & rename":"Rename"}),s.jsx("button",{disabled:p||c||C||ge,onClick:()=>{b(""),D(z)},type:"button",children:C?"In use":ge?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),ae(z)},type:"button",children:"Delete"})]})]},z.id)})}),M?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 se(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:q})]}),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||!q.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!R&&S(!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 ce(),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),U(!0),window.setTimeout(()=>U(!1),1500)},type:"button",children:J?"Copied":"Copy code"})]}),s.jsx("a",{href:R.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):R.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=R.account)==null?void 0:A.name)??R.accountName})," is persisted 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 ce(),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 xe(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:()=>S(!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=>E(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:()=>S(!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&&D(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>D(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children: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:()=>D(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void we(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,X?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&ae(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:()=>ae(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:X.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:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void Me(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function nN({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=N.useState(null),[y,m]=N.useState(c),[b,x]=N.useState(!1),[S,w]=N.useState(null),[E,R]=N.useState("");function $(){m(c),R(""),p("new")}function M(F){m({username:F.username,password:"",role:F.role,active:F.active}),R(""),p(F)}function H(){b||(p(null),R(""))}async function q(F){if(F.preventDefault(),!!d){x(!0),R("");try{d==="new"?await a({username:y.username.trim(),password:y.password,role:y.role}):await u(d.id,{username:y.username.trim(),password:y.password||void 0,role:y.role,active:y.active}),p(null)}catch(ie){R(Ge(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:$,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:()=>M(F),title:"Edit",type:"button",children:s.jsx(vd,{})}),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 q(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:y.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:y.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:y.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:y.active,disabled:d.id===e.id,onChange:F=>m(ie=>({...ie,active:F.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,E?s.jsx("p",{className:"memory-editor-error",children:E}):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||!y.username.trim()||d==="new"&&y.password.length<8||d!=="new"&&y.password.length>0&&y.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,S?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:S.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):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(S.id).then(()=>w(null)).catch(F=>R(Ge(F).message))},type:"button",children:"Delete"})]})]})}):null]})}function iN({settings:e,onSave:i}){const[a,r]=N.useState(e),[u,c]=N.useState(!1);return N.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-field settings-field-wide",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Public URL"}),s.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),s.jsx("input",{"aria-label":"Public URL of this deployment",onChange:d=>r({...a,publicUrl:d.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:a.publicUrl||""})]}),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({...a,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 aN({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:y,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:S,onUpdateCodexCli:w}){var F;const E=d==="workspace",R=lu(r.model,c),$=lu(u.model,c),M=lu(p.model,c),H=Nx(r.reasoningEffort,R),q=FE(R,r.reasoningEffort);return N.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."})]}),E?s.jsx("span",{className:y>0?"section-override-count active":"section-override-count",children:y>0?`${y} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:S,children:[s.jsxs("label",{className:Xc(E,Il(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Kc,{globalValue:xb(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Il(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(Ep,{"aria-label":"Runtime model",onChange:ie=>{const D=lu(ie,c);b({...r,model:ie,reasoningEffort:Nx(r.reasoningEffort,D)})},options:gR(c,r.model),value:r.model||((F=c.find(ie=>ie.isDefault))==null?void 0:F.model)||""})]}),s.jsxs("label",{className:Xc(E,Il(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Kc,{globalValue:Ax(u.reasoningEffort,$),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Il(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(Ep,{"aria-label":"Runtime reasoning effort",onChange:ie=>b({...r,reasoningEffort:ie}),options:q,value:H})]}),s.jsxs("label",{className:Xc(E,Il(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Kc,{globalValue:wb(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Il(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(Ep,{"aria-label":"Permission mode",onChange:ie=>b({...r,sandbox:ie}),options:wA,value:r.sandbox})]}),s.jsxs("label",{className:Xc(E,Il(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Kc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Il(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 ",xb(p.model,c),", reasoning"," ",Ax(p.reasoningEffort,M),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",wb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:sh(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:E?"Save workspace overrides":"Save global runtime"})})]})]})}function Kc({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 Ep({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=N.useState(!1),d=N.useRef(null),p=a.find(y=>y.value===r)??a[0]??null;return N.useEffect(()=>{if(!u)return;function y(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",y,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",y,!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(y=>!y),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(y=>s.jsx("button",{"aria-selected":y.value===r,className:y.value===r?"selected":void 0,onClick:()=>{i(y.value),c(!1)},role:"option",type:"button",children:y.label},y.value||"default"))}):null]})}function Il(e,i,a){return e!==i?"workspace":a}function Xc(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function lN({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,y=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(sN,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(rN,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:y,title:""})})]})}function rN({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var X;const[c,d]=N.useState(fu(a)),[p,y]=N.useState(null),[m,b]=N.useState({key:"",value:""}),[x,S]=N.useState(null),[w,E]=N.useState(null),[R,$]=N.useState(null);N.useEffect(()=>{d(fu(a))},[a]),N.useEffect(()=>{if(p===null)return;const ae=J=>{J.key==="Escape"&&(F(),E(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function M(ae,J){$(J);try{const U=await r(ae);return d(fu(U)),U}finally{$(null)}}function H(){E(null),S(null),b({key:"",value:""}),y("new")}function q(ae){const J=c[ae];J&&(E(null),S(null),b({...J}),y(ae))}function F(){y(null),S(null),b({key:"",value:""})}async function ie(ae){const J=c[ae],U=(J==null?void 0:J.key)||`${ae}`;await M(c.filter((te,ue)=>ue!==ae),`delete:${U}`),E(null)}async function D(ae){ae.preventDefault(),ae.stopPropagation();const J=m.key.trim(),U=kD(J);if(U){S(U);return}const te=m.value.trim();if(!te){S("Value is required.");return}const ue=p==="new"?-1:p;if(c.some((xe,ce)=>ce!==ue&&xe.key.trim()===J)){S(`Key "${J}" already exists. Each memory key must be unique.`);return}const je={...m,key:J,value:te};p==="new"?await M([...c,je],"add"):typeof p=="number"&&await M(c.map((xe,ce)=>ce===p?je:xe),`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((ae,J)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${ae.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${ae.key}>`}),`
94
+ `,s.jsx("span",{children:ae.value}),`
95
+ `,s.jsx("span",{className:"memory-tag",children:`</${ae.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${ae.key||J+1}`,className:"memory-icon-button memory-item-edit",disabled:R!==null,title:"Edit",type:"button",onClick:()=>q(J),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||J+1}`,className:"memory-icon-button memory-item-delete",disabled:R!==null,title:"Delete",type:"button",onClick:()=>E(J),children:"×"})]})]},`${J}-${ae.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:ae=>ae.stopPropagation(),onSubmit:ae=>void D(ae),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:ae=>b(J=>({...J,key:ae.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:ae=>b(J=>({...J,value:ae.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:()=>E(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ae=>ae.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:()=>E(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((X=c[w])==null?void 0:X.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:R!==null,type:"button",onClick:()=>E(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 sN({emptyText:e,items:i}){const a=fu(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 oN({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:y,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:S,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:R}){const $=i!==null&&R.has(i),M=u==="workspace",H=M?c:r,[q,F]=N.useState(!1);function ie(){p(),b({description:"",key:"",value:""}),E(!1),F(!0)}function D(J){x(J),E(!1),F(!0)}function X(){F(!1),p(),E(!1)}function ae(J){w(J),F(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:M?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:M?"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."})]})}),M?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(Hx,{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(Hx,{emptyText:M?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:J=>y(J),onEdit:D,variables:H})]}),q?s.jsx("div",{className:"memory-editor-overlay",onClick:X,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:J=>J.stopPropagation(),onSubmit:ae,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:X,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:J=>b({...a,key:J.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:J=>b({...a,value:J.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!$&&!a.value){S(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(O2,{}):s.jsx(M2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:J=>b({...a,description:J.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:X,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>y(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:J=>J.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>y(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:()=>y(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),y(null)},children:"Delete"})]})]})}):null]})}function Hx({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 Yv({items:e,onDelete:i,onEdit:a}){const[r,u]=N.useState(null),[c,d]=N.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:cN(p.kind)}),s.jsx("span",{className:pN(p.status),children:dN(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(y=>s.jsx("span",{title:y.description||y.key,children:y.key},y.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," · ",fN(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(vd,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function uN({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:y}){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(Yv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:y,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 cN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function dN(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function fN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function pN(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 hN({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=N.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,mN(p)]).sort(([d],[p])=>{const y=r.indexOf(d),m=r.indexOf(p);return y>=0||m>=0?(y>=0?y:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById($x(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:[Un(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:$x(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Un(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function $x(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function mN(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 gN({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:Jo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Jo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Jo(e.recencyAt)}),s.jsx(Je,{label:"Turns",value:Un(e.turnCount),mono:!0}),s.jsx(Je,{label:"Items",value:Un(e.itemCount),mono:!0}),s.jsx(Je,{label:"User / agent",value:`${Un(e.userMessageCount)} / ${Un(e.agentMessageCount)}`,mono:!0}),s.jsx(Je,{label:"Compactions",value:`${Un(e.compactionCount)} / ${Un(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Je,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Je,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Je,{label:"Status",value:i.status}),s.jsx(Je,{label:"Items view",value:i.itemsView}),s.jsx(Je,{label:"Started",value:Jo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Jo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":Is(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 tu(e,i,a,r,u,c,d,p,y,m){var b,x,S,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(au,{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(eb,{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:jR(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(eb,{content:e.message.content}):s.jsx(au,{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(au,{content:R.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},R.id))});const E=Rr({},[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(id,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:E})]})})})}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&&y?s.jsx(Kv,{description:e.tool.body,icon:s.jsx(Wv,{}),onClick:()=>void y(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(AN,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(TN,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(jN,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(CN,{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(id,{})}),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(au,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(S=e.tool.rawEvents)!=null&&S.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(id,{})}):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 Vx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&yN(e.tool)}function yN(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 xN(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 bN({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:y,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:S,onOpenComplexTask:w,onOpenSystemEvent:E}){const R=xN(e.agentItems.filter(Vx)),$=e.agentItems.some(te=>!Vx(te)),M=a&&($||e.turnIds.length>0),H=c?"process":"result",[q,F]=N.useState(H),[ie,D]=N.useState(!1),X=q==="result"?R:e.agentItems,ae=RN(X);N.useEffect(()=>{ie||F(H)},[H,ie]);const J=c||M||e.stopped,U=s.jsxs(s.Fragment,{children:[J?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):M?s.jsx("button",{"aria-label":q==="result"?"Show process":"Show result",className:"turn-view-toggle",title:q==="result"?"Show process":"Show result",type:"button",onClick:()=>{D(!0),F(te=>te==="result"?(y(e.turnIds),"process"):"result")},children:q==="result"?s.jsx(vN,{}):s.jsx(wN,{})}):null}):null,X.map(te=>s.jsx(N.Fragment,{children:tu(te,i,m,d,u,b,x,S,w,E)},te.id)),q==="result"&&X.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":$?"No reliable final answer captured":"No result yet"}):null,s.jsx(nu,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:_N(X),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:J?"stopped-turn-body has-controls":"stopped-turn-body",children:U})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",J?"has-controls":""].filter(Boolean).join(" "),children:U})}function vN(){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 wN(){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 kN(){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 Wv(){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 SN(){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 Kv({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 jN({conversation:e,tool:i,onRespond:a}){var $;const r=Te(($=i.workspaceChangePayload)==null?void 0:$.content)||i.body,[u,c]=N.useState(r),[d,p]=N.useState(null),[y,m]=N.useState("source"),[b,x]=N.useState(!1),S=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:S?"pending":"preparing",E=w==="pending";N.useEffect(()=>{c(r)},[r]);async function R(M){p(M);try{await a(i,M,M==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Kv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(vd,{}),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:M=>M.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:S?"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,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":y==="source",className:y==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":y==="preview",className:y==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),y==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:M=>c(M.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Ul(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Ul(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?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 CN({tool:e,onRespond:i}){const[a,r]=N.useState(e.body),[u,c]=N.useState(null),[d,p]=N.useState("source"),y=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=y==="pending",b=Gx(a);return N.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:y})]}),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(Fx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Fx,{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:()=>{Gx(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 Gx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function Ap(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Fx({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:Ap(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:Ap(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:Ap(e.content??e.description)})]})]})})}function TN({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=HE(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:qE(a,r)})]}),s.jsx(Px,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,y)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:EN(p.kind)}),s.jsx("code",{title:p.path,children:Mv(p.path,r)}),s.jsx(Px,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${y}`))}),(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 Px({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 EN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function AN({tool:e,onRespondApproval:i}){var S;const a=KD(e),[r,u]=N.useState(!1),[c,d]=N.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,y=fd(e.body)?null:e.body,m=y?eR(y):null,b=m?`${NN(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=XD(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"}),(S=e.rawEvents)!=null&&S.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:y?s.jsx(Yx,{content:y}):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:QD(e,a)}),e.output?s.jsx(Yx,{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(DN,{events:e.rawEvents??[]}):null]})}function NN(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Yx({content:e}){const[i,a]=N.useState(!1),r=JD(e,Ux);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:ZD(e,Ux)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function DN({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 nu({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(cw,{})}):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 iu(e){return e.type==="message"?e.message.role==="user"?e.message.content:Mr(e.message.content):e.type==="assistantText"?Mr(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 RN(e){return e.map(iu).filter(i=>i.trim()).join(`
102
+
103
+ `)}function _N(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 MN({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(ON,{label:Xv(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 Xv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function ON({label:e,window:i}){const a=wd(i.usedPercent),r=qh(a),u=`${e} usage ${Aw(a)} · resets ${Nw(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 zN(e,i,a,r,u,c){const d=[...e].sort(du),p=new Map(r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>[D.turnId,D.sequence])),y=new Map(r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>[D.turnId,D.timelineAt])),m=new Map(r.filter(D=>D.nodeType==="user_message"&&D.entityId!==null).map(D=>[D.entityId,D.sequence])),b=new Map(r.filter(D=>D.nodeType==="user_message"&&D.entityId!==null).map(D=>[D.entityId,D.timelineAt])),x=r.filter(D=>D.parentId===null&&D.nodeType==="system_event"),S=x.filter(D=>D.turnId!==null&&D.subtype.startsWith("input:")),w=x.filter(D=>!S.includes(D)),E=new Set(x.flatMap(D=>D.turnId?[D.turnId]:[])),R=AE(i),$=new Map(a.map(D=>[D.id,D])),M=r.filter(D=>D.parentId===null&&D.nodeType==="agent_turn"&&D.turnId!==null).map(D=>D.turnId),q=[...new Set(r.length>0?[...M,...u?[u]:[]]:[...a.map(D=>D.id),...d.flatMap(D=>D.turnId?[D.turnId]:[]),...i.flatMap(D=>D.turnId?[D.turnId]:[])])].map(D=>{var Ke,mt,tn,xn;const X=$.get(D),ae=d.filter(Ie=>Ie.turnId===D),J=ae.filter(Ie=>Ie.role==="user").sort((Ie,Bt)=>{const jt=b.get(Ie.id)??Ie.createdAt,Pt=b.get(Bt.id)??Bt.createdAt;return jt.localeCompare(Pt)||du(Ie,Bt)}),U=ae.filter(Ie=>Ie.role==="assistant"),te=i.filter(Ie=>Ie.turnId===D).sort(du),ue=`turn:${D}`,je=r.filter(Ie=>Ie.parentId===ue).sort((Ie,Bt)=>Ie.sequence-Bt.sequence),xe=(X==null?void 0:X.origin)??R.get(D),ce=S.filter(Ie=>Ie.turnId===D).sort((Ie,Bt)=>Ie.timelineAt.localeCompare(Bt.timelineAt)||Ie.sequence-Bt.sequence).map(Ie=>Wx(Ie,void 0,c)),G=xe==="timeline_event"?[]:r.length>0?GN(je,te,uu([D],u),c):Zv(te,uu([D],u),c),se=U.map(Zo),we=je.find(Ie=>Ie.subtype==="server.complex_task.plan_updated"),Me=te.find(Ie=>Ie.event==="server.complex_task.plan_updated"),O=(we==null?void 0:we.detail)??(Me==null?void 0:Me.data),A=me(me(O).task),z=me(A.currentPlan),C=Te(z.planMarkdown),W=BN(VN(G,se),C),he=NE(X);he&&W.push({id:`turn-error-${he.turnId}`,type:"turnError",createdAt:he.createdAt,content:he.content});const ge=te.find(Ie=>Ie.event==="server.wakeup.started"),ke=me(ge==null?void 0:ge.data),oe=typeof ke.instruction=="string"?ke.instruction.trim():"",Oe=xe==="timeline_event"?te[0]:void 0,vt=E.has(D)?null:Oe?Qv(Oe,(X==null?void 0:X.startedAt)??new Date(0).toISOString()):qN(xe)?{id:`system-${D}`,type:"system",createdAt:(X==null?void 0:X.startedAt)??((Ke=te[0])==null?void 0:Ke.createdAt)??new Date(0).toISOString(),title:HN(xe??"system"),detail:$N(xe??"system",oe),fullDetail:oe||void 0}:null,St=a2(te),yn=(J[0]?b.get(J[0].id):(mt=S.find(Ie=>Ie.turnId===D))==null?void 0:mt.timelineAt)??y.get(D)??(X==null?void 0:X.startedAt)??((tn=ae[0])==null?void 0:tn.createdAt)??((xn=te[0])==null?void 0:xn.createdAt)??new Date(0).toISOString();return{id:`turn-${D}`,turnIds:[D],user:vt??(J[0]?Zo(J[0]):null),followupUsers:J.slice(1).map(Zo),acceptedSystemInputs:ce,agentItems:W,activity:St??(uu([D],u)?{id:-1,title:W.some(Ie=>Ie.type==="assistantText"&&Ie.streaming)?"Writing response":"Working",createdAt:yn,tone:"running"}:null),notificationFailure:i2(te),stopped:te.some(ew),trailingSystemItems:[],sortAt:yn,sortSequence:p.get(D)??null}}),F=d.filter(D=>!D.turnId);q.push(...F.map(D=>({id:`message-${D.id}`,turnIds:[],user:D.role==="user"?Zo(D):null,followupUsers:[],agentItems:D.role==="assistant"?[Zo(D)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(D.id)??D.createdAt,sortSequence:m.get(D.id)??null})));const ie=new Map(i.map(D=>[String(D.id),D]));return q.push(...w.map(D=>({id:D.id,turnIds:[],user:Wx(D,D.entityType==="event"&&D.entityId?ie.get(D.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:D.timelineAt,sortSequence:D.sequence}))),q.sort((D,X)=>{const ae=D.sortAt.localeCompare(X.sortAt);return ae!==0?ae:D.sortSequence!==null||X.sortSequence!==null?(D.sortSequence??Number.MAX_SAFE_INTEGER)-(X.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:D,...X})=>X)}function Wx(e,i,a){var y,m;if(i||e.entityType==="event")return Qv(i??ih(e),e.createdAt);const r=me(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Xp(r,a),x=LN(r.messages,a),S=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(E=>typeof E=="string"&&E.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**","",S.length>0?S.map(E=>{const R=a.get(E)??E;return`${Ar(R)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
104
+ `)}}const u=Te(r.complexTaskId)||Te(me(r.task).id)||void 0,c=Rv(e.title,e.subtype),d=Rr(r,[e.summary,e.contentMarkdown]),p=[`## ${Ar(c)}`,"",((y=e.contentMarkdown)==null?void 0:y.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 LN(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=me(u),d=Te(c.id),p=Te(c.senderWorkspaceId),y=Te(c.contentMarkdown).trim(),m=Te(c.createdAt);!d||a.has(d)||!p||!y||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(Te(c.senderTitleSnapshot)||p),contentMarkdown:y,createdAt:m}))}return r}function Qv(e,i){return e.event==="server.collaboration.topic_created"?IN(e,i):UN(e,i)}function IN(e,i){const a=me(me(e.data).topic),r=Te(a.title).trim()||"Untitled Topic",u=Te(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(me):[],d=Te(a.ownerWorkspaceId),p=c.find(x=>Te(x.role)==="owner"||Te(x.workspaceId)===d),y=Te(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>Te(x.role)!=="owner"&&Te(x.status)==="active"),b=m.length?m.map(x=>{const S=Te(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${Ar(S)} (\`${Te(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",Ar(r),"","**描述**","",Ar(u),"","**Owner Workspace**","",`${Ar(y)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
107
+ `)}}function UN(e,i){const a=me(e.data),r=nh(e.data),u=Rv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:Rr(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${Ar(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
108
+ `)}}function nh(e,i=""){return Array.isArray(e)?e.map(a=>nh(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,nh(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&pu(e)||e}function BN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?Mr(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?Mr(r.message.content).trim()!==a:!0):e}function qN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function HN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function $N(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?ww(i,20):"Auto resumed"}function VN(e,i){if(e.some(u=>u.type==="assistantText"))return dd(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&zh(u.tool)&&Oh(a,u.tool)||r.push(u);return dd([...r,...a])}function GN(e,i,a,r){var y;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=FN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Ha(x),x)}if(a)for(const m of i)PN(e,m)||c.set(Ha(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Ha(m),m);const p=Zv([...c.values()].sort(du),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((y=m.contentMarkdown)!=null&&y.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:YN(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:WN(m,r)})}return dd(p)}function FN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[ih(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Mh(u)===e.entityId);return r.length>0?r:[ih(e)]}return[]}function ih(e){const i=me(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":Te(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 PN(e,i){const a=i.id===void 0?null:String(i.id),r=Mh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Mh(e){if(e.event!=="codex.notification")return null;const i=me(e.data),a=me(i.params),r=me(a.item);return Te(r.id)||Te(a.itemId)||null}function YN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function WN(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"?Xp(a,i).title:e.title||kw(e.subtype),body:e.subtype==="input:collaboration_notice"?Xp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||mw(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Zv(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"){QN(r,p);continue}if(p.event==="server.knowledge.decision"){ZN(r,p);continue}if(ew(p)){n2(r);continue}if(p.event==="server.steer"){const E=me(p.data),R=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:R||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const y=bR(p.data);y!=null&&y.itemId&&d.set(y.itemId,y.phase);const m=xR(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,R=m.itemId??`phase:${E}`,$=`${u.get(R)??""}${m.text}`,M=rw($),H=c.get(R)??"",q=M.startsWith(H)?M.slice(H.length):M;if(u.set(R,$),c.set(R,M),q){const F=r[r.length-1];(F==null?void 0:F.type)==="assistantText"&&e2(F,m.itemId,E)?(F.content+=q,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:q,phase:E,itemId:m.itemId,streamKey:R,streaming:i})}continue}const b=vR(p.data);if(b!=null&&b.text){const E=Mr(b.text),R=b.itemId??`phase:${b.phase}`,$=t2(r,b.itemId,b.phase);if($>=0){const M=r[$];M.type==="assistantText"&&(E?(M.content=E,M.phase=b.phase,M.itemId=M.itemId??b.itemId,M.streamKey=M.streamKey??R,M.streaming=!1,XN(r,$,b.itemId)):r.splice($,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:R,streaming:!1});continue}const x=FD(p,a);if(x){x.rawEvents=[p];const E=Xx(r,x);if(E>=0){Qx(r[E],x);continue}if(zh(x)&&Oh(r,x)||x.kind==="command"&&x.meta==="running"&&fd(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const S=PD(p);if(S){S.rawEvents=[p];const E=Xx(r,S);if(E>=0){Qx(r[E],S);continue}r.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S});continue}if(LE(p)){KN(r,p);continue}const w=YD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return dd(r)}function KN(e,i){const a=Mh(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:tw(u.tool.rawEvents,[i])};return}}}function XN(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 QN(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=Te(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 y=e[p];if(y.type==="tool"&&(y.tool.kind==="responsibility"||y.tool.kind==="workspaceChange")&&(y.tool.workspaceChangeProposalId===r||y.tool.responsibilityProposalId===r)){const m=rA(y.tool.meta,u);y.tool={...y.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?d??y.tool.body:y.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(c).length>0?c:y.tool.workspaceChangePayload};return}}}function ZN(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 Oh(e,i){const a=Jv(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Kx(d,i))continue;const p=Mr(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"||!Kx(d,i))continue;u=c;const p=r,y=p+d.content.length;if(r=y,a>=y)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(),S=[];return b&&S.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),S.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&S.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...S),!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 Kx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function dd(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&zh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)Oh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return JN([...u,...r])}function zh(e){return typeof Jv(e)=="number"}function Jv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function JN(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 e2(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function t2(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 ew(e){return e.event==="server.stop"||e.event==="server.stopped"}function n2(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 i2(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 a2(e){for(let i=e.length-1;i>=0;i-=1){const a=Sw(e[i]);if(a)return a}return null}function Xx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[a];if(r.type==="tool"&&r.tool.kind===i.kind&&(i.itemId&&r.tool.itemId===i.itemId||r.tool.body===i.body&&r.tool.meta==="running"))return a}return-1}function Qx(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&fd(i.body)&&!fd(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:sR(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:tw(e.tool.rawEvents,i.rawEvents)}}function tw(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Ha(u);return r.has(c)?!1:(r.add(c),!0)})}function Zo(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Np(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=>nw(u)?!r.some(c=>l2(c,u)):!0)}function Dp(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 Rp(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 nw(e){return e.id.startsWith("local-")}function l2(e,i){if(nw(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 Qc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Ha(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=iw(c,d);return p!==0?p:(r.get(Ha(c))??0)-(r.get(Ha(d))??0)})}function Zx(e,i){const a=Ha(i),r=e.findIndex(c=>Ha(c)===a);if(r<0)return[...e,i];if(r2(e[r],i))return e;const u=[...e];return u[r]=i,u}function r2(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 Ha(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function du(e,i){const a=iw(e,i);return a!==0?a:s2(e.id,i.id)}function iw(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 s2(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 Jx(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 au=N.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?rw(i):Mr(i),y=a&&!r?m2(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(c2,{content:p,conversation:a}):Ul(p,a),y.length>0?s.jsx("div",{className:"artifact-preview-list",children:y.map(m=>s.jsx(h2,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},o2);function o2(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 eb({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const u2=2;function c2({content:e,conversation:i}){const a=N.useRef(null),[r,u]=N.useState(null),{committedBlocks:c,activeBlock:d}=d2(e);return N.useLayoutEffect(()=>{const p=a.current;if(!p)return;const y=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=y*u2,S=Math.min(m,x);return b!==null&&S<=b?b:S})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,y)=>s.jsx(N.Fragment,{children:Ul(p,i)},`${y}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function d2(e){const i=p2(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:f2(a),activeBlock:r}}function f2(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 y=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Zc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Zc(i,e.slice(a,m)),a=m,u=!1),y===""&&(Zc(i,e.slice(a,d)),a=d)}return a<e.length&&Zc(i,e.slice(a)),i}function Zc(e,i){i.trim()&&e.push(i)}function p2(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 h2({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 m2(e,i){const a=new Map;for(const r of g2(e)){const u=aw(r);if(u){const c=lw(u).toLowerCase(),d=a.get(c);(!d||b2(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>y2(r,i)).filter(r=>r!==null)}function g2(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 y2(e,i){const a=aw(e);if(!a||!x2(a))return null;const r=Lv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:lw(r),url:ye(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function aw(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function x2(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function lw(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function b2(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function Mr(e){return e.trim()}function rw(e){return e.trim()}function tb(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function v2(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?w2(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=S2(i);return a?Lh(a.language)==="mermaid"?s.jsx(j2,{code:a.code}):s.jsx(E2,{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:nb(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:nb(i),children:a})}}}function w2(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const a=uA(e,i.workspacePath);if(!a)return null;const r=a.line?`#L${a.line}${a.column?`C${a.column}`:""}`:"";return`${ye(`conversations/${i.id}/files?path=${encodeURIComponent(a.path)}`)}${r}`}function nb(e){return e&&e!=="char"?{textAlign:e}:void 0}function Ul(e,i){const a=k2(e);return s.jsx(hC,{components:v2(i),remarkPlugins:[EE],skipHtml:!0,children:a})}function k2(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
112
+ $2`)}function S2(e){var c;const i=N.Children.toArray(e),a=i.length===1&&N.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:ah(a.props.children).replace(/\n$/,""),language:u}}function ah(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(ah).join(""):N.isValidElement(e)?ah(e.props.children):""}const sw="github-light",_p=new Map,Mp=new Map;let Op=null,zp=null;const ow=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Lh(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 uw(e){const i=Lh(e);return!i||i==="text"||i==="txt"?"text":ow.has(i)?i:"text"}function j2({code:e}){const a=`seele-mermaid-${N.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=N.useState(!1),[c,d]=N.useState(()=>Mp.get(e)??null),[p,y]=N.useState(null);N.useEffect(()=>{let b=!1,x;const S=Mp.get(e);return S?(d(S),y(null),()=>{b=!0}):(y(null),d(null),C2(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Mp.set(e,w),d(w),y(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||y(E)},vA)}}),()=>{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(Ih,{})})}),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 C2(e,i){return(await(await T2()).render(e,i)).svg}function T2(){return zp||(zp=Et(()=>import("./mermaid.core-DgCBkrfs.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})),zp}function E2({code:e,language:i,reserveHeight:a=!1}){const[r,u]=N.useState(!1),[c,d]=N.useState(()=>{if(!lb(i))return null;const m=ab(e,i);return _p.get(m)??null}),p=a?{"--code-block-min-height":`${RA(e)}px`}:void 0;N.useEffect(()=>{let m=!1;if(!lb(i))return d(null),()=>{m=!0};const b=ab(e,i),x=_p.get(b);return x?(d(x),()=>{m=!0}):(d(null),z2(e,i).then(S=>{_p.set(b,S),m||d(S)}).catch(S=>{console.warn("Failed to highlight code block",S),m||d(null)}),()=>{m=!0})},[e,i]);async function y(){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 y(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Ih,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Ih(){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 A2(){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 cw(){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 N2(){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 D2(){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 ib(){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 R2(){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 id(){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 vd(){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 _2(){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 M2(){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 O2(){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 ab(e,i){return`${sw}:${uw(i)}:${e}`}function lb(e){const i=Lh(e);return!!i&&ow.has(i)}async function z2(e,i){return(await L2()).codeToHtml(e,{lang:uw(i),theme:sw})}function L2(){return Op||(Op=I2()),Op}async function I2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:y},{default:m},{default:b},{default:x},{default:S},{default:w},{default:E},{default:R},{default:$},{default:M},{default:H},{default:q},{default:F},{default:ie}]=await Promise.all([Et(()=>import("./core-BhqdvYWU.js"),[],import.meta.url),Et(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),Et(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),Et(()=>import("./bash-BELqPA7S.js").then(D=>D.b),[],import.meta.url),Et(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),Et(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),Et(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),Et(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),Et(()=>import("./java-CylS5w8V.js"),[],import.meta.url),Et(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),Et(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),Et(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),Et(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),Et(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),Et(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),Et(()=>import("./bash-BELqPA7S.js").then(D=>D.s),[],import.meta.url),Et(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),Et(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),Et(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),Et(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),Et(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),Et(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,y,m,b,x,S,w,E,R,$,M,H,q,F,ie]})}async function rb(){const e=ye("conversations"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).conversations}async function U2(){const e=ye("workspace-states"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).workspaces}async function sb(){const e=ye("collaboration/topics"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).topics}async function Jc(e){const i=ye(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).messages}async function B2(e){const i=ye("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ee(a,{method:"POST",url:i}),(await a.json()).topic}async function q2(e,i){const a=ye(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ee(r,{method:"PATCH",url:a}),(await r.json()).topic}async function H2(e,i){const a=ye(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Ee(r,{method:"POST",url:a}),(await r.json()).topic}async function $2(e){const i=ye(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await Ee(a,{method:"POST",url:i})}async function ob(){const e=ye("workspace-groups"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).groups}async function V2(e){const i=ye("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Ee(a,{method:"POST",url:i}),(await a.json()).group}async function G2(e,i){const a=ye(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ee(r,{method:"PATCH",url:a}),(await r.json()).group}async function F2(e){const i=ye(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await Ee(a,{method:"DELETE",url:i}),await a.json()}async function P2(){const e=ye("settings/environment"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).variables}async function Y2(e){const i=ye(`conversations/${e}/settings/environment`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).variables}async function W2(e){const i=ye(`conversations/${e}/knowledge`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).items}async function K2(){const e=ye("settings/runtime"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).settings}async function X2(){const e=ye("settings/deployment"),i=await fetch(e);return await Ee(i,{url:e}),(await i.json()).settings}async function Q2(){const e=ye("diagnostics"),i=await fetch(e);return await Ee(i,{url:e}),await i.json()}async function Z2(){const e=ye("settings/runtime/codex"),i=await fetch(e);return await Ee(i,{url:e}),await i.json()}async function ub(){const e=ye("settings/runtime/accounts"),i=await fetch(e);await Ee(i,{url:e});const a=await i.json();return zr(),a}async function cb(e=!1){const i=ye(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});await Ee(a,{method:"POST",url:i});const r=await a.json();return zr(),r}async function J2(e){const i=ye("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Ee(a,{method:"POST",url:i});const r=await a.json();return r.login.status==="succeeded"&&zr(),r.login}async function eD(e){const i=ye(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).login}async function tD(e){const i=ye(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await Ee(a,{method:"POST",url:i}),(await a.json()).login}async function nD(e,i){const a=ye(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Ee(r,{method:"PATCH",url:a});const u=await r.json();return zr(),u.account}async function iD(e){const i=ye(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await Ee(a,{method:"DELETE",url:i}),zr()}async function aD(e){const i=ye(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});await Ee(a,{method:"POST",url:i});const r=await a.json();return zr(),r}async function lD(e=!0){const i=ye(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ee(a,{url:i}),await a.json()}async function rD(e=!1){const i=ye(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await Ee(a,{url:i}),await a.json()}async function sD(){const e=ye("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Ee(i,{method:"POST",url:e}),(await i.json()).job}async function oD(e){const i=ye(`conversations/${e}/settings/runtime`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).settings}async function uD(){const e=ye("settings/memory"),i=await fetch(e);return await Ee(i,{url:e}),await i.json()}async function cD(e){const i=ye("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ee(a,{method:"PUT",url:i}),(await a.json()).settings}async function dD(e){const i=ye("settings/deployment"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ee(a,{method:"PUT",url:i}),(await a.json()).settings}async function db(e,i){const a=ye(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ee(r,{method:"PUT",url:a}),await r.json()}async function fb(e,i){const a=ye(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ee(r,{method:"POST",url:a});const u=(await r.json()).job;return fw(e,u)}async function dw(e){const i=ye(`conversations/${e}/runtime/reset`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).job}async function fw(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 dw(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 pb(e){const i=ye(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await Ee(a,{url:i}),await a.json()}async function fD(e,i){const a=ye(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Ee(r,{method:"PUT",url:a})}async function pD(e){const i=ye(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).result}async function hD(e){const i=ye(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await Ee(a,{url:i});const r=await a.json();return r.event?jw(r.event):null}async function mD(e){const i=ye(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await Ee(a,{url:i}),await a.json()}async function gD(e){const i=ye(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).compactions}function yD(e,i,a){return{model:e.model===i.model?null:e.model,reasoningEffort:PE(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 xD(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:vD(e.sourceCluesText),requiredEnv:wD(e.requiredEnvText)}}function bD(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 vD(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 wD(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 hb(e,i){const a=mb(i.attention)-mb(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function mb(e){return e==="watch"?2:e==="tracked"?1:0}function fu(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function kD(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 SD(e){return fu(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
115
+ `)}async function jD(e){const i=ye("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Ee(a,{method:"PUT",url:i}),await a.json()}async function CD(e,i,a){const r=ye("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await Ee(u,{method:"PUT",url:r}),(await u.json()).variable}async function TD(e,i,a,r){const u=ye(`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 Ee(c,{method:"PUT",url:u}),await c.json()}async function ED(e){const i=ye(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).variable.value}async function AD(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await Ee(r,{url:a}),(await r.json()).variable.value}async function ND(e){const i=ye(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await Ee(a,{method:"DELETE",url:i})}async function DD(e,i){const a=ye(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await Ee(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function RD(e,i){const a=ye(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ee(r,{method:"POST",url:a}),(await r.json()).item}async function _D(e,i,a){const r=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await Ee(u,{method:"PATCH",url:r}),(await u.json()).item}async function MD(e,i){const a=ye(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await Ee(r,{method:"DELETE",url:a})}async function OD(){const e=ye("meta"),i=await fetch(e);return await Ee(i,{url:e}),await i.json()}async function zD(e){const i=ye(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).usage??null}async function LD(e,i){const a=ye("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Ee(r,{method:"POST",url:a}),(await r.json()).conversation}async function ID(e){const i=ye(`conversations/${e}/complex-task`),a=await fetch(i);return await Ee(a,{url:i}),(await a.json()).task}async function UD(e,i){const a=ye(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await Ee(r,{url:a}),(await r.json()).task}async function BD(e,i){const a=ye(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await Ee(r,{method:"POST",url:a}),(await r.json()).task}async function qD(e,i,a){const r=ye(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await Ee(u,{method:"POST",url:r}),await u.json()}async function HD(e){const i=ye(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await Ee(a,{method:"POST",url:i}),await a.json()}async function Lp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??Iv)),i.before&&a.set("before",i.before);const r=ye(`conversations/${e}?${a}`),u=await fetch(r);return await Ee(u,{url:r}),(await u.json()).conversation}async function $D(e,i){const a=ye(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await Ee(r,{url:a}),(await r.json()).events}async function ed(e,i){const a=ye(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Ee(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function VD(e){const i=ye(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await Ee(a,{method:"DELETE",url:i})}function GD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function pw(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function FD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:fR(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=Te(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const y=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=Te(c.audience),x=Te(c.recipientWorkspaceId),S=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter($=>typeof $=="string"):Array.isArray(c.recipients)?c.recipients.filter($=>typeof $=="string"):[],w=S.filter($=>$!=="ALL").map($=>i.get($)).filter($=>!!$);let E="Topic";w.length>0?E=pw(w):S.length===1?E=S[0]==="ALL"?"Topic participants":ql(S[0]):S.length>1?E=`${S.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const R=Te(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:R?`Topic ${ql(R)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:y?"pending send":m?"done":"failed",output:y||m?Te(c.contentMarkdown)||void 0:Te(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(y||m)&&Te(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),y=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=me(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",S=Array.isArray(b.options)?b.options.map(w=>{const E=me(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
116
+ `):"";return S?`${x}
117
+
118
+ ${S}`:x}).join(`
119
+
120
+ `);return{id:e.id,kind:"activity",title:"Seele needs input",body:y||"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(Te(c.actionType)==="seele_workspace_change"){const p=me(c.payload),y=me(p.payload),m=Te(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:bw(m,y),createdAt:e.createdAt??new Date().toISOString(),itemId:Te(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:y}}const d=BE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:Te(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=UE(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=Te(d.tool)||"dynamic tool",y=me(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:yw(p,!1,y),body:xw(p,y),createdAt:e.createdAt??new Date().toISOString(),itemId:Te(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?hw(y.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&Te(y.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?me(y.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=Te(d.content)||Te(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:Te(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:Te(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),y=me(c.update),m=Te(y.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof y.changeCount=="number"?y.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:Te(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:Te(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"?ad(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:lh(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=dR(c.requestId),p=me(c.params),y=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:y,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:ad(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Qp(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:Te(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:ad(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=Qp(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:Te(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 PD(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(gw(c)||Tw(u))return null;const d=a==="item/completed",p=me(u.arguments),y=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:y==="seele_topics"?"collaboration":y==="seele_workspace_change"?"workspaceChange":"activity",title:y?yw(y,d,p):d?`Finished ${Bl(c)}`:`Working on ${Bl(c)}`,body:y?xw(y,p):vw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:y==="seele_wakeup"&&d?"after turn":d?WD(u):"running",topicAction:y==="seele_topics"?hw(p.action):void 0,workspaceChangeType:y==="seele_workspace_change"&&Te(p.type)||void 0,workspaceChangePayload:y==="seele_workspace_change"?me(p.payload):void 0}}function hw(e){return e==="read"||e==="history"||e==="send"?e:void 0}function YD(e){if(Sw(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=IE(e);return i?{id:e.id,kind:"activity",title:kw(i),body:mw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function mw(e){const i=me(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return ww(i[a].trim(),180);return"Event details are available"}function gw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function WD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Bl(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function yw(e,i,a){if(e==="seele_topics")switch(Te(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=Te(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=Bl(e);return i?`Finished ${r}`:`Running ${r}`}function xw(e,i){if(e==="seele_topics"){const a=Te(i.topicId);return a?`Topic ${ql(a)}`:"Topic"}if(e==="seele_wakeup")return Te(i.instruction)||(Te(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=Te(i.type)||"workspace";return bw(a,me(i.payload))}return Bl(e)}function bw(e,i){return e==="responsibility"?Te(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function vw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Ms(e[a].trim(),160);return typeof e.id=="string"?`${Bl(i)} ${ql(e.id)}`:Bl(i)}function KD(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 XD(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function QD(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 ZD(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
121
+ `);return a.length>i?`${u}
122
+ ...`:u}function JD(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function fd(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function eR(e){const i=e.trim();return!i||i.includes(`
123
+ `)?null:Ms(i,120)}function Ms(e,i){if(e.length<=i)return e;const a=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,a)}...${e.slice(-a)}`}function ww(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function kw(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 Sw(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 ${ql(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:lh(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:lh(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=me(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(e.event==="server.wakeup.started"){const c=me(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Ms(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=me(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=me(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Ms(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=me(e.data),r=a.method,u=me(a.params);if(r==="item/started"||r==="item/completed"){const c=me(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:Ms(ad(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 y=Tw(c);if(y)return{id:e.id,title:p?"File update finished":"Editing file",detail:Ms(y,96),createdAt:i,tone:p?"done":"running"};if(!gw(d))return{id:e.id,title:p?`Finished ${Bl(d)}`:`Working on ${Bl(d)}`,detail:vw(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"?Is(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 ${yb(d)}`:`Finished ${yb(d)}`,detail:typeof c.durationMs=="number"?Is(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function lh(e,i){const a=pd(e.before),r=pd(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${Is(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${Er(a)} → ${Er(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Uh(c)} tokens`)}else a&&u.push(`context ${Er(a)}`);return u.join(" · ")}function tR(e){const i=pd(e.before),a=pd(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${Er(i)} → ${Er(a)}`:i?u=`${Er(i)} → unavailable`:a&&(u=`unavailable → ${Er(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":Is(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Uh(r)} tokens`:"No decrease observed"}]}function pd(e){const i=me(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function Er(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Uh(e.totalTokens)} tokens`}function Uh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function nR(e){let i=null;for(const a of e)for(const r of a.events){const u=lR(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function gb(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function iR(e){let i=null;for(const a of e){const r=jw(a);r&&(!i||du(a,i)>0)&&(i=r)}return i}function jw(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=gi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:gi(d.inputTokens),cachedInputTokens:gi(d.cachedInputTokens),outputTokens:gi(d.outputTokens),reasoningOutputTokens:gi(d.reasoningOutputTokens),modelContextWindow:gi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function aR(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function Cw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function lR(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=>rR(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function rR(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 sR(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function ad(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function Tw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=Qp(e)[0])==null?void 0:a.path)??null}function me(e){return e&&typeof e=="object"?e:{}}function gi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Te(e){return typeof e=="string"?e:""}function Ar(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function oR(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,y=0,m=0;return r.forEach((b,x)=>{const S=me(b),w=Te(S.id)||`turn-${x+1}`,E=Array.isArray(S.items)?S.items:[];c+=E.length,u.push(uR(S,w)),E.forEach(R=>{const $=me(R),M=Te($.type);M==="userMessage"?d+=1:M==="agentMessage"?p+=1:M==="compaction"?y+=1:M==="contextCompaction"&&(m+=1)})}),{id:Te(a.id),sessionId:Te(a.sessionId),status:Ew(a.status),source:Bh(a.source),cwd:Te(a.cwd),path:Te(a.path),preview:Te(a.preview),createdAt:gi(a.createdAt),updatedAt:gi(a.updatedAt),recencyAt:gi(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:y,contextCompactionCount:m,turns:u}}function uR(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>Te(me(c).type)).filter(c=>c.length>0))).join(", "),u=cR(a.map(c=>rh(c)).filter(Boolean).join(" "),220);return{id:i,status:Ew(e.status),itemsView:Te(e.itemsView)||"unknown",itemCount:a.length,startedAt:gi(e.startedAt),completedAt:gi(e.completedAt),durationMs:gi(e.durationMs),itemTypes:r,preview:u,raw:e}}function rh(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(rh).filter(Boolean).join(`
124
+ `);if(!e||typeof e!="object")return"";const i=e,a=Te(i.text),r=rh(i.content);return[a,r].filter(Boolean).join(`
125
+ `)}function Ew(e){const i=me(e);return Te(i.type)||Bh(e)}function cR(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Jo(e){return e===null?"unknown":$e(e*1e3)}function dR(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Bh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function fR(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||Bh(e)}function yb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function Is(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ip(e){if(e<6e4)return Is(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 Aw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function ld(e){return e===null?"unknown":Un(e)}function wd(e){return Math.max(0,Math.min(100,Math.round(e)))}function qh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function Nw(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 pu(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function pR(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 xb(e,i){const a=lu(e,i);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function lu(e,i){return e?i.find(a=>a.model===e)??null:i.find(a=>a.isDefault)??i[0]??null}function kd(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function sh(e,i){const a=kd(e);return i?`${a} (${$e(i)})`:a}function hR(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(kd(e))}`}function mR(e,i){const a=bb(e),r=bb(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 bb(e){if(!e)return null;const i=kd(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 gR(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 vb(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 y of p){const m=yR(y);m&&i(m)}}}function yR(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 xR(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 bR(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 vR(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 td(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 zs(e){return e.length<=6?e:e.slice(0,6)}function ql(e){return e.slice(0,8)}function wb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function kb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function Up(e,...i){return i.includes(e)}function wR(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 kR(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 oh(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 SR(e,i){return`waiting ${hd(e,i)}`}function hd(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 rd(e,i=null,a=Date.now()){if(e==="waiting")return i?SR(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 Sb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function jR(e){return e==="assistant"?"Seele":"You"}const CR=document.getElementById("root"),Dw=window.__seeleCodexRoot??nS.createRoot(CR);window.__seeleCodexRoot=Dw;OR();Dw.render(s.jsx(N.StrictMode,{children:s.jsx(TR,{})}));function TR(){const[e,i]=N.useState(null),[a,r]=N.useState(null),[u,c]=N.useState(""),[d,p]=N.useState(""),[y,m]=N.useState("admin"),[b,x]=N.useState(""),[S,w]=N.useState(!1),[E,R]=N.useState("");N.useEffect(()=>{let H=!1,q=0;const F=async()=>{try{const ie=await jb();if(H)return;i(ie),p("")}catch{if(H)return;p("Reconnecting to Seele..."),q=window.setTimeout(F,2e3)}};return F(),()=>{H=!0,window.clearTimeout(q)}},[]),N.useEffect(()=>{let H=!1,q=0;const F=async()=>{try{const D=await Rw();if(H)return;r(D),c(""),q=window.setTimeout(F,D.status==="authorized"&&D.configurationReady&&D.codexAccountsReady?3e4:3e3)}catch{if(H)return;c("Unable to reach Seele."),q=window.setTimeout(F,3e3)}},ie=()=>{window.clearTimeout(q),F()};return window.addEventListener(th,ie),F(),()=>{H=!0,window.clearTimeout(q),window.removeEventListener(th,ie)}},[]),N.useEffect(()=>{const H=()=>{i({enabled:!0,authenticated:!1,user:null}),x(""),R("Your session has expired. Sign in again.")};return window.addEventListener(eh,H),()=>window.removeEventListener(eh,H)},[]);async function $(H){H.preventDefault(),w(!0),R("");try{const q=await fetch(ye("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:y,password:b})});if(!q.ok){R(q.status===401?"Incorrect username or password.":q.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}x(""),i(await jb())}catch{R("Unable to reach Seele.")}finally{w(!1)}}async function M(){await fetch(ye("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(a&&(a.status!=="authorized"||!a.configurationReady||!a.codexAccountsReady))return s.jsx(ER,{authorization:a});if(!e||!a)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||d||"Loading Seele..."})});if(!e.enabled||e.authenticated){const H=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(HA,{authEnabled:e.enabled,currentUser:H,deploymentId:a.deploymentId,onLogout:M},`${a.deploymentId}:${H.id}`)}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:$,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:H=>m(H.target.value),value:y})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:H=>x(H.target.value),type:"password",value:b})]}),E?s.jsx("p",{className:"auth-error",role:"alert",children:E}):null,s.jsx("button",{disabled:S||!y||!b,type:"submit",children:S?"Signing in...":"Sign in"})]})]})})}function ER({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?NR(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:AR(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function AR(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function NR(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function Rw(){const e=await fetch(ye("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function jb(){const e=await fetch(ye("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function DR(){const e=ye("admin/users"),i=await fetch(e);if(!i.ok)throw await un(i,{url:e});return(await i.json()).users}async function RR(e){const i=ye("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await un(a,{method:"POST",url:i});return(await a.json()).user}async function _R(e,i){const a=ye(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await un(r,{method:"PATCH",url:a});return(await r.json()).user}async function MR(e){const i=ye(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await un(a,{method:"DELETE",url:i})}function OR(){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;if(a.status===401){const u=await a.clone().json().then(c=>c&&typeof c=="object"&&"error"in c?c.error:void 0).catch(()=>{});XE(a.status,u,r.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(eh))}return a.status===503&&r.includes("/api/")&&zr(),a},window.__seeleAuthFetchInstalled=!0}function zr(){window.dispatchEvent(new Event(th))}export{Et as _,iS as a,bS as b,xx as c,mS as f,Cb as g,xS as h,dh as s,oS as w};