@seele00/seele 0.1.87 → 0.1.88

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 (68) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/package.json +1 -1
  4. package/scripts/deploy/bootstrap.sh +3 -3
  5. package/scripts/deploy/seele.env.example +8 -5
  6. package/web/dist/assets/{abnfDiagram-VRR7QNED-B7c8oNTN.js → abnfDiagram-VRR7QNED-B9Eil9NE.js} +1 -1
  7. package/web/dist/assets/{arc-BpMEgusl.js → arc-F5I-xZgt.js} +1 -1
  8. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-B4A2Wo4_.js → architectureDiagram-ZJ3FMSHR-CzOZlJM2.js} +1 -1
  9. package/web/dist/assets/{blockDiagram-677ZJIJ3-BJyRUDbZ.js → blockDiagram-677ZJIJ3-Bd1iq1N_.js} +1 -1
  10. package/web/dist/assets/{c4Diagram-LMCZKHZV-DVIENCOW.js → c4Diagram-LMCZKHZV-BrrhPVRs.js} +1 -1
  11. package/web/dist/assets/channel-Bjnm2aBw.js +1 -0
  12. package/web/dist/assets/{chunk-2Q5K7J3B-D2qwxqYh.js → chunk-2Q5K7J3B-Ch0DeOAE.js} +1 -1
  13. package/web/dist/assets/{chunk-32BRIVSS-BfLYIUbg.js → chunk-32BRIVSS-BD8Ddd2a.js} +1 -1
  14. package/web/dist/assets/{chunk-5VM5RSS4-DX3pvGYq.js → chunk-5VM5RSS4-DqWM1W46.js} +1 -1
  15. package/web/dist/assets/{chunk-EX3LRPZG-BiD3TK8z.js → chunk-EX3LRPZG-nszYQz74.js} +1 -1
  16. package/web/dist/assets/{chunk-JWPE2WC7-9HJoxEJF.js → chunk-JWPE2WC7-CS7B1FMF.js} +1 -1
  17. package/web/dist/assets/{chunk-MOJQB5TN-wJGIzBWv.js → chunk-MOJQB5TN-DbrcvFIq.js} +1 -1
  18. package/web/dist/assets/{chunk-RYQCIY6F-i4B4zJcf.js → chunk-RYQCIY6F-6OMTMNyq.js} +1 -1
  19. package/web/dist/assets/{chunk-V7JOEXUC-DK53rWUr.js → chunk-V7JOEXUC-DLfaAtl1.js} +1 -1
  20. package/web/dist/assets/{chunk-VR4S4FIN-CRzZXes5.js → chunk-VR4S4FIN-CQF0OBt2.js} +1 -1
  21. package/web/dist/assets/{chunk-XXDRQBXY-DQ-lx2nS.js → chunk-XXDRQBXY-CRbIWe_5.js} +1 -1
  22. package/web/dist/assets/classDiagram-OUVF2IWQ-DfXzLIjH.js +1 -0
  23. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DfXzLIjH.js +1 -0
  24. package/web/dist/assets/{core-oe5gdaUo.js → core-Bw-_nA47.js} +1 -1
  25. package/web/dist/assets/{cose-bilkent-JH36ORCC-ScfbG5-l.js → cose-bilkent-JH36ORCC-Dy4KVLYi.js} +1 -1
  26. package/web/dist/assets/{cynefin-VYW2F7L2-BLC7hTIX.js → cynefin-VYW2F7L2-D-wpzGnX.js} +1 -1
  27. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-DFHfd6JH.js → cynefinDiagram-TSTJHNR4-B1bH4eG1.js} +1 -1
  28. package/web/dist/assets/{dagre-VKFMJZFB-Bpt8YFNa.js → dagre-VKFMJZFB-uyWBFsne.js} +1 -1
  29. package/web/dist/assets/{diagram-FQU43EPY-Dd1h4e07.js → diagram-FQU43EPY-egNHxJln.js} +1 -1
  30. package/web/dist/assets/{diagram-G47NLZAW-CRX8u8BK.js → diagram-G47NLZAW-DPjYMHYk.js} +1 -1
  31. package/web/dist/assets/{diagram-NH7WQ7WH-DPpKZ4oP.js → diagram-NH7WQ7WH-DacOaPtf.js} +1 -1
  32. package/web/dist/assets/{diagram-OA4YK3LP-Cw78xmf_.js → diagram-OA4YK3LP-he3d8H1C.js} +1 -1
  33. package/web/dist/assets/{diagram-WEI45ONY-CsI24tz6.js → diagram-WEI45ONY-D9H5zDMI.js} +1 -1
  34. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-DK7BSySy.js → ebnfDiagram-CCIWWBDH-BbCaEszb.js} +1 -1
  35. package/web/dist/assets/{erDiagram-Q63AITRT-CMt5zO6c.js → erDiagram-Q63AITRT-wol7dN7r.js} +1 -1
  36. package/web/dist/assets/{flowDiagram-23GEKE2U-CNqGJ3Ld.js → flowDiagram-23GEKE2U-DfB4dTNi.js} +1 -1
  37. package/web/dist/assets/{ganttDiagram-NO4QXBWP-C56wodJT.js → ganttDiagram-NO4QXBWP-lMfgHePv.js} +1 -1
  38. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-BKMlYi8E.js → gitGraphDiagram-IHSO6WYX-Dbecr1Zm.js} +1 -1
  39. package/web/dist/assets/{index-Dd2mtf8B.js → index-DoxFuof_.js} +59 -59
  40. package/web/dist/assets/{infoDiagram-FWYZ7A6U-iLoOoIrC.js → infoDiagram-FWYZ7A6U-CRHjJy2g.js} +1 -1
  41. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BH8k0g0x.js → ishikawaDiagram-FXEZZL3T-kAB5eqf4.js} +1 -1
  42. package/web/dist/assets/{journeyDiagram-5HDEW3XC-Co3MBEv7.js → journeyDiagram-5HDEW3XC-CbvLi6We.js} +1 -1
  43. package/web/dist/assets/{kanban-definition-HUTT4EX6-B7MuO4zW.js → kanban-definition-HUTT4EX6-DP-DVi8m.js} +1 -1
  44. package/web/dist/assets/{linear-C8FUdg-J.js → linear-kft2ucIf.js} +1 -1
  45. package/web/dist/assets/{mermaid.core-CF4D4k4A.js → mermaid.core-CdmqBWlH.js} +4 -4
  46. package/web/dist/assets/{mindmap-definition-LN4V7U3C-DEafX8mT.js → mindmap-definition-LN4V7U3C-CP8pudgQ.js} +1 -1
  47. package/web/dist/assets/{pegDiagram-2B236MQR-BwTlg37T.js → pegDiagram-2B236MQR-D8mEf00a.js} +1 -1
  48. package/web/dist/assets/{pieDiagram-ENE6RG2P-rzG53uSk.js → pieDiagram-ENE6RG2P-DCmULKVR.js} +1 -1
  49. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DV5iUiRv.js → quadrantDiagram-ABIIQ3AL-84FSpiO5.js} +1 -1
  50. package/web/dist/assets/{railroadDiagram-RFXS5EU6-D0_HRO_e.js → railroadDiagram-RFXS5EU6-DxWwoy6C.js} +1 -1
  51. package/web/dist/assets/{requirementDiagram-TGXJPOKE-NkszbP-9.js → requirementDiagram-TGXJPOKE-DeYJX0H_.js} +1 -1
  52. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-DIzJim8O.js → sankeyDiagram-HTMAVEWB-px2uvUeU.js} +1 -1
  53. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-CgM5UE17.js → sequenceDiagram-DBY2YBRQ--lbyScDh.js} +1 -1
  54. package/web/dist/assets/{sizeCapture-X5ZJPWSS-BhU2yRYt.js → sizeCapture-X5ZJPWSS-BA6OAaHw.js} +1 -1
  55. package/web/dist/assets/{stateDiagram-2N3HPSRC-pfowBOmS.js → stateDiagram-2N3HPSRC-DomEqXQG.js} +1 -1
  56. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DBTnibp_.js +1 -0
  57. package/web/dist/assets/{swimlanes-5IMT3BWC-C1A5hYBg.js → swimlanes-5IMT3BWC-Cvz5ML7N.js} +2 -2
  58. package/web/dist/assets/swimlanesDiagram-G3AALYLV-9BB6zNMn.js +8 -0
  59. package/web/dist/assets/{timeline-definition-FHXFAJF6-DpUFJcj8.js → timeline-definition-FHXFAJF6-_b740r9n.js} +1 -1
  60. package/web/dist/assets/{vennDiagram-L72KCM5P-BBLK34lk.js → vennDiagram-L72KCM5P-ClvUXeGh.js} +1 -1
  61. package/web/dist/assets/{wardleyDiagram-EHGQE667-kOk3Xs9N.js → wardleyDiagram-EHGQE667-TD-VTMw5.js} +1 -1
  62. package/web/dist/assets/{xychartDiagram-FW5EYKEG-DCYaqHkg.js → xychartDiagram-FW5EYKEG-B7DKqjnK.js} +1 -1
  63. package/web/dist/index.html +1 -1
  64. package/web/dist/assets/channel-DGow2ZMi.js +0 -1
  65. package/web/dist/assets/classDiagram-OUVF2IWQ-DE793lw1.js +0 -1
  66. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DE793lw1.js +0 -1
  67. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-Dfygd8H-.js +0 -1
  68. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BGfUEvbA.js +0 -8
@@ -1,5 +1,5 @@
1
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 Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l;var kc=(e,i,l)=>Ak(e,typeof i!="symbol"?i+"":i,l);(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 l(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=l(u);fetch(u.href,c)}})();const Nk="modulepreload",Dk=function(e,i){return new URL(e,i).href},by={},jt=function(i,l,r){let u=Promise.resolve();if(l&&l.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(l.map(b=>{if(b=Dk(b,r),b in by)return;by[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!r)for(let M=p.length-1;M>=0;M--){const U=p[M];if(U.href===b&&(!x||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const T=document.createElement("link");if(T.rel=x?"stylesheet":Nk,x||(T.as="script"),T.crossOrigin="",T.href=b,m&&T.setAttribute("nonce",m),document.head.appendChild(T),x)return new Promise((M,U)=>{T.addEventListener("load",M),T.addEventListener("error",()=>U(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 qf={exports:{}},Eo={};/**
2
+ var Nk=Object.defineProperty;var Dk=(e,i,l)=>i in e?Nk(e,i,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[i]=l;var jc=(e,i,l)=>Dk(e,typeof i!="symbol"?i+"":i,l);(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 l(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=l(u);fetch(u.href,c)}})();const _k="modulepreload",Rk=function(e,i){return new URL(e,i).href},wy={},jt=function(i,l,r){let u=Promise.resolve();if(l&&l.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(l.map(b=>{if(b=Rk(b,r),b in wy)return;wy[b]=!0;const x=b.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(!!r)for(let M=p.length-1;M>=0;M--){const I=p[M];if(I.href===b&&(!x||I.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${j}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":_k,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((M,I)=>{E.addEventListener("load",M),E.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hf={exports:{}},Ao={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@ var Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,config
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var vy;function _k(){if(vy)return Eo;vy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(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 Eo.Fragment=i,Eo.jsx=l,Eo.jsxs=l,Eo}var wy;function Rk(){return wy||(wy=1,qf.exports=_k()),qf.exports}var s=Rk(),Hf={exports:{}},Ue={};/**
10
+ */var ky;function Mk(){if(ky)return Ao;ky=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function l(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 Ao.Fragment=i,Ao.jsx=l,Ao.jsxs=l,Ao}var jy;function Ok(){return jy||(jy=1,Hf.exports=Mk()),Hf.exports}var s=Ok(),$f={exports:{}},Ue={};/**
11
11
  * @license React
12
12
  * react.production.js
13
13
  *
@@ -15,7 +15,7 @@ var Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,config
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var ky;function Mk(){if(ky)return Ue;ky=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=j&&A[j]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,U={};function N(A,z,C){this.props=A,this.context=z,this.refs=U,this.updater=C||T}N.prototype.isReactComponent={},N.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,z,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function H(){}H.prototype=N.prototype;function $(A,z,C){this.props=A,this.context=z,this.refs=U,this.updater=C||T}var W=$.prototype=new H;W.constructor=$,M(W,N.prototype),W.isPureReactComponent=!0;var oe=Array.isArray;function _(){}var X={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function te(A,z,C){var K=C.ref;return{$$typeof:e,type:A,key:z,ref:K!==void 0?K:null,props:C}}function L(A,z){return te(A.type,z,A.props)}function ee(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function de(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(C){return z[C]})}var Ae=/\/+/g;function ge(A,z){return typeof A=="object"&&A!==null&&A.key!=null?de(""+A.key):z.toString(36)}function ue(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(_,_):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,z,C,K,me){var Q=typeof A;(Q==="undefined"||Q==="boolean")&&(A=null);var xe=!1;if(A===null)xe=!0;else switch(Q){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(A.$$typeof){case e:case i:xe=!0;break;case b:return xe=A._init,V(xe(A._payload),z,C,K,me)}}if(xe)return me=me(A),xe=K===""?"."+ge(A,0):K,oe(me)?(C="",xe!=null&&(C=xe.replace(Ae,"$&/")+"/"),V(me,z,C,"",function(Rt){return Rt})):me!=null&&(ee(me)&&(me=L(me,C+(me.key==null||A&&A.key===me.key?"":(""+me.key).replace(Ae,"$&/")+"/")+xe)),z.push(me)),1;xe=0;var ze=K===""?".":K+":";if(oe(A))for(var Ke=0;Ke<A.length;Ke++)K=A[Ke],Q=ze+ge(K,Ke),xe+=V(K,z,C,Q,me);else if(Ke=w(A),typeof Ke=="function")for(A=Ke.call(A),Ke=0;!(K=A.next()).done;)K=K.value,Q=ze+ge(K,Ke++),xe+=V(K,z,C,Q,me);else if(Q==="object"){if(typeof A.then=="function")return V(ue(A),z,C,K,me);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return xe}function se(A,z,C){if(A==null)return A;var K=[],me=0;return V(A,K,"","",function(Q){return z.call(C,Q,me++)}),K}function ye(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(C){(A._status===0||A._status===-1)&&(A._status=1,A._result=C)},function(C){(A._status===0||A._status===-1)&&(A._status=2,A._result=C)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var _e=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map: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(!ee(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ue.Activity=x,Ue.Children=O,Ue.Component=N,Ue.Fragment=l,Ue.Profiler=u,Ue.PureComponent=$,Ue.StrictMode=r,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(A){return X.H.useMemoCache(A)}},Ue.cache=function(A){return function(){return A.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(A,z,C){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var K=M({},A.props),me=A.key;if(z!=null)for(Q in z.key!==void 0&&(me=""+z.key),z)!ae.call(z,Q)||Q==="key"||Q==="__self"||Q==="__source"||Q==="ref"&&z.ref===void 0||(K[Q]=z[Q]);var Q=arguments.length-2;if(Q===1)K.children=C;else if(1<Q){for(var xe=Array(Q),ze=0;ze<Q;ze++)xe[ze]=arguments[ze+2];K.children=xe}return te(A.type,me,K)},Ue.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},Ue.createElement=function(A,z,C){var K,me={},Q=null;if(z!=null)for(K in z.key!==void 0&&(Q=""+z.key),z)ae.call(z,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(me[K]=z[K]);var xe=arguments.length-2;if(xe===1)me.children=C;else if(1<xe){for(var ze=Array(xe),Ke=0;Ke<xe;Ke++)ze[Ke]=arguments[Ke+2];me.children=ze}if(A&&A.defaultProps)for(K in xe=A.defaultProps,xe)me[K]===void 0&&(me[K]=xe[K]);return te(A,Q,me)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(A){return{$$typeof:p,render:A}},Ue.isValidElement=ee,Ue.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:ye}},Ue.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Ue.startTransition=function(A){var z=X.T,C={};X.T=C;try{var K=A(),me=X.S;me!==null&&me(C,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(_,_e)}catch(Q){_e(Q)}finally{z!==null&&C.types!==null&&(z.types=C.types),X.T=z}},Ue.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Ue.use=function(A){return X.H.use(A)},Ue.useActionState=function(A,z,C){return X.H.useActionState(A,z,C)},Ue.useCallback=function(A,z){return X.H.useCallback(A,z)},Ue.useContext=function(A){return X.H.useContext(A)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(A,z){return X.H.useDeferredValue(A,z)},Ue.useEffect=function(A,z){return X.H.useEffect(A,z)},Ue.useEffectEvent=function(A){return X.H.useEffectEvent(A)},Ue.useId=function(){return X.H.useId()},Ue.useImperativeHandle=function(A,z,C){return X.H.useImperativeHandle(A,z,C)},Ue.useInsertionEffect=function(A,z){return X.H.useInsertionEffect(A,z)},Ue.useLayoutEffect=function(A,z){return X.H.useLayoutEffect(A,z)},Ue.useMemo=function(A,z){return X.H.useMemo(A,z)},Ue.useOptimistic=function(A,z){return X.H.useOptimistic(A,z)},Ue.useReducer=function(A,z,C){return X.H.useReducer(A,z,C)},Ue.useRef=function(A){return X.H.useRef(A)},Ue.useState=function(A){return X.H.useState(A)},Ue.useSyncExternalStore=function(A,z,C){return X.H.useSyncExternalStore(A,z,C)},Ue.useTransition=function(){return X.H.useTransition()},Ue.version="19.2.7",Ue}var jy;function th(){return jy||(jy=1,Hf.exports=Mk()),Hf.exports}var D=th(),$f={exports:{}},Ao={},Gf={exports:{}},Vf={};/**
18
+ */var Sy;function zk(){if(Sy)return Ue;Sy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function w(S){return S===null||typeof S!="object"?null:(S=j&&S[j]||S["@@iterator"],typeof S=="function"?S:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,I={};function N(S,q,T){this.props=S,this.context=q,this.refs=I,this.updater=T||E}N.prototype.isReactComponent={},N.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},N.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function H(){}H.prototype=N.prototype;function $(S,q,T){this.props=S,this.context=q,this.refs=I,this.updater=T||E}var W=$.prototype=new H;W.constructor=$,M(W,N.prototype),W.isPureReactComponent=!0;var oe=Array.isArray;function _(){}var K={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ee(S,q,T){var Q=T.ref;return{$$typeof:e,type:S,key:q,ref:Q!==void 0?Q:null,props:T}}function z(S,q){return ee(S.type,q,S.props)}function te(S){return typeof S=="object"&&S!==null&&S.$$typeof===e}function de(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(T){return q[T]})}var Ae=/\/+/g;function ge(S,q){return typeof S=="object"&&S!==null&&S.key!=null?de(""+S.key):q.toString(36)}function ue(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(_,_):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function V(S,q,T,Q,me){var X=typeof S;(X==="undefined"||X==="boolean")&&(S=null);var xe=!1;if(S===null)xe=!0;else switch(X){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(S.$$typeof){case e:case i:xe=!0;break;case b:return xe=S._init,V(xe(S._payload),q,T,Q,me)}}if(xe)return me=me(S),xe=Q===""?"."+ge(S,0):Q,oe(me)?(T="",xe!=null&&(T=xe.replace(Ae,"$&/")+"/"),V(me,q,T,"",function(Rt){return Rt})):me!=null&&(te(me)&&(me=z(me,T+(me.key==null||S&&S.key===me.key?"":(""+me.key).replace(Ae,"$&/")+"/")+xe)),q.push(me)),1;xe=0;var ze=Q===""?".":Q+":";if(oe(S))for(var Ke=0;Ke<S.length;Ke++)Q=S[Ke],X=ze+ge(Q,Ke),xe+=V(Q,q,T,X,me);else if(Ke=w(S),typeof Ke=="function")for(S=Ke.call(S),Ke=0;!(Q=S.next()).done;)Q=Q.value,X=ze+ge(Q,Ke++),xe+=V(Q,q,T,X,me);else if(X==="object"){if(typeof S.then=="function")return V(ue(S),q,T,Q,me);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return xe}function se(S,q,T){if(S==null)return S;var Q=[],me=0;return V(S,Q,"","",function(X){return q.call(T,X,me++)}),Q}function ye(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(T){(S._status===0||S._status===-1)&&(S._status=1,S._result=T)},function(T){(S._status===0||S._status===-1)&&(S._status=2,S._result=T)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var De=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},O={map:se,forEach:function(S,q,T){se(S,function(){q.apply(this,arguments)},T)},count:function(S){var q=0;return se(S,function(){q++}),q},toArray:function(S){return se(S,function(q){return q})||[]},only:function(S){if(!te(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return Ue.Activity=x,Ue.Children=O,Ue.Component=N,Ue.Fragment=l,Ue.Profiler=u,Ue.PureComponent=$,Ue.StrictMode=r,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return K.H.useMemoCache(S)}},Ue.cache=function(S){return function(){return S.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(S,q,T){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var Q=M({},S.props),me=S.key;if(q!=null)for(X in q.key!==void 0&&(me=""+q.key),q)!ae.call(q,X)||X==="key"||X==="__self"||X==="__source"||X==="ref"&&q.ref===void 0||(Q[X]=q[X]);var X=arguments.length-2;if(X===1)Q.children=T;else if(1<X){for(var xe=Array(X),ze=0;ze<X;ze++)xe[ze]=arguments[ze+2];Q.children=xe}return ee(S.type,me,Q)},Ue.createContext=function(S){return S={$$typeof:d,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:c,_context:S},S},Ue.createElement=function(S,q,T){var Q,me={},X=null;if(q!=null)for(Q in q.key!==void 0&&(X=""+q.key),q)ae.call(q,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(me[Q]=q[Q]);var xe=arguments.length-2;if(xe===1)me.children=T;else if(1<xe){for(var ze=Array(xe),Ke=0;Ke<xe;Ke++)ze[Ke]=arguments[Ke+2];me.children=ze}if(S&&S.defaultProps)for(Q in xe=S.defaultProps,xe)me[Q]===void 0&&(me[Q]=xe[Q]);return ee(S,X,me)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(S){return{$$typeof:p,render:S}},Ue.isValidElement=te,Ue.lazy=function(S){return{$$typeof:b,_payload:{_status:-1,_result:S},_init:ye}},Ue.memo=function(S,q){return{$$typeof:m,type:S,compare:q===void 0?null:q}},Ue.startTransition=function(S){var q=K.T,T={};K.T=T;try{var Q=S(),me=K.S;me!==null&&me(T,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(_,De)}catch(X){De(X)}finally{q!==null&&T.types!==null&&(q.types=T.types),K.T=q}},Ue.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Ue.use=function(S){return K.H.use(S)},Ue.useActionState=function(S,q,T){return K.H.useActionState(S,q,T)},Ue.useCallback=function(S,q){return K.H.useCallback(S,q)},Ue.useContext=function(S){return K.H.useContext(S)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(S,q){return K.H.useDeferredValue(S,q)},Ue.useEffect=function(S,q){return K.H.useEffect(S,q)},Ue.useEffectEvent=function(S){return K.H.useEffectEvent(S)},Ue.useId=function(){return K.H.useId()},Ue.useImperativeHandle=function(S,q,T){return K.H.useImperativeHandle(S,q,T)},Ue.useInsertionEffect=function(S,q){return K.H.useInsertionEffect(S,q)},Ue.useLayoutEffect=function(S,q){return K.H.useLayoutEffect(S,q)},Ue.useMemo=function(S,q){return K.H.useMemo(S,q)},Ue.useOptimistic=function(S,q){return K.H.useOptimistic(S,q)},Ue.useReducer=function(S,q,T){return K.H.useReducer(S,q,T)},Ue.useRef=function(S){return K.H.useRef(S)},Ue.useState=function(S){return K.H.useState(S)},Ue.useSyncExternalStore=function(S,q,T){return K.H.useSyncExternalStore(S,q,T)},Ue.useTransition=function(){return K.H.useTransition()},Ue.version="19.2.7",Ue}var Cy;function ih(){return Cy||(Cy=1,$f.exports=zk()),$f.exports}var D=ih(),Gf={exports:{}},No={},Vf={exports:{}},Pf={};/**
19
19
  * @license React
20
20
  * scheduler.production.js
21
21
  *
@@ -23,7 +23,7 @@ var Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,config
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var Sy;function Ok(){return Sy||(Sy=1,(function(e){function i(V,se){var ye=V.length;V.push(se);e:for(;0<ye;){var _e=ye-1>>>1,O=V[_e];if(0<u(O,se))V[_e]=se,V[ye]=O,ye=_e;else break e}}function l(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var se=V[0],ye=V.pop();if(ye!==se){V[0]=ye;e:for(var _e=0,O=V.length,A=O>>>1;_e<A;){var z=2*(_e+1)-1,C=V[z],K=z+1,me=V[K];if(0>u(C,ye))K<O&&0>u(me,C)?(V[_e]=me,V[K]=ye,_e=K):(V[_e]=C,V[z]=ye,_e=z);else if(K<O&&0>u(me,ye))V[_e]=me,V[K]=ye,_e=K;else break e}}return se}function u(V,se){var ye=V.sortIndex-se.sortIndex;return ye!==0?ye:V.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 g=[],m=[],b=1,x=null,j=3,w=!1,T=!1,M=!1,U=!1,N=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function W(V){for(var se=l(m);se!==null;){if(se.callback===null)r(m);else if(se.startTime<=V)r(m),se.sortIndex=se.expirationTime,i(g,se);else break;se=l(m)}}function oe(V){if(M=!1,W(V),!T)if(l(g)!==null)T=!0,_||(_=!0,de());else{var se=l(m);se!==null&&ue(oe,se.startTime-V)}}var _=!1,X=-1,ae=5,te=-1;function L(){return U?!0:!(e.unstable_now()-te<ae)}function ee(){if(U=!1,_){var V=e.unstable_now();te=V;var se=!0;try{e:{T=!1,M&&(M=!1,H(X),X=-1),w=!0;var ye=j;try{t:{for(W(V),x=l(g);x!==null&&!(x.expirationTime>V&&L());){var _e=x.callback;if(typeof _e=="function"){x.callback=null,j=x.priorityLevel;var O=_e(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,W(V),se=!0;break t}x===l(g)&&r(g),W(V)}else r(g);x=l(g)}if(x!==null)se=!0;else{var A=l(m);A!==null&&ue(oe,A.startTime-V),se=!1}}break e}finally{x=null,j=ye,w=!1}se=void 0}}finally{se?de():_=!1}}}var de;if(typeof $=="function")de=function(){$(ee)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,ge=Ae.port2;Ae.port1.onmessage=ee,de=function(){ge.postMessage(null)}}else de=function(){N(ee,0)};function ue(V,se){X=N(function(){V(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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(V){switch(j){case 1:case 2:case 3:var se=3;break;default:se=j}var ye=j;j=se;try{return V()}finally{j=ye}},e.unstable_requestPaint=function(){U=!0},e.unstable_runWithPriority=function(V,se){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ye=j;j=V;try{return se()}finally{j=ye}},e.unstable_scheduleCallback=function(V,se,ye){var _e=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?_e+ye:_e):ye=_e,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ye+O,V={id:b++,callback:se,priorityLevel:V,startTime:ye,expirationTime:O,sortIndex:-1},ye>_e?(V.sortIndex=ye,i(m,V),l(g)===null&&V===l(m)&&(M?(H(X),X=-1):M=!0,ue(oe,ye-_e))):(V.sortIndex=O,i(g,V),T||w||(T=!0,_||(_=!0,de()))),V},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(V){var se=j;return function(){var ye=j;j=se;try{return V.apply(this,arguments)}finally{j=ye}}}})(Vf)),Vf}var Cy;function zk(){return Cy||(Cy=1,Gf.exports=Ok()),Gf.exports}var Pf={exports:{}},pn={};/**
26
+ */var Ty;function Lk(){return Ty||(Ty=1,(function(e){function i(V,se){var ye=V.length;V.push(se);e:for(;0<ye;){var De=ye-1>>>1,O=V[De];if(0<u(O,se))V[De]=se,V[ye]=O,ye=De;else break e}}function l(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var se=V[0],ye=V.pop();if(ye!==se){V[0]=ye;e:for(var De=0,O=V.length,S=O>>>1;De<S;){var q=2*(De+1)-1,T=V[q],Q=q+1,me=V[Q];if(0>u(T,ye))Q<O&&0>u(me,T)?(V[De]=me,V[Q]=ye,De=Q):(V[De]=T,V[q]=ye,De=q);else if(Q<O&&0>u(me,ye))V[De]=me,V[Q]=ye,De=Q;else break e}}return se}function u(V,se){var ye=V.sortIndex-se.sortIndex;return ye!==0?ye:V.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 g=[],m=[],b=1,x=null,j=3,w=!1,E=!1,M=!1,I=!1,N=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function W(V){for(var se=l(m);se!==null;){if(se.callback===null)r(m);else if(se.startTime<=V)r(m),se.sortIndex=se.expirationTime,i(g,se);else break;se=l(m)}}function oe(V){if(M=!1,W(V),!E)if(l(g)!==null)E=!0,_||(_=!0,de());else{var se=l(m);se!==null&&ue(oe,se.startTime-V)}}var _=!1,K=-1,ae=5,ee=-1;function z(){return I?!0:!(e.unstable_now()-ee<ae)}function te(){if(I=!1,_){var V=e.unstable_now();ee=V;var se=!0;try{e:{E=!1,M&&(M=!1,H(K),K=-1),w=!0;var ye=j;try{t:{for(W(V),x=l(g);x!==null&&!(x.expirationTime>V&&z());){var De=x.callback;if(typeof De=="function"){x.callback=null,j=x.priorityLevel;var O=De(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,W(V),se=!0;break t}x===l(g)&&r(g),W(V)}else r(g);x=l(g)}if(x!==null)se=!0;else{var S=l(m);S!==null&&ue(oe,S.startTime-V),se=!1}}break e}finally{x=null,j=ye,w=!1}se=void 0}}finally{se?de():_=!1}}}var de;if(typeof $=="function")de=function(){$(te)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,ge=Ae.port2;Ae.port1.onmessage=te,de=function(){ge.postMessage(null)}}else de=function(){N(te,0)};function ue(V,se){K=N(function(){V(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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(V){switch(j){case 1:case 2:case 3:var se=3;break;default:se=j}var ye=j;j=se;try{return V()}finally{j=ye}},e.unstable_requestPaint=function(){I=!0},e.unstable_runWithPriority=function(V,se){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ye=j;j=V;try{return se()}finally{j=ye}},e.unstable_scheduleCallback=function(V,se,ye){var De=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ye+O,V={id:b++,callback:se,priorityLevel:V,startTime:ye,expirationTime:O,sortIndex:-1},ye>De?(V.sortIndex=ye,i(m,V),l(g)===null&&V===l(m)&&(M?(H(K),K=-1):M=!0,ue(oe,ye-De))):(V.sortIndex=O,i(g,V),E||w||(E=!0,_||(_=!0,de()))),V},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(V){var se=j;return function(){var ye=j;j=se;try{return V.apply(this,arguments)}finally{j=ye}}}})(Pf)),Pf}var Ey;function Ik(){return Ey||(Ey=1,Vf.exports=Lk()),Vf.exports}var Yf={exports:{}},pn={};/**
27
27
  * @license React
28
28
  * react-dom.production.js
29
29
  *
@@ -31,7 +31,7 @@ var Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,config
31
31
  *
32
32
  * This source code is licensed under the MIT license found in the
33
33
  * LICENSE file in the root directory of this source tree.
34
- */var Ty;function Lk(){if(Ty)return pn;Ty=1;var e=th();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var r={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},pn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},pn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},pn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},pn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),j=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},pn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},pn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},pn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},pn.requestFormReset=function(g){r.d.r(g)},pn.unstable_batchedUpdates=function(g,m){return g(m)},pn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},pn.useFormStatus=function(){return d.H.useHostTransitionStatus()},pn.version="19.2.7",pn}var Ey;function Ik(){if(Ey)return Pf.exports;Ey=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Pf.exports=Lk(),Pf.exports}/**
34
+ */var Ay;function Uk(){if(Ay)return pn;Ay=1;var e=ih();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var r={d:{f:l,r:function(){throw Error(i(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return pn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,pn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},pn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},pn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},pn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},pn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),j=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:j,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:j,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},pn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},pn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},pn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},pn.requestFormReset=function(g){r.d.r(g)},pn.unstable_batchedUpdates=function(g,m){return g(m)},pn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},pn.useFormStatus=function(){return d.H.useHostTransitionStatus()},pn.version="19.2.7",pn}var Ny;function Bk(){if(Ny)return Yf.exports;Ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Yf.exports=Uk(),Yf.exports}/**
35
35
  * @license React
36
36
  * react-dom-client.production.js
37
37
  *
@@ -39,91 +39,91 @@ var Ek=Object.defineProperty;var Ak=(e,i,l)=>i in e?Ek(e,i,{enumerable:!0,config
39
39
  *
40
40
  * This source code is licensed under the MIT license found in the
41
41
  * LICENSE file in the root directory of this source tree.
42
- */var Ay;function Uk(){if(Ay)return Ao;Ay=1;var e=zk(),i=th(),l=Ik();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}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,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var a=t,o=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==o.return)a=f,o=h;else{for(var v=!1,E=f.child;E;){if(E===a){v=!0,a=f,o=h;break}if(E===o){v=!0,o=f,a=h;break}E=E.sibling}if(!v){for(E=h.child;E;){if(E===a){v=!0,a=h,o=f;break}if(E===o){v=!0,o=h,a=f;break}E=E.sibling}if(!v)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=ee&&t[ee]||t["@@iterator"],typeof t=="function"?t:null)}var Ae=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case N:return"Profiler";case U:return"StrictMode";case oe:return"Suspense";case _:return"SuspenseList";case te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case $:return t.displayName||"Context";case H:return(t._context.displayName||"Context")+".Consumer";case W:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var ue=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},_e=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=_e[O],_e[O]=null,O--)}function C(t,n){O++,_e[O]=t.current,t.current=n}var K=A(null),me=A(null),Q=A(null),xe=A(null);function ze(t,n){switch(C(Q,n),C(me,t),C(K,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?$g(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=$g(n),t=Gg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(K),C(K,t)}function Ke(){z(K),z(me),z(Q)}function Rt(t){t.memoizedState!==null&&C(xe,t);var n=K.current,a=Gg(n,t.type);n!==a&&(C(me,t),C(K,a))}function Kt(t){me.current===t&&(z(K),z(me)),xe.current===t&&(z(xe),jo._currentValue=ye)}var sn,Pe;function bt(t){if(sn===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);sn=n&&n[1]||"",Pe=-1<a.stack.indexOf(`
42
+ */var Dy;function qk(){if(Dy)return No;Dy=1;var e=Ik(),i=ih(),l=Bk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}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,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var a=t,o=n;;){var f=a.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){a=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===a)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(a.return!==o.return)a=f,o=h;else{for(var v=!1,A=f.child;A;){if(A===a){v=!0,a=f,o=h;break}if(A===o){v=!0,o=f,a=h;break}A=A.sibling}if(!v){for(A=h.child;A;){if(A===a){v=!0,a=h,o=f;break}if(A===o){v=!0,o=h,a=f;break}A=A.sibling}if(!v)throw Error(r(189))}}if(a.alternate!==o)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,j=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),oe=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),te=Symbol.iterator;function de(t){return t===null||typeof t!="object"?null:(t=te&&t[te]||t["@@iterator"],typeof t=="function"?t:null)}var Ae=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case N:return"Profiler";case I:return"StrictMode";case oe:return"Suspense";case _:return"SuspenseList";case ee:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case $:return t.displayName||"Context";case H:return(t._context.displayName||"Context")+".Consumer";case W:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case ae:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var ue=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},De=[],O=-1;function S(t){return{current:t}}function q(t){0>O||(t.current=De[O],De[O]=null,O--)}function T(t,n){O++,De[O]=t.current,t.current=n}var Q=S(null),me=S(null),X=S(null),xe=S(null);function ze(t,n){switch(T(X,n),T(me,t),T(Q,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Vg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Vg(n),t=Pg(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}q(Q),T(Q,t)}function Ke(){q(Q),q(me),q(X)}function Rt(t){t.memoizedState!==null&&T(xe,t);var n=Q.current,a=Pg(n,t.type);n!==a&&(T(me,t),T(Q,a))}function Kt(t){me.current===t&&(q(Q),q(me)),xe.current===t&&(q(xe),So._currentValue=ye)}var sn,Pe;function bt(t){if(sn===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);sn=n&&n[1]||"",Pe=-1<a.stack.indexOf(`
43
43
  at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+sn+t+Pe}var Mt=!1;function on(t,n){if(!t||Mt)return"";Mt=!0;var a=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 F=Z}Reflect.construct(t,[],re)}else{try{re.call()}catch(Z){F=Z}t.call(re.prototype)}}else{try{throw Error()}catch(Z){F=Z}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Z){if(Z&&F&&typeof Z.stack=="string")return[Z.stack,F.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],E=h[1];if(v&&E){var I=v.split(`
45
- `),Y=E.split(`
46
- `);for(f=o=0;o<I.length&&!I[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;if(o===I.length||f===Y.length)for(o=I.length-1,f=Y.length-1;1<=o&&0<=f&&I[o]!==Y[f];)f--;for(;1<=o&&0<=f;o--,f--)if(I[o]!==Y[f]){if(o!==1||f!==1)do if(o--,f--,0>f||I[o]!==Y[f]){var ne=`
47
- `+I[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{Mt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?bt(a):""}function Oe(t,n){switch(t.tag){case 26:case 27:case 5:return bt(t.type);case 16:return bt("Lazy");case 13:return t.child!==n&&n!==null?bt("Suspense Fallback"):bt("Suspense");case 19:return bt("SuspenseList");case 0:case 15:return on(t.type,!1);case 11:return on(t.type.render,!1);case 1:return on(t.type,!0);case 31:return bt("Activity");default:return""}}function Ot(t){try{var n="",a=null;do n+=Oe(t,a),a=t,t=t.return;while(t);return n}catch(o){return`
44
+ `+sn+t+Pe}var Mt=!1;function on(t,n){if(!t||Mt)return"";Mt=!0;var a=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 F=Z}Reflect.construct(t,[],re)}else{try{re.call()}catch(Z){F=Z}t.call(re.prototype)}}else{try{throw Error()}catch(Z){F=Z}(re=t())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Z){if(Z&&F&&typeof Z.stack=="string")return[Z.stack,F.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],A=h[1];if(v&&A){var L=v.split(`
45
+ `),Y=A.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 ne=`
47
+ `+L[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{Mt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?bt(a):""}function Oe(t,n){switch(t.tag){case 26:case 27:case 5:return bt(t.type);case 16:return bt("Lazy");case 13:return t.child!==n&&n!==null?bt("Suspense Fallback"):bt("Suspense");case 19:return bt("SuspenseList");case 0:case 15:return on(t.type,!1);case 11:return on(t.type.render,!1);case 1:return on(t.type,!0);case 31:return bt("Activity");default:return""}}function Ot(t){try{var n="",a=null;do n+=Oe(t,a),a=t,t=t.return;while(t);return n}catch(o){return`
48
48
  Error generating stack: `+o.message+`
49
- `+o.stack}}var gn=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,Si=e.unstable_cancelCallback,Xn=e.unstable_shouldYield,Nl=e.unstable_requestPaint,At=e.unstable_now,Dl=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,Ie=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Vt=e.log,Qn=e.unstable_setDisableYieldValue,Pt=null,St=null;function ut(t){if(typeof Vt=="function"&&Qn(t),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Pt,t)}catch{}}var rt=Math.clz32?Math.clz32:nd,Ci=Math.log,kn=Math.LN2;function nd(t){return t>>>=0,t===0?32:31-(Ci(t)/kn|0)|0}var xr=256,br=262144,_a=4194304;function Ti(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _l(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=o&134217727;return E!==0?(o=E&~h,o!==0?f=Ti(o):(v&=E,v!==0?f=Ti(v):a||(a=E&~t,a!==0&&(f=Ti(a))))):(E=o&~h,E!==0?f=Ti(E):v!==0?f=Ti(v):a||(a=o&~t,a!==0&&(f=Ti(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function nn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Rl(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 yt(){var t=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),t}function Ji(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Ra(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ma(t,n,a,o,f,h){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var E=t.entanglements,I=t.expirationTimes,Y=t.hiddenUpdates;for(a=v&~a;0<a;){var ne=31-rt(a),re=1<<ne;E[ne]=0,I[ne]=-1;var F=Y[ne];if(F!==null)for(Y[ne]=null,ne=0;ne<F.length;ne++){var Z=F[ne];Z!==null&&(Z.lane&=-536870913)}a&=~re}o!==0&&ys(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function ys(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function Ml(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var o=31-rt(a),f=1<<o;f&n|t[o]&n&&(t[o]|=n),a&=~f}}function eu(t,n){var a=n&-n;return a=(a&42)!==0?1:vr(a),(a&(t.suspendedLanes|n))!==0?0:a}function vr(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 xs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function bs(){var t=se.p;return t!==0?t:(t=window.event,t===void 0?32:fy(t.type))}function tu(t,n){var a=se.p;try{return se.p=t,n()}finally{se.p=a}}var Zn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Zn,zt="__reactProps$"+Zn,qn="__reactContainer$"+Zn,Ei="__reactEvents$"+Zn,Ol="__reactListeners$"+Zn,zl="__reactHandles$"+Zn,wr="__reactResources$"+Zn,Ai="__reactMarker$"+Zn;function vs(t){delete t[Yt],delete t[zt],delete t[Ei],delete t[Ol],delete t[zl]}function Jn(t){var n=t[Yt];if(n)return n;for(var a=t.parentNode;a;){if(n=a[qn]||a[Yt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Xg(t);t!==null;){if(a=t[Yt])return a;t=Xg(t)}return n}t=a,a=t.parentNode}return null}function Ni(t){if(t=t[Yt]||t[qn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function el(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Di(t){var n=t[wr];return n||(n=t[wr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ct(t){t[Ai]=!0}var nu=new Set,ws={};function un(t,n){_i(t,n),_i(t+"Capture",n)}function _i(t,n){for(ws[t]=n,t=0;t<n.length;t++)nu.add(n[t])}var iu=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]*$"),lu={},au={};function Ll(t){return gn.call(au,t)?!0:gn.call(lu,t)?!1:iu.test(t)?au[t]=!0:(lu[t]=!0,!1)}function kr(t,n,a){if(Ll(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){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,""+a)}}function Oa(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function Qt(t,n,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+o)}}function Lt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ru(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ri(t,n,a){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){a=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function tl(t){if(!t._valueTracker){var n=ru(t)?"checked":"value";t._valueTracker=Ri(t,n,""+t[n])}}function ks(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return t&&(o=ru(t)?t.checked?"true":"false":t.value),t=o,t!==a?(n.setValue(t),!0):!1}function jn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var hi=/[\n"\\]/g;function It(t){return t.replace(hi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function jr(t,n,a,o,f,h,v,E){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Lt(n)):t.value!==""+Lt(n)&&(t.value=""+Lt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Sr(t,v,Lt(n)):a!=null?Sr(t,v,Lt(a)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+Lt(E):t.removeAttribute("name")}function Il(t,n,a,o,f,h,v,E){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){tl(t);return}a=a!=null?""+Lt(a):"",n=n!=null?""+Lt(n):a,E||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=E?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),tl(t)}function Sr(t,n,a){n==="number"&&jn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ei(t,n,a,o){if(t=t.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=n.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Lt(a),n=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function su(t,n,a){if(n!=null&&(n=""+Lt(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+Lt(a):""}function za(t,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Lt(n),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),tl(t)}function ti(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var js=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 Cr(t,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,a):typeof a!="number"||a===0||js.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Ss(t,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,a!=null){for(var o in a)!a.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)&&a[f]!==o&&Cr(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Cr(t,h,n[h])}function Ul(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ni=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Mi=/^[\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 Bl(t){return Mi.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function yn(){}var La=null;function Ia(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ql=null,Oi=null;function Cs(t){var n=Ni(t);if(n&&(t=n.stateNode)){var a=t[zt]||null;e:switch(t=n.stateNode,n.type){case"input":if(jr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+It(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==t&&o.form===t.form){var f=o[zt]||null;if(!f)throw Error(r(90));jr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===t.form&&ks(o)}break e;case"textarea":su(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ei(t,!!a.multiple,n,!1)}}}var Ts=!1;function zi(t,n,a){if(Ts)return t(n,a);Ts=!0;try{var o=t(n);return o}finally{if(Ts=!1,(ql!==null||Oi!==null)&&(ec(),ql&&(n=ql,t=Oi,Oi=ql=null,Cs(n),t)))for(n=0;n<t.length;n++)Cs(t[n])}}function Ua(t,n){var a=t.stateNode;if(a===null)return null;var o=a[zt]||null;if(o===null)return null;a=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(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=!1;if(ii)try{var $l={};Object.defineProperty($l,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",$l,$l),window.removeEventListener("test",$l,$l)}catch{Hl=!1}var li=null,Li=null,nl=null;function Es(){if(nl)return nl;var t,n=Li,a=n.length,o,f="value"in li?li.value:li.textContent,h=f.length;for(t=0;t<a&&n[t]===f[t];t++);var v=a-t;for(o=1;o<=v&&n[a-o]===f[h-o];o++);return nl=f.slice(t,1<o?1-o:void 0)}function Ii(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 Gl(){return!0}function Tr(){return!1}function Zt(t){function n(a,o,f,h,v){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(a=t[E],this[E]=a?a(h):h[E]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Gl:Tr,this.isPropagationStopped=Tr,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ba=Zt(Ui),Vl=x({},Ui,{view:0,detail:0}),Bi=Zt(Vl),Sn,Jt,qi,il=x({},Vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ll,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!==qi&&(qi&&t.type==="mousemove"?(Sn=t.screenX-qi.screenX,Jt=t.screenY-qi.screenY):Jt=Sn=0,qi=t),Sn)},movementY:function(t){return"movementY"in t?t.movementY:Jt}}),Pl=Zt(il),Yl=x({},il,{dataTransfer:0}),Er=Zt(Yl),Ar=x({},Vl,{relatedTarget:0}),qa=Zt(Ar),As=x({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),Ne=Zt(As),ou=x({},Ui,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),mi=Zt(ou),en=x({},Ui,{data:0}),Nr=Zt(en),Ha={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lt={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"},Fl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dr(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Fl[t])?!!n[t]:!1}function ll(){return Dr}var $a=x({},Vl,{key:function(t){if(t.key){var n=Ha[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ii(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?lt[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ll,charCode:function(t){return t.type==="keypress"?Ii(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ii(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Ns=Zt($a),_r=x({},il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uu=Zt(_r),id=x({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ll}),Ga=Zt(id),cu=x({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ds=Zt(cu),_s=x({},il,{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}),Rs=Zt(_s),Ms=x({},Ui,{newState:0,oldState:0}),Rr=Zt(Ms),ld=[9,13,27,32],al=ii&&"CompositionEvent"in window,Va=null;ii&&"documentMode"in document&&(Va=document.documentMode);var ad=ii&&"TextEvent"in window&&!Va,du=ii&&(!al||Va&&8<Va&&11>=Va),Mr=" ",Hi=!1;function Wl(t,n){switch(t){case"keyup":return ld.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ve(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Kl=!1;function xn(t,n){switch(t){case"compositionend":return ve(n);case"keypress":return n.which!==32?null:(Hi=!0,Mr);case"textInput":return t=n.data,t===Mr&&Hi?null:t;default:return null}}function rd(t,n){if(Kl)return t==="compositionend"||!al&&Wl(t,n)?(t=Es(),nl=Li=li=null,Kl=!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 du&&n.locale!=="ko"?null:n.data;default:return null}}var sd={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 Pa(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!sd[t.type]:n==="textarea"}function fu(t,n,a,o){ql?Oi?Oi.push(o):Oi=[o]:ql=o,n=sc(n,"onChange"),0<n.length&&(a=new Ba("onChange","change",null,a,o),t.push({event:a,listeners:n}))}var Xl=null,rl=null;function od(t){Lg(t,0)}function Or(t){var n=el(t);if(ks(n))return t}function Ya(t,n){if(t==="change")return n}var zr=!1;if(ii){var Fa;if(ii){var Os="oninput"in document;if(!Os){var Lr=document.createElement("div");Lr.setAttribute("oninput","return;"),Os=typeof Lr.oninput=="function"}Fa=Os}else Fa=!1;zr=Fa&&(!document.documentMode||9<document.documentMode)}function pu(){Xl&&(Xl.detachEvent("onpropertychange",hu),rl=Xl=null)}function hu(t){if(t.propertyName==="value"&&Or(rl)){var n=[];fu(n,rl,t,Ia(t)),zi(od,n)}}function zs(t,n,a){t==="focusin"?(pu(),Xl=n,rl=a,Xl.attachEvent("onpropertychange",hu)):t==="focusout"&&pu()}function mu(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Or(rl)}function ud(t,n){if(t==="click")return Or(n)}function cd(t,n){if(t==="input"||t==="change")return Or(n)}function gu(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var bn=typeof Object.is=="function"?Object.is:gu;function Wa(t,n){if(bn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!gn.call(n,f)||!bn(t[f],n[f]))return!1}return!0}function yu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xu(t,n){var a=yu(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=yu(a)}}function bu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?bu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function vu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=jn(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=jn(t.document)}return n}function Ls(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 dd=ii&&"documentMode"in document&&11>=document.documentMode,Ql=null,Is=null,Ka=null,Us=!1;function wu(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Us||Ql==null||Ql!==jn(o)||(o=Ql,"selectionStart"in o&&Ls(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}),Ka&&Wa(Ka,o)||(Ka=o,o=sc(Is,"onSelect"),0<o.length&&(n=new Ba("onSelect","select",null,n,a),t.push({event:n,listeners:o}),n.target=Ql)))}function sl(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var Zl={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},Bs={},ku={};ii&&(ku=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function ol(t){if(Bs[t])return Bs[t];if(!Zl[t])return t;var n=Zl[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in ku)return Bs[t]=n[a];return t}var ju=ol("animationend"),qs=ol("animationiteration"),ai=ol("animationstart"),Hs=ol("transitionrun"),Su=ol("transitionstart"),Xa=ol("transitioncancel"),$i=ol("transitionend"),Cu=new Map,$s="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(" ");$s.push("scrollEnd");function Hn(t,n){Cu.set(t,n),un(n,[t])}var Ir=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)},Cn=[],Jl=0,Ur=0;function Qa(){for(var t=Jl,n=Ur=Jl=0;n<t;){var a=Cn[n];Cn[n++]=null;var o=Cn[n];Cn[n++]=null;var f=Cn[n];Cn[n++]=null;var h=Cn[n];if(Cn[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&&cl(a,f,h)}}function Br(t,n,a,o){Cn[Jl++]=t,Cn[Jl++]=n,Cn[Jl++]=a,Cn[Jl++]=o,Ur|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Gs(t,n,a,o){return Br(t,n,a,o),dl(t)}function ul(t,n){return Br(t,null,null,n),dl(t)}function cl(t,n,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(a),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=a|536870912),h):null}function dl(t){if(50<go)throw go=0,cf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ea={};function fd(t,n,a,o){this.tag=t,this.key=a,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 cn(t,n,a,o){return new fd(t,n,a,o)}function Vs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ri(t,n){var a=t.alternate;return a===null?(a=cn(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Tu(t,n){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function qr(t,n,a,o,f,h){var v=0;if(o=t,typeof t=="function")Vs(t)&&(v=1);else if(typeof t=="string")v=mk(t,a,K.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case te:return t=cn(31,a,n,f),t.elementType=te,t.lanes=h,t;case M:return fl(a.children,f,h,n);case U:v=8,f|=24;break;case N:return t=cn(12,a,n,f|2),t.elementType=N,t.lanes=h,t;case oe:return t=cn(13,a,n,f),t.elementType=oe,t.lanes=h,t;case _:return t=cn(19,a,n,f),t.elementType=_,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case H:v=9;break e;case W:v=11;break e;case X:v=14;break e;case ae:v=16,o=null;break e}v=29,a=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=cn(v,a,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function fl(t,n,a,o){return t=cn(7,t,o,n),t.lanes=a,t}function Ps(t,n,a){return t=cn(6,t,null,n),t.lanes=a,t}function Eu(t){var n=cn(18,null,null,0);return n.stateNode=t,n}function Ys(t,n,a){return n=cn(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Au=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var a=Au.get(t);return a!==void 0?a:(n={value:t,source:n,stack:Ot(n)},Au.set(t,n),n)}return{value:t,source:n,stack:Ot(n)}}var ta=[],na=0,Hr=null,Za=0,En=[],ln=0,Gi=null,An=1,si="";function gi(t,n){ta[na++]=Za,ta[na++]=Hr,Hr=t,Za=n}function Ja(t,n,a){En[ln++]=An,En[ln++]=si,En[ln++]=Gi,Gi=t;var o=An;t=si;var f=32-rt(o)-1;o&=~(1<<f),a+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,An=1<<32-rt(n)+f|a<<f|o,si=h+t}else An=1<<h|a<<f|o,si=t}function yi(t){t.return!==null&&(gi(t,1),Ja(t,1,0))}function er(t){for(;t===Hr;)Hr=ta[--na],ta[na]=null,Za=ta[--na],ta[na]=null;for(;t===Gi;)Gi=En[--ln],En[ln]=null,si=En[--ln],En[ln]=null,An=En[--ln],En[ln]=null}function Fs(t,n){En[ln++]=An,En[ln++]=si,En[ln++]=Gi,An=n.id,si=n.overflow,Gi=t}var Nt=null,ct=null,Ge=!1,Vi=null,Nn=!1,Ws=Error(r(519));function Pi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(Tn(n,t)),Ws}function Ks(t){var n=t.stateNode,a=t.type,o=t.memoizedProps;switch(n[Yt]=t,n[zt]=o,a){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(a=0;a<xo.length;a++)Fe(xo[a],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":Fe("invalid",n),Il(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Fe("invalid",n);break;case"textarea":Fe("invalid",n),za(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||qg(n.textContent,a)?(o.popover!=null&&(Fe("beforetoggle",n),Fe("toggle",n)),o.onScroll!=null&&Fe("scroll",n),o.onScrollEnd!=null&&Fe("scrollend",n),o.onClick!=null&&(n.onclick=yn),n=!0):n=!1,n||Pi(t,!0)}function ia(t){for(Nt=t.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Nt=Nt.return}}function la(t){if(t!==Nt)return!1;if(!Ge)return ia(t),Ge=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Cf(t.type,t.memoizedProps)),a=!a),a&&ct&&Pi(t),ia(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=Kg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=Kg(t)}else n===27?(n=ct,ba(t.type)?(t=Df,Df=null,ct=t):ct=n):ct=Nt?ci(t.stateNode.nextSibling):null;return!0}function $n(){ct=Nt=null,Ge=!1}function pl(){var t=Vi;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),Vi=null),t}function xi(t){Vi===null?Vi=[t]:Vi.push(t)}var Xs=A(null),hl=null,bi=null;function et(t,n,a){C(Xs,n._currentValue),n._currentValue=a}function dn(t){t._currentValue=Xs.current,z(Xs)}function Dn(t,n,a){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===a)break;t=t.return}}function Qs(t,n,a,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var E=h;h=f;for(var I=0;I<n.length;I++)if(E.context===n[I]){h.lanes|=a,E=h.alternate,E!==null&&(E.lanes|=a),Dn(h.return,a,t),o||(v=null);break e}h=E.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=a,h=v.alternate,h!==null&&(h.lanes|=a),Dn(v,a,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 _n(t,n,a,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var E=f.type;bn(f.pendingProps.value,v.value)||(t!==null?t.push(E):t=[E])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(jo):t=[jo])}f=f.return}t!==null&&Qs(n,t,a,o),n.flags|=262144}function $r(t){for(t=t.firstContext;t!==null;){if(!bn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ml(t){hl=t,bi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ft(t){return Nu(hl,t)}function aa(t,n){return hl===null&&ml(t),Nu(t,n)}function Nu(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},bi===null){if(t===null)throw Error(r(308));bi=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else bi=bi.next=n;return a}var pd=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},hd=e.unstable_scheduleCallback,Du=e.unstable_NormalPriority,wt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gr(){return{controller:new pd,data:new Map,refCount:0}}function ra(t){t.refCount--,t.refCount===0&&hd(Du,function(){t.controller.abort()})}var y=null,k=0,S=0,R=null;function B(t,n){if(y===null){var a=y=[];k=0,S=gf(),R={status:"pending",value:void 0,then:function(o){a.push(o)}}}return k++,n.then(J,J),n}function J(){if(--k===0&&y!==null){R!==null&&(R.status="fulfilled");var t=y;y=null,S=0,R=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function be(t,n){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var He=V.S;V.S=function(t,n){cg=At(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&B(t,n),He!==null&&He(t,n)};var Te=A(null);function we(){var t=Te.current;return t!==null?t:ht.pooledCache}function Ut(t,n){n===null?C(Te,Te.current):C(Te,n.pool)}function kt(){var t=we();return t===null?null:{parent:wt._currentValue,pool:t}}var vi=Error(r(460)),fn=Error(r(474)),oi=Error(r(542)),Yi={then:function(){}};function Vr(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Dh(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(yn,yn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Rh(t),t;default:if(typeof n.status=="string")n.then(yn,yn);else{if(t=ht,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Rh(t),t}throw nr=n,vi}}function tr(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(nr=a,vi):a}}var nr=null;function _h(){if(nr===null)throw Error(r(459));var t=nr;return nr=null,t}function Rh(t){if(t===vi||t===oi)throw Error(r(483))}var Pr=null,Zs=0;function _u(t){var n=Zs;return Zs+=1,Pr===null&&(Pr=[]),Dh(Pr,t,n)}function Js(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Ru(t,n){throw n.$$typeof===j?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Mh(t){function n(G,q){if(t){var P=G.deletions;P===null?(G.deletions=[q],G.flags|=16):P.push(q)}}function a(G,q){if(!t)return null;for(;q!==null;)n(G,q),q=q.sibling;return null}function o(G){for(var q=new Map;G!==null;)G.key!==null?q.set(G.key,G):q.set(G.index,G),G=G.sibling;return q}function f(G,q){return G=ri(G,q),G.index=0,G.sibling=null,G}function h(G,q,P){return G.index=P,t?(P=G.alternate,P!==null?(P=P.index,P<q?(G.flags|=67108866,q):P):(G.flags|=67108866,q)):(G.flags|=1048576,q)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function E(G,q,P,le){return q===null||q.tag!==6?(q=Ps(P,G.mode,le),q.return=G,q):(q=f(q,P),q.return=G,q)}function I(G,q,P,le){var De=P.type;return De===M?ne(G,q,P.props.children,le,P.key):q!==null&&(q.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===ae&&tr(De)===q.type)?(q=f(q,P.props),Js(q,P),q.return=G,q):(q=qr(P.type,P.key,P.props,null,G.mode,le),Js(q,P),q.return=G,q)}function Y(G,q,P,le){return q===null||q.tag!==4||q.stateNode.containerInfo!==P.containerInfo||q.stateNode.implementation!==P.implementation?(q=Ys(P,G.mode,le),q.return=G,q):(q=f(q,P.children||[]),q.return=G,q)}function ne(G,q,P,le,De){return q===null||q.tag!==7?(q=fl(P,G.mode,le,De),q.return=G,q):(q=f(q,P),q.return=G,q)}function re(G,q,P){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Ps(""+q,G.mode,P),q.return=G,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return P=qr(q.type,q.key,q.props,null,G.mode,P),Js(P,q),P.return=G,P;case T:return q=Ys(q,G.mode,P),q.return=G,q;case ae:return q=tr(q),re(G,q,P)}if(ue(q)||de(q))return q=fl(q,G.mode,P,null),q.return=G,q;if(typeof q.then=="function")return re(G,_u(q),P);if(q.$$typeof===$)return re(G,aa(G,q),P);Ru(G,q)}return null}function F(G,q,P,le){var De=q!==null?q.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return De!==null?null:E(G,q,""+P,le);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return P.key===De?I(G,q,P,le):null;case T:return P.key===De?Y(G,q,P,le):null;case ae:return P=tr(P),F(G,q,P,le)}if(ue(P)||de(P))return De!==null?null:ne(G,q,P,le,null);if(typeof P.then=="function")return F(G,q,_u(P),le);if(P.$$typeof===$)return F(G,q,aa(G,P),le);Ru(G,P)}return null}function Z(G,q,P,le,De){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(P)||null,E(q,G,""+le,De);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?P:le.key)||null,I(q,G,le,De);case T:return G=G.get(le.key===null?P:le.key)||null,Y(q,G,le,De);case ae:return le=tr(le),Z(G,q,P,le,De)}if(ue(le)||de(le))return G=G.get(P)||null,ne(q,G,le,De,null);if(typeof le.then=="function")return Z(G,q,P,_u(le),De);if(le.$$typeof===$)return Z(G,q,P,aa(q,le),De);Ru(q,le)}return null}function ke(G,q,P,le){for(var De=null,nt=null,Ee=q,$e=q=0,Ze=null;Ee!==null&&$e<P.length;$e++){Ee.index>$e?(Ze=Ee,Ee=null):Ze=Ee.sibling;var it=F(G,Ee,P[$e],le);if(it===null){Ee===null&&(Ee=Ze);break}t&&Ee&&it.alternate===null&&n(G,Ee),q=h(it,q,$e),nt===null?De=it:nt.sibling=it,nt=it,Ee=Ze}if($e===P.length)return a(G,Ee),Ge&&gi(G,$e),De;if(Ee===null){for(;$e<P.length;$e++)Ee=re(G,P[$e],le),Ee!==null&&(q=h(Ee,q,$e),nt===null?De=Ee:nt.sibling=Ee,nt=Ee);return Ge&&gi(G,$e),De}for(Ee=o(Ee);$e<P.length;$e++)Ze=Z(Ee,G,$e,P[$e],le),Ze!==null&&(t&&Ze.alternate!==null&&Ee.delete(Ze.key===null?$e:Ze.key),q=h(Ze,q,$e),nt===null?De=Ze:nt.sibling=Ze,nt=Ze);return t&&Ee.forEach(function(Sa){return n(G,Sa)}),Ge&&gi(G,$e),De}function Me(G,q,P,le){if(P==null)throw Error(r(151));for(var De=null,nt=null,Ee=q,$e=q=0,Ze=null,it=P.next();Ee!==null&&!it.done;$e++,it=P.next()){Ee.index>$e?(Ze=Ee,Ee=null):Ze=Ee.sibling;var Sa=F(G,Ee,it.value,le);if(Sa===null){Ee===null&&(Ee=Ze);break}t&&Ee&&Sa.alternate===null&&n(G,Ee),q=h(Sa,q,$e),nt===null?De=Sa:nt.sibling=Sa,nt=Sa,Ee=Ze}if(it.done)return a(G,Ee),Ge&&gi(G,$e),De;if(Ee===null){for(;!it.done;$e++,it=P.next())it=re(G,it.value,le),it!==null&&(q=h(it,q,$e),nt===null?De=it:nt.sibling=it,nt=it);return Ge&&gi(G,$e),De}for(Ee=o(Ee);!it.done;$e++,it=P.next())it=Z(Ee,G,$e,it.value,le),it!==null&&(t&&it.alternate!==null&&Ee.delete(it.key===null?$e:it.key),q=h(it,q,$e),nt===null?De=it:nt.sibling=it,nt=it);return t&&Ee.forEach(function(Tk){return n(G,Tk)}),Ge&&gi(G,$e),De}function pt(G,q,P,le){if(typeof P=="object"&&P!==null&&P.type===M&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case w:e:{for(var De=P.key;q!==null;){if(q.key===De){if(De=P.type,De===M){if(q.tag===7){a(G,q.sibling),le=f(q,P.props.children),le.return=G,G=le;break e}}else if(q.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===ae&&tr(De)===q.type){a(G,q.sibling),le=f(q,P.props),Js(le,P),le.return=G,G=le;break e}a(G,q);break}else n(G,q);q=q.sibling}P.type===M?(le=fl(P.props.children,G.mode,le,P.key),le.return=G,G=le):(le=qr(P.type,P.key,P.props,null,G.mode,le),Js(le,P),le.return=G,G=le)}return v(G);case T:e:{for(De=P.key;q!==null;){if(q.key===De)if(q.tag===4&&q.stateNode.containerInfo===P.containerInfo&&q.stateNode.implementation===P.implementation){a(G,q.sibling),le=f(q,P.children||[]),le.return=G,G=le;break e}else{a(G,q);break}else n(G,q);q=q.sibling}le=Ys(P,G.mode,le),le.return=G,G=le}return v(G);case ae:return P=tr(P),pt(G,q,P,le)}if(ue(P))return ke(G,q,P,le);if(de(P)){if(De=de(P),typeof De!="function")throw Error(r(150));return P=De.call(P),Me(G,q,P,le)}if(typeof P.then=="function")return pt(G,q,_u(P),le);if(P.$$typeof===$)return pt(G,q,aa(G,P),le);Ru(G,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,q!==null&&q.tag===6?(a(G,q.sibling),le=f(q,P),le.return=G,G=le):(a(G,q),le=Ps(P,G.mode,le),le.return=G,G=le),v(G)):a(G,q)}return function(G,q,P,le){try{Zs=0;var De=pt(G,q,P,le);return Pr=null,De}catch(Ee){if(Ee===vi||Ee===oi)throw Ee;var nt=cn(29,Ee,null,G.mode);return nt.lanes=le,nt.return=G,nt}finally{}}}var ir=Mh(!0),Oh=Mh(!1),sa=!1;function md(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function oa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ua(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=dl(t),cl(t,null,a),n}return Br(t,o,n,a),dl(t)}function eo(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Ml(t,a)}}function yd(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var xd=!1;function to(){if(xd){var t=R;if(t!==null)throw t}}function no(t,n,a,o){xd=!1;var f=t.updateQueue;sa=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,E=f.shared.pending;if(E!==null){f.shared.pending=null;var I=E,Y=I.next;I.next=null,v===null?h=Y:v.next=Y,v=I;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,E=ne.lastBaseUpdate,E!==v&&(E===null?ne.firstBaseUpdate=Y:E.next=Y,ne.lastBaseUpdate=I))}if(h!==null){var re=f.baseState;v=0,ne=Y=I=null,E=h;do{var F=E.lane&-536870913,Z=F!==E.lane;if(Z?(Qe&F)===F:(o&F)===F){F!==0&&F===S&&(xd=!0),ne!==null&&(ne=ne.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var ke=t,Me=E;F=n;var pt=a;switch(Me.tag){case 1:if(ke=Me.payload,typeof ke=="function"){re=ke.call(pt,re,F);break e}re=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Me.payload,F=typeof ke=="function"?ke.call(pt,re,F):ke,F==null)break e;re=x({},re,F);break e;case 2:sa=!0}}F=E.callback,F!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[F]:Z.push(F))}else Z={lane:F,tag:E.tag,payload:E.payload,callback:E.callback,next:null},ne===null?(Y=ne=Z,I=re):ne=ne.next=Z,v|=F;if(E=E.next,E===null){if(E=f.shared.pending,E===null)break;Z=E,E=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);ne===null&&(I=re),f.baseState=I,f.firstBaseUpdate=Y,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),ha|=v,t.lanes=v,t.memoizedState=re}}function zh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Lh(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)zh(a[t],n)}var Yr=A(null),Mu=A(0);function Ih(t,n){t=Sl,C(Mu,t),C(Yr,n),Sl=t|n.baseLanes}function bd(){C(Mu,Sl),C(Yr,Yr.current)}function vd(){Sl=Mu.current,z(Yr),z(Mu)}var Gn=A(null),ui=null;function ca(t){var n=t.alternate;C(Dt,Dt.current&1),C(Gn,t),ui===null&&(n===null||Yr.current!==null||n.memoizedState!==null)&&(ui=t)}function wd(t){C(Dt,Dt.current),C(Gn,t),ui===null&&(ui=t)}function Uh(t){t.tag===22?(C(Dt,Dt.current),C(Gn,t),ui===null&&(ui=t)):da()}function da(){C(Dt,Dt.current),C(Gn,Gn.current)}function Vn(t){z(Gn),ui===t&&(ui=null),z(Dt)}var Dt=A(0);function Ou(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Af(a)||Nf(a)))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 gl=0,Be=null,dt=null,Bt=null,zu=!1,Fr=!1,lr=!1,Lu=0,io=0,Wr=null,gw=0;function Tt(){throw Error(r(321))}function kd(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!bn(t[a],n[a]))return!1;return!0}function jd(t,n,a,o,f,h){return gl=h,Be=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?wm:Ud,lr=!1,h=a(o,f),lr=!1,Fr&&(h=qh(n,a,o,f)),Bh(t),h}function Bh(t){V.H=ro;var n=dt!==null&&dt.next!==null;if(gl=0,Bt=dt=Be=null,zu=!1,io=0,Wr=null,n)throw Error(r(300));t===null||qt||(t=t.dependencies,t!==null&&$r(t)&&(qt=!0))}function qh(t,n,a,o){Be=t;var f=0;do{if(Fr&&(Wr=null),io=0,Fr=!1,25<=f)throw Error(r(301));if(f+=1,Bt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=km,h=n(a,o)}while(Fr);return h}function yw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?lo(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(Be.flags|=1024),n}function Sd(){var t=Lu!==0;return Lu=0,t}function Cd(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function Td(t){if(zu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}zu=!1}gl=0,Bt=dt=Be=null,Fr=!1,io=Lu=0,Wr=null}function vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Be.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function _t(){if(dt===null){var t=Be.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=Bt===null?Be.memoizedState:Bt.next;if(n!==null)Bt=n,dt=t;else{if(t===null)throw Be.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?Be.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function Iu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(t){var n=io;return io+=1,Wr===null&&(Wr=[]),t=Dh(Wr,t,n),n=Be,(Bt===null?n.memoizedState:Bt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?wm:Ud),t}function Uu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return lo(t);if(t.$$typeof===$)return Ft(t)}throw Error(r(438,String(t)))}function Ed(t){var n=null,a=Be.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=Be.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}),a===null&&(a=Iu(),Be.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),o=0;o<t;o++)a[o]=L;return n.index++,a}function yl(t,n){return typeof n=="function"?n(t):n}function Bu(t){var n=_t();return Ad(n,dt,t)}function Ad(t,n,a){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var E=v=null,I=null,Y=n,ne=!1;do{var re=Y.lane&-536870913;if(re!==Y.lane?(Qe&re)===re:(gl&re)===re){var F=Y.revertLane;if(F===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),re===S&&(ne=!0);else if((gl&F)===F){Y=Y.next,F===S&&(ne=!0);continue}else re={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(E=I=re,v=h):I=I.next=re,Be.lanes|=F,ha|=F;re=Y.action,lr&&a(h,re),h=Y.hasEagerState?Y.eagerState:a(h,re)}else F={lane:re,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},I===null?(E=I=F,v=h):I=I.next=F,Be.lanes|=re,ha|=re;Y=Y.next}while(Y!==null&&Y!==n);if(I===null?v=h:I.next=E,!bn(h,t.memoizedState)&&(qt=!0,ne&&(a=R,a!==null)))throw a;t.memoizedState=h,t.baseState=v,t.baseQueue=I,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Nd(t){var n=_t(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var o=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);bn(h,n.memoizedState)||(qt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function Hh(t,n,a){var o=Be,f=_t(),h=Ge;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var v=!bn((dt||f).memoizedState,a);if(v&&(f.memoizedState=a,qt=!0),f=f.queue,Rd(Vh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||Bt!==null&&Bt.memoizedState.tag&1){if(o.flags|=2048,Kr(9,{destroy:void 0},Gh.bind(null,o,f,a,n),null),ht===null)throw Error(r(349));h||(gl&127)!==0||$h(o,n,a)}return a}function $h(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=Be.updateQueue,n===null?(n=Iu(),Be.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function Gh(t,n,a,o){n.value=a,n.getSnapshot=o,Ph(n)&&Yh(t)}function Vh(t,n,a){return a(function(){Ph(n)&&Yh(t)})}function Ph(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!bn(t,a)}catch{return!0}}function Yh(t){var n=ul(t,2);n!==null&&Ln(n,t,2)}function Dd(t){var n=vn();if(typeof t=="function"){var a=t;if(t=a(),lr){ut(!0);try{a()}finally{ut(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:t},n}function Fh(t,n,a,o){return t.baseState=a,Ad(t,dt,typeof o=="function"?o:yl)}function xw(t,n,a,o,f){if($u(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,Wh(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Wh(t,n){var a=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var E=a(f,o),I=V.S;I!==null&&I(v,E),Kh(t,n,E)}catch(Y){_d(t,n,Y)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=a(f,o),Kh(t,n,h)}catch(Y){_d(t,n,Y)}}function Kh(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Xh(t,n,o)},function(o){return _d(t,n,o)}):Xh(t,n,a)}function Xh(t,n,a){n.status="fulfilled",n.value=a,Qh(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,Wh(t,a)))}function _d(t,n,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,Qh(n),n=n.next;while(n!==o)}t.action=null}function Qh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Zh(t,n){return n}function Jh(t,n){if(Ge){var a=ht.formState;if(a!==null){e:{var o=Be;if(Ge){if(ct){t:{for(var f=ct,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=ci(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ct=ci(f.nextSibling),o=f.data==="F!";break e}}Pi(o)}o=!1}o&&(n=a[0])}}return a=vn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zh,lastRenderedState:n},a.queue=o,a=xm.bind(null,Be,o),o.dispatch=a,o=Dd(!1),h=Id.bind(null,Be,!1,o.queue),o=vn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,a=xw.bind(null,Be,f,h,a),f.dispatch=a,o.memoizedState=t,[n,a,!1]}function em(t){var n=_t();return tm(n,dt,t)}function tm(t,n,a){if(n=Ad(t,n,Zh)[0],t=Bu(yl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=lo(n)}catch(v){throw v===vi?oi:v}else o=n;n=_t();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Be.flags|=2048,Kr(9,{destroy:void 0},bw.bind(null,f,a),null)),[o,h,t]}function bw(t,n){t.action=n}function nm(t){var n=_t(),a=dt;if(a!==null)return tm(n,a,t);_t(),n=n.memoizedState,a=_t();var o=a.queue.dispatch;return a.memoizedState=t,[n,o,!1]}function Kr(t,n,a,o){return t={tag:t,create:a,deps:o,inst:n,next:null},n=Be.updateQueue,n===null&&(n=Iu(),Be.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,n.lastEffect=t),t}function im(){return _t().memoizedState}function qu(t,n,a,o){var f=vn();Be.flags|=t,f.memoizedState=Kr(1|n,{destroy:void 0},a,o===void 0?null:o)}function Hu(t,n,a,o){var f=_t();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&kd(o,dt.memoizedState.deps)?f.memoizedState=Kr(n,h,a,o):(Be.flags|=t,f.memoizedState=Kr(1|n,h,a,o))}function lm(t,n){qu(8390656,8,t,n)}function Rd(t,n){Hu(2048,8,t,n)}function vw(t){Be.flags|=4;var n=Be.updateQueue;if(n===null)n=Iu(),Be.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function am(t){var n=_t().memoizedState;return vw({ref:n,nextImpl:t}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function rm(t,n){return Hu(4,2,t,n)}function sm(t,n){return Hu(4,4,t,n)}function om(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function um(t,n,a){a=a!=null?a.concat([t]):null,Hu(4,4,om.bind(null,n,t),a)}function Md(){}function cm(t,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&kd(n,o[1])?o[0]:(a.memoizedState=[t,n],t)}function dm(t,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&kd(n,o[1]))return o[0];if(o=t(),lr){ut(!0);try{t()}finally{ut(!1)}}return a.memoizedState=[o,n],o}function Od(t,n,a){return a===void 0||(gl&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=fg(),Be.lanes|=t,ha|=t,a)}function fm(t,n,a,o){return bn(a,n)?a:Yr.current!==null?(t=Od(t,a,o),bn(t,n)||(qt=!0),t):(gl&42)===0||(gl&1073741824)!==0&&(Qe&261930)===0?(qt=!0,t.memoizedState=a):(t=fg(),Be.lanes|=t,ha|=t,n)}function pm(t,n,a,o,f){var h=se.p;se.p=h!==0&&8>h?h:8;var v=V.T,E={};V.T=E,Id(t,!1,n,a);try{var I=f(),Y=V.S;if(Y!==null&&Y(E,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ne=be(I,o);ao(t,n,ne,Fn(t))}else ao(t,n,o,Fn(t))}catch(re){ao(t,n,{then:function(){},status:"rejected",reason:re},Fn())}finally{se.p=h,v!==null&&E.types!==null&&(v.types=E.types),V.T=v}}function ww(){}function zd(t,n,a,o){if(t.tag!==5)throw Error(r(476));var f=hm(t).queue;pm(t,f,n,ye,a===null?ww:function(){return mm(t),a(o)})}function hm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:ye},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function mm(t){var n=hm(t);n.next===null&&(n=t.alternate.memoizedState),ao(t,n.next.queue,{},Fn())}function Ld(){return Ft(jo)}function gm(){return _t().memoizedState}function ym(){return _t().memoizedState}function kw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Fn();t=oa(a);var o=ua(n,t,a);o!==null&&(Ln(o,n,a),eo(o,n,a)),n={cache:Gr()},t.payload=n;return}n=n.return}}function jw(t,n,a){var o=Fn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$u(t)?bm(n,a):(a=Gs(t,n,a,o),a!==null&&(Ln(a,t,o),vm(a,n,o)))}function xm(t,n,a){var o=Fn();ao(t,n,a,o)}function ao(t,n,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if($u(t))bm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,E=h(v,a);if(f.hasEagerState=!0,f.eagerState=E,bn(E,v))return Br(t,n,f,0),ht===null&&Qa(),!1}catch{}finally{}if(a=Gs(t,n,f,o),a!==null)return Ln(a,t,o),vm(a,n,o),!0}return!1}function Id(t,n,a,o){if(o={lane:2,revertLane:gf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},$u(t)){if(n)throw Error(r(479))}else n=Gs(t,a,o,2),n!==null&&Ln(n,t,2)}function $u(t){var n=t.alternate;return t===Be||n!==null&&n===Be}function bm(t,n){Fr=zu=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function vm(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Ml(t,a)}}var ro={readContext:Ft,use:Uu,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};ro.useEffectEvent=Tt;var wm={readContext:Ft,use:Uu,useCallback:function(t,n){return vn().memoizedState=[t,n===void 0?null:n],t},useContext:Ft,useEffect:lm,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,qu(4194308,4,om.bind(null,n,t),a)},useLayoutEffect:function(t,n){return qu(4194308,4,t,n)},useInsertionEffect:function(t,n){qu(4,2,t,n)},useMemo:function(t,n){var a=vn();n=n===void 0?null:n;var o=t();if(lr){ut(!0);try{t()}finally{ut(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=vn();if(a!==void 0){var f=a(n);if(lr){ut(!0);try{a(n)}finally{ut(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=jw.bind(null,Be,t),[o.memoizedState,t]},useRef:function(t){var n=vn();return t={current:t},n.memoizedState=t},useState:function(t){t=Dd(t);var n=t.queue,a=xm.bind(null,Be,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:Md,useDeferredValue:function(t,n){var a=vn();return Od(a,t,n)},useTransition:function(){var t=Dd(!1);return t=pm.bind(null,Be,t.queue,!0,!1),vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=Be,f=vn();if(Ge){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),ht===null)throw Error(r(349));(Qe&127)!==0||$h(o,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,lm(Vh.bind(null,o,h,t),[t]),o.flags|=2048,Kr(9,{destroy:void 0},Gh.bind(null,o,h,a,n),null),a},useId:function(){var t=vn(),n=ht.identifierPrefix;if(Ge){var a=si,o=An;a=(o&~(1<<32-rt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Lu++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=gw++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Ld,useFormState:Jh,useActionState:Jh,useOptimistic:function(t){var n=vn();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Id.bind(null,Be,!0,a),a.dispatch=n,[t,n]},useMemoCache:Ed,useCacheRefresh:function(){return vn().memoizedState=kw.bind(null,Be)},useEffectEvent:function(t){var n=vn(),a={impl:t};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Ud={readContext:Ft,use:Uu,useCallback:cm,useContext:Ft,useEffect:Rd,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:sm,useMemo:dm,useReducer:Bu,useRef:im,useState:function(){return Bu(yl)},useDebugValue:Md,useDeferredValue:function(t,n){var a=_t();return fm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Bu(yl)[0],n=_t().memoizedState;return[typeof t=="boolean"?t:lo(t),n]},useSyncExternalStore:Hh,useId:gm,useHostTransitionStatus:Ld,useFormState:em,useActionState:em,useOptimistic:function(t,n){var a=_t();return Fh(a,dt,t,n)},useMemoCache:Ed,useCacheRefresh:ym};Ud.useEffectEvent=am;var km={readContext:Ft,use:Uu,useCallback:cm,useContext:Ft,useEffect:Rd,useImperativeHandle:um,useInsertionEffect:rm,useLayoutEffect:sm,useMemo:dm,useReducer:Nd,useRef:im,useState:function(){return Nd(yl)},useDebugValue:Md,useDeferredValue:function(t,n){var a=_t();return dt===null?Od(a,t,n):fm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Nd(yl)[0],n=_t().memoizedState;return[typeof t=="boolean"?t:lo(t),n]},useSyncExternalStore:Hh,useId:gm,useHostTransitionStatus:Ld,useFormState:nm,useActionState:nm,useOptimistic:function(t,n){var a=_t();return dt!==null?Fh(a,dt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ed,useCacheRefresh:ym};km.useEffectEvent=am;function Bd(t,n,a,o){n=t.memoizedState,a=a(o,n),a=a==null?n:x({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var qd={enqueueSetState:function(t,n,a){t=t._reactInternals;var o=Fn(),f=oa(o);f.payload=n,a!=null&&(f.callback=a),n=ua(t,f,o),n!==null&&(Ln(n,t,o),eo(n,t,o))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var o=Fn(),f=oa(o);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ua(t,f,o),n!==null&&(Ln(n,t,o),eo(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=Fn(),o=oa(a);o.tag=2,n!=null&&(o.callback=n),n=ua(t,o,a),n!==null&&(Ln(n,t,a),eo(n,t,a))}};function jm(t,n,a,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!Wa(a,o)||!Wa(f,h):!0}function Sm(t,n,a,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==t&&qd.enqueueReplaceState(n,n.state,null)}function ar(t,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(t=t.defaultProps){a===n&&(a=x({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function Cm(t){Ir(t)}function Tm(t){console.error(t)}function Em(t){Ir(t)}function Gu(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Am(t,n,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Hd(t,n,a){return a=oa(a),a.tag=3,a.payload={element:null},a.callback=function(){Gu(t,n)},a}function Nm(t){return t=oa(t),t.tag=3,t}function Dm(t,n,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Am(n,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Am(n,a,o),typeof f!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var E=o.stack;this.componentDidCatch(o.value,{componentStack:E!==null?E:""})})}function Sw(t,n,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&_n(n,a,f,!0),a=Gn.current,a!==null){switch(a.tag){case 31:case 13:return ui===null?tc():a.alternate===null&&Et===0&&(Et=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Yi?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),pf(t,o,f)),!1;case 22:return a.flags|=65536,o===Yi?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),pf(t,o,f)),!1}throw Error(r(435,a.tag))}return pf(t,o,f),tc(),!1}if(Ge)return n=Gn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Ws&&(t=Error(r(422),{cause:o}),xi(Tn(t,a)))):(o!==Ws&&(n=Error(r(423),{cause:o}),xi(Tn(n,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Tn(o,a),f=Hd(t.stateNode,o,f),yd(t,f),Et!==4&&(Et=2)),!1;var h=Error(r(520),{cause:o});if(h=Tn(h,a),mo===null?mo=[h]:mo.push(h),Et!==4&&(Et=2),n===null)return!0;o=Tn(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=Hd(a.stateNode,o,t),yd(a,t),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ma===null||!ma.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Nm(f),Dm(f,t,a,o),yd(a,f),!1}a=a.return}while(a!==null);return!1}var $d=Error(r(461)),qt=!1;function an(t,n,a,o){n.child=t===null?Oh(n,null,a,o):ir(n,t.child,a,o)}function _m(t,n,a,o,f){a=a.render;var h=n.ref;if("ref"in o){var v={};for(var E in o)E!=="ref"&&(v[E]=o[E])}else v=o;return ml(n),o=jd(t,n,a,v,h,f),E=Sd(),t!==null&&!qt?(Cd(t,n,f),xl(t,n,f)):(Ge&&E&&yi(n),n.flags|=1,an(t,n,o,f),n.child)}function Rm(t,n,a,o,f){if(t===null){var h=a.type;return typeof h=="function"&&!Vs(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,Mm(t,n,h,o,f)):(t=qr(a.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!Xd(t,f)){var v=h.memoizedProps;if(a=a.compare,a=a!==null?a:Wa,a(v,o)&&t.ref===n.ref)return xl(t,n,f)}return n.flags|=1,t=ri(h,o),t.ref=n.ref,t.return=n,n.child=t}function Mm(t,n,a,o,f){if(t!==null){var h=t.memoizedProps;if(Wa(h,o)&&t.ref===n.ref)if(qt=!1,n.pendingProps=o=h,Xd(t,f))(t.flags&131072)!==0&&(qt=!0);else return n.lanes=t.lanes,xl(t,n,f)}return Gd(t,n,a,o,f)}function Om(t,n,a,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|a:a,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 zm(t,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ut(n,h!==null?h.cachePool:null),h!==null?Ih(n,h):bd(),Uh(n);else return o=n.lanes=536870912,zm(t,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(Ut(n,h.cachePool),Ih(n,h),da(),n.memoizedState=null):(t!==null&&Ut(n,null),bd(),da());return an(t,n,f,a),n.child}function so(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function zm(t,n,a,o,f){var h=we();return h=h===null?null:{parent:wt._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},t!==null&&Ut(n,null),bd(),Uh(n),t!==null&&_n(t,n,o,!0),n.childLanes=f,null}function Vu(t,n){return n=Yu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Lm(t,n,a){return ir(n,t.child,null,a),t=Vu(n,n.pendingProps),t.flags|=2,Vn(n),n.memoizedState=null,t}function Cw(t,n,a){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ge){if(o.mode==="hidden")return t=Vu(n,o),n.lanes=536870912,so(null,t);if(wd(n),(t=ct)?(t=Wg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Gi!==null?{id:An,overflow:si}:null,retryLane:536870912,hydrationErrors:null},a=Eu(t),a.return=n,n.child=a,Nt=n,ct=null)):t=null,t===null)throw Pi(n);return n.lanes=536870912,null}return Vu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(wd(n),f)if(n.flags&256)n.flags&=-257,n=Lm(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(qt||_n(t,n,a,!1),f=(a&t.childLanes)!==0,qt||f){if(o=ht,o!==null&&(v=eu(o,a),v!==0&&v!==h.retryLane))throw h.retryLane=v,ul(t,v),Ln(o,t,v),$d;tc(),n=Lm(t,n,a)}else t=h.treeContext,ct=ci(v.nextSibling),Nt=n,Ge=!0,Vi=null,Nn=!1,t!==null&&Fs(n,t),n=Vu(n,o),n.flags|=4096;return n}return t=ri(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Pu(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Gd(t,n,a,o,f){return ml(n),a=jd(t,n,a,o,void 0,f),o=Sd(),t!==null&&!qt?(Cd(t,n,f),xl(t,n,f)):(Ge&&o&&yi(n),n.flags|=1,an(t,n,a,f),n.child)}function Im(t,n,a,o,f,h){return ml(n),n.updateQueue=null,a=qh(n,o,a,f),Bh(t),o=Sd(),t!==null&&!qt?(Cd(t,n,h),xl(t,n,h)):(Ge&&o&&yi(n),n.flags|=1,an(t,n,a,h),n.child)}function Um(t,n,a,o,f){if(ml(n),n.stateNode===null){var h=ea,v=a.contextType;typeof v=="object"&&v!==null&&(h=Ft(v)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=qd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},md(n),v=a.contextType,h.context=typeof v=="object"&&v!==null?Ft(v):ea,h.state=n.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Bd(n,a,v,o),h.state=n.memoizedState),typeof a.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&&qd.enqueueReplaceState(h,h.state,null),no(n,o,h,f),to(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var E=n.memoizedProps,I=ar(a,E);h.props=I;var Y=h.context,ne=a.contextType;v=ea,typeof ne=="object"&&ne!==null&&(v=Ft(ne));var re=a.getDerivedStateFromProps;ne=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(E||Y!==v)&&Sm(n,h,o,v),sa=!1;var F=n.memoizedState;h.state=F,no(n,o,h,f),to(),Y=n.memoizedState,E||F!==Y||sa?(typeof re=="function"&&(Bd(n,a,re,o),Y=n.memoizedState),(I=sa||jm(n,a,I,o,F,Y,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=Y),h.props=o,h.state=Y,h.context=v,o=I):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,gd(t,n),v=n.memoizedProps,ne=ar(a,v),h.props=ne,re=n.pendingProps,F=h.context,Y=a.contextType,I=ea,typeof Y=="object"&&Y!==null&&(I=Ft(Y)),E=a.getDerivedStateFromProps,(Y=typeof E=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||F!==I)&&Sm(n,h,o,I),sa=!1,F=n.memoizedState,h.state=F,no(n,o,h,f),to();var Z=n.memoizedState;v!==re||F!==Z||sa||t!==null&&t.dependencies!==null&&$r(t.dependencies)?(typeof E=="function"&&(Bd(n,a,E,o),Z=n.memoizedState),(ne=sa||jm(n,a,ne,o,F,Z,I)||t!==null&&t.dependencies!==null&&$r(t.dependencies))?(Y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Z,I),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Z,I)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Z),h.props=o,h.state=Z,h.context=I,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,Pu(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=ir(n,t.child,null,f),n.child=ir(n,null,a,f)):an(t,n,a,f),n.memoizedState=h.state,t=n.child):t=xl(t,n,f),t}function Bm(t,n,a,o){return $n(),n.flags|=256,an(t,n,a,o),n.child}var Vd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pd(t){return{baseLanes:t,cachePool:kt()}}function Yd(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Yn),t}function qm(t,n,a){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Dt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ge){if(f?ca(n):da(),(t=ct)?(t=Wg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Gi!==null?{id:An,overflow:si}:null,retryLane:536870912,hydrationErrors:null},a=Eu(t),a.return=n,n.child=a,Nt=n,ct=null)):t=null,t===null)throw Pi(n);return Nf(t)?n.lanes=32:n.lanes=536870912,null}var E=o.children;return o=o.fallback,f?(da(),f=n.mode,E=Yu({mode:"hidden",children:E},f),o=fl(o,f,a,null),E.return=n,o.return=n,E.sibling=o,n.child=E,o=n.child,o.memoizedState=Pd(a),o.childLanes=Yd(t,v,a),n.memoizedState=Vd,so(null,o)):(ca(n),Fd(n,E))}var I=t.memoizedState;if(I!==null&&(E=I.dehydrated,E!==null)){if(h)n.flags&256?(ca(n),n.flags&=-257,n=Wd(t,n,a)):n.memoizedState!==null?(da(),n.child=t.child,n.flags|=128,n=null):(da(),E=o.fallback,f=n.mode,o=Yu({mode:"visible",children:o.children},f),E=fl(E,f,a,null),E.flags|=2,o.return=n,E.return=n,o.sibling=E,n.child=o,ir(n,t.child,null,a),o=n.child,o.memoizedState=Pd(a),o.childLanes=Yd(t,v,a),n.memoizedState=Vd,n=so(null,o));else if(ca(n),Nf(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var Y=v.dgst;v=Y,o=Error(r(419)),o.stack="",o.digest=v,xi({value:o,source:null,stack:null}),n=Wd(t,n,a)}else if(qt||_n(t,n,a,!1),v=(a&t.childLanes)!==0,qt||v){if(v=ht,v!==null&&(o=eu(v,a),o!==0&&o!==I.retryLane))throw I.retryLane=o,ul(t,o),Ln(v,t,o),$d;Af(E)||tc(),n=Wd(t,n,a)}else Af(E)?(n.flags|=192,n.child=t.child,n=null):(t=I.treeContext,ct=ci(E.nextSibling),Nt=n,Ge=!0,Vi=null,Nn=!1,t!==null&&Fs(n,t),n=Fd(n,o.children),n.flags|=4096);return n}return f?(da(),E=o.fallback,f=n.mode,I=t.child,Y=I.sibling,o=ri(I,{mode:"hidden",children:o.children}),o.subtreeFlags=I.subtreeFlags&65011712,Y!==null?E=ri(Y,E):(E=fl(E,f,a,null),E.flags|=2),E.return=n,o.return=n,o.sibling=E,n.child=o,so(null,o),o=n.child,E=t.child.memoizedState,E===null?E=Pd(a):(f=E.cachePool,f!==null?(I=wt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=kt(),E={baseLanes:E.baseLanes|a,cachePool:f}),o.memoizedState=E,o.childLanes=Yd(t,v,a),n.memoizedState=Vd,so(t.child,o)):(ca(n),a=t.child,t=a.sibling,a=ri(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=a,n.memoizedState=null,a)}function Fd(t,n){return n=Yu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Yu(t,n){return t=cn(22,t,null,n),t.lanes=0,t}function Wd(t,n,a){return ir(n,t.child,null,a),t=Fd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Hm(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Dn(t.return,n,a)}function Kd(t,n,a,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=f,v.treeForkCount=h)}function $m(t,n,a){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Dt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,C(Dt,v),an(t,n,o,a),o=Ge?Za:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Hm(t,a,n);else if(t.tag===19)Hm(t,a,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(a=n.child,f=null;a!==null;)t=a.alternate,t!==null&&Ou(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Kd(n,!1,f,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Ou(t)===null){n.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Kd(n,!0,a,null,h,o);break;case"together":Kd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function xl(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),ha|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(_n(t,n,a,!1),(a&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,a=ri(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=ri(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function Xd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&$r(t)))}function Tw(t,n,a){switch(n.tag){case 3:ze(n,n.stateNode.containerInfo),et(n,wt,t.memoizedState.cache),$n();break;case 27:case 5:Rt(n);break;case 4:ze(n,n.stateNode.containerInfo);break;case 10:et(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,wd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ca(n),n.flags|=128,null):(a&n.child.childLanes)!==0?qm(t,n,a):(ca(n),t=xl(t,n,a),t!==null?t.sibling:null);ca(n);break;case 19:var f=(t.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(_n(t,n,a,!1),o=(a&n.childLanes)!==0),f){if(o)return $m(t,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),C(Dt,Dt.current),o)break;return null;case 22:return n.lanes=0,Om(t,n,a,n.pendingProps);case 24:et(n,wt,t.memoizedState.cache)}return xl(t,n,a)}function Gm(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)qt=!0;else{if(!Xd(t,a)&&(n.flags&128)===0)return qt=!1,Tw(t,n,a);qt=(t.flags&131072)!==0}else qt=!1,Ge&&(n.flags&1048576)!==0&&Ja(n,Za,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=tr(n.elementType),n.type=t,typeof t=="function")Vs(t)?(o=ar(t,o),n.tag=1,n=Um(null,n,t,o,a)):(n.tag=0,n=Gd(null,n,t,o,a));else{if(t!=null){var f=t.$$typeof;if(f===W){n.tag=11,n=_m(null,n,t,o,a);break e}else if(f===X){n.tag=14,n=Rm(null,n,t,o,a);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Gd(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,f=ar(o,n.pendingProps),Um(t,n,o,f,a);case 3:e:{if(ze(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,gd(t,n),no(n,o,null,a);var v=n.memoizedState;if(o=v.cache,et(n,wt,o),o!==h.cache&&Qs(n,[wt],a,!0),to(),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=Bm(t,n,o,a);break e}else if(o!==f){f=Tn(Error(r(424)),n),xi(f),n=Bm(t,n,o,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ct=ci(t.firstChild),Nt=n,Ge=!0,Vi=null,Nn=!0,a=Oh(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($n(),o===f){n=xl(t,n,a);break e}an(t,n,o,a)}n=n.child}return n;case 26:return Pu(t,n),t===null?(a=ey(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ge||(a=n.type,t=n.pendingProps,o=oc(Q.current).createElement(a),o[Yt]=n,o[zt]=t,rn(o,a,t),Ct(o),n.stateNode=o):n.memoizedState=ey(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Rt(n),t===null&&Ge&&(o=n.stateNode=Qg(n.type,n.pendingProps,Q.current),Nt=n,Nn=!0,f=ct,ba(n.type)?(Df=f,ct=ci(o.firstChild)):ct=f),an(t,n,n.pendingProps.children,a),Pu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ge&&((f=o=ct)&&(o=nk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Nt=n,ct=ci(o.firstChild),Nn=!1,f=!0):f=!1),f||Pi(n)),Rt(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Cf(f,h)?o=null:v!==null&&Cf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=jd(t,n,yw,null,null,a),jo._currentValue=f),Pu(t,n),an(t,n,o,a),n.child;case 6:return t===null&&Ge&&((t=a=ct)&&(a=ik(a,n.pendingProps,Nn),a!==null?(n.stateNode=a,Nt=n,ct=null,t=!0):t=!1),t||Pi(n)),null;case 13:return qm(t,n,a);case 4:return ze(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=ir(n,null,o,a):an(t,n,o,a),n.child;case 11:return _m(t,n,n.type,n.pendingProps,a);case 7:return an(t,n,n.pendingProps,a),n.child;case 8:return an(t,n,n.pendingProps.children,a),n.child;case 12:return an(t,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,et(n,n.type,o.value),an(t,n,o.children,a),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,ml(n),f=Ft(f),o=o(f),n.flags|=1,an(t,n,o,a),n.child;case 14:return Rm(t,n,n.type,n.pendingProps,a);case 15:return Mm(t,n,n.type,n.pendingProps,a);case 19:return $m(t,n,a);case 31:return Cw(t,n,a);case 22:return Om(t,n,a,n.pendingProps);case 24:return ml(n),o=Ft(wt),t===null?(f=we(),f===null&&(f=ht,h=Gr(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:o,cache:f},md(n),et(n,wt,f)):((t.lanes&a)!==0&&(gd(t,n),no(n,null,null,a),to()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),et(n,wt,o)):(o=h.cache,et(n,wt,o),o!==f.cache&&Qs(n,[wt],a,!0))),an(t,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function bl(t){t.flags|=4}function Qd(t,n,a,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(gg())t.flags|=8192;else throw nr=Yi,fn}else t.flags&=-16777217}function Vm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ay(n))if(gg())t.flags|=8192;else throw nr=Yi,fn}function Fu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?yt():536870912,t.lanes|=n,Jr|=n)}function oo(t,n){if(!Ge)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function xt(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var f=t.child;f!==null;)a|=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;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function Ew(t,n,a){var o=n.pendingProps;switch(er(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(n),null;case 1:return xt(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),dn(wt),Ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(la(n)?bl(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,pl())),xt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(bl(n),h!==null?(xt(n),Vm(n,h)):(xt(n),Qd(n,f,null,o,a))):h?h!==t.memoizedState?(bl(n),xt(n),Vm(n,h)):(xt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&bl(n),xt(n),Qd(n,f,t,o,a)),null;case 27:if(Kt(n),a=Q.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}t=K.current,la(n)?Ks(n):(t=Qg(f,o,a),n.stateNode=t,bl(n))}return xt(n),null;case 5:if(Kt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}if(h=K.current,la(n))Ks(n);else{var v=oc(Q.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[Yt]=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(rn(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&bl(n)}}return xt(n),Qd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=Q.current,la(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,f=Nt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Yt]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||qg(t.nodeValue,a)),t||Pi(n,!0)}else t=oc(t).createTextNode(o),t[Yt]=n,n.stateNode=t}return xt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=la(n),a!==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[Yt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else a=pl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Vn(n),n):(Vn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return xt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=la(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[Yt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=pl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Vn(n),n):(Vn(n),null)}return Vn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(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)),a!==t&&a&&(n.child.flags|=8192),Fu(n,n.updateQueue),xt(n),null);case 4:return Ke(),t===null&&vf(n.stateNode.containerInfo),xt(n),null;case 10:return dn(n.type),xt(n),null;case 19:if(z(Dt),o=n.memoizedState,o===null)return xt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)oo(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Ou(t),h!==null){for(n.flags|=128,oo(o,!1),t=h.updateQueue,n.updateQueue=t,Fu(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)Tu(a,t),a=a.sibling;return C(Dt,Dt.current&1|2),Ge&&gi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&At()>Zu&&(n.flags|=128,f=!0,oo(o,!1),n.lanes=4194304)}else{if(!f)if(t=Ou(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Fu(n,t),oo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ge)return xt(n),null}else 2*At()-o.renderingStartTime>Zu&&a!==536870912&&(n.flags|=128,f=!0,oo(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=At(),t.sibling=null,a=Dt.current,C(Dt,f?a&1|2:a&1),Ge&&gi(n,o.treeForkCount),t):(xt(n),null);case 22:case 23:return Vn(n),vd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),a=n.updateQueue,a!==null&&Fu(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&z(Te),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),dn(wt),xt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Aw(t,n){switch(er(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return dn(wt),Ke(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Kt(n),null;case 31:if(n.memoizedState!==null){if(Vn(n),n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Vn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(Dt),null;case 4:return Ke(),null;case 10:return dn(n.type),null;case 22:case 23:return Vn(n),vd(),t!==null&&z(Te),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return dn(wt),null;case 25:return null;default:return null}}function Pm(t,n){switch(er(n),n.tag){case 3:dn(wt),Ke();break;case 26:case 27:case 5:Kt(n);break;case 4:Ke();break;case 31:n.memoizedState!==null&&Vn(n);break;case 13:Vn(n);break;case 19:z(Dt);break;case 10:dn(n.type);break;case 22:case 23:Vn(n),vd(),t!==null&&z(Te);break;case 24:dn(wt)}}function uo(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&t)===t){o=void 0;var h=a.create,v=a.inst;o=h(),v.destroy=o}a=a.next}while(a!==f)}}catch(E){ot(n,n.return,E)}}function fa(t,n,a){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,f=n;var I=a,Y=E;try{Y()}catch(ne){ot(f,I,ne)}}}o=o.next}while(o!==h)}}catch(ne){ot(n,n.return,ne)}}function Ym(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{Lh(n,a)}catch(o){ot(t,t.return,o)}}}function Fm(t,n,a){a.props=ar(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){ot(t,n,o)}}function co(t,n){try{var a=t.ref;if(a!==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 a=="function"?t.refCleanup=a(o):a.current=o}}catch(f){ot(t,n,f)}}function Fi(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){ot(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){ot(t,n,f)}else a.current=null}function Wm(t){var n=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){ot(t,t.return,f)}}function Zd(t,n,a){try{var o=t.stateNode;Xw(o,t.type,a,n),o[zt]=n}catch(f){ot(t,t.return,f)}}function Km(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ba(t.type)||t.tag===4}function Jd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Km(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&&ba(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ef(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=yn));else if(o!==4&&(o===27&&ba(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(ef(t,n,a),t=t.sibling;t!==null;)ef(t,n,a),t=t.sibling}function Wu(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(o!==4&&(o===27&&ba(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Wu(t,n,a),t=t.sibling;t!==null;)Wu(t,n,a),t=t.sibling}function Xm(t){var n=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);rn(n,o,a),n[Yt]=t,n[zt]=a}catch(h){ot(t,t.return,h)}}var vl=!1,Ht=!1,tf=!1,Qm=typeof WeakSet=="function"?WeakSet:Set,tn=null;function Nw(t,n){if(t=t.containerInfo,jf=mc,t=vu(t),Ls(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var v=0,E=-1,I=-1,Y=0,ne=0,re=t,F=null;t:for(;;){for(var Z;re!==a||f!==0&&re.nodeType!==3||(E=v+f),re!==h||o!==0&&re.nodeType!==3||(I=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Z=re.firstChild)!==null;)F=re,re=Z;for(;;){if(re===t)break t;if(F===a&&++Y===f&&(E=v),F===h&&++ne===o&&(I=v),(Z=re.nextSibling)!==null)break;re=F,F=re.parentNode}re=Z}a=E===-1||I===-1?null:{start:E,end:I}}else a=null}a=a||{start:0,end:0}}else a=null;for(Sf={focusedElem:t,selectionRange:a},mc=!1,tn=n;tn!==null;)if(n=tn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,tn=t;else for(;tn!==null;){switch(n=tn,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var ke=ar(a.type,f);t=o.getSnapshotBeforeUpdate(ke,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Me){ot(a,a.return,Me)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)Ef(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ef(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,tn=t;break}tn=n.return}}function Zm(t,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:kl(t,a),o&4&&uo(5,a);break;case 1:if(kl(t,a),o&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(v){ot(a,a.return,v)}else{var f=ar(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ot(a,a.return,v)}}o&64&&Ym(a),o&512&&co(a,a.return);break;case 3:if(kl(t,a),o&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Lh(t,n)}catch(v){ot(a,a.return,v)}}break;case 27:n===null&&o&4&&Xm(a);case 26:case 5:kl(t,a),n===null&&o&4&&Wm(a),o&512&&co(a,a.return);break;case 12:kl(t,a);break;case 31:kl(t,a),o&4&&tg(t,a);break;case 13:kl(t,a),o&4&&ng(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=Uw.bind(null,a),lk(t,a))));break;case 22:if(o=a.memoizedState!==null||vl,!o){n=n!==null&&n.memoizedState!==null||Ht,f=vl;var h=Ht;vl=o,(Ht=n)&&!h?jl(t,a,(a.subtreeFlags&8772)!==0):kl(t,a),vl=f,Ht=h}break;case 30:break;default:kl(t,a)}}function Jm(t){var n=t.alternate;n!==null&&(t.alternate=null,Jm(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&vs(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var vt=null,Rn=!1;function wl(t,n,a){for(a=a.child;a!==null;)eg(t,n,a),a=a.sibling}function eg(t,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Pt,a)}catch{}switch(a.tag){case 26:Ht||Fi(a,n),wl(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ht||Fi(a,n);var o=vt,f=Rn;ba(a.type)&&(vt=a.stateNode,Rn=!1),wl(t,n,a),vo(a.stateNode),vt=o,Rn=f;break;case 5:Ht||Fi(a,n);case 6:if(o=vt,f=Rn,vt=null,wl(t,n,a),vt=o,Rn=f,vt!==null)if(Rn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(h){ot(a,n,h)}else try{vt.removeChild(a.stateNode)}catch(h){ot(a,n,h)}break;case 18:vt!==null&&(Rn?(t=vt,Yg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ss(t)):Yg(vt,a.stateNode));break;case 4:o=vt,f=Rn,vt=a.stateNode.containerInfo,Rn=!0,wl(t,n,a),vt=o,Rn=f;break;case 0:case 11:case 14:case 15:fa(2,a,n),Ht||fa(4,a,n),wl(t,n,a);break;case 1:Ht||(Fi(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Fm(a,n,o)),wl(t,n,a);break;case 21:wl(t,n,a);break;case 22:Ht=(o=Ht)||a.memoizedState!==null,wl(t,n,a),Ht=o;break;default:wl(t,n,a)}}function tg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ss(t)}catch(a){ot(n,n.return,a)}}}function ng(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ss(t)}catch(a){ot(n,n.return,a)}}function Dw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Qm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Qm),n;default:throw Error(r(435,t.tag))}}function Ku(t,n){var a=Dw(t);n.forEach(function(o){if(!a.has(o)){a.add(o);var f=Bw.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],h=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(ba(E.type)){vt=E.stateNode,Rn=!1;break e}break;case 5:vt=E.stateNode,Rn=!1;break e;case 3:case 4:vt=E.stateNode.containerInfo,Rn=!0;break e}E=E.return}if(vt===null)throw Error(r(160));eg(h,v,f),vt=null,Rn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ig(n,t),n=n.sibling}var wi=null;function ig(t,n){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(fa(3,t,t.return),uo(3,t),fa(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),o&64&&vl&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=wi;if(Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Ai]||h[Yt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),rn(h,o,a),h[Yt]=t,Ct(h),o=h;break e;case"link":var v=iy("link","href",f).get(o+(a.href||""));if(v){for(var E=0;E<v.length;E++)if(h=v[E],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(E,1);break t}}h=f.createElement(o),rn(h,o,a),f.head.appendChild(h);break;case"meta":if(v=iy("meta","content",f).get(o+(a.content||""))){for(E=0;E<v.length;E++)if(h=v[E],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(E,1);break t}}h=f.createElement(o),rn(h,o,a),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Yt]=t,Ct(h),o=h}t.stateNode=o}else ly(f,t.type,t.stateNode);else t.stateNode=ny(f,o,t.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?ly(f,t.type,t.stateNode):ny(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Zd(t,t.memoizedProps,a.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),a!==null&&o&4&&Zd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),t.flags&32){f=t.stateNode;try{ti(f,"")}catch(ke){ot(t,t.return,ke)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Zd(t,f,a!==null?a.memoizedProps:f)),o&1024&&(tf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(ke){ot(t,t.return,ke)}}break;case 3:if(dc=null,f=wi,wi=uc(n.containerInfo),Mn(n,t),wi=f,On(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{ss(n.containerInfo)}catch(ke){ot(t,t.return,ke)}tf&&(tf=!1,lg(t));break;case 4:o=wi,wi=uc(t.stateNode.containerInfo),Mn(n,t),On(t),wi=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,Ku(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Qu=At()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ku(t,o)));break;case 22:f=t.memoizedState!==null;var I=a!==null&&a.memoizedState!==null,Y=vl,ne=Ht;if(vl=Y||f,Ht=ne||I,Mn(n,t),Ht=ne,vl=Y,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||I||vl||Ht||rr(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){I=a=n;try{if(h=I.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=I.stateNode;var re=I.memoizedProps.style,F=re!=null&&re.hasOwnProperty("display")?re.display:null;E.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ke){ot(I,I.return,ke)}}}else if(n.tag===6){if(a===null){I=n;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ke){ot(I,I.return,ke)}}}else if(n.tag===18){if(a===null){I=n;try{var Z=I.stateNode;f?Fg(Z,!0):Fg(I.stateNode,!1)}catch(ke){ot(I,I.return,ke)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Ku(t,a))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Ku(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 a,o=t.return;o!==null;){if(Km(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=Jd(t);Wu(t,h,f);break;case 5:var v=a.stateNode;a.flags&32&&(ti(v,""),a.flags&=-33);var E=Jd(t);Wu(t,E,v);break;case 3:case 4:var I=a.stateNode.containerInfo,Y=Jd(t);ef(t,Y,I);break;default:throw Error(r(161))}}catch(ne){ot(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function lg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;lg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function kl(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Zm(t,n.alternate,n),n=n.sibling}function rr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:fa(4,n,n.return),rr(n);break;case 1:Fi(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Fm(n,n.return,a),rr(n);break;case 27:vo(n.stateNode);case 26:case 5:Fi(n,n.return),rr(n);break;case 22:n.memoizedState===null&&rr(n);break;case 30:rr(n);break;default:rr(n)}t=t.sibling}}function jl(t,n,a){for(a=a&&(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:jl(f,h,a),uo(4,h);break;case 1:if(jl(f,h,a),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){ot(o,o.return,Y)}if(o=h,f=o.updateQueue,f!==null){var E=o.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)zh(I[f],E)}catch(Y){ot(o,o.return,Y)}}a&&v&64&&Ym(h),co(h,h.return);break;case 27:Xm(h);case 26:case 5:jl(f,h,a),a&&o===null&&v&4&&Wm(h),co(h,h.return);break;case 12:jl(f,h,a);break;case 31:jl(f,h,a),a&&v&4&&tg(f,h);break;case 13:jl(f,h,a),a&&v&4&&ng(f,h);break;case 22:h.memoizedState===null&&jl(f,h,a),co(h,h.return);break;case 30:break;default:jl(f,h,a)}n=n.sibling}}function nf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&ra(a))}function lf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ra(t))}function ki(t,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)ag(t,n,a,o),n=n.sibling}function ag(t,n,a,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ki(t,n,a,o),f&2048&&uo(9,n);break;case 1:ki(t,n,a,o);break;case 3:ki(t,n,a,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ra(t)));break;case 12:if(f&2048){ki(t,n,a,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,E=h.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){ot(n,n.return,I)}}else ki(t,n,a,o);break;case 31:ki(t,n,a,o);break;case 13:ki(t,n,a,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?ki(t,n,a,o):fo(t,n):h._visibility&2?ki(t,n,a,o):(h._visibility|=2,Xr(t,n,a,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&nf(v,n);break;case 24:ki(t,n,a,o),f&2048&&lf(n.alternate,n);break;default:ki(t,n,a,o)}}function Xr(t,n,a,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,E=a,I=o,Y=v.flags;switch(v.tag){case 0:case 11:case 15:Xr(h,v,E,I,f),uo(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?Xr(h,v,E,I,f):fo(h,v):(ne._visibility|=2,Xr(h,v,E,I,f)),f&&Y&2048&&nf(v.alternate,v);break;case 24:Xr(h,v,E,I,f),f&&Y&2048&&lf(v.alternate,v);break;default:Xr(h,v,E,I,f)}n=n.sibling}}function fo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,o=n,f=o.flags;switch(o.tag){case 22:fo(a,o),f&2048&&nf(o.alternate,o);break;case 24:fo(a,o),f&2048&&lf(o.alternate,o);break;default:fo(a,o)}n=n.sibling}}var po=8192;function Qr(t,n,a){if(t.subtreeFlags&po)for(t=t.child;t!==null;)rg(t,n,a),t=t.sibling}function rg(t,n,a){switch(t.tag){case 26:Qr(t,n,a),t.flags&po&&t.memoizedState!==null&&gk(a,wi,t.memoizedState,t.memoizedProps);break;case 5:Qr(t,n,a);break;case 3:case 4:var o=wi;wi=uc(t.stateNode.containerInfo),Qr(t,n,a),wi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=po,po=16777216,Qr(t,n,a),po=o):Qr(t,n,a));break;default:Qr(t,n,a)}}function sg(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 ho(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];tn=o,ug(o,t)}sg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)og(t),t=t.sibling}function og(t){switch(t.tag){case 0:case 11:case 15:ho(t),t.flags&2048&&fa(9,t,t.return);break;case 3:ho(t);break;case 12:ho(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Xu(t)):ho(t);break;default:ho(t)}}function Xu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];tn=o,ug(o,t)}sg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:fa(8,n,n.return),Xu(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Xu(n));break;default:Xu(n)}t=t.sibling}}function ug(t,n){for(;tn!==null;){var a=tn;switch(a.tag){case 0:case 11:case 15:fa(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ra(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,tn=o;else e:for(a=t;tn!==null;){o=tn;var f=o.sibling,h=o.return;if(Jm(o),o===a){tn=null;break e}if(f!==null){f.return=h,tn=f;break e}tn=h}}}var _w={getCacheForType:function(t){var n=Ft(wt),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return Ft(wt).controller.signal}},Rw=typeof WeakMap=="function"?WeakMap:Map,at=0,ht=null,Ye=null,Qe=0,st=0,Pn=null,pa=!1,Zr=!1,af=!1,Sl=0,Et=0,ha=0,sr=0,rf=0,Yn=0,Jr=0,mo=null,zn=null,sf=!1,Qu=0,cg=0,Zu=1/0,Ju=null,ma=null,Wt=0,ga=null,es=null,Cl=0,of=0,uf=null,dg=null,go=0,cf=null;function Fn(){return(at&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?gf():bs()}function fg(){if(Yn===0)if((Qe&536870912)===0||Ge){var t=br;br<<=1,(br&3932160)===0&&(br=262144),Yn=t}else Yn=536870912;return t=Gn.current,t!==null&&(t.flags|=32),Yn}function Ln(t,n,a){(t===ht&&(st===2||st===9)||t.cancelPendingCommit!==null)&&(ts(t,0),ya(t,Qe,Yn,!1)),Ra(t,a),((at&2)===0||t!==ht)&&(t===ht&&((at&2)===0&&(sr|=a),Et===4&&ya(t,Qe,Yn,!1)),Wi(t))}function pg(t,n,a){if((at&6)!==0)throw Error(r(327));var o=!a&&(n&127)===0&&(n&t.expiredLanes)===0||nn(t,n),f=o?zw(t,n):ff(t,n,!0),h=o;do{if(f===0){Zr&&!o&&ya(t,n,0,!1);break}else{if(a=t.current.alternate,h&&!Mw(a)){f=ff(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var E=t;f=mo;var I=E.current.memoizedState.isDehydrated;if(I&&(ts(E,v).flags|=256),v=ff(E,v,!1),v!==2){if(af&&!I){E.errorRecoveryDisabledLanes|=h,sr|=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){ts(t,0),ya(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:ya(o,n,Yn,!pa);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Qu+300-At(),10<f)){if(ya(o,n,Yn,!pa),_l(o,0,!0)!==0)break e;Cl=n,o.timeoutHandle=Vg(hg.bind(null,o,a,zn,Ju,sf,n,Yn,sr,Jr,pa,h,"Throttled",-0,0),f);break e}hg(o,a,zn,Ju,sf,n,Yn,sr,Jr,pa,h,null,-0,0)}}break}while(!0);Wi(t)}function hg(t,n,a,o,f,h,v,E,I,Y,ne,re,F,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:yn},rg(n,h,re);var ke=(h&62914560)===h?Qu-At():(h&4194048)===h?cg-At():0;if(ke=yk(re,ke),ke!==null){Cl=h,t.cancelPendingCommit=ke(kg.bind(null,t,n,h,a,o,f,v,E,I,ne,re,null,F,Z)),ya(t,h,v,!Y);return}}kg(t,n,h,a,o,f,v,E,I)}function Mw(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],h=f.getSnapshot;f=f.value;try{if(!bn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;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 ya(t,n,a,o){n&=~rf,n&=~sr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}a!==0&&ys(t,a,n)}function ec(){return(at&6)===0?(yo(0),!1):!0}function df(){if(Ye!==null){if(st===0)var t=Ye.return;else t=Ye,bi=hl=null,Td(t),Pr=null,Zs=0,t=Ye;for(;t!==null;)Pm(t.alternate,t),t=t.return;Ye=null}}function ts(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,Jw(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Cl=0,df(),ht=t,Ye=a=ri(t.current,null),Qe=n,st=0,Pn=null,pa=!1,Zr=nn(t,n),af=!1,Jr=Yn=rf=sr=ha=Et=0,zn=mo=null,sf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-rt(o),h=1<<f;n|=t[f],o&=~h}return Sl=n,Qa(),a}function mg(t,n){Be=null,V.H=ro,n===vi||n===oi?(n=_h(),st=3):n===fn?(n=_h(),st=4):st=n===$d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Pn=n,Ye===null&&(Et=1,Gu(t,Tn(n,t.current)))}function gg(){var t=Gn.current;return t===null?!0:(Qe&4194048)===Qe?ui===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===ui:!1}function yg(){var t=V.H;return V.H=ro,t===null?ro:t}function xg(){var t=V.A;return V.A=_w,t}function tc(){Et=4,pa||(Qe&4194048)!==Qe&&Gn.current!==null||(Zr=!0),(ha&134217727)===0&&(sr&134217727)===0||ht===null||ya(ht,Qe,Yn,!1)}function ff(t,n,a){var o=at;at|=2;var f=yg(),h=xg();(ht!==t||Qe!==n)&&(Ju=null,ts(t,n)),n=!1;var v=Et;e:do try{if(st!==0&&Ye!==null){var E=Ye,I=Pn;switch(st){case 8:df(),v=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(n=!0);var Y=st;if(st=0,Pn=null,ns(t,E,I,Y),a&&Zr){v=0;break e}break;default:Y=st,st=0,Pn=null,ns(t,E,I,Y)}}Ow(),v=Et;break}catch(ne){mg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,bi=hl=null,at=o,V.H=f,V.A=h,Ye===null&&(ht=null,Qe=0,Qa()),v}function Ow(){for(;Ye!==null;)bg(Ye)}function zw(t,n){var a=at;at|=2;var o=yg(),f=xg();ht!==t||Qe!==n?(Ju=null,Zu=At()+500,ts(t,n)):Zr=nn(t,n);e:do try{if(st!==0&&Ye!==null){n=Ye;var h=Pn;t:switch(st){case 1:st=0,Pn=null,ns(t,n,h,1);break;case 2:case 9:if(Vr(h)){st=0,Pn=null,vg(n);break}n=function(){st!==2&&st!==9||ht!==t||(st=7),Wi(t)},h.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Vr(h)?(st=0,Pn=null,vg(n)):(st=0,Pn=null,ns(t,n,h,7));break;case 5:var v=null;switch(Ye.tag){case 26:v=Ye.memoizedState;case 5:case 27:var E=Ye;if(v?ay(v):E.stateNode.complete){st=0,Pn=null;var I=E.sibling;if(I!==null)Ye=I;else{var Y=E.return;Y!==null?(Ye=Y,nc(Y)):Ye=null}break t}}st=0,Pn=null,ns(t,n,h,5);break;case 6:st=0,Pn=null,ns(t,n,h,6);break;case 8:df(),Et=6;break e;default:throw Error(r(462))}}Lw();break}catch(ne){mg(t,ne)}while(!0);return bi=hl=null,V.H=o,V.A=f,at=a,Ye!==null?0:(ht=null,Qe=0,Qa(),Et)}function Lw(){for(;Ye!==null&&!Xn();)bg(Ye)}function bg(t){var n=Gm(t.alternate,t,Sl);t.memoizedProps=t.pendingProps,n===null?nc(t):Ye=n}function vg(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=Im(a,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Im(a,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Td(n);default:Pm(a,n),n=Ye=Tu(n,Sl),n=Gm(a,n,Sl)}t.memoizedProps=t.pendingProps,n===null?nc(t):Ye=n}function ns(t,n,a,o){bi=hl=null,Td(n),Pr=null,Zs=0;var f=n.return;try{if(Sw(t,f,n,a,Qe)){Et=1,Gu(t,Tn(a,t.current)),Ye=null;return}}catch(h){if(f!==null)throw Ye=f,h;Et=1,Gu(t,Tn(a,t.current)),Ye=null;return}n.flags&32768?(Ge||o===1?t=!0:Zr||(Qe&536870912)!==0?t=!1:(pa=t=!0,(o===2||o===9||o===3||o===6)&&(o=Gn.current,o!==null&&o.tag===13&&(o.flags|=16384))),wg(n,t)):nc(n)}function nc(t){var n=t;do{if((n.flags&32768)!==0){wg(n,pa);return}t=n.return;var a=Ew(n.alternate,n,Sl);if(a!==null){Ye=a;return}if(n=n.sibling,n!==null){Ye=n;return}Ye=n=t}while(n!==null);Et===0&&(Et=5)}function wg(t,n){do{var a=Aw(t.alternate,t);if(a!==null){a.flags&=32767,Ye=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=a}while(t!==null);Et=6,Ye=null}function kg(t,n,a,o,f,h,v,E,I){t.cancelPendingCommit=null;do ic();while(Wt!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Ur,Ma(t,a,h,v,E,I),t===ht&&(Ye=ht=null,Qe=0),es=n,ga=t,Cl=a,of=h,uf=f,dg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,qw(Ce,function(){return Eg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,f=se.p,se.p=2,v=at,at|=4;try{Nw(t,n,a)}finally{at=v,se.p=f,V.T=o}}Wt=1,jg(),Sg(),Cg()}}function jg(){if(Wt===1){Wt=0;var t=ga,n=es,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var o=se.p;se.p=2;var f=at;at|=4;try{ig(n,t);var h=Sf,v=vu(t.containerInfo),E=h.focusedElem,I=h.selectionRange;if(v!==E&&E&&E.ownerDocument&&bu(E.ownerDocument.documentElement,E)){if(I!==null&&Ls(E)){var Y=I.start,ne=I.end;if(ne===void 0&&(ne=Y),"selectionStart"in E)E.selectionStart=Y,E.selectionEnd=Math.min(ne,E.value.length);else{var re=E.ownerDocument||document,F=re&&re.defaultView||window;if(F.getSelection){var Z=F.getSelection(),ke=E.textContent.length,Me=Math.min(I.start,ke),pt=I.end===void 0?Me:Math.min(I.end,ke);!Z.extend&&Me>pt&&(v=pt,pt=Me,Me=v);var G=xu(E,Me),q=xu(E,pt);if(G&&q&&(Z.rangeCount!==1||Z.anchorNode!==G.node||Z.anchorOffset!==G.offset||Z.focusNode!==q.node||Z.focusOffset!==q.offset)){var P=re.createRange();P.setStart(G.node,G.offset),Z.removeAllRanges(),Me>pt?(Z.addRange(P),Z.extend(q.node,q.offset)):(P.setEnd(q.node,q.offset),Z.addRange(P))}}}}for(re=[],Z=E;Z=Z.parentNode;)Z.nodeType===1&&re.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<re.length;E++){var le=re[E];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}mc=!!jf,Sf=jf=null}finally{at=f,se.p=o,V.T=a}}t.current=n,Wt=2}}function Sg(){if(Wt===2){Wt=0;var t=ga,n=es,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var o=se.p;se.p=2;var f=at;at|=4;try{Zm(t,n.alternate,n)}finally{at=f,se.p=o,V.T=a}}Wt=3}}function Cg(){if(Wt===4||Wt===3){Wt=0,Nl();var t=ga,n=es,a=Cl,o=dg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,es=ga=null,Tg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ma=null),xs(a),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Pt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=se.p,se.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var E=o[v];h(E.value,{componentStack:E.stack})}}finally{V.T=n,se.p=f}}(Cl&3)!==0&&ic(),Wi(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===cf?go++:(go=0,cf=t):go=0,yo(0)}}function Tg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ra(n)))}function ic(){return jg(),Sg(),Cg(),Eg()}function Eg(){if(Wt!==5)return!1;var t=ga,n=of;of=0;var a=xs(Cl),o=V.T,f=se.p;try{se.p=32>a?32:a,V.T=null,a=uf,uf=null;var h=ga,v=Cl;if(Wt=0,es=ga=null,Cl=0,(at&6)!==0)throw Error(r(331));var E=at;if(at|=4,og(h.current),ag(h,h.current,v,a),at=E,yo(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Pt,h)}catch{}return!0}finally{se.p=f,V.T=o,Tg(t,n)}}function Ag(t,n,a){n=Tn(a,n),n=Hd(t.stateNode,n,2),t=ua(t,n,2),t!==null&&(Ra(t,2),Wi(t))}function ot(t,n,a){if(t.tag===3)Ag(t,t,a);else for(;n!==null;){if(n.tag===3){Ag(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ma===null||!ma.has(o))){t=Tn(a,t),a=Nm(2),o=ua(n,a,2),o!==null&&(Dm(a,o,n,t),Ra(o,2),Wi(o));break}}n=n.return}}function pf(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Rw;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(a)||(af=!0,f.add(a),t=Iw.bind(null,t,n,a),n.then(t,t))}function Iw(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,ht===t&&(Qe&a)===a&&(Et===4||Et===3&&(Qe&62914560)===Qe&&300>At()-Qu?(at&2)===0&&ts(t,0):rf|=a,Jr===Qe&&(Jr=0)),Wi(t)}function Ng(t,n){n===0&&(n=yt()),t=ul(t,n),t!==null&&(Ra(t,n),Wi(t))}function Uw(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),Ng(t,a)}function Bw(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(a=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),Ng(t,a)}function qw(t,n){return Xt(t,n)}var lc=null,is=null,hf=!1,ac=!1,mf=!1,xa=0;function Wi(t){t!==is&&t.next===null&&(is===null?lc=is=t:is=is.next=t),ac=!0,hf||(hf=!0,$w())}function yo(t,n){if(!mf&&ac){mf=!0;do for(var a=!1,o=lc;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,E=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~E),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,Mg(o,h))}else h=Qe,h=_l(o,o===ht?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||nn(o,h)||(a=!0,Mg(o,h));o=o.next}while(a);mf=!1}}function Hw(){Dg()}function Dg(){ac=hf=!1;var t=0;xa!==0&&Zw()&&(t=xa);for(var n=At(),a=null,o=lc;o!==null;){var f=o.next,h=_g(o,n);h===0?(o.next=null,a===null?lc=f:a.next=f,f===null&&(is=a)):(a=o,(t!==0||(h&3)!==0)&&(ac=!0)),o=f}Wt!==0&&Wt!==5||yo(t),xa!==0&&(xa=0)}function _g(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),E=1<<v,I=f[v];I===-1?((E&a)===0||(E&o)!==0)&&(f[v]=Rl(E,n)):I<=n&&(t.expiredLanes|=E),h&=~E}if(n=ht,a=Qe,a=_l(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===n&&(st===2||st===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Si(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||nn(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(o!==null&&Si(o),xs(a)){case 2:case 8:a=ce;break;case 32:a=Ce;break;case 268435456:a=Xe;break;default:a=Ce}return o=Rg.bind(null,t),a=Xt(a,o),t.callbackPriority=n,t.callbackNode=a,n}return o!==null&&o!==null&&Si(o),t.callbackPriority=2,t.callbackNode=null,2}function Rg(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(ic()&&t.callbackNode!==a)return null;var o=Qe;return o=_l(t,t===ht?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(pg(t,o,n),_g(t,At()),t.callbackNode!=null&&t.callbackNode===a?Rg.bind(null,t):null)}function Mg(t,n){if(ic())return null;pg(t,n,!0)}function $w(){ek(function(){(at&6)!==0?Xt(ie,Hw):Dg()})}function gf(){if(xa===0){var t=S;t===0&&(t=xr,xr<<=1,(xr&261888)===0&&(xr=256)),xa=t}return xa}function Og(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Bl(""+t)}function zg(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function Gw(t,n,a,o,f){if(n==="submit"&&a&&a.stateNode===f){var h=Og((f[zt]||null).action),v=o.submitter;v&&(n=(n=v[zt]||null)?Og(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var E=new Ba("action","action",null,o,f);t.push({event:E,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(xa!==0){var I=v?zg(f,v):new FormData(f);zd(a,{pending:!0,data:I,method:f.method,action:h},null,I)}}else typeof h=="function"&&(E.preventDefault(),I=v?zg(f,v):new FormData(f),zd(a,{pending:!0,data:I,method:f.method,action:h},h,I))},currentTarget:f}]})}}for(var yf=0;yf<$s.length;yf++){var xf=$s[yf],Vw=xf.toLowerCase(),Pw=xf[0].toUpperCase()+xf.slice(1);Hn(Vw,"on"+Pw)}Hn(ju,"onAnimationEnd"),Hn(qs,"onAnimationIteration"),Hn(ai,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn(Hs,"onTransitionRun"),Hn(Su,"onTransitionStart"),Hn(Xa,"onTransitionCancel"),Hn($i,"onTransitionEnd"),_i("onMouseEnter",["mouseout","mouseover"]),_i("onMouseLeave",["mouseout","mouseover"]),_i("onPointerEnter",["pointerout","pointerover"]),_i("onPointerLeave",["pointerout","pointerover"]),un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),un("onBeforeInput",["compositionend","keypress","textInput","paste"]),un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xo="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(" "),Yw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xo));function Lg(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var E=o[v],I=E.instance,Y=E.currentTarget;if(E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=Y;try{h(f)}catch(ne){Ir(ne)}f.currentTarget=null,h=I}else for(v=0;v<o.length;v++){if(E=o[v],I=E.instance,Y=E.currentTarget,E=E.listener,I!==h&&f.isPropagationStopped())break e;h=E,f.currentTarget=Y;try{h(f)}catch(ne){Ir(ne)}f.currentTarget=null,h=I}}}}function Fe(t,n){var a=n[Ei];a===void 0&&(a=n[Ei]=new Set);var o=t+"__bubble";a.has(o)||(Ig(n,t,2,!1),a.add(o))}function bf(t,n,a){var o=0;n&&(o|=4),Ig(a,t,o,n)}var rc="_reactListening"+Math.random().toString(36).slice(2);function vf(t){if(!t[rc]){t[rc]=!0,nu.forEach(function(a){a!=="selectionchange"&&(Yw.has(a)||bf(a,!1,t),bf(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[rc]||(n[rc]=!0,bf("selectionchange",!1,n))}}function Ig(t,n,a,o){switch(fy(n)){case 2:var f=vk;break;case 8:f=wk;break;default:f=zf}a=f.bind(null,n,a,t),f=void 0,!Hl||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,a,{capture:!0,passive:f}):t.addEventListener(n,a,!0):f!==void 0?t.addEventListener(n,a,{passive:f}):t.addEventListener(n,a,!1)}function wf(t,n,a,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var E=o.stateNode.containerInfo;if(E===f)break;if(v===4)for(v=o.return;v!==null;){var I=v.tag;if((I===3||I===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;E!==null;){if(v=Jn(E),v===null)return;if(I=v.tag,I===5||I===6||I===26||I===27){o=h=v;continue e}E=E.parentNode}}o=o.return}zi(function(){var Y=h,ne=Ia(a),re=[];e:{var F=Cu.get(t);if(F!==void 0){var Z=Ba,ke=t;switch(t){case"keypress":if(Ii(a)===0)break e;case"keydown":case"keyup":Z=Ns;break;case"focusin":ke="focus",Z=qa;break;case"focusout":ke="blur",Z=qa;break;case"beforeblur":case"afterblur":Z=qa;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Pl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Er;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Ga;break;case ju:case qs:case ai:Z=Ne;break;case $i:Z=Ds;break;case"scroll":case"scrollend":Z=Bi;break;case"wheel":Z=Rs;break;case"copy":case"cut":case"paste":Z=mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=uu;break;case"toggle":case"beforetoggle":Z=Rr}var Me=(n&4)!==0,pt=!Me&&(t==="scroll"||t==="scrollend"),G=Me?F!==null?F+"Capture":null:F;Me=[];for(var q=Y,P;q!==null;){var le=q;if(P=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||P===null||G===null||(le=Ua(q,G),le!=null&&Me.push(bo(q,le,P))),pt)break;q=q.return}0<Me.length&&(F=new Z(F,ke,null,a,ne),re.push({event:F,listeners:Me}))}}if((n&7)===0){e:{if(F=t==="mouseover"||t==="pointerover",Z=t==="mouseout"||t==="pointerout",F&&a!==La&&(ke=a.relatedTarget||a.fromElement)&&(Jn(ke)||ke[qn]))break e;if((Z||F)&&(F=ne.window===ne?ne:(F=ne.ownerDocument)?F.defaultView||F.parentWindow:window,Z?(ke=a.relatedTarget||a.toElement,Z=Y,ke=ke?Jn(ke):null,ke!==null&&(pt=c(ke),Me=ke.tag,ke!==pt||Me!==5&&Me!==27&&Me!==6)&&(ke=null)):(Z=null,ke=Y),Z!==ke)){if(Me=Pl,le="onMouseLeave",G="onMouseEnter",q="mouse",(t==="pointerout"||t==="pointerover")&&(Me=uu,le="onPointerLeave",G="onPointerEnter",q="pointer"),pt=Z==null?F:el(Z),P=ke==null?F:el(ke),F=new Me(le,q+"leave",Z,a,ne),F.target=pt,F.relatedTarget=P,le=null,Jn(ne)===Y&&(Me=new Me(G,q+"enter",ke,a,ne),Me.target=P,Me.relatedTarget=pt,le=Me),pt=le,Z&&ke)t:{for(Me=Fw,G=Z,q=ke,P=0,le=G;le;le=Me(le))P++;le=0;for(var De=q;De;De=Me(De))le++;for(;0<P-le;)G=Me(G),P--;for(;0<le-P;)q=Me(q),le--;for(;P--;){if(G===q||q!==null&&G===q.alternate){Me=G;break t}G=Me(G),q=Me(q)}Me=null}else Me=null;Z!==null&&Ug(re,F,Z,Me,!1),ke!==null&&pt!==null&&Ug(re,pt,ke,Me,!0)}}e:{if(F=Y?el(Y):window,Z=F.nodeName&&F.nodeName.toLowerCase(),Z==="select"||Z==="input"&&F.type==="file")var nt=Ya;else if(Pa(F))if(zr)nt=cd;else{nt=mu;var Ee=zs}else Z=F.nodeName,!Z||Z.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Y&&Ul(Y.elementType)&&(nt=Ya):nt=ud;if(nt&&(nt=nt(t,Y))){fu(re,nt,a,ne);break e}Ee&&Ee(t,F,Y),t==="focusout"&&Y&&F.type==="number"&&Y.memoizedProps.value!=null&&Sr(F,"number",F.value)}switch(Ee=Y?el(Y):window,t){case"focusin":(Pa(Ee)||Ee.contentEditable==="true")&&(Ql=Ee,Is=Y,Ka=null);break;case"focusout":Ka=Is=Ql=null;break;case"mousedown":Us=!0;break;case"contextmenu":case"mouseup":case"dragend":Us=!1,wu(re,a,ne);break;case"selectionchange":if(dd)break;case"keydown":case"keyup":wu(re,a,ne)}var $e;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 Kl?Wl(t,a)&&(Ze="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(du&&a.locale!=="ko"&&(Kl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Kl&&($e=Es()):(li=ne,Li="value"in li?li.value:li.textContent,Kl=!0)),Ee=sc(Y,Ze),0<Ee.length&&(Ze=new Nr(Ze,t,null,a,ne),re.push({event:Ze,listeners:Ee}),$e?Ze.data=$e:($e=ve(a),$e!==null&&(Ze.data=$e)))),($e=ad?xn(t,a):rd(t,a))&&(Ze=sc(Y,"onBeforeInput"),0<Ze.length&&(Ee=new Nr("onBeforeInput","beforeinput",null,a,ne),re.push({event:Ee,listeners:Ze}),Ee.data=$e)),Gw(re,t,Y,a,ne)}Lg(re,n)})}function bo(t,n,a){return{instance:t,listener:n,currentTarget:a}}function sc(t,n){for(var a=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Ua(t,a),f!=null&&o.unshift(bo(t,f,h)),f=Ua(t,n),f!=null&&o.push(bo(t,f,h))),t.tag===3)return o;t=t.return}return[]}function Fw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ug(t,n,a,o,f){for(var h=n._reactName,v=[];a!==null&&a!==o;){var E=a,I=E.alternate,Y=E.stateNode;if(E=E.tag,I!==null&&I===o)break;E!==5&&E!==26&&E!==27||Y===null||(I=Y,f?(Y=Ua(a,h),Y!=null&&v.unshift(bo(a,Y,I))):f||(Y=Ua(a,h),Y!=null&&v.push(bo(a,Y,I)))),a=a.return}v.length!==0&&t.push({event:n,listeners:v})}var Ww=/\r\n?/g,Kw=/\u0000|\uFFFD/g;function Bg(t){return(typeof t=="string"?t:""+t).replace(Ww,`
50
- `).replace(Kw,"")}function qg(t,n){return n=Bg(n),Bg(t)===n}function ft(t,n,a,o,f,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||ti(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&ti(t,""+o);break;case"className":Oa(t,"class",o);break;case"tabIndex":Oa(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Oa(t,a,o);break;case"style":Ss(t,o,h);break;case"data":if(n!=="object"){Oa(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Bl(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Bl(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=yn);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}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}a=Bl(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+o):t.removeAttribute(a);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(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),kr(t,"popover",o);break;case"xlinkActuate":Qt(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Qt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Qt(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Qt(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Qt(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Qt(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":kr(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ni.get(a)||a,kr(t,a,o))}}function kf(t,n,a,o,f,h){switch(a){case"style":Ss(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"children":typeof o=="string"?ti(t,o):(typeof o=="number"||typeof o=="bigint")&&ti(t,""+o);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ws.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=t[zt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,o,f);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):kr(t,a,o)}}}function rn(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",t),Fe("load",t);var o=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var v=a[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,a,null)}}f&&ft(t,n,"srcSet",a.srcSet,a,null),o&&ft(t,n,"src",a.src,a,null);return;case"input":Fe("invalid",t);var E=h=v=f=null,I=null,Y=null;for(o in a)if(a.hasOwnProperty(o)){var ne=a[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":I=ne;break;case"defaultChecked":Y=ne;break;case"value":h=ne;break;case"defaultValue":E=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:ft(t,n,o,ne,a,null)}}Il(t,h,E,I,Y,v,f,!1);return;case"select":Fe("invalid",t),o=v=h=null;for(f in a)if(a.hasOwnProperty(f)&&(E=a[f],E!=null))switch(f){case"value":h=E;break;case"defaultValue":v=E;break;case"multiple":o=E;default:ft(t,n,f,E,a,null)}n=h,a=v,t.multiple=!!o,n!=null?ei(t,!!o,n,!1):a!=null&&ei(t,!!o,a,!0);return;case"textarea":Fe("invalid",t),h=f=o=null;for(v in a)if(a.hasOwnProperty(v)&&(E=a[v],E!=null))switch(v){case"value":o=E;break;case"defaultValue":f=E;break;case"children":h=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:ft(t,n,v,E,a,null)}za(t,o,f,h);return;case"option":for(I in a)if(a.hasOwnProperty(I)&&(o=a[I],o!=null))switch(I){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,I,o,a,null)}return;case"dialog":Fe("beforetoggle",t),Fe("toggle",t),Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":Fe("load",t);break;case"video":case"audio":for(o=0;o<xo.length;o++)Fe(xo[o],t);break;case"image":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"embed":case"source":case"link":Fe("error",t),Fe("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 a)if(a.hasOwnProperty(Y)&&(o=a[Y],o!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,Y,o,a,null)}return;default:if(Ul(n)){for(ne in a)a.hasOwnProperty(ne)&&(o=a[ne],o!==void 0&&kf(t,n,ne,o,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(o=a[E],o!=null&&ft(t,n,E,o,a,null))}function Xw(t,n,a,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,E=null,I=null,Y=null,ne=null;for(Z in a){var re=a[Z];if(a.hasOwnProperty(Z)&&re!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":I=re;default:o.hasOwnProperty(Z)||ft(t,n,Z,null,o,re)}}for(var F in o){var Z=o[F];if(re=a[F],o.hasOwnProperty(F)&&(Z!=null||re!=null))switch(F){case"type":h=Z;break;case"name":f=Z;break;case"checked":Y=Z;break;case"defaultChecked":ne=Z;break;case"value":v=Z;break;case"defaultValue":E=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==re&&ft(t,n,F,Z,o,re)}}jr(t,v,E,I,Y,ne,h,f);return;case"select":Z=v=E=F=null;for(h in a)if(I=a[h],a.hasOwnProperty(h)&&I!=null)switch(h){case"value":break;case"multiple":Z=I;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,I)}for(f in o)if(h=o[f],I=a[f],o.hasOwnProperty(f)&&(h!=null||I!=null))switch(f){case"value":F=h;break;case"defaultValue":E=h;break;case"multiple":v=h;default:h!==I&&ft(t,n,f,h,o,I)}n=E,a=v,o=Z,F!=null?ei(t,!!a,F,!1):!!o!=!!a&&(n!=null?ei(t,!!a,n,!0):ei(t,!!a,a?[]:"",!1));return;case"textarea":Z=F=null;for(E in a)if(f=a[E],a.hasOwnProperty(E)&&f!=null&&!o.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:ft(t,n,E,null,o,f)}for(v in o)if(f=o[v],h=a[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":F=f;break;case"defaultValue":Z=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}su(t,F,Z);return;case"option":for(var ke in a)if(F=a[ke],a.hasOwnProperty(ke)&&F!=null&&!o.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:ft(t,n,ke,null,o,F)}for(I in o)if(F=o[I],Z=a[I],o.hasOwnProperty(I)&&F!==Z&&(F!=null||Z!=null))switch(I){case"selected":t.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ft(t,n,I,F,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 Me in a)F=a[Me],a.hasOwnProperty(Me)&&F!=null&&!o.hasOwnProperty(Me)&&ft(t,n,Me,null,o,F);for(Y in o)if(F=o[Y],Z=a[Y],o.hasOwnProperty(Y)&&F!==Z&&(F!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ft(t,n,Y,F,o,Z)}return;default:if(Ul(n)){for(var pt in a)F=a[pt],a.hasOwnProperty(pt)&&F!==void 0&&!o.hasOwnProperty(pt)&&kf(t,n,pt,void 0,o,F);for(ne in o)F=o[ne],Z=a[ne],!o.hasOwnProperty(ne)||F===Z||F===void 0&&Z===void 0||kf(t,n,ne,F,o,Z);return}}for(var G in a)F=a[G],a.hasOwnProperty(G)&&F!=null&&!o.hasOwnProperty(G)&&ft(t,n,G,null,o,F);for(re in o)F=o[re],Z=a[re],!o.hasOwnProperty(re)||F===Z||F==null&&Z==null||ft(t,n,re,F,o,Z)}function Hg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],h=f.transferSize,v=f.initiatorType,E=f.duration;if(h&&E&&Hg(v)){for(v=0,E=f.responseEnd,o+=1;o<a.length;o++){var I=a[o],Y=I.startTime;if(Y>E)break;var ne=I.transferSize,re=I.initiatorType;ne&&Hg(re)&&(I=I.responseEnd,v+=ne*(I<E?1:(E-Y)/(I-Y)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var jf=null,Sf=null;function oc(t){return t.nodeType===9?t:t.ownerDocument}function $g(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 Gg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Cf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Tf=null;function Zw(){var t=window.event;return t&&t.type==="popstate"?t===Tf?!1:(Tf=t,!0):(Tf=null,!1)}var Vg=typeof setTimeout=="function"?setTimeout:void 0,Jw=typeof clearTimeout=="function"?clearTimeout:void 0,Pg=typeof Promise=="function"?Promise:void 0,ek=typeof queueMicrotask=="function"?queueMicrotask:typeof Pg<"u"?function(t){return Pg.resolve(null).then(t).catch(tk)}:Vg;function tk(t){setTimeout(function(){throw t})}function ba(t){return t==="head"}function Yg(t,n){var a=n,o=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(f),ss(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")vo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,vo(a);for(var h=a.firstChild;h;){var v=h.nextSibling,E=h.nodeName;h[Ai]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=v}}else a==="body"&&vo(t.ownerDocument.body);a=f}while(a);ss(n)}function Fg(t,n){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Ef(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Ef(a),vs(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function nk(t,n,a,o){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ai])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function ik(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ci(t.nextSibling),t===null))return null;return t}function Wg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ci(t.nextSibling),t===null))return null;return t}function Af(t){return t.data==="$?"||t.data==="$~"}function Nf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function lk(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function ci(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Df=null;function Kg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return ci(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Xg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function Qg(t,n,a){switch(n=oc(a),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 vo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);vs(t)}var di=new Map,Zg=new Set;function uc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Tl=se.d;se.d={f:ak,r:rk,D:sk,C:ok,L:uk,m:ck,X:fk,S:dk,M:pk};function ak(){var t=Tl.f(),n=ec();return t||n}function rk(t){var n=Ni(t);n!==null&&n.tag===5&&n.type==="form"?mm(n):Tl.r(t)}var ls=typeof document>"u"?null:document;function Jg(t,n,a){var o=ls;if(o&&typeof n=="string"&&n){var f=It(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),Zg.has(f)||(Zg.add(f),t={rel:t,crossOrigin:a,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),rn(n,"link",t),Ct(n),o.head.appendChild(n)))}}function sk(t){Tl.D(t),Jg("dns-prefetch",t,null)}function ok(t,n){Tl.C(t,n),Jg("preconnect",t,n)}function uk(t,n,a){Tl.L(t,n,a);var o=ls;if(o&&t&&n){var f='link[rel="preload"][as="'+It(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+It(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+It(a.imageSizes)+'"]')):f+='[href="'+It(t)+'"]';var h=f;switch(n){case"style":h=as(t);break;case"script":h=rs(t)}di.has(h)||(t=x({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),di.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(wo(h))||n==="script"&&o.querySelector(ko(h))||(n=o.createElement("link"),rn(n,"link",t),Ct(n),o.head.appendChild(n)))}}function ck(t,n){Tl.m(t,n);var a=ls;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+It(o)+'"][href="'+It(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=rs(t)}if(!di.has(h)&&(t=x({rel:"modulepreload",href:t},n),di.set(h,t),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ko(h)))return}o=a.createElement("link"),rn(o,"link",t),Ct(o),a.head.appendChild(o)}}}function dk(t,n,a){Tl.S(t,n,a);var o=ls;if(o&&t){var f=Di(o).hoistableStyles,h=as(t);n=n||"default";var v=f.get(h);if(!v){var E={loading:0,preload:null};if(v=o.querySelector(wo(h)))E.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},a),(a=di.get(h))&&_f(t,a);var I=v=o.createElement("link");Ct(I),rn(I,"link",t),I._p=new Promise(function(Y,ne){I.onload=Y,I.onerror=ne}),I.addEventListener("load",function(){E.loading|=1}),I.addEventListener("error",function(){E.loading|=2}),E.loading|=4,cc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:E},f.set(h,v)}}}function fk(t,n){Tl.X(t,n);var a=ls;if(a&&t){var o=Di(a).hoistableScripts,f=rs(t),h=o.get(f);h||(h=a.querySelector(ko(f)),h||(t=x({src:t,async:!0},n),(n=di.get(f))&&Rf(t,n),h=a.createElement("script"),Ct(h),rn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function pk(t,n){Tl.M(t,n);var a=ls;if(a&&t){var o=Di(a).hoistableScripts,f=rs(t),h=o.get(f);h||(h=a.querySelector(ko(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=di.get(f))&&Rf(t,n),h=a.createElement("script"),Ct(h),rn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ey(t,n,a,o){var f=(f=Q.current)?uc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=as(a.href),a=Di(f).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=as(a.href);var h=Di(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(wo(t)))&&!h._p&&(v.instance=h,v.state.loading=5),di.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},di.set(t,a),h||hk(f,t,a,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=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=rs(a),a=Di(f).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function as(t){return'href="'+It(t)+'"'}function wo(t){return'link[rel="stylesheet"]['+t+"]"}function ty(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function hk(t,n,a,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),rn(n,"link",a),Ct(n),t.head.appendChild(n))}function rs(t){return'[src="'+It(t)+'"]'}function ko(t){return"script[async]"+t}function ny(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+It(a.href)+'"]');if(o)return n.instance=o,Ct(o),o;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ct(o),rn(o,"style",f),cc(o,a.precedence,t),n.instance=o;case"stylesheet":f=as(a.href);var h=t.querySelector(wo(f));if(h)return n.state.loading|=4,n.instance=h,Ct(h),h;o=ty(a),(f=di.get(f))&&_f(o,f),h=(t.ownerDocument||t).createElement("link"),Ct(h);var v=h;return v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),rn(h,"link",o),n.state.loading|=4,cc(h,a.precedence,t),n.instance=h;case"script":return h=rs(a.src),(f=t.querySelector(ko(h)))?(n.instance=f,Ct(f),f):(o=a,(f=di.get(h))&&(o=x({},a),Rf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ct(f),rn(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,cc(o,a.precedence,t));return n.instance}function cc(t,n,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var E=o[v];if(E.dataset.precedence===n)h=E;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function _f(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var dc=null;function iy(t,n,a){if(dc===null){var o=new Map,f=dc=new Map;f.set(a,o)}else f=dc,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[Ai]||h[Yt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var E=o.get(v);E?E.push(h):o.set(v,[h])}}return o}function ly(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function mk(t,n,a){if(a===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 ay(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function gk(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=as(o.href),h=n.querySelector(wo(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=fc.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=h,Ct(h);return}h=n.ownerDocument||n,o=ty(o),(f=di.get(f))&&_f(o,f),h=h.createElement("link"),Ct(h);var v=h;v._p=new Promise(function(E,I){v.onload=E,v.onerror=I}),rn(h,"link",o),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=fc.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var Mf=0;function yk(t,n){return t.stylesheets&&t.count===0&&hc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&hc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Mf===0&&(Mf=62500*Qw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&hc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Mf?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function fc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var pc=null;function hc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,pc=new Map,n.forEach(xk,t),pc=null,fc.call(t))}function xk(t,n){if(!(n.state.loading&4)){var a=pc.get(t);if(a)var o=a.get(null);else{a=new Map,pc.set(t,a);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")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=a.get(v)||o,h===o&&a.set(null,f),a.set(v,f),this.count++,o=fc.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 jo={$$typeof:$,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function bk(t,n,a,o,f,h,v,E,I){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ji(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ji(0),this.hiddenUpdates=Ji(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function ry(t,n,a,o,f,h,v,E,I,Y,ne,re){return t=new bk(t,n,a,v,I,Y,ne,re,E),n=1,h===!0&&(n|=24),h=cn(3,null,null,n),t.current=h,h.stateNode=t,n=Gr(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},md(h),t}function sy(t){return t?(t=ea,t):ea}function oy(t,n,a,o,f,h){f=sy(f),o.context===null?o.context=f:o.pendingContext=f,o=oa(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=ua(t,o,n),a!==null&&(Ln(a,t,n),eo(a,t,n))}function uy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function Of(t,n){uy(t,n),(t=t.alternate)&&uy(t,n)}function cy(t){if(t.tag===13||t.tag===31){var n=ul(t,67108864);n!==null&&Ln(n,t,67108864),Of(t,67108864)}}function dy(t){if(t.tag===13||t.tag===31){var n=Fn();n=vr(n);var a=ul(t,n);a!==null&&Ln(a,t,n),Of(t,n)}}var mc=!0;function vk(t,n,a,o){var f=V.T;V.T=null;var h=se.p;try{se.p=2,zf(t,n,a,o)}finally{se.p=h,V.T=f}}function wk(t,n,a,o){var f=V.T;V.T=null;var h=se.p;try{se.p=8,zf(t,n,a,o)}finally{se.p=h,V.T=f}}function zf(t,n,a,o){if(mc){var f=Lf(o);if(f===null)wf(t,n,o,gc,a),py(t,o);else if(jk(f,t,n,a,o))o.stopPropagation();else if(py(t,o),n&4&&-1<kk.indexOf(t)){for(;f!==null;){var h=Ni(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ti(h.pendingLanes);if(v!==0){var E=h;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var I=1<<31-rt(v);E.entanglements[1]|=I,v&=~I}Wi(h),(at&6)===0&&(Zu=At()+500,yo(0))}}break;case 31:case 13:E=ul(h,2),E!==null&&Ln(E,h,2),ec(),Of(h,2)}if(h=Lf(o),h===null&&wf(t,n,o,gc,a),h===f)break;f=h}f!==null&&o.stopPropagation()}else wf(t,n,o,null,a)}}function Lf(t){return t=Ia(t),If(t)}var gc=null;function If(t){if(gc=null,t=Jn(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=d(n),t!==null)return t;t=null}else if(a===31){if(t=p(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return gc=t,null}function fy(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(Dl()){case ie:return 2;case ce:return 8;case Ce:case Ie:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Uf=!1,va=null,wa=null,ka=null,So=new Map,Co=new Map,ja=[],kk="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 py(t,n){switch(t){case"focusin":case"focusout":va=null;break;case"dragenter":case"dragleave":wa=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":So.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Co.delete(n.pointerId)}}function To(t,n,a,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ni(n),n!==null&&cy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function jk(t,n,a,o,f){switch(n){case"focusin":return va=To(va,t,n,a,o,f),!0;case"dragenter":return wa=To(wa,t,n,a,o,f),!0;case"mouseover":return ka=To(ka,t,n,a,o,f),!0;case"pointerover":var h=f.pointerId;return So.set(h,To(So.get(h)||null,t,n,a,o,f)),!0;case"gotpointercapture":return h=f.pointerId,Co.set(h,To(Co.get(h)||null,t,n,a,o,f)),!0}return!1}function hy(t){var n=Jn(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){t.blockedOn=n,tu(t.priority,function(){dy(a)});return}}else if(n===31){if(n=p(a),n!==null){t.blockedOn=n,tu(t.priority,function(){dy(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function yc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=Lf(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);La=o,a.target.dispatchEvent(o),La=null}else return n=Ni(a),n!==null&&cy(n),t.blockedOn=a,!1;n.shift()}return!0}function my(t,n,a){yc(t)&&a.delete(n)}function Sk(){Uf=!1,va!==null&&yc(va)&&(va=null),wa!==null&&yc(wa)&&(wa=null),ka!==null&&yc(ka)&&(ka=null),So.forEach(my),Co.forEach(my)}function xc(t,n){t.blockedOn===n&&(t.blockedOn=null,Uf||(Uf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sk)))}var bc=null;function gy(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 a=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(If(o||a)===null)continue;break}var h=Ni(a);h!==null&&(t.splice(n,3),n-=3,zd(h,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function ss(t){function n(I){return xc(I,t)}va!==null&&xc(va,t),wa!==null&&xc(wa,t),ka!==null&&xc(ka,t),So.forEach(n),Co.forEach(n);for(var a=0;a<ja.length;a++){var o=ja[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<ja.length&&(a=ja[0],a.blockedOn===null);)hy(a),a.blockedOn===null&&ja.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],h=a[o+1],v=f[zt]||null;if(typeof h=="function")v||gy(a);else if(v){var E=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[zt]||null)E=v.formAction;else if(If(f)!==null)continue}else E=v.action;typeof E=="function"?a[o+1]=E:(a.splice(o,3),o-=3),gy(a)}}}function yy(){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(a,20)}function a(){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(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Bf(t){this._internalRoot=t}vc.prototype.render=Bf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,o=Fn();oy(a,o,t,n,null,null)},vc.prototype.unmount=Bf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;oy(t.current,2,null,t,null,null),ec(),n[qn]=null}};function vc(t){this._internalRoot=t}vc.prototype.unstable_scheduleHydration=function(t){if(t){var n=bs();t={blockedOn:null,target:t,priority:n};for(var a=0;a<ja.length&&n!==0&&n<ja[a].priority;a++);ja.splice(a,0,t),a===0&&hy(t)}};var xy=i.version;if(xy!=="19.2.7")throw Error(r(527,xy,"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 Ck={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wc.isDisabled&&wc.supportsFiber)try{Pt=wc.inject(Ck),St=wc}catch{}}return Ao.createRoot=function(t,n){if(!u(t))throw Error(r(299));var a=!1,o="",f=Cm,h=Tm,v=Em;return n!=null&&(n.unstable_strictMode===!0&&(a=!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=ry(t,1,!1,null,null,a,o,null,f,h,v,yy),t[qn]=n.current,vf(t),new Bf(n)},Ao.hydrateRoot=function(t,n,a){if(!u(t))throw Error(r(299));var o=!1,f="",h=Cm,v=Tm,E=Em,I=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(I=a.formState)),n=ry(t,1,!0,n,a??null,o,f,I,h,v,E,yy),n.context=sy(null),a=n.current,o=Fn(),o=vr(o),f=oa(o),f.callback=null,ua(a,f,o),a=o,n.current.lanes=a,Ra(n,a),Wi(n),t[qn]=n.current,vf(t),new vc(n)},Ao.version="19.2.7",Ao}var Ny;function Bk(){if(Ny)return $f.exports;Ny=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),$f.exports=Uk(),$f.exports}var qk=Bk();function Hk(e,i){const l=i||{};return(e[e.length-1]===""?[...e,""]:e).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const $k=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vk={};function Dy(e,i){return(Vk.jsx?Gk:$k).test(e)}const Pk=/[ \t\n\f\r]/g;function Yk(e){return typeof e=="object"?e.type==="text"?_y(e.value):!1:_y(e)}function _y(e){return e.replace(Pk,"")===""}class Qo{constructor(i,l,r){this.normal=l,this.property=i,r&&(this.space=r)}}Qo.prototype.normal={};Qo.prototype.property={};Qo.prototype.space=void 0;function db(e,i){const l={},r={};for(const u of e)Object.assign(l,u.property),Object.assign(r,u.normal);return new Qo(l,r,i)}function _p(e){return e.toLowerCase()}class Bn{constructor(i,l){this.attribute=l,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 Fk=0;const Le=yr(),$t=yr(),Rp=yr(),fe=yr(),mt=yr(),pr=yr(),Wn=yr();function yr(){return 2**++Fk}const Mp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:$t,commaOrSpaceSeparated:Wn,commaSeparated:pr,number:fe,overloadedBoolean:Rp,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),Yf=Object.keys(Mp);class nh extends Bn{constructor(i,l,r,u){let c=-1;if(super(i,l),Ry(this,"space",u),typeof r=="number")for(;++c<Yf.length;){const d=Yf[c];Ry(this,Yf[c],(r&Mp[d])===Mp[d])}}}nh.prototype.defined=!0;function Ry(e,i,l){l&&(e[i]=l)}function ms(e){const i={},l={};for(const[r,u]of Object.entries(e.properties)){const c=new nh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,l[_p(r)]=r,l[_p(c.attribute)]=r}return new Qo(i,l,e.space)}const fb=ms({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:mt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:fe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:mt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:$t,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function pb(e,i){return i in e?e[i]:i}function hb(e,i){return pb(e,i.toLowerCase())}const Wk=ms({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:mt,autoFocus:Le,autoPlay:Le,blocking:mt,capture:null,charSet:null,checked:Le,cite:null,className:mt,closedBy:null,colorSpace:null,cols:fe,colSpan:fe,command:null,commandFor:null,content:null,contentEditable:$t,controls:Le,controlsList:mt,coords:fe|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:Rp,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:mt,height:fe,hidden:Rp,high:fe,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:mt,itemRef:mt,itemScope:Le,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:fe,pattern:null,ping:mt,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:mt,required:Le,reversed:Le,rows:fe,rowSpan:fe,sandbox:mt,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:$t,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:pr,part:mt,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:hb}),Kk=ms({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:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:mt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,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:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pb}),mb=ms({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()}}),gb=ms({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:hb}),yb=ms({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Xk={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"},Qk=/[A-Z]/g,My=/-[a-z]/g,Zk=/^data[-\w.:]+$/i;function Jk(e,i){const l=_p(i);let r=i,u=Bn;if(l in e.normal)return e.property[e.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&Zk.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(My,tj);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!My.test(c)){let d=c.replace(Qk,ej);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=nh}return new u(r,i)}function ej(e){return"-"+e.toLowerCase()}function tj(e){return e.charAt(1).toUpperCase()}const nj=db([fb,Wk,mb,gb,yb],"html"),ih=db([fb,Kk,mb,gb,yb],"svg");function ij(e){return e.join(" ").trim()}var os={},Ff,Oy;function lj(){if(Oy)return Ff;Oy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
- `,m="/",b="*",x="",j="comment",w="declaration";function T(U,N){if(typeof U!="string")throw new TypeError("First argument must be a string");if(!U)return[];N=N||{};var H=1,$=1;function W(ge){var ue=ge.match(i);ue&&(H+=ue.length);var V=ge.lastIndexOf(g);$=~V?ge.length-V:$+ge.length}function oe(){var ge={line:H,column:$};return function(ue){return ue.position=new _(ge),te(),ue}}function _(ge){this.start=ge,this.end={line:H,column:$},this.source=N.source}_.prototype.content=U;function X(ge){var ue=new Error(N.source+":"+H+":"+$+": "+ge);if(ue.reason=ge,ue.filename=N.source,ue.line=H,ue.column=$,ue.source=U,!N.silent)throw ue}function ae(ge){var ue=ge.exec(U);if(ue){var V=ue[0];return W(V),U=U.slice(V.length),ue}}function te(){ae(l)}function L(ge){var ue;for(ge=ge||[];ue=ee();)ue!==!1&&ge.push(ue);return ge}function ee(){var ge=oe();if(!(m!=U.charAt(0)||b!=U.charAt(1))){for(var ue=2;x!=U.charAt(ue)&&(b!=U.charAt(ue)||m!=U.charAt(ue+1));)++ue;if(ue+=2,x===U.charAt(ue-1))return X("End of comment missing");var V=U.slice(2,ue-2);return $+=2,W(V),U=U.slice(ue),$+=2,ge({type:j,comment:V})}}function de(){var ge=oe(),ue=ae(r);if(ue){if(ee(),!ae(u))return X("property missing ':'");var V=ae(c),se=ge({type:w,property:M(ue[0].replace(e,x)),value:V?M(V[0].replace(e,x)):x});return ae(d),se}}function Ae(){var ge=[];L(ge);for(var ue;ue=de();)ue!==!1&&(ge.push(ue),L(ge));return ge}return te(),Ae()}function M(U){return U?U.replace(p,x):x}return Ff=T,Ff}var zy;function aj(){if(zy)return os;zy=1;var e=os&&os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(os,"__esModule",{value:!0}),os.default=l;const i=e(lj());function l(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return os}var No={},Ly;function rj(){if(Ly)return No;Ly=1,Object.defineProperty(No,"__esModule",{value:!0}),No.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||l.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return No.camelCase=g,No}var Do,Iy;function sj(){if(Iy)return Do;Iy=1;var e=Do&&Do.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(aj()),l=rj();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,l.camelCase)(p,c)]=g)}),d}return r.default=r,Do=r,Do}var oj=sj();const uj=cb(oj),xb=bb("end"),lh=bb("start");function bb(e){return i;function i(l){const r=l&&l.position&&l.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 cj(e){const i=lh(e),l=xb(e);if(i&&l)return{start:i,end:l}}function Ho(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Uy(e.position):"start"in e||"end"in e?Uy(e):"line"in e||"column"in e?Op(e):""}function Op(e){return By(e&&e.line)+":"+By(e&&e.column)}function Uy(e){return Op(e&&e.start)+"-"+Op(e&&e.end)}function By(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(i,l,r){super(),typeof l=="string"&&(r=l,l=void 0);let u="",c={},d=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=Ho(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const ah={}.hasOwnProperty,dj=new Map,fj=/[A-Z]/g,pj=new Set(["table","tbody","thead","tfoot","tr"]),hj=new Set(["td","th"]),vb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mj(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=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=jj(l,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=kj(l,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:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ih:nj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=wb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function wb(e,i,l){if(i.type==="element")return gj(e,i,l);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return yj(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return bj(e,i,l);if(i.type==="mdxjsEsm")return xj(e,i);if(i.type==="root")return vj(e,i,l);if(i.type==="text")return wj(e,i)}function gj(e,i,l){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ih,e.schema=u),e.ancestors.push(i);const c=jb(e,i.tagName,!1),d=Sj(e,i);let p=sh(e,i);return pj.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Yk(g):!0})),kb(e,d,c,i),rh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function yj(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)}Ko(e,i.position)}function xj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Ko(e,i.position)}function bj(e,i,l){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ih,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:jb(e,i.name,!0),d=Cj(e,i),p=sh(e,i);return kb(e,d,c,i),rh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function vj(e,i,l){const r={};return rh(r,sh(e,i)),e.create(i,e.Fragment,r,l)}function wj(e,i){return i.value}function kb(e,i,l,r){typeof l!="string"&&l!==e.Fragment&&e.passNode&&(i.node=r)}function rh(e,i){if(i.length>0){const l=i.length>1?i:i[0];l&&(e.children=l)}}function kj(e,i,l){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?l:i;return p?m(c,d,p):m(c,d)}}function jj(e,i){return l;function l(r,u,c,d){const p=Array.isArray(c.children),g=lh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function Sj(e,i){const l={};let r,u;for(u in i.properties)if(u!=="children"&&ah.call(i.properties,u)){const c=Tj(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&hj.has(i.tagName)?r=p:l[d]=p}}if(r){const c=l.style||(l.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return l}function Cj(e,i){const l={};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(l,e.evaluater.evaluateExpression(p.argument))}else Ko(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 Ko(e,i.position);else c=r.value===null?!0:r.value;l[u]=c}return l}function sh(e,i){const l=[];let r=-1;const u=e.passKeys?new Map:dj;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=wb(e,c,d);p!==void 0&&l.push(p)}return l}function Tj(e,i,l){const r=Jk(e.schema,i);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=r.commaSeparated?Hk(l):ij(l)),r.property==="style"){let u=typeof l=="object"?l:Ej(e,String(l));return e.stylePropertyNameCase==="css"&&(u=Aj(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Xk[r.property]||r.property:r.attribute,l]}}function Ej(e,i){try{return uj(i,{reactCompat:!0})}catch(l){if(e.ignoreInvalidStyle)return{};const r=l,u=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=vb+"#cannot-parse-style-attribute",u}}function jb(e,i,l){let r;if(!l)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Dy(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=Dy(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return ah.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ko(e)}function Ko(e,i){const l=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=vb+"#cannot-handle-mdx-estrees-without-createevaluater",l}function Aj(e){const i={};let l;for(l in e)ah.call(e,l)&&(i[Nj(l)]=e[l]);return i}function Nj(e){let i=e.replace(fj,Dj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Dj(e){return"-"+e.toLowerCase()}const Wf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_j={};function oh(e,i){const l=_j,r=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,u=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Sb(e,r,u)}function Sb(e,i,l){if(Rj(e)){if("value"in e)return e.type==="html"&&!l?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return qy(e.children,i,l)}return Array.isArray(e)?qy(e,i,l):""}function qy(e,i,l){const r=[];let u=-1;for(;++u<e.length;)r[u]=Sb(e[u],i,l);return r.join("")}function Rj(e){return!!(e&&typeof e=="object")}const Hy=document.createElement("i");function uh(e){const i="&"+e+";";Hy.innerHTML=i;const l=Hy.textContent;return l.charCodeAt(l.length-1)===59&&e!=="semi"||l===i?!1:l}function Kn(e,i,l,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,l=l>0?l:0,r.length<1e4)d=Array.from(r),d.unshift(i,l),e.splice(...d);else for(l&&e.splice(i,l);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function fi(e,i){return e.length>0?(Kn(e,e.length,0,i),e):i}const $y={}.hasOwnProperty;function Cb(e){const i={};let l=-1;for(;++l<e.length;)Mj(i,e[l]);return i}function Mj(e,i){let l;for(l in i){const u=($y.call(e,l)?e[l]:void 0)||(e[l]={}),c=i[l];let d;if(c)for(d in c){$y.call(u,d)||(u[d]=[]);const p=c[d];Oj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Oj(e,i){let l=-1;const r=[];for(;++l<i.length;)(i[l].add==="after"?e:r).push(i[l]);Kn(e,0,0,r)}function Tb(e,i){const l=Number.parseInt(e,i);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wn=Da(/[A-Za-z]/),hn=Da(/[\dA-Za-z]/),zj=Da(/[#-'*+\--9=?A-Z^-~]/);function qc(e){return e!==null&&(e<32||e===127)}const zp=Da(/\d/),Lj=Da(/[\dA-Fa-f]/),Ij=Da(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const Wc=Da(new RegExp("\\p{P}|\\p{S}","u")),hr=Da(/\s/);function Da(e){return i;function i(l){return l!==null&&l>-1&&e.test(String.fromCharCode(l))}}function gs(e){const i=[];let l=-1,r=0,u=0;for(;++l<e.length;){const c=e.charCodeAt(l);let d="";if(c===37&&hn(e.charCodeAt(l+1))&&hn(e.charCodeAt(l+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(l+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,l),encodeURIComponent(d)),r=l+u+1,d=""),u&&(l+=u,u=0)}return i.join("")+e.slice(r)}function tt(e,i,l,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return We(g)?(e.enter(l),p(g)):i(g)}function p(g){return We(g)&&c++<u?(e.consume(g),p):(e.exit(l),i(g))}}const Uj={tokenize:Bj};function Bj(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let l;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=g),l=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Re(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const qj={tokenize:Hj},Gy={tokenize:$j};function Hj(e){const i=this,l=[];let r=0,u,c,d;return p;function p($){if(r<l.length){const W=l[r];return i.containerState=W[1],e.attempt(W[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const W=i.events.length;let oe=W,_;for(;oe--;)if(i.events[oe][0]==="exit"&&i.events[oe][1].type==="chunkFlow"){_=i.events[oe][1].end;break}N(r);let X=W;for(;X<i.events.length;)i.events[X][1].end={..._},X++;return Kn(i.events,oe+1,0,i.events.slice(W)),i.events.length=X,m($)}return p($)}function m($){if(r===l.length){if(!u)return j($);if(u.currentConstruct&&u.currentConstruct.concrete)return T($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Gy,b,x)($)}function b($){return u&&H(),N(r),j($)}function x($){return i.parser.lazy[i.now().line]=r!==l.length,d=i.now().offset,T($)}function j($){return i.containerState={},e.attempt(Gy,w,T)($)}function w($){return r++,l.push([i.currentConstruct,i.containerState]),j($)}function T($){if($===null){u&&H(),N(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),M($)}function M($){if($===null){U(e.exit("chunkFlow"),!0),N(0),e.consume($);return}return Re($)?(e.consume($),U(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),M)}function U($,W){const oe=i.sliceStream($);if(W&&oe.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(oe),i.parser.lazy[$.start.line]){let _=u.events.length;for(;_--;)if(u.events[_][1].start.offset<d&&(!u.events[_][1].end||u.events[_][1].end.offset>d))return;const X=i.events.length;let ae=X,te,L;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(te){L=i.events[ae][1].end;break}te=!0}for(N(r),_=X;_<i.events.length;)i.events[_][1].end={...L},_++;Kn(i.events,ae+1,0,i.events.slice(X)),i.events.length=_}}function N($){let W=l.length;for(;W-- >$;){const oe=l[W];i.containerState=oe[1],oe[0].exit.call(i,e)}l.length=$}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function $j(e,i,l){return tt(e,e.attempt(this.parser.constructs.document,i,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ps(e){if(e===null||gt(e)||hr(e))return 1;if(Wc(e))return 2}function Kc(e,i,l){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,l),r.push(c))}return i}const Lp={name:"attention",resolveAll:Gj,tokenize:Vj};function Gj(e,i){let l=-1,r,u,c,d,p,g,m,b;for(;++l<e.length;)if(e[l][0]==="enter"&&e[l][1].type==="attentionSequence"&&e[l][1]._close){for(r=l;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[l][1]).charCodeAt(0)){if((e[r][1]._close||e[l][1]._open)&&(e[l][1].end.offset-e[l][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[l][1].end.offset-e[l][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const x={...e[r][1].end},j={...e[l][1].start};Vy(x,-g),Vy(j,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[l][1].start},end:j},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[l][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[l][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=fi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=fi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=fi(m,Kc(i.parser.constructs.insideSpan.null,e.slice(r+1,l),i)),m=fi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[l][1].end.offset-e[l][1].start.offset?(b=2,m=fi(m,[["enter",e[l][1],i],["exit",e[l][1],i]])):b=0,Kn(e,r-1,l-r+3,m),l=r+m.length-b-2;break}}for(l=-1;++l<e.length;)e[l][1].type==="attentionSequence"&&(e[l][1].type="data");return e}function Vj(e,i){const l=this.parser.constructs.attentionMarkers.null,r=this.previous,u=ps(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=ps(g),x=!b||b===2&&u||l.includes(g),j=!u||u===2&&b||l.includes(r);return m._open=!!(c===42?x:x&&(u||!j)),m._close=!!(c===42?j:j&&(b||!x)),i(g)}}function Vy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const Pj={name:"autolink",tokenize:Yj};function Yj(e,i,l){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 wn(w)?(e.consume(w),d):w===64?l(w):m(w)}function d(w){return w===43||w===45||w===46||hn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||hn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||qc(w)?l(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):zj(w)?(e.consume(w),m):l(w)}function b(w){return hn(w)?x(w):l(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):j(w)}function j(w){if((w===45||hn(w))&&r++<63){const T=w===45?j:x;return e.consume(w),T}return l(w)}}const Zo={partial:!0,tokenize:Fj};function Fj(e,i,l){return r;function r(c){return We(c)?tt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Re(c)?i(c):l(c)}}const Eb={continuation:{tokenize:Kj},exit:Xj,name:"blockQuote",tokenize:Wj};function Wj(e,i,l){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 l(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 Kj(e,i,l){const r=this;return u;function u(d){return We(d)?tt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Eb,i,l)(d)}}function Xj(e){e.exit("blockQuote")}const Ab={name:"characterEscape",tokenize:Qj};function Qj(e,i,l){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return Ij(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):l(c)}}const Nb={name:"characterReference",tokenize:Zj};function Zj(e,i,l){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=hn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Lj,b):(e.enter("characterReferenceValue"),c=7,d=zp,b(x))}function b(x){if(x===59&&u){const j=e.exit("characterReferenceValue");return d===hn&&!uh(r.sliceSerialize(j))?l(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):l(x)}}const Py={partial:!0,tokenize:eS},Yy={concrete:!0,name:"codeFenced",tokenize:Jj};function Jj(e,i,l){const r=this,u={partial:!0,tokenize:oe};let c=0,d=0,p;return g;function g(_){return m(_)}function m(_){const X=r.events[r.events.length-1];return c=X&&X[1].type==="linePrefix"?X[2].sliceSerialize(X[1],!0).length:0,p=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===p?(d++,e.consume(_),b):d<3?l(_):(e.exit("codeFencedFenceSequence"),We(_)?tt(e,x,"whitespace")(_):x(_))}function x(_){return _===null||Re(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(Py,M,W)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(_))}function j(_){return _===null||Re(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(_)):We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,w,"whitespace")(_)):_===96&&_===p?l(_):(e.consume(_),j)}function w(_){return _===null||Re(_)?x(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(_))}function T(_){return _===null||Re(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(_)):_===96&&_===p?l(_):(e.consume(_),T)}function M(_){return e.attempt(u,W,U)(_)}function U(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return c>0&&We(_)?tt(e,H,"linePrefix",c+1)(_):H(_)}function H(_){return _===null||Re(_)?e.check(Py,M,W)(_):(e.enter("codeFlowValue"),$(_))}function $(_){return _===null||Re(_)?(e.exit("codeFlowValue"),H(_)):(e.consume(_),$)}function W(_){return e.exit("codeFenced"),i(_)}function oe(_,X,ae){let te=0;return L;function L(ue){return _.enter("lineEnding"),_.consume(ue),_.exit("lineEnding"),ee}function ee(ue){return _.enter("codeFencedFence"),We(ue)?tt(_,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(_.enter("codeFencedFenceSequence"),Ae(ue)):ae(ue)}function Ae(ue){return ue===p?(te++,_.consume(ue),Ae):te>=d?(_.exit("codeFencedFenceSequence"),We(ue)?tt(_,ge,"whitespace")(ue):ge(ue)):ae(ue)}function ge(ue){return ue===null||Re(ue)?(_.exit("codeFencedFence"),X(ue)):ae(ue)}}}function eS(e,i,l){const r=this;return u;function u(d){return d===null?l(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}const Kf={name:"codeIndented",tokenize:nS},tS={partial:!0,tokenize:iS};function nS(e,i,l){const r=this;return u;function u(m){return e.enter("codeIndented"),tt(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):l(m)}function d(m){return m===null?g(m):Re(m)?e.attempt(tS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Re(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function iS(e,i,l){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?l(d):Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):tt(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Re(d)?u(d):l(d)}}const lS={name:"codeText",previous:rS,resolve:aS,tokenize:sS};function aS(e){let i=e.length-4,l=3,r,u;if((e[l][1].type==="lineEnding"||e[l][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=l;++r<i;)if(e[r][1].type==="codeTextData"){e[l][1].type="codeTextPadding",e[i][1].type="codeTextPadding",l+=2,i-=2;break}}for(r=l-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 rS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function sS(e,i,l){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?l(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Re(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Re(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class oS{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,l){const r=l??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,l,r){const u=l||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&_o(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),_o(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),_o(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 l=this.left.splice(i,Number.POSITIVE_INFINITY);_o(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);_o(this.left,l.reverse())}}}function _o(e,i){let l=0;if(i.length<1e4)e.push(...i);else for(;l<i.length;)e.push(...i.slice(l,l+1e4)),l+=1e4}function Db(e){const i={};let l=-1,r,u,c,d,p,g,m;const b=new oS(e);for(;++l<b.length;){for(;l in i;)l=i[l];if(r=b.get(l),l&&r[1].type==="chunkFlow"&&b.get(l-1)[1].type==="listItemPrefix"&&(g=r[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,uS(b,l)),l=i[l],m=!0);else if(r[1]._container){for(c=l,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,l),p.unshift(r),b.splice(u,l-u+1,p))}}return Kn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function uS(e,i){const l=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=l._tokenizer;d||(d=r.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,j=-1,w=l,T=0,M=0;const U=[M];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=l;++j<p.length;)p[j][0]==="exit"&&p[j-1][0]==="enter"&&p[j][1].type===p[j-1][1].type&&p[j][1].start.line!==p[j][1].end.line&&(M=j+1,U.push(M),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):U.pop(),j=U.length;j--;){const N=p.slice(U[j],U[j+1]),H=c.pop();g.push([H,H+N.length-1]),e.splice(H,2,N)}for(g.reverse(),j=-1;++j<g.length;)m[T+g[j][0]]=T+g[j][1],T+=g[j][1]-g[j][0]-1;return m}const cS={resolve:fS,tokenize:pS},dS={partial:!0,tokenize:hS};function fS(e){return Db(e),e}function pS(e,i){let l;return r;function r(p){return e.enter("content"),l=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Re(p)?e.check(dS,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"),l.next=e.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,u}}function hS(e,i,l){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),tt(e,c,"linePrefix")}function c(d){if(d===null||Re(d))return l(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,l,i)(d)}}function _b(e,i,l,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(N){return N===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(N),e.exit(c),j):N===null||N===32||N===41||qc(N)?l(N):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),M(N))}function j(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===62?(e.exit("chunkString"),e.exit(p),j(N)):N===null||N===60||Re(N)?l(N):(e.consume(N),N===92?T:w)}function T(N){return N===60||N===62||N===92?(e.consume(N),w):w(N)}function M(N){return!b&&(N===null||N===41||gt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):b<m&&N===40?(e.consume(N),b++,M):N===41?(e.consume(N),b--,M):N===null||N===32||N===40||qc(N)?l(N):(e.consume(N),N===92?U:M)}function U(N){return N===40||N===41||N===92?(e.consume(N),M):M(N)}}function Rb(e,i,l,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?l(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Re(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||Re(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!We(w)),w===92?j:x)}function j(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Mb(e,i,l,r,u,c){let d;return p;function p(j){return j===34||j===39||j===40?(e.enter(r),e.enter(u),e.consume(j),e.exit(u),d=j===40?41:j,g):l(j)}function g(j){return j===d?(e.enter(u),e.consume(j),e.exit(u),e.exit(r),i):(e.enter(c),m(j))}function m(j){return j===d?(e.exit(c),g(d)):j===null?l(j):Re(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),tt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===d||j===null||Re(j)?(e.exit("chunkString"),m(j)):(e.consume(j),j===92?x:b)}function x(j){return j===d||j===92?(e.consume(j),b):b(j)}}function $o(e,i){let l;return r;function r(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l=!0,r):We(u)?tt(e,r,l?"linePrefix":"lineSuffix")(u):i(u)}}const mS={name:"definition",tokenize:yS},gS={partial:!0,tokenize:xS};function yS(e,i,l){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Rb.call(r,e,p,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):l(w)}function g(w){return gt(w)?$o(e,m)(w):m(w)}function m(w){return _b(e,b,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(gS,x,x)(w)}function x(w){return We(w)?tt(e,j,"whitespace")(w):j(w)}function j(w){return w===null||Re(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):l(w)}}function xS(e,i,l){return r;function r(p){return gt(p)?$o(e,u)(p):l(p)}function u(p){return Mb(e,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return We(p)?tt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Re(p)?i(p):l(p)}}const bS={name:"hardBreakEscape",tokenize:vS};function vS(e,i,l){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Re(c)?(e.exit("hardBreakEscape"),i(c)):l(c)}}const wS={name:"headingAtx",resolve:kS,tokenize:jS};function kS(e,i){let l=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),l-2>r&&e[l][1].type==="whitespace"&&(l-=2),e[l][1].type==="atxHeadingSequence"&&(r===l-1||l-4>r&&e[l-2][1].type==="whitespace")&&(l-=r+1===l?2:4),l>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[l][1].end},c={type:"chunkText",start:e[r][1].start,end:e[l][1].end,contentType:"text"},Kn(e,r,l-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function jS(e,i,l){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||gt(b)?(e.exit("atxHeadingSequence"),p(b)):l(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Re(b)?(e.exit("atxHeading"),i(b)):We(b)?tt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||gt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const SS=["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"],Fy=["pre","script","style","textarea"],CS={concrete:!0,name:"htmlFlow",resolveTo:AS,tokenize:NS},TS={partial:!0,tokenize:_S},ES={partial:!0,tokenize:DS};function AS(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 NS(e,i,l){const r=this;let u,c,d,p,g;return m;function m(C){return b(C)}function b(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),x}function x(C){return C===33?(e.consume(C),j):C===47?(e.consume(C),c=!0,M):C===63?(e.consume(C),u=3,r.interrupt?i:O):wn(C)?(e.consume(C),d=String.fromCharCode(C),U):l(C)}function j(C){return C===45?(e.consume(C),u=2,w):C===91?(e.consume(C),u=5,p=0,T):wn(C)?(e.consume(C),u=4,r.interrupt?i:O):l(C)}function w(C){return C===45?(e.consume(C),r.interrupt?i:O):l(C)}function T(C){const K="CDATA[";return C===K.charCodeAt(p++)?(e.consume(C),p===K.length?r.interrupt?i:de:T):l(C)}function M(C){return wn(C)?(e.consume(C),d=String.fromCharCode(C),U):l(C)}function U(C){if(C===null||C===47||C===62||gt(C)){const K=C===47,me=d.toLowerCase();return!K&&!c&&Fy.includes(me)?(u=1,r.interrupt?i(C):de(C)):SS.includes(d.toLowerCase())?(u=6,K?(e.consume(C),N):r.interrupt?i(C):de(C)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?l(C):c?H(C):$(C))}return C===45||hn(C)?(e.consume(C),d+=String.fromCharCode(C),U):l(C)}function N(C){return C===62?(e.consume(C),r.interrupt?i:de):l(C)}function H(C){return We(C)?(e.consume(C),H):L(C)}function $(C){return C===47?(e.consume(C),L):C===58||C===95||wn(C)?(e.consume(C),W):We(C)?(e.consume(C),$):L(C)}function W(C){return C===45||C===46||C===58||C===95||hn(C)?(e.consume(C),W):oe(C)}function oe(C){return C===61?(e.consume(C),_):We(C)?(e.consume(C),oe):$(C)}function _(C){return C===null||C===60||C===61||C===62||C===96?l(C):C===34||C===39?(e.consume(C),g=C,X):We(C)?(e.consume(C),_):ae(C)}function X(C){return C===g?(e.consume(C),g=null,te):C===null||Re(C)?l(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||gt(C)?oe(C):(e.consume(C),ae)}function te(C){return C===47||C===62||We(C)?$(C):l(C)}function L(C){return C===62?(e.consume(C),ee):l(C)}function ee(C){return C===null||Re(C)?de(C):We(C)?(e.consume(C),ee):l(C)}function de(C){return C===45&&u===2?(e.consume(C),V):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),_e):Re(C)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(TS,z,Ae)(C)):C===null||Re(C)?(e.exit("htmlFlowData"),Ae(C)):(e.consume(C),de)}function Ae(C){return e.check(ES,ge,z)(C)}function ge(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),ue}function ue(C){return C===null||Re(C)?Ae(C):(e.enter("htmlFlowData"),de(C))}function V(C){return C===45?(e.consume(C),O):de(C)}function se(C){return C===47?(e.consume(C),d="",ye):de(C)}function ye(C){if(C===62){const K=d.toLowerCase();return Fy.includes(K)?(e.consume(C),A):de(C)}return wn(C)&&d.length<8?(e.consume(C),d+=String.fromCharCode(C),ye):de(C)}function _e(C){return C===93?(e.consume(C),O):de(C)}function O(C){return C===62?(e.consume(C),A):C===45&&u===2?(e.consume(C),O):de(C)}function A(C){return C===null||Re(C)?(e.exit("htmlFlowData"),z(C)):(e.consume(C),A)}function z(C){return e.exit("htmlFlow"),i(C)}}function DS(e,i,l){const r=this;return u;function u(d){return Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):l(d)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}function _S(e,i,l){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Zo,i,l)}}const RS={name:"htmlText",tokenize:MS};function MS(e,i,l){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),oe):O===63?(e.consume(O),$):wn(O)?(e.consume(O),ae):l(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,T):wn(O)?(e.consume(O),H):l(O)}function b(O){return O===45?(e.consume(O),w):l(O)}function x(O){return O===null?l(O):O===45?(e.consume(O),j):Re(O)?(d=x,se(O)):(e.consume(O),x)}function j(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?j(O):x(O)}function T(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?M:T):l(O)}function M(O){return O===null?l(O):O===93?(e.consume(O),U):Re(O)?(d=M,se(O)):(e.consume(O),M)}function U(O){return O===93?(e.consume(O),N):M(O)}function N(O){return O===62?V(O):O===93?(e.consume(O),N):M(O)}function H(O){return O===null||O===62?V(O):Re(O)?(d=H,se(O)):(e.consume(O),H)}function $(O){return O===null?l(O):O===63?(e.consume(O),W):Re(O)?(d=$,se(O)):(e.consume(O),$)}function W(O){return O===62?V(O):$(O)}function oe(O){return wn(O)?(e.consume(O),_):l(O)}function _(O){return O===45||hn(O)?(e.consume(O),_):X(O)}function X(O){return Re(O)?(d=X,se(O)):We(O)?(e.consume(O),X):V(O)}function ae(O){return O===45||hn(O)?(e.consume(O),ae):O===47||O===62||gt(O)?te(O):l(O)}function te(O){return O===47?(e.consume(O),V):O===58||O===95||wn(O)?(e.consume(O),L):Re(O)?(d=te,se(O)):We(O)?(e.consume(O),te):V(O)}function L(O){return O===45||O===46||O===58||O===95||hn(O)?(e.consume(O),L):ee(O)}function ee(O){return O===61?(e.consume(O),de):Re(O)?(d=ee,se(O)):We(O)?(e.consume(O),ee):te(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?l(O):O===34||O===39?(e.consume(O),u=O,Ae):Re(O)?(d=de,se(O)):We(O)?(e.consume(O),de):(e.consume(O),ge)}function Ae(O){return O===u?(e.consume(O),u=void 0,ue):O===null?l(O):Re(O)?(d=Ae,se(O)):(e.consume(O),Ae)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?l(O):O===47||O===62||gt(O)?te(O):(e.consume(O),ge)}function ue(O){return O===47||O===62||gt(O)?te(O):l(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):l(O)}function se(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ye}function ye(O){return We(O)?tt(e,_e,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):_e(O)}function _e(O){return e.enter("htmlTextData"),d(O)}}const ch={name:"labelEnd",resolveAll:IS,resolveTo:US,tokenize:BS},OS={tokenize:qS},zS={tokenize:HS},LS={tokenize:$S};function IS(e){let i=-1;const l=[];for(;++i<e.length;){const r=e[i][1];if(l.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!==l.length&&Kn(e,0,e.length,l),e}function US(e,i){let l=e.length,r=0,u,c,d,p;for(;l--;)if(u=e[l][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[l][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[l][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=l,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=l);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=fi(p,e.slice(c+1,c+r+3)),p=fi(p,[["enter",b,i]]),p=fi(p,Kc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=fi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=fi(p,e.slice(d+1)),p=fi(p,[["exit",g,i]]),Kn(e,c,e.length,p),e}function BS(e,i,l){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(j){return c?c._inactive?x(j):(d=r.parser.defined.includes(ji(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(j),e.exit("labelMarker"),e.exit("labelEnd"),g):l(j)}function g(j){return j===40?e.attempt(OS,b,d?b:x)(j):j===91?e.attempt(zS,b,d?m:x)(j):d?b(j):x(j)}function m(j){return e.attempt(LS,b,x)(j)}function b(j){return i(j)}function x(j){return c._balanced=!0,l(j)}}function qS(e,i,l){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return gt(x)?$o(e,c)(x):c(x)}function c(x){return x===41?b(x):_b(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return gt(x)?$o(e,g)(x):b(x)}function p(x){return l(x)}function g(x){return x===34||x===39||x===40?Mb(e,m,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return gt(x)?$o(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):l(x)}}function HS(e,i,l){const r=this;return u;function u(p){return Rb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):l(p)}function d(p){return l(p)}}function $S(e,i,l){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):l(c)}}const GS={name:"labelStartImage",resolveAll:ch.resolveAll,tokenize:VS};function VS(e,i,l){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):l(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?l(p):i(p)}}const PS={name:"labelStartLink",resolveAll:ch.resolveAll,tokenize:YS};function YS(e,i,l){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?l(d):i(d)}}const Xf={name:"lineEnding",tokenize:FS};function FS(e,i){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}const Oc={name:"thematicBreak",tokenize:WS};function WS(e,i,l){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Re(m))?(e.exit("thematicBreak"),i(m)):l(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),We(m)?tt(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:ZS},exit:e0,name:"list",tokenize:QS},KS={partial:!0,tokenize:t0},XS={partial:!0,tokenize:JS};function QS(e,i,l){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const T=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:zp(w)){if(r.containerState.type||(r.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Oc,l,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return l(w)}function g(w){return zp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):l(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Zo,r.interrupt?l:b,e.attempt(KS,j,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,j(w)}function x(w){return We(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),j):l(w)}function j(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function ZS(e,i,l){const r=this;return r.containerState._closeFlow=void 0,e.check(Zo,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tt(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!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(XS,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(In,i,l),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function JS(e,i,l){const r=this;return tt(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):l(c)}}function e0(e){e.exit(this.containerState.type)}function t0(e,i,l){const r=this;return tt(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!We(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):l(c)}}const Wy={name:"setextUnderline",resolveTo:n0,tokenize:i0};function n0(e,i){let l=e.length,r,u,c;for(;l--;)if(e[l][0]==="enter"){if(e[l][1].type==="content"){r=l;break}e[l][1].type==="paragraph"&&(u=l)}else e[l][1].type==="content"&&e.splice(l,1),!c&&e[l][1].type==="definition"&&(c=l);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 i0(e,i,l){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)):l(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)?tt(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Re(m)?(e.exit("setextHeadingLine"),i(m)):l(m)}}const l0={tokenize:a0};function a0(e){const i=this,l=e.attempt(Zo,r,e.attempt(this.parser.constructs.flowInitial,u,tt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(cS,u)),"linePrefix")));return l;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,l}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,l}}const r0={resolveAll:zb()},s0=Ob("string"),o0=Ob("text");function Ob(e){return{resolveAll:zb(e==="text"?u0:void 0),tokenize:i};function i(l){const r=this,u=this.parser.constructs[e],c=l.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){l.consume(b);return}return l.enter("data"),l.consume(b),g}function g(b){return m(b)?(l.exit("data"),c(b)):(l.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let j=-1;if(x)for(;++j<x.length;){const w=x[j];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function zb(e){return i;function i(l,r){let u=-1,c;for(;++u<=l.length;)c===void 0?l[u]&&l[u][1].type==="data"&&(c=u,u++):(!l[u]||l[u][1].type!=="data")&&(u!==c+2&&(l[c][1].end=l[u-1][1].end,l.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(l,r):l}}function u0(e,i){let l=0;for(;++l<=e.length;)if((l===e.length||e[l][1].type==="lineEnding")&&e[l-1][1].type==="data"){const r=e[l-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&l===e.length&&(p=0),p){const m={type:l===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(l,0,["enter",m,i],["exit",m,i]),l+=2)}l++}return e}const c0={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:Eb},d0={91:mS},f0={[-2]:Kf,[-1]:Kf,32:Kf},p0={35:wS,42:Oc,45:[Wy,Oc],60:CS,61:Wy,95:Oc,96:Yy,126:Yy},h0={38:Nb,92:Ab},m0={[-5]:Xf,[-4]:Xf,[-3]:Xf,33:GS,38:Nb,42:Lp,60:[Pj,RS],91:PS,92:[bS,Ab],93:ch,95:Lp,96:lS},g0={null:[Lp,r0]},y0={null:[42,95]},x0={null:[]},b0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:y0,contentInitial:d0,disable:x0,document:c0,flow:p0,flowInitial:f0,insideSpan:g0,string:h0,text:m0},Symbol.toStringTag,{value:"Module"}));function v0(e,i,l){let r={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:X(oe),check:X(_),consume:H,enter:$,exit:W,interrupt:X(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:M,events:[],now:T,parser:e,previous:null,sliceSerialize:j,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(ee){return d=fi(d,ee),U(),d[d.length-1]!==null?[]:(ae(i,0),m.events=Kc(c,m.events,m),m.events)}function j(ee,de){return k0(w(ee),de)}function w(ee){return w0(d,ee)}function T(){const{_bufferIndex:ee,_index:de,line:Ae,column:ge,offset:ue}=r;return{_bufferIndex:ee,_index:de,line:Ae,column:ge,offset:ue}}function M(ee){u[ee.line]=ee.column,L()}function U(){let ee;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(ee=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ee&&r._bufferIndex<de.length;)N(de.charCodeAt(r._bufferIndex));else N(de)}}function N(ee){b=b(ee)}function H(ee){Re(ee)?(r.line++,r.column=1,r.offset+=ee===-3?2:1,L()):ee!==-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=ee}function $(ee,de){const Ae=de||{};return Ae.type=ee,Ae.start=T(),m.events.push(["enter",Ae,m]),p.push(Ae),Ae}function W(ee){const de=p.pop();return de.end=T(),m.events.push(["exit",de,m]),de}function oe(ee,de){ae(ee,de.from)}function _(ee,de){de.restore()}function X(ee,de){return Ae;function Ae(ge,ue,V){let se,ye,_e,O;return Array.isArray(ge)?z(ge):"tokenize"in ge?z([ge]):A(ge);function A(Q){return xe;function xe(ze){const Ke=ze!==null&&Q[ze],Rt=ze!==null&&Q.null,Kt=[...Array.isArray(Ke)?Ke:Ke?[Ke]:[],...Array.isArray(Rt)?Rt:Rt?[Rt]:[]];return z(Kt)(ze)}}function z(Q){return se=Q,ye=0,Q.length===0?V:C(Q[ye])}function C(Q){return xe;function xe(ze){return O=te(),_e=Q,Q.partial||(m.currentConstruct=Q),Q.name&&m.parser.constructs.disable.null.includes(Q.name)?me():Q.tokenize.call(de?Object.assign(Object.create(m),de):m,g,K,me)(ze)}}function K(Q){return ee(_e,O),ue}function me(Q){return O.restore(),++ye<se.length?C(se[ye]):V}}}function ae(ee,de){ee.resolveAll&&!c.includes(ee)&&c.push(ee),ee.resolve&&Kn(m.events,de,m.events.length-de,ee.resolve(m.events.slice(de),m)),ee.resolveTo&&(m.events=ee.resolveTo(m.events,m))}function te(){const ee=T(),de=m.previous,Ae=m.currentConstruct,ge=m.events.length,ue=Array.from(p);return{from:ge,restore:V};function V(){r=ee,m.previous=de,m.currentConstruct=Ae,m.events.length=ge,p=ue,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function w0(e,i){const l=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(l===u)d=[e[l].slice(r,c)];else{if(d=e.slice(l,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 k0(e,i){let l=-1;const r=[];let u;for(;++l<e.length;){const c=e[l];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
49
+ `+o.stack}}var gn=Object.prototype.hasOwnProperty,Xt=e.unstable_scheduleCallback,Si=e.unstable_cancelCallback,Xn=e.unstable_shouldYield,Nl=e.unstable_requestPaint,At=e.unstable_now,Dl=e.unstable_getCurrentPriorityLevel,ie=e.unstable_ImmediatePriority,ce=e.unstable_UserBlockingPriority,Ce=e.unstable_NormalPriority,Ie=e.unstable_LowPriority,Xe=e.unstable_IdlePriority,Vt=e.log,Qn=e.unstable_setDisableYieldValue,Pt=null,St=null;function ut(t){if(typeof Vt=="function"&&Qn(t),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Pt,t)}catch{}}var rt=Math.clz32?Math.clz32:id,Ci=Math.log,kn=Math.LN2;function id(t){return t>>>=0,t===0?32:31-(Ci(t)/kn|0)|0}var br=256,vr=262144,_a=4194304;function Ti(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _l(t,n,a){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var A=o&134217727;return A!==0?(o=A&~h,o!==0?f=Ti(o):(v&=A,v!==0?f=Ti(v):a||(a=A&~t,a!==0&&(f=Ti(a))))):(A=o&~h,A!==0?f=Ti(A):v!==0?f=Ti(v):a||(a=o&~t,a!==0&&(f=Ti(a)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,a=n&-n,h>=a||h===32&&(a&4194048)!==0)?n:f}function nn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Rl(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 yt(){var t=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),t}function Ji(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function Ra(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ma(t,n,a,o,f,h){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var A=t.entanglements,L=t.expirationTimes,Y=t.hiddenUpdates;for(a=v&~a;0<a;){var ne=31-rt(a),re=1<<ne;A[ne]=0,L[ne]=-1;var F=Y[ne];if(F!==null)for(Y[ne]=null,ne=0;ne<F.length;ne++){var Z=F[ne];Z!==null&&(Z.lane&=-536870913)}a&=~re}o!==0&&xs(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function xs(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-rt(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|a&261930}function Ml(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var o=31-rt(a),f=1<<o;f&n|t[o]&n&&(t[o]|=n),a&=~f}}function tu(t,n){var a=n&-n;return a=(a&42)!==0?1:wr(a),(a&(t.suspendedLanes|n))!==0?0:a}function wr(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 bs(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function vs(){var t=se.p;return t!==0?t:(t=window.event,t===void 0?32:hy(t.type))}function nu(t,n){var a=se.p;try{return se.p=t,n()}finally{se.p=a}}var Zn=Math.random().toString(36).slice(2),Yt="__reactFiber$"+Zn,zt="__reactProps$"+Zn,qn="__reactContainer$"+Zn,Ei="__reactEvents$"+Zn,Ol="__reactListeners$"+Zn,zl="__reactHandles$"+Zn,kr="__reactResources$"+Zn,Ai="__reactMarker$"+Zn;function ws(t){delete t[Yt],delete t[zt],delete t[Ei],delete t[Ol],delete t[zl]}function Jn(t){var n=t[Yt];if(n)return n;for(var a=t.parentNode;a;){if(n=a[qn]||a[Yt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=Zg(t);t!==null;){if(a=t[Yt])return a;t=Zg(t)}return n}t=a,a=t.parentNode}return null}function Ni(t){if(t=t[Yt]||t[qn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function el(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function Di(t){var n=t[kr];return n||(n=t[kr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ct(t){t[Ai]=!0}var iu=new Set,ks={};function un(t,n){_i(t,n),_i(t+"Capture",n)}function _i(t,n){for(ks[t]=n,t=0;t<n.length;t++)iu.add(n[t])}var lu=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]*$"),au={},ru={};function Ll(t){return gn.call(ru,t)?!0:gn.call(au,t)?!1:lu.test(t)?ru[t]=!0:(au[t]=!0,!1)}function jr(t,n,a){if(Ll(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){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,""+a)}}function Oa(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function Qt(t,n,a,o){if(o===null)t.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+o)}}function Lt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function su(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ri(t,n,a){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){a=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function tl(t){if(!t._valueTracker){var n=su(t)?"checked":"value";t._valueTracker=Ri(t,n,""+t[n])}}function js(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),o="";return t&&(o=su(t)?t.checked?"true":"false":t.value),t=o,t!==a?(n.setValue(t),!0):!1}function jn(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var hi=/[\n"\\]/g;function It(t){return t.replace(hi,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Sr(t,n,a,o,f,h,v,A){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=""+Lt(n)):t.value!==""+Lt(n)&&(t.value=""+Lt(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Cr(t,v,Lt(n)):a!=null?Cr(t,v,Lt(a)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+Lt(A):t.removeAttribute("name")}function Il(t,n,a,o,f,h,v,A){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||a!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){tl(t);return}a=a!=null?""+Lt(a):"",n=n!=null?""+Lt(n):a,A||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=A?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),tl(t)}function Cr(t,n,a){n==="number"&&jn(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ei(t,n,a,o){if(t=t.options,n){n={};for(var f=0;f<a.length;f++)n["$"+a[f]]=!0;for(a=0;a<t.length;a++)f=n.hasOwnProperty("$"+t[a].value),t[a].selected!==f&&(t[a].selected=f),f&&o&&(t[a].defaultSelected=!0)}else{for(a=""+Lt(a),n=null,f=0;f<t.length;f++){if(t[f].value===a){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function ou(t,n,a){if(n!=null&&(n=""+Lt(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+Lt(a):""}function za(t,n,a,o){if(n==null){if(o!=null){if(a!=null)throw Error(r(92));if(ue(o)){if(1<o.length)throw Error(r(93));o=o[0]}a=o}a==null&&(a=""),n=a}a=Lt(n),t.defaultValue=a,o=t.textContent,o===a&&o!==""&&o!==null&&(t.value=o),tl(t)}function ti(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var Ss=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 Tr(t,n,a){var o=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,a):typeof a!="number"||a===0||Ss.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Cs(t,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,a!=null){for(var o in a)!a.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)&&a[f]!==o&&Tr(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&Tr(t,h,n[h])}function Ul(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ni=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Mi=/^[\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 Bl(t){return Mi.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function yn(){}var La=null;function Ia(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ql=null,Oi=null;function Ts(t){var n=Ni(t);if(n&&(t=n.stateNode)){var a=t[zt]||null;e:switch(t=n.stateNode,n.type){case"input":if(Sr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+It(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var o=a[n];if(o!==t&&o.form===t.form){var f=o[zt]||null;if(!f)throw Error(r(90));Sr(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<a.length;n++)o=a[n],o.form===t.form&&js(o)}break e;case"textarea":ou(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&ei(t,!!a.multiple,n,!1)}}}var Es=!1;function zi(t,n,a){if(Es)return t(n,a);Es=!0;try{var o=t(n);return o}finally{if(Es=!1,(ql!==null||Oi!==null)&&(tc(),ql&&(n=ql,t=Oi,Oi=ql=null,Ts(n),t)))for(n=0;n<t.length;n++)Ts(t[n])}}function Ua(t,n){var a=t.stateNode;if(a===null)return null;var o=a[zt]||null;if(o===null)return null;a=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(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hl=!1;if(ii)try{var $l={};Object.defineProperty($l,"passive",{get:function(){Hl=!0}}),window.addEventListener("test",$l,$l),window.removeEventListener("test",$l,$l)}catch{Hl=!1}var li=null,Li=null,nl=null;function As(){if(nl)return nl;var t,n=Li,a=n.length,o,f="value"in li?li.value:li.textContent,h=f.length;for(t=0;t<a&&n[t]===f[t];t++);var v=a-t;for(o=1;o<=v&&n[a-o]===f[h-o];o++);return nl=f.slice(t,1<o?1-o:void 0)}function Ii(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 Gl(){return!0}function Er(){return!1}function Zt(t){function n(a,o,f,h,v){this._reactName=a,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var A in t)t.hasOwnProperty(A)&&(a=t[A],this[A]=a?a(h):h[A]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Gl:Er,this.isPropagationStopped=Er,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),n}var Ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ba=Zt(Ui),Vl=x({},Ui,{view:0,detail:0}),Bi=Zt(Vl),Sn,Jt,qi,il=x({},Vl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ll,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!==qi&&(qi&&t.type==="mousemove"?(Sn=t.screenX-qi.screenX,Jt=t.screenY-qi.screenY):Jt=Sn=0,qi=t),Sn)},movementY:function(t){return"movementY"in t?t.movementY:Jt}}),Pl=Zt(il),Yl=x({},il,{dataTransfer:0}),Ar=Zt(Yl),Nr=x({},Vl,{relatedTarget:0}),qa=Zt(Nr),Ns=x({},Ui,{animationName:0,elapsedTime:0,pseudoElement:0}),Ne=Zt(Ns),uu=x({},Ui,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),mi=Zt(uu),en=x({},Ui,{data:0}),Dr=Zt(en),Ha={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lt={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"},Fl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _r(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Fl[t])?!!n[t]:!1}function ll(){return _r}var $a=x({},Vl,{key:function(t){if(t.key){var n=Ha[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ii(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?lt[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ll,charCode:function(t){return t.type==="keypress"?Ii(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ii(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Ds=Zt($a),Rr=x({},il,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cu=Zt(Rr),ld=x({},Vl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ll}),Ga=Zt(ld),du=x({},Ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),_s=Zt(du),Rs=x({},il,{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}),Ms=Zt(Rs),Os=x({},Ui,{newState:0,oldState:0}),Mr=Zt(Os),ad=[9,13,27,32],al=ii&&"CompositionEvent"in window,Va=null;ii&&"documentMode"in document&&(Va=document.documentMode);var rd=ii&&"TextEvent"in window&&!Va,fu=ii&&(!al||Va&&8<Va&&11>=Va),Or=" ",Hi=!1;function Wl(t,n){switch(t){case"keyup":return ad.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ve(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Kl=!1;function xn(t,n){switch(t){case"compositionend":return ve(n);case"keypress":return n.which!==32?null:(Hi=!0,Or);case"textInput":return t=n.data,t===Or&&Hi?null:t;default:return null}}function sd(t,n){if(Kl)return t==="compositionend"||!al&&Wl(t,n)?(t=As(),nl=Li=li=null,Kl=!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 fu&&n.locale!=="ko"?null:n.data;default:return null}}var od={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 Pa(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!od[t.type]:n==="textarea"}function pu(t,n,a,o){ql?Oi?Oi.push(o):Oi=[o]:ql=o,n=oc(n,"onChange"),0<n.length&&(a=new Ba("onChange","change",null,a,o),t.push({event:a,listeners:n}))}var Xl=null,rl=null;function ud(t){Ug(t,0)}function zr(t){var n=el(t);if(js(n))return t}function Ya(t,n){if(t==="change")return n}var Lr=!1;if(ii){var Fa;if(ii){var zs="oninput"in document;if(!zs){var Ir=document.createElement("div");Ir.setAttribute("oninput","return;"),zs=typeof Ir.oninput=="function"}Fa=zs}else Fa=!1;Lr=Fa&&(!document.documentMode||9<document.documentMode)}function hu(){Xl&&(Xl.detachEvent("onpropertychange",mu),rl=Xl=null)}function mu(t){if(t.propertyName==="value"&&zr(rl)){var n=[];pu(n,rl,t,Ia(t)),zi(ud,n)}}function Ls(t,n,a){t==="focusin"?(hu(),Xl=n,rl=a,Xl.attachEvent("onpropertychange",mu)):t==="focusout"&&hu()}function gu(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return zr(rl)}function cd(t,n){if(t==="click")return zr(n)}function dd(t,n){if(t==="input"||t==="change")return zr(n)}function yu(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var bn=typeof Object.is=="function"?Object.is:yu;function Wa(t,n){if(bn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var f=a[o];if(!gn.call(n,f)||!bn(t[f],n[f]))return!1}return!0}function xu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bu(t,n){var a=xu(t);t=0;for(var o;a;){if(a.nodeType===3){if(o=t+a.textContent.length,t<=n&&o>=n)return{node:a,offset:n-t};t=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=xu(a)}}function vu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?vu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function wu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=jn(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=jn(t.document)}return n}function Is(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 fd=ii&&"documentMode"in document&&11>=document.documentMode,Ql=null,Us=null,Ka=null,Bs=!1;function ku(t,n,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Bs||Ql==null||Ql!==jn(o)||(o=Ql,"selectionStart"in o&&Is(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}),Ka&&Wa(Ka,o)||(Ka=o,o=oc(Us,"onSelect"),0<o.length&&(n=new Ba("onSelect","select",null,n,a),t.push({event:n,listeners:o}),n.target=Ql)))}function sl(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var Zl={animationend:sl("Animation","AnimationEnd"),animationiteration:sl("Animation","AnimationIteration"),animationstart:sl("Animation","AnimationStart"),transitionrun:sl("Transition","TransitionRun"),transitionstart:sl("Transition","TransitionStart"),transitioncancel:sl("Transition","TransitionCancel"),transitionend:sl("Transition","TransitionEnd")},qs={},ju={};ii&&(ju=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function ol(t){if(qs[t])return qs[t];if(!Zl[t])return t;var n=Zl[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in ju)return qs[t]=n[a];return t}var Su=ol("animationend"),Hs=ol("animationiteration"),ai=ol("animationstart"),$s=ol("transitionrun"),Cu=ol("transitionstart"),Xa=ol("transitioncancel"),$i=ol("transitionend"),Tu=new Map,Gs="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(" ");Gs.push("scrollEnd");function Hn(t,n){Tu.set(t,n),un(n,[t])}var Ur=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)},Cn=[],Jl=0,Br=0;function Qa(){for(var t=Jl,n=Br=Jl=0;n<t;){var a=Cn[n];Cn[n++]=null;var o=Cn[n];Cn[n++]=null;var f=Cn[n];Cn[n++]=null;var h=Cn[n];if(Cn[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&&cl(a,f,h)}}function qr(t,n,a,o){Cn[Jl++]=t,Cn[Jl++]=n,Cn[Jl++]=a,Cn[Jl++]=o,Br|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Vs(t,n,a,o){return qr(t,n,a,o),dl(t)}function ul(t,n){return qr(t,null,null,n),dl(t)}function cl(t,n,a){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a);for(var f=!1,h=t.return;h!==null;)h.childLanes|=a,o=h.alternate,o!==null&&(o.childLanes|=a),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-rt(a),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=a|536870912),h):null}function dl(t){if(50<yo)throw yo=0,df=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var ea={};function pd(t,n,a,o){this.tag=t,this.key=a,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 cn(t,n,a,o){return new pd(t,n,a,o)}function Ps(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ri(t,n){var a=t.alternate;return a===null?(a=cn(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Eu(t,n){t.flags&=65011714;var a=t.alternate;return a===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=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Hr(t,n,a,o,f,h){var v=0;if(o=t,typeof t=="function")Ps(t)&&(v=1);else if(typeof t=="string")v=yk(t,a,Q.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ee:return t=cn(31,a,n,f),t.elementType=ee,t.lanes=h,t;case M:return fl(a.children,f,h,n);case I:v=8,f|=24;break;case N:return t=cn(12,a,n,f|2),t.elementType=N,t.lanes=h,t;case oe:return t=cn(13,a,n,f),t.elementType=oe,t.lanes=h,t;case _:return t=cn(19,a,n,f),t.elementType=_,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $:v=10;break e;case H:v=9;break e;case W:v=11;break e;case K:v=14;break e;case ae:v=16,o=null;break e}v=29,a=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=cn(v,a,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function fl(t,n,a,o){return t=cn(7,t,o,n),t.lanes=a,t}function Ys(t,n,a){return t=cn(6,t,null,n),t.lanes=a,t}function Au(t){var n=cn(18,null,null,0);return n.stateNode=t,n}function Fs(t,n,a){return n=cn(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Nu=new WeakMap;function Tn(t,n){if(typeof t=="object"&&t!==null){var a=Nu.get(t);return a!==void 0?a:(n={value:t,source:n,stack:Ot(n)},Nu.set(t,n),n)}return{value:t,source:n,stack:Ot(n)}}var ta=[],na=0,$r=null,Za=0,En=[],ln=0,Gi=null,An=1,si="";function gi(t,n){ta[na++]=Za,ta[na++]=$r,$r=t,Za=n}function Ja(t,n,a){En[ln++]=An,En[ln++]=si,En[ln++]=Gi,Gi=t;var o=An;t=si;var f=32-rt(o)-1;o&=~(1<<f),a+=1;var h=32-rt(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,An=1<<32-rt(n)+f|a<<f|o,si=h+t}else An=1<<h|a<<f|o,si=t}function yi(t){t.return!==null&&(gi(t,1),Ja(t,1,0))}function er(t){for(;t===$r;)$r=ta[--na],ta[na]=null,Za=ta[--na],ta[na]=null;for(;t===Gi;)Gi=En[--ln],En[ln]=null,si=En[--ln],En[ln]=null,An=En[--ln],En[ln]=null}function Ws(t,n){En[ln++]=An,En[ln++]=si,En[ln++]=Gi,An=n.id,si=n.overflow,Gi=t}var Nt=null,ct=null,Ge=!1,Vi=null,Nn=!1,Ks=Error(r(519));function Pi(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xi(Tn(n,t)),Ks}function Xs(t){var n=t.stateNode,a=t.type,o=t.memoizedProps;switch(n[Yt]=t,n[zt]=o,a){case"dialog":Fe("cancel",n),Fe("close",n);break;case"iframe":case"object":case"embed":Fe("load",n);break;case"video":case"audio":for(a=0;a<bo.length;a++)Fe(bo[a],n);break;case"source":Fe("error",n);break;case"img":case"image":case"link":Fe("error",n),Fe("load",n);break;case"details":Fe("toggle",n);break;case"input":Fe("invalid",n),Il(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Fe("invalid",n);break;case"textarea":Fe("invalid",n),za(n,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||o.suppressHydrationWarning===!0||$g(n.textContent,a)?(o.popover!=null&&(Fe("beforetoggle",n),Fe("toggle",n)),o.onScroll!=null&&Fe("scroll",n),o.onScrollEnd!=null&&Fe("scrollend",n),o.onClick!=null&&(n.onclick=yn),n=!0):n=!1,n||Pi(t,!0)}function ia(t){for(Nt=t.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:Nn=!1;return;case 27:case 3:Nn=!0;return;default:Nt=Nt.return}}function la(t){if(t!==Nt)return!1;if(!Ge)return ia(t),Ge=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Tf(t.type,t.memoizedProps)),a=!a),a&&ct&&Pi(t),ia(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=Qg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));ct=Qg(t)}else n===27?(n=ct,ba(t.type)?(t=_f,_f=null,ct=t):ct=n):ct=Nt?ci(t.stateNode.nextSibling):null;return!0}function $n(){ct=Nt=null,Ge=!1}function pl(){var t=Vi;return t!==null&&(zn===null?zn=t:zn.push.apply(zn,t),Vi=null),t}function xi(t){Vi===null?Vi=[t]:Vi.push(t)}var Qs=S(null),hl=null,bi=null;function et(t,n,a){T(Qs,n._currentValue),n._currentValue=a}function dn(t){t._currentValue=Qs.current,q(Qs)}function Dn(t,n,a){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===a)break;t=t.return}}function Zs(t,n,a,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 A=h;h=f;for(var L=0;L<n.length;L++)if(A.context===n[L]){h.lanes|=a,A=h.alternate,A!==null&&(A.lanes|=a),Dn(h.return,a,t),o||(v=null);break e}h=A.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=a,h=v.alternate,h!==null&&(h.lanes|=a),Dn(v,a,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 _n(t,n,a,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 A=f.type;bn(f.pendingProps.value,v.value)||(t!==null?t.push(A):t=[A])}}else if(f===xe.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(So):t=[So])}f=f.return}t!==null&&Zs(n,t,a,o),n.flags|=262144}function Gr(t){for(t=t.firstContext;t!==null;){if(!bn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ml(t){hl=t,bi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ft(t){return Du(hl,t)}function aa(t,n){return hl===null&&ml(t),Du(t,n)}function Du(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},bi===null){if(t===null)throw Error(r(308));bi=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else bi=bi.next=n;return a}var hd=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},md=e.unstable_scheduleCallback,_u=e.unstable_NormalPriority,wt={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vr(){return{controller:new hd,data:new Map,refCount:0}}function ra(t){t.refCount--,t.refCount===0&&md(_u,function(){t.controller.abort()})}var y=null,k=0,C=0,R=null;function U(t,n){if(y===null){var a=y=[];k=0,C=yf(),R={status:"pending",value:void 0,then:function(o){a.push(o)}}}return k++,n.then(J,J),n}function J(){if(--k===0&&y!==null){R!==null&&(R.status="fulfilled");var t=y;y=null,C=0,R=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function be(t,n){var a=[],o={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<a.length;f++)(0,a[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),o}var He=V.S;V.S=function(t,n){fg=At(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&U(t,n),He!==null&&He(t,n)};var Te=S(null);function we(){var t=Te.current;return t!==null?t:ht.pooledCache}function Ut(t,n){n===null?T(Te,Te.current):T(Te,n.pool)}function kt(){var t=we();return t===null?null:{parent:wt._currentValue,pool:t}}var vi=Error(r(460)),fn=Error(r(474)),oi=Error(r(542)),Yi={then:function(){}};function Pr(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Rh(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(yn,yn),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Oh(t),t;default:if(typeof n.status=="string")n.then(yn,yn);else{if(t=ht,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Oh(t),t}throw nr=n,vi}}function tr(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(nr=a,vi):a}}var nr=null;function Mh(){if(nr===null)throw Error(r(459));var t=nr;return nr=null,t}function Oh(t){if(t===vi||t===oi)throw Error(r(483))}var Yr=null,Js=0;function Ru(t){var n=Js;return Js+=1,Yr===null&&(Yr=[]),Rh(Yr,t,n)}function eo(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Mu(t,n){throw n.$$typeof===j?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function zh(t){function n(G,B){if(t){var P=G.deletions;P===null?(G.deletions=[B],G.flags|=16):P.push(B)}}function a(G,B){if(!t)return null;for(;B!==null;)n(G,B),B=B.sibling;return null}function o(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function f(G,B){return G=ri(G,B),G.index=0,G.sibling=null,G}function h(G,B,P){return G.index=P,t?(P=G.alternate,P!==null?(P=P.index,P<B?(G.flags|=67108866,B):P):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function A(G,B,P,le){return B===null||B.tag!==6?(B=Ys(P,G.mode,le),B.return=G,B):(B=f(B,P),B.return=G,B)}function L(G,B,P,le){var _e=P.type;return _e===M?ne(G,B,P.props.children,le,P.key):B!==null&&(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&tr(_e)===B.type)?(B=f(B,P.props),eo(B,P),B.return=G,B):(B=Hr(P.type,P.key,P.props,null,G.mode,le),eo(B,P),B.return=G,B)}function Y(G,B,P,le){return B===null||B.tag!==4||B.stateNode.containerInfo!==P.containerInfo||B.stateNode.implementation!==P.implementation?(B=Fs(P,G.mode,le),B.return=G,B):(B=f(B,P.children||[]),B.return=G,B)}function ne(G,B,P,le,_e){return B===null||B.tag!==7?(B=fl(P,G.mode,le,_e),B.return=G,B):(B=f(B,P),B.return=G,B)}function re(G,B,P){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Ys(""+B,G.mode,P),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case w:return P=Hr(B.type,B.key,B.props,null,G.mode,P),eo(P,B),P.return=G,P;case E:return B=Fs(B,G.mode,P),B.return=G,B;case ae:return B=tr(B),re(G,B,P)}if(ue(B)||de(B))return B=fl(B,G.mode,P,null),B.return=G,B;if(typeof B.then=="function")return re(G,Ru(B),P);if(B.$$typeof===$)return re(G,aa(G,B),P);Mu(G,B)}return null}function F(G,B,P,le){var _e=B!==null?B.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return _e!==null?null:A(G,B,""+P,le);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return P.key===_e?L(G,B,P,le):null;case E:return P.key===_e?Y(G,B,P,le):null;case ae:return P=tr(P),F(G,B,P,le)}if(ue(P)||de(P))return _e!==null?null:ne(G,B,P,le,null);if(typeof P.then=="function")return F(G,B,Ru(P),le);if(P.$$typeof===$)return F(G,B,aa(G,P),le);Mu(G,P)}return null}function Z(G,B,P,le,_e){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return G=G.get(P)||null,A(B,G,""+le,_e);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case w:return G=G.get(le.key===null?P:le.key)||null,L(B,G,le,_e);case E:return G=G.get(le.key===null?P:le.key)||null,Y(B,G,le,_e);case ae:return le=tr(le),Z(G,B,P,le,_e)}if(ue(le)||de(le))return G=G.get(P)||null,ne(B,G,le,_e,null);if(typeof le.then=="function")return Z(G,B,P,Ru(le),_e);if(le.$$typeof===$)return Z(G,B,P,aa(B,le),_e);Mu(B,le)}return null}function ke(G,B,P,le){for(var _e=null,nt=null,Ee=B,$e=B=0,Ze=null;Ee!==null&&$e<P.length;$e++){Ee.index>$e?(Ze=Ee,Ee=null):Ze=Ee.sibling;var it=F(G,Ee,P[$e],le);if(it===null){Ee===null&&(Ee=Ze);break}t&&Ee&&it.alternate===null&&n(G,Ee),B=h(it,B,$e),nt===null?_e=it:nt.sibling=it,nt=it,Ee=Ze}if($e===P.length)return a(G,Ee),Ge&&gi(G,$e),_e;if(Ee===null){for(;$e<P.length;$e++)Ee=re(G,P[$e],le),Ee!==null&&(B=h(Ee,B,$e),nt===null?_e=Ee:nt.sibling=Ee,nt=Ee);return Ge&&gi(G,$e),_e}for(Ee=o(Ee);$e<P.length;$e++)Ze=Z(Ee,G,$e,P[$e],le),Ze!==null&&(t&&Ze.alternate!==null&&Ee.delete(Ze.key===null?$e:Ze.key),B=h(Ze,B,$e),nt===null?_e=Ze:nt.sibling=Ze,nt=Ze);return t&&Ee.forEach(function(Sa){return n(G,Sa)}),Ge&&gi(G,$e),_e}function Me(G,B,P,le){if(P==null)throw Error(r(151));for(var _e=null,nt=null,Ee=B,$e=B=0,Ze=null,it=P.next();Ee!==null&&!it.done;$e++,it=P.next()){Ee.index>$e?(Ze=Ee,Ee=null):Ze=Ee.sibling;var Sa=F(G,Ee,it.value,le);if(Sa===null){Ee===null&&(Ee=Ze);break}t&&Ee&&Sa.alternate===null&&n(G,Ee),B=h(Sa,B,$e),nt===null?_e=Sa:nt.sibling=Sa,nt=Sa,Ee=Ze}if(it.done)return a(G,Ee),Ge&&gi(G,$e),_e;if(Ee===null){for(;!it.done;$e++,it=P.next())it=re(G,it.value,le),it!==null&&(B=h(it,B,$e),nt===null?_e=it:nt.sibling=it,nt=it);return Ge&&gi(G,$e),_e}for(Ee=o(Ee);!it.done;$e++,it=P.next())it=Z(Ee,G,$e,it.value,le),it!==null&&(t&&it.alternate!==null&&Ee.delete(it.key===null?$e:it.key),B=h(it,B,$e),nt===null?_e=it:nt.sibling=it,nt=it);return t&&Ee.forEach(function(Ak){return n(G,Ak)}),Ge&&gi(G,$e),_e}function pt(G,B,P,le){if(typeof P=="object"&&P!==null&&P.type===M&&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===M){if(B.tag===7){a(G,B.sibling),le=f(B,P.props.children),le.return=G,G=le;break e}}else if(B.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ae&&tr(_e)===B.type){a(G,B.sibling),le=f(B,P.props),eo(le,P),le.return=G,G=le;break e}a(G,B);break}else n(G,B);B=B.sibling}P.type===M?(le=fl(P.props.children,G.mode,le,P.key),le.return=G,G=le):(le=Hr(P.type,P.key,P.props,null,G.mode,le),eo(le,P),le.return=G,G=le)}return v(G);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){a(G,B.sibling),le=f(B,P.children||[]),le.return=G,G=le;break e}else{a(G,B);break}else n(G,B);B=B.sibling}le=Fs(P,G.mode,le),le.return=G,G=le}return v(G);case ae:return P=tr(P),pt(G,B,P,le)}if(ue(P))return ke(G,B,P,le);if(de(P)){if(_e=de(P),typeof _e!="function")throw Error(r(150));return P=_e.call(P),Me(G,B,P,le)}if(typeof P.then=="function")return pt(G,B,Ru(P),le);if(P.$$typeof===$)return pt(G,B,aa(G,P),le);Mu(G,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,B!==null&&B.tag===6?(a(G,B.sibling),le=f(B,P),le.return=G,G=le):(a(G,B),le=Ys(P,G.mode,le),le.return=G,G=le),v(G)):a(G,B)}return function(G,B,P,le){try{Js=0;var _e=pt(G,B,P,le);return Yr=null,_e}catch(Ee){if(Ee===vi||Ee===oi)throw Ee;var nt=cn(29,Ee,null,G.mode);return nt.lanes=le,nt.return=G,nt}finally{}}}var ir=zh(!0),Lh=zh(!1),sa=!1;function gd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yd(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 oa(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ua(t,n,a){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(at&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=dl(t),cl(t,null,a),n}return qr(t,o,n,a),dl(t)}function to(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Ml(t,a)}}function xd(t,n){var a=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var f=null,h=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,a=a.next}while(a!==null);h===null?f=h=n:h=h.next=n}else f=h=n;a={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var bd=!1;function no(){if(bd){var t=R;if(t!==null)throw t}}function io(t,n,a,o){bd=!1;var f=t.updateQueue;sa=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,A=f.shared.pending;if(A!==null){f.shared.pending=null;var L=A,Y=L.next;L.next=null,v===null?h=Y:v.next=Y,v=L;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,A=ne.lastBaseUpdate,A!==v&&(A===null?ne.firstBaseUpdate=Y:A.next=Y,ne.lastBaseUpdate=L))}if(h!==null){var re=f.baseState;v=0,ne=Y=L=null,A=h;do{var F=A.lane&-536870913,Z=F!==A.lane;if(Z?(Qe&F)===F:(o&F)===F){F!==0&&F===C&&(bd=!0),ne!==null&&(ne=ne.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var ke=t,Me=A;F=n;var pt=a;switch(Me.tag){case 1:if(ke=Me.payload,typeof ke=="function"){re=ke.call(pt,re,F);break e}re=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Me.payload,F=typeof ke=="function"?ke.call(pt,re,F):ke,F==null)break e;re=x({},re,F);break e;case 2:sa=!0}}F=A.callback,F!==null&&(t.flags|=64,Z&&(t.flags|=8192),Z=f.callbacks,Z===null?f.callbacks=[F]:Z.push(F))}else Z={lane:F,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ne===null?(Y=ne=Z,L=re):ne=ne.next=Z,v|=F;if(A=A.next,A===null){if(A=f.shared.pending,A===null)break;Z=A,A=Z.next,Z.next=null,f.lastBaseUpdate=Z,f.shared.pending=null}}while(!0);ne===null&&(L=re),f.baseState=L,f.firstBaseUpdate=Y,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),ha|=v,t.lanes=v,t.memoizedState=re}}function Ih(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function Uh(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Ih(a[t],n)}var Fr=S(null),Ou=S(0);function Bh(t,n){t=Sl,T(Ou,t),T(Fr,n),Sl=t|n.baseLanes}function vd(){T(Ou,Sl),T(Fr,Fr.current)}function wd(){Sl=Ou.current,q(Fr),q(Ou)}var Gn=S(null),ui=null;function ca(t){var n=t.alternate;T(Dt,Dt.current&1),T(Gn,t),ui===null&&(n===null||Fr.current!==null||n.memoizedState!==null)&&(ui=t)}function kd(t){T(Dt,Dt.current),T(Gn,t),ui===null&&(ui=t)}function qh(t){t.tag===22?(T(Dt,Dt.current),T(Gn,t),ui===null&&(ui=t)):da()}function da(){T(Dt,Dt.current),T(Gn,Gn.current)}function Vn(t){q(Gn),ui===t&&(ui=null),q(Dt)}var Dt=S(0);function zu(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Nf(a)||Df(a)))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 gl=0,Be=null,dt=null,Bt=null,Lu=!1,Wr=!1,lr=!1,Iu=0,lo=0,Kr=null,xw=0;function Tt(){throw Error(r(321))}function jd(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!bn(t[a],n[a]))return!1;return!0}function Sd(t,n,a,o,f,h){return gl=h,Be=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?jm:Bd,lr=!1,h=a(o,f),lr=!1,Wr&&(h=$h(n,a,o,f)),Hh(t),h}function Hh(t){V.H=so;var n=dt!==null&&dt.next!==null;if(gl=0,Bt=dt=Be=null,Lu=!1,lo=0,Kr=null,n)throw Error(r(300));t===null||qt||(t=t.dependencies,t!==null&&Gr(t)&&(qt=!0))}function $h(t,n,a,o){Be=t;var f=0;do{if(Wr&&(Kr=null),lo=0,Wr=!1,25<=f)throw Error(r(301));if(f+=1,Bt=dt=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=Sm,h=n(a,o)}while(Wr);return h}function bw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?ao(n):n,t=t.useState()[0],(dt!==null?dt.memoizedState:null)!==t&&(Be.flags|=1024),n}function Cd(){var t=Iu!==0;return Iu=0,t}function Td(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function Ed(t){if(Lu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Lu=!1}gl=0,Bt=dt=Be=null,Wr=!1,lo=Iu=0,Kr=null}function vn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?Be.memoizedState=Bt=t:Bt=Bt.next=t,Bt}function _t(){if(dt===null){var t=Be.alternate;t=t!==null?t.memoizedState:null}else t=dt.next;var n=Bt===null?Be.memoizedState:Bt.next;if(n!==null)Bt=n,dt=t;else{if(t===null)throw Be.alternate===null?Error(r(467)):Error(r(310));dt=t,t={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?Be.memoizedState=Bt=t:Bt=Bt.next=t}return Bt}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ao(t){var n=lo;return lo+=1,Kr===null&&(Kr=[]),t=Rh(Kr,t,n),n=Be,(Bt===null?n.memoizedState:Bt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?jm:Bd),t}function Bu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return ao(t);if(t.$$typeof===$)return Ft(t)}throw Error(r(438,String(t)))}function Ad(t){var n=null,a=Be.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var o=Be.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}),a===null&&(a=Uu(),Be.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),o=0;o<t;o++)a[o]=z;return n.index++,a}function yl(t,n){return typeof n=="function"?n(t):n}function qu(t){var n=_t();return Nd(n,dt,t)}function Nd(t,n,a){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=a;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 A=v=null,L=null,Y=n,ne=!1;do{var re=Y.lane&-536870913;if(re!==Y.lane?(Qe&re)===re:(gl&re)===re){var F=Y.revertLane;if(F===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),re===C&&(ne=!0);else if((gl&F)===F){Y=Y.next,F===C&&(ne=!0);continue}else re={lane:0,revertLane:Y.revertLane,gesture:null,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(A=L=re,v=h):L=L.next=re,Be.lanes|=F,ha|=F;re=Y.action,lr&&a(h,re),h=Y.hasEagerState?Y.eagerState:a(h,re)}else F={lane:re,revertLane:Y.revertLane,gesture:Y.gesture,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null},L===null?(A=L=F,v=h):L=L.next=F,Be.lanes|=re,ha|=re;Y=Y.next}while(Y!==null&&Y!==n);if(L===null?v=h:L.next=A,!bn(h,t.memoizedState)&&(qt=!0,ne&&(a=R,a!==null)))throw a;t.memoizedState=h,t.baseState=v,t.baseQueue=L,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Dd(t){var n=_t(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=t;var o=a.dispatch,f=a.pending,h=n.memoizedState;if(f!==null){a.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);bn(h,n.memoizedState)||(qt=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),a.lastRenderedState=h}return[h,o]}function Gh(t,n,a){var o=Be,f=_t(),h=Ge;if(h){if(a===void 0)throw Error(r(407));a=a()}else a=n();var v=!bn((dt||f).memoizedState,a);if(v&&(f.memoizedState=a,qt=!0),f=f.queue,Md(Yh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||Bt!==null&&Bt.memoizedState.tag&1){if(o.flags|=2048,Xr(9,{destroy:void 0},Ph.bind(null,o,f,a,n),null),ht===null)throw Error(r(349));h||(gl&127)!==0||Vh(o,n,a)}return a}function Vh(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=Be.updateQueue,n===null?(n=Uu(),Be.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function Ph(t,n,a,o){n.value=a,n.getSnapshot=o,Fh(n)&&Wh(t)}function Yh(t,n,a){return a(function(){Fh(n)&&Wh(t)})}function Fh(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!bn(t,a)}catch{return!0}}function Wh(t){var n=ul(t,2);n!==null&&Ln(n,t,2)}function _d(t){var n=vn();if(typeof t=="function"){var a=t;if(t=a(),lr){ut(!0);try{a()}finally{ut(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:t},n}function Kh(t,n,a,o){return t.baseState=a,Nd(t,dt,typeof o=="function"?o:yl)}function vw(t,n,a,o,f){if(Gu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?a(!0):h.isTransition=!1,o(h),a=n.pending,a===null?(h.next=n.pending=h,Xh(n,h)):(h.next=a.next,n.pending=a.next=h)}}function Xh(t,n){var a=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var A=a(f,o),L=V.S;L!==null&&L(v,A),Qh(t,n,A)}catch(Y){Rd(t,n,Y)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=a(f,o),Qh(t,n,h)}catch(Y){Rd(t,n,Y)}}function Qh(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){Zh(t,n,o)},function(o){return Rd(t,n,o)}):Zh(t,n,a)}function Zh(t,n,a){n.status="fulfilled",n.value=a,Jh(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,Xh(t,a)))}function Rd(t,n,a){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=a,Jh(n),n=n.next;while(n!==o)}t.action=null}function Jh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function em(t,n){return n}function tm(t,n){if(Ge){var a=ht.formState;if(a!==null){e:{var o=Be;if(Ge){if(ct){t:{for(var f=ct,h=Nn;f.nodeType!==8;){if(!h){f=null;break t}if(f=ci(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){ct=ci(f.nextSibling),o=f.data==="F!";break e}}Pi(o)}o=!1}o&&(n=a[0])}}return a=vn(),a.memoizedState=a.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:em,lastRenderedState:n},a.queue=o,a=vm.bind(null,Be,o),o.dispatch=a,o=_d(!1),h=Ud.bind(null,Be,!1,o.queue),o=vn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,a=vw.bind(null,Be,f,h,a),f.dispatch=a,o.memoizedState=t,[n,a,!1]}function nm(t){var n=_t();return im(n,dt,t)}function im(t,n,a){if(n=Nd(t,n,em)[0],t=qu(yl)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=ao(n)}catch(v){throw v===vi?oi:v}else o=n;n=_t();var f=n.queue,h=f.dispatch;return a!==n.memoizedState&&(Be.flags|=2048,Xr(9,{destroy:void 0},ww.bind(null,f,a),null)),[o,h,t]}function ww(t,n){t.action=n}function lm(t){var n=_t(),a=dt;if(a!==null)return im(n,a,t);_t(),n=n.memoizedState,a=_t();var o=a.queue.dispatch;return a.memoizedState=t,[n,o,!1]}function Xr(t,n,a,o){return t={tag:t,create:a,deps:o,inst:n,next:null},n=Be.updateQueue,n===null&&(n=Uu(),Be.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(o=a.next,a.next=t,t.next=o,n.lastEffect=t),t}function am(){return _t().memoizedState}function Hu(t,n,a,o){var f=vn();Be.flags|=t,f.memoizedState=Xr(1|n,{destroy:void 0},a,o===void 0?null:o)}function $u(t,n,a,o){var f=_t();o=o===void 0?null:o;var h=f.memoizedState.inst;dt!==null&&o!==null&&jd(o,dt.memoizedState.deps)?f.memoizedState=Xr(n,h,a,o):(Be.flags|=t,f.memoizedState=Xr(1|n,h,a,o))}function rm(t,n){Hu(8390656,8,t,n)}function Md(t,n){$u(2048,8,t,n)}function kw(t){Be.flags|=4;var n=Be.updateQueue;if(n===null)n=Uu(),Be.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function sm(t){var n=_t().memoizedState;return kw({ref:n,nextImpl:t}),function(){if((at&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function om(t,n){return $u(4,2,t,n)}function um(t,n){return $u(4,4,t,n)}function cm(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function dm(t,n,a){a=a!=null?a.concat([t]):null,$u(4,4,cm.bind(null,n,t),a)}function Od(){}function fm(t,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;return n!==null&&jd(n,o[1])?o[0]:(a.memoizedState=[t,n],t)}function pm(t,n){var a=_t();n=n===void 0?null:n;var o=a.memoizedState;if(n!==null&&jd(n,o[1]))return o[0];if(o=t(),lr){ut(!0);try{t()}finally{ut(!1)}}return a.memoizedState=[o,n],o}function zd(t,n,a){return a===void 0||(gl&1073741824)!==0&&(Qe&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=hg(),Be.lanes|=t,ha|=t,a)}function hm(t,n,a,o){return bn(a,n)?a:Fr.current!==null?(t=zd(t,a,o),bn(t,n)||(qt=!0),t):(gl&42)===0||(gl&1073741824)!==0&&(Qe&261930)===0?(qt=!0,t.memoizedState=a):(t=hg(),Be.lanes|=t,ha|=t,n)}function mm(t,n,a,o,f){var h=se.p;se.p=h!==0&&8>h?h:8;var v=V.T,A={};V.T=A,Ud(t,!1,n,a);try{var L=f(),Y=V.S;if(Y!==null&&Y(A,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ne=be(L,o);ro(t,n,ne,Fn(t))}else ro(t,n,o,Fn(t))}catch(re){ro(t,n,{then:function(){},status:"rejected",reason:re},Fn())}finally{se.p=h,v!==null&&A.types!==null&&(v.types=A.types),V.T=v}}function jw(){}function Ld(t,n,a,o){if(t.tag!==5)throw Error(r(476));var f=gm(t).queue;mm(t,f,n,ye,a===null?jw:function(){return ym(t),a(o)})}function gm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:ye},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:yl,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ym(t){var n=gm(t);n.next===null&&(n=t.alternate.memoizedState),ro(t,n.next.queue,{},Fn())}function Id(){return Ft(So)}function xm(){return _t().memoizedState}function bm(){return _t().memoizedState}function Sw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Fn();t=oa(a);var o=ua(n,t,a);o!==null&&(Ln(o,n,a),to(o,n,a)),n={cache:Vr()},t.payload=n;return}n=n.return}}function Cw(t,n,a){var o=Fn();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Gu(t)?wm(n,a):(a=Vs(t,n,a,o),a!==null&&(Ln(a,t,o),km(a,n,o)))}function vm(t,n,a){var o=Fn();ro(t,n,a,o)}function ro(t,n,a,o){var f={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Gu(t))wm(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,A=h(v,a);if(f.hasEagerState=!0,f.eagerState=A,bn(A,v))return qr(t,n,f,0),ht===null&&Qa(),!1}catch{}finally{}if(a=Vs(t,n,f,o),a!==null)return Ln(a,t,o),km(a,n,o),!0}return!1}function Ud(t,n,a,o){if(o={lane:2,revertLane:yf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Gu(t)){if(n)throw Error(r(479))}else n=Vs(t,a,o,2),n!==null&&Ln(n,t,2)}function Gu(t){var n=t.alternate;return t===Be||n!==null&&n===Be}function wm(t,n){Wr=Lu=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function km(t,n,a){if((a&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,a|=o,n.lanes=a,Ml(t,a)}}var so={readContext:Ft,use:Bu,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};so.useEffectEvent=Tt;var jm={readContext:Ft,use:Bu,useCallback:function(t,n){return vn().memoizedState=[t,n===void 0?null:n],t},useContext:Ft,useEffect:rm,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Hu(4194308,4,cm.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Hu(4194308,4,t,n)},useInsertionEffect:function(t,n){Hu(4,2,t,n)},useMemo:function(t,n){var a=vn();n=n===void 0?null:n;var o=t();if(lr){ut(!0);try{t()}finally{ut(!1)}}return a.memoizedState=[o,n],o},useReducer:function(t,n,a){var o=vn();if(a!==void 0){var f=a(n);if(lr){ut(!0);try{a(n)}finally{ut(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=Cw.bind(null,Be,t),[o.memoizedState,t]},useRef:function(t){var n=vn();return t={current:t},n.memoizedState=t},useState:function(t){t=_d(t);var n=t.queue,a=vm.bind(null,Be,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:Od,useDeferredValue:function(t,n){var a=vn();return zd(a,t,n)},useTransition:function(){var t=_d(!1);return t=mm.bind(null,Be,t.queue,!0,!1),vn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var o=Be,f=vn();if(Ge){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),ht===null)throw Error(r(349));(Qe&127)!==0||Vh(o,n,a)}f.memoizedState=a;var h={value:a,getSnapshot:n};return f.queue=h,rm(Yh.bind(null,o,h,t),[t]),o.flags|=2048,Xr(9,{destroy:void 0},Ph.bind(null,o,h,a,n),null),a},useId:function(){var t=vn(),n=ht.identifierPrefix;if(Ge){var a=si,o=An;a=(o&~(1<<32-rt(o)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Iu++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=xw++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Id,useFormState:tm,useActionState:tm,useOptimistic:function(t){var n=vn();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Ud.bind(null,Be,!0,a),a.dispatch=n,[t,n]},useMemoCache:Ad,useCacheRefresh:function(){return vn().memoizedState=Sw.bind(null,Be)},useEffectEvent:function(t){var n=vn(),a={impl:t};return n.memoizedState=a,function(){if((at&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Bd={readContext:Ft,use:Bu,useCallback:fm,useContext:Ft,useEffect:Md,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:qu,useRef:am,useState:function(){return qu(yl)},useDebugValue:Od,useDeferredValue:function(t,n){var a=_t();return hm(a,dt.memoizedState,t,n)},useTransition:function(){var t=qu(yl)[0],n=_t().memoizedState;return[typeof t=="boolean"?t:ao(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Id,useFormState:nm,useActionState:nm,useOptimistic:function(t,n){var a=_t();return Kh(a,dt,t,n)},useMemoCache:Ad,useCacheRefresh:bm};Bd.useEffectEvent=sm;var Sm={readContext:Ft,use:Bu,useCallback:fm,useContext:Ft,useEffect:Md,useImperativeHandle:dm,useInsertionEffect:om,useLayoutEffect:um,useMemo:pm,useReducer:Dd,useRef:am,useState:function(){return Dd(yl)},useDebugValue:Od,useDeferredValue:function(t,n){var a=_t();return dt===null?zd(a,t,n):hm(a,dt.memoizedState,t,n)},useTransition:function(){var t=Dd(yl)[0],n=_t().memoizedState;return[typeof t=="boolean"?t:ao(t),n]},useSyncExternalStore:Gh,useId:xm,useHostTransitionStatus:Id,useFormState:lm,useActionState:lm,useOptimistic:function(t,n){var a=_t();return dt!==null?Kh(a,dt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ad,useCacheRefresh:bm};Sm.useEffectEvent=sm;function qd(t,n,a,o){n=t.memoizedState,a=a(o,n),a=a==null?n:x({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Hd={enqueueSetState:function(t,n,a){t=t._reactInternals;var o=Fn(),f=oa(o);f.payload=n,a!=null&&(f.callback=a),n=ua(t,f,o),n!==null&&(Ln(n,t,o),to(n,t,o))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var o=Fn(),f=oa(o);f.tag=1,f.payload=n,a!=null&&(f.callback=a),n=ua(t,f,o),n!==null&&(Ln(n,t,o),to(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=Fn(),o=oa(a);o.tag=2,n!=null&&(o.callback=n),n=ua(t,o,a),n!==null&&(Ln(n,t,a),to(n,t,a))}};function Cm(t,n,a,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!Wa(a,o)||!Wa(f,h):!0}function Tm(t,n,a,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,o),n.state!==t&&Hd.enqueueReplaceState(n,n.state,null)}function ar(t,n){var a=n;if("ref"in n){a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}if(t=t.defaultProps){a===n&&(a=x({},a));for(var f in t)a[f]===void 0&&(a[f]=t[f])}return a}function Em(t){Ur(t)}function Am(t){console.error(t)}function Nm(t){Ur(t)}function Vu(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Dm(t,n,a){try{var o=t.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function $d(t,n,a){return a=oa(a),a.tag=3,a.payload={element:null},a.callback=function(){Vu(t,n)},a}function _m(t){return t=oa(t),t.tag=3,t}function Rm(t,n,a,o){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Dm(n,a,o)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Dm(n,a,o),typeof f!="function"&&(ma===null?ma=new Set([this]):ma.add(this));var A=o.stack;this.componentDidCatch(o.value,{componentStack:A!==null?A:""})})}function Tw(t,n,a,o,f){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=a.alternate,n!==null&&_n(n,a,f,!0),a=Gn.current,a!==null){switch(a.tag){case 31:case 13:return ui===null?nc():a.alternate===null&&Et===0&&(Et=3),a.flags&=-257,a.flags|=65536,a.lanes=f,o===Yi?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([o]):n.add(o),hf(t,o,f)),!1;case 22:return a.flags|=65536,o===Yi?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([o]):a.add(o)),hf(t,o,f)),!1}throw Error(r(435,a.tag))}return hf(t,o,f),nc(),!1}if(Ge)return n=Gn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Ks&&(t=Error(r(422),{cause:o}),xi(Tn(t,a)))):(o!==Ks&&(n=Error(r(423),{cause:o}),xi(Tn(n,a))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Tn(o,a),f=$d(t.stateNode,o,f),xd(t,f),Et!==4&&(Et=2)),!1;var h=Error(r(520),{cause:o});if(h=Tn(h,a),go===null?go=[h]:go.push(h),Et!==4&&(Et=2),n===null)return!0;o=Tn(o,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=f&-f,a.lanes|=t,t=$d(a.stateNode,o,t),xd(a,t),!1;case 1:if(n=a.type,h=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(ma===null||!ma.has(h))))return a.flags|=65536,f&=-f,a.lanes|=f,f=_m(f),Rm(f,t,a,o),xd(a,f),!1}a=a.return}while(a!==null);return!1}var Gd=Error(r(461)),qt=!1;function an(t,n,a,o){n.child=t===null?Lh(n,null,a,o):ir(n,t.child,a,o)}function Mm(t,n,a,o,f){a=a.render;var h=n.ref;if("ref"in o){var v={};for(var A in o)A!=="ref"&&(v[A]=o[A])}else v=o;return ml(n),o=Sd(t,n,a,v,h,f),A=Cd(),t!==null&&!qt?(Td(t,n,f),xl(t,n,f)):(Ge&&A&&yi(n),n.flags|=1,an(t,n,o,f),n.child)}function Om(t,n,a,o,f){if(t===null){var h=a.type;return typeof h=="function"&&!Ps(h)&&h.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=h,zm(t,n,h,o,f)):(t=Hr(a.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!Qd(t,f)){var v=h.memoizedProps;if(a=a.compare,a=a!==null?a:Wa,a(v,o)&&t.ref===n.ref)return xl(t,n,f)}return n.flags|=1,t=ri(h,o),t.ref=n.ref,t.return=n,n.child=t}function zm(t,n,a,o,f){if(t!==null){var h=t.memoizedProps;if(Wa(h,o)&&t.ref===n.ref)if(qt=!1,n.pendingProps=o=h,Qd(t,f))(t.flags&131072)!==0&&(qt=!0);else return n.lanes=t.lanes,xl(t,n,f)}return Vd(t,n,a,o,f)}function Lm(t,n,a,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|a:a,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 Im(t,n,h,a,o)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ut(n,h!==null?h.cachePool:null),h!==null?Bh(n,h):vd(),qh(n);else return o=n.lanes=536870912,Im(t,n,h!==null?h.baseLanes|a:a,a,o)}else h!==null?(Ut(n,h.cachePool),Bh(n,h),da(),n.memoizedState=null):(t!==null&&Ut(n,null),vd(),da());return an(t,n,f,a),n.child}function oo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Im(t,n,a,o,f){var h=we();return h=h===null?null:{parent:wt._currentValue,pool:h},n.memoizedState={baseLanes:a,cachePool:h},t!==null&&Ut(n,null),vd(),qh(n),t!==null&&_n(t,n,o,!0),n.childLanes=f,null}function Pu(t,n){return n=Fu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function Um(t,n,a){return ir(n,t.child,null,a),t=Pu(n,n.pendingProps),t.flags|=2,Vn(n),n.memoizedState=null,t}function Ew(t,n,a){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ge){if(o.mode==="hidden")return t=Pu(n,o),n.lanes=536870912,oo(null,t);if(kd(n),(t=ct)?(t=Xg(t,Nn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Gi!==null?{id:An,overflow:si}:null,retryLane:536870912,hydrationErrors:null},a=Au(t),a.return=n,n.child=a,Nt=n,ct=null)):t=null,t===null)throw Pi(n);return n.lanes=536870912,null}return Pu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(kd(n),f)if(n.flags&256)n.flags&=-257,n=Um(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(qt||_n(t,n,a,!1),f=(a&t.childLanes)!==0,qt||f){if(o=ht,o!==null&&(v=tu(o,a),v!==0&&v!==h.retryLane))throw h.retryLane=v,ul(t,v),Ln(o,t,v),Gd;nc(),n=Um(t,n,a)}else t=h.treeContext,ct=ci(v.nextSibling),Nt=n,Ge=!0,Vi=null,Nn=!1,t!==null&&Ws(n,t),n=Pu(n,o),n.flags|=4096;return n}return t=ri(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Yu(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Vd(t,n,a,o,f){return ml(n),a=Sd(t,n,a,o,void 0,f),o=Cd(),t!==null&&!qt?(Td(t,n,f),xl(t,n,f)):(Ge&&o&&yi(n),n.flags|=1,an(t,n,a,f),n.child)}function Bm(t,n,a,o,f,h){return ml(n),n.updateQueue=null,a=$h(n,o,a,f),Hh(t),o=Cd(),t!==null&&!qt?(Td(t,n,h),xl(t,n,h)):(Ge&&o&&yi(n),n.flags|=1,an(t,n,a,h),n.child)}function qm(t,n,a,o,f){if(ml(n),n.stateNode===null){var h=ea,v=a.contextType;typeof v=="object"&&v!==null&&(h=Ft(v)),h=new a(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Hd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},gd(n),v=a.contextType,h.context=typeof v=="object"&&v!==null?Ft(v):ea,h.state=n.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(qd(n,a,v,o),h.state=n.memoizedState),typeof a.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&&Hd.enqueueReplaceState(h,h.state,null),io(n,o,h,f),no(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var A=n.memoizedProps,L=ar(a,A);h.props=L;var Y=h.context,ne=a.contextType;v=ea,typeof ne=="object"&&ne!==null&&(v=Ft(ne));var re=a.getDerivedStateFromProps;ne=typeof re=="function"||typeof h.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(A||Y!==v)&&Tm(n,h,o,v),sa=!1;var F=n.memoizedState;h.state=F,io(n,o,h,f),no(),Y=n.memoizedState,A||F!==Y||sa?(typeof re=="function"&&(qd(n,a,re,o),Y=n.memoizedState),(L=sa||Cm(n,a,L,o,F,Y,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=Y),h.props=o,h.state=Y,h.context=v,o=L):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,yd(t,n),v=n.memoizedProps,ne=ar(a,v),h.props=ne,re=n.pendingProps,F=h.context,Y=a.contextType,L=ea,typeof Y=="object"&&Y!==null&&(L=Ft(Y)),A=a.getDerivedStateFromProps,(Y=typeof A=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==re||F!==L)&&Tm(n,h,o,L),sa=!1,F=n.memoizedState,h.state=F,io(n,o,h,f),no();var Z=n.memoizedState;v!==re||F!==Z||sa||t!==null&&t.dependencies!==null&&Gr(t.dependencies)?(typeof A=="function"&&(qd(n,a,A,o),Z=n.memoizedState),(ne=sa||Cm(n,a,ne,o,F,Z,L)||t!==null&&t.dependencies!==null&&Gr(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&&F===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Z),h.props=o,h.state=Z,h.context=L,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&F===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,Yu(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=ir(n,t.child,null,f),n.child=ir(n,null,a,f)):an(t,n,a,f),n.memoizedState=h.state,t=n.child):t=xl(t,n,f),t}function Hm(t,n,a,o){return $n(),n.flags|=256,an(t,n,a,o),n.child}var Pd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yd(t){return{baseLanes:t,cachePool:kt()}}function Fd(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=Yn),t}function $m(t,n,a){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Dt.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ge){if(f?ca(n):da(),(t=ct)?(t=Xg(t,Nn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Gi!==null?{id:An,overflow:si}:null,retryLane:536870912,hydrationErrors:null},a=Au(t),a.return=n,n.child=a,Nt=n,ct=null)):t=null,t===null)throw Pi(n);return Df(t)?n.lanes=32:n.lanes=536870912,null}var A=o.children;return o=o.fallback,f?(da(),f=n.mode,A=Fu({mode:"hidden",children:A},f),o=fl(o,f,a,null),A.return=n,o.return=n,A.sibling=o,n.child=A,o=n.child,o.memoizedState=Yd(a),o.childLanes=Fd(t,v,a),n.memoizedState=Pd,oo(null,o)):(ca(n),Wd(n,A))}var L=t.memoizedState;if(L!==null&&(A=L.dehydrated,A!==null)){if(h)n.flags&256?(ca(n),n.flags&=-257,n=Kd(t,n,a)):n.memoizedState!==null?(da(),n.child=t.child,n.flags|=128,n=null):(da(),A=o.fallback,f=n.mode,o=Fu({mode:"visible",children:o.children},f),A=fl(A,f,a,null),A.flags|=2,o.return=n,A.return=n,o.sibling=A,n.child=o,ir(n,t.child,null,a),o=n.child,o.memoizedState=Yd(a),o.childLanes=Fd(t,v,a),n.memoizedState=Pd,n=oo(null,o));else if(ca(n),Df(A)){if(v=A.nextSibling&&A.nextSibling.dataset,v)var Y=v.dgst;v=Y,o=Error(r(419)),o.stack="",o.digest=v,xi({value:o,source:null,stack:null}),n=Kd(t,n,a)}else if(qt||_n(t,n,a,!1),v=(a&t.childLanes)!==0,qt||v){if(v=ht,v!==null&&(o=tu(v,a),o!==0&&o!==L.retryLane))throw L.retryLane=o,ul(t,o),Ln(v,t,o),Gd;Nf(A)||nc(),n=Kd(t,n,a)}else Nf(A)?(n.flags|=192,n.child=t.child,n=null):(t=L.treeContext,ct=ci(A.nextSibling),Nt=n,Ge=!0,Vi=null,Nn=!1,t!==null&&Ws(n,t),n=Wd(n,o.children),n.flags|=4096);return n}return f?(da(),A=o.fallback,f=n.mode,L=t.child,Y=L.sibling,o=ri(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,Y!==null?A=ri(Y,A):(A=fl(A,f,a,null),A.flags|=2),A.return=n,o.return=n,o.sibling=A,n.child=o,oo(null,o),o=n.child,A=t.child.memoizedState,A===null?A=Yd(a):(f=A.cachePool,f!==null?(L=wt._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=kt(),A={baseLanes:A.baseLanes|a,cachePool:f}),o.memoizedState=A,o.childLanes=Fd(t,v,a),n.memoizedState=Pd,oo(t.child,o)):(ca(n),a=t.child,t=a.sibling,a=ri(a,{mode:"visible",children:o.children}),a.return=n,a.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=a,n.memoizedState=null,a)}function Wd(t,n){return n=Fu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Fu(t,n){return t=cn(22,t,null,n),t.lanes=0,t}function Kd(t,n,a){return ir(n,t.child,null,a),t=Wd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Gm(t,n,a){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Dn(t.return,n,a)}function Xd(t,n,a,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=a,v.tailMode=f,v.treeForkCount=h)}function Vm(t,n,a){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Dt.current,A=(v&2)!==0;if(A?(v=v&1|2,n.flags|=128):v&=1,T(Dt,v),an(t,n,o,a),o=Ge?Za:0,!A&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Gm(t,a,n);else if(t.tag===19)Gm(t,a,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(a=n.child,f=null;a!==null;)t=a.alternate,t!==null&&zu(t)===null&&(f=a),a=a.sibling;a=f,a===null?(f=n.child,n.child=null):(f=a.sibling,a.sibling=null),Xd(n,!1,f,a,h,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&zu(t)===null){n.child=f;break}t=f.sibling,f.sibling=a,a=f,f=t}Xd(n,!0,a,null,h,o);break;case"together":Xd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function xl(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),ha|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(_n(t,n,a,!1),(a&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,a=ri(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=ri(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function Qd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Gr(t)))}function Aw(t,n,a){switch(n.tag){case 3:ze(n,n.stateNode.containerInfo),et(n,wt,t.memoizedState.cache),$n();break;case 27:case 5:Rt(n);break;case 4:ze(n,n.stateNode.containerInfo);break;case 10:et(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,kd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(ca(n),n.flags|=128,null):(a&n.child.childLanes)!==0?$m(t,n,a):(ca(n),t=xl(t,n,a),t!==null?t.sibling:null);ca(n);break;case 19:var f=(t.flags&128)!==0;if(o=(a&n.childLanes)!==0,o||(_n(t,n,a,!1),o=(a&n.childLanes)!==0),f){if(o)return Vm(t,n,a);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),T(Dt,Dt.current),o)break;return null;case 22:return n.lanes=0,Lm(t,n,a,n.pendingProps);case 24:et(n,wt,t.memoizedState.cache)}return xl(t,n,a)}function Pm(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)qt=!0;else{if(!Qd(t,a)&&(n.flags&128)===0)return qt=!1,Aw(t,n,a);qt=(t.flags&131072)!==0}else qt=!1,Ge&&(n.flags&1048576)!==0&&Ja(n,Za,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=tr(n.elementType),n.type=t,typeof t=="function")Ps(t)?(o=ar(t,o),n.tag=1,n=qm(null,n,t,o,a)):(n.tag=0,n=Vd(null,n,t,o,a));else{if(t!=null){var f=t.$$typeof;if(f===W){n.tag=11,n=Mm(null,n,t,o,a);break e}else if(f===K){n.tag=14,n=Om(null,n,t,o,a);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return Vd(t,n,n.type,n.pendingProps,a);case 1:return o=n.type,f=ar(o,n.pendingProps),qm(t,n,o,f,a);case 3:e:{if(ze(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,yd(t,n),io(n,o,null,a);var v=n.memoizedState;if(o=v.cache,et(n,wt,o),o!==h.cache&&Zs(n,[wt],a,!0),no(),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=Hm(t,n,o,a);break e}else if(o!==f){f=Tn(Error(r(424)),n),xi(f),n=Hm(t,n,o,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(ct=ci(t.firstChild),Nt=n,Ge=!0,Vi=null,Nn=!0,a=Lh(n,null,o,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($n(),o===f){n=xl(t,n,a);break e}an(t,n,o,a)}n=n.child}return n;case 26:return Yu(t,n),t===null?(a=ny(n.type,null,n.pendingProps,null))?n.memoizedState=a:Ge||(a=n.type,t=n.pendingProps,o=uc(X.current).createElement(a),o[Yt]=n,o[zt]=t,rn(o,a,t),Ct(o),n.stateNode=o):n.memoizedState=ny(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Rt(n),t===null&&Ge&&(o=n.stateNode=Jg(n.type,n.pendingProps,X.current),Nt=n,Nn=!0,f=ct,ba(n.type)?(_f=f,ct=ci(o.firstChild)):ct=f),an(t,n,n.pendingProps.children,a),Yu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ge&&((f=o=ct)&&(o=lk(o,n.type,n.pendingProps,Nn),o!==null?(n.stateNode=o,Nt=n,ct=ci(o.firstChild),Nn=!1,f=!0):f=!1),f||Pi(n)),Rt(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,Tf(f,h)?o=null:v!==null&&Tf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=Sd(t,n,bw,null,null,a),So._currentValue=f),Yu(t,n),an(t,n,o,a),n.child;case 6:return t===null&&Ge&&((t=a=ct)&&(a=ak(a,n.pendingProps,Nn),a!==null?(n.stateNode=a,Nt=n,ct=null,t=!0):t=!1),t||Pi(n)),null;case 13:return $m(t,n,a);case 4:return ze(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=ir(n,null,o,a):an(t,n,o,a),n.child;case 11:return Mm(t,n,n.type,n.pendingProps,a);case 7:return an(t,n,n.pendingProps,a),n.child;case 8:return an(t,n,n.pendingProps.children,a),n.child;case 12:return an(t,n,n.pendingProps.children,a),n.child;case 10:return o=n.pendingProps,et(n,n.type,o.value),an(t,n,o.children,a),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,ml(n),f=Ft(f),o=o(f),n.flags|=1,an(t,n,o,a),n.child;case 14:return Om(t,n,n.type,n.pendingProps,a);case 15:return zm(t,n,n.type,n.pendingProps,a);case 19:return Vm(t,n,a);case 31:return Ew(t,n,a);case 22:return Lm(t,n,a,n.pendingProps);case 24:return ml(n),o=Ft(wt),t===null?(f=we(),f===null&&(f=ht,h=Vr(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=a),f=h),n.memoizedState={parent:o,cache:f},gd(n),et(n,wt,f)):((t.lanes&a)!==0&&(yd(t,n),io(n,null,null,a),no()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),et(n,wt,o)):(o=h.cache,et(n,wt,o),o!==f.cache&&Zs(n,[wt],a,!0))),an(t,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function bl(t){t.flags|=4}function Zd(t,n,a,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(xg())t.flags|=8192;else throw nr=Yi,fn}else t.flags&=-16777217}function Ym(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!sy(n))if(xg())t.flags|=8192;else throw nr=Yi,fn}function Wu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?yt():536870912,t.lanes|=n,es|=n)}function uo(t,n){if(!Ge)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function xt(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,o=0;if(n)for(var f=t.child;f!==null;)a|=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;)a|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=a,n}function Nw(t,n,a){var o=n.pendingProps;switch(er(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(n),null;case 1:return xt(n),null;case 3:return a=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),dn(wt),Ke(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(la(n)?bl(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,pl())),xt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(bl(n),h!==null?(xt(n),Ym(n,h)):(xt(n),Zd(n,f,null,o,a))):h?h!==t.memoizedState?(bl(n),xt(n),Ym(n,h)):(xt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&bl(n),xt(n),Zd(n,f,t,o,a)),null;case 27:if(Kt(n),a=X.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}t=Q.current,la(n)?Xs(n):(t=Jg(f,o,a),n.stateNode=t,bl(n))}return xt(n),null;case 5:if(Kt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return xt(n),null}if(h=Q.current,la(n))Xs(n);else{var v=uc(X.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[Yt]=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(rn(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&bl(n)}}return xt(n),Zd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&bl(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=X.current,la(n)){if(t=n.stateNode,a=n.memoizedProps,o=null,f=Nt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Yt]=n,t=!!(t.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||$g(t.nodeValue,a)),t||Pi(n,!0)}else t=uc(t).createTextNode(o),t[Yt]=n,n.stateNode=t}return xt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(o=la(n),a!==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[Yt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else a=pl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Vn(n),n):(Vn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return xt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=la(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[Yt]=n}else $n(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),f=!1}else f=pl(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Vn(n),n):(Vn(n),null)}return Vn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=o!==null,t=t!==null&&t.memoizedState!==null,a&&(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)),a!==t&&a&&(n.child.flags|=8192),Wu(n,n.updateQueue),xt(n),null);case 4:return Ke(),t===null&&wf(n.stateNode.containerInfo),xt(n),null;case 10:return dn(n.type),xt(n),null;case 19:if(q(Dt),o=n.memoizedState,o===null)return xt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)uo(o,!1);else{if(Et!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=zu(t),h!==null){for(n.flags|=128,uo(o,!1),t=h.updateQueue,n.updateQueue=t,Wu(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)Eu(a,t),a=a.sibling;return T(Dt,Dt.current&1|2),Ge&&gi(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&At()>Ju&&(n.flags|=128,f=!0,uo(o,!1),n.lanes=4194304)}else{if(!f)if(t=zu(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Wu(n,t),uo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ge)return xt(n),null}else 2*At()-o.renderingStartTime>Ju&&a!==536870912&&(n.flags|=128,f=!0,uo(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=At(),t.sibling=null,a=Dt.current,T(Dt,f?a&1|2:a&1),Ge&&gi(n,o.treeForkCount),t):(xt(n),null);case 22:case 23:return Vn(n),wd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(a&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),a=n.updateQueue,a!==null&&Wu(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==a&&(n.flags|=2048),t!==null&&q(Te),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),dn(wt),xt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Dw(t,n){switch(er(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return dn(wt),Ke(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Kt(n),null;case 31:if(n.memoizedState!==null){if(Vn(n),n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Vn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));$n()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return q(Dt),null;case 4:return Ke(),null;case 10:return dn(n.type),null;case 22:case 23:return Vn(n),wd(),t!==null&&q(Te),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return dn(wt),null;case 25:return null;default:return null}}function Fm(t,n){switch(er(n),n.tag){case 3:dn(wt),Ke();break;case 26:case 27:case 5:Kt(n);break;case 4:Ke();break;case 31:n.memoizedState!==null&&Vn(n);break;case 13:Vn(n);break;case 19:q(Dt);break;case 10:dn(n.type);break;case 22:case 23:Vn(n),wd(),t!==null&&q(Te);break;case 24:dn(wt)}}function co(t,n){try{var a=n.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var f=o.next;a=f;do{if((a.tag&t)===t){o=void 0;var h=a.create,v=a.inst;o=h(),v.destroy=o}a=a.next}while(a!==f)}}catch(A){ot(n,n.return,A)}}function fa(t,n,a){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,A=v.destroy;if(A!==void 0){v.destroy=void 0,f=n;var L=a,Y=A;try{Y()}catch(ne){ot(f,L,ne)}}}o=o.next}while(o!==h)}}catch(ne){ot(n,n.return,ne)}}function Wm(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{Uh(n,a)}catch(o){ot(t,t.return,o)}}}function Km(t,n,a){a.props=ar(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(o){ot(t,n,o)}}function fo(t,n){try{var a=t.ref;if(a!==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 a=="function"?t.refCleanup=a(o):a.current=o}}catch(f){ot(t,n,f)}}function Fi(t,n){var a=t.ref,o=t.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(f){ot(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){ot(t,n,f)}else a.current=null}function Xm(t){var n=t.type,a=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(f){ot(t,t.return,f)}}function Jd(t,n,a){try{var o=t.stateNode;Zw(o,t.type,a,n),o[zt]=n}catch(f){ot(t,t.return,f)}}function Qm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ba(t.type)||t.tag===4}function ef(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Qm(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&&ba(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 tf(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=yn));else if(o!==4&&(o===27&&ba(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(tf(t,n,a),t=t.sibling;t!==null;)tf(t,n,a),t=t.sibling}function Ku(t,n,a){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(o!==4&&(o===27&&ba(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Ku(t,n,a),t=t.sibling;t!==null;)Ku(t,n,a),t=t.sibling}function Zm(t){var n=t.stateNode,a=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);rn(n,o,a),n[Yt]=t,n[zt]=a}catch(h){ot(t,t.return,h)}}var vl=!1,Ht=!1,nf=!1,Jm=typeof WeakSet=="function"?WeakSet:Set,tn=null;function _w(t,n){if(t=t.containerInfo,Sf=gc,t=wu(t),Is(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var v=0,A=-1,L=-1,Y=0,ne=0,re=t,F=null;t:for(;;){for(var Z;re!==a||f!==0&&re.nodeType!==3||(A=v+f),re!==h||o!==0&&re.nodeType!==3||(L=v+o),re.nodeType===3&&(v+=re.nodeValue.length),(Z=re.firstChild)!==null;)F=re,re=Z;for(;;){if(re===t)break t;if(F===a&&++Y===f&&(A=v),F===h&&++ne===o&&(L=v),(Z=re.nextSibling)!==null)break;re=F,F=re.parentNode}re=Z}a=A===-1||L===-1?null:{start:A,end:L}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cf={focusedElem:t,selectionRange:a},gc=!1,tn=n;tn!==null;)if(n=tn,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,tn=t;else for(;tn!==null;){switch(n=tn,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)f=t[a],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,a=n,f=h.memoizedProps,h=h.memoizedState,o=a.stateNode;try{var ke=ar(a.type,f);t=o.getSnapshotBeforeUpdate(ke,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(Me){ot(a,a.return,Me)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)Af(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Af(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,tn=t;break}tn=n.return}}function eg(t,n,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:kl(t,a),o&4&&co(5,a);break;case 1:if(kl(t,a),o&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(v){ot(a,a.return,v)}else{var f=ar(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){ot(a,a.return,v)}}o&64&&Wm(a),o&512&&fo(a,a.return);break;case 3:if(kl(t,a),o&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{Uh(t,n)}catch(v){ot(a,a.return,v)}}break;case 27:n===null&&o&4&&Zm(a);case 26:case 5:kl(t,a),n===null&&o&4&&Xm(a),o&512&&fo(a,a.return);break;case 12:kl(t,a);break;case 31:kl(t,a),o&4&&ig(t,a);break;case 13:kl(t,a),o&4&&lg(t,a),o&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=qw.bind(null,a),rk(t,a))));break;case 22:if(o=a.memoizedState!==null||vl,!o){n=n!==null&&n.memoizedState!==null||Ht,f=vl;var h=Ht;vl=o,(Ht=n)&&!h?jl(t,a,(a.subtreeFlags&8772)!==0):kl(t,a),vl=f,Ht=h}break;case 30:break;default:kl(t,a)}}function tg(t){var n=t.alternate;n!==null&&(t.alternate=null,tg(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&ws(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var vt=null,Rn=!1;function wl(t,n,a){for(a=a.child;a!==null;)ng(t,n,a),a=a.sibling}function ng(t,n,a){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Pt,a)}catch{}switch(a.tag){case 26:Ht||Fi(a,n),wl(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ht||Fi(a,n);var o=vt,f=Rn;ba(a.type)&&(vt=a.stateNode,Rn=!1),wl(t,n,a),wo(a.stateNode),vt=o,Rn=f;break;case 5:Ht||Fi(a,n);case 6:if(o=vt,f=Rn,vt=null,wl(t,n,a),vt=o,Rn=f,vt!==null)if(Rn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(h){ot(a,n,h)}else try{vt.removeChild(a.stateNode)}catch(h){ot(a,n,h)}break;case 18:vt!==null&&(Rn?(t=vt,Wg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),os(t)):Wg(vt,a.stateNode));break;case 4:o=vt,f=Rn,vt=a.stateNode.containerInfo,Rn=!0,wl(t,n,a),vt=o,Rn=f;break;case 0:case 11:case 14:case 15:fa(2,a,n),Ht||fa(4,a,n),wl(t,n,a);break;case 1:Ht||(Fi(a,n),o=a.stateNode,typeof o.componentWillUnmount=="function"&&Km(a,n,o)),wl(t,n,a);break;case 21:wl(t,n,a);break;case 22:Ht=(o=Ht)||a.memoizedState!==null,wl(t,n,a),Ht=o;break;default:wl(t,n,a)}}function ig(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{os(t)}catch(a){ot(n,n.return,a)}}}function lg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{os(t)}catch(a){ot(n,n.return,a)}}function Rw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Jm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Jm),n;default:throw Error(r(435,t.tag))}}function Xu(t,n){var a=Rw(t);n.forEach(function(o){if(!a.has(o)){a.add(o);var f=Hw.bind(null,t,o);o.then(f,f)}})}function Mn(t,n){var a=n.deletions;if(a!==null)for(var o=0;o<a.length;o++){var f=a[o],h=t,v=n,A=v;e:for(;A!==null;){switch(A.tag){case 27:if(ba(A.type)){vt=A.stateNode,Rn=!1;break e}break;case 5:vt=A.stateNode,Rn=!1;break e;case 3:case 4:vt=A.stateNode.containerInfo,Rn=!0;break e}A=A.return}if(vt===null)throw Error(r(160));ng(h,v,f),vt=null,Rn=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ag(n,t),n=n.sibling}var wi=null;function ag(t,n){var a=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Mn(n,t),On(t),o&4&&(fa(3,t,t.return),co(3,t),fa(5,t,t.return));break;case 1:Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),o&64&&vl&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var f=wi;if(Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),o&4){var h=a!==null?a.memoizedState:null;if(o=t.memoizedState,a===null)if(o===null)if(t.stateNode===null){e:{o=t.type,a=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[Ai]||h[Yt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),rn(h,o,a),h[Yt]=t,Ct(h),o=h;break e;case"link":var v=ay("link","href",f).get(o+(a.href||""));if(v){for(var A=0;A<v.length;A++)if(h=v[A],h.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&h.getAttribute("rel")===(a.rel==null?null:a.rel)&&h.getAttribute("title")===(a.title==null?null:a.title)&&h.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(A,1);break t}}h=f.createElement(o),rn(h,o,a),f.head.appendChild(h);break;case"meta":if(v=ay("meta","content",f).get(o+(a.content||""))){for(A=0;A<v.length;A++)if(h=v[A],h.getAttribute("content")===(a.content==null?null:""+a.content)&&h.getAttribute("name")===(a.name==null?null:a.name)&&h.getAttribute("property")===(a.property==null?null:a.property)&&h.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&h.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(A,1);break t}}h=f.createElement(o),rn(h,o,a),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[Yt]=t,Ct(h),o=h}t.stateNode=o}else ry(f,t.type,t.stateNode);else t.stateNode=ly(f,o,t.memoizedProps);else h!==o?(h===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):h.count--,o===null?ry(f,t.type,t.stateNode):ly(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Jd(t,t.memoizedProps,a.memoizedProps)}break;case 27:Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),a!==null&&o&4&&Jd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Mn(n,t),On(t),o&512&&(Ht||a===null||Fi(a,a.return)),t.flags&32){f=t.stateNode;try{ti(f,"")}catch(ke){ot(t,t.return,ke)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Jd(t,f,a!==null?a.memoizedProps:f)),o&1024&&(nf=!0);break;case 6:if(Mn(n,t),On(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,a=t.stateNode;try{a.nodeValue=o}catch(ke){ot(t,t.return,ke)}}break;case 3:if(fc=null,f=wi,wi=cc(n.containerInfo),Mn(n,t),wi=f,On(t),o&4&&a!==null&&a.memoizedState.isDehydrated)try{os(n.containerInfo)}catch(ke){ot(t,t.return,ke)}nf&&(nf=!1,rg(t));break;case 4:o=wi,wi=cc(t.stateNode.containerInfo),Mn(n,t),On(t),wi=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,Xu(t,o)));break;case 13:Mn(n,t),On(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Zu=At()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Xu(t,o)));break;case 22:f=t.memoizedState!==null;var L=a!==null&&a.memoizedState!==null,Y=vl,ne=Ht;if(vl=Y||f,Ht=ne||L,Mn(n,t),Ht=ne,vl=Y,On(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(a===null||L||vl||Ht||rr(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){L=a=n;try{if(h=L.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{A=L.stateNode;var re=L.memoizedProps.style,F=re!=null&&re.hasOwnProperty("display")?re.display:null;A.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(ke){ot(L,L.return,ke)}}}else if(n.tag===6){if(a===null){L=n;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(ke){ot(L,L.return,ke)}}}else if(n.tag===18){if(a===null){L=n;try{var Z=L.stateNode;f?Kg(Z,!0):Kg(L.stateNode,!1)}catch(ke){ot(L,L.return,ke)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Xu(t,a))));break;case 19:Mn(n,t),On(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Xu(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 a,o=t.return;o!==null;){if(Qm(o)){a=o;break}o=o.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,h=ef(t);Ku(t,h,f);break;case 5:var v=a.stateNode;a.flags&32&&(ti(v,""),a.flags&=-33);var A=ef(t);Ku(t,A,v);break;case 3:case 4:var L=a.stateNode.containerInfo,Y=ef(t);tf(t,Y,L);break;default:throw Error(r(161))}}catch(ne){ot(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function rg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;rg(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function kl(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)eg(t,n.alternate,n),n=n.sibling}function rr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:fa(4,n,n.return),rr(n);break;case 1:Fi(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Km(n,n.return,a),rr(n);break;case 27:wo(n.stateNode);case 26:case 5:Fi(n,n.return),rr(n);break;case 22:n.memoizedState===null&&rr(n);break;case 30:rr(n);break;default:rr(n)}t=t.sibling}}function jl(t,n,a){for(a=a&&(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:jl(f,h,a),co(4,h);break;case 1:if(jl(f,h,a),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Y){ot(o,o.return,Y)}if(o=h,f=o.updateQueue,f!==null){var A=o.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)Ih(L[f],A)}catch(Y){ot(o,o.return,Y)}}a&&v&64&&Wm(h),fo(h,h.return);break;case 27:Zm(h);case 26:case 5:jl(f,h,a),a&&o===null&&v&4&&Xm(h),fo(h,h.return);break;case 12:jl(f,h,a);break;case 31:jl(f,h,a),a&&v&4&&ig(f,h);break;case 13:jl(f,h,a),a&&v&4&&lg(f,h);break;case 22:h.memoizedState===null&&jl(f,h,a),fo(h,h.return);break;case 30:break;default:jl(f,h,a)}n=n.sibling}}function lf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&ra(a))}function af(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ra(t))}function ki(t,n,a,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)sg(t,n,a,o),n=n.sibling}function sg(t,n,a,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:ki(t,n,a,o),f&2048&&co(9,n);break;case 1:ki(t,n,a,o);break;case 3:ki(t,n,a,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ra(t)));break;case 12:if(f&2048){ki(t,n,a,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,A=h.onPostCommit;typeof A=="function"&&A(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(L){ot(n,n.return,L)}}else ki(t,n,a,o);break;case 31:ki(t,n,a,o);break;case 13:ki(t,n,a,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?ki(t,n,a,o):po(t,n):h._visibility&2?ki(t,n,a,o):(h._visibility|=2,Qr(t,n,a,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&lf(v,n);break;case 24:ki(t,n,a,o),f&2048&&af(n.alternate,n);break;default:ki(t,n,a,o)}}function Qr(t,n,a,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,A=a,L=o,Y=v.flags;switch(v.tag){case 0:case 11:case 15:Qr(h,v,A,L,f),co(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?Qr(h,v,A,L,f):po(h,v):(ne._visibility|=2,Qr(h,v,A,L,f)),f&&Y&2048&&lf(v.alternate,v);break;case 24:Qr(h,v,A,L,f),f&&Y&2048&&af(v.alternate,v);break;default:Qr(h,v,A,L,f)}n=n.sibling}}function po(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,o=n,f=o.flags;switch(o.tag){case 22:po(a,o),f&2048&&lf(o.alternate,o);break;case 24:po(a,o),f&2048&&af(o.alternate,o);break;default:po(a,o)}n=n.sibling}}var ho=8192;function Zr(t,n,a){if(t.subtreeFlags&ho)for(t=t.child;t!==null;)og(t,n,a),t=t.sibling}function og(t,n,a){switch(t.tag){case 26:Zr(t,n,a),t.flags&ho&&t.memoizedState!==null&&xk(a,wi,t.memoizedState,t.memoizedProps);break;case 5:Zr(t,n,a);break;case 3:case 4:var o=wi;wi=cc(t.stateNode.containerInfo),Zr(t,n,a),wi=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=ho,ho=16777216,Zr(t,n,a),ho=o):Zr(t,n,a));break;default:Zr(t,n,a)}}function ug(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 mo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];tn=o,dg(o,t)}ug(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cg(t),t=t.sibling}function cg(t){switch(t.tag){case 0:case 11:case 15:mo(t),t.flags&2048&&fa(9,t,t.return);break;case 3:mo(t);break;case 12:mo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Qu(t)):mo(t);break;default:mo(t)}}function Qu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var o=n[a];tn=o,dg(o,t)}ug(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:fa(8,n,n.return),Qu(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,Qu(n));break;default:Qu(n)}t=t.sibling}}function dg(t,n){for(;tn!==null;){var a=tn;switch(a.tag){case 0:case 11:case 15:fa(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ra(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,tn=o;else e:for(a=t;tn!==null;){o=tn;var f=o.sibling,h=o.return;if(tg(o),o===a){tn=null;break e}if(f!==null){f.return=h,tn=f;break e}tn=h}}}var Mw={getCacheForType:function(t){var n=Ft(wt),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return Ft(wt).controller.signal}},Ow=typeof WeakMap=="function"?WeakMap:Map,at=0,ht=null,Ye=null,Qe=0,st=0,Pn=null,pa=!1,Jr=!1,rf=!1,Sl=0,Et=0,ha=0,sr=0,sf=0,Yn=0,es=0,go=null,zn=null,of=!1,Zu=0,fg=0,Ju=1/0,ec=null,ma=null,Wt=0,ga=null,ts=null,Cl=0,uf=0,cf=null,pg=null,yo=0,df=null;function Fn(){return(at&2)!==0&&Qe!==0?Qe&-Qe:V.T!==null?yf():vs()}function hg(){if(Yn===0)if((Qe&536870912)===0||Ge){var t=vr;vr<<=1,(vr&3932160)===0&&(vr=262144),Yn=t}else Yn=536870912;return t=Gn.current,t!==null&&(t.flags|=32),Yn}function Ln(t,n,a){(t===ht&&(st===2||st===9)||t.cancelPendingCommit!==null)&&(ns(t,0),ya(t,Qe,Yn,!1)),Ra(t,a),((at&2)===0||t!==ht)&&(t===ht&&((at&2)===0&&(sr|=a),Et===4&&ya(t,Qe,Yn,!1)),Wi(t))}function mg(t,n,a){if((at&6)!==0)throw Error(r(327));var o=!a&&(n&127)===0&&(n&t.expiredLanes)===0||nn(t,n),f=o?Iw(t,n):pf(t,n,!0),h=o;do{if(f===0){Jr&&!o&&ya(t,n,0,!1);break}else{if(a=t.current.alternate,h&&!zw(a)){f=pf(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 A=t;f=go;var L=A.current.memoizedState.isDehydrated;if(L&&(ns(A,v).flags|=256),v=pf(A,v,!1),v!==2){if(rf&&!L){A.errorRecoveryDisabledLanes|=h,sr|=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){ns(t,0),ya(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:ya(o,n,Yn,!pa);break e;case 2:zn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Zu+300-At(),10<f)){if(ya(o,n,Yn,!pa),_l(o,0,!0)!==0)break e;Cl=n,o.timeoutHandle=Yg(gg.bind(null,o,a,zn,ec,of,n,Yn,sr,es,pa,h,"Throttled",-0,0),f);break e}gg(o,a,zn,ec,of,n,Yn,sr,es,pa,h,null,-0,0)}}break}while(!0);Wi(t)}function gg(t,n,a,o,f,h,v,A,L,Y,ne,re,F,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:yn},og(n,h,re);var ke=(h&62914560)===h?Zu-At():(h&4194048)===h?fg-At():0;if(ke=bk(re,ke),ke!==null){Cl=h,t.cancelPendingCommit=ke(Sg.bind(null,t,n,h,a,o,f,v,A,L,ne,re,null,F,Z)),ya(t,h,v,!Y);return}}Sg(t,n,h,a,o,f,v,A,L)}function zw(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var f=a[o],h=f.getSnapshot;f=f.value;try{if(!bn(h(),f))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;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 ya(t,n,a,o){n&=~sf,n&=~sr,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-rt(f),v=1<<h;o[h]=-1,f&=~v}a!==0&&xs(t,a,n)}function tc(){return(at&6)===0?(xo(0),!1):!0}function ff(){if(Ye!==null){if(st===0)var t=Ye.return;else t=Ye,bi=hl=null,Ed(t),Yr=null,Js=0,t=Ye;for(;t!==null;)Fm(t.alternate,t),t=t.return;Ye=null}}function ns(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,tk(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Cl=0,ff(),ht=t,Ye=a=ri(t.current,null),Qe=n,st=0,Pn=null,pa=!1,Jr=nn(t,n),rf=!1,es=Yn=sf=sr=ha=Et=0,zn=go=null,of=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-rt(o),h=1<<f;n|=t[f],o&=~h}return Sl=n,Qa(),a}function yg(t,n){Be=null,V.H=so,n===vi||n===oi?(n=Mh(),st=3):n===fn?(n=Mh(),st=4):st=n===Gd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Pn=n,Ye===null&&(Et=1,Vu(t,Tn(n,t.current)))}function xg(){var t=Gn.current;return t===null?!0:(Qe&4194048)===Qe?ui===null:(Qe&62914560)===Qe||(Qe&536870912)!==0?t===ui:!1}function bg(){var t=V.H;return V.H=so,t===null?so:t}function vg(){var t=V.A;return V.A=Mw,t}function nc(){Et=4,pa||(Qe&4194048)!==Qe&&Gn.current!==null||(Jr=!0),(ha&134217727)===0&&(sr&134217727)===0||ht===null||ya(ht,Qe,Yn,!1)}function pf(t,n,a){var o=at;at|=2;var f=bg(),h=vg();(ht!==t||Qe!==n)&&(ec=null,ns(t,n)),n=!1;var v=Et;e:do try{if(st!==0&&Ye!==null){var A=Ye,L=Pn;switch(st){case 8:ff(),v=6;break e;case 3:case 2:case 9:case 6:Gn.current===null&&(n=!0);var Y=st;if(st=0,Pn=null,is(t,A,L,Y),a&&Jr){v=0;break e}break;default:Y=st,st=0,Pn=null,is(t,A,L,Y)}}Lw(),v=Et;break}catch(ne){yg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,bi=hl=null,at=o,V.H=f,V.A=h,Ye===null&&(ht=null,Qe=0,Qa()),v}function Lw(){for(;Ye!==null;)wg(Ye)}function Iw(t,n){var a=at;at|=2;var o=bg(),f=vg();ht!==t||Qe!==n?(ec=null,Ju=At()+500,ns(t,n)):Jr=nn(t,n);e:do try{if(st!==0&&Ye!==null){n=Ye;var h=Pn;t:switch(st){case 1:st=0,Pn=null,is(t,n,h,1);break;case 2:case 9:if(Pr(h)){st=0,Pn=null,kg(n);break}n=function(){st!==2&&st!==9||ht!==t||(st=7),Wi(t)},h.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Pr(h)?(st=0,Pn=null,kg(n)):(st=0,Pn=null,is(t,n,h,7));break;case 5:var v=null;switch(Ye.tag){case 26:v=Ye.memoizedState;case 5:case 27:var A=Ye;if(v?sy(v):A.stateNode.complete){st=0,Pn=null;var L=A.sibling;if(L!==null)Ye=L;else{var Y=A.return;Y!==null?(Ye=Y,ic(Y)):Ye=null}break t}}st=0,Pn=null,is(t,n,h,5);break;case 6:st=0,Pn=null,is(t,n,h,6);break;case 8:ff(),Et=6;break e;default:throw Error(r(462))}}Uw();break}catch(ne){yg(t,ne)}while(!0);return bi=hl=null,V.H=o,V.A=f,at=a,Ye!==null?0:(ht=null,Qe=0,Qa(),Et)}function Uw(){for(;Ye!==null&&!Xn();)wg(Ye)}function wg(t){var n=Pm(t.alternate,t,Sl);t.memoizedProps=t.pendingProps,n===null?ic(t):Ye=n}function kg(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=Bm(a,n,n.pendingProps,n.type,void 0,Qe);break;case 11:n=Bm(a,n,n.pendingProps,n.type.render,n.ref,Qe);break;case 5:Ed(n);default:Fm(a,n),n=Ye=Eu(n,Sl),n=Pm(a,n,Sl)}t.memoizedProps=t.pendingProps,n===null?ic(t):Ye=n}function is(t,n,a,o){bi=hl=null,Ed(n),Yr=null,Js=0;var f=n.return;try{if(Tw(t,f,n,a,Qe)){Et=1,Vu(t,Tn(a,t.current)),Ye=null;return}}catch(h){if(f!==null)throw Ye=f,h;Et=1,Vu(t,Tn(a,t.current)),Ye=null;return}n.flags&32768?(Ge||o===1?t=!0:Jr||(Qe&536870912)!==0?t=!1:(pa=t=!0,(o===2||o===9||o===3||o===6)&&(o=Gn.current,o!==null&&o.tag===13&&(o.flags|=16384))),jg(n,t)):ic(n)}function ic(t){var n=t;do{if((n.flags&32768)!==0){jg(n,pa);return}t=n.return;var a=Nw(n.alternate,n,Sl);if(a!==null){Ye=a;return}if(n=n.sibling,n!==null){Ye=n;return}Ye=n=t}while(n!==null);Et===0&&(Et=5)}function jg(t,n){do{var a=Dw(t.alternate,t);if(a!==null){a.flags&=32767,Ye=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=a}while(t!==null);Et=6,Ye=null}function Sg(t,n,a,o,f,h,v,A,L){t.cancelPendingCommit=null;do lc();while(Wt!==0);if((at&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Br,Ma(t,a,h,v,A,L),t===ht&&(Ye=ht=null,Qe=0),ts=n,ga=t,Cl=a,uf=h,cf=f,pg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,$w(Ce,function(){return Ng(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,f=se.p,se.p=2,v=at,at|=4;try{_w(t,n,a)}finally{at=v,se.p=f,V.T=o}}Wt=1,Cg(),Tg(),Eg()}}function Cg(){if(Wt===1){Wt=0;var t=ga,n=ts,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var o=se.p;se.p=2;var f=at;at|=4;try{ag(n,t);var h=Cf,v=wu(t.containerInfo),A=h.focusedElem,L=h.selectionRange;if(v!==A&&A&&A.ownerDocument&&vu(A.ownerDocument.documentElement,A)){if(L!==null&&Is(A)){var Y=L.start,ne=L.end;if(ne===void 0&&(ne=Y),"selectionStart"in A)A.selectionStart=Y,A.selectionEnd=Math.min(ne,A.value.length);else{var re=A.ownerDocument||document,F=re&&re.defaultView||window;if(F.getSelection){var Z=F.getSelection(),ke=A.textContent.length,Me=Math.min(L.start,ke),pt=L.end===void 0?Me:Math.min(L.end,ke);!Z.extend&&Me>pt&&(v=pt,pt=Me,Me=v);var G=bu(A,Me),B=bu(A,pt);if(G&&B&&(Z.rangeCount!==1||Z.anchorNode!==G.node||Z.anchorOffset!==G.offset||Z.focusNode!==B.node||Z.focusOffset!==B.offset)){var P=re.createRange();P.setStart(G.node,G.offset),Z.removeAllRanges(),Me>pt?(Z.addRange(P),Z.extend(B.node,B.offset)):(P.setEnd(B.node,B.offset),Z.addRange(P))}}}}for(re=[],Z=A;Z=Z.parentNode;)Z.nodeType===1&&re.push({element:Z,left:Z.scrollLeft,top:Z.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<re.length;A++){var le=re[A];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}gc=!!Sf,Cf=Sf=null}finally{at=f,se.p=o,V.T=a}}t.current=n,Wt=2}}function Tg(){if(Wt===2){Wt=0;var t=ga,n=ts,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var o=se.p;se.p=2;var f=at;at|=4;try{eg(t,n.alternate,n)}finally{at=f,se.p=o,V.T=a}}Wt=3}}function Eg(){if(Wt===4||Wt===3){Wt=0,Nl();var t=ga,n=ts,a=Cl,o=pg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,ts=ga=null,Ag(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(ma=null),bs(a),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Pt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=se.p,se.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var A=o[v];h(A.value,{componentStack:A.stack})}}finally{V.T=n,se.p=f}}(Cl&3)!==0&&lc(),Wi(t),f=t.pendingLanes,(a&261930)!==0&&(f&42)!==0?t===df?yo++:(yo=0,df=t):yo=0,xo(0)}}function Ag(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ra(n)))}function lc(){return Cg(),Tg(),Eg(),Ng()}function Ng(){if(Wt!==5)return!1;var t=ga,n=uf;uf=0;var a=bs(Cl),o=V.T,f=se.p;try{se.p=32>a?32:a,V.T=null,a=cf,cf=null;var h=ga,v=Cl;if(Wt=0,ts=ga=null,Cl=0,(at&6)!==0)throw Error(r(331));var A=at;if(at|=4,cg(h.current),sg(h,h.current,v,a),at=A,xo(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Pt,h)}catch{}return!0}finally{se.p=f,V.T=o,Ag(t,n)}}function Dg(t,n,a){n=Tn(a,n),n=$d(t.stateNode,n,2),t=ua(t,n,2),t!==null&&(Ra(t,2),Wi(t))}function ot(t,n,a){if(t.tag===3)Dg(t,t,a);else for(;n!==null;){if(n.tag===3){Dg(n,t,a);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ma===null||!ma.has(o))){t=Tn(a,t),a=_m(2),o=ua(n,a,2),o!==null&&(Rm(a,o,n,t),Ra(o,2),Wi(o));break}}n=n.return}}function hf(t,n,a){var o=t.pingCache;if(o===null){o=t.pingCache=new Ow;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(a)||(rf=!0,f.add(a),t=Bw.bind(null,t,n,a),n.then(t,t))}function Bw(t,n,a){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,ht===t&&(Qe&a)===a&&(Et===4||Et===3&&(Qe&62914560)===Qe&&300>At()-Zu?(at&2)===0&&ns(t,0):sf|=a,es===Qe&&(es=0)),Wi(t)}function _g(t,n){n===0&&(n=yt()),t=ul(t,n),t!==null&&(Ra(t,n),Wi(t))}function qw(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),_g(t,a)}function Hw(t,n){var a=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(a=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),_g(t,a)}function $w(t,n){return Xt(t,n)}var ac=null,ls=null,mf=!1,rc=!1,gf=!1,xa=0;function Wi(t){t!==ls&&t.next===null&&(ls===null?ac=ls=t:ls=ls.next=t),rc=!0,mf||(mf=!0,Vw())}function xo(t,n){if(!gf&&rc){gf=!0;do for(var a=!1,o=ac;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,A=o.pingedLanes;h=(1<<31-rt(42|t)+1)-1,h&=f&~(v&~A),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(a=!0,zg(o,h))}else h=Qe,h=_l(o,o===ht?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||nn(o,h)||(a=!0,zg(o,h));o=o.next}while(a);gf=!1}}function Gw(){Rg()}function Rg(){rc=mf=!1;var t=0;xa!==0&&ek()&&(t=xa);for(var n=At(),a=null,o=ac;o!==null;){var f=o.next,h=Mg(o,n);h===0?(o.next=null,a===null?ac=f:a.next=f,f===null&&(ls=a)):(a=o,(t!==0||(h&3)!==0)&&(rc=!0)),o=f}Wt!==0&&Wt!==5||xo(t),xa!==0&&(xa=0)}function Mg(t,n){for(var a=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-rt(h),A=1<<v,L=f[v];L===-1?((A&a)===0||(A&o)!==0)&&(f[v]=Rl(A,n)):L<=n&&(t.expiredLanes|=A),h&=~A}if(n=ht,a=Qe,a=_l(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,a===0||t===n&&(st===2||st===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Si(o),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||nn(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(o!==null&&Si(o),bs(a)){case 2:case 8:a=ce;break;case 32:a=Ce;break;case 268435456:a=Xe;break;default:a=Ce}return o=Og.bind(null,t),a=Xt(a,o),t.callbackPriority=n,t.callbackNode=a,n}return o!==null&&o!==null&&Si(o),t.callbackPriority=2,t.callbackNode=null,2}function Og(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(lc()&&t.callbackNode!==a)return null;var o=Qe;return o=_l(t,t===ht?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(mg(t,o,n),Mg(t,At()),t.callbackNode!=null&&t.callbackNode===a?Og.bind(null,t):null)}function zg(t,n){if(lc())return null;mg(t,n,!0)}function Vw(){nk(function(){(at&6)!==0?Xt(ie,Gw):Rg()})}function yf(){if(xa===0){var t=C;t===0&&(t=br,br<<=1,(br&261888)===0&&(br=256)),xa=t}return xa}function Lg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Bl(""+t)}function Ig(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function Pw(t,n,a,o,f){if(n==="submit"&&a&&a.stateNode===f){var h=Lg((f[zt]||null).action),v=o.submitter;v&&(n=(n=v[zt]||null)?Lg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var A=new Ba("action","action",null,o,f);t.push({event:A,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(xa!==0){var L=v?Ig(f,v):new FormData(f);Ld(a,{pending:!0,data:L,method:f.method,action:h},null,L)}}else typeof h=="function"&&(A.preventDefault(),L=v?Ig(f,v):new FormData(f),Ld(a,{pending:!0,data:L,method:f.method,action:h},h,L))},currentTarget:f}]})}}for(var xf=0;xf<Gs.length;xf++){var bf=Gs[xf],Yw=bf.toLowerCase(),Fw=bf[0].toUpperCase()+bf.slice(1);Hn(Yw,"on"+Fw)}Hn(Su,"onAnimationEnd"),Hn(Hs,"onAnimationIteration"),Hn(ai,"onAnimationStart"),Hn("dblclick","onDoubleClick"),Hn("focusin","onFocus"),Hn("focusout","onBlur"),Hn($s,"onTransitionRun"),Hn(Cu,"onTransitionStart"),Hn(Xa,"onTransitionCancel"),Hn($i,"onTransitionEnd"),_i("onMouseEnter",["mouseout","mouseover"]),_i("onMouseLeave",["mouseout","mouseover"]),_i("onPointerEnter",["pointerout","pointerover"]),_i("onPointerLeave",["pointerout","pointerover"]),un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),un("onBeforeInput",["compositionend","keypress","textInput","paste"]),un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ww=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bo));function Ug(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var o=t[a],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var A=o[v],L=A.instance,Y=A.currentTarget;if(A=A.listener,L!==h&&f.isPropagationStopped())break e;h=A,f.currentTarget=Y;try{h(f)}catch(ne){Ur(ne)}f.currentTarget=null,h=L}else for(v=0;v<o.length;v++){if(A=o[v],L=A.instance,Y=A.currentTarget,A=A.listener,L!==h&&f.isPropagationStopped())break e;h=A,f.currentTarget=Y;try{h(f)}catch(ne){Ur(ne)}f.currentTarget=null,h=L}}}}function Fe(t,n){var a=n[Ei];a===void 0&&(a=n[Ei]=new Set);var o=t+"__bubble";a.has(o)||(Bg(n,t,2,!1),a.add(o))}function vf(t,n,a){var o=0;n&&(o|=4),Bg(a,t,o,n)}var sc="_reactListening"+Math.random().toString(36).slice(2);function wf(t){if(!t[sc]){t[sc]=!0,iu.forEach(function(a){a!=="selectionchange"&&(Ww.has(a)||vf(a,!1,t),vf(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[sc]||(n[sc]=!0,vf("selectionchange",!1,n))}}function Bg(t,n,a,o){switch(hy(n)){case 2:var f=kk;break;case 8:f=jk;break;default:f=Lf}a=f.bind(null,n,a,t),f=void 0,!Hl||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,a,{capture:!0,passive:f}):t.addEventListener(n,a,!0):f!==void 0?t.addEventListener(n,a,{passive:f}):t.addEventListener(n,a,!1)}function kf(t,n,a,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 A=o.stateNode.containerInfo;if(A===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(;A!==null;){if(v=Jn(A),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){o=h=v;continue e}A=A.parentNode}}o=o.return}zi(function(){var Y=h,ne=Ia(a),re=[];e:{var F=Tu.get(t);if(F!==void 0){var Z=Ba,ke=t;switch(t){case"keypress":if(Ii(a)===0)break e;case"keydown":case"keyup":Z=Ds;break;case"focusin":ke="focus",Z=qa;break;case"focusout":ke="blur",Z=qa;break;case"beforeblur":case"afterblur":Z=qa;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Z=Pl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Z=Ar;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Z=Ga;break;case Su:case Hs:case ai:Z=Ne;break;case $i:Z=_s;break;case"scroll":case"scrollend":Z=Bi;break;case"wheel":Z=Ms;break;case"copy":case"cut":case"paste":Z=mi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Z=cu;break;case"toggle":case"beforetoggle":Z=Mr}var Me=(n&4)!==0,pt=!Me&&(t==="scroll"||t==="scrollend"),G=Me?F!==null?F+"Capture":null:F;Me=[];for(var B=Y,P;B!==null;){var le=B;if(P=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||P===null||G===null||(le=Ua(B,G),le!=null&&Me.push(vo(B,le,P))),pt)break;B=B.return}0<Me.length&&(F=new Z(F,ke,null,a,ne),re.push({event:F,listeners:Me}))}}if((n&7)===0){e:{if(F=t==="mouseover"||t==="pointerover",Z=t==="mouseout"||t==="pointerout",F&&a!==La&&(ke=a.relatedTarget||a.fromElement)&&(Jn(ke)||ke[qn]))break e;if((Z||F)&&(F=ne.window===ne?ne:(F=ne.ownerDocument)?F.defaultView||F.parentWindow:window,Z?(ke=a.relatedTarget||a.toElement,Z=Y,ke=ke?Jn(ke):null,ke!==null&&(pt=c(ke),Me=ke.tag,ke!==pt||Me!==5&&Me!==27&&Me!==6)&&(ke=null)):(Z=null,ke=Y),Z!==ke)){if(Me=Pl,le="onMouseLeave",G="onMouseEnter",B="mouse",(t==="pointerout"||t==="pointerover")&&(Me=cu,le="onPointerLeave",G="onPointerEnter",B="pointer"),pt=Z==null?F:el(Z),P=ke==null?F:el(ke),F=new Me(le,B+"leave",Z,a,ne),F.target=pt,F.relatedTarget=P,le=null,Jn(ne)===Y&&(Me=new Me(G,B+"enter",ke,a,ne),Me.target=P,Me.relatedTarget=pt,le=Me),pt=le,Z&&ke)t:{for(Me=Kw,G=Z,B=ke,P=0,le=G;le;le=Me(le))P++;le=0;for(var _e=B;_e;_e=Me(_e))le++;for(;0<P-le;)G=Me(G),P--;for(;0<le-P;)B=Me(B),le--;for(;P--;){if(G===B||B!==null&&G===B.alternate){Me=G;break t}G=Me(G),B=Me(B)}Me=null}else Me=null;Z!==null&&qg(re,F,Z,Me,!1),ke!==null&&pt!==null&&qg(re,pt,ke,Me,!0)}}e:{if(F=Y?el(Y):window,Z=F.nodeName&&F.nodeName.toLowerCase(),Z==="select"||Z==="input"&&F.type==="file")var nt=Ya;else if(Pa(F))if(Lr)nt=dd;else{nt=gu;var Ee=Ls}else Z=F.nodeName,!Z||Z.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?Y&&Ul(Y.elementType)&&(nt=Ya):nt=cd;if(nt&&(nt=nt(t,Y))){pu(re,nt,a,ne);break e}Ee&&Ee(t,F,Y),t==="focusout"&&Y&&F.type==="number"&&Y.memoizedProps.value!=null&&Cr(F,"number",F.value)}switch(Ee=Y?el(Y):window,t){case"focusin":(Pa(Ee)||Ee.contentEditable==="true")&&(Ql=Ee,Us=Y,Ka=null);break;case"focusout":Ka=Us=Ql=null;break;case"mousedown":Bs=!0;break;case"contextmenu":case"mouseup":case"dragend":Bs=!1,ku(re,a,ne);break;case"selectionchange":if(fd)break;case"keydown":case"keyup":ku(re,a,ne)}var $e;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 Kl?Wl(t,a)&&(Ze="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ze="onCompositionStart");Ze&&(fu&&a.locale!=="ko"&&(Kl||Ze!=="onCompositionStart"?Ze==="onCompositionEnd"&&Kl&&($e=As()):(li=ne,Li="value"in li?li.value:li.textContent,Kl=!0)),Ee=oc(Y,Ze),0<Ee.length&&(Ze=new Dr(Ze,t,null,a,ne),re.push({event:Ze,listeners:Ee}),$e?Ze.data=$e:($e=ve(a),$e!==null&&(Ze.data=$e)))),($e=rd?xn(t,a):sd(t,a))&&(Ze=oc(Y,"onBeforeInput"),0<Ze.length&&(Ee=new Dr("onBeforeInput","beforeinput",null,a,ne),re.push({event:Ee,listeners:Ze}),Ee.data=$e)),Pw(re,t,Y,a,ne)}Ug(re,n)})}function vo(t,n,a){return{instance:t,listener:n,currentTarget:a}}function oc(t,n){for(var a=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Ua(t,a),f!=null&&o.unshift(vo(t,f,h)),f=Ua(t,n),f!=null&&o.push(vo(t,f,h))),t.tag===3)return o;t=t.return}return[]}function Kw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function qg(t,n,a,o,f){for(var h=n._reactName,v=[];a!==null&&a!==o;){var A=a,L=A.alternate,Y=A.stateNode;if(A=A.tag,L!==null&&L===o)break;A!==5&&A!==26&&A!==27||Y===null||(L=Y,f?(Y=Ua(a,h),Y!=null&&v.unshift(vo(a,Y,L))):f||(Y=Ua(a,h),Y!=null&&v.push(vo(a,Y,L)))),a=a.return}v.length!==0&&t.push({event:n,listeners:v})}var Xw=/\r\n?/g,Qw=/\u0000|\uFFFD/g;function Hg(t){return(typeof t=="string"?t:""+t).replace(Xw,`
50
+ `).replace(Qw,"")}function $g(t,n){return n=Hg(n),Hg(t)===n}function ft(t,n,a,o,f,h){switch(a){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||ti(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&ti(t,""+o);break;case"className":Oa(t,"class",o);break;case"tabIndex":Oa(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Oa(t,a,o);break;case"style":Cs(t,o,h);break;case"data":if(n!=="object"){Oa(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Bl(""+o),t.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(n!=="input"&&ft(t,n,"name",f.name,f,null),ft(t,n,"formEncType",f.formEncType,f,null),ft(t,n,"formMethod",f.formMethod,f,null),ft(t,n,"formTarget",f.formTarget,f,null)):(ft(t,n,"encType",f.encType,f,null),ft(t,n,"method",f.method,f,null),ft(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(a);break}o=Bl(""+o),t.setAttribute(a,o);break;case"onClick":o!=null&&(t.onclick=yn);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}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}a=Bl(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+o):t.removeAttribute(a);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(a,""):t.removeAttribute(a);break;case"capture":case"download":o===!0?t.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(a,o):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(a,o):t.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(a):t.setAttribute(a,o);break;case"popover":Fe("beforetoggle",t),Fe("toggle",t),jr(t,"popover",o);break;case"xlinkActuate":Qt(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Qt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Qt(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Qt(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Qt(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Qt(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":jr(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ni.get(a)||a,jr(t,a,o))}}function jf(t,n,a,o,f,h){switch(a){case"style":Cs(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(a=o.__html,a!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=a}}break;case"children":typeof o=="string"?ti(t,o):(typeof o=="number"||typeof o=="bigint")&&ti(t,""+o);break;case"onScroll":o!=null&&Fe("scroll",t);break;case"onScrollEnd":o!=null&&Fe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ks.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),n=a.slice(2,f?a.length-7:void 0),h=t[zt]||null,h=h!=null?h[a]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,o,f);break e}a in t?t[a]=o:o===!0?t.setAttribute(a,""):jr(t,a,o)}}}function rn(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",t),Fe("load",t);var o=!1,f=!1,h;for(h in a)if(a.hasOwnProperty(h)){var v=a[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,h,v,a,null)}}f&&ft(t,n,"srcSet",a.srcSet,a,null),o&&ft(t,n,"src",a.src,a,null);return;case"input":Fe("invalid",t);var A=h=v=f=null,L=null,Y=null;for(o in a)if(a.hasOwnProperty(o)){var ne=a[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":L=ne;break;case"defaultChecked":Y=ne;break;case"value":h=ne;break;case"defaultValue":A=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:ft(t,n,o,ne,a,null)}}Il(t,h,A,L,Y,v,f,!1);return;case"select":Fe("invalid",t),o=v=h=null;for(f in a)if(a.hasOwnProperty(f)&&(A=a[f],A!=null))switch(f){case"value":h=A;break;case"defaultValue":v=A;break;case"multiple":o=A;default:ft(t,n,f,A,a,null)}n=h,a=v,t.multiple=!!o,n!=null?ei(t,!!o,n,!1):a!=null&&ei(t,!!o,a,!0);return;case"textarea":Fe("invalid",t),h=f=o=null;for(v in a)if(a.hasOwnProperty(v)&&(A=a[v],A!=null))switch(v){case"value":o=A;break;case"defaultValue":f=A;break;case"children":h=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:ft(t,n,v,A,a,null)}za(t,o,f,h);return;case"option":for(L in a)if(a.hasOwnProperty(L)&&(o=a[L],o!=null))switch(L){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:ft(t,n,L,o,a,null)}return;case"dialog":Fe("beforetoggle",t),Fe("toggle",t),Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":Fe("load",t);break;case"video":case"audio":for(o=0;o<bo.length;o++)Fe(bo[o],t);break;case"image":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"embed":case"source":case"link":Fe("error",t),Fe("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 a)if(a.hasOwnProperty(Y)&&(o=a[Y],o!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:ft(t,n,Y,o,a,null)}return;default:if(Ul(n)){for(ne in a)a.hasOwnProperty(ne)&&(o=a[ne],o!==void 0&&jf(t,n,ne,o,a,void 0));return}}for(A in a)a.hasOwnProperty(A)&&(o=a[A],o!=null&&ft(t,n,A,o,a,null))}function Zw(t,n,a,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,A=null,L=null,Y=null,ne=null;for(Z in a){var re=a[Z];if(a.hasOwnProperty(Z)&&re!=null)switch(Z){case"checked":break;case"value":break;case"defaultValue":L=re;default:o.hasOwnProperty(Z)||ft(t,n,Z,null,o,re)}}for(var F in o){var Z=o[F];if(re=a[F],o.hasOwnProperty(F)&&(Z!=null||re!=null))switch(F){case"type":h=Z;break;case"name":f=Z;break;case"checked":Y=Z;break;case"defaultChecked":ne=Z;break;case"value":v=Z;break;case"defaultValue":A=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,n));break;default:Z!==re&&ft(t,n,F,Z,o,re)}}Sr(t,v,A,L,Y,ne,h,f);return;case"select":Z=v=A=F=null;for(h in a)if(L=a[h],a.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":Z=L;default:o.hasOwnProperty(h)||ft(t,n,h,null,o,L)}for(f in o)if(h=o[f],L=a[f],o.hasOwnProperty(f)&&(h!=null||L!=null))switch(f){case"value":F=h;break;case"defaultValue":A=h;break;case"multiple":v=h;default:h!==L&&ft(t,n,f,h,o,L)}n=A,a=v,o=Z,F!=null?ei(t,!!a,F,!1):!!o!=!!a&&(n!=null?ei(t,!!a,n,!0):ei(t,!!a,a?[]:"",!1));return;case"textarea":Z=F=null;for(A in a)if(f=a[A],a.hasOwnProperty(A)&&f!=null&&!o.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:ft(t,n,A,null,o,f)}for(v in o)if(f=o[v],h=a[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":F=f;break;case"defaultValue":Z=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&ft(t,n,v,f,o,h)}ou(t,F,Z);return;case"option":for(var ke in a)if(F=a[ke],a.hasOwnProperty(ke)&&F!=null&&!o.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:ft(t,n,ke,null,o,F)}for(L in o)if(F=o[L],Z=a[L],o.hasOwnProperty(L)&&F!==Z&&(F!=null||Z!=null))switch(L){case"selected":t.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:ft(t,n,L,F,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 Me in a)F=a[Me],a.hasOwnProperty(Me)&&F!=null&&!o.hasOwnProperty(Me)&&ft(t,n,Me,null,o,F);for(Y in o)if(F=o[Y],Z=a[Y],o.hasOwnProperty(Y)&&F!==Z&&(F!=null||Z!=null))switch(Y){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,n));break;default:ft(t,n,Y,F,o,Z)}return;default:if(Ul(n)){for(var pt in a)F=a[pt],a.hasOwnProperty(pt)&&F!==void 0&&!o.hasOwnProperty(pt)&&jf(t,n,pt,void 0,o,F);for(ne in o)F=o[ne],Z=a[ne],!o.hasOwnProperty(ne)||F===Z||F===void 0&&Z===void 0||jf(t,n,ne,F,o,Z);return}}for(var G in a)F=a[G],a.hasOwnProperty(G)&&F!=null&&!o.hasOwnProperty(G)&&ft(t,n,G,null,o,F);for(re in o)F=o[re],Z=a[re],!o.hasOwnProperty(re)||F===Z||F==null&&Z==null||ft(t,n,re,F,o,Z)}function Gg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var f=a[o],h=f.transferSize,v=f.initiatorType,A=f.duration;if(h&&A&&Gg(v)){for(v=0,A=f.responseEnd,o+=1;o<a.length;o++){var L=a[o],Y=L.startTime;if(Y>A)break;var ne=L.transferSize,re=L.initiatorType;ne&&Gg(re)&&(L=L.responseEnd,v+=ne*(L<A?1:(A-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 Sf=null,Cf=null;function uc(t){return t.nodeType===9?t:t.ownerDocument}function Vg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Pg(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Tf(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 Ef=null;function ek(){var t=window.event;return t&&t.type==="popstate"?t===Ef?!1:(Ef=t,!0):(Ef=null,!1)}var Yg=typeof setTimeout=="function"?setTimeout:void 0,tk=typeof clearTimeout=="function"?clearTimeout:void 0,Fg=typeof Promise=="function"?Promise:void 0,nk=typeof queueMicrotask=="function"?queueMicrotask:typeof Fg<"u"?function(t){return Fg.resolve(null).then(t).catch(ik)}:Yg;function ik(t){setTimeout(function(){throw t})}function ba(t){return t==="head"}function Wg(t,n){var a=n,o=0;do{var f=a.nextSibling;if(t.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"||a==="/&"){if(o===0){t.removeChild(f),os(n);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")wo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,wo(a);for(var h=a.firstChild;h;){var v=h.nextSibling,A=h.nodeName;h[Ai]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&h.rel.toLowerCase()==="stylesheet"||a.removeChild(h),h=v}}else a==="body"&&wo(t.ownerDocument.body);a=f}while(a);os(n)}function Kg(t,n){var a=t;t=0;do{var o=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=o}while(a)}function Af(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Af(a),ws(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function lk(t,n,a,o){for(;t.nodeType===1;){var f=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ai])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=ci(t.nextSibling),t===null)break}return null}function ak(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=ci(t.nextSibling),t===null))return null;return t}function Xg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ci(t.nextSibling),t===null))return null;return t}function Nf(t){return t.data==="$?"||t.data==="$~"}function Df(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rk(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var o=function(){n(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function ci(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var _f=null;function Qg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return ci(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function Zg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function Jg(t,n,a){switch(n=uc(a),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 wo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);ws(t)}var di=new Map,ey=new Set;function cc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Tl=se.d;se.d={f:sk,r:ok,D:uk,C:ck,L:dk,m:fk,X:hk,S:pk,M:mk};function sk(){var t=Tl.f(),n=tc();return t||n}function ok(t){var n=Ni(t);n!==null&&n.tag===5&&n.type==="form"?ym(n):Tl.r(t)}var as=typeof document>"u"?null:document;function ty(t,n,a){var o=as;if(o&&typeof n=="string"&&n){var f=It(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),ey.has(f)||(ey.add(f),t={rel:t,crossOrigin:a,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),rn(n,"link",t),Ct(n),o.head.appendChild(n)))}}function uk(t){Tl.D(t),ty("dns-prefetch",t,null)}function ck(t,n){Tl.C(t,n),ty("preconnect",t,n)}function dk(t,n,a){Tl.L(t,n,a);var o=as;if(o&&t&&n){var f='link[rel="preload"][as="'+It(n)+'"]';n==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+It(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+It(a.imageSizes)+'"]')):f+='[href="'+It(t)+'"]';var h=f;switch(n){case"style":h=rs(t);break;case"script":h=ss(t)}di.has(h)||(t=x({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),di.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(ko(h))||n==="script"&&o.querySelector(jo(h))||(n=o.createElement("link"),rn(n,"link",t),Ct(n),o.head.appendChild(n)))}}function fk(t,n){Tl.m(t,n);var a=as;if(a&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+It(o)+'"][href="'+It(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=ss(t)}if(!di.has(h)&&(t=x({rel:"modulepreload",href:t},n),di.set(h,t),a.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(jo(h)))return}o=a.createElement("link"),rn(o,"link",t),Ct(o),a.head.appendChild(o)}}}function pk(t,n,a){Tl.S(t,n,a);var o=as;if(o&&t){var f=Di(o).hoistableStyles,h=rs(t);n=n||"default";var v=f.get(h);if(!v){var A={loading:0,preload:null};if(v=o.querySelector(ko(h)))A.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},a),(a=di.get(h))&&Rf(t,a);var L=v=o.createElement("link");Ct(L),rn(L,"link",t),L._p=new Promise(function(Y,ne){L.onload=Y,L.onerror=ne}),L.addEventListener("load",function(){A.loading|=1}),L.addEventListener("error",function(){A.loading|=2}),A.loading|=4,dc(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:A},f.set(h,v)}}}function hk(t,n){Tl.X(t,n);var a=as;if(a&&t){var o=Di(a).hoistableScripts,f=ss(t),h=o.get(f);h||(h=a.querySelector(jo(f)),h||(t=x({src:t,async:!0},n),(n=di.get(f))&&Mf(t,n),h=a.createElement("script"),Ct(h),rn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function mk(t,n){Tl.M(t,n);var a=as;if(a&&t){var o=Di(a).hoistableScripts,f=ss(t),h=o.get(f);h||(h=a.querySelector(jo(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=di.get(f))&&Mf(t,n),h=a.createElement("script"),Ct(h),rn(h,"link",t),a.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function ny(t,n,a,o){var f=(f=X.current)?cc(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=rs(a.href),a=Di(f).hoistableStyles,o=a.get(n),o||(o={type:"style",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=rs(a.href);var h=Di(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(ko(t)))&&!h._p&&(v.instance=h,v.state.loading=5),di.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},di.set(t,a),h||gk(f,t,a,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=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ss(a),a=Di(f).hoistableScripts,o=a.get(n),o||(o={type:"script",instance:null,count:0,state:null},a.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function rs(t){return'href="'+It(t)+'"'}function ko(t){return'link[rel="stylesheet"]['+t+"]"}function iy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function gk(t,n,a,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),rn(n,"link",a),Ct(n),t.head.appendChild(n))}function ss(t){return'[src="'+It(t)+'"]'}function jo(t){return"script[async]"+t}function ly(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+It(a.href)+'"]');if(o)return n.instance=o,Ct(o),o;var f=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ct(o),rn(o,"style",f),dc(o,a.precedence,t),n.instance=o;case"stylesheet":f=rs(a.href);var h=t.querySelector(ko(f));if(h)return n.state.loading|=4,n.instance=h,Ct(h),h;o=iy(a),(f=di.get(f))&&Rf(o,f),h=(t.ownerDocument||t).createElement("link"),Ct(h);var v=h;return v._p=new Promise(function(A,L){v.onload=A,v.onerror=L}),rn(h,"link",o),n.state.loading|=4,dc(h,a.precedence,t),n.instance=h;case"script":return h=ss(a.src),(f=t.querySelector(jo(h)))?(n.instance=f,Ct(f),f):(o=a,(f=di.get(h))&&(o=x({},a),Mf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Ct(f),rn(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,dc(o,a.precedence,t));return n.instance}function dc(t,n,a){for(var o=a.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 A=o[v];if(A.dataset.precedence===n)h=A;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function Rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Mf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var fc=null;function ay(t,n,a){if(fc===null){var o=new Map,f=fc=new Map;f.set(a,o)}else f=fc,o=f.get(a),o||(o=new Map,f.set(a,o));if(o.has(t))return o;for(o.set(t,null),a=a.getElementsByTagName(t),f=0;f<a.length;f++){var h=a[f];if(!(h[Ai]||h[Yt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var A=o.get(v);A?A.push(h):o.set(v,[h])}}return o}function ry(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function yk(t,n,a){if(a===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 sy(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function xk(t,n,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=rs(o.href),h=n.querySelector(ko(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=pc.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=h,Ct(h);return}h=n.ownerDocument||n,o=iy(o),(f=di.get(f))&&Rf(o,f),h=h.createElement("link"),Ct(h);var v=h;v._p=new Promise(function(A,L){v.onload=A,v.onerror=L}),rn(h,"link",o),a.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=pc.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var Of=0;function bk(t,n){return t.stylesheets&&t.count===0&&mc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var o=setTimeout(function(){if(t.stylesheets&&mc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Of===0&&(Of=62500*Jw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&mc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Of?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)mc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var hc=null;function mc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,hc=new Map,n.forEach(vk,t),hc=null,pc.call(t))}function vk(t,n){if(!(n.state.loading&4)){var a=hc.get(t);if(a)var o=a.get(null);else{a=new Map,hc.set(t,a);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")&&(a.set(v.dataset.precedence,v),o=v)}o&&a.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=a.get(v)||o,h===o&&a.set(null,f),a.set(v,f),this.count++,o=pc.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 So={$$typeof:$,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function wk(t,n,a,o,f,h,v,A,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=Ji(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ji(0),this.hiddenUpdates=Ji(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 oy(t,n,a,o,f,h,v,A,L,Y,ne,re){return t=new wk(t,n,a,v,L,Y,ne,re,A),n=1,h===!0&&(n|=24),h=cn(3,null,null,n),t.current=h,h.stateNode=t,n=Vr(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:a,cache:n},gd(h),t}function uy(t){return t?(t=ea,t):ea}function cy(t,n,a,o,f,h){f=uy(f),o.context===null?o.context=f:o.pendingContext=f,o=oa(n),o.payload={element:a},h=h===void 0?null:h,h!==null&&(o.callback=h),a=ua(t,o,n),a!==null&&(Ln(a,t,n),to(a,t,n))}function dy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function zf(t,n){dy(t,n),(t=t.alternate)&&dy(t,n)}function fy(t){if(t.tag===13||t.tag===31){var n=ul(t,67108864);n!==null&&Ln(n,t,67108864),zf(t,67108864)}}function py(t){if(t.tag===13||t.tag===31){var n=Fn();n=wr(n);var a=ul(t,n);a!==null&&Ln(a,t,n),zf(t,n)}}var gc=!0;function kk(t,n,a,o){var f=V.T;V.T=null;var h=se.p;try{se.p=2,Lf(t,n,a,o)}finally{se.p=h,V.T=f}}function jk(t,n,a,o){var f=V.T;V.T=null;var h=se.p;try{se.p=8,Lf(t,n,a,o)}finally{se.p=h,V.T=f}}function Lf(t,n,a,o){if(gc){var f=If(o);if(f===null)kf(t,n,o,yc,a),my(t,o);else if(Ck(f,t,n,a,o))o.stopPropagation();else if(my(t,o),n&4&&-1<Sk.indexOf(t)){for(;f!==null;){var h=Ni(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=Ti(h.pendingLanes);if(v!==0){var A=h;for(A.pendingLanes|=2,A.entangledLanes|=2;v;){var L=1<<31-rt(v);A.entanglements[1]|=L,v&=~L}Wi(h),(at&6)===0&&(Ju=At()+500,xo(0))}}break;case 31:case 13:A=ul(h,2),A!==null&&Ln(A,h,2),tc(),zf(h,2)}if(h=If(o),h===null&&kf(t,n,o,yc,a),h===f)break;f=h}f!==null&&o.stopPropagation()}else kf(t,n,o,null,a)}}function If(t){return t=Ia(t),Uf(t)}var yc=null;function Uf(t){if(yc=null,t=Jn(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=d(n),t!==null)return t;t=null}else if(a===31){if(t=p(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return yc=t,null}function hy(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(Dl()){case ie:return 2;case ce:return 8;case Ce:case Ie:return 32;case Xe:return 268435456;default:return 32}default:return 32}}var Bf=!1,va=null,wa=null,ka=null,Co=new Map,To=new Map,ja=[],Sk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function my(t,n){switch(t){case"focusin":case"focusout":va=null;break;case"dragenter":case"dragleave":wa=null;break;case"mouseover":case"mouseout":ka=null;break;case"pointerover":case"pointerout":Co.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":To.delete(n.pointerId)}}function Eo(t,n,a,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:a,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=Ni(n),n!==null&&fy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function Ck(t,n,a,o,f){switch(n){case"focusin":return va=Eo(va,t,n,a,o,f),!0;case"dragenter":return wa=Eo(wa,t,n,a,o,f),!0;case"mouseover":return ka=Eo(ka,t,n,a,o,f),!0;case"pointerover":var h=f.pointerId;return Co.set(h,Eo(Co.get(h)||null,t,n,a,o,f)),!0;case"gotpointercapture":return h=f.pointerId,To.set(h,Eo(To.get(h)||null,t,n,a,o,f)),!0}return!1}function gy(t){var n=Jn(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){t.blockedOn=n,nu(t.priority,function(){py(a)});return}}else if(n===31){if(n=p(a),n!==null){t.blockedOn=n,nu(t.priority,function(){py(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function xc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=If(t.nativeEvent);if(a===null){a=t.nativeEvent;var o=new a.constructor(a.type,a);La=o,a.target.dispatchEvent(o),La=null}else return n=Ni(a),n!==null&&fy(n),t.blockedOn=a,!1;n.shift()}return!0}function yy(t,n,a){xc(t)&&a.delete(n)}function Tk(){Bf=!1,va!==null&&xc(va)&&(va=null),wa!==null&&xc(wa)&&(wa=null),ka!==null&&xc(ka)&&(ka=null),Co.forEach(yy),To.forEach(yy)}function bc(t,n){t.blockedOn===n&&(t.blockedOn=null,Bf||(Bf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Tk)))}var vc=null;function xy(t){vc!==t&&(vc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vc===t&&(vc=null);for(var n=0;n<t.length;n+=3){var a=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(Uf(o||a)===null)continue;break}var h=Ni(a);h!==null&&(t.splice(n,3),n-=3,Ld(h,{pending:!0,data:f,method:a.method,action:o},o,f))}}))}function os(t){function n(L){return bc(L,t)}va!==null&&bc(va,t),wa!==null&&bc(wa,t),ka!==null&&bc(ka,t),Co.forEach(n),To.forEach(n);for(var a=0;a<ja.length;a++){var o=ja[a];o.blockedOn===t&&(o.blockedOn=null)}for(;0<ja.length&&(a=ja[0],a.blockedOn===null);)gy(a),a.blockedOn===null&&ja.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var f=a[o],h=a[o+1],v=f[zt]||null;if(typeof h=="function")v||xy(a);else if(v){var A=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[zt]||null)A=v.formAction;else if(Uf(f)!==null)continue}else A=v.action;typeof A=="function"?a[o+1]=A:(a.splice(o,3),o-=3),xy(a)}}}function by(){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(a,20)}function a(){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(a,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function qf(t){this._internalRoot=t}wc.prototype.render=qf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,o=Fn();cy(a,o,t,n,null,null)},wc.prototype.unmount=qf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;cy(t.current,2,null,t,null,null),tc(),n[qn]=null}};function wc(t){this._internalRoot=t}wc.prototype.unstable_scheduleHydration=function(t){if(t){var n=vs();t={blockedOn:null,target:t,priority:n};for(var a=0;a<ja.length&&n!==0&&n<ja[a].priority;a++);ja.splice(a,0,t),a===0&&gy(t)}};var vy=i.version;if(vy!=="19.2.7")throw Error(r(527,vy,"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 Ek={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var kc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kc.isDisabled&&kc.supportsFiber)try{Pt=kc.inject(Ek),St=kc}catch{}}return No.createRoot=function(t,n){if(!u(t))throw Error(r(299));var a=!1,o="",f=Em,h=Am,v=Nm;return n!=null&&(n.unstable_strictMode===!0&&(a=!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=oy(t,1,!1,null,null,a,o,null,f,h,v,by),t[qn]=n.current,wf(t),new qf(n)},No.hydrateRoot=function(t,n,a){if(!u(t))throw Error(r(299));var o=!1,f="",h=Em,v=Am,A=Nm,L=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(h=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(A=a.onRecoverableError),a.formState!==void 0&&(L=a.formState)),n=oy(t,1,!0,n,a??null,o,f,L,h,v,A,by),n.context=uy(null),a=n.current,o=Fn(),o=wr(o),f=oa(o),f.callback=null,ua(a,f,o),a=o,n.current.lanes=a,Ra(n,a),Wi(n),t[qn]=n.current,wf(t),new wc(n)},No.version="19.2.7",No}var _y;function Hk(){if(_y)return Gf.exports;_y=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Gf.exports=qk(),Gf.exports}var $k=Hk();function Gk(e,i){const l=i||{};return(e[e.length-1]===""?[...e,""]:e).join((l.padRight?" ":"")+","+(l.padLeft===!1?"":" ")).trim()}const Vk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yk={};function Ry(e,i){return(Yk.jsx?Pk:Vk).test(e)}const Fk=/[ \t\n\f\r]/g;function Wk(e){return typeof e=="object"?e.type==="text"?My(e.value):!1:My(e)}function My(e){return e.replace(Fk,"")===""}class Zo{constructor(i,l,r){this.normal=l,this.property=i,r&&(this.space=r)}}Zo.prototype.normal={};Zo.prototype.property={};Zo.prototype.space=void 0;function fb(e,i){const l={},r={};for(const u of e)Object.assign(l,u.property),Object.assign(r,u.normal);return new Zo(l,r,i)}function Rp(e){return e.toLowerCase()}class Bn{constructor(i,l){this.attribute=l,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 Kk=0;const Le=yr(),$t=yr(),Mp=yr(),fe=yr(),mt=yr(),pr=yr(),Wn=yr();function yr(){return 2**++Kk}const Op=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:$t,commaOrSpaceSeparated:Wn,commaSeparated:pr,number:fe,overloadedBoolean:Mp,spaceSeparated:mt},Symbol.toStringTag,{value:"Module"})),Ff=Object.keys(Op);class lh extends Bn{constructor(i,l,r,u){let c=-1;if(super(i,l),Oy(this,"space",u),typeof r=="number")for(;++c<Ff.length;){const d=Ff[c];Oy(this,Ff[c],(r&Op[d])===Op[d])}}}lh.prototype.defined=!0;function Oy(e,i,l){l&&(e[i]=l)}function gs(e){const i={},l={};for(const[r,u]of Object.entries(e.properties)){const c=new lh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,l[Rp(r)]=r,l[Rp(c.attribute)]=r}return new Zo(i,l,e.space)}const pb=gs({properties:{ariaActiveDescendant:null,ariaAtomic:$t,ariaAutoComplete:null,ariaBusy:$t,ariaChecked:$t,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:mt,ariaCurrent:null,ariaDescribedBy:mt,ariaDetails:null,ariaDisabled:$t,ariaDropEffect:mt,ariaErrorMessage:null,ariaExpanded:$t,ariaFlowTo:mt,ariaGrabbed:$t,ariaHasPopup:null,ariaHidden:$t,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mt,ariaLevel:fe,ariaLive:null,ariaModal:$t,ariaMultiLine:$t,ariaMultiSelectable:$t,ariaOrientation:null,ariaOwns:mt,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:$t,ariaReadOnly:$t,ariaRelevant:null,ariaRequired:$t,ariaRoleDescription:mt,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:$t,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function hb(e,i){return i in e?e[i]:i}function mb(e,i){return hb(e,i.toLowerCase())}const Xk=gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pr,acceptCharset:mt,accessKey:mt,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alpha:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:mt,autoFocus:Le,autoPlay:Le,blocking:mt,capture:null,charSet:null,checked:Le,cite:null,className:mt,closedBy:null,colorSpace:null,cols:fe,colSpan:fe,command:null,commandFor:null,content:null,contentEditable:$t,controls:Le,controlsList:mt,coords:fe|pr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:Mp,draggable:$t,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:mt,height:fe,hidden:Mp,high:fe,href:null,hrefLang:null,htmlFor:mt,httpEquiv:mt,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:mt,itemRef:mt,itemScope:Le,itemType:mt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:fe,pattern:null,ping:mt,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:mt,required:Le,reversed:Le,rows:fe,rowSpan:fe,sandbox:mt,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootCustomElementRegistry:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shadowRootSerializable:Le,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:$t,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:$t,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mt,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:$t,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Le,disablePictureInPicture:Le,disableRemotePlayback:Le,exportParts:pr,part:mt,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:mb}),Qk=gs({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:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:mt,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:pr,g2:pr,glyphName:pr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,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:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hb}),gb=gs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),yb=gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mb}),xb=gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Zk={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Jk=/[A-Z]/g,zy=/-[a-z]/g,ej=/^data[-\w.:]+$/i;function tj(e,i){const l=Rp(i);let r=i,u=Bn;if(l in e.normal)return e.property[e.normal[l]];if(l.length>4&&l.slice(0,4)==="data"&&ej.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(zy,ij);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!zy.test(c)){let d=c.replace(Jk,nj);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=lh}return new u(r,i)}function nj(e){return"-"+e.toLowerCase()}function ij(e){return e.charAt(1).toUpperCase()}const lj=fb([pb,Xk,gb,yb,xb],"html"),ah=fb([pb,Qk,gb,yb,xb],"svg");function aj(e){return e.join(" ").trim()}var us={},Wf,Ly;function rj(){if(Ly)return Wf;Ly=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
51
+ `,m="/",b="*",x="",j="comment",w="declaration";function E(I,N){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];N=N||{};var H=1,$=1;function W(ge){var ue=ge.match(i);ue&&(H+=ue.length);var V=ge.lastIndexOf(g);$=~V?ge.length-V:$+ge.length}function oe(){var ge={line:H,column:$};return function(ue){return ue.position=new _(ge),ee(),ue}}function _(ge){this.start=ge,this.end={line:H,column:$},this.source=N.source}_.prototype.content=I;function K(ge){var ue=new Error(N.source+":"+H+":"+$+": "+ge);if(ue.reason=ge,ue.filename=N.source,ue.line=H,ue.column=$,ue.source=I,!N.silent)throw ue}function ae(ge){var ue=ge.exec(I);if(ue){var V=ue[0];return W(V),I=I.slice(V.length),ue}}function ee(){ae(l)}function z(ge){var ue;for(ge=ge||[];ue=te();)ue!==!1&&ge.push(ue);return ge}function te(){var ge=oe();if(!(m!=I.charAt(0)||b!=I.charAt(1))){for(var ue=2;x!=I.charAt(ue)&&(b!=I.charAt(ue)||m!=I.charAt(ue+1));)++ue;if(ue+=2,x===I.charAt(ue-1))return K("End of comment missing");var V=I.slice(2,ue-2);return $+=2,W(V),I=I.slice(ue),$+=2,ge({type:j,comment:V})}}function de(){var ge=oe(),ue=ae(r);if(ue){if(te(),!ae(u))return K("property missing ':'");var V=ae(c),se=ge({type:w,property:M(ue[0].replace(e,x)),value:V?M(V[0].replace(e,x)):x});return ae(d),se}}function Ae(){var ge=[];z(ge);for(var ue;ue=de();)ue!==!1&&(ge.push(ue),z(ge));return ge}return ee(),Ae()}function M(I){return I?I.replace(p,x):x}return Wf=E,Wf}var Iy;function sj(){if(Iy)return us;Iy=1;var e=us&&us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(us,"__esModule",{value:!0}),us.default=l;const i=e(rj());function l(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return us}var Do={},Uy;function oj(){if(Uy)return Do;Uy=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||l.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return Do.camelCase=g,Do}var _o,By;function uj(){if(By)return _o;By=1;var e=_o&&_o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(sj()),l=oj();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,l.camelCase)(p,c)]=g)}),d}return r.default=r,_o=r,_o}var cj=uj();const dj=db(cj),bb=vb("end"),rh=vb("start");function vb(e){return i;function i(l){const r=l&&l.position&&l.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fj(e){const i=rh(e),l=bb(e);if(i&&l)return{start:i,end:l}}function $o(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qy(e.position):"start"in e||"end"in e?qy(e):"line"in e||"column"in e?zp(e):""}function zp(e){return Hy(e&&e.line)+":"+Hy(e&&e.column)}function qy(e){return zp(e&&e.start)+"-"+zp(e&&e.end)}function Hy(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(i,l,r){super(),typeof l=="string"&&(r=l,l=void 0);let u="",c={},d=!1;if(l&&("line"in l&&"column"in l?c={place:l}:"start"in l&&"end"in l?c={place:l}:"type"in l?c={ancestors:[l],place:l.position}:c={...l}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=$o(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const sh={}.hasOwnProperty,pj=new Map,hj=/[A-Z]/g,mj=new Set(["table","tbody","thead","tfoot","tr"]),gj=new Set(["td","th"]),wb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yj(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const l=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Cj(l,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Sj(l,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:l,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ah:lj,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=kb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function kb(e,i,l){if(i.type==="element")return xj(e,i,l);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return bj(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return wj(e,i,l);if(i.type==="mdxjsEsm")return vj(e,i);if(i.type==="root")return kj(e,i,l);if(i.type==="text")return jj(e,i)}function xj(e,i,l){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=ah,e.schema=u),e.ancestors.push(i);const c=Sb(e,i.tagName,!1),d=Tj(e,i);let p=uh(e,i);return mj.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Wk(g):!0})),jb(e,d,c,i),oh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function bj(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Xo(e,i.position)}function vj(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Xo(e,i.position)}function wj(e,i,l){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=ah,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:Sb(e,i.name,!0),d=Ej(e,i),p=uh(e,i);return jb(e,d,c,i),oh(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,l)}function kj(e,i,l){const r={};return oh(r,uh(e,i)),e.create(i,e.Fragment,r,l)}function jj(e,i){return i.value}function jb(e,i,l,r){typeof l!="string"&&l!==e.Fragment&&e.passNode&&(i.node=r)}function oh(e,i){if(i.length>0){const l=i.length>1?i:i[0];l&&(e.children=l)}}function Sj(e,i,l){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?l:i;return p?m(c,d,p):m(c,d)}}function Cj(e,i){return l;function l(r,u,c,d){const p=Array.isArray(c.children),g=rh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function Tj(e,i){const l={};let r,u;for(u in i.properties)if(u!=="children"&&sh.call(i.properties,u)){const c=Aj(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&gj.has(i.tagName)?r=p:l[d]=p}}if(r){const c=l.style||(l.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return l}function Ej(e,i){const l={};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(l,e.evaluater.evaluateExpression(p.argument))}else Xo(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 Xo(e,i.position);else c=r.value===null?!0:r.value;l[u]=c}return l}function uh(e,i){const l=[];let r=-1;const u=e.passKeys?new Map:pj;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=kb(e,c,d);p!==void 0&&l.push(p)}return l}function Aj(e,i,l){const r=tj(e.schema,i);if(!(l==null||typeof l=="number"&&Number.isNaN(l))){if(Array.isArray(l)&&(l=r.commaSeparated?Gk(l):aj(l)),r.property==="style"){let u=typeof l=="object"?l:Nj(e,String(l));return e.stylePropertyNameCase==="css"&&(u=Dj(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Zk[r.property]||r.property:r.attribute,l]}}function Nj(e,i){try{return dj(i,{reactCompat:!0})}catch(l){if(e.ignoreInvalidStyle)return{};const r=l,u=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=wb+"#cannot-parse-style-attribute",u}}function Sb(e,i,l){let r;if(!l)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Ry(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=Ry(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return sh.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);Xo(e)}function Xo(e,i){const l=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=wb+"#cannot-handle-mdx-estrees-without-createevaluater",l}function Dj(e){const i={};let l;for(l in e)sh.call(e,l)&&(i[_j(l)]=e[l]);return i}function _j(e){let i=e.replace(hj,Rj);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function Rj(e){return"-"+e.toLowerCase()}const Kf={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Mj={};function ch(e,i){const l=Mj,r=typeof l.includeImageAlt=="boolean"?l.includeImageAlt:!0,u=typeof l.includeHtml=="boolean"?l.includeHtml:!0;return Cb(e,r,u)}function Cb(e,i,l){if(Oj(e)){if("value"in e)return e.type==="html"&&!l?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $y(e.children,i,l)}return Array.isArray(e)?$y(e,i,l):""}function $y(e,i,l){const r=[];let u=-1;for(;++u<e.length;)r[u]=Cb(e[u],i,l);return r.join("")}function Oj(e){return!!(e&&typeof e=="object")}const Gy=document.createElement("i");function dh(e){const i="&"+e+";";Gy.innerHTML=i;const l=Gy.textContent;return l.charCodeAt(l.length-1)===59&&e!=="semi"||l===i?!1:l}function Kn(e,i,l,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,l=l>0?l:0,r.length<1e4)d=Array.from(r),d.unshift(i,l),e.splice(...d);else for(l&&e.splice(i,l);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function fi(e,i){return e.length>0?(Kn(e,e.length,0,i),e):i}const Vy={}.hasOwnProperty;function Tb(e){const i={};let l=-1;for(;++l<e.length;)zj(i,e[l]);return i}function zj(e,i){let l;for(l in i){const u=(Vy.call(e,l)?e[l]:void 0)||(e[l]={}),c=i[l];let d;if(c)for(d in c){Vy.call(u,d)||(u[d]=[]);const p=c[d];Lj(u[d],Array.isArray(p)?p:p?[p]:[])}}}function Lj(e,i){let l=-1;const r=[];for(;++l<i.length;)(i[l].add==="after"?e:r).push(i[l]);Kn(e,0,0,r)}function Eb(e,i){const l=Number.parseInt(e,i);return l<9||l===11||l>13&&l<32||l>126&&l<160||l>55295&&l<57344||l>64975&&l<65008||(l&65535)===65535||(l&65535)===65534||l>1114111?"�":String.fromCodePoint(l)}function ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const wn=Da(/[A-Za-z]/),hn=Da(/[\dA-Za-z]/),Ij=Da(/[#-'*+\--9=?A-Z^-~]/);function Hc(e){return e!==null&&(e<32||e===127)}const Lp=Da(/\d/),Uj=Da(/[\dA-Fa-f]/),Bj=Da(/[!-/:-@[-`{-~]/);function Re(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const Kc=Da(new RegExp("\\p{P}|\\p{S}","u")),hr=Da(/\s/);function Da(e){return i;function i(l){return l!==null&&l>-1&&e.test(String.fromCharCode(l))}}function ys(e){const i=[];let l=-1,r=0,u=0;for(;++l<e.length;){const c=e.charCodeAt(l);let d="";if(c===37&&hn(e.charCodeAt(l+1))&&hn(e.charCodeAt(l+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(l+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,l),encodeURIComponent(d)),r=l+u+1,d=""),u&&(l+=u,u=0)}return i.join("")+e.slice(r)}function tt(e,i,l,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return We(g)?(e.enter(l),p(g)):i(g)}function p(g){return We(g)&&c++<u?(e.consume(g),p):(e.exit(l),i(g))}}const qj={tokenize:Hj};function Hj(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let l;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),tt(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:l});return l&&(l.next=g),l=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Re(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const $j={tokenize:Gj},Py={tokenize:Vj};function Gj(e){const i=this,l=[];let r=0,u,c,d;return p;function p($){if(r<l.length){const W=l[r];return i.containerState=W[1],e.attempt(W[0].continuation,g,m)($)}return m($)}function g($){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&H();const W=i.events.length;let oe=W,_;for(;oe--;)if(i.events[oe][0]==="exit"&&i.events[oe][1].type==="chunkFlow"){_=i.events[oe][1].end;break}N(r);let K=W;for(;K<i.events.length;)i.events[K][1].end={..._},K++;return Kn(i.events,oe+1,0,i.events.slice(W)),i.events.length=K,m($)}return p($)}function m($){if(r===l.length){if(!u)return j($);if(u.currentConstruct&&u.currentConstruct.concrete)return E($);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(Py,b,x)($)}function b($){return u&&H(),N(r),j($)}function x($){return i.parser.lazy[i.now().line]=r!==l.length,d=i.now().offset,E($)}function j($){return i.containerState={},e.attempt(Py,w,E)($)}function w($){return r++,l.push([i.currentConstruct,i.containerState]),j($)}function E($){if($===null){u&&H(),N(0),e.consume($);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),M($)}function M($){if($===null){I(e.exit("chunkFlow"),!0),N(0),e.consume($);return}return Re($)?(e.consume($),I(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume($),M)}function I($,W){const oe=i.sliceStream($);if(W&&oe.push(null),$.previous=c,c&&(c.next=$),c=$,u.defineSkip($.start),u.write(oe),i.parser.lazy[$.start.line]){let _=u.events.length;for(;_--;)if(u.events[_][1].start.offset<d&&(!u.events[_][1].end||u.events[_][1].end.offset>d))return;const K=i.events.length;let ae=K,ee,z;for(;ae--;)if(i.events[ae][0]==="exit"&&i.events[ae][1].type==="chunkFlow"){if(ee){z=i.events[ae][1].end;break}ee=!0}for(N(r),_=K;_<i.events.length;)i.events[_][1].end={...z},_++;Kn(i.events,ae+1,0,i.events.slice(K)),i.events.length=_}}function N($){let W=l.length;for(;W-- >$;){const oe=l[W];i.containerState=oe[1],oe[0].exit.call(i,e)}l.length=$}function H(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function Vj(e,i,l){return tt(e,e.attempt(this.parser.constructs.document,i,l),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hs(e){if(e===null||gt(e)||hr(e))return 1;if(Kc(e))return 2}function Xc(e,i,l){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,l),r.push(c))}return i}const Ip={name:"attention",resolveAll:Pj,tokenize:Yj};function Pj(e,i){let l=-1,r,u,c,d,p,g,m,b;for(;++l<e.length;)if(e[l][0]==="enter"&&e[l][1].type==="attentionSequence"&&e[l][1]._close){for(r=l;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[l][1]).charCodeAt(0)){if((e[r][1]._close||e[l][1]._open)&&(e[l][1].end.offset-e[l][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[l][1].end.offset-e[l][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[l][1].end.offset-e[l][1].start.offset>1?2:1;const x={...e[r][1].end},j={...e[l][1].start};Yy(x,-g),Yy(j,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[l][1].start},end:j},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[l][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[l][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=fi(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=fi(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=fi(m,Xc(i.parser.constructs.insideSpan.null,e.slice(r+1,l),i)),m=fi(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[l][1].end.offset-e[l][1].start.offset?(b=2,m=fi(m,[["enter",e[l][1],i],["exit",e[l][1],i]])):b=0,Kn(e,r-1,l-r+3,m),l=r+m.length-b-2;break}}for(l=-1;++l<e.length;)e[l][1].type==="attentionSequence"&&(e[l][1].type="data");return e}function Yj(e,i){const l=this.parser.constructs.attentionMarkers.null,r=this.previous,u=hs(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=hs(g),x=!b||b===2&&u||l.includes(g),j=!u||u===2&&b||l.includes(r);return m._open=!!(c===42?x:x&&(u||!j)),m._close=!!(c===42?j:j&&(b||!x)),i(g)}}function Yy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const Fj={name:"autolink",tokenize:Wj};function Wj(e,i,l){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 wn(w)?(e.consume(w),d):w===64?l(w):m(w)}function d(w){return w===43||w===45||w===46||hn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||hn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Hc(w)?l(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):Ij(w)?(e.consume(w),m):l(w)}function b(w){return hn(w)?x(w):l(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):j(w)}function j(w){if((w===45||hn(w))&&r++<63){const E=w===45?j:x;return e.consume(w),E}return l(w)}}const Jo={partial:!0,tokenize:Kj};function Kj(e,i,l){return r;function r(c){return We(c)?tt(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Re(c)?i(c):l(c)}}const Ab={continuation:{tokenize:Qj},exit:Zj,name:"blockQuote",tokenize:Xj};function Xj(e,i,l){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 l(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 Qj(e,i,l){const r=this;return u;function u(d){return We(d)?tt(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Ab,i,l)(d)}}function Zj(e){e.exit("blockQuote")}const Nb={name:"characterEscape",tokenize:Jj};function Jj(e,i,l){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return Bj(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):l(c)}}const Db={name:"characterReference",tokenize:eS};function eS(e,i,l){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=hn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=Uj,b):(e.enter("characterReferenceValue"),c=7,d=Lp,b(x))}function b(x){if(x===59&&u){const j=e.exit("characterReferenceValue");return d===hn&&!dh(r.sliceSerialize(j))?l(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):l(x)}}const Fy={partial:!0,tokenize:nS},Wy={concrete:!0,name:"codeFenced",tokenize:tS};function tS(e,i,l){const r=this,u={partial:!0,tokenize:oe};let c=0,d=0,p;return g;function g(_){return m(_)}function m(_){const K=r.events[r.events.length-1];return c=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,p=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(_)}function b(_){return _===p?(d++,e.consume(_),b):d<3?l(_):(e.exit("codeFencedFenceSequence"),We(_)?tt(e,x,"whitespace")(_):x(_))}function x(_){return _===null||Re(_)?(e.exit("codeFencedFence"),r.interrupt?i(_):e.check(Fy,M,W)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),j(_))}function j(_){return _===null||Re(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(_)):We(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tt(e,w,"whitespace")(_)):_===96&&_===p?l(_):(e.consume(_),j)}function w(_){return _===null||Re(_)?x(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(_))}function E(_){return _===null||Re(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(_)):_===96&&_===p?l(_):(e.consume(_),E)}function M(_){return e.attempt(u,W,I)(_)}function I(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),N}function N(_){return c>0&&We(_)?tt(e,H,"linePrefix",c+1)(_):H(_)}function H(_){return _===null||Re(_)?e.check(Fy,M,W)(_):(e.enter("codeFlowValue"),$(_))}function $(_){return _===null||Re(_)?(e.exit("codeFlowValue"),H(_)):(e.consume(_),$)}function W(_){return e.exit("codeFenced"),i(_)}function oe(_,K,ae){let ee=0;return z;function z(ue){return _.enter("lineEnding"),_.consume(ue),_.exit("lineEnding"),te}function te(ue){return _.enter("codeFencedFence"),We(ue)?tt(_,de,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ue):de(ue)}function de(ue){return ue===p?(_.enter("codeFencedFenceSequence"),Ae(ue)):ae(ue)}function Ae(ue){return ue===p?(ee++,_.consume(ue),Ae):ee>=d?(_.exit("codeFencedFenceSequence"),We(ue)?tt(_,ge,"whitespace")(ue):ge(ue)):ae(ue)}function ge(ue){return ue===null||Re(ue)?(_.exit("codeFencedFence"),K(ue)):ae(ue)}}}function nS(e,i,l){const r=this;return u;function u(d){return d===null?l(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}const Xf={name:"codeIndented",tokenize:lS},iS={partial:!0,tokenize:aS};function lS(e,i,l){const r=this;return u;function u(m){return e.enter("codeIndented"),tt(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):l(m)}function d(m){return m===null?g(m):Re(m)?e.attempt(iS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Re(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function aS(e,i,l){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?l(d):Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):tt(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Re(d)?u(d):l(d)}}const rS={name:"codeText",previous:oS,resolve:sS,tokenize:uS};function sS(e){let i=e.length-4,l=3,r,u;if((e[l][1].type==="lineEnding"||e[l][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=l;++r<i;)if(e[r][1].type==="codeTextData"){e[l][1].type="codeTextPadding",e[i][1].type="codeTextPadding",l+=2,i-=2;break}}for(r=l-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function oS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uS(e,i,l){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?l(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Re(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Re(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class cS{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,l){const r=l??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,l,r){const u=l||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&Ro(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),Ro(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),Ro(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 l=this.left.splice(i,Number.POSITIVE_INFINITY);Ro(this.right,l.reverse())}else{const l=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);Ro(this.left,l.reverse())}}}function Ro(e,i){let l=0;if(i.length<1e4)e.push(...i);else for(;l<i.length;)e.push(...i.slice(l,l+1e4)),l+=1e4}function _b(e){const i={};let l=-1,r,u,c,d,p,g,m;const b=new cS(e);for(;++l<b.length;){for(;l in i;)l=i[l];if(r=b.get(l),l&&r[1].type==="chunkFlow"&&b.get(l-1)[1].type==="listItemPrefix"&&(g=r[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,dS(b,l)),l=i[l],m=!0);else if(r[1]._container){for(c=l,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,l),p.unshift(r),b.splice(u,l-u+1,p))}}return Kn(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function dS(e,i){const l=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=l._tokenizer;d||(d=r.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,j=-1,w=l,E=0,M=0;const I=[M];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=l;++j<p.length;)p[j][0]==="exit"&&p[j-1][0]==="enter"&&p[j][1].type===p[j-1][1].type&&p[j][1].start.line!==p[j][1].end.line&&(M=j+1,I.push(M),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):I.pop(),j=I.length;j--;){const N=p.slice(I[j],I[j+1]),H=c.pop();g.push([H,H+N.length-1]),e.splice(H,2,N)}for(g.reverse(),j=-1;++j<g.length;)m[E+g[j][0]]=E+g[j][1],E+=g[j][1]-g[j][0]-1;return m}const fS={resolve:hS,tokenize:mS},pS={partial:!0,tokenize:gS};function hS(e){return _b(e),e}function mS(e,i){let l;return r;function r(p){return e.enter("content"),l=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Re(p)?e.check(pS,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),l.next=e.enter("chunkContent",{contentType:"content",previous:l}),l=l.next,u}}function gS(e,i,l){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),tt(e,c,"linePrefix")}function c(d){if(d===null||Re(d))return l(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,l,i)(d)}}function Rb(e,i,l,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(N){return N===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(N),e.exit(c),j):N===null||N===32||N===41||Hc(N)?l(N):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),M(N))}function j(N){return N===62?(e.enter(c),e.consume(N),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(N))}function w(N){return N===62?(e.exit("chunkString"),e.exit(p),j(N)):N===null||N===60||Re(N)?l(N):(e.consume(N),N===92?E:w)}function E(N){return N===60||N===62||N===92?(e.consume(N),w):w(N)}function M(N){return!b&&(N===null||N===41||gt(N))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(N)):b<m&&N===40?(e.consume(N),b++,M):N===41?(e.consume(N),b--,M):N===null||N===32||N===40||Hc(N)?l(N):(e.consume(N),N===92?I:M)}function I(N){return N===40||N===41||N===92?(e.consume(N),M):M(N)}}function Mb(e,i,l,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?l(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Re(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||Re(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!We(w)),w===92?j:x)}function j(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Ob(e,i,l,r,u,c){let d;return p;function p(j){return j===34||j===39||j===40?(e.enter(r),e.enter(u),e.consume(j),e.exit(u),d=j===40?41:j,g):l(j)}function g(j){return j===d?(e.enter(u),e.consume(j),e.exit(u),e.exit(r),i):(e.enter(c),m(j))}function m(j){return j===d?(e.exit(c),g(d)):j===null?l(j):Re(j)?(e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),tt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(j))}function b(j){return j===d||j===null||Re(j)?(e.exit("chunkString"),m(j)):(e.consume(j),j===92?x:b)}function x(j){return j===d||j===92?(e.consume(j),b):b(j)}}function Go(e,i){let l;return r;function r(u){return Re(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l=!0,r):We(u)?tt(e,r,l?"linePrefix":"lineSuffix")(u):i(u)}}const yS={name:"definition",tokenize:bS},xS={partial:!0,tokenize:vS};function bS(e,i,l){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return Mb.call(r,e,p,l,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):l(w)}function g(w){return gt(w)?Go(e,m)(w):m(w)}function m(w){return Rb(e,b,l,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(xS,x,x)(w)}function x(w){return We(w)?tt(e,j,"whitespace")(w):j(w)}function j(w){return w===null||Re(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):l(w)}}function vS(e,i,l){return r;function r(p){return gt(p)?Go(e,u)(p):l(p)}function u(p){return Ob(e,c,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return We(p)?tt(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Re(p)?i(p):l(p)}}const wS={name:"hardBreakEscape",tokenize:kS};function kS(e,i,l){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Re(c)?(e.exit("hardBreakEscape"),i(c)):l(c)}}const jS={name:"headingAtx",resolve:SS,tokenize:CS};function SS(e,i){let l=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),l-2>r&&e[l][1].type==="whitespace"&&(l-=2),e[l][1].type==="atxHeadingSequence"&&(r===l-1||l-4>r&&e[l-2][1].type==="whitespace")&&(l-=r+1===l?2:4),l>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[l][1].end},c={type:"chunkText",start:e[r][1].start,end:e[l][1].end,contentType:"text"},Kn(e,r,l-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function CS(e,i,l){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||gt(b)?(e.exit("atxHeadingSequence"),p(b)):l(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Re(b)?(e.exit("atxHeading"),i(b)):We(b)?tt(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||gt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const TS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ky=["pre","script","style","textarea"],ES={concrete:!0,name:"htmlFlow",resolveTo:DS,tokenize:_S},AS={partial:!0,tokenize:MS},NS={partial:!0,tokenize:RS};function DS(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 _S(e,i,l){const r=this;let u,c,d,p,g;return m;function m(T){return b(T)}function b(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),x}function x(T){return T===33?(e.consume(T),j):T===47?(e.consume(T),c=!0,M):T===63?(e.consume(T),u=3,r.interrupt?i:O):wn(T)?(e.consume(T),d=String.fromCharCode(T),I):l(T)}function j(T){return T===45?(e.consume(T),u=2,w):T===91?(e.consume(T),u=5,p=0,E):wn(T)?(e.consume(T),u=4,r.interrupt?i:O):l(T)}function w(T){return T===45?(e.consume(T),r.interrupt?i:O):l(T)}function E(T){const Q="CDATA[";return T===Q.charCodeAt(p++)?(e.consume(T),p===Q.length?r.interrupt?i:de:E):l(T)}function M(T){return wn(T)?(e.consume(T),d=String.fromCharCode(T),I):l(T)}function I(T){if(T===null||T===47||T===62||gt(T)){const Q=T===47,me=d.toLowerCase();return!Q&&!c&&Ky.includes(me)?(u=1,r.interrupt?i(T):de(T)):TS.includes(d.toLowerCase())?(u=6,Q?(e.consume(T),N):r.interrupt?i(T):de(T)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?l(T):c?H(T):$(T))}return T===45||hn(T)?(e.consume(T),d+=String.fromCharCode(T),I):l(T)}function N(T){return T===62?(e.consume(T),r.interrupt?i:de):l(T)}function H(T){return We(T)?(e.consume(T),H):z(T)}function $(T){return T===47?(e.consume(T),z):T===58||T===95||wn(T)?(e.consume(T),W):We(T)?(e.consume(T),$):z(T)}function W(T){return T===45||T===46||T===58||T===95||hn(T)?(e.consume(T),W):oe(T)}function oe(T){return T===61?(e.consume(T),_):We(T)?(e.consume(T),oe):$(T)}function _(T){return T===null||T===60||T===61||T===62||T===96?l(T):T===34||T===39?(e.consume(T),g=T,K):We(T)?(e.consume(T),_):ae(T)}function K(T){return T===g?(e.consume(T),g=null,ee):T===null||Re(T)?l(T):(e.consume(T),K)}function ae(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||gt(T)?oe(T):(e.consume(T),ae)}function ee(T){return T===47||T===62||We(T)?$(T):l(T)}function z(T){return T===62?(e.consume(T),te):l(T)}function te(T){return T===null||Re(T)?de(T):We(T)?(e.consume(T),te):l(T)}function de(T){return T===45&&u===2?(e.consume(T),V):T===60&&u===1?(e.consume(T),se):T===62&&u===4?(e.consume(T),S):T===63&&u===3?(e.consume(T),O):T===93&&u===5?(e.consume(T),De):Re(T)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(AS,q,Ae)(T)):T===null||Re(T)?(e.exit("htmlFlowData"),Ae(T)):(e.consume(T),de)}function Ae(T){return e.check(NS,ge,q)(T)}function ge(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),ue}function ue(T){return T===null||Re(T)?Ae(T):(e.enter("htmlFlowData"),de(T))}function V(T){return T===45?(e.consume(T),O):de(T)}function se(T){return T===47?(e.consume(T),d="",ye):de(T)}function ye(T){if(T===62){const Q=d.toLowerCase();return Ky.includes(Q)?(e.consume(T),S):de(T)}return wn(T)&&d.length<8?(e.consume(T),d+=String.fromCharCode(T),ye):de(T)}function De(T){return T===93?(e.consume(T),O):de(T)}function O(T){return T===62?(e.consume(T),S):T===45&&u===2?(e.consume(T),O):de(T)}function S(T){return T===null||Re(T)?(e.exit("htmlFlowData"),q(T)):(e.consume(T),S)}function q(T){return e.exit("htmlFlow"),i(T)}}function RS(e,i,l){const r=this;return u;function u(d){return Re(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):l(d)}function c(d){return r.parser.lazy[r.now().line]?l(d):i(d)}}function MS(e,i,l){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Jo,i,l)}}const OS={name:"htmlText",tokenize:zS};function zS(e,i,l){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),oe):O===63?(e.consume(O),$):wn(O)?(e.consume(O),ae):l(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):wn(O)?(e.consume(O),H):l(O)}function b(O){return O===45?(e.consume(O),w):l(O)}function x(O){return O===null?l(O):O===45?(e.consume(O),j):Re(O)?(d=x,se(O)):(e.consume(O),x)}function j(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?j(O):x(O)}function E(O){const S="CDATA[";return O===S.charCodeAt(c++)?(e.consume(O),c===S.length?M:E):l(O)}function M(O){return O===null?l(O):O===93?(e.consume(O),I):Re(O)?(d=M,se(O)):(e.consume(O),M)}function I(O){return O===93?(e.consume(O),N):M(O)}function N(O){return O===62?V(O):O===93?(e.consume(O),N):M(O)}function H(O){return O===null||O===62?V(O):Re(O)?(d=H,se(O)):(e.consume(O),H)}function $(O){return O===null?l(O):O===63?(e.consume(O),W):Re(O)?(d=$,se(O)):(e.consume(O),$)}function W(O){return O===62?V(O):$(O)}function oe(O){return wn(O)?(e.consume(O),_):l(O)}function _(O){return O===45||hn(O)?(e.consume(O),_):K(O)}function K(O){return Re(O)?(d=K,se(O)):We(O)?(e.consume(O),K):V(O)}function ae(O){return O===45||hn(O)?(e.consume(O),ae):O===47||O===62||gt(O)?ee(O):l(O)}function ee(O){return O===47?(e.consume(O),V):O===58||O===95||wn(O)?(e.consume(O),z):Re(O)?(d=ee,se(O)):We(O)?(e.consume(O),ee):V(O)}function z(O){return O===45||O===46||O===58||O===95||hn(O)?(e.consume(O),z):te(O)}function te(O){return O===61?(e.consume(O),de):Re(O)?(d=te,se(O)):We(O)?(e.consume(O),te):ee(O)}function de(O){return O===null||O===60||O===61||O===62||O===96?l(O):O===34||O===39?(e.consume(O),u=O,Ae):Re(O)?(d=de,se(O)):We(O)?(e.consume(O),de):(e.consume(O),ge)}function Ae(O){return O===u?(e.consume(O),u=void 0,ue):O===null?l(O):Re(O)?(d=Ae,se(O)):(e.consume(O),Ae)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?l(O):O===47||O===62||gt(O)?ee(O):(e.consume(O),ge)}function ue(O){return O===47||O===62||gt(O)?ee(O):l(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):l(O)}function se(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ye}function ye(O){return We(O)?tt(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):De(O)}function De(O){return e.enter("htmlTextData"),d(O)}}const fh={name:"labelEnd",resolveAll:BS,resolveTo:qS,tokenize:HS},LS={tokenize:$S},IS={tokenize:GS},US={tokenize:VS};function BS(e){let i=-1;const l=[];for(;++i<e.length;){const r=e[i][1];if(l.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!==l.length&&Kn(e,0,e.length,l),e}function qS(e,i){let l=e.length,r=0,u,c,d,p;for(;l--;)if(u=e[l][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[l][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[l][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=l,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=l);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=fi(p,e.slice(c+1,c+r+3)),p=fi(p,[["enter",b,i]]),p=fi(p,Xc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=fi(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=fi(p,e.slice(d+1)),p=fi(p,[["exit",g,i]]),Kn(e,c,e.length,p),e}function HS(e,i,l){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(j){return c?c._inactive?x(j):(d=r.parser.defined.includes(ji(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(j),e.exit("labelMarker"),e.exit("labelEnd"),g):l(j)}function g(j){return j===40?e.attempt(LS,b,d?b:x)(j):j===91?e.attempt(IS,b,d?m:x)(j):d?b(j):x(j)}function m(j){return e.attempt(US,b,x)(j)}function b(j){return i(j)}function x(j){return c._balanced=!0,l(j)}}function $S(e,i,l){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return gt(x)?Go(e,c)(x):c(x)}function c(x){return x===41?b(x):Rb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return gt(x)?Go(e,g)(x):b(x)}function p(x){return l(x)}function g(x){return x===34||x===39||x===40?Ob(e,m,l,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return gt(x)?Go(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):l(x)}}function GS(e,i,l){const r=this;return u;function u(p){return Mb.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):l(p)}function d(p){return l(p)}}function VS(e,i,l){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):l(c)}}const PS={name:"labelStartImage",resolveAll:fh.resolveAll,tokenize:YS};function YS(e,i,l){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):l(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?l(p):i(p)}}const FS={name:"labelStartLink",resolveAll:fh.resolveAll,tokenize:WS};function WS(e,i,l){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?l(d):i(d)}}const Qf={name:"lineEnding",tokenize:KS};function KS(e,i){return l;function l(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tt(e,i,"linePrefix")}}const zc={name:"thematicBreak",tokenize:XS};function XS(e,i,l){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Re(m))?(e.exit("thematicBreak"),i(m)):l(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),We(m)?tt(e,p,"whitespace")(m):p(m))}}const In={continuation:{tokenize:e0},exit:n0,name:"list",tokenize:JS},QS={partial:!0,tokenize:i0},ZS={partial:!0,tokenize:t0};function JS(e,i,l){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:Lp(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(zc,l,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return l(w)}function g(w){return Lp(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):l(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Jo,r.interrupt?l:b,e.attempt(QS,j,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,j(w)}function x(w){return We(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),j):l(w)}function j(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function e0(e,i,l){const r=this;return r.containerState._closeFlow=void 0,e.check(Jo,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tt(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!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(ZS,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,tt(e,e.attempt(In,i,l),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function t0(e,i,l){const r=this;return tt(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):l(c)}}function n0(e){e.exit(this.containerState.type)}function i0(e,i,l){const r=this;return tt(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!We(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):l(c)}}const Xy={name:"setextUnderline",resolveTo:l0,tokenize:a0};function l0(e,i){let l=e.length,r,u,c;for(;l--;)if(e[l][0]==="enter"){if(e[l][1].type==="content"){r=l;break}e[l][1].type==="paragraph"&&(u=l)}else e[l][1].type==="content"&&e.splice(l,1),!c&&e[l][1].type==="definition"&&(c=l);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 a0(e,i,l){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)):l(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)?tt(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Re(m)?(e.exit("setextHeadingLine"),i(m)):l(m)}}const r0={tokenize:s0};function s0(e){const i=this,l=e.attempt(Jo,r,e.attempt(this.parser.constructs.flowInitial,u,tt(e,e.attempt(this.parser.constructs.flow,u,e.attempt(fS,u)),"linePrefix")));return l;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,l}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,l}}const o0={resolveAll:Lb()},u0=zb("string"),c0=zb("text");function zb(e){return{resolveAll:Lb(e==="text"?d0:void 0),tokenize:i};function i(l){const r=this,u=this.parser.constructs[e],c=l.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){l.consume(b);return}return l.enter("data"),l.consume(b),g}function g(b){return m(b)?(l.exit("data"),c(b)):(l.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let j=-1;if(x)for(;++j<x.length;){const w=x[j];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Lb(e){return i;function i(l,r){let u=-1,c;for(;++u<=l.length;)c===void 0?l[u]&&l[u][1].type==="data"&&(c=u,u++):(!l[u]||l[u][1].type!=="data")&&(u!==c+2&&(l[c][1].end=l[u-1][1].end,l.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(l,r):l}}function d0(e,i){let l=0;for(;++l<=e.length;)if((l===e.length||e[l][1].type==="lineEnding")&&e[l-1][1].type==="data"){const r=e[l-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&l===e.length&&(p=0),p){const m={type:l===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(l,0,["enter",m,i],["exit",m,i]),l+=2)}l++}return e}const f0={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:Ab},p0={91:yS},h0={[-2]:Xf,[-1]:Xf,32:Xf},m0={35:jS,42:zc,45:[Xy,zc],60:ES,61:Xy,95:zc,96:Wy,126:Wy},g0={38:Db,92:Nb},y0={[-5]:Qf,[-4]:Qf,[-3]:Qf,33:PS,38:Db,42:Ip,60:[Fj,OS],91:FS,92:[wS,Nb],93:fh,95:Ip,96:rS},x0={null:[Ip,o0]},b0={null:[42,95]},v0={null:[]},w0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:b0,contentInitial:p0,disable:v0,document:f0,flow:m0,flowInitial:h0,insideSpan:x0,string:g0,text:y0},Symbol.toStringTag,{value:"Module"}));function k0(e,i,l){let r={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:K(oe),check:K(_),consume:H,enter:$,exit:W,interrupt:K(_,{interrupt:!0})},m={code:null,containerState:{},defineSkip:M,events:[],now:E,parser:e,previous:null,sliceSerialize:j,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(te){return d=fi(d,te),I(),d[d.length-1]!==null?[]:(ae(i,0),m.events=Xc(c,m.events,m),m.events)}function j(te,de){return S0(w(te),de)}function w(te){return j0(d,te)}function E(){const{_bufferIndex:te,_index:de,line:Ae,column:ge,offset:ue}=r;return{_bufferIndex:te,_index:de,line:Ae,column:ge,offset:ue}}function M(te){u[te.line]=te.column,z()}function I(){let te;for(;r._index<d.length;){const de=d[r._index];if(typeof de=="string")for(te=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===te&&r._bufferIndex<de.length;)N(de.charCodeAt(r._bufferIndex));else N(de)}}function N(te){b=b(te)}function H(te){Re(te)?(r.line++,r.column=1,r.offset+=te===-3?2:1,z()):te!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=te}function $(te,de){const Ae=de||{};return Ae.type=te,Ae.start=E(),m.events.push(["enter",Ae,m]),p.push(Ae),Ae}function W(te){const de=p.pop();return de.end=E(),m.events.push(["exit",de,m]),de}function oe(te,de){ae(te,de.from)}function _(te,de){de.restore()}function K(te,de){return Ae;function Ae(ge,ue,V){let se,ye,De,O;return Array.isArray(ge)?q(ge):"tokenize"in ge?q([ge]):S(ge);function S(X){return xe;function xe(ze){const Ke=ze!==null&&X[ze],Rt=ze!==null&&X.null,Kt=[...Array.isArray(Ke)?Ke:Ke?[Ke]:[],...Array.isArray(Rt)?Rt:Rt?[Rt]:[]];return q(Kt)(ze)}}function q(X){return se=X,ye=0,X.length===0?V:T(X[ye])}function T(X){return xe;function xe(ze){return O=ee(),De=X,X.partial||(m.currentConstruct=X),X.name&&m.parser.constructs.disable.null.includes(X.name)?me():X.tokenize.call(de?Object.assign(Object.create(m),de):m,g,Q,me)(ze)}}function Q(X){return te(De,O),ue}function me(X){return O.restore(),++ye<se.length?T(se[ye]):V}}}function ae(te,de){te.resolveAll&&!c.includes(te)&&c.push(te),te.resolve&&Kn(m.events,de,m.events.length-de,te.resolve(m.events.slice(de),m)),te.resolveTo&&(m.events=te.resolveTo(m.events,m))}function ee(){const te=E(),de=m.previous,Ae=m.currentConstruct,ge=m.events.length,ue=Array.from(p);return{from:ge,restore:V};function V(){r=te,m.previous=de,m.currentConstruct=Ae,m.events.length=ge,p=ue,z()}}function z(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function j0(e,i){const l=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(l===u)d=[e[l].slice(r,c)];else{if(d=e.slice(l,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function S0(e,i){let l=-1;const r=[];let u;for(;++l<e.length;){const c=e[l];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
52
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 j0(e){const r={constructs:Cb([b0,...(e||{}).extensions||[]]),content:u(Uj),defined:[],document:u(qj),flow:u(l0),lazy:{},string:u(s0),text:u(o0)};return r;function u(c){return d;function d(p){return v0(r,c,p)}}}function S0(e){for(;!Db(e););return e}const Ky=/[\0\t\n\r]/g;function C0(){let e=1,i="",l=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,j,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",l&&(c.charCodeAt(0)===65279&&x++,l=void 0);x<c.length;){if(Ky.lastIndex=x,m=Ky.exec(c),j=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(j),!m){i=c.slice(x);break}if(w===10&&x===j&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<j&&(g.push(c.slice(x,j)),e+=j-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=j+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const T0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function E0(e){return e.replace(T0,A0)}function A0(e,i,l){if(i)return i;if(l.charCodeAt(0)===35){const u=l.charCodeAt(1),c=u===120||u===88;return Tb(l.slice(c?2:1),c?16:10)}return uh(l)||e}const Lb={}.hasOwnProperty;function N0(e,i,l){return i&&typeof i=="object"&&(l=i,i=void 0),D0(l)(S0(j0(l).document().write(C0()(e,i,!0))))}function D0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(gn),autolinkProtocol:te,autolinkEmail:te,atxHeading:c(Mt),blockQuote:c(Rt),characterEscape:te,characterReference:te,codeFenced:c(Kt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Kt,d),codeText:c(sn,d),codeTextData:te,data:te,codeFlowValue:te,definition:c(Pe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(bt),hardBreakEscape:c(on),hardBreakTrailing:c(on),htmlFlow:c(Oe,d),htmlFlowData:te,htmlText:c(Oe,d),htmlTextData:te,image:c(Ot),label:d,link:c(gn),listItem:c(Si),listItemValue:j,listOrdered:c(Xt,x),listUnordered:c(Xt),paragraph:c(Xn),reference:C,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Mt),strong:c(Nl),thematicBreak:c(Dl)},exit:{atxHeading:g(),atxHeadingSequence:oe,autolink:g(),autolinkEmail:Ke,autolinkProtocol:ze,blockQuote:g(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:Q,characterReference:xe,codeFenced:g(U),codeFencedFence:M,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:g(N),codeText:g(ue),codeTextData:L,data:L,definition:g(),definitionDestinationString:W,definitionLabelString:H,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ae),htmlFlowData:L,htmlText:g(ge),htmlTextData:L,image:g(se),label:_e,labelText:ye,lineEnding:ee,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:K,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(ae),setextHeadingLineSequence:X,setextHeadingText:_,strong:g(),thematicBreak:g()}};Ib(i,(e||{}).mdastExtensions||[]);const l={};return r;function r(ie){let ce={type:"root",children:[]};const Ce={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:l},Ie=[];let Xe=-1;for(;++Xe<ie.length;)if(ie[Xe][1].type==="listOrdered"||ie[Xe][1].type==="listUnordered")if(ie[Xe][0]==="enter")Ie.push(Xe);else{const Vt=Ie.pop();Xe=u(ie,Vt,Xe)}for(Xe=-1;++Xe<ie.length;){const Vt=i[ie[Xe][0]];Lb.call(Vt,ie[Xe][1].type)&&Vt[ie[Xe][1].type].call(Object.assign({sliceSerialize:ie[Xe][2].sliceSerialize},Ce),ie[Xe][1])}if(Ce.tokenStack.length>0){const Vt=Ce.tokenStack[Ce.tokenStack.length-1];(Vt[1]||Xy).call(Ce,void 0,Vt[0])}for(ce.position={start:Ca(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Ca(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)ce=i.transforms[Xe](ce)||ce;return ce}function u(ie,ce,Ce){let Ie=ce-1,Xe=-1,Vt=!1,Qn,Pt,St,ut;for(;++Ie<=Ce;){const rt=ie[Ie];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Xe++:Xe--,ut=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Qn&&!ut&&!Xe&&!St&&(St=Ie),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Xe&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Xe===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Qn){let Ci=Ie;for(Pt=void 0;Ci--;){const kn=ie[Ci];if(kn[1].type==="lineEnding"||kn[1].type==="lineEndingBlank"){if(kn[0]==="exit")continue;Pt&&(ie[Pt][1].type="lineEndingBlank",Vt=!0),kn[1].type="lineEnding",Pt=Ci}else if(!(kn[1].type==="linePrefix"||kn[1].type==="blockQuotePrefix"||kn[1].type==="blockQuotePrefixWhitespace"||kn[1].type==="blockQuoteMarker"||kn[1].type==="listItemIndent"))break}St&&(!Pt||St<Pt)&&(Qn._spread=!0),Qn.end=Object.assign({},Pt?ie[Pt][1].start:rt[1].end),ie.splice(Pt||Ie,0,["exit",Qn,rt[2]]),Ie++,Ce++}if(rt[1].type==="listItemPrefix"){const Ci={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Qn=Ci,ie.splice(Ie,0,["enter",Ci,rt[2]]),Ie++,Ce++,St=void 0,ut=!0}}}return ie[ce][1]._spread=Vt,Ce}function c(ie,ce){return Ce;function Ce(Ie){p.call(this,ie(Ie),Ie),ce&&ce.call(this,Ie)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ie,ce,Ce){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ce,Ce||void 0]),ie.position={start:Ca(ce.start),end:void 0}}function g(ie){return ce;function ce(Ce){ie&&ie.call(this,Ce),m.call(this,Ce)}}function m(ie,ce){const Ce=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ie.type&&(ce?ce.call(this,ie,Ie[0]):(Ie[1]||Xy).call(this,ie,Ie[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Ho({start:ie.start,end:ie.end})+"): it’s not open");Ce.position.end=Ca(ie.end)}function b(){return oh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function j(ie){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ie}function T(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ie}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function U(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/(\r?\n|\r)$/g,"")}function H(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ji(this.sliceSerialize(ie)).toLowerCase()}function $(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function W(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function oe(ie){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ce=this.sliceSerialize(ie).length;ce.depth=Ce}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function X(ie){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function te(ie){const Ce=this.stack[this.stack.length-1].children;let Ie=Ce[Ce.length-1];(!Ie||Ie.type!=="text")&&(Ie=At(),Ie.position={start:Ca(ie.start),end:void 0},Ce.push(Ie)),this.stack.push(Ie)}function L(ie){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ie),ce.position.end=Ca(ie.end)}function ee(ie){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ce.children[ce.children.length-1];Ce.position.end=Ca(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(te.call(this,ie),L.call(this,ie))}function de(){this.data.atHardBreak=!0}function Ae(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ge(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ue(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function V(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function se(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ye(ie){const ce=this.sliceSerialize(ie),Ce=this.stack[this.stack.length-2];Ce.label=E0(ce),Ce.identifier=ji(ce).toLowerCase()}function _e(){const ie=this.stack[this.stack.length-1],ce=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Ie=ie.children;Ce.children=Ie}else Ce.alt=ce}function O(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function A(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function z(){this.data.inReference=void 0}function C(){this.data.referenceType="collapsed"}function K(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ji(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function me(ie){this.data.characterReferenceType=ie.type}function Q(ie){const ce=this.sliceSerialize(ie),Ce=this.data.characterReferenceType;let Ie;Ce?(Ie=Tb(ce,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=uh(ce);const Xe=this.stack[this.stack.length-1];Xe.value+=Ie}function xe(ie){const ce=this.stack.pop();ce.position.end=Ca(ie.end)}function ze(ie){L.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ie)}function Ke(ie){L.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ie)}function Rt(){return{type:"blockquote",children:[]}}function Kt(){return{type:"code",lang:null,meta:null,value:""}}function sn(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function on(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function Ot(){return{type:"image",title:null,url:"",alt:null}}function gn(){return{type:"link",title:null,url:"",children:[]}}function Xt(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Si(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Xn(){return{type:"paragraph",children:[]}}function Nl(){return{type:"strong",children:[]}}function At(){return{type:"text",value:""}}function Dl(){return{type:"thematicBreak"}}}function Ca(e){return{line:e.line,column:e.column,offset:e.offset}}function Ib(e,i){let l=-1;for(;++l<i.length;){const r=i[l];Array.isArray(r)?Ib(e,r):_0(e,r)}}function _0(e,i){let l;for(l in i)if(Lb.call(i,l))switch(l){case"canContainEols":{const r=i[l];r&&e[l].push(...r);break}case"transforms":{const r=i[l];r&&e[l].push(...r);break}case"enter":case"exit":{const r=i[l];r&&Object.assign(e[l],r);break}}}function Xy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Ho({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Ho({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Ho({start:i.start,end:i.end})+") is still open")}function R0(e){const i=this;i.parser=l;function l(r){return N0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function M0(e,i){const l={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,l),e.applyData(i,l)}function O0(e,i){const l={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,l),[e.applyData(i,l),{type:"text",value:`
54
- `}]}function z0(e,i){const l=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:l}]};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 L0(e,i){const l={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function I0(e,i){const l={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function U0(e,i){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=gs(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+u,id:l+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function B0(e,i){const l={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function q0(e,i){if(e.options.allowDangerousHtml){const l={type:"raw",value:i.value};return e.patch(i,l),e.applyData(i,l)}}function Ub(e,i){const l=i.referenceType;let r="]";if(l==="collapsed"?r+="[]":l==="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 H0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Ub(e,i);const u={src:gs(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 $0(e,i){const l={src:gs(i.url)};i.alt!==null&&i.alt!==void 0&&(l.alt=i.alt),i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,r),e.applyData(i,r)}function G0(e,i){const l={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,l);const r={type:"element",tagName:"code",properties:{},children:[l]};return e.patch(i,r),e.applyData(i,r)}function V0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Ub(e,i);const u={href:gs(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 P0(e,i){const l={href:gs(i.url)};i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Y0(e,i,l){const r=e.all(i),u=l?F0(l):Bb(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:`
53
+ `;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function C0(e){const r={constructs:Tb([w0,...(e||{}).extensions||[]]),content:u(qj),defined:[],document:u($j),flow:u(r0),lazy:{},string:u(u0),text:u(c0)};return r;function u(c){return d;function d(p){return k0(r,c,p)}}}function T0(e){for(;!_b(e););return e}const Qy=/[\0\t\n\r]/g;function E0(){let e=1,i="",l=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,j,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",l&&(c.charCodeAt(0)===65279&&x++,l=void 0);x<c.length;){if(Qy.lastIndex=x,m=Qy.exec(c),j=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(j),!m){i=c.slice(x);break}if(w===10&&x===j&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<j&&(g.push(c.slice(x,j)),e+=j-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=j+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const A0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N0(e){return e.replace(A0,D0)}function D0(e,i,l){if(i)return i;if(l.charCodeAt(0)===35){const u=l.charCodeAt(1),c=u===120||u===88;return Eb(l.slice(c?2:1),c?16:10)}return dh(l)||e}const Ib={}.hasOwnProperty;function _0(e,i,l){return i&&typeof i=="object"&&(l=i,i=void 0),R0(l)(T0(C0(l).document().write(E0()(e,i,!0))))}function R0(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(gn),autolinkProtocol:ee,autolinkEmail:ee,atxHeading:c(Mt),blockQuote:c(Rt),characterEscape:ee,characterReference:ee,codeFenced:c(Kt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Kt,d),codeText:c(sn,d),codeTextData:ee,data:ee,codeFlowValue:ee,definition:c(Pe),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(bt),hardBreakEscape:c(on),hardBreakTrailing:c(on),htmlFlow:c(Oe,d),htmlFlowData:ee,htmlText:c(Oe,d),htmlTextData:ee,image:c(Ot),label:d,link:c(gn),listItem:c(Si),listItemValue:j,listOrdered:c(Xt,x),listUnordered:c(Xt),paragraph:c(Xn),reference:T,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Mt),strong:c(Nl),thematicBreak:c(Dl)},exit:{atxHeading:g(),atxHeadingSequence:oe,autolink:g(),autolinkEmail:Ke,autolinkProtocol:ze,blockQuote:g(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:X,characterReference:xe,codeFenced:g(I),codeFencedFence:M,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:z,codeIndented:g(N),codeText:g(ue),codeTextData:z,data:z,definition:g(),definitionDestinationString:W,definitionLabelString:H,definitionTitleString:$,emphasis:g(),hardBreakEscape:g(de),hardBreakTrailing:g(de),htmlFlow:g(Ae),htmlFlowData:z,htmlText:g(ge),htmlTextData:z,image:g(se),label:De,labelText:ye,lineEnding:te,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:Q,resourceDestinationString:O,resourceTitleString:S,resource:q,setextHeading:g(ae),setextHeadingLineSequence:K,setextHeadingText:_,strong:g(),thematicBreak:g()}};Ub(i,(e||{}).mdastExtensions||[]);const l={};return r;function r(ie){let ce={type:"root",children:[]};const Ce={stack:[ce],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:l},Ie=[];let Xe=-1;for(;++Xe<ie.length;)if(ie[Xe][1].type==="listOrdered"||ie[Xe][1].type==="listUnordered")if(ie[Xe][0]==="enter")Ie.push(Xe);else{const Vt=Ie.pop();Xe=u(ie,Vt,Xe)}for(Xe=-1;++Xe<ie.length;){const Vt=i[ie[Xe][0]];Ib.call(Vt,ie[Xe][1].type)&&Vt[ie[Xe][1].type].call(Object.assign({sliceSerialize:ie[Xe][2].sliceSerialize},Ce),ie[Xe][1])}if(Ce.tokenStack.length>0){const Vt=Ce.tokenStack[Ce.tokenStack.length-1];(Vt[1]||Zy).call(Ce,void 0,Vt[0])}for(ce.position={start:Ca(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:Ca(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<i.transforms.length;)ce=i.transforms[Xe](ce)||ce;return ce}function u(ie,ce,Ce){let Ie=ce-1,Xe=-1,Vt=!1,Qn,Pt,St,ut;for(;++Ie<=Ce;){const rt=ie[Ie];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Xe++:Xe--,ut=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Qn&&!ut&&!Xe&&!St&&(St=Ie),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!Xe&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Xe===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Qn){let Ci=Ie;for(Pt=void 0;Ci--;){const kn=ie[Ci];if(kn[1].type==="lineEnding"||kn[1].type==="lineEndingBlank"){if(kn[0]==="exit")continue;Pt&&(ie[Pt][1].type="lineEndingBlank",Vt=!0),kn[1].type="lineEnding",Pt=Ci}else if(!(kn[1].type==="linePrefix"||kn[1].type==="blockQuotePrefix"||kn[1].type==="blockQuotePrefixWhitespace"||kn[1].type==="blockQuoteMarker"||kn[1].type==="listItemIndent"))break}St&&(!Pt||St<Pt)&&(Qn._spread=!0),Qn.end=Object.assign({},Pt?ie[Pt][1].start:rt[1].end),ie.splice(Pt||Ie,0,["exit",Qn,rt[2]]),Ie++,Ce++}if(rt[1].type==="listItemPrefix"){const Ci={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Qn=Ci,ie.splice(Ie,0,["enter",Ci,rt[2]]),Ie++,Ce++,St=void 0,ut=!0}}}return ie[ce][1]._spread=Vt,Ce}function c(ie,ce){return Ce;function Ce(Ie){p.call(this,ie(Ie),Ie),ce&&ce.call(this,Ie)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(ie,ce,Ce){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([ce,Ce||void 0]),ie.position={start:Ca(ce.start),end:void 0}}function g(ie){return ce;function ce(Ce){ie&&ie.call(this,Ce),m.call(this,Ce)}}function m(ie,ce){const Ce=this.stack.pop(),Ie=this.tokenStack.pop();if(Ie)Ie[0].type!==ie.type&&(ce?ce.call(this,ie,Ie[0]):(Ie[1]||Zy).call(this,ie,Ie[0]));else throw new Error("Cannot close `"+ie.type+"` ("+$o({start:ie.start,end:ie.end})+"): it’s not open");Ce.position.end=Ca(ie.end)}function b(){return ch(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function j(ie){if(this.data.expectingFirstListItemValue){const ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=ie}function E(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=ie}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function N(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie.replace(/(\r?\n|\r)$/g,"")}function H(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ji(this.sliceSerialize(ie)).toLowerCase()}function $(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function W(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function oe(ie){const ce=this.stack[this.stack.length-1];if(!ce.depth){const Ce=this.sliceSerialize(ie).length;ce.depth=Ce}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function K(ie){const ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function ee(ie){const Ce=this.stack[this.stack.length-1].children;let Ie=Ce[Ce.length-1];(!Ie||Ie.type!=="text")&&(Ie=At(),Ie.position={start:Ca(ie.start),end:void 0},Ce.push(Ie)),this.stack.push(Ie)}function z(ie){const ce=this.stack.pop();ce.value+=this.sliceSerialize(ie),ce.position.end=Ca(ie.end)}function te(ie){const ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=ce.children[ce.children.length-1];Ce.position.end=Ca(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(ce.type)&&(ee.call(this,ie),z.call(this,ie))}function de(){this.data.atHardBreak=!0}function Ae(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ge(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function ue(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.value=ie}function V(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function se(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const ce=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=ce,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function ye(ie){const ce=this.sliceSerialize(ie),Ce=this.stack[this.stack.length-2];Ce.label=N0(ce),Ce.identifier=ji(ce).toLowerCase()}function De(){const ie=this.stack[this.stack.length-1],ce=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Ie=ie.children;Ce.children=Ie}else Ce.alt=ce}function O(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.url=ie}function S(){const ie=this.resume(),ce=this.stack[this.stack.length-1];ce.title=ie}function q(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function Q(ie){const ce=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=ce,Ce.identifier=ji(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function me(ie){this.data.characterReferenceType=ie.type}function X(ie){const ce=this.sliceSerialize(ie),Ce=this.data.characterReferenceType;let Ie;Ce?(Ie=Eb(ce,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ie=dh(ce);const Xe=this.stack[this.stack.length-1];Xe.value+=Ie}function xe(ie){const ce=this.stack.pop();ce.position.end=Ca(ie.end)}function ze(ie){z.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(ie)}function Ke(ie){z.call(this,ie);const ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(ie)}function Rt(){return{type:"blockquote",children:[]}}function Kt(){return{type:"code",lang:null,meta:null,value:""}}function sn(){return{type:"inlineCode",value:""}}function Pe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bt(){return{type:"emphasis",children:[]}}function Mt(){return{type:"heading",depth:0,children:[]}}function on(){return{type:"break"}}function Oe(){return{type:"html",value:""}}function Ot(){return{type:"image",title:null,url:"",alt:null}}function gn(){return{type:"link",title:null,url:"",children:[]}}function Xt(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Si(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Xn(){return{type:"paragraph",children:[]}}function Nl(){return{type:"strong",children:[]}}function At(){return{type:"text",value:""}}function Dl(){return{type:"thematicBreak"}}}function Ca(e){return{line:e.line,column:e.column,offset:e.offset}}function Ub(e,i){let l=-1;for(;++l<i.length;){const r=i[l];Array.isArray(r)?Ub(e,r):M0(e,r)}}function M0(e,i){let l;for(l in i)if(Ib.call(i,l))switch(l){case"canContainEols":{const r=i[l];r&&e[l].push(...r);break}case"transforms":{const r=i[l];r&&e[l].push(...r);break}case"enter":case"exit":{const r=i[l];r&&Object.assign(e[l],r);break}}}function Zy(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+$o({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+$o({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+$o({start:i.start,end:i.end})+") is still open")}function O0(e){const i=this;i.parser=l;function l(r){return _0(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function z0(e,i){const l={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,l),e.applyData(i,l)}function L0(e,i){const l={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,l),[e.applyData(i,l),{type:"text",value:`
54
+ `}]}function I0(e,i){const l=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:l}]};return i.meta&&(c.data={meta:i.meta}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function U0(e,i){const l={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function B0(e,i){const l={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function q0(e,i){const l=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=ys(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+l+"fn-"+u,id:l+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function H0(e,i){const l={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function $0(e,i){if(e.options.allowDangerousHtml){const l={type:"raw",value:i.value};return e.patch(i,l),e.applyData(i,l)}}function Bb(e,i){const l=i.referenceType;let r="]";if(l==="collapsed"?r+="[]":l==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const u=e.all(i),c=u[0];c&&c.type==="text"?c.value="["+c.value:u.unshift({type:"text",value:"["});const d=u[u.length-1];return d&&d.type==="text"?d.value+=r:u.push({type:"text",value:r}),u}function G0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Bb(e,i);const u={src:ys(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"img",properties:u,children:[]};return e.patch(i,c),e.applyData(i,c)}function V0(e,i){const l={src:ys(i.url)};i.alt!==null&&i.alt!==void 0&&(l.alt=i.alt),i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"img",properties:l,children:[]};return e.patch(i,r),e.applyData(i,r)}function P0(e,i){const l={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,l);const r={type:"element",tagName:"code",properties:{},children:[l]};return e.patch(i,r),e.applyData(i,r)}function Y0(e,i){const l=String(i.identifier).toUpperCase(),r=e.definitionById.get(l);if(!r)return Bb(e,i);const u={href:ys(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function F0(e,i){const l={href:ys(i.url)};i.title!==null&&i.title!==void 0&&(l.title=i.title);const r={type:"element",tagName:"a",properties:l,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function W0(e,i,l){const r=e.all(i),u=l?K0(l):qb(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
56
  `}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
57
- `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function F0(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const l=e.children;let r=-1;for(;!i&&++r<l.length;)i=Bb(l[r])}return i}function Bb(e){const i=e.spread;return i??e.children.length>1}function W0(e,i){const l={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(l.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")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:l,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function K0(e,i){const l={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function X0(e,i){const l={type:"root",children:e.wrap(e.all(i))};return e.patch(i,l),e.applyData(i,l)}function Q0(e,i){const l={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Z0(e,i){const l=e.all(i),r=l.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(l.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(l,!0)},p=lh(i.children[1]),g=xb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function J0(e,i,l){const r=l?l.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=l&&l.type==="table"?l.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],j={},w=d?d[g]:void 0;w&&(j.align=w);let T={type:"element",tagName:c,properties:j,children:[]};x&&(T.children=e.all(x),e.patch(x,T),T=e.applyData(x,T)),m.push(T)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function e1(e,i){const l={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}const Qy=9,Zy=32;function t1(e){const i=String(e),l=/\r?\n|\r/g;let r=l.exec(i),u=0;const c=[];for(;r;)c.push(Jy(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=l.exec(i);return c.push(Jy(i.slice(u),u>0,!1)),c.join("")}function Jy(e,i,l){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Qy||c===Zy;)r++,c=e.codePointAt(r)}if(l){let c=e.codePointAt(u-1);for(;c===Qy||c===Zy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function n1(e,i){const l={type:"text",value:t1(String(i.value))};return e.patch(i,l),e.applyData(i,l)}function i1(e,i){const l={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,l),e.applyData(i,l)}const l1={blockquote:M0,break:O0,code:z0,delete:L0,emphasis:I0,footnoteReference:U0,heading:B0,html:q0,imageReference:H0,image:$0,inlineCode:G0,linkReference:V0,link:P0,listItem:Y0,list:W0,paragraph:K0,root:X0,strong:Q0,table:Z0,tableCell:e1,tableRow:J0,text:n1,thematicBreak:i1,toml:jc,yaml:jc,definition:jc,footnoteDefinition:jc};function jc(){}const qb=-1,Xc=0,Go=1,Hc=2,dh=3,fh=4,ph=5,hh=6,Hb=7,$b=8,a1=typeof self=="object"?self:globalThis,ex=(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 a1[e](i)},r1=(e,i)=>{const l=(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 Xc:case qb:return l(d,u);case Go:{const p=l([],u);for(const g of d)p.push(r(g));return p}case Hc:{const p=l({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case dh:return l(new Date(d),u);case fh:{const{source:p,flags:g}=d;return l(new RegExp(p,g),u)}case ph:{const p=l(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case hh:{const p=l(new Set,u);for(const g of d)p.add(r(g));return p}case Hb:{const{name:p,message:g}=d;return l(ex(p,g),u)}case $b:return l(BigInt(d),u);case"BigInt":return l(Object(BigInt(d)),u);case"ArrayBuffer":return l(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return l(new DataView(p),d)}}return l(ex(c,d),u)};return r},tx=e=>r1(new Map,e)(0),cr="",{toString:s1}={},{keys:o1}=Object,Ro=e=>{const i=typeof e;if(i!=="object"||!e)return[Xc,i];const l=s1.call(e).slice(8,-1);switch(l){case"Array":return[Go,cr];case"Object":return[Hc,cr];case"Date":return[dh,cr];case"RegExp":return[fh,cr];case"Map":return[ph,cr];case"Set":return[hh,cr];case"DataView":return[Go,l]}return l.includes("Array")?[Go,l]:l.includes("Error")?[Hb,l]:[Hc,l]},Sc=([e,i])=>e===Xc&&(i==="function"||i==="symbol"),u1=(e,i,l,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return l.set(p,g),g},c=d=>{if(l.has(d))return l.get(d);let[p,g]=Ro(d);switch(p){case Xc:{let b=d;switch(g){case"bigint":p=$b,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([qb],d)}return u([p,b],d)}case Go:{if(g){let j=d;return g==="DataView"?j=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(j=new Uint8Array(d)),u([g,[...j]],d)}const b=[],x=u([p,b],d);for(const j of d)b.push(c(j));return x}case Hc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const j of o1(d))(e||!Sc(Ro(d[j])))&&b.push([c(j),c(d[j])]);return x}case dh:return u([p,isNaN(d.getTime())?cr:d.toISOString()],d);case fh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case ph:{const b=[],x=u([p,b],d);for(const[j,w]of d)(e||!(Sc(Ro(j))||Sc(Ro(w))))&&b.push([c(j),c(w)]);return x}case hh:{const b=[],x=u([p,b],d);for(const j of d)(e||!Sc(Ro(j)))&&b.push(c(j));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},nx=(e,{json:i,lossy:l}={})=>{const r=[];return u1(!(i||l),!!i,new Map,r)(e),r},$c=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?tx(nx(e,i)):structuredClone(e):(e,i)=>tx(nx(e,i));function c1(e,i){const l=[{type:"text",value:"↩"}];return i>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),l}function d1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function f1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=e.options.footnoteBackContent||c1,r=e.options.footnoteBackLabel||d1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),j=gs(x.toLowerCase());let w=0;const T=[],M=e.footnoteCounts.get(x);for(;M!==void 0&&++w<=M;){T.length>0&&T.push({type:"text",value:" "});let H=typeof l=="string"?l:l(g,w);typeof H=="string"&&(H={type:"text",value:H}),T.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+j+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const U=b[b.length-1];if(U&&U.type==="element"&&U.tagName==="p"){const H=U.children[U.children.length-1];H&&H.type==="text"?H.value+=" ":U.children.push({type:"text",value:" "}),U.children.push(...T)}else b.push(...T);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+j},children:e.wrap(b,!0)};e.patch(m,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...$c(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
57
+ `});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function K0(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const l=e.children;let r=-1;for(;!i&&++r<l.length;)i=qb(l[r])}return i}function qb(e){const i=e.spread;return i??e.children.length>1}function X0(e,i){const l={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(l.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")){l.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:l,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function Q0(e,i){const l={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function Z0(e,i){const l={type:"root",children:e.wrap(e.all(i))};return e.patch(i,l),e.applyData(i,l)}function J0(e,i){const l={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}function e1(e,i){const l=e.all(i),r=l.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(l.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(l,!0)},p=rh(i.children[1]),g=bb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function t1(e,i,l){const r=l?l.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=l&&l.type==="table"?l.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],j={},w=d?d[g]:void 0;w&&(j.align=w);let E={type:"element",tagName:c,properties:j,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 n1(e,i){const l={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,l),e.applyData(i,l)}const Jy=9,ex=32;function i1(e){const i=String(e),l=/\r?\n|\r/g;let r=l.exec(i),u=0;const c=[];for(;r;)c.push(tx(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=l.exec(i);return c.push(tx(i.slice(u),u>0,!1)),c.join("")}function tx(e,i,l){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Jy||c===ex;)r++,c=e.codePointAt(r)}if(l){let c=e.codePointAt(u-1);for(;c===Jy||c===ex;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function l1(e,i){const l={type:"text",value:i1(String(i.value))};return e.patch(i,l),e.applyData(i,l)}function a1(e,i){const l={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,l),e.applyData(i,l)}const r1={blockquote:z0,break:L0,code:I0,delete:U0,emphasis:B0,footnoteReference:q0,heading:H0,html:$0,imageReference:G0,image:V0,inlineCode:P0,linkReference:Y0,link:F0,listItem:W0,list:X0,paragraph:Q0,root:Z0,strong:J0,table:e1,tableCell:n1,tableRow:t1,text:l1,thematicBreak:a1,toml:Sc,yaml:Sc,definition:Sc,footnoteDefinition:Sc};function Sc(){}const Hb=-1,Qc=0,Vo=1,$c=2,ph=3,hh=4,mh=5,gh=6,$b=7,Gb=8,s1=typeof self=="object"?self:globalThis,nx=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new s1[e](i)},o1=(e,i)=>{const l=(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 Qc:case Hb:return l(d,u);case Vo:{const p=l([],u);for(const g of d)p.push(r(g));return p}case $c:{const p=l({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case ph:return l(new Date(d),u);case hh:{const{source:p,flags:g}=d;return l(new RegExp(p,g),u)}case mh:{const p=l(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case gh:{const p=l(new Set,u);for(const g of d)p.add(r(g));return p}case $b:{const{name:p,message:g}=d;return l(nx(p,g),u)}case Gb:return l(BigInt(d),u);case"BigInt":return l(Object(BigInt(d)),u);case"ArrayBuffer":return l(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return l(new DataView(p),d)}}return l(nx(c,d),u)};return r},ix=e=>o1(new Map,e)(0),cr="",{toString:u1}={},{keys:c1}=Object,Mo=e=>{const i=typeof e;if(i!=="object"||!e)return[Qc,i];const l=u1.call(e).slice(8,-1);switch(l){case"Array":return[Vo,cr];case"Object":return[$c,cr];case"Date":return[ph,cr];case"RegExp":return[hh,cr];case"Map":return[mh,cr];case"Set":return[gh,cr];case"DataView":return[Vo,l]}return l.includes("Array")?[Vo,l]:l.includes("Error")?[$b,l]:[$c,l]},Cc=([e,i])=>e===Qc&&(i==="function"||i==="symbol"),d1=(e,i,l,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return l.set(p,g),g},c=d=>{if(l.has(d))return l.get(d);let[p,g]=Mo(d);switch(p){case Qc:{let b=d;switch(g){case"bigint":p=Gb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Hb],d)}return u([p,b],d)}case Vo:{if(g){let j=d;return g==="DataView"?j=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(j=new Uint8Array(d)),u([g,[...j]],d)}const b=[],x=u([p,b],d);for(const j of d)b.push(c(j));return x}case $c:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const j of c1(d))(e||!Cc(Mo(d[j])))&&b.push([c(j),c(d[j])]);return x}case ph:return u([p,isNaN(d.getTime())?cr:d.toISOString()],d);case hh:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case mh:{const b=[],x=u([p,b],d);for(const[j,w]of d)(e||!(Cc(Mo(j))||Cc(Mo(w))))&&b.push([c(j),c(w)]);return x}case gh:{const b=[],x=u([p,b],d);for(const j of d)(e||!Cc(Mo(j)))&&b.push(c(j));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},lx=(e,{json:i,lossy:l}={})=>{const r=[];return d1(!(i||l),!!i,new Map,r)(e),r},Gc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ix(lx(e,i)):structuredClone(e):(e,i)=>ix(lx(e,i));function f1(e,i){const l=[{type:"text",value:"↩"}];return i>1&&l.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),l}function p1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function h1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",l=e.options.footnoteBackContent||f1,r=e.options.footnoteBackLabel||p1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),j=ys(x.toLowerCase());let w=0;const E=[],M=e.footnoteCounts.get(x);for(;M!==void 0&&++w<=M;){E.length>0&&E.push({type:"text",value:" "});let H=typeof l=="string"?l:l(g,w);typeof H=="string"&&(H={type:"text",value:H}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+j+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(H)?H:[H]})}const I=b[b.length-1];if(I&&I.type==="element"&&I.tagName==="p"){const H=I.children[I.children.length-1];H&&H.type==="text"?H.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...E)}else b.push(...E);const N={type:"element",tagName:"li",properties:{id:i+"fn-"+j},children:e.wrap(b,!0)};e.patch(m,N),p.push(N)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Gc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
58
58
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
59
- `}]}}const Qc=(function(e){if(e==null)return g1;if(typeof e=="function")return Zc(e);if(typeof e=="object")return Array.isArray(e)?p1(e):h1(e);if(typeof e=="string")return m1(e);throw new Error("Expected function, string, or object as test")});function p1(e){const i=[];let l=-1;for(;++l<e.length;)i[l]=Qc(e[l]);return Zc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function h1(e){const i=e;return Zc(l);function l(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function m1(e){return Zc(i);function i(l){return l&&l.type===e}}function Zc(e){return i;function i(l,r,u){return!!(y1(l)&&e.call(this,l,typeof r=="number"?r:void 0,u||void 0))}}function g1(){return!0}function y1(e){return e!==null&&typeof e=="object"&&"type"in e}const Gb=[],x1=!0,Ip=!1,b1="skip";function Vb(e,i,l,r){let u;typeof i=="function"&&typeof l!="function"?(r=l,l=i):u=i;const c=Qc(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return j;function j(){let w=Gb,T,M,U;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=v1(l(g,b)),w[0]===Ip))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==b1)for(M=(r?N.children.length:-1)+d,U=b.concat(N);M>-1&&M<N.children.length;){const H=N.children[M];if(T=p(H,M,U)(),T[0]===Ip)return T;M=typeof T[1]=="number"?T[1]:M+d}}return w}}}function v1(e){return Array.isArray(e)?e:typeof e=="number"?[x1,e]:e==null?Gb:[e]}function mh(e,i,l,r){let u,c,d;typeof i=="function"&&typeof l!="function"?(c=void 0,d=i,u=l):(c=i,d=l,u=r),Vb(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Up={}.hasOwnProperty,w1={};function k1(e,i){const l=i||w1,r=new Map,u=new Map,c=new Map,d={...l1,...l.handlers},p={all:m,applyData:S1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:l,patch:j1,wrap:T1};return mh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,j=String(b.identifier).toUpperCase();x.has(j)||x.set(j,b)}}),p;function g(b,x){const j=b.type,w=p.handlers[j];if(Up.call(p.handlers,j)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(j)){if("children"in b){const{children:M,...U}=b,N=$c(U);return N.children=p.all(b),N}return $c(b)}return(p.options.unknownHandler||C1)(p,b,x)}function m(b){const x=[];if("children"in b){const j=b.children;let w=-1;for(;++w<j.length;){const T=p.one(j[w],b);if(T){if(w&&j[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=ix(T.value)),!Array.isArray(T)&&T.type==="element")){const M=T.children[0];M&&M.type==="text"&&(M.value=ix(M.value))}Array.isArray(T)?x.push(...T):x.push(T)}}}return x}}function j1(e,i){e.position&&(i.position=cj(e))}function S1(e,i){let l=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(l.type==="element")l.tagName=r;else{const d="children"in l?l.children:[l];l={type:"element",tagName:r,properties:{},children:d}}l.type==="element"&&c&&Object.assign(l.properties,$c(c)),"children"in l&&l.children&&u!==null&&u!==void 0&&(l.children=u)}return l}function C1(e,i){const l=i.data||{},r="value"in i&&!(Up.call(l,"hProperties")||Up.call(l,"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 T1(e,i){const l=[];let r=-1;for(i&&l.push({type:"text",value:`
59
+ `}]}}const Zc=(function(e){if(e==null)return x1;if(typeof e=="function")return Jc(e);if(typeof e=="object")return Array.isArray(e)?m1(e):g1(e);if(typeof e=="string")return y1(e);throw new Error("Expected function, string, or object as test")});function m1(e){const i=[];let l=-1;for(;++l<e.length;)i[l]=Zc(e[l]);return Jc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function g1(e){const i=e;return Jc(l);function l(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function y1(e){return Jc(i);function i(l){return l&&l.type===e}}function Jc(e){return i;function i(l,r,u){return!!(b1(l)&&e.call(this,l,typeof r=="number"?r:void 0,u||void 0))}}function x1(){return!0}function b1(e){return e!==null&&typeof e=="object"&&"type"in e}const Vb=[],v1=!0,Up=!1,w1="skip";function Pb(e,i,l,r){let u;typeof i=="function"&&typeof l!="function"?(r=l,l=i):u=i;const c=Zc(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return j;function j(){let w=Vb,E,M,I;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=k1(l(g,b)),w[0]===Up))return w;if("children"in g&&g.children){const N=g;if(N.children&&w[0]!==w1)for(M=(r?N.children.length:-1)+d,I=b.concat(N);M>-1&&M<N.children.length;){const H=N.children[M];if(E=p(H,M,I)(),E[0]===Up)return E;M=typeof E[1]=="number"?E[1]:M+d}}return w}}}function k1(e){return Array.isArray(e)?e:typeof e=="number"?[v1,e]:e==null?Vb:[e]}function yh(e,i,l,r){let u,c,d;typeof i=="function"&&typeof l!="function"?(c=void 0,d=i,u=l):(c=i,d=l,u=r),Pb(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Bp={}.hasOwnProperty,j1={};function S1(e,i){const l=i||j1,r=new Map,u=new Map,c=new Map,d={...r1,...l.handlers},p={all:m,applyData:T1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:l,patch:C1,wrap:A1};return yh(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,j=String(b.identifier).toUpperCase();x.has(j)||x.set(j,b)}}),p;function g(b,x){const j=b.type,w=p.handlers[j];if(Bp.call(p.handlers,j)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(j)){if("children"in b){const{children:M,...I}=b,N=Gc(I);return N.children=p.all(b),N}return Gc(b)}return(p.options.unknownHandler||E1)(p,b,x)}function m(b){const x=[];if("children"in b){const j=b.children;let w=-1;for(;++w<j.length;){const E=p.one(j[w],b);if(E){if(w&&j[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=ax(E.value)),!Array.isArray(E)&&E.type==="element")){const M=E.children[0];M&&M.type==="text"&&(M.value=ax(M.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function C1(e,i){e.position&&(i.position=fj(e))}function T1(e,i){let l=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(l.type==="element")l.tagName=r;else{const d="children"in l?l.children:[l];l={type:"element",tagName:r,properties:{},children:d}}l.type==="element"&&c&&Object.assign(l.properties,Gc(c)),"children"in l&&l.children&&u!==null&&u!==void 0&&(l.children=u)}return l}function E1(e,i){const l=i.data||{},r="value"in i&&!(Bp.call(l,"hProperties")||Bp.call(l,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function A1(e,i){const l=[];let r=-1;for(i&&l.push({type:"text",value:`
60
60
  `});++r<e.length;)r&&l.push({type:"text",value:`
61
61
  `}),l.push(e[r]);return i&&e.length>0&&l.push({type:"text",value:`
62
- `}),l}function ix(e){let i=0,l=e.charCodeAt(i);for(;l===9||l===32;)i++,l=e.charCodeAt(i);return e.slice(i)}function lx(e,i){const l=k1(e,i),r=l.one(e,void 0),u=f1(l),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
63
- `},u),c}function E1(e,i){return e&&"run"in e?async function(l,r){const u=lx(l,{file:r,...i});await e.run(u,r)}:function(l,r){return lx(l,{file:r,...e||i})}}function ax(e){if(e)throw e}var Qf,rx;function A1(){if(rx)return Qf;rx=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var j;for(j in m);return typeof j>"u"||e.call(m,j)},d=function(m,b){l&&b.name==="__proto__"?l(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 Qf=function g(){var m,b,x,j,w,T,M=arguments[0],U=1,N=arguments.length,H=!1;for(typeof M=="boolean"&&(H=M,M=arguments[1]||{},U=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});U<N;++U)if(m=arguments[U],m!=null)for(b in m)x=p(M,b),j=p(m,b),M!==j&&(H&&j&&(c(j)||(w=u(j)))?(w?(w=!1,T=x&&u(x)?x:[]):T=x&&c(x)?x:{},d(M,{name:b,newValue:g(H,T,j)})):typeof j<"u"&&d(M,{name:b,newValue:j}));return M},Qf}var N1=A1();const Zf=cb(N1);function Bp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function D1(){const e=[],i={run:l,use:r};return i;function l(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?_1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function _1(e,i){let l;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&l)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){l||(l=!0,i(d,...p))}function c(d){u(null,d)}}const Ki={basename:R1,dirname:M1,extname:O1,join:z1,sep:"/"};function R1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Jo(e);let l=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){l=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(l,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){l=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 l===r?r=d:r<0&&(r=e.length),e.slice(l,r)}function M1(e){if(Jo(e),e.length===0)return".";let i=-1,l=e.length,r;for(;--l;)if(e.codePointAt(l)===47){if(r){i=l;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function O1(e){Jo(e);let i=e.length,l=-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}l<0&&(d=!0,l=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||l<0||c===0||c===1&&u===l-1&&u===r+1?"":e.slice(u,l)}function z1(...e){let i=-1,l;for(;++i<e.length;)Jo(e[i]),e[i]&&(l=l===void 0?e[i]:l+"/"+e[i]);return l===void 0?".":L1(l)}function L1(e){Jo(e);const i=e.codePointAt(0)===47;let l=I1(e,!i);return l.length===0&&!i&&(l="."),l.length>0&&e.codePointAt(e.length-1)===47&&(l+="/"),i?"/"+l:l}function I1(e,i){let l="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(l.length<2||r!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(g=l.lastIndexOf("/"),g!==l.length-1){g<0?(l="",r=0):(l=l.slice(0,g),r=l.length-1-l.lastIndexOf("/")),u=d,c=0;continue}}else if(l.length>0){l="",r=0,u=d,c=0;continue}}i&&(l=l.length>0?l+"/..":"..",r=2)}else l.length>0?l+="/"+e.slice(u+1,d):l=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return l}function Jo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const U1={cwd:B1};function B1(){return"/"}function qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function q1(e){if(typeof e=="string")e=new URL(e);else if(!qp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return H1(e)}function H1(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 l=-1;for(;++l<i.length;)if(i.codePointAt(l)===37&&i.codePointAt(l+1)===50){const r=i.codePointAt(l+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(i)}const Jf=["history","path","basename","stem","extname","dirname"];class Pb{constructor(i){let l;i?qp(i)?l={path:i}:typeof i=="string"||$1(i)?l={value:i}:l=i:l={},this.cwd="cwd"in l?"":U1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Jf.length;){const c=Jf[r];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let u;for(u in l)Jf.includes(u)||(this[u]=l[u])}get basename(){return typeof this.path=="string"?Ki.basename(this.path):void 0}set basename(i){tp(i,"basename"),ep(i,"basename"),this.path=Ki.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ki.dirname(this.path):void 0}set dirname(i){sx(this.basename,"dirname"),this.path=Ki.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ki.extname(this.path):void 0}set extname(i){if(ep(i,"extname"),sx(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=Ki.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){qp(i)&&(i=q1(i)),tp(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ki.basename(this.path,this.extname):void 0}set stem(i){tp(i,"stem"),ep(i,"stem"),this.path=Ki.join(this.dirname||"",i+(this.extname||""))}fail(i,l,r){const u=this.message(i,l,r);throw u.fatal=!0,u}info(i,l,r){const u=this.message(i,l,r);return u.fatal=void 0,u}message(i,l,r){const u=new mn(i,l,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function ep(e,i){if(e&&e.includes(Ki.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ki.sep+"`")}function tp(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function sx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function $1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const G1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),V1={}.hasOwnProperty;class gh extends G1{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=D1()}copy(){const i=new gh;let l=-1;for(;++l<this.attachers.length;){const r=this.attachers[l];i.use(...r)}return i.data(Zf(!0,{},this.namespace)),i}data(i,l){return typeof i=="string"?arguments.length===2?(lp("data",this.frozen),this.namespace[i]=l,this):V1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(lp("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[l,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=l.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 l=Cc(i),r=this.parser||this.Parser;return np("parse",r),r(String(l),l)}process(i,l){const r=this;return this.freeze(),np("process",this.parser||this.Parser),ip("process",this.compiler||this.Compiler),l?u(void 0,l):new Promise(u);function u(c,d){const p=Cc(i),g=r.parse(p);r.run(g,p,function(b,x,j){if(b||!x||!j)return m(b);const w=x,T=r.stringify(w,j);F1(T)?j.value=T:j.result=T,m(b,j)});function m(b,x){b||!x?d(b):c?c(x):l(void 0,x)}}}processSync(i){let l=!1,r;return this.freeze(),np("processSync",this.parser||this.Parser),ip("processSync",this.compiler||this.Compiler),this.process(i,u),ux("processSync","process",l),r;function u(c,d){l=!0,ax(c),r=d}}run(i,l,r){ox(i),this.freeze();const u=this.transformers;return!r&&typeof l=="function"&&(r=l,l=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=Cc(l);u.run(i,g,m);function m(b,x,j){const w=x||i;b?p(b):d?d(w):r(void 0,w,j)}}}runSync(i,l){let r=!1,u;return this.run(i,l,c),ux("runSync","run",r),u;function c(d,p){ax(d),u=p,r=!0}}stringify(i,l){this.freeze();const r=Cc(l),u=this.compiler||this.Compiler;return ip("stringify",u),ox(i),u(i,r)}use(i,...l){const r=this.attachers,u=this.namespace;if(lp("use",this.frozen),i!=null)if(typeof i=="function")g(i,l);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=Zf(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,j=-1;for(;++x<r.length;)if(r[x][0]===m){j=x;break}if(j===-1)r.push([m,...b]);else if(b.length>0){let[w,...T]=b;const M=r[j][1];Bp(M)&&Bp(w)&&(w=Zf(!0,M,w)),r[j]=[m,w,...T]}}}}const P1=new gh().freeze();function np(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function lp(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 ox(e){if(!Bp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ux(e,i,l){if(!l)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Cc(e){return Y1(e)?e:new Pb(e)}function Y1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function F1(e){return typeof e=="string"||W1(e)}function W1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const K1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cx=[],dx={allowDangerousHtml:!0},X1=/^(https?|ircs?|mailto|xmpp)$/i,Q1=[{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 Z1(e){const i=J1(e),l=eC(e);return tC(i.runSync(i.parse(l),l),e)}function J1(e){const i=e.rehypePlugins||cx,l=e.remarkPlugins||cx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dx}:dx;return P1().use(R0).use(l).use(E1,r).use(i)}function eC(e){const i=e.children||"",l=new Pb;return typeof i=="string"&&(l.value=i),l}function tC(e,i){const l=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||nC;for(const b of Q1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+K1+b.id,void 0);return mh(e,m),mj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,j){if(b.type==="raw"&&j&&typeof x=="number")return d?j.children.splice(x,1):j.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in Wf)if(Object.hasOwn(Wf,w)&&Object.hasOwn(b.properties,w)){const T=b.properties[w],M=Wf[w];(M===null||M.includes(b.tagName))&&(b.properties[w]=g(String(T||""),w,b))}}if(b.type==="element"){let w=l?!l.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,j)),w&&j&&typeof x=="number")return p&&b.children?j.children.splice(x,1,...b.children):j.children.splice(x,1),x}}}function nC(e){const i=e.indexOf(":"),l=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||l!==-1&&i>l||r!==-1&&i>r||X1.test(e.slice(0,i))?e:""}function fx(e,i){const l=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=l.indexOf(i);for(;u!==-1;)r++,u=l.indexOf(i,u+i.length);return r}function iC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function lC(e,i,l){const u=Qc((l||{}).ignore||[]),c=aC(i);let d=-1;for(;++d<c.length;)Vb(e,"text",p);function p(m,b){let x=-1,j;for(;++x<b.length;){const w=b[x],T=j?j.children:void 0;if(u(w,T?T.indexOf(w):void 0,j))return;j=w}if(j)return g(m,b)}function g(m,b){const x=b[b.length-1],j=c[d][0],w=c[d][1];let T=0;const U=x.children.indexOf(m);let N=!1,H=[];j.lastIndex=0;let $=j.exec(m.value);for(;$;){const W=$.index,oe={index:$.index,input:$.input,stack:[...b,m]};let _=w(...$,oe);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?j.lastIndex=W+1:(T!==W&&H.push({type:"text",value:m.value.slice(T,W)}),Array.isArray(_)?H.push(..._):_&&H.push(_),T=W+$[0].length,N=!0),!j.global)break;$=j.exec(m.value)}return N?(T<m.value.length&&H.push({type:"text",value:m.value.slice(T)}),x.children.splice(U,1,...H)):H=[m],U+H.length}}function aC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<l.length;){const u=l[r];i.push([rC(u[0]),sC(u[1])])}return i}function rC(e){return typeof e=="string"?new RegExp(iC(e),"g"):e}function sC(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",rp=["autolink","link","image","label"];function oC(){return{transforms:[mC],enter:{literalAutolink:cC,literalAutolinkEmail:sp,literalAutolinkHttp:sp,literalAutolinkWww:sp},exit:{literalAutolink:hC,literalAutolinkEmail:pC,literalAutolinkHttp:dC,literalAutolinkWww:fC}}}function uC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:rp},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:rp}]}}function cC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function sp(e){this.config.enter.autolinkProtocol.call(this,e)}function dC(e){this.config.exit.autolinkProtocol.call(this,e)}function fC(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 pC(e){this.config.exit.autolinkEmail.call(this,e)}function hC(e){this.exit(e)}function mC(e){lC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,gC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),yC]],{ignore:["link","linkReference"]})}function gC(e,i,l,r,u){let c="";if(!Yb(u)||(/^w/i.test(i)&&(l=i+l,i="",c="http://"),!xC(l)))return!1;const d=bC(l+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 yC(e,i,l,r){return!Yb(r,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+l,children:[{type:"text",value:i+"@"+l}]}}function xC(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 bC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let l=i[0],r=l.indexOf(")");const u=fx(e,"(");let c=fx(e,")");for(;r!==-1&&u>c;)e+=l.slice(0,r+1),l=l.slice(r+1),r=l.indexOf(")"),c++;return[e,l]}function Yb(e,i){const l=e.input.charCodeAt(e.index-1);return(e.index===0||hr(l)||Wc(l))&&(!i||l!==47)}Fb.peek=AC;function vC(){this.buffer()}function wC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kC(){this.buffer()}function jC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function SC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=ji(this.sliceSerialize(e)).toLowerCase(),l.label=i}function CC(e){this.exit(e)}function TC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=ji(this.sliceSerialize(e)).toLowerCase(),l.label=i}function EC(e){this.exit(e)}function AC(){return"["}function Fb(e,i,l,r){const u=l.createTracker(r);let c=u.move("[^");const d=l.enter("footnoteReference"),p=l.enter("reference");return c+=u.move(l.safe(l.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function NC(){return{enter:{gfmFootnoteCallString:vC,gfmFootnoteCall:wC,gfmFootnoteDefinitionLabelString:kC,gfmFootnoteDefinition:jC},exit:{gfmFootnoteCallString:SC,gfmFootnoteCall:CC,gfmFootnoteDefinitionLabelString:TC,gfmFootnoteDefinition:EC}}}function DC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:l,footnoteReference:Fb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
- `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?Wb:_C))),m(),g}}function _C(e,i,l){return i===0?e:Wb(e,i,l)}function Wb(e,i,l){return(l?"":" ")+e}const RC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kb.peek=IC;function MC(){return{canContainEols:["delete"],enter:{strikethrough:zC},exit:{strikethrough:LC}}}function OC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:RC}],handlers:{delete:Kb}}}function zC(e){this.enter({type:"delete",children:[]},e)}function LC(e){this.exit(e)}function Kb(e,i,l,r){const u=l.createTracker(r),c=l.enter("strikethrough");let d=u.move("~~");return d+=l.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function IC(){return"~"}function UC(e){return e.length}function BC(e,i){const l=i||{},r=(l.align||[]).concat(),u=l.stringLength||UC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const M=[],U=[];let N=-1;for(e[b].length>m&&(m=e[b].length);++N<e[b].length;){const H=qC(e[b][N]);if(l.alignDelimiters!==!1){const $=u(H);U[N]=$,(g[N]===void 0||$>g[N])&&(g[N]=$)}M.push(H)}d[b]=M,p[b]=U}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=px(r[x]);else{const M=px(r);for(;++x<m;)c[x]=M}x=-1;const j=[],w=[];for(;++x<m;){const M=c[x];let U="",N="";M===99?(U=":",N=":"):M===108?U=":":M===114&&(N=":");let H=l.alignDelimiters===!1?1:Math.max(1,g[x]-U.length-N.length);const $=U+"-".repeat(H)+N;l.alignDelimiters!==!1&&(H=U.length+H+N.length,H>g[x]&&(g[x]=H),w[x]=H),j[x]=$}d.splice(1,0,j),p.splice(1,0,w),b=-1;const T=[];for(;++b<d.length;){const M=d[b],U=p[b];x=-1;const N=[];for(;++x<m;){const H=M[x]||"";let $="",W="";if(l.alignDelimiters!==!1){const oe=g[x]-(U[x]||0),_=c[x];_===114?$=" ".repeat(oe):_===99?oe%2?($=" ".repeat(oe/2+.5),W=" ".repeat(oe/2-.5)):($=" ".repeat(oe/2),W=$):W=" ".repeat(oe)}l.delimiterStart!==!1&&!x&&N.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&H==="")&&(l.delimiterStart!==!1||x)&&N.push(" "),l.alignDelimiters!==!1&&N.push($),N.push(H),l.alignDelimiters!==!1&&N.push(W),l.padding!==!1&&N.push(" "),(l.delimiterEnd!==!1||x!==m-1)&&N.push("|")}T.push(l.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return T.join(`
65
- `)}function qC(e){return e==null?"":String(e)}function px(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 HC(e,i,l,r){const u=l.enter("blockquote"),c=l.createTracker(r);c.move("> "),c.shift(2);const d=l.indentLines(l.containerFlow(e,c.current()),$C);return u(),d}function $C(e,i,l){return">"+(l?"":" ")+e}function GC(e,i){return hx(e,i.inConstruct,!0)&&!hx(e,i.notInConstruct,!1)}function hx(e,i,l){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return l;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function mx(e,i,l,r){let u=-1;for(;++u<l.unsafe.length;)if(l.unsafe[u].character===`
66
- `&&GC(l.stack,l.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
- `}function VC(e,i){const l=String(e);let r=l.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=l.indexOf(i,u);return d}function PC(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 YC(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 FC(e,i,l,r){const u=YC(l),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(PC(e,l)){const x=l.enter("codeIndented"),j=l.indentLines(c,WC);return x(),j}const p=l.createTracker(r),g=u.repeat(Math.max(VC(c,u)+1,3)),m=l.enter("codeFenced");let b=p.move(g);if(e.lang){const x=l.enter(`codeFencedLang${d}`);b+=p.move(l.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=l.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(l.safe(e.meta,{before:b,after:`
62
+ `}),l}function ax(e){let i=0,l=e.charCodeAt(i);for(;l===9||l===32;)i++,l=e.charCodeAt(i);return e.slice(i)}function rx(e,i){const l=S1(e,i),r=l.one(e,void 0),u=h1(l),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
63
+ `},u),c}function N1(e,i){return e&&"run"in e?async function(l,r){const u=rx(l,{file:r,...i});await e.run(u,r)}:function(l,r){return rx(l,{file:r,...e||i})}}function sx(e){if(e)throw e}var Zf,ox;function D1(){if(ox)return Zf;ox=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var j;for(j in m);return typeof j>"u"||e.call(m,j)},d=function(m,b){l&&b.name==="__proto__"?l(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 Zf=function g(){var m,b,x,j,w,E,M=arguments[0],I=1,N=arguments.length,H=!1;for(typeof M=="boolean"&&(H=M,M=arguments[1]||{},I=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});I<N;++I)if(m=arguments[I],m!=null)for(b in m)x=p(M,b),j=p(m,b),M!==j&&(H&&j&&(c(j)||(w=u(j)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(M,{name:b,newValue:g(H,E,j)})):typeof j<"u"&&d(M,{name:b,newValue:j}));return M},Zf}var _1=D1();const Jf=db(_1);function qp(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function R1(){const e=[],i={run:l,use:r};return i;function l(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?M1(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 M1(e,i){let l;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&l)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){l||(l=!0,i(d,...p))}function c(d){u(null,d)}}const Ki={basename:O1,dirname:z1,extname:L1,join:I1,sep:"/"};function O1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');eu(e);let l=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){l=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(l,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){l=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 l===r?r=d:r<0&&(r=e.length),e.slice(l,r)}function z1(e){if(eu(e),e.length===0)return".";let i=-1,l=e.length,r;for(;--l;)if(e.codePointAt(l)===47){if(r){i=l;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function L1(e){eu(e);let i=e.length,l=-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}l<0&&(d=!0,l=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||l<0||c===0||c===1&&u===l-1&&u===r+1?"":e.slice(u,l)}function I1(...e){let i=-1,l;for(;++i<e.length;)eu(e[i]),e[i]&&(l=l===void 0?e[i]:l+"/"+e[i]);return l===void 0?".":U1(l)}function U1(e){eu(e);const i=e.codePointAt(0)===47;let l=B1(e,!i);return l.length===0&&!i&&(l="."),l.length>0&&e.codePointAt(e.length-1)===47&&(l+="/"),i?"/"+l:l}function B1(e,i){let l="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(l.length<2||r!==2||l.codePointAt(l.length-1)!==46||l.codePointAt(l.length-2)!==46){if(l.length>2){if(g=l.lastIndexOf("/"),g!==l.length-1){g<0?(l="",r=0):(l=l.slice(0,g),r=l.length-1-l.lastIndexOf("/")),u=d,c=0;continue}}else if(l.length>0){l="",r=0,u=d,c=0;continue}}i&&(l=l.length>0?l+"/..":"..",r=2)}else l.length>0?l+="/"+e.slice(u+1,d):l=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return l}function eu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const q1={cwd:H1};function H1(){return"/"}function Hp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $1(e){if(typeof e=="string")e=new URL(e);else if(!Hp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return G1(e)}function G1(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const i=e.pathname;let l=-1;for(;++l<i.length;)if(i.codePointAt(l)===37&&i.codePointAt(l+1)===50){const r=i.codePointAt(l+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 ep=["history","path","basename","stem","extname","dirname"];class Yb{constructor(i){let l;i?Hp(i)?l={path:i}:typeof i=="string"||V1(i)?l={value:i}:l=i:l={},this.cwd="cwd"in l?"":q1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ep.length;){const c=ep[r];c in l&&l[c]!==void 0&&l[c]!==null&&(this[c]=c==="history"?[...l[c]]:l[c])}let u;for(u in l)ep.includes(u)||(this[u]=l[u])}get basename(){return typeof this.path=="string"?Ki.basename(this.path):void 0}set basename(i){np(i,"basename"),tp(i,"basename"),this.path=Ki.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Ki.dirname(this.path):void 0}set dirname(i){ux(this.basename,"dirname"),this.path=Ki.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Ki.extname(this.path):void 0}set extname(i){if(tp(i,"extname"),ux(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=Ki.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Hp(i)&&(i=$1(i)),np(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Ki.basename(this.path,this.extname):void 0}set stem(i){np(i,"stem"),tp(i,"stem"),this.path=Ki.join(this.dirname||"",i+(this.extname||""))}fail(i,l,r){const u=this.message(i,l,r);throw u.fatal=!0,u}info(i,l,r){const u=this.message(i,l,r);return u.fatal=void 0,u}message(i,l,r){const u=new mn(i,l,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 tp(e,i){if(e&&e.includes(Ki.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Ki.sep+"`")}function np(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function ux(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function V1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),Y1={}.hasOwnProperty;class xh extends P1{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=R1()}copy(){const i=new xh;let l=-1;for(;++l<this.attachers.length;){const r=this.attachers[l];i.use(...r)}return i.data(Jf(!0,{},this.namespace)),i}data(i,l){return typeof i=="string"?arguments.length===2?(ap("data",this.frozen),this.namespace[i]=l,this):Y1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(ap("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[l,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=l.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 l=Tc(i),r=this.parser||this.Parser;return ip("parse",r),r(String(l),l)}process(i,l){const r=this;return this.freeze(),ip("process",this.parser||this.Parser),lp("process",this.compiler||this.Compiler),l?u(void 0,l):new Promise(u);function u(c,d){const p=Tc(i),g=r.parse(p);r.run(g,p,function(b,x,j){if(b||!x||!j)return m(b);const w=x,E=r.stringify(w,j);K1(E)?j.value=E:j.result=E,m(b,j)});function m(b,x){b||!x?d(b):c?c(x):l(void 0,x)}}}processSync(i){let l=!1,r;return this.freeze(),ip("processSync",this.parser||this.Parser),lp("processSync",this.compiler||this.Compiler),this.process(i,u),dx("processSync","process",l),r;function u(c,d){l=!0,sx(c),r=d}}run(i,l,r){cx(i),this.freeze();const u=this.transformers;return!r&&typeof l=="function"&&(r=l,l=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=Tc(l);u.run(i,g,m);function m(b,x,j){const w=x||i;b?p(b):d?d(w):r(void 0,w,j)}}}runSync(i,l){let r=!1,u;return this.run(i,l,c),dx("runSync","run",r),u;function c(d,p){sx(d),u=p,r=!0}}stringify(i,l){this.freeze();const r=Tc(l),u=this.compiler||this.Compiler;return lp("stringify",u),cx(i),u(i,r)}use(i,...l){const r=this.attachers,u=this.namespace;if(ap("use",this.frozen),i!=null)if(typeof i=="function")g(i,l);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");p(m.plugins),m.settings&&(u.settings=Jf(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,j=-1;for(;++x<r.length;)if(r[x][0]===m){j=x;break}if(j===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const M=r[j][1];qp(M)&&qp(w)&&(w=Jf(!0,M,w)),r[j]=[m,w,...E]}}}}const F1=new xh().freeze();function ip(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ap(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cx(e){if(!qp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dx(e,i,l){if(!l)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function Tc(e){return W1(e)?e:new Yb(e)}function W1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function K1(e){return typeof e=="string"||X1(e)}function X1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Q1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fx=[],px={allowDangerousHtml:!0},Z1=/^(https?|ircs?|mailto|xmpp)$/i,J1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function eC(e){const i=tC(e),l=nC(e);return iC(i.runSync(i.parse(l),l),e)}function tC(e){const i=e.rehypePlugins||fx,l=e.remarkPlugins||fx,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...px}:px;return F1().use(O0).use(l).use(N1,r).use(i)}function nC(e){const i=e.children||"",l=new Yb;return typeof i=="string"&&(l.value=i),l}function iC(e,i){const l=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||lC;for(const b of J1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Q1+b.id,void 0);return yh(e,m),yj(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,j){if(b.type==="raw"&&j&&typeof x=="number")return d?j.children.splice(x,1):j.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in Kf)if(Object.hasOwn(Kf,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],M=Kf[w];(M===null||M.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=l?!l.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,j)),w&&j&&typeof x=="number")return p&&b.children?j.children.splice(x,1,...b.children):j.children.splice(x,1),x}}}function lC(e){const i=e.indexOf(":"),l=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||l!==-1&&i>l||r!==-1&&i>r||Z1.test(e.slice(0,i))?e:""}function hx(e,i){const l=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=l.indexOf(i);for(;u!==-1;)r++,u=l.indexOf(i,u+i.length);return r}function aC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function rC(e,i,l){const u=Zc((l||{}).ignore||[]),c=sC(i);let d=-1;for(;++d<c.length;)Pb(e,"text",p);function p(m,b){let x=-1,j;for(;++x<b.length;){const w=b[x],E=j?j.children:void 0;if(u(w,E?E.indexOf(w):void 0,j))return;j=w}if(j)return g(m,b)}function g(m,b){const x=b[b.length-1],j=c[d][0],w=c[d][1];let E=0;const I=x.children.indexOf(m);let N=!1,H=[];j.lastIndex=0;let $=j.exec(m.value);for(;$;){const W=$.index,oe={index:$.index,input:$.input,stack:[...b,m]};let _=w(...$,oe);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?j.lastIndex=W+1:(E!==W&&H.push({type:"text",value:m.value.slice(E,W)}),Array.isArray(_)?H.push(..._):_&&H.push(_),E=W+$[0].length,N=!0),!j.global)break;$=j.exec(m.value)}return N?(E<m.value.length&&H.push({type:"text",value:m.value.slice(E)}),x.children.splice(I,1,...H)):H=[m],I+H.length}}function sC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const l=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<l.length;){const u=l[r];i.push([oC(u[0]),uC(u[1])])}return i}function oC(e){return typeof e=="string"?new RegExp(aC(e),"g"):e}function uC(e){return typeof e=="function"?e:function(){return e}}const rp="phrasing",sp=["autolink","link","image","label"];function cC(){return{transforms:[yC],enter:{literalAutolink:fC,literalAutolinkEmail:op,literalAutolinkHttp:op,literalAutolinkWww:op},exit:{literalAutolink:gC,literalAutolinkEmail:mC,literalAutolinkHttp:pC,literalAutolinkWww:hC}}}function dC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rp,notInConstruct:sp},{character:":",before:"[ps]",after:"\\/",inConstruct:rp,notInConstruct:sp}]}}function fC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function op(e){this.config.enter.autolinkProtocol.call(this,e)}function pC(e){this.config.exit.autolinkProtocol.call(this,e)}function hC(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 mC(e){this.config.exit.autolinkEmail.call(this,e)}function gC(e){this.exit(e)}function yC(e){rC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),bC]],{ignore:["link","linkReference"]})}function xC(e,i,l,r,u){let c="";if(!Fb(u)||(/^w/i.test(i)&&(l=i+l,i="",c="http://"),!vC(l)))return!1;const d=wC(l+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function bC(e,i,l,r){return!Fb(r,!0)||/[-\d_]$/.test(l)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+l,children:[{type:"text",value:i+"@"+l}]}}function vC(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function wC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let l=i[0],r=l.indexOf(")");const u=hx(e,"(");let c=hx(e,")");for(;r!==-1&&u>c;)e+=l.slice(0,r+1),l=l.slice(r+1),r=l.indexOf(")"),c++;return[e,l]}function Fb(e,i){const l=e.input.charCodeAt(e.index-1);return(e.index===0||hr(l)||Kc(l))&&(!i||l!==47)}Wb.peek=DC;function kC(){this.buffer()}function jC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SC(){this.buffer()}function CC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function TC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=ji(this.sliceSerialize(e)).toLowerCase(),l.label=i}function EC(e){this.exit(e)}function AC(e){const i=this.resume(),l=this.stack[this.stack.length-1];l.type,l.identifier=ji(this.sliceSerialize(e)).toLowerCase(),l.label=i}function NC(e){this.exit(e)}function DC(){return"["}function Wb(e,i,l,r){const u=l.createTracker(r);let c=u.move("[^");const d=l.enter("footnoteReference"),p=l.enter("reference");return c+=u.move(l.safe(l.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function _C(){return{enter:{gfmFootnoteCallString:kC,gfmFootnoteCall:jC,gfmFootnoteDefinitionLabelString:SC,gfmFootnoteDefinition:CC},exit:{gfmFootnoteCallString:TC,gfmFootnoteCall:EC,gfmFootnoteDefinitionLabelString:AC,gfmFootnoteDefinition:NC}}}function RC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:l,footnoteReference:Wb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function l(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
64
+ `:" ")+c.indentLines(c.containerFlow(r,p.current()),i?Kb:MC))),m(),g}}function MC(e,i,l){return i===0?e:Kb(e,i,l)}function Kb(e,i,l){return(l?"":" ")+e}const OC=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Xb.peek=BC;function zC(){return{canContainEols:["delete"],enter:{strikethrough:IC},exit:{strikethrough:UC}}}function LC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OC}],handlers:{delete:Xb}}}function IC(e){this.enter({type:"delete",children:[]},e)}function UC(e){this.exit(e)}function Xb(e,i,l,r){const u=l.createTracker(r),c=l.enter("strikethrough");let d=u.move("~~");return d+=l.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function BC(){return"~"}function qC(e){return e.length}function HC(e,i){const l=i||{},r=(l.align||[]).concat(),u=l.stringLength||qC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const M=[],I=[];let N=-1;for(e[b].length>m&&(m=e[b].length);++N<e[b].length;){const H=$C(e[b][N]);if(l.alignDelimiters!==!1){const $=u(H);I[N]=$,(g[N]===void 0||$>g[N])&&(g[N]=$)}M.push(H)}d[b]=M,p[b]=I}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=mx(r[x]);else{const M=mx(r);for(;++x<m;)c[x]=M}x=-1;const j=[],w=[];for(;++x<m;){const M=c[x];let I="",N="";M===99?(I=":",N=":"):M===108?I=":":M===114&&(N=":");let H=l.alignDelimiters===!1?1:Math.max(1,g[x]-I.length-N.length);const $=I+"-".repeat(H)+N;l.alignDelimiters!==!1&&(H=I.length+H+N.length,H>g[x]&&(g[x]=H),w[x]=H),j[x]=$}d.splice(1,0,j),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const M=d[b],I=p[b];x=-1;const N=[];for(;++x<m;){const H=M[x]||"";let $="",W="";if(l.alignDelimiters!==!1){const oe=g[x]-(I[x]||0),_=c[x];_===114?$=" ".repeat(oe):_===99?oe%2?($=" ".repeat(oe/2+.5),W=" ".repeat(oe/2-.5)):($=" ".repeat(oe/2),W=$):W=" ".repeat(oe)}l.delimiterStart!==!1&&!x&&N.push("|"),l.padding!==!1&&!(l.alignDelimiters===!1&&H==="")&&(l.delimiterStart!==!1||x)&&N.push(" "),l.alignDelimiters!==!1&&N.push($),N.push(H),l.alignDelimiters!==!1&&N.push(W),l.padding!==!1&&N.push(" "),(l.delimiterEnd!==!1||x!==m-1)&&N.push("|")}E.push(l.delimiterEnd===!1?N.join("").replace(/ +$/,""):N.join(""))}return E.join(`
65
+ `)}function $C(e){return e==null?"":String(e)}function mx(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function GC(e,i,l,r){const u=l.enter("blockquote"),c=l.createTracker(r);c.move("> "),c.shift(2);const d=l.indentLines(l.containerFlow(e,c.current()),VC);return u(),d}function VC(e,i,l){return">"+(l?"":" ")+e}function PC(e,i){return gx(e,i.inConstruct,!0)&&!gx(e,i.notInConstruct,!1)}function gx(e,i,l){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return l;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function yx(e,i,l,r){let u=-1;for(;++u<l.unsafe.length;)if(l.unsafe[u].character===`
66
+ `&&PC(l.stack,l.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
67
+ `}function YC(e,i){const l=String(e);let r=l.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=l.indexOf(i,u);return d}function FC(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function WC(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function KC(e,i,l,r){const u=WC(l),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(FC(e,l)){const x=l.enter("codeIndented"),j=l.indentLines(c,XC);return x(),j}const p=l.createTracker(r),g=u.repeat(Math.max(YC(c,u)+1,3)),m=l.enter("codeFenced");let b=p.move(g);if(e.lang){const x=l.enter(`codeFencedLang${d}`);b+=p.move(l.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=l.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(l.safe(e.meta,{before:b,after:`
68
68
  `,encode:["`"],...p.current()})),x()}return b+=p.move(`
69
69
  `),c&&(b+=p.move(c+`
70
- `)),b+=p.move(g),m(),b}function WC(e,i,l){return(l?"":" ")+e}function yh(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 KC(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("definition");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("[");return m+=g.move(l.safe(l.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":`
71
- `,...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function XC(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 Xo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Gc(e,i,l){const r=ps(e),u=ps(i);return r===void 0?u===void 0?l==="_"?{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}}Xb.peek=QC;function Xb(e,i,l,r){const u=XC(l),c=l.enter("emphasis"),d=l.createTracker(r),p=d.move(u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Gc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Xo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Gc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+Xo(x));const w=d.move(u);return c(),l.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function QC(e,i,l){return l.options.emphasis||"*"}function ZC(e,i){let l=!1;return mh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return l=!0,Ip}),!!((!e.depth||e.depth<3)&&oh(e)&&(i.options.setext||l))}function JC(e,i,l,r){const u=Math.max(Math.min(6,e.depth||1),1),c=l.createTracker(r);if(ZC(e,l)){const b=l.enter("headingSetext"),x=l.enter("phrasing"),j=l.containerPhrasing(e,{...c.current(),before:`
70
+ `)),b+=p.move(g),m(),b}function XC(e,i,l){return(l?"":" ")+e}function bh(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function QC(e,i,l,r){const u=bh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("definition");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("[");return m+=g.move(l.safe(l.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":`
71
+ `,...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function ZC(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Qo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vc(e,i,l){const r=hs(e),u=hs(i);return r===void 0?u===void 0?l==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qb.peek=JC;function Qb(e,i,l,r){const u=ZC(l),c=l.enter("emphasis"),d=l.createTracker(r),p=d.move(u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Vc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Qo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Vc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+Qo(x));const w=d.move(u);return c(),l.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function JC(e,i,l){return l.options.emphasis||"*"}function eT(e,i){let l=!1;return yh(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return l=!0,Up}),!!((!e.depth||e.depth<3)&&ch(e)&&(i.options.setext||l))}function tT(e,i,l,r){const u=Math.max(Math.min(6,e.depth||1),1),c=l.createTracker(r);if(eT(e,l)){const b=l.enter("headingSetext"),x=l.enter("phrasing"),j=l.containerPhrasing(e,{...c.current(),before:`
72
72
  `,after:`
73
73
  `});return x(),b(),j+`
74
74
  `+(u===1?"=":"-").repeat(j.length-(Math.max(j.lastIndexOf("\r"),j.lastIndexOf(`
75
75
  `))+1))}const d="#".repeat(u),p=l.enter("headingAtx"),g=l.enter("phrasing");c.move(d+" ");let m=l.containerPhrasing(e,{before:"# ",after:`
76
- `,...c.current()});return/^[\t ]/.test(m)&&(m=Xo(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,l.options.closeAtx&&(m+=" "+d),g(),p(),m}Qb.peek=eT;function Qb(e){return e.value||""}function eT(){return"<"}Zb.peek=tT;function Zb(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("image");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("![");return m+=g.move(l.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function tT(){return"!"}Jb.peek=nT;function Jb(e,i,l,r){const u=e.referenceType,c=l.enter("imageReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("![");const m=l.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function nT(){return"!"}ev.peek=iT;function ev(e,i,l){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<l.unsafe.length;){const d=l.unsafe[c],p=l.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function iT(){return"`"}function tv(e,i){const l=oh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(l===e.url||"mailto:"+l===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}nv.peek=lT;function nv(e,i,l,r){const u=yh(l),c=u==='"'?"Quote":"Apostrophe",d=l.createTracker(r);let p,g;if(tv(e,l)){const b=l.stack;l.stack=[],p=l.enter("autolink");let x=d.move("<");return x+=d.move(l.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),l.stack=b,x}p=l.enter("link"),g=l.enter("label");let m=d.move("[");return m+=d.move(l.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=l.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(l.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=l.enter("destinationRaw"),m+=d.move(l.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=l.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(l.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function lT(e,i,l){return tv(e,l)?"<":"["}iv.peek=aT;function iv(e,i,l,r){const u=e.referenceType,c=l.enter("linkReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("[");const m=l.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function aT(){return"["}function xh(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 rT(e){const i=xh(e),l=e.options.bulletOther;if(!l)return i==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+l+"`) to be different");return l}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 lv(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function oT(e,i,l,r){const u=l.enter("list"),c=l.bulletCurrent;let d=e.ordered?sT(l):xh(l);const p=e.ordered?d==="."?")":".":rT(l);let g=i&&l.bulletLastUsed?d===l.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(g=!0),lv(l)===d&&b){let x=-1;for(;++x<e.children.length;){const j=e.children[x];if(j&&j.type==="listItem"&&j.children&&j.children[0]&&j.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),l.bulletCurrent=d;const m=l.containerFlow(e,r);return l.bulletLastUsed=d,l.bulletCurrent=c,u(),m}function uT(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 cT(e,i,l,r){const u=uT(l);let c=l.bulletCurrent||xh(l);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(l.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=l.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=l.enter("listItem"),m=l.indentLines(l.containerFlow(e,p.current()),b);return g(),m;function b(x,j,w){return j?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function dT(e,i,l,r){const u=l.enter("paragraph"),c=l.enter("phrasing"),d=l.containerPhrasing(e,r);return c(),u(),d}const fT=Qc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pT(e,i,l,r){return(e.children.some(function(d){return fT(d)})?l.containerPhrasing:l.containerFlow).call(l,e,r)}function hT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}av.peek=mT;function av(e,i,l,r){const u=hT(l),c=l.enter("strong"),d=l.createTracker(r),p=d.move(u+u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Gc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Xo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Gc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+Xo(x));const w=d.move(u+u);return c(),l.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function mT(e,i,l){return l.options.strong||"*"}function gT(e,i,l,r){return l.safe(e.value,r)}function yT(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 xT(e,i,l){const r=(lv(l)+(l.options.ruleSpaces?" ":"")).repeat(yT(l));return l.options.ruleSpaces?r.slice(0,-1):r}const rv={blockquote:HC,break:mx,code:FC,definition:KC,emphasis:Xb,hardBreak:mx,heading:JC,html:Qb,image:Zb,imageReference:Jb,inlineCode:ev,link:nv,linkReference:iv,list:oT,listItem:cT,paragraph:dT,root:pT,strong:av,text:gT,thematicBreak:xT};function bT(){return{enter:{table:vT,tableData:gx,tableHeader:gx,tableRow:kT},exit:{codeText:jT,table:wT,tableData:op,tableHeader:op,tableRow:op}}}function vT(e){const i=e._align;this.enter({type:"table",align:i.map(function(l){return l==="none"?null:l}),children:[]},e),this.data.inTable=!0}function wT(e){this.exit(e),this.data.inTable=void 0}function kT(e){this.enter({type:"tableRow",children:[]},e)}function op(e){this.exit(e)}function gx(e){this.enter({type:"tableCell",children:[]},e)}function jT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,ST));const l=this.stack[this.stack.length-1];l.type,l.value=i,this.exit(e)}function ST(e,i){return i==="|"?i:e}function CT(e){const i=e||{},l=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=l?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
77
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:j,table:d,tableCell:g,tableRow:p}};function d(w,T,M,U){return m(b(w,M,U),w.align)}function p(w,T,M,U){const N=x(w,M,U),H=m([N]);return H.slice(0,H.indexOf(`
78
- `))}function g(w,T,M,U){const N=M.enter("tableCell"),H=M.enter("phrasing"),$=M.containerPhrasing(w,{...U,before:c,after:c});return H(),N(),$}function m(w,T){return BC(w,{align:T,alignDelimiters:r,padding:l,stringLength:u})}function b(w,T,M){const U=w.children;let N=-1;const H=[],$=T.enter("table");for(;++N<U.length;)H[N]=x(U[N],T,M);return $(),H}function x(w,T,M){const U=w.children;let N=-1;const H=[],$=T.enter("tableRow");for(;++N<U.length;)H[N]=g(U[N],w,T,M);return $(),H}function j(w,T,M){let U=rv.inlineCode(w,T,M);return M.stack.includes("tableCell")&&(U=U.replace(/\|/g,"\\$&")),U}}function TT(){return{exit:{taskListCheckValueChecked:yx,taskListCheckValueUnchecked:yx,paragraph:AT}}}function ET(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NT}}}function yx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function AT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const r=l.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===l&&(r.value=r.value.slice(1),r.value.length===0?l.children.shift():l.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,l.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function NT(e,i,l,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=l.createTracker(r);c&&p.move(d);let g=rv.listItem(e,i,l,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function DT(){return[oC(),NC(),MC(),bT(),TT()]}function _T(e){return{extensions:[uC(),DC(e),OC(),CT(e),ET()]}}const RT={tokenize:UT,partial:!0},sv={tokenize:BT,partial:!0},ov={tokenize:qT,partial:!0},uv={tokenize:HT,partial:!0},MT={tokenize:$T,partial:!0},cv={name:"wwwAutolink",tokenize:LT,previous:fv},dv={name:"protocolAutolink",tokenize:IT,previous:pv},Al={name:"emailAutolink",tokenize:zT,previous:hv},Zi={};function OT(){return{text:Zi}}let or=48;for(;or<123;)Zi[or]=Al,or++,or===58?or=65:or===91&&(or=97);Zi[43]=Al;Zi[45]=Al;Zi[46]=Al;Zi[95]=Al;Zi[72]=[Al,dv];Zi[104]=[Al,dv];Zi[87]=[Al,cv];Zi[119]=[Al,cv];function zT(e,i,l){const r=this;let u,c;return d;function d(x){return!Hp(x)||!hv.call(r,r.previous)||bh(r.events)?l(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return Hp(x)?(e.consume(x),p):x===64?(e.consume(x),g):l(x)}function g(x){return x===46?e.check(MT,b,m)(x):x===45||x===95||hn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&wn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):l(x)}}function LT(e,i,l){const r=this;return u;function u(d){return d!==87&&d!==119||!fv.call(r,r.previous)||bh(r.events)?l(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(RT,e.attempt(sv,e.attempt(ov,c),l),l)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function IT(e,i,l){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&pv.call(r,r.previous)&&!bh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):l(x)}function p(x){if(wn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const j=u.toLowerCase();if(j==="http"||j==="https")return e.consume(x),g}return l(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):l(x)}function m(x){return x===null||qc(x)||gt(x)||hr(x)||Wc(x)?l(x):e.attempt(sv,e.attempt(ov,b),l)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function UT(e,i,l){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):l(d)}function c(d){return d===null?l(d):i(d)}}function BT(e,i,l){let r,u,c;return d;function d(m){return m===46||m===95?e.check(uv,g,p)(m):m===null||gt(m)||hr(m)||m!==45&&Wc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?l(m):i(m)}}function qT(e,i){let l=0,r=0;return u;function u(d){return d===40?(l++,e.consume(d),u):d===41&&r<l?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(uv,i,c)(d):d===null||gt(d)||hr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function HT(e,i,l){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||gt(p)||hr(p)?i(p):l(p)}function u(p){return p===null||p===40||p===91||gt(p)||hr(p)?i(p):r(p)}function c(p){return wn(p)?d(p):l(p)}function d(p){return p===59?(e.consume(p),r):wn(p)?(e.consume(p),d):l(p)}}function $T(e,i,l){return r;function r(c){return e.consume(c),u}function u(c){return hn(c)?l(c):i(c)}}function fv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function pv(e){return!wn(e)}function hv(e){return!(e===47||Hp(e))}function Hp(e){return e===43||e===45||e===46||e===95||hn(e)}function bh(e){let i=e.length,l=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){l=!0;break}if(r._gfmAutolinkLiteralWalkedInto){l=!1;break}}return e.length>0&&!l&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const GT={tokenize:QT,partial:!0};function VT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:WT,continuation:{tokenize:KT},exit:XT}},text:{91:{name:"gfmFootnoteCall",tokenize:FT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PT,resolveTo:YT}}}}function PT(e,i,l){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return l(g);const m=ji(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?l(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function YT(e,i){let l=e.length;for(;l--;)if(e[l][1].type==="labelImage"&&e[l][0]==="enter"){e[l][1];break}e[l+1][1].type="data",e[l+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[l+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[l+3][1].end),end:Object.assign({},e[l+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[l+1],e[l+2],["enter",r,i],e[l+3],e[l+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(l,e.length-l+1,...p),e}function FT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?l(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||gt(x))return l(x);if(x===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return u.includes(ji(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):l(x)}return gt(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 WT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):l(T)}function b(T){if(d>999||T===93&&!p||T===null||T===91||gt(T))return l(T);if(T===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return c=ji(r.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),j}return gt(T)||(p=!0),d++,e.consume(T),T===92?x:b}function x(T){return T===91||T===92||T===93?(e.consume(T),d++,b):b(T)}function j(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),u.includes(c)||u.push(c),tt(e,w,"gfmFootnoteDefinitionWhitespace")):l(T)}function w(T){return i(T)}}function KT(e,i,l){return e.check(Zo,i,e.attempt(GT,i,l))}function XT(e){e.exit("gfmFootnoteDefinition")}function QT(e,i,l){const r=this;return tt(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):l(c)}}function ZT(e){let l=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return l==null&&(l=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},j=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Kn(j,j.length,0,Kc(w,d.slice(m+1,g),p)),Kn(j,j.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Kn(d,m-1,g-m+3,j),g=m+j.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return j;function j(T){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(T):(d.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const M=ps(m);if(T===126)return x>1?g(T):(d.consume(T),x++,w);if(x<2&&!l)return g(T);const U=d.exit("strikethroughSequenceTemporary"),N=ps(T);return U._open=!N||N===2&&!!M,U._close=!M||M===2&&!!N,p(T)}}}class JT{constructor(){this.map=[]}add(i,l,r){eE(this,i,l,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let l=this.map.length;const r=[];for(;l>0;)l-=1,r.push(i.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),i.length=this.map[l][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 eE(e,i,l,r){let u=0;if(!(l===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=l,e.map[u][2].push(...r);return}u+=1}e.map.push([i,l,r])}}function tE(e,i){let l=!1;const r=[];for(;i<e.length;){const u=e[i];if(l){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"&&(l=!0);i+=1}return r}function nE(){return{flow:{null:{name:"table",tokenize:iE,resolveAll:lE}}}}function iE(e,i,l){const r=this;let u=0,c=0,d;return p;function p(L){let ee=r.events.length-1;for(;ee>-1;){const ge=r.events[ee][1].type;if(ge==="lineEnding"||ge==="linePrefix")ee--;else break}const de=ee>-1?r.events[ee][1].type:null,Ae=de==="tableHead"||de==="tableRow"?_:g;return Ae===_&&r.parser.lazy[r.now().line]?l(L):Ae(L)}function g(L){return e.enter("tableHead"),e.enter("tableRow"),m(L)}function m(L){return L===124||(d=!0,c+=1),b(L)}function b(L){return L===null?l(L):Re(L)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),w):l(L):We(L)?tt(e,b,"whitespace")(L):(c+=1,d&&(d=!1,u+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(L)))}function x(L){return L===null||L===124||gt(L)?(e.exit("data"),b(L)):(e.consume(L),L===92?j:x)}function j(L){return L===92||L===124?(e.consume(L),x):x(L)}function w(L){return r.interrupt=!1,r.parser.lazy[r.now().line]?l(L):(e.enter("tableDelimiterRow"),d=!1,We(L)?tt(e,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):T(L))}function T(L){return L===45||L===58?U(L):L===124?(d=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),M):oe(L)}function M(L){return We(L)?tt(e,U,"whitespace")(L):U(L)}function U(L){return L===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),N):L===45?(c+=1,N(L)):L===null||Re(L)?W(L):oe(L)}function N(L){return L===45?(e.enter("tableDelimiterFiller"),H(L)):oe(L)}function H(L){return L===45?(e.consume(L),H):L===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(L))}function $(L){return We(L)?tt(e,W,"whitespace")(L):W(L)}function W(L){return L===124?T(L):L===null||Re(L)?!d||u!==c?oe(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(L)):oe(L)}function oe(L){return l(L)}function _(L){return e.enter("tableRow"),X(L)}function X(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),X):L===null||Re(L)?(e.exit("tableRow"),i(L)):We(L)?tt(e,X,"whitespace")(L):(e.enter("data"),ae(L))}function ae(L){return L===null||L===124||gt(L)?(e.exit("data"),X(L)):(e.consume(L),L===92?te:ae)}function te(L){return L===92||L===124?(e.consume(L),ae):ae(L)}}function lE(e,i){let l=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const j=new JT;for(;++l<e.length;){const w=e[l],T=w[1];w[0]==="enter"?T.type==="tableHead"?(p=!1,g!==0&&(xx(j,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(l,0,[["enter",m,i]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,l+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},j.add(l,0,[["enter",b,i]])),u=T.type==="tableDelimiterRow"?2:b?3:1):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=Tc(j,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=l)):T.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Tc(j,i,c,u,void 0,x)),c=d,d=[c[1],l,0,0])):T.type==="tableHead"?(p=!0,g=l):T.type==="tableRow"||T.type==="tableDelimiterRow"?(g=l,c[1]!==0?(d[0]=d[1],x=Tc(j,i,c,u,l,x)):d[1]!==0&&(x=Tc(j,i,d,u,l,x)),u=0):u&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(d[3]=l)}for(g!==0&&xx(j,i,g,m,b),j.consume(i.events),l=-1;++l<i.events.length;){const w=i.events[l];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=tE(i.events,l))}return e}function Tc(e,i,l,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";l[0]!==0&&(c.end=Object.assign({},cs(i.events,l[0])),e.add(l[0],0,[["exit",c,i]]));const g=cs(i.events,l[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(l[1],0,[["enter",c,i]]),l[2]!==0){const m=cs(i.events,l[2]),b=cs(i.events,l[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(l[2],0,[["enter",x,i]]),r!==2){const j=i.events[l[2]],w=i.events[l[3]];if(j[1].end=Object.assign({},w[1].end),j[1].type="chunkText",j[1].contentType="text",l[3]>l[2]+1){const T=l[2]+1,M=l[3]-l[2]-1;e.add(T,M,[])}}e.add(l[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},cs(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function xx(e,i,l,r,u){const c=[],d=cs(i.events,l);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(l+1,0,c)}function cs(e,i){const l=e[i],r=l[0]==="enter"?"start":"end";return l[1][r]}const aE={name:"tasklistCheck",tokenize:sE};function rE(){return{text:{91:aE}}}function sE(e,i,l){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?l(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return gt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):l(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):l(g)}function p(g){return Re(g)?i(g):We(g)?e.check({tokenize:oE},i,l)(g):l(g)}}function oE(e,i,l){return tt(e,r,"whitespace");function r(u){return u===null?l(u):i(u)}}function uE(e){return Cb([OT(),VT(),ZT(e),nE(),rE()])}const cE={};function dE(e){const i=this,l=e||cE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(uE(l)),c.push(DT()),d.push(_T(l))}function fE(e){const i=new Map;for(const l of e){if(!l.turnId)continue;if(l.event==="server.wakeup.started"){i.set(l.turnId,"wakeup");continue}if(l.event!=="server.turn")continue;const r=hE(l.data);i.set(l.turnId,typeof r.source=="string"?r.source:"web")}return i}function Vo(e,i){return!!(i&&e.includes(i))}function pE(e){var l;if((e==null?void 0:e.status)!=="failed")return null;const i=(l=e.error)==null?void 0:l.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function hE(e){return e&&typeof e=="object"?e:{}}const mE=["summary","message","status","instruction","description","reason","error","text"],bx=96,gE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),yE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),xE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),mv=new Set(["item/commandExecution/terminalInteraction"]),bE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function vE(e){if(e.event!=="codex.notification")return!1;const i=Qi(e.data);return typeof i.method=="string"&&mv.has(i.method)}function wE(e){if(yE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||gE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Qi(e.data),l=typeof i.method=="string"?i.method:"",r=Qi(i.params),u=Qi(r.item),c=typeof u.type=="string"?u.type:"";return!l.startsWith("item/")||mv.has(l)||l.endsWith("/delta")||l.endsWith("/outputDelta")||xE.has(c)?null:l}function gv(e,i){const l=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===l?bE.get(l)??yv(l):r}function mr(e,i=[]){const l=Qi(e),u=[...i,...mE.map(c=>Po(l[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=bx?u:`${u.slice(0,bx-3)}...`:"查看详情"}function $p(e,i=new Map){const l=Qi(e),r=typeof l.unreadCount=="number"&&l.unreadCount>0?Math.floor(l.unreadCount):0,c=(Array.isArray(l.senderWorkspaceIds)?Array.from(new Set(l.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:mr({},[p])}}function kE(e){const i=Qi(e),l=Array.isArray(i.offers)?i.offers.map(Qi).filter(c=>Object.keys(c).length>0):[],r=l.map(c=>{var d;return(d=Po(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=l.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:mr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function jE(e){const i=Qi(e),l=Po(i.actionType)??"",r=Qi(i.payload);return l==="seele_wakeup"||l==="seele_workspace_schedule_wakeup"?{title:(Po(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:mr(r,[Po(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:mr(r,[yv(l||"agent action")]),meta:"after turn"}}function yv(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function Po(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Qi(e){return e&&typeof e=="object"?e:{}}function Gp(e){const i=Vp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Vp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=EE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=TE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function xv(e,i){const l=wx(e),r=wx(i??"").replace(/\/+$/,"");return r&&(l===r||l.startsWith(`${r}/`))?l.slice(r.length+1)||".":l}function SE(e,i){if(e.length===0)return"File changed";const l=xv(e[0].path,i);return e.length===1?l:`${l} +${e.length-1}`}function CE(e){return e.reduce((i,l)=>({additions:i.additions+l.additions,deletions:i.deletions+l.deletions}),{additions:0,deletions:0})}function TE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:vx(e),deletions:0};if(i==="delete")return{additions:0,deletions:vx(e)};let l=0,r=0;for(const u of e.split(`
79
- `))u.startsWith("+")&&!u.startsWith("+++")?l+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:l,deletions:r}}function vx(e){const i=e.split(`
76
+ `,...c.current()});return/^[\t ]/.test(m)&&(m=Qo(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,l.options.closeAtx&&(m+=" "+d),g(),p(),m}Zb.peek=nT;function Zb(e){return e.value||""}function nT(){return"<"}Jb.peek=iT;function Jb(e,i,l,r){const u=bh(l),c=u==='"'?"Quote":"Apostrophe",d=l.enter("image");let p=l.enter("label");const g=l.createTracker(r);let m=g.move("![");return m+=g.move(l.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=l.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(l.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=l.enter("destinationRaw"),m+=g.move(l.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=l.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(l.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function iT(){return"!"}ev.peek=lT;function ev(e,i,l,r){const u=e.referenceType,c=l.enter("imageReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("![");const m=l.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function lT(){return"!"}tv.peek=aT;function tv(e,i,l){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<l.unsafe.length;){const d=l.unsafe[c],p=l.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function aT(){return"`"}function nv(e,i){const l=ch(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(l===e.url||"mailto:"+l===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}iv.peek=rT;function iv(e,i,l,r){const u=bh(l),c=u==='"'?"Quote":"Apostrophe",d=l.createTracker(r);let p,g;if(nv(e,l)){const b=l.stack;l.stack=[],p=l.enter("autolink");let x=d.move("<");return x+=d.move(l.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),l.stack=b,x}p=l.enter("link"),g=l.enter("label");let m=d.move("[");return m+=d.move(l.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=l.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(l.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=l.enter("destinationRaw"),m+=d.move(l.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=l.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(l.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function rT(e,i,l){return nv(e,l)?"<":"["}lv.peek=sT;function lv(e,i,l,r){const u=e.referenceType,c=l.enter("linkReference");let d=l.enter("label");const p=l.createTracker(r);let g=p.move("[");const m=l.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=l.stack;l.stack=[],d=l.enter("reference");const x=l.safe(l.associationId(e),{before:g,after:"]",...p.current()});return d(),l.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function sT(){return"["}function vh(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function oT(e){const i=vh(e),l=e.options.bulletOther;if(!l)return i==="*"?"-":"*";if(l!=="*"&&l!=="+"&&l!=="-")throw new Error("Cannot serialize items with `"+l+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(l===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+l+"`) to be different");return l}function uT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function av(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function cT(e,i,l,r){const u=l.enter("list"),c=l.bulletCurrent;let d=e.ordered?uT(l):vh(l);const p=e.ordered?d==="."?")":".":oT(l);let g=i&&l.bulletLastUsed?d===l.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&l.stack[l.stack.length-1]==="list"&&l.stack[l.stack.length-2]==="listItem"&&l.stack[l.stack.length-3]==="list"&&l.stack[l.stack.length-4]==="listItem"&&l.indexStack[l.indexStack.length-1]===0&&l.indexStack[l.indexStack.length-2]===0&&l.indexStack[l.indexStack.length-3]===0&&(g=!0),av(l)===d&&b){let x=-1;for(;++x<e.children.length;){const j=e.children[x];if(j&&j.type==="listItem"&&j.children&&j.children[0]&&j.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),l.bulletCurrent=d;const m=l.containerFlow(e,r);return l.bulletLastUsed=d,l.bulletCurrent=c,u(),m}function dT(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function fT(e,i,l,r){const u=dT(l);let c=l.bulletCurrent||vh(l);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(l.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=l.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=l.enter("listItem"),m=l.indentLines(l.containerFlow(e,p.current()),b);return g(),m;function b(x,j,w){return j?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function pT(e,i,l,r){const u=l.enter("paragraph"),c=l.enter("phrasing"),d=l.containerPhrasing(e,r);return c(),u(),d}const hT=Zc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function mT(e,i,l,r){return(e.children.some(function(d){return hT(d)})?l.containerPhrasing:l.containerFlow).call(l,e,r)}function gT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}rv.peek=yT;function rv(e,i,l,r){const u=gT(l),c=l.enter("strong"),d=l.createTracker(r),p=d.move(u+u);let g=d.move(l.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=Vc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Qo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),j=Vc(r.after.charCodeAt(0),x,u);j.inside&&(g=g.slice(0,-1)+Qo(x));const w=d.move(u+u);return c(),l.attentionEncodeSurroundingInfo={after:j.outside,before:b.outside},p+g+w}function yT(e,i,l){return l.options.strong||"*"}function xT(e,i,l,r){return l.safe(e.value,r)}function bT(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function vT(e,i,l){const r=(av(l)+(l.options.ruleSpaces?" ":"")).repeat(bT(l));return l.options.ruleSpaces?r.slice(0,-1):r}const sv={blockquote:GC,break:yx,code:KC,definition:QC,emphasis:Qb,hardBreak:yx,heading:tT,html:Zb,image:Jb,imageReference:ev,inlineCode:tv,link:iv,linkReference:lv,list:cT,listItem:fT,paragraph:pT,root:mT,strong:rv,text:xT,thematicBreak:vT};function wT(){return{enter:{table:kT,tableData:xx,tableHeader:xx,tableRow:ST},exit:{codeText:CT,table:jT,tableData:up,tableHeader:up,tableRow:up}}}function kT(e){const i=e._align;this.enter({type:"table",align:i.map(function(l){return l==="none"?null:l}),children:[]},e),this.data.inTable=!0}function jT(e){this.exit(e),this.data.inTable=void 0}function ST(e){this.enter({type:"tableRow",children:[]},e)}function up(e){this.exit(e)}function xx(e){this.enter({type:"tableCell",children:[]},e)}function CT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,TT));const l=this.stack[this.stack.length-1];l.type,l.value=i,this.exit(e)}function TT(e,i){return i==="|"?i:e}function ET(e){const i=e||{},l=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=l?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
77
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:j,table:d,tableCell:g,tableRow:p}};function d(w,E,M,I){return m(b(w,M,I),w.align)}function p(w,E,M,I){const N=x(w,M,I),H=m([N]);return H.slice(0,H.indexOf(`
78
+ `))}function g(w,E,M,I){const N=M.enter("tableCell"),H=M.enter("phrasing"),$=M.containerPhrasing(w,{...I,before:c,after:c});return H(),N(),$}function m(w,E){return HC(w,{align:E,alignDelimiters:r,padding:l,stringLength:u})}function b(w,E,M){const I=w.children;let N=-1;const H=[],$=E.enter("table");for(;++N<I.length;)H[N]=x(I[N],E,M);return $(),H}function x(w,E,M){const I=w.children;let N=-1;const H=[],$=E.enter("tableRow");for(;++N<I.length;)H[N]=g(I[N],w,E,M);return $(),H}function j(w,E,M){let I=sv.inlineCode(w,E,M);return M.stack.includes("tableCell")&&(I=I.replace(/\|/g,"\\$&")),I}}function AT(){return{exit:{taskListCheckValueChecked:bx,taskListCheckValueUnchecked:bx,paragraph:DT}}}function NT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_T}}}function bx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function DT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const l=this.stack[this.stack.length-1];l.type;const r=l.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===l&&(r.value=r.value.slice(1),r.value.length===0?l.children.shift():l.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,l.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function _T(e,i,l,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=l.createTracker(r);c&&p.move(d);let g=sv.listItem(e,i,l,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function RT(){return[cC(),_C(),zC(),wT(),AT()]}function MT(e){return{extensions:[dC(),RC(e),LC(),ET(e),NT()]}}const OT={tokenize:qT,partial:!0},ov={tokenize:HT,partial:!0},uv={tokenize:$T,partial:!0},cv={tokenize:GT,partial:!0},zT={tokenize:VT,partial:!0},dv={name:"wwwAutolink",tokenize:UT,previous:pv},fv={name:"protocolAutolink",tokenize:BT,previous:hv},Al={name:"emailAutolink",tokenize:IT,previous:mv},Zi={};function LT(){return{text:Zi}}let or=48;for(;or<123;)Zi[or]=Al,or++,or===58?or=65:or===91&&(or=97);Zi[43]=Al;Zi[45]=Al;Zi[46]=Al;Zi[95]=Al;Zi[72]=[Al,fv];Zi[104]=[Al,fv];Zi[87]=[Al,dv];Zi[119]=[Al,dv];function IT(e,i,l){const r=this;let u,c;return d;function d(x){return!$p(x)||!mv.call(r,r.previous)||wh(r.events)?l(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return $p(x)?(e.consume(x),p):x===64?(e.consume(x),g):l(x)}function g(x){return x===46?e.check(zT,b,m)(x):x===45||x===95||hn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&wn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):l(x)}}function UT(e,i,l){const r=this;return u;function u(d){return d!==87&&d!==119||!pv.call(r,r.previous)||wh(r.events)?l(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OT,e.attempt(ov,e.attempt(uv,c),l),l)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function BT(e,i,l){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&hv.call(r,r.previous)&&!wh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):l(x)}function p(x){if(wn(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const j=u.toLowerCase();if(j==="http"||j==="https")return e.consume(x),g}return l(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):l(x)}function m(x){return x===null||Hc(x)||gt(x)||hr(x)||Kc(x)?l(x):e.attempt(ov,e.attempt(uv,b),l)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function qT(e,i,l){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):l(d)}function c(d){return d===null?l(d):i(d)}}function HT(e,i,l){let r,u,c;return d;function d(m){return m===46||m===95?e.check(cv,g,p)(m):m===null||gt(m)||hr(m)||m!==45&&Kc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?l(m):i(m)}}function $T(e,i){let l=0,r=0;return u;function u(d){return d===40?(l++,e.consume(d),u):d===41&&r<l?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(cv,i,c)(d):d===null||gt(d)||hr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function GT(e,i,l){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||gt(p)||hr(p)?i(p):l(p)}function u(p){return p===null||p===40||p===91||gt(p)||hr(p)?i(p):r(p)}function c(p){return wn(p)?d(p):l(p)}function d(p){return p===59?(e.consume(p),r):wn(p)?(e.consume(p),d):l(p)}}function VT(e,i,l){return r;function r(c){return e.consume(c),u}function u(c){return hn(c)?l(c):i(c)}}function pv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function hv(e){return!wn(e)}function mv(e){return!(e===47||$p(e))}function $p(e){return e===43||e===45||e===46||e===95||hn(e)}function wh(e){let i=e.length,l=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){l=!0;break}if(r._gfmAutolinkLiteralWalkedInto){l=!1;break}}return e.length>0&&!l&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),l}const PT={tokenize:JT,partial:!0};function YT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:XT,continuation:{tokenize:QT},exit:ZT}},text:{91:{name:"gfmFootnoteCall",tokenize:KT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:FT,resolveTo:WT}}}}function FT(e,i,l){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return l(g);const m=ji(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?l(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function WT(e,i){let l=e.length;for(;l--;)if(e[l][1].type==="labelImage"&&e[l][0]==="enter"){e[l][1];break}e[l+1][1].type="data",e[l+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[l+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[l+3][1].end),end:Object.assign({},e[l+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[l+1],e[l+2],["enter",r,i],e[l+3],e[l+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(l,e.length-l+1,...p),e}function KT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?l(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||gt(x))return l(x);if(x===93){e.exit("chunkString");const j=e.exit("gfmFootnoteCallString");return u.includes(ji(r.sliceSerialize(j)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):l(x)}return gt(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 XT(e,i,l){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(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):l(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||gt(E))return l(E);if(E===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return c=ji(r.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),j}return gt(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 j(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),tt(e,w,"gfmFootnoteDefinitionWhitespace")):l(E)}function w(E){return i(E)}}function QT(e,i,l){return e.check(Jo,i,e.attempt(PT,i,l))}function ZT(e){e.exit("gfmFootnoteDefinition")}function JT(e,i,l){const r=this;return tt(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):l(c)}}function eE(e){let l=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return l==null&&(l=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},j=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&Kn(j,j.length,0,Xc(w,d.slice(m+1,g),p)),Kn(j,j.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),Kn(d,m-1,g-m+3,j),g=m+j.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return j;function j(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const M=hs(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!l)return g(E);const I=d.exit("strikethroughSequenceTemporary"),N=hs(E);return I._open=!N||N===2&&!!M,I._close=!M||M===2&&!!N,p(E)}}}class tE{constructor(){this.map=[]}add(i,l,r){nE(this,i,l,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let l=this.map.length;const r=[];for(;l>0;)l-=1,r.push(i.slice(this.map[l][0]+this.map[l][1]),this.map[l][2]),i.length=this.map[l][0];r.push(i.slice()),i.length=0;let u=r.pop();for(;u;){for(const c of u)i.push(c);u=r.pop()}this.map.length=0}}function nE(e,i,l,r){let u=0;if(!(l===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=l,e.map[u][2].push(...r);return}u+=1}e.map.push([i,l,r])}}function iE(e,i){let l=!1;const r=[];for(;i<e.length;){const u=e[i];if(l){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"&&(l=!0);i+=1}return r}function lE(){return{flow:{null:{name:"table",tokenize:aE,resolveAll:rE}}}}function aE(e,i,l){const r=this;let u=0,c=0,d;return p;function p(z){let te=r.events.length-1;for(;te>-1;){const ge=r.events[te][1].type;if(ge==="lineEnding"||ge==="linePrefix")te--;else break}const de=te>-1?r.events[te][1].type:null,Ae=de==="tableHead"||de==="tableRow"?_:g;return Ae===_&&r.parser.lazy[r.now().line]?l(z):Ae(z)}function g(z){return e.enter("tableHead"),e.enter("tableRow"),m(z)}function m(z){return z===124||(d=!0,c+=1),b(z)}function b(z){return z===null?l(z):Re(z)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),w):l(z):We(z)?tt(e,b,"whitespace")(z):(c+=1,d&&(d=!1,u+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(z)))}function x(z){return z===null||z===124||gt(z)?(e.exit("data"),b(z)):(e.consume(z),z===92?j:x)}function j(z){return z===92||z===124?(e.consume(z),x):x(z)}function w(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?l(z):(e.enter("tableDelimiterRow"),d=!1,We(z)?tt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):E(z))}function E(z){return z===45||z===58?I(z):z===124?(d=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),M):oe(z)}function M(z){return We(z)?tt(e,I,"whitespace")(z):I(z)}function I(z){return z===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),N):z===45?(c+=1,N(z)):z===null||Re(z)?W(z):oe(z)}function N(z){return z===45?(e.enter("tableDelimiterFiller"),H(z)):oe(z)}function H(z){return z===45?(e.consume(z),H):z===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),$):(e.exit("tableDelimiterFiller"),$(z))}function $(z){return We(z)?tt(e,W,"whitespace")(z):W(z)}function W(z){return z===124?E(z):z===null||Re(z)?!d||u!==c?oe(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(z)):oe(z)}function oe(z){return l(z)}function _(z){return e.enter("tableRow"),K(z)}function K(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),K):z===null||Re(z)?(e.exit("tableRow"),i(z)):We(z)?tt(e,K,"whitespace")(z):(e.enter("data"),ae(z))}function ae(z){return z===null||z===124||gt(z)?(e.exit("data"),K(z)):(e.consume(z),z===92?ee:ae)}function ee(z){return z===92||z===124?(e.consume(z),ae):ae(z)}}function rE(e,i){let l=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const j=new tE;for(;++l<e.length;){const w=e[l],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(vx(j,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},j.add(l,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,l+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},j.add(l,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=Ec(j,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=l)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=Ec(j,i,c,u,void 0,x)),c=d,d=[c[1],l,0,0])):E.type==="tableHead"?(p=!0,g=l):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=l,c[1]!==0?(d[0]=d[1],x=Ec(j,i,c,u,l,x)):d[1]!==0&&(x=Ec(j,i,d,u,l,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=l)}for(g!==0&&vx(j,i,g,m,b),j.consume(i.events),l=-1;++l<i.events.length;){const w=i.events[l];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=iE(i.events,l))}return e}function Ec(e,i,l,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";l[0]!==0&&(c.end=Object.assign({},ds(i.events,l[0])),e.add(l[0],0,[["exit",c,i]]));const g=ds(i.events,l[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(l[1],0,[["enter",c,i]]),l[2]!==0){const m=ds(i.events,l[2]),b=ds(i.events,l[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(l[2],0,[["enter",x,i]]),r!==2){const j=i.events[l[2]],w=i.events[l[3]];if(j[1].end=Object.assign({},w[1].end),j[1].type="chunkText",j[1].contentType="text",l[3]>l[2]+1){const E=l[2]+1,M=l[3]-l[2]-1;e.add(E,M,[])}}e.add(l[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},ds(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function vx(e,i,l,r,u){const c=[],d=ds(i.events,l);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(l+1,0,c)}function ds(e,i){const l=e[i],r=l[0]==="enter"?"start":"end";return l[1][r]}const sE={name:"tasklistCheck",tokenize:uE};function oE(){return{text:{91:sE}}}function uE(e,i,l){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?l(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return gt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):l(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):l(g)}function p(g){return Re(g)?i(g):We(g)?e.check({tokenize:cE},i,l)(g):l(g)}}function cE(e,i,l){return tt(e,r,"whitespace");function r(u){return u===null?l(u):i(u)}}function dE(e){return Tb([LT(),YT(),eE(e),lE(),oE()])}const fE={};function pE(e){const i=this,l=e||fE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(dE(l)),c.push(RT()),d.push(MT(l))}function hE(e){const i=new Map;for(const l of e){if(!l.turnId)continue;if(l.event==="server.wakeup.started"){i.set(l.turnId,"wakeup");continue}if(l.event!=="server.turn")continue;const r=gE(l.data);i.set(l.turnId,typeof r.source=="string"?r.source:"web")}return i}function Po(e,i){return!!(i&&e.includes(i))}function mE(e){var l;if((e==null?void 0:e.status)!=="failed")return null;const i=(l=e.error)==null?void 0:l.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function gE(e){return e&&typeof e=="object"?e:{}}const yE=["summary","message","status","instruction","description","reason","error","text"],wx=96,xE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),bE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),vE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),gv=new Set(["item/commandExecution/terminalInteraction"]),wE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function kE(e){if(e.event!=="codex.notification")return!1;const i=Qi(e.data);return typeof i.method=="string"&&gv.has(i.method)}function jE(e){if(bE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||xE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Qi(e.data),l=typeof i.method=="string"?i.method:"",r=Qi(i.params),u=Qi(r.item),c=typeof u.type=="string"?u.type:"";return!l.startsWith("item/")||gv.has(l)||l.endsWith("/delta")||l.endsWith("/outputDelta")||vE.has(c)?null:l}function yv(e,i){const l=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===l?wE.get(l)??xv(l):r}function mr(e,i=[]){const l=Qi(e),u=[...i,...yE.map(c=>Yo(l[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=wx?u:`${u.slice(0,wx-3)}...`:"查看详情"}function Gp(e,i=new Map){const l=Qi(e),r=typeof l.unreadCount=="number"&&l.unreadCount>0?Math.floor(l.unreadCount):0,c=(Array.isArray(l.senderWorkspaceIds)?Array.from(new Set(l.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:mr({},[p])}}function SE(e){const i=Qi(e),l=Array.isArray(i.offers)?i.offers.map(Qi).filter(c=>Object.keys(c).length>0):[],r=l.map(c=>{var d;return(d=Yo(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=l.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:mr({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function CE(e){const i=Qi(e),l=Yo(i.actionType)??"",r=Qi(i.payload);return l==="seele_wakeup"||l==="seele_workspace_schedule_wakeup"?{title:(Yo(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:mr(r,[Yo(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:mr(r,[xv(l||"agent action")]),meta:"after turn"}}function xv(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function Yo(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Qi(e){return e&&typeof e=="object"?e:{}}function Vp(e){const i=Pp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Pp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=NE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=AE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function bv(e,i){const l=jx(e),r=jx(i??"").replace(/\/+$/,"");return r&&(l===r||l.startsWith(`${r}/`))?l.slice(r.length+1)||".":l}function TE(e,i){if(e.length===0)return"File changed";const l=bv(e[0].path,i);return e.length===1?l:`${l} +${e.length-1}`}function EE(e){return e.reduce((i,l)=>({additions:i.additions+l.additions,deletions:i.deletions+l.deletions}),{additions:0,deletions:0})}function AE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:kx(e),deletions:0};if(i==="delete")return{additions:0,deletions:kx(e)};let l=0,r=0;for(const u of e.split(`
79
+ `))u.startsWith("+")&&!u.startsWith("+++")?l+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:l,deletions:r}}function kx(e){const i=e.split(`
80
80
  `).length;return e.endsWith(`
81
- `)?Math.max(0,i-1):i}function EE(e){const i=Vp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function wx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Vp(e){return e&&typeof e=="object"?e:{}}function AE(e,i,l){return l?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Pp="seele:authentication-required",bv=12,NE=3e3,Yp="seele.activeWorkspaceId",vv="seele.workspaceOrder",wv="seele.workspaceGroupOrder",kv="seele.workspaceDrafts",jv="seele.collapsedWorkspaceGroups",Sv="seele.sidebarWidth",kx=5,jx=275,DE=236,_E=420,Sx="default",Cx=300,RE=3,ME=10,OE=2,zE=13,LE=1.65,IE=20,UE=900;class Xi extends Error{constructor(l,r,u,c){super(l);kc(this,"detail");kc(this,"status");kc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const BE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],qE=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Mo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Cv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function pe(e){return`${Cv()}api/${e.replace(/^\/+/,"")}`}function vh(e=""){return`${Cv()}${e.replace(/^\/+/,"")}`}async function Gt(e,i){const l=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),l?`Response: ${l}`:"Response: <empty>"].join(`
82
- `);return new Xi(r,u,e.status,l)}function Ve(e){return e instanceof Xi?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function ur(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Se(e,i){if(!e.ok)throw await Gt(e,i)}function HE(e){return e instanceof Xi&&e.status===410&&e.body.includes('"turn_not_active"')}function $E(e){return e instanceof Xi&&e.status===409&&e.body.includes('"turn_not_running"')}function GE(e){return e instanceof Xi&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Tx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function VE(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 wh(e){return Math.max(DE,Math.min(_E,Math.round(e)))}function PE(){try{const e=window.localStorage.getItem(Sv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?wh(i):jx}catch{return jx}}function YE(e){try{window.localStorage.setItem(Sv,String(wh(e)))}catch{}}function up(e){Tv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function FE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function WE(e){if(!e)return;const i=window.getComputedStyle(e),l=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=l*RE+r+u,d=l*ME+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 KE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(OE,Math.max(1,i+1))}function XE(e){return Math.ceil(KE(e)*zE*LE+IE)}function Tv(e,i){const l=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=l}function QE(e){const i=e.getBoundingClientRect(),l=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<=l&&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:l-c.top,anchorTurnId:u.dataset.turnId}}function ZE(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(l=>l.dataset.turnId===i)??null:null}function Ex(e,i){Tv(e,()=>{const l=ZE(e,i.anchorTurnId);if(l&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=l.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function JE(e,i){let l=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{l||Ex(e,i)});Ex(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){l||(l=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function eA(){try{return window.localStorage.getItem(Yp)}catch{return null}}function cp(e){try{e?window.localStorage.setItem(Yp,e):window.localStorage.removeItem(Yp)}catch{}}function Ev(){try{const e=window.localStorage.getItem(vv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Av(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Nv(e){try{window.localStorage.setItem(wv,JSON.stringify(e))}catch{}}function zc(e){try{window.localStorage.setItem(vv,JSON.stringify(e))}catch{}}function Dv(){try{const e=window.localStorage.getItem(kv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(l=>typeof l[0]=="string"&&typeof l[1]=="string"))}catch{return{}}}function Ax(e){return e?Dv()[e]??"":""}function dp(e,i){if(e)try{const l=Dv();i?l[e]=i:delete l[e],window.localStorage.setItem(kv,JSON.stringify(l))}catch{}}function tA(){try{const e=window.localStorage.getItem(jv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(l=>typeof l=="string"):[])}catch{return new Set}}function fp(e){try{window.localStorage.setItem(jv,JSON.stringify(Array.from(e)))}catch{}}function Oo(e){const i=Ev();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function Ec(e){const i=Av();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:r.createdAt.localeCompare(u.createdAt)})}function pp(e){const i=new Set(e.map(u=>u.id)),l=Ev().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));zc([...l,...r])}function hp(e){const i=new Set(e.map(u=>u.id)),l=Av().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));Nv([...l,...r])}function nA(e,i){const l=e.getBoundingClientRect(),r=l.top+l.height/2;return i<r?"before":"after"}function iA(e,i,l,r){if(i===l)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===l);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===l),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function lA(e,i,l){if(i===l)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===l);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===l);return c.splice(p+1,0,d),c}function aA({authEnabled:e,currentUser:i,onLogout:l}){var Du,wt,Gr,ra;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,j]=D.useState(null),[w,T]=D.useState(null),[M,U]=D.useState("simple"),[N,H]=D.useState(null),[$,W]=D.useState(null),[oe,_]=D.useState(null),[X,ae]=D.useState(!1),[te,L]=D.useState(!1),[ee,de]=D.useState({}),[Ae,ge]=D.useState({}),[ue,V]=D.useState(null),[se,ye]=D.useState([]),[_e,O]=D.useState(null),[A,z]=D.useState(!1),[C,K]=D.useState(null),[me,Q]=D.useState("checking"),[xe,ze]=D.useState(null),[Ke,Rt]=D.useState(!1),[Kt,sn]=D.useState(null),[Pe,bt]=D.useState(!1),[Mt,on]=D.useState(null),[Oe,Ot]=D.useState(!1),[gn,Xt]=D.useState([]),[Si,Xn]=D.useState([]),[Nl,At]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[Dl,ie]=D.useState({profuseNotificationEnabled:!0}),[ce,Ce]=D.useState([]),[Ie,Xe]=D.useState(null),[Vt,Qn]=D.useState(null),[Pt,St]=D.useState(!1),[ut,rt]=D.useState(null),[Ci,kn]=D.useState(!1),[nd,xr]=D.useState(null),[br,_a]=D.useState(!1),[Ti,_l]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[nn,Rl]=D.useState("global"),[yt,Ji]=D.useState(null),[Ra,Ma]=D.useState(null),[ys,Ml]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[eu,vr]=D.useState({memory:"",items:[]}),[xs,bs]=D.useState({memory:"",items:[]}),[tu,Zn]=D.useState({memory:"",items:[]}),[Yt,zt]=D.useState([]),[qn,Ei]=D.useState(Mo),[Ol,zl]=D.useState({description:"",key:"",value:""}),[wr,Ai]=D.useState(null),[vs,Jn]=D.useState(()=>new Set),[Ni,el]=D.useState(!1),[Di,Ct]=D.useState(!1),[nu,ws]=D.useState(!1),[un,_i]=D.useState(null),[iu,lu]=D.useState(!0),[au,Ll]=D.useState(!1),[kr,Oa]=D.useState(!1),[Qt,Lt]=D.useState(null),[ru,Ri]=D.useState(null),[tl,ks]=D.useState(null),[jn,hi]=D.useState(null),[It,jr]=D.useState(null),[Il,Sr]=D.useState(null),[ei,su]=D.useState(()=>new Set),[za,ti]=D.useState(null),[js,Cr]=D.useState(null),[Ss,Ul]=D.useState(null),[ni,Mi]=D.useState(null),[Bl,yn]=D.useState(null),[La,Ia]=D.useState(()=>tA()),[ql,Oi]=D.useState(()=>PE()),[Cs,Ts]=D.useState(230),[zi,Ua]=D.useState(()=>Date.now()),ii=D.useRef(null),Hl=D.useRef(null),$l=D.useRef(null),li=D.useRef(null),Li=D.useRef(null),nl=D.useRef(!0),Es=D.useRef(null),Ii=D.useRef(null),Gl=D.useRef(null),Tr=D.useRef(new Set),Zt=D.useRef(!1),Ui=D.useRef([]),Ba=D.useRef(null),Vl=D.useRef(null),Bi=D.useRef(null),Sn=D.useRef(new Map),Jt=D.useRef(new Map),qi=D.useRef(new Set),il=D.useRef(new Map),Pl=D.useRef(new Map),Yl=D.useRef(new Set),Er=D.useRef(null),Ar=D.useRef(null),qa=D.useRef(!1),As=D.useRef(!1),Ne=p.find(y=>y.id===x),ou=(Ne==null?void 0:Ne.unreadTurnCount)??0,mi=p.find(y=>y.id===un),en=p.find(y=>y.id===yt),Nr=p.find(y=>y.id===za),Ha=D.useMemo(()=>{const k=Ec(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(B=>({id:B.id,title:B.title,conversations:[]})),S=new Map(k.map(B=>[B.id,B])),R=k[0];for(const B of p)(S.get(B.groupId)??R).conversations.push(B);return k.filter(B=>B.conversations.length>0||B.id!=="default")},[p,m]),lt=x!==null?ee[x]:null,Fl=(lt==null?void 0:lt.messages)??[],Dr=(lt==null?void 0:lt.events)??[],ll=jD(kD(Dr),x?Ae[x]:null),$a=cw(ll),Ns=(lt==null?void 0:lt.status)??(Ne==null?void 0:Ne.status)??"idle",_r=Jp(Ne,Ns),uu=un!==null?((Du=ee[un])==null?void 0:Du.status)??(mi==null?void 0:mi.status)??"idle":"idle",id=Jp(mi,uu),Ga=x?Jt.current.get(x)??null:null,cu=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),Ds=D.useMemo(()=>JA(Fl,Dr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],Ga,cu),[Ga,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,Dr,Fl,cu]),_s=D.useMemo(()=>new Set(Fl.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Fl]),Rs=x!==null&&ei.has(x),Ms=Ga?(wt=Ds.find(y=>Vo(y.turnIds,Ga)))==null?void 0:wt.activity:null,Rr=_r==="running"||Rs?Ms&&!uD(Ms)?Ms:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,ld=!Rr&&_r==="waiting"&&(Ne!=null&&Ne.nextWakeup)?{title:"Scheduled wakeup",detail:Fc(Ne.nextWakeup,zi),createdAt:Ne.nextWakeup.wakeAt,tone:"waiting"}:null,al=Rr??ld,Va=D.useMemo(()=>wD(Object.values(ee)),[ee]),ad=tb(C,Va);D.useEffect(()=>{Kl(),sd()},[]),D.useEffect(()=>()=>{Li.current!==null&&window.clearTimeout(Li.current)},[]),D.useEffect(()=>{Pa(!1),Pa(!0);const y=window.setInterval(()=>{Pa(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>Ua(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Yl.current=ei},[ei]),D.useEffect(()=>{Ba.current=x},[x]),D.useLayoutEffect(()=>{const y=Vl.current;if(Vl.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const S=li.current;S&&!S.disabled&&!document.querySelector('[aria-modal="true"]')&&S.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),D.useEffect(()=>{Ui.current=p},[p]),D.useEffect(()=>{x&&cp(x)},[x]),D.useLayoutEffect(()=>{if(!x||ou<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(R=>R.map(B=>B.id===x?{...B,unreadTurnCount:0}:B));try{await s2(x)}catch(R){y||console.error(R)}}},S=()=>void k();return k(),document.addEventListener("visibilitychange",S),()=>{y=!0,document.removeEventListener("visibilitychange",S)}},[x,ou]),D.useEffect(()=>{U("simple"),T(null),x&&(ai(x),Su(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void rd(),NE);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(Ax(x))},[x]),D.useEffect(()=>{!x||Ns!=="running"||Yl.current.has(x)||ct(x)},[x,Ns,ei]),D.useEffect(()=>{if(!x)return;let y=!1;return M2(x).then(k=>{y||ge(S=>({...S,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&nn==="workspace"&&Rl("global")},[x,nn]),D.useEffect(()=>{var y;if(Oe){if(!yt&&x){Ji(x);return}yt&&!p.some(k=>k.id===yt)&&Ji(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,Oe,yt]),D.useEffect(()=>{if(!Oe||i.role!=="admin")return;const y=window.setInterval(()=>void zs(),5e3);return()=>window.clearInterval(y)},[i.role,Oe]),D.useEffect(()=>{!Oe||nn!=="workspace"||Zn({memory:(en==null?void 0:en.memory)??"",items:(en==null?void 0:en.memoryItems)??[]})},[nn,Oe,en==null?void 0:en.id,en==null?void 0:en.memory,en==null?void 0:en.memoryItems]),D.useEffect(()=>{if(!Ni)return;x&&rl(x);const y=k=>{k.key==="Escape"&&el(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ni]),D.useEffect(()=>{if(!Oe)return;const y=k=>{k.key==="Escape"&&Ot(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Oe]),D.useEffect(()=>{var k;if(!Di)return;if(un&&!p.some(S=>S.id===un)){_i(x??((k=p[0])==null?void 0:k.id)??null);return}const y=S=>{S.key==="Escape"&&(Qt?Lt(null):Ct(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Di,Qt,un,p]),D.useEffect(()=>{if(!jn)return;jr(null);const y=k=>{k.key==="Escape"&&hi(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[jn]),D.useLayoutEffect(()=>{WE(li.current)},[r]),D.useLayoutEffect(()=>{const y=$l.current;if(!y)return;const k=()=>{const R=y.getBoundingClientRect();Ts(Math.ceil(R.height+44))};k();const S=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return S==null||S.observe(y),window.addEventListener("resize",k),()=>{S==null||S.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var J,be;const y=Hl.current;if(!y)return;const k=Es.current!==x;Es.current=x,k&&((J=Bi.current)==null||J.call(Bi),Bi.current=null);const S=Ii.current;if(S&&S.conversationId===x){(be=Bi.current)==null||be.call(Bi),Bi.current=JE(y,S),Ii.current=null,nl.current=!1;return}if(!k&&!nl.current)return;nl.current=!0,up(y);const R=requestAnimationFrame(()=>up(y)),B=window.setTimeout(()=>up(y),120);return()=>{cancelAnimationFrame(R),window.clearTimeout(B)}},[x,Dr.length,Fl.length]);async function du(){var k;const y=Hl.current;y&&(nl.current=FE(y),!(!x||!((k=lt==null?void 0:lt.history)!=null&&k.hasMoreBefore))&&(lt.loadingOlder||Tr.current.has(x)||y.scrollTop>96||await Ir(x)))}function Mr(y){var S,R;if(y.history)return y.history;const k=((S=y.timelineNodes)==null?void 0:S.filter(B=>B.parentId===null).reduce((B,J)=>B===null||J.timelineAt<B.timelineAt||J.timelineAt===B.timelineAt&&J.sequence<B.sequence?J:B,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((R=y.messages[0])==null?void 0:R.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function Hi(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),jr(y.url)}async function Wl(y,k){await navigator.clipboard.writeText(k),Sr(y),Li.current!==null&&window.clearTimeout(Li.current),Li.current=window.setTimeout(()=>{Sr(null),Li.current=null},1800)}function ve(y,k,S){const R=Date.now();ks({id:R,tone:y,text:k,detail:S}),window.setTimeout(()=>{ks(B=>(B==null?void 0:B.id)===R?null:B)},S?8e3:2400)}async function Kl(){try{const[y,k]=await Promise.all([Px(),Fx()]);Q("connected");const S=Ec(k);if(b(S),hp(S),y.length>0){const R=Oo(y),B=eA(),J=R.find(be=>be.id===B)??R[0];g(R),pp(R),j(J.id);return}g([]),cp(null),j(null)}catch(y){console.error(y),Q("error")}}async function xn(){const[y,k]=await Promise.all([Px(),Fx()]),S=Oo(y),R=Ec(k);b(R),hp(R),g(S),pp(S)}async function rd(){if(!Zt.current){Zt.current=!0;try{const y=await i2(),k=Ui.current,S=new Set(k.map(Te=>Te.id)),R=new Set(y.map(Te=>Te.id));if(S.size!==R.size||[...S].some(Te=>!R.has(Te))){await xn(),Q("connected");return}const B=Ba.current,J=B?y.find(Te=>Te.id===B)??null:null,be=new Map(y.map(Te=>[Te.id,Te])),He=Oo(k.map(Te=>{const we=be.get(Te.id);return we?{...Te,status:we.status,statusError:we.statusError,nextWakeup:we.nextWakeup,unreadTurnCount:we.unreadTurnCount,updatedAt:we.updatedAt}:Te}));g(He),pp(He),Q("connected"),J&&!Yl.current.has(J.id)&&et(J.id,Te=>({...Te,status:J.status}))}catch(y){console.error(y),Q("error")}finally{Zt.current=!1}}}async function sd(){try{const y=await J2();Q("connected"),V(y.version)}catch(y){console.error(y),Q("error")}}async function Pa(y){try{const k=await eD(y);k&&K(S=>tb(S,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function fu(){try{const y=await d2();Xt(y),Q("connected")}catch(y){console.error(y),Q("error")}}async function Xl(y){try{const k=await f2(y);Xn(k),Q("connected")}catch(k){console.error(k),Xn([]),Q("error")}}async function rl(y){try{const k=await p2(y);zt(k),Q("connected")}catch(k){console.error(k),zt([]),Q("error")}}async function od(y){try{const k=await h2();At(k),_l(k),y||(Ma(null),Ml(k)),Q("connected")}catch(k){console.error(k),Q("error")}}async function Or(){if(i.role==="admin")try{ie(await m2()),Q("connected")}catch(y){console.error(y),Q("error")}}async function Ya(y=!0){try{const k=await S2(y);Ce(k.models),Q("connected"),k.refreshing&&window.setTimeout(()=>void Ya(!1),1e3)}catch(k){console.error(k),Ce([]),Q("error")}}async function zr(){try{const y=await y2();Xe(y.codexVersion),Qn(y.codexReleasedAt),Q("connected")}catch(y){console.error(y),Xe(null),Qn(null),Q("error")}}async function Fa(y=!1){y&&_a(!0);try{const k=await C2(y);rt(k.job),xr(k.latest),Q("connected"),k.job&&k.job.status!=="running"&&Gl.current===k.job.id&&(Gl.current=null,k.job.status==="succeeded"?(await Promise.all([Ya(),zr()]),ve("success",`Codex CLI updated to ${td(k.job.currentVersion)}`)):ve("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),Q("error")}finally{y&&_a(!1)}}async function Os(){kn(!0);try{const y=await T2();Gl.current=y.id,rt(y),Q("connected")}catch(y){console.error(y);const k=Ve(y);ve("error","Unable to start Codex CLI update",k.detail??k.message)}finally{kn(!1)}}D.useEffect(()=>{if(!Pt||(ut==null?void 0:ut.status)!=="running")return;const y=window.setInterval(()=>void Fa(),1e3);return()=>window.clearInterval(y)},[Pt,ut==null?void 0:ut.id,ut==null?void 0:ut.status]);async function Lr(y){try{const k=await E2(y);Ma(k),Ml(k.effective),Q("connected")}catch(k){console.error(k),Ma(null),Q("error")}}async function pu(){try{const y=await A2();vr(y),bs(y),Q("connected")}catch(y){console.error(y),Q("error")}}async function hu(){if(i.role!=="admin"){ye([]);return}try{ye(await JD()),Q("connected")}catch(y){console.error(y),Q("error")}}async function zs(){if(i.role!=="admin"){O(null);return}z(!0);try{O(await g2()),Q("connected")}catch(y){console.error(y),Q("error")}finally{z(!1)}}async function mu(y=yt){const k=[fu(),od(y),zr(),Ya(),pu()];i.role==="admin"&&(k.push(hu()),k.push(zs()),k.push(Or())),y&&(k.push(Lr(y)),k.push(Xl(y)),k.push(rl(y))),await Promise.all(k)}function ud(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;L(!1),Ji(y),Rl(i.role==="admin"?"global":y?"workspace":"global"),Ot(!0),mu(y)}function cd(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;Ji(y),Rl(y?"workspace":"global"),Ot(!0),mu(y)}function gu(){var k;L(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;_i(y),Ri(null),Lt(null),Ct(!0),y&&bn(y)}async function bn(y){try{const k=await Xv(y);if(!k||k.status!=="running")return;Ll(!0);const S=await Qv(y,k);Ri(S),await ai(y),await xn(),S.warmupTurnId&&Ge(y,S.warmupTurnId),ve("success","Full-history runtime reset completed")}catch(k){const S=Ve(k);ve("error","Full-history runtime reset failed",S.message)}finally{Ll(!1)}}function Wa(y){Ji(y),Rl("workspace"),Lr(y),Xl(y),rl(y),Ei(Mo)}async function yu(y){y.preventDefault();try{if(nn==="workspace"&&yt){const k=await Xx(yt,L2(ys,Nl));Ma(k.settings),Ml(k.settings.effective),Dn(k.conversation),ve("success","Workspace settings saved")}else{const k=await N2(Ti);At(k),_l(k),yt&&await Lr(yt),ve("success","Global settings saved")}Q("connected")}catch(k){console.error(k),Q("error");const S=Ve(k);ve("error","Failed to save runtime settings",S.detail??S.message)}}async function xu(y){try{const k=await D2(y);ie(k),Q("connected"),ve("success","Deployment settings saved")}catch(k){console.error(k),Q("error");const S=Ve(k);throw ve("error","Failed to save deployment settings",S.detail??S.message),k}}async function bu(){var S;const y=mi;if(!y){ve("error","No workspace selected");return}if((((S=ee[y.id])==null?void 0:S.status)??y.status)==="running"){ve("error","Stop the running turn before resetting runtime");return}Oa(!0),Ri(null);try{const R=await Zx(y.id);Lt(R),Q("connected")}catch(R){console.error(R),Q("error");const B=Ve(R);ve("error","Failed to preview runtime reset",B.detail??B.message)}finally{Oa(!1)}}async function vu(y){const k=mi,S=Qt;if(!k||!S||S.conversationId!==k.id){ve("error","Reset preview is required");return}Ll(!0),Ri(null);try{const R=await Qx(k.id,{warmup:iu,previewFingerprint:S.fingerprint,selectedEntryIds:y});Ri(R),Lt(null),Q("connected"),await ai(k.id),await xn(),R.warmupTurnId&&Ge(k.id,R.warmupTurnId),ve("success","Runtime thread reset")}catch(R){console.error(R),Q("error");const B=Ve(R);ve("error","Failed to reset runtime thread",B.detail??B.message)}finally{Ll(!1)}}async function Ls(){var R;const y=mi;if(!y){ve("error","No workspace selected");return}if((((R=ee[y.id])==null?void 0:R.status)??y.status)==="running"){ve("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
81
+ `)?Math.max(0,i-1):i}function NE(e){const i=Pp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function jx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Pp(e){return e&&typeof e=="object"?e:{}}function DE(e,i,l){return l?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Yp="seele:authentication-required",Fp="seele:deployment-status-required",vv=12,_E=3e3,Wp="seele.activeWorkspaceId",wv="seele.workspaceOrder",kv="seele.workspaceGroupOrder",jv="seele.workspaceDrafts",Sv="seele.collapsedWorkspaceGroups",Cv="seele.sidebarWidth",Sx=5,Cx=275,RE=236,ME=420,Tx="default",Ex=300,OE=3,zE=10,LE=2,IE=13,UE=1.65,BE=20,qE=900;class Xi extends Error{constructor(l,r,u,c){super(l);jc(this,"detail");jc(this,"status");jc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const HE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],$E=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Oo={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function Tv(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function pe(e){return`${Tv()}api/${e.replace(/^\/+/,"")}`}function kh(e=""){return`${Tv()}${e.replace(/^\/+/,"")}`}async function Gt(e,i){const l=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),l?`Response: ${l}`:"Response: <empty>"].join(`
82
+ `);return new Xi(r,u,e.status,l)}function Ve(e){return e instanceof Xi?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function ur(e){const i=Ve(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function Se(e,i){if(!e.ok)throw await Gt(e,i)}function GE(e){return e instanceof Xi&&e.status===410&&e.body.includes('"turn_not_active"')}function VE(e){return e instanceof Xi&&e.status===409&&e.body.includes('"turn_not_running"')}function PE(e){return e instanceof Xi&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Ax(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function YE(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function jh(e){return Math.max(RE,Math.min(ME,Math.round(e)))}function FE(){try{const e=window.localStorage.getItem(Cv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?jh(i):Cx}catch{return Cx}}function WE(e){try{window.localStorage.setItem(Cv,String(jh(e)))}catch{}}function cp(e){Ev(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function KE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function XE(e){if(!e)return;const i=window.getComputedStyle(e),l=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=l*OE+r+u,d=l*zE+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function QE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(LE,Math.max(1,i+1))}function ZE(e){return Math.ceil(QE(e)*IE*UE+BE)}function Ev(e,i){const l=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=l}function JE(e){const i=e.getBoundingClientRect(),l=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<=l&&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:l-c.top,anchorTurnId:u.dataset.turnId}}function eA(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(l=>l.dataset.turnId===i)??null:null}function Nx(e,i){Ev(e,()=>{const l=eA(e,i.anchorTurnId);if(l&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=l.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function tA(e,i){let l=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{l||Nx(e,i)});Nx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){l||(l=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function nA(){try{return window.localStorage.getItem(Wp)}catch{return null}}function dp(e){try{e?window.localStorage.setItem(Wp,e):window.localStorage.removeItem(Wp)}catch{}}function Av(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Nv(){try{const e=window.localStorage.getItem(kv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(l=>typeof l=="string"):[]}catch{return[]}}function Dv(e){try{window.localStorage.setItem(kv,JSON.stringify(e))}catch{}}function Lc(e){try{window.localStorage.setItem(wv,JSON.stringify(e))}catch{}}function _v(){try{const e=window.localStorage.getItem(jv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(l=>typeof l[0]=="string"&&typeof l[1]=="string"))}catch{return{}}}function Dx(e){return e?_v()[e]??"":""}function fp(e,i){if(e)try{const l=_v();i?l[e]=i:delete l[e],window.localStorage.setItem(jv,JSON.stringify(l))}catch{}}function iA(){try{const e=window.localStorage.getItem(Sv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(l=>typeof l=="string"):[])}catch{return new Set}}function pp(e){try{window.localStorage.setItem(Sv,JSON.stringify(Array.from(e)))}catch{}}function zo(e){const i=Av();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function Ac(e){const i=Nv();if(i.length===0)return e;const l=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=l.get(r.id),d=l.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:r.createdAt.localeCompare(u.createdAt)})}function hp(e){const i=new Set(e.map(u=>u.id)),l=Av().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));Lc([...l,...r])}function mp(e){const i=new Set(e.map(u=>u.id)),l=Nv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!l.includes(u));Dv([...l,...r])}function lA(e,i){const l=e.getBoundingClientRect(),r=l.top+l.height/2;return i<r?"before":"after"}function aA(e,i,l,r){if(i===l)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===l);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===l),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function rA(e,i,l){if(i===l)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===l);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===l);return c.splice(p+1,0,d),c}function sA({authEnabled:e,currentUser:i,onLogout:l}){var _u,wt,Vr,ra;const[r,u]=D.useState(""),[c,d]=D.useState(new Set),[p,g]=D.useState([]),[m,b]=D.useState([]),[x,j]=D.useState(null),[w,E]=D.useState(null),[M,I]=D.useState("simple"),[N,H]=D.useState(null),[$,W]=D.useState(null),[oe,_]=D.useState(null),[K,ae]=D.useState(!1),[ee,z]=D.useState(!1),[te,de]=D.useState({}),[Ae,ge]=D.useState({}),[ue,V]=D.useState(null),[se,ye]=D.useState([]),[De,O]=D.useState(null),[S,q]=D.useState(!1),[T,Q]=D.useState(null),[me,X]=D.useState("checking"),[xe,ze]=D.useState(null),[Ke,Rt]=D.useState(!1),[Kt,sn]=D.useState(null),[Pe,bt]=D.useState(!1),[Mt,on]=D.useState(null),[Oe,Ot]=D.useState(!1),[gn,Xt]=D.useState([]),[Si,Xn]=D.useState([]),[Nl,At]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[Dl,ie]=D.useState({profuseNotificationEnabled:!0}),[ce,Ce]=D.useState([]),[Ie,Xe]=D.useState(null),[Vt,Qn]=D.useState(null),[Pt,St]=D.useState(!1),[ut,rt]=D.useState(null),[Ci,kn]=D.useState(!1),[id,br]=D.useState(null),[vr,_a]=D.useState(!1),[Ti,_l]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[nn,Rl]=D.useState("global"),[yt,Ji]=D.useState(null),[Ra,Ma]=D.useState(null),[xs,Ml]=D.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write"}),[tu,wr]=D.useState({memory:"",items:[]}),[bs,vs]=D.useState({memory:"",items:[]}),[nu,Zn]=D.useState({memory:"",items:[]}),[Yt,zt]=D.useState([]),[qn,Ei]=D.useState(Oo),[Ol,zl]=D.useState({description:"",key:"",value:""}),[kr,Ai]=D.useState(null),[ws,Jn]=D.useState(()=>new Set),[Ni,el]=D.useState(!1),[Di,Ct]=D.useState(!1),[iu,ks]=D.useState(!1),[un,_i]=D.useState(null),[lu,au]=D.useState(!0),[ru,Ll]=D.useState(!1),[jr,Oa]=D.useState(!1),[Qt,Lt]=D.useState(null),[su,Ri]=D.useState(null),[tl,js]=D.useState(null),[jn,hi]=D.useState(null),[It,Sr]=D.useState(null),[Il,Cr]=D.useState(null),[ei,ou]=D.useState(()=>new Set),[za,ti]=D.useState(null),[Ss,Tr]=D.useState(null),[Cs,Ul]=D.useState(null),[ni,Mi]=D.useState(null),[Bl,yn]=D.useState(null),[La,Ia]=D.useState(()=>iA()),[ql,Oi]=D.useState(()=>FE()),[Ts,Es]=D.useState(230),[zi,Ua]=D.useState(()=>Date.now()),ii=D.useRef(null),Hl=D.useRef(null),$l=D.useRef(null),li=D.useRef(null),Li=D.useRef(null),nl=D.useRef(!0),As=D.useRef(null),Ii=D.useRef(null),Gl=D.useRef(null),Er=D.useRef(new Set),Zt=D.useRef(!1),Ui=D.useRef([]),Ba=D.useRef(null),Vl=D.useRef(null),Bi=D.useRef(null),Sn=D.useRef(new Map),Jt=D.useRef(new Map),qi=D.useRef(new Set),il=D.useRef(new Map),Pl=D.useRef(new Map),Yl=D.useRef(new Set),Ar=D.useRef(null),Nr=D.useRef(null),qa=D.useRef(!1),Ns=D.useRef(!1),Ne=p.find(y=>y.id===x),uu=(Ne==null?void 0:Ne.unreadTurnCount)??0,mi=p.find(y=>y.id===un),en=p.find(y=>y.id===yt),Dr=p.find(y=>y.id===za),Ha=D.useMemo(()=>{const k=Ac(m.length>0?m:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(U=>({id:U.id,title:U.title,conversations:[]})),C=new Map(k.map(U=>[U.id,U])),R=k[0];for(const U of p)(C.get(U.groupId)??R).conversations.push(U);return k.filter(U=>U.conversations.length>0||U.id!=="default")},[p,m]),lt=x!==null?te[x]:null,Fl=(lt==null?void 0:lt.messages)??[],_r=(lt==null?void 0:lt.events)??[],ll=TD(CD(_r),x?Ae[x]:null),$a=dw(ll),Ds=(lt==null?void 0:lt.status)??(Ne==null?void 0:Ne.status)??"idle",Rr=th(Ne,Ds),cu=un!==null?((_u=te[un])==null?void 0:_u.status)??(mi==null?void 0:mi.status)??"idle":"idle",ld=th(mi,cu),Ga=x?Jt.current.get(x)??null:null,du=D.useMemo(()=>new Map(p.map(y=>[y.id,y.title])),[p]),_s=D.useMemo(()=>tN(Fl,_r,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],Ga,du),[Ga,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,_r,Fl,du]),Rs=D.useMemo(()=>new Set(Fl.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[Fl]),Ms=x!==null&&ei.has(x),Os=Ga?(wt=_s.find(y=>Po(y.turnIds,Ga)))==null?void 0:wt.activity:null,Mr=Rr==="running"||Ms?Os&&!fD(Os)?Os:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,ad=!Mr&&Rr==="waiting"&&(Ne!=null&&Ne.nextWakeup)?{title:"Scheduled wakeup",detail:Wc(Ne.nextWakeup,zi),createdAt:Ne.nextWakeup.wakeAt,tone:"waiting"}:null,al=Mr??ad,Va=D.useMemo(()=>SD(Object.values(te)),[te]),rd=nb(T,Va);D.useEffect(()=>{Kl(),od()},[]),D.useEffect(()=>()=>{Li.current!==null&&window.clearTimeout(Li.current)},[]),D.useEffect(()=>{Pa(!1),Pa(!0);const y=window.setInterval(()=>{Pa(!0)},300*1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{const y=window.setInterval(()=>Ua(Date.now()),1e3);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{Yl.current=ei},[ei]),D.useEffect(()=>{Ba.current=x},[x]),D.useLayoutEffect(()=>{const y=Vl.current;if(Vl.current=x,!x||y===x)return;const k=window.requestAnimationFrame(()=>{const C=li.current;C&&!C.disabled&&!document.querySelector('[aria-modal="true"]')&&C.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(k)},[x]),D.useEffect(()=>{Ui.current=p},[p]),D.useEffect(()=>{x&&dp(x)},[x]),D.useLayoutEffect(()=>{if(!x||uu<=0)return;let y=!1;const k=async()=>{if(document.visibilityState==="visible"){g(R=>R.map(U=>U.id===x?{...U,unreadTurnCount:0}:U));try{await u2(x)}catch(R){y||console.error(R)}}},C=()=>void k();return k(),document.addEventListener("visibilitychange",C),()=>{y=!0,document.removeEventListener("visibilitychange",C)}},[x,uu]),D.useEffect(()=>{I("simple"),E(null),x&&(ai(x),Cu(x))},[x]),D.useEffect(()=>{const y=window.setInterval(()=>void sd(),_E);return()=>window.clearInterval(y)},[]),D.useEffect(()=>{u(Dx(x))},[x]),D.useEffect(()=>{!x||Ds!=="running"||Yl.current.has(x)||ct(x)},[x,Ds,ei]),D.useEffect(()=>{if(!x)return;let y=!1;return L2(x).then(k=>{y||ge(C=>({...C,[x]:k}))}).catch(k=>console.error(k)),()=>{y=!0}},[x]),D.useEffect(()=>{!x&&nn==="workspace"&&Rl("global")},[x,nn]),D.useEffect(()=>{var y;if(Oe){if(!yt&&x){Ji(x);return}yt&&!p.some(k=>k.id===yt)&&Ji(x??((y=p[0])==null?void 0:y.id)??null)}},[x,p,Oe,yt]),D.useEffect(()=>{if(!Oe||i.role!=="admin")return;const y=window.setInterval(()=>void Ls(),5e3);return()=>window.clearInterval(y)},[i.role,Oe]),D.useEffect(()=>{!Oe||nn!=="workspace"||Zn({memory:(en==null?void 0:en.memory)??"",items:(en==null?void 0:en.memoryItems)??[]})},[nn,Oe,en==null?void 0:en.id,en==null?void 0:en.memory,en==null?void 0:en.memoryItems]),D.useEffect(()=>{if(!Ni)return;x&&rl(x);const y=k=>{k.key==="Escape"&&el(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Ni]),D.useEffect(()=>{if(!Oe)return;const y=k=>{k.key==="Escape"&&Ot(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Oe]),D.useEffect(()=>{var k;if(!Di)return;if(un&&!p.some(C=>C.id===un)){_i(x??((k=p[0])==null?void 0:k.id)??null);return}const y=C=>{C.key==="Escape"&&(Qt?Lt(null):Ct(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[x,Di,Qt,un,p]),D.useEffect(()=>{if(!jn)return;Sr(null);const y=k=>{k.key==="Escape"&&hi(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[jn]),D.useLayoutEffect(()=>{XE(li.current)},[r]),D.useLayoutEffect(()=>{const y=$l.current;if(!y)return;const k=()=>{const R=y.getBoundingClientRect();Es(Math.ceil(R.height+44))};k();const C=typeof ResizeObserver>"u"?null:new ResizeObserver(k);return C==null||C.observe(y),window.addEventListener("resize",k),()=>{C==null||C.disconnect(),window.removeEventListener("resize",k)}},[]),D.useLayoutEffect(()=>{var J,be;const y=Hl.current;if(!y)return;const k=As.current!==x;As.current=x,k&&((J=Bi.current)==null||J.call(Bi),Bi.current=null);const C=Ii.current;if(C&&C.conversationId===x){(be=Bi.current)==null||be.call(Bi),Bi.current=tA(y,C),Ii.current=null,nl.current=!1;return}if(!k&&!nl.current)return;nl.current=!0,cp(y);const R=requestAnimationFrame(()=>cp(y)),U=window.setTimeout(()=>cp(y),120);return()=>{cancelAnimationFrame(R),window.clearTimeout(U)}},[x,_r.length,Fl.length]);async function fu(){var k;const y=Hl.current;y&&(nl.current=KE(y),!(!x||!((k=lt==null?void 0:lt.history)!=null&&k.hasMoreBefore))&&(lt.loadingOlder||Er.current.has(x)||y.scrollTop>96||await Ur(x)))}function Or(y){var C,R;if(y.history)return y.history;const k=((C=y.timelineNodes)==null?void 0:C.filter(U=>U.parentId===null).reduce((U,J)=>U===null||J.timelineAt<U.timelineAt||J.timelineAt===U.timelineAt&&J.sequence<U.sequence?J:U,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((R=y.messages[0])==null?void 0:R.createdAt)??null,oldestTimelineAt:(k==null?void 0:k.timelineAt)??null,oldestTimelineSequence:(k==null?void 0:k.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function Hi(y){const k=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(k),Sr(y.url)}async function Wl(y,k){await navigator.clipboard.writeText(k),Cr(y),Li.current!==null&&window.clearTimeout(Li.current),Li.current=window.setTimeout(()=>{Cr(null),Li.current=null},1800)}function ve(y,k,C){const R=Date.now();js({id:R,tone:y,text:k,detail:C}),window.setTimeout(()=>{js(U=>(U==null?void 0:U.id)===R?null:U)},C?8e3:2400)}async function Kl(){try{const[y,k]=await Promise.all([Fx(),Kx()]);X("connected");const C=Ac(k);if(b(C),mp(C),y.length>0){const R=zo(y),U=nA(),J=R.find(be=>be.id===U)??R[0];g(R),hp(R),j(J.id);return}g([]),dp(null),j(null)}catch(y){console.error(y),X("error")}}async function xn(){const[y,k]=await Promise.all([Fx(),Kx()]),C=zo(y),R=Ac(k);b(R),mp(R),g(C),hp(C)}async function sd(){if(!Zt.current){Zt.current=!0;try{const y=await a2(),k=Ui.current,C=new Set(k.map(Te=>Te.id)),R=new Set(y.map(Te=>Te.id));if(C.size!==R.size||[...C].some(Te=>!R.has(Te))){await xn(),X("connected");return}const U=Ba.current,J=U?y.find(Te=>Te.id===U)??null:null,be=new Map(y.map(Te=>[Te.id,Te])),He=zo(k.map(Te=>{const we=be.get(Te.id);return we?{...Te,status:we.status,statusError:we.statusError,nextWakeup:we.nextWakeup,unreadTurnCount:we.unreadTurnCount,updatedAt:we.updatedAt}:Te}));g(He),hp(He),X("connected"),J&&!Yl.current.has(J.id)&&et(J.id,Te=>({...Te,status:J.status}))}catch(y){console.error(y),X("error")}finally{Zt.current=!1}}}async function od(){try{const y=await nD();X("connected"),V(y.version)}catch(y){console.error(y),X("error")}}async function Pa(y){try{const k=await iD(y);k&&Q(C=>nb(C,k))}catch(k){console.error("runtime rate-limit refresh failed",k)}}async function pu(){try{const y=await p2();Xt(y),X("connected")}catch(y){console.error(y),X("error")}}async function Xl(y){try{const k=await h2(y);Xn(k),X("connected")}catch(k){console.error(k),Xn([]),X("error")}}async function rl(y){try{const k=await m2(y);zt(k),X("connected")}catch(k){console.error(k),zt([]),X("error")}}async function ud(y){try{const k=await g2();At(k),_l(k),y||(Ma(null),Ml(k)),X("connected")}catch(k){console.error(k),X("error")}}async function zr(){if(i.role==="admin")try{ie(await y2()),X("connected")}catch(y){console.error(y),X("error")}}async function Ya(y=!0){try{const k=await E2(y);Ce(k.models),X("connected"),k.refreshing&&window.setTimeout(()=>void Ya(!1),1e3)}catch(k){console.error(k),Ce([]),X("error")}}async function Lr(){try{const y=await b2();Xe(y.codexVersion),Qn(y.codexReleasedAt),X("connected")}catch(y){console.error(y),Xe(null),Qn(null),X("error")}}async function Fa(y=!1){y&&_a(!0);try{const k=await A2(y);rt(k.job),br(k.latest),X("connected"),k.job&&k.job.status!=="running"&&Gl.current===k.job.id&&(Gl.current=null,k.job.status==="succeeded"?(await Promise.all([Ya(),Lr()]),ve("success",`Codex CLI updated to ${nd(k.job.currentVersion)}`)):ve("error","Codex CLI update failed",k.job.error??void 0))}catch(k){console.error(k),X("error")}finally{y&&_a(!1)}}async function zs(){kn(!0);try{const y=await N2();Gl.current=y.id,rt(y),X("connected")}catch(y){console.error(y);const k=Ve(y);ve("error","Unable to start Codex CLI update",k.detail??k.message)}finally{kn(!1)}}D.useEffect(()=>{if(!Pt||(ut==null?void 0:ut.status)!=="running")return;const y=window.setInterval(()=>void Fa(),1e3);return()=>window.clearInterval(y)},[Pt,ut==null?void 0:ut.id,ut==null?void 0:ut.status]);async function Ir(y){try{const k=await D2(y);Ma(k),Ml(k.effective),X("connected")}catch(k){console.error(k),Ma(null),X("error")}}async function hu(){try{const y=await _2();wr(y),vs(y),X("connected")}catch(y){console.error(y),X("error")}}async function mu(){if(i.role!=="admin"){ye([]);return}try{ye(await t_()),X("connected")}catch(y){console.error(y),X("error")}}async function Ls(){if(i.role!=="admin"){O(null);return}q(!0);try{O(await x2()),X("connected")}catch(y){console.error(y),X("error")}finally{q(!1)}}async function gu(y=yt){const k=[pu(),ud(y),Lr(),Ya(),hu()];i.role==="admin"&&(k.push(mu()),k.push(Ls()),k.push(zr())),y&&(k.push(Ir(y)),k.push(Xl(y)),k.push(rl(y))),await Promise.all(k)}function cd(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;z(!1),Ji(y),Rl(i.role==="admin"?"global":y?"workspace":"global"),Ot(!0),gu(y)}function dd(){var k;const y=x??((k=p[0])==null?void 0:k.id)??null;Ji(y),Rl(y?"workspace":"global"),Ot(!0),gu(y)}function yu(){var k;z(!1);const y=x??((k=p[0])==null?void 0:k.id)??null;_i(y),Ri(null),Lt(null),Ct(!0),y&&bn(y)}async function bn(y){try{const k=await Qv(y);if(!k||k.status!=="running")return;Ll(!0);const C=await Zv(y,k);Ri(C),await ai(y),await xn(),C.warmupTurnId&&Ge(y,C.warmupTurnId),ve("success","Full-history runtime reset completed")}catch(k){const C=Ve(k);ve("error","Full-history runtime reset failed",C.message)}finally{Ll(!1)}}function Wa(y){Ji(y),Rl("workspace"),Ir(y),Xl(y),rl(y),Ei(Oo)}async function xu(y){y.preventDefault();try{if(nn==="workspace"&&yt){const k=await Qx(yt,B2(xs,Nl));Ma(k.settings),Ml(k.settings.effective),Dn(k.conversation),ve("success","Workspace settings saved")}else{const k=await R2(Ti);At(k),_l(k),yt&&await Ir(yt),ve("success","Global settings saved")}X("connected")}catch(k){console.error(k),X("error");const C=Ve(k);ve("error","Failed to save runtime settings",C.detail??C.message)}}async function bu(y){try{const k=await M2(y);ie(k),X("connected"),ve("success","Deployment settings saved")}catch(k){console.error(k),X("error");const C=Ve(k);throw ve("error","Failed to save deployment settings",C.detail??C.message),k}}async function vu(){var C;const y=mi;if(!y){ve("error","No workspace selected");return}if((((C=te[y.id])==null?void 0:C.status)??y.status)==="running"){ve("error","Stop the running turn before resetting runtime");return}Oa(!0),Ri(null);try{const R=await Jx(y.id);Lt(R),X("connected")}catch(R){console.error(R),X("error");const U=Ve(R);ve("error","Failed to preview runtime reset",U.detail??U.message)}finally{Oa(!1)}}async function wu(y){const k=mi,C=Qt;if(!k||!C||C.conversationId!==k.id){ve("error","Reset preview is required");return}Ll(!0),Ri(null);try{const R=await Zx(k.id,{warmup:lu,previewFingerprint:C.fingerprint,selectedEntryIds:y});Ri(R),Lt(null),X("connected"),await ai(k.id),await xn(),R.warmupTurnId&&Ge(k.id,R.warmupTurnId),ve("success","Runtime thread reset")}catch(R){console.error(R),X("error");const U=Ve(R);ve("error","Failed to reset runtime thread",U.detail??U.message)}finally{Ll(!1)}}async function Is(){var R;const y=mi;if(!y){ve("error","No workspace selected");return}if((((R=te[y.id])==null?void 0:R.status)??y.status)==="running"){ve("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
83
83
 
84
- This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Ll(!0),Ri(null);try{const B=await Zx(y.id),J=await Qx(y.id,{warmup:!1,previewFingerprint:B.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Ri(J),Lt(null),yt===y.id&&Zn({memory:"",items:[]}),Q("connected"),await ai(y.id),await xn(),ve("success","Workspace started from blank context")}catch(B){console.error(B),Q("error");const J=Ve(B);ve("error","Failed to clear workspace context",J.detail??J.message)}finally{Ll(!1)}}}async function dd(y){const k=mi,S=Qt;if(!k||!S||S.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await _2(k.id,{previewFingerprint:S.fingerprint,selectedEntryIds:y}),Q("connected")}catch(R){console.error(R),Q("error");const B=Ve(R);throw ve("error","Failed to save reset defaults",B.detail??B.message),R}}async function Ql(y,k){try{const S=await Xx(y,{[k]:null});Ma(S.settings),Ml(S.settings.effective),Dn(S.conversation),Q("connected"),ve("success","Workspace override reset")}catch(S){console.error(S),Q("error"),ve("error","Failed to reset workspace override")}}async function Is(y){try{const k=await G2({memory:$2(y),items:y});return vr(k),bs(k),Q("connected"),ve("success","Base memory saved"),k.items}catch(k){throw console.error(k),Q("error"),ve("error","Failed to save memory"),k}}async function Ka(y,k){try{const S=await Mc(y,{memoryItems:k});return Dn(S),Zn({memory:S.memory,items:S.memoryItems}),Q("connected"),ve("success","Workspace memory saved"),S.memoryItems}catch(S){throw console.error(S),Q("error"),ve("error","Failed to save memory"),S}}async function Us(y){y.preventDefault();const k=Ol.key.trim();if(k)try{if(nn==="workspace"&&yt){const S=await P2(yt,k,Ol.value,Ol.description);Xn(R=>[...R.filter(B=>B.key!==S.variable.key),S.variable].sort((B,J)=>B.key.localeCompare(J.key))),Dn(S.conversation)}else{const S=await V2(k,Ol.value,Ol.description);Xt(R=>[...R.filter(B=>B.key!==S.key),S].sort((B,J)=>B.key.localeCompare(J.key)))}ve("success",nn==="workspace"?"Workspace environment saved":"Base environment saved"),zl({description:"",key:"",value:""}),Ai(null),Jn(S=>{const R=new Set(S);return R.delete(k),R}),Q("connected")}catch(S){console.error(S),Q("error"),ve("error","Failed to save environment")}}async function wu(y){try{if(nn==="workspace"&&yt){const k=await K2(yt,y);Xn(S=>S.filter(R=>R.key!==y)),Dn(k)}else await W2(y),Xt(k=>k.filter(S=>S.key!==y));wr===y&&(zl({description:"",key:"",value:""}),Ai(null),Jn(k=>{const S=new Set(k);return S.delete(y),S})),Q("connected"),ve("success",nn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),Q("error"),ve("error","Failed to delete environment")}}async function sl(y,k){if(k.preventDefault(),!qn.name.trim()){ve("error","Knowledge name is required");return}const S=I2(qn);try{const R=qn.id?await Q2(y,qn.id,S):await X2(y,S);zt(B=>[...B.filter(J=>J.id!==R.id),R].sort(Jx)),Ei(Mo),Q("connected"),ve("success","Workspace knowledge saved")}catch(R){console.error(R),Q("error"),ve("error","Failed to save workspace knowledge")}}async function Zl(y,k){try{await Z2(y,k),zt(S=>S.filter(R=>R.id!==k)),qn.id===k&&Ei(Mo),Q("connected"),ve("success","Workspace knowledge deleted")}catch(S){console.error(S),Q("error"),ve("error","Failed to delete workspace knowledge")}}function Bs(y){Rl("workspace"),Ei(U2(y))}function ku(y){zl({description:y.description,key:y.key,value:""}),Ai(y.key),Jn(k=>{const S=new Set(k);return S.delete(y.key),S}),qs(y.key,{preserveTypedValue:!0})}function ol(){const y=wr;zl({description:"",key:"",value:""}),Ai(null),y&&Jn(k=>{const S=new Set(k);return S.delete(y),S})}async function ju(y){await qs(y)}async function qs(y,k={}){try{const S=nn==="workspace"&&yt?await F2(yt,y):await Y2(y);zl(R=>R.key===y&&(!k.preserveTypedValue||R.value.length===0)?{...R,value:S}:R),Jn(R=>new Set(R).add(y)),Q("connected")}catch(S){console.error(S),Q("error")}}async function ai(y){const k=await Ep(y);Xs(k)}async function Hs(y){try{const k=await Ep(y);bi(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function Su(y){try{T(await nD(y))}catch(k){console.error(k)}}async function Xa(y){if(x)try{const k=await lD(x,y);T(y==="end"?null:k),y==="end"&&U("simple"),ve("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&ct(x,{waitMs:15e3}),await xn()}catch(k){ve("error","Complex task control failed",Ve(k).detail??Ve(k).message)}}async function $i(y){if(x)try{H(await iD(x,y))}catch(k){const S=Ve(k);ve("error","Failed to load complex task",S.detail??S.message)}}function Cu(){Ne&&_({sourceId:Ne.id,name:`${Ne.title} - Clone`,groupId:Ne.groupId})}async function $s(y){if(y.preventDefault(),!(!oe||!oe.name.trim())){ae(!0);try{const k=await aD(oe.sourceId,oe.name.trim(),oe.groupId);g(S=>Oo([k.conversation,...S])),j(k.conversation.id),_(null),L(!1),ve(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){ve("error","Clone failed",Ve(k).detail??Ve(k).message)}finally{ae(!1)}}}async function Hn(){if(Ne)try{const y=await rD(Ne.id);Dn(y.conversation),ve(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){ve("error","Clone retry failed",Ve(y).detail??Ve(y).message)}}async function Ir(y,k={}){var Te,we,Ut;const S=ee[y],R=(Te=S==null?void 0:S.history)==null?void 0:Te.oldestTimelineAt,B=(we=S==null?void 0:S.history)==null?void 0:we.oldestTimelineSequence,J=R&&B!==null&&B!==void 0?`${R}|${B}`:B==null?(Ut=S==null?void 0:S.history)==null?void 0:Ut.oldestMessageCreatedAt:String(B),be=Hl.current;if(!J||!be)return;if(k.preserveAnchor??!0){const kt=QE(be);Ii.current={anchorOffset:kt.anchorOffset,conversationId:y,previousScrollHeight:be.scrollHeight,anchorTurnId:kt.anchorTurnId}}else Ii.current=null;Tr.current.add(y),et(y,kt=>({...kt,loadingOlder:!0}));try{const kt=await Ep(y,{before:J,limit:bv});hl(kt)}catch(kt){console.error(kt),Ii.current=null}finally{Tr.current.delete(y),et(y,kt=>({...kt,loadingOlder:!1}))}}async function Cn(y,k){const S=await tD(y,k||void 0);g(R=>{const B=[S,...R];return zc(B.map(J=>J.id)),B}),j(S.id),L(!1)}function Jl(){L(!1),on({mode:"create",groupId:null,title:""})}function Ur(y){on({mode:"rename",groupId:y.id,title:y.title})}function Qa(){var y;L(!1),ze({mode:"create",conversationId:null,title:"",groupId:(Ne==null?void 0:Ne.groupId)??((y=m[0])==null?void 0:y.id)})}async function Br(y){var k;if(y.status!=="running"){bt(!0);try{await oD(y.id),de(R=>{const B={...R};return delete B[y.id],B});const S=p.filter(R=>R.id!==y.id);if(zc(S.map(R=>R.id)),dp(y.id,""),g(S),x===y.id){const R=((k=S[0])==null?void 0:k.id)??null;cp(R),j(R)}(xe==null?void 0:xe.conversationId)===y.id&&cl(),sn(null),ve("success","Workspace moved to recycle")}catch(S){const R=Ve(S);ve("error","Failed to move workspace to recycle",R.detail??R.message)}finally{bt(!1)}}}async function Gs(y){if(!(y.id===Sx||!window.confirm(`Delete group "${y.title}"?
84
+ This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Ll(!0),Ri(null);try{const U=await Jx(y.id),J=await Zx(y.id,{warmup:!1,previewFingerprint:U.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Ri(J),Lt(null),yt===y.id&&Zn({memory:"",items:[]}),X("connected"),await ai(y.id),await xn(),ve("success","Workspace started from blank context")}catch(U){console.error(U),X("error");const J=Ve(U);ve("error","Failed to clear workspace context",J.detail??J.message)}finally{Ll(!1)}}}async function fd(y){const k=mi,C=Qt;if(!k||!C||C.conversationId!==k.id)throw new Error("Reset preview is no longer current.");try{await O2(k.id,{previewFingerprint:C.fingerprint,selectedEntryIds:y}),X("connected")}catch(R){console.error(R),X("error");const U=Ve(R);throw ve("error","Failed to save reset defaults",U.detail??U.message),R}}async function Ql(y,k){try{const C=await Qx(y,{[k]:null});Ma(C.settings),Ml(C.settings.effective),Dn(C.conversation),X("connected"),ve("success","Workspace override reset")}catch(C){console.error(C),X("error"),ve("error","Failed to reset workspace override")}}async function Us(y){try{const k=await Y2({memory:P2(y),items:y});return wr(k),vs(k),X("connected"),ve("success","Base memory saved"),k.items}catch(k){throw console.error(k),X("error"),ve("error","Failed to save memory"),k}}async function Ka(y,k){try{const C=await Oc(y,{memoryItems:k});return Dn(C),Zn({memory:C.memory,items:C.memoryItems}),X("connected"),ve("success","Workspace memory saved"),C.memoryItems}catch(C){throw console.error(C),X("error"),ve("error","Failed to save memory"),C}}async function Bs(y){y.preventDefault();const k=Ol.key.trim();if(k)try{if(nn==="workspace"&&yt){const C=await W2(yt,k,Ol.value,Ol.description);Xn(R=>[...R.filter(U=>U.key!==C.variable.key),C.variable].sort((U,J)=>U.key.localeCompare(J.key))),Dn(C.conversation)}else{const C=await F2(k,Ol.value,Ol.description);Xt(R=>[...R.filter(U=>U.key!==C.key),C].sort((U,J)=>U.key.localeCompare(J.key)))}ve("success",nn==="workspace"?"Workspace environment saved":"Base environment saved"),zl({description:"",key:"",value:""}),Ai(null),Jn(C=>{const R=new Set(C);return R.delete(k),R}),X("connected")}catch(C){console.error(C),X("error"),ve("error","Failed to save environment")}}async function ku(y){try{if(nn==="workspace"&&yt){const k=await Z2(yt,y);Xn(C=>C.filter(R=>R.key!==y)),Dn(k)}else await Q2(y),Xt(k=>k.filter(C=>C.key!==y));kr===y&&(zl({description:"",key:"",value:""}),Ai(null),Jn(k=>{const C=new Set(k);return C.delete(y),C})),X("connected"),ve("success",nn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(k){console.error(k),X("error"),ve("error","Failed to delete environment")}}async function sl(y,k){if(k.preventDefault(),!qn.name.trim()){ve("error","Knowledge name is required");return}const C=q2(qn);try{const R=qn.id?await eD(y,qn.id,C):await J2(y,C);zt(U=>[...U.filter(J=>J.id!==R.id),R].sort(eb)),Ei(Oo),X("connected"),ve("success","Workspace knowledge saved")}catch(R){console.error(R),X("error"),ve("error","Failed to save workspace knowledge")}}async function Zl(y,k){try{await tD(y,k),zt(C=>C.filter(R=>R.id!==k)),qn.id===k&&Ei(Oo),X("connected"),ve("success","Workspace knowledge deleted")}catch(C){console.error(C),X("error"),ve("error","Failed to delete workspace knowledge")}}function qs(y){Rl("workspace"),Ei(H2(y))}function ju(y){zl({description:y.description,key:y.key,value:""}),Ai(y.key),Jn(k=>{const C=new Set(k);return C.delete(y.key),C}),Hs(y.key,{preserveTypedValue:!0})}function ol(){const y=kr;zl({description:"",key:"",value:""}),Ai(null),y&&Jn(k=>{const C=new Set(k);return C.delete(y),C})}async function Su(y){await Hs(y)}async function Hs(y,k={}){try{const C=nn==="workspace"&&yt?await X2(yt,y):await K2(y);zl(R=>R.key===y&&(!k.preserveTypedValue||R.value.length===0)?{...R,value:C}:R),Jn(R=>new Set(R).add(y)),X("connected")}catch(C){console.error(C),X("error")}}async function ai(y){const k=await Ap(y);Qs(k)}async function $s(y){try{const k=await Ap(y);bi(k)}catch(k){console.warn("Failed to synchronize timeline before turn stream",k)}}async function Cu(y){try{E(await aD(y))}catch(k){console.error(k)}}async function Xa(y){if(x)try{const k=await sD(x,y);E(y==="end"?null:k),y==="end"&&I("simple"),ve("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&ct(x,{waitMs:15e3}),await xn()}catch(k){ve("error","Complex task control failed",Ve(k).detail??Ve(k).message)}}async function $i(y){if(x)try{H(await rD(x,y))}catch(k){const C=Ve(k);ve("error","Failed to load complex task",C.detail??C.message)}}function Tu(){Ne&&_({sourceId:Ne.id,name:`${Ne.title} - Clone`,groupId:Ne.groupId})}async function Gs(y){if(y.preventDefault(),!(!oe||!oe.name.trim())){ae(!0);try{const k=await oD(oe.sourceId,oe.name.trim(),oe.groupId);g(C=>zo([k.conversation,...C])),j(k.conversation.id),_(null),z(!1),ve(k.error?"error":"success",k.error?"Clone created, initialization failed":"Workspace cloned",k.error??void 0)}catch(k){ve("error","Clone failed",Ve(k).detail??Ve(k).message)}finally{ae(!1)}}}async function Hn(){if(Ne)try{const y=await uD(Ne.id);Dn(y.conversation),ve(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){ve("error","Clone retry failed",Ve(y).detail??Ve(y).message)}}async function Ur(y,k={}){var Te,we,Ut;const C=te[y],R=(Te=C==null?void 0:C.history)==null?void 0:Te.oldestTimelineAt,U=(we=C==null?void 0:C.history)==null?void 0:we.oldestTimelineSequence,J=R&&U!==null&&U!==void 0?`${R}|${U}`:U==null?(Ut=C==null?void 0:C.history)==null?void 0:Ut.oldestMessageCreatedAt:String(U),be=Hl.current;if(!J||!be)return;if(k.preserveAnchor??!0){const kt=JE(be);Ii.current={anchorOffset:kt.anchorOffset,conversationId:y,previousScrollHeight:be.scrollHeight,anchorTurnId:kt.anchorTurnId}}else Ii.current=null;Er.current.add(y),et(y,kt=>({...kt,loadingOlder:!0}));try{const kt=await Ap(y,{before:J,limit:vv});hl(kt)}catch(kt){console.error(kt),Ii.current=null}finally{Er.current.delete(y),et(y,kt=>({...kt,loadingOlder:!1}))}}async function Cn(y,k){const C=await lD(y,k||void 0);g(R=>{const U=[C,...R];return Lc(U.map(J=>J.id)),U}),j(C.id),z(!1)}function Jl(){z(!1),on({mode:"create",groupId:null,title:""})}function Br(y){on({mode:"rename",groupId:y.id,title:y.title})}function Qa(){var y;z(!1),ze({mode:"create",conversationId:null,title:"",groupId:(Ne==null?void 0:Ne.groupId)??((y=m[0])==null?void 0:y.id)})}async function qr(y){var k;if(y.status!=="running"){bt(!0);try{await dD(y.id),de(R=>{const U={...R};return delete U[y.id],U});const C=p.filter(R=>R.id!==y.id);if(Lc(C.map(R=>R.id)),fp(y.id,""),g(C),x===y.id){const R=((k=C[0])==null?void 0:k.id)??null;dp(R),j(R)}(xe==null?void 0:xe.conversationId)===y.id&&cl(),sn(null),ve("success","Workspace moved to recycle")}catch(C){const R=Ve(C);ve("error","Failed to move workspace to recycle",R.detail??R.message)}finally{bt(!1)}}}async function Vs(y){if(!(y.id===Tx||!window.confirm(`Delete group "${y.title}"?
85
85
 
86
- Workspaces in this group will move to Default.`)))try{const S=await c2(y.id),R=Ec(S.groups);b(R),hp(R),g(S.conversations),Ia(B=>{const J=new Set(B);return J.delete(y.id),fp(J),J})}catch(S){console.error(S)}}function ul(y){ze({mode:"rename",conversationId:y.id,title:y.title})}function cl(){Rt(!1),ze(null)}function dl(){on(null)}async function ea(y,k){const S=k.trim(),R=p.find(J=>J.id===y);if(!R||!S||S===R.title){cl();return}const B=await Mc(y,{title:S});Dn(B),cl()}function fd(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function cn(y){return y instanceof Element&&!!y.closest("input, button")}function Vs(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".session-item[data-workspace-id]"):null}function ri(y,k){const S=document.elementFromPoint(y,k);return S instanceof HTMLElement?S.closest(".workspace-group[data-group-id]"):null}function Tu(y,k,S){const R=Vs(k,S),B=R==null?void 0:R.dataset.workspaceId;if(R&&B&&B!==y){Mi({kind:"workspace",id:B,position:nA(R,S)});return}const J=ri(k,S),be=J==null?void 0:J.dataset.groupId;if(!be){Mi(null);return}Mi({kind:"group",id:be})}function qr(y,k){cn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Er.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function fl(y,k){const S=Er.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(za!==k){if(R<kx)return;ti(k),Mi(null)}y.preventDefault(),yn({x:y.clientX,y:y.clientY}),Tu(k,y.clientX,y.clientY)}async function Ps(y,k){var be;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Er.current=null;const S=za===k;S&&(qa.current=!0);const R=ni;if(!S||!R){ti(null),Mi(null),yn(null);return}const B=p.find(He=>He.id===k),J=R.kind==="group"?R.id:(be=p.find(He=>He.id===R.id))==null?void 0:be.groupId;if(!B||!J){ti(null),Mi(null),yn(null);return}if(g(He=>{const Te=R.kind==="workspace"?iA(He.map(we=>we.id===k?{...we,groupId:J}:we),k,R.id,R.position):[...He.filter(we=>we.id!==k),{...B,groupId:J}];return zc(Te.map(we=>we.id)),Te}),B.groupId!==J)try{const He=await Mc(k,{groupId:J});Dn(He)}catch(He){console.error(He),await xn()}ti(null),Mi(null),yn(null)}function Eu(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Er.current=null,ti(null),Mi(null),yn(null)}function Ys(y,k){y.currentTarget.setPointerCapture(y.pointerId),Ar.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Au(y,k){const S=Ar.current;if(!S||S.id!==k||S.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-S.startX,y.clientY-S.startY);if(js!==k){if(R<kx)return;Cr(k),Ul(null)}y.preventDefault();const B=ri(y.clientX,y.clientY),J=B==null?void 0:B.dataset.groupId;Ul(J&&J!==k?J:null)}function Tn(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const S=js===k;S&&(y.preventDefault(),As.current=!0);const R=Ss;S&&R&&b(B=>{const J=lA(B,k,R);return Nv(J.map(be=>be.id)),J}),Ar.current=null,Cr(null),Ul(null)}function ta(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ar.current=null,Cr(null),Ul(null)}function na(y){const k=y.target.value;ze(S=>S&&{...S,title:k})}function Hr(y){const k=y.target.value;ze(S=>S&&{...S,groupId:k})}function Za(y){const k=y.target.value;on(S=>S&&{...S,title:k})}async function En(y){if(y.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Rt(!0);try{if(xe.mode==="create"){await Cn(k,xe.groupId),cl();return}xe.conversationId&&await ea(xe.conversationId,k)}catch(S){console.error(S);const R=Ve(S);ve("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",R.detail??R.message)}finally{Rt(!1)}}}function ln(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),cl())}async function Gi(y){if(y.preventDefault(),!Mt)return;const k=Mt.title.trim();if(k)try{if(Mt.mode==="rename"){if(!Mt.groupId)return;const R=await u2(Mt.groupId,{title:k});b(B=>B.map(J=>J.id===R.id?R:J)),dl();return}const S=await o2(k);b(R=>[...R,S]),Ia(R=>{const B=new Set(R);return B.delete(S.id),fp(B),B}),dl()}catch(S){console.error(S)}}function An(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),dl())}async function si(y){y.preventDefault(),await Fs()}function gi(y){u(y),dp(x,y)}function Ja(y,k){Ax(y).trim()===k&&dp(y,""),x===y&&u(S=>S.trim()===k?"":S)}function yi(y,k){d(S=>{const R=new Set(S);return k?R.add(y):R.delete(y),R})}function er(y){const k=Ve(y);ve("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function Fs(y={}){const k=r.trim();if(!k)return;if(!x){Qa();return}const S=x,R=Jt.current.has(S),B=qi.current.has(S);if(B)return;if(_r==="running"||Rs||R||B){if(y.forceNewTurn&&!w){await Vi(S,k);return}await Nn(S,k);return}qi.current.add(S),yi(S,!0);const J=`local-${Date.now()}`;et(S,Te=>({...Te,messages:[...Te.messages,{id:J,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),dn(S,"running"),_n(S,!0);const be=new AbortController;Sn.current.set(S,be);let He=!1;try{let Te=null;const we=pe(`conversations/${S}/turns`),Ut=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(Ut.ok){const fn=await Ut.json();if(!fn.turnId)throw new Error("Turn did not return a turn id");if(Te=fn.turnId,(M==="complex"||w)&&(Su(S),U("simple")),!fn.message)throw new Error("Turn did not return the persisted message");ia(S,J,fn.message,Te),He=!0,Ja(S,k)}else{const fn=await VE(Ut);if(fn){Te=fn;const oi=await Ks(S,fn,k);if(!oi.ok)throw await Gt(oi,{method:"POST",url:pe(`conversations/${S}/turns/${fn}/steer`)});const Yi=await oi.json();if(!Yi.message)throw new Error("Steer did not return the persisted message");ia(S,J,Yi.message,fn),He=!0,Ja(S,k)}else throw await Gt(Ut,{method:"POST",url:we})}if(!Te)throw await Gt(Ut,{method:"POST",url:we});Jt.current.set(S,Te),await Pi(S,Te);const kt=pe(`conversations/${S}/turns/${Te}/events`),vi=await fetch(kt,{signal:be.signal});if(!vi.ok||!vi.body)throw await Gt(vi,{method:"GET",url:kt});await Hs(S),await Np(vi.body,fn=>{const oi=wp(fn,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(S,Vr=>({...Vr,status:us(oi)??Vr.status,events:vp(Vr.events,oi)}));const Yi=us(oi);Yi&&dn(S,Yi)}),await ai(S),await xn()}catch(Te){if(kp(Te))return;He||er(Te);const we=GE(Te);we&&ve("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),Jt.current.has(S)||Pl.current.delete(S),et(S,Ut=>({...Ut,status:"error",events:[...Ut.events,{id:Ut.events.length+1,event:"client.error",data:we?{message:"Reset thread required",detail:w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:ur(Te),createdAt:new Date().toISOString()}]})),dn(S,"error"),await xn()}finally{qi.current.delete(S),yi(S,!1),Jt.current.delete(S),Sn.current.get(S)===be&&Sn.current.delete(S),_n(S,!1),await Nt(S)}}async function Nt(y){const k=il.current.get(y)??[];if(k.length===0)return;const[S,...R]=k;il.current.set(y,R),await Ge(y,S)}async function ct(y,k={}){if(Yl.current.has(y))return;const S=new AbortController;Sn.current.set(y,S),_n(y,!0);try{const R=k.waitMs?`?waitMs=${k.waitMs}`:"",B=pe(`conversations/${y}/turns/current/events${R}`),J=await fetch(B,{signal:S.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:B});await Hs(y),await Np(J.body,be=>{const He=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);He.turnId&&!Jt.current.has(y)&&Jt.current.set(y,He.turnId),et(y,we=>({...we,status:us(He)??we.status,events:vp(we.events,He)}));const Te=us(He);Te&&dn(y,Te)}),await ai(y),await xn()}catch(R){if(!kp(R)){if($E(R)){await ai(y),await xn();return}et(y,B=>({...B,status:"error",events:[...B.events,{id:B.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),Sn.current.get(y)===S&&Sn.current.delete(y),_n(y,!1),await Nt(y)}}async function Ge(y,k,S={}){if(Jt.current.has(y)){const B=il.current.get(y)??[];B.includes(k)||il.current.set(y,[...B,k]);return}const R=new AbortController;Sn.current.set(y,R),Jt.current.set(y,k),_n(y,!0);try{const B=pe(`conversations/${y}/turns/${k}/events`),J=await fetch(B,{signal:R.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:B});await Hs(y),await Np(J.body,be=>{const He=wp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(y,we=>({...we,status:us(He)??we.status,events:vp(we.events,He)}));const Te=us(He);Te&&dn(y,Te)}),await ai(y),await xn()}catch(B){if(!kp(B)){if(S.recovered&&HE(B)){await ai(y),await xn();return}et(y,J=>({...J,status:"error",events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(B),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),Sn.current.get(y)===R&&Sn.current.delete(y),_n(y,!1),await Nt(y)}}async function Vi(y,k){yi(y,!0);let S=!1;const R=`local-queued-${Date.now()}`;et(y,B=>({...B,messages:[...B.messages,{id:R,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const B=pe(`conversations/${y}/turns`),J=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!J.ok)throw await Gt(J,{method:"POST",url:B});const be=await J.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");ia(y,R,be.message,be.turnId),S=!0,Ja(y,k),Ge(y,be.turnId),await xn(),ve("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(B){S||er(B),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(B),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}async function Nn(y,k){yi(y,!0);const S=Jt.current.get(y),R=`local-steer-${Date.now()}`;if(et(y,B=>({...B,messages:[...B.messages,{id:R,role:"user",content:k,createdAt:new Date().toISOString(),turnId:S??null}],status:"running"})),!S&&qi.current.has(y)){Ws(y,k,R),yi(y,!1);return}try{const B=pe(S?`conversations/${y}/turns/${S}/steer`:`conversations/${y}/turns/steer`),J=await fetch(B,Tx(k));if(!J.ok)throw await Gt(J,{method:"POST",url:B});const be=await J.json();if(!be.message)throw new Error("Steer did not return the persisted message");ia(y,R,be.message,S),Ja(y,k)}catch(B){er(B),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(B),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}function Ws(y,k,S){const R=Pl.current.get(y)??[];Pl.current.set(y,[...R,{message:k,localMessageId:S}])}async function Pi(y,k){const S=Pl.current.get(y)??[];if(S.length!==0){Pl.current.delete(y);for(const R of S){const B=await Ks(y,k,R.message);if(!B.ok)throw await Gt(B,{method:"POST",url:pe(`conversations/${y}/turns/${k}/steer`)});const J=await B.json();J.message&&ia(y,R.localMessageId,J.message,k)}}}async function Ks(y,k,S){return fetch(pe(`conversations/${y}/turns/${k}/steer`),Tx(S))}function ia(y,k,S,R){et(y,B=>({...B,messages:yp(B.messages.filter(J=>J.id!==k),[{...S,turnId:R??S.turnId??null}])}))}async function la(){var S;if(!x||_r!=="running"&&!Rs)return;const y=x,k=Jt.current.get(y);(S=Sn.current.get(y))==null||S.abort(),_n(y,!1),et(y,R=>({...R,status:"done",events:[...R.events,{id:R.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),dn(y,"done");try{const R=pe(k?`conversations/${y}/turns/${k}/stop`:`conversations/${y}/turns/interrupt`),B=await fetch(R,{method:"POST"});if(!B.ok&&B.status!==409)throw await Gt(B,{method:"POST",url:R})}catch(R){et(y,B=>({...B,events:[...B.events,{id:B.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}))}Jt.current.delete(y)}async function $n(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const S=x;try{const R=pe(`conversations/${S}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),B=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!B.ok)throw await Gt(B,{method:"POST",url:R});et(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(R){et(S,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}));const B=Ve(R);ve("error","Failed to respond to approval",B.detail??B.message)}}async function pl(y,k,S){const R=x,B=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!R||!B)return!1;try{const J=pe(`conversations/${R}/workspace-change-proposals/${encodeURIComponent(B)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?S??y.workspaceChangePayload:void 0})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const He=await be.json();return Dn(He.conversation),et(R,Te=>({...Te,events:[...Te.events,{id:`${y.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:B,changeType:y.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?S??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),ve("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(J){console.error(J);const be=Ve(J);return ve("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function xi(y,k,S){const R=x;if(!(!R||!y.knowledgeProposalId))try{let B;if(k==="accept")try{B=JSON.parse(S??y.body)}catch{ve("error","Knowledge proposal JSON is invalid");return}const J=pe(`conversations/${R}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:B})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const He=await be.json();zt([...He.items??[]].sort(Jx)),et(R,Te=>({...Te,events:[...Te.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?He.item:null},createdAt:new Date().toISOString()}]})),ve("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(B){console.error(B);const J=Ve(B);ve("error","Failed to respond to knowledge proposal",J.detail??J.message)}}function Xs(y){de(k=>{const S=k[y.id],R=y.events.map(B=>({id:B.id,turnId:B.turnId,seq:B.seq,event:B.event,data:B.data,createdAt:B.createdAt}));return{...k,[y.id]:{messages:y.messages,events:Dc(R,(S==null?void 0:S.events)??[]),timelineNodes:bp(y.timelineNodes??[],(S==null?void 0:S.timelineNodes)??[]),turns:xp(y.turns??[],(S==null?void 0:S.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:Mr(y),loadingOlder:!1,fullEventTurnIds:(S==null?void 0:S.fullEventTurnIds)??new Set,loadingEventTurnIds:(S==null?void 0:S.loadingEventTurnIds)??new Set}}})}function hl(y){const k=Mr(y);et(y.id,S=>{var R,B,J;return{...S,messages:yp(y.messages,S.messages),timelineNodes:bp(y.timelineNodes??[],S.timelineNodes),turns:xp(y.turns??[],S.turns),events:Dc(y.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),S.events),contextVersions:(((R=y.contextVersions)==null?void 0:R.length)??0)>0?y.contextVersions??[]:S.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((B=S.history)==null?void 0:B.loadedMessageCount)??S.messages.length),loadedEventCount:k.loadedEventCount+(((J=S.history)==null?void 0:J.loadedEventCount)??S.events.length)},loadingOlder:!1}})}function bi(y){const k=Mr(y),S=y.events.map(R=>({id:R.id,turnId:R.turnId,seq:R.seq,event:R.event,data:R.data,createdAt:R.createdAt}));et(y.id,R=>{var B,J,be;return{...R,messages:yp(R.messages,y.messages),timelineNodes:bp(R.timelineNodes,y.timelineNodes??[]),turns:xp(R.turns,y.turns??[]),events:Dc(S,R.events),contextVersions:(((B=y.contextVersions)==null?void 0:B.length)??0)>0?y.contextVersions??[]:R.contextVersions,status:y.status,history:{...R.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((J=R.history)==null?void 0:J.loadedMessageCount)??R.messages.length,R.messages.length,y.messages.length),loadedEventCount:Math.max(((be=R.history)==null?void 0:be.loadedEventCount)??R.events.length,R.events.length,y.events.length)},loadingOlder:!1}})}function et(y,k){de(S=>{const R=S[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...S,[y]:k(R)}})}function dn(y,k){g(S=>S.map(R=>R.id===y?{...R,status:k,updatedAt:new Date().toISOString()}:R))}function Dn(y){g(k=>Oo(k.map(S=>S.id===y.id?{...S,...y}:S)))}async function Qs(y,k){const S=k.filter(R=>{const B=ee[y];return B&&!B.fullEventTurnIds.has(R)&&!B.loadingEventTurnIds.has(R)});if(S.length!==0){et(y,R=>{const B=new Set(R.loadingEventTurnIds);for(const J of S)B.add(J);return{...R,loadingEventTurnIds:B}});try{const R=await Promise.all(S.map(B=>sD(y,B)));et(y,B=>{const J=new Set(B.fullEventTurnIds),be=new Set(B.loadingEventTurnIds),He=R.flatMap((Te,we)=>{const Ut=S[we];return J.add(Ut),be.delete(Ut),Te.map(kt=>({id:kt.id,turnId:kt.turnId,seq:kt.seq,event:kt.event,data:kt.data,createdAt:kt.createdAt}))});return{...B,events:Dc(B.events,He),fullEventTurnIds:J,loadingEventTurnIds:be}})}catch(R){console.error(R),et(y,B=>{const J=new Set(B.loadingEventTurnIds);for(const be of S)J.delete(be);return{...B,loadingEventTurnIds:J}}),ve("error","Failed to load process details")}}}function _n(y,k){const S=new Set(Yl.current);k?S.add(y):S.delete(y),Yl.current=S,su(R=>{const B=new Set(R);return k?B.add(y):B.delete(y),B})}function $r(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Fs({forceNewTurn:y.shiftKey}))}function ml(y){Ia(k=>{const S=new Set(k);return S.has(y)?S.delete(y):S.add(y),fp(S),S})}function Ft(y){var k;return AE(y.status,(k=y.nextWakeup)==null?void 0:k.status,ei.has(y.id))}function aa(y){var R;const k=(R=ii.current)==null?void 0:R.getBoundingClientRect(),S=k?y-k.left:y;return wh(S)}function Nu(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Oi(aa(y.clientX))}function pd(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Oi(aa(y.clientX)))}function hd(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=aa(y.clientX);Oi(k),YE(k)}return s.jsxs("main",{className:`shell${te?" mobile-sidebar-open":""}`,ref:ii,style:{"--sidebar-width":`${ql}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":ob(me),className:`backend-status ${me}`,"data-label":ob(me)})]}),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:l,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>L(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Qa,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Ha.map(y=>s.jsxs("section",{className:["workspace-group",js===y.id?"dragging":"",Ss===y.id?"drop-after":"",(ni==null?void 0:ni.kind)==="group"&&ni.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!La.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(As.current){k.preventDefault(),As.current=!1;return}ml(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Ur(y)},onPointerCancel:ta,onPointerDown:k=>Ys(k,y.id),onPointerMove:k=>Au(k,y.id),onPointerUp:k=>Tn(k,y.id),type:"button",children:[s.jsx("span",{className:La.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Ur(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Sx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Gs(y)},title:"Delete group",type:"button",children:"×"}):null]}),La.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const S=Ft(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===za?"dragging":"",(ni==null?void 0:ni.kind)==="workspace"&&ni.id===k.id?`drop-${ni.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:R=>{if(qa.current){R.preventDefault(),qa.current=!1;return}j(k.id),L(!1)},onDoubleClick:R=>{cn(R.target)||(R.preventDefault(),ul(k))},onKeyDown:R=>{fd(R.target)||R.key==="Enter"&&(j(k.id),L(!1))},onPointerCancel:Eu,onPointerDown:R=>qr(R,k.id),onPointerMove:R=>fl(R,k.id),onPointerUp:R=>Ps(R,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Bc(S,k.nextWakeup,zi),className:`session-status ${S}`,title:Bc(S,k.nextWakeup,zi)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),S==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:Bc(S,k.nextWakeup,zi),children:Fc(k.nextWakeup,zi)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,S!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:R=>{R.stopPropagation(),sn(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",fs(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:ud,type:"button",children:s.jsx($x,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Jl,type:"button",children:s.jsx(KN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{ws(!0),L(!1)},type:"button",children:s.jsx(Lc,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:gu,type:"button",children:s.jsx(XN,{})}),s.jsx(QA,{usage:ad})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>L(!1),tabIndex:te?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Nu,onPointerMove:pd,onPointerUp:hd,role:"separator",tabIndex:0}),Nr&&Bl?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Bl.x+12}px, ${Bl.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Nr.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",fs(Nr.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ln,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ln,onSubmit:y=>void En(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:na,onKeyDown:ln,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Hr,onKeyDown:ln,value:xe.groupId??((Gr=m[0])==null?void 0:Gr.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:cl,children:"Cancel"}),s.jsx("button",{disabled:Ke,type:"submit",children:Ke?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,Mt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:An,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:An,onSubmit:y=>void Gi(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:Za,onKeyDown:An,value:Mt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:dl,children:"Cancel"}),s.jsx("button",{type:"submit",children:Mt.mode==="create"?"Create":"Save"})]})]})}):null,Oe?s.jsx(dA,{currentUser:i,conversations:p,editingEnvironmentKey:wr,deploymentSettings:Dl,environmentDraft:Ol,globalEnvironment:gn,workspaceEnvironment:Si,memorySettings:eu,memorySettingsDraft:xs,workspaceMemoryDraft:tu,runtimeSettings:Nl,runtimeModels:ce,runtimeCodexVersion:Ie,runtimeCodexReleasedAt:Vt,runtimeCodexUpdating:(ut==null?void 0:ut.status)==="running",runtimeSettingsDraft:Ti,runtimeSettingsScope:nn,settingsWorkspace:en,settingsWorkspaceId:yt,systemDiagnostics:_e,systemDiagnosticsLoading:A,workspaceGroups:Ha,workspaceRuntimeSettings:Ra,workspaceRuntimeSettingsDraft:ys,managedUsers:se,onCancelEnvironmentEdit:ol,onClose:()=>Ot(!1),onCreateUser:async y=>{const k=await e_(y);ye(S=>[...S,k]),ve("success","User created")},onDeleteUser:async y=>{await n_(y),ye(k=>k.filter(S=>S.id!==y)),ve("success","User deleted")},onSaveDeploymentSettings:xu,onDeleteEnvironment:y=>void wu(y),onDraftChange:zl,onEditEnvironment:ku,onRevealEnvironmentValue:y=>void ju(y),onSaveBaseMemoryItems:y=>Is(y),onSaveResponsibility:async(y,k)=>{try{const S=await Mc(y,{responsibility:k});return Dn(S),Q("connected"),ve("success","Workspace responsibility saved"),S.responsibility}catch(S){throw console.error(S),Q("error"),ve("error","Failed to save workspace responsibility"),S}},onSaveWorkspaceMemoryItems:y=>yt?Ka(yt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:_l,onCodexAccountSwitched:async()=>{await Promise.all([Pa(!0),Ya(!0),zr()]),ve("success","Codex account switched")},onUpdateCodexCli:()=>{St(!0),Fa(!0)},onRuntimeScopeChange:Rl,onSettingsWorkspaceChange:Wa,onSubmitRuntimeSettings:y=>void yu(y),onWorkspaceRuntimeDraftChange:Ml,onWorkspaceRuntimeReset:y=>yt?void Ql(yt,y):void 0,revealedEnvironmentKeys:vs,onSubmitEnvironment:y=>void Us(y),onRefreshSystemDiagnostics:()=>void zs(),onUpdateUser:async(y,k)=>{const S=await t_(y,k);ye(R=>R.map(B=>B.id===S.id?S:B)),ve("success","User updated")}}):null,Pt?s.jsx(cA,{currentReleasedAt:Vt,currentVersion:Ie,job:ut,latest:nd,latestChecking:br,starting:Ci,onClose:()=>St(!1),onRefresh:()=>void Fa(),onStart:()=>void Os()}):null,Ni&&Ne?s.jsx(rA,{conversation:Ne,clockNow:zi,knowledgeDraft:qn,workspaceKnowledge:Yt,tokenUsage:ll,onCancelKnowledgeEdit:()=>Ei(Mo),onDeleteKnowledge:y=>void Zl(Ne.id,y),onEditKnowledge:Bs,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void sl(Ne.id,y),onClose:()=>el(!1)}):null,nu?s.jsx(sA,{conversations:p,onClose:()=>ws(!1),workspaceGroups:Ha}):null,Di?s.jsx(oA,{busy:au,conversation:mi??null,conversationId:un,preview:(Qt==null?void 0:Qt.conversationId)===un?Qt:null,previewLoading:kr,result:ru,status:id,warmup:iu,workspaceGroups:Ha,onClose:()=>Ct(!1),onCancelResetPreview:()=>Lt(null),onPreviewReset:()=>void bu(),onStartBlankContext:()=>void Ls(),onResetRuntime:y=>void vu(y),onSaveResetSelection:dd,onWorkspaceChange:y=>{_i(y),Ri(null),Lt(null)},onWarmupChange:lu}):null,oe?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!X&&_(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:$s,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:oe.name,onChange:y=>_(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:oe.groupId,onChange:y=>_(k=>k&&{...k,groupId:y.target.value}),children:Ha.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:X,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:X||!oe.name.trim(),type:"submit",children:X?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>H(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:N.title}),s.jsxs("p",{children:[sb(N.status),N.startedAt&&N.finishedAt?` · ${HD(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:N.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:N.status==="completed"?"Final plan":"Current plan"}),N.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Ea(N.currentPlan.planMarkdown,Ne)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:N.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:N.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:N.startedAt?qe(N.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:N.finishedAt?qe(N.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>H(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>W(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:qe($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>W(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(qo,{content:$.fullDetail??$.detail??"No additional details.",conversation:Ne,streaming:!1,onPreviewArtifact:hi,onCopyArtifactUrl:Hi,copiedArtifactUrl:It})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;W(null),$i(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>W(null),type:"button",children:"Close"})]})]})}):null,Kt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Pe||sn(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Pe,onClick:()=>sn(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Kt.title})," to recycle?"]}),s.jsx("code",{children:Kt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Pe,onClick:()=>sn(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Pe,onClick:()=>void Br(Kt),type:"button",children:Pe?"Moving...":"Move to recycle"})]})]})}):null,tl?s.jsxs("div",{className:`app-toast ${tl.tone}`,role:"status",children:[s.jsx("strong",{children:tl.text}),tl.detail?s.jsx("pre",{children:tl.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>L(!0),title:"Workspaces",type:"button",children:s.jsx(WN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ne==null?void 0:Ne.title)??"New workspace"})}),Ne?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",fs(Ne.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ne?s.jsxs(s.Fragment,{children:[Ne.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:gu,title:`当前 Thread 工具集已过期(${Ne.threadCapabilityVersion} / ${Ne.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Kv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Cu,title:"Clone workspace",type:"button",children:s.jsx(FN,{})}),s.jsxs("button",{className:`context-button has-usage ${Nh($a??0)}`,onClick:()=>el(!0),style:{"--context-usage":`${ed($a??0)}%`},title:ll&&$a!==null?`Context ${Math.round($a)}% · ${Un(ll.totalTokens)} / ${Uc(ll.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round($a??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:cd,title:"Workspace settings",type:"button",children:s.jsx($x,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void $i(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:sb(w.status)}),s.jsx("span",{className:"complex-task-duration",children:qD(w,zi)})]}),s.jsxs("div",{className:"complex-task-actions",children:[Dp(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Xa("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void Xa("pause"),type:"button",children:"Pause"}):null,Dp(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Xa("resume"),type:"button",children:"Resume"}):null,Dp(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Xa("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Xa("end"),type:"button",children:"End task"})]})]}):null,(Ne==null?void 0:Ne.status)==="initialization_failed"&&Ne.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ne.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Hn(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void du(),ref:Hl,style:{scrollPaddingBottom:Cs},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Cs},children:[Fl.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ne!=null&&Ne.cloneLineage&&_s.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ne.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",qe(Ne.cloneLineage.snapshotAt)," · ",Ne.cloneLineage.importedMessageCount," messages"]})]}):null,(ra=lt==null?void 0:lt.history)!=null&&ra.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,Ds.map((y,k)=>{var be,He,Te;const S=((be=y.user)==null?void 0:be.type)==="system",R=y.turnIds.some(we=>_s.has(we)),B=Ds[k+1],J=R&&(!B||!B.turnIds.some(we=>_s.has(we)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${R?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${S?"system-turn":"user-turn"}`,children:[Io(y.user,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Uo,{copied:Il===`${S?"system":"user"}-${y.id}-bottom`,content:Bo(y.user),id:`${S?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Wl})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(we=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Io(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Uo,{copied:Il===`user-${we.id}-bottom`,content:Bo(we),id:`user-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id))}):null,(He=y.acceptedSystemInputs)==null?void 0:He.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Io(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Uo,{copied:Il===`system-${we.id}-bottom`,content:Bo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id)),y.agentItems.length>0?s.jsx(IA,{group:y,conversation:Ne,allowProcessView:!R,copiedFooter:Il===`agent-${y.id}-bottom`,copiedArtifactUrl:It,running:!R&&Vo(y.turnIds,Ga),onCopyArtifactUrl:Hi,onCopyBubble:Wl,onPreviewArtifact:hi,onLoadProcessDetails:we=>Ne&&!R?Qs(Ne.id,we):void 0,onRespondApproval:$n,onRespondWorkspaceChangeProposal:pl,onRespondKnowledgeProposal:xi,onOpenComplexTask:$i,onOpenSystemEvent:W}):null,(Te=y.trailingSystemItems)==null?void 0:Te.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Io(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Uo,{copied:Il===`system-${we.id}-bottom`,content:Bo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id))]}),J?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:si,ref:$l,children:[al?s.jsxs("div",{className:`global-activity ${al.tone??"running"}`,children:[Rr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void la(),title:"Stop current agent run",type:"button",children:s.jsx(qA,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:al.title}),al.detail?s.jsx("small",{children:al.detail}):null]}),Rr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||M==="complex",className:`complex-mode-button ${w||M==="complex"?"active":""}`,disabled:!!w,onClick:()=>U(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Rv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:x!==null&&c.has(x),onChange:y=>gi(y.target.value),onKeyDown:$r,placeholder:"Cmd/Ctrl + Enter",ref:li,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||x!==null&&c.has(x),type:"submit",children:[s.jsx(HA,{}),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"]})]})]})]})]}),jn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>hi(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>hi(null),type:"button",children:"×"}),s.jsx("img",{alt:jn.name,src:jn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:jn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:jn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void Hi(jn),type:"button",children:It===jn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function rA({conversation:e,clockNow:i,knowledgeDraft:l,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,j]=D.useState("overview"),[w,T]=D.useState(!1),[M,U]=D.useState(!1),[N,H]=D.useState(null),[$,W]=D.useState(null),[oe,_]=D.useState(!1),[X,ae]=D.useState(null),[te,L]=D.useState(null),[ee,de]=D.useState(!1),[Ae,ge]=D.useState(null),[ue,V]=D.useState(null),se=cw(u),ye=Jp(e,e.status),_e=N?ED(N):null;D.useEffect(()=>{T(!1),H(null),W(null),ae(null),L(null),ge(null),V(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!X&&A()},[x,X]),D.useEffect(()=>{x==="compactions"&&!Ae&&z()},[x,Ae]);const O=()=>{T(!0),U(!0),W(null),R2(e.id).then(C=>H(C)).catch(C=>{const K=Ve(C);W(K.detail?`${K.message}
87
- ${K.detail}`:K.message)}).finally(()=>U(!1))},A=()=>{_(!0),L(null),O2(e.id).then(C=>ae(C)).catch(C=>{const K=Ve(C);L(K.detail?`${K.message}
88
- ${K.detail}`:K.message)}).finally(()=>_(!1))},z=()=>{de(!0),V(null),z2(e.id).then(C=>ge(C)).catch(C=>{const K=Ve(C);V(K.detail?`${K.message}
89
- ${K.detail}`:K.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:C=>C.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>j("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>j("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>j("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>j("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>j("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>j("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:Bc(ye,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:Wo(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:Fc(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/${fs(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:Ea(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(_v,{items:r,onDelete:d,onEdit:C=>{p(C),j("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Ea(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(EA,{draft:l,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:M,onClick:O,type:"button",children:M?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:M,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Used",value: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 ${Nh(se)}`,children:s.jsx("span",{style:{width:`${ed(se)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Uc(u.inputTokens)} / ${Uc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Uc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",qe(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."}),M?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):N?s.jsxs(s.Fragment,{children:[_e?s.jsx(OA,{summary:_e}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(N,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:ee,onClick:z,type:"button",children:ee?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):ee&&!Ae?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ae!=null&&Ae.length?s.jsx("div",{className:"context-compaction-list",children:Ae.map(C=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:qe(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:vD(C).map(K=>s.jsxs("div",{children:[s.jsx("dt",{children:K.label}),s.jsx("dd",{children:K.value})]},K.label))}),s.jsxs("small",{children:[Na(C.id),C.turnId?` · turn ${Na(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."})]})}),oe?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):te?s.jsx("pre",{className:"thread-read-error",children:te}):X?s.jsx(RA,{preview:X,refreshing:oe,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function sA({conversations:e,onClose:i,workspaceGroups:l}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,j]=D.useState(!0),[w,T]=D.useState(null),[M,U]=D.useState(null),[N,H]=D.useState(!1),[$,W]=D.useState(!1),[oe,_]=D.useState(new Set),[X,ae]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),te=r.find(A=>A.id===p)??null,L=D.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),ee=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),de=l.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==X.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Ae=()=>{var A;ae({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),_(new Set),U("create")},ge=()=>{!te||te.status!=="active"||(ae({title:te.title,publicDescription:te.publicDescription,ownerWorkspaceId:te.ownerWorkspaceId,participantWorkspaceIds:te.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),_(new Set),U("edit"))},ue=async(A,z=c)=>{var C;j(!0),T(null);try{const K=await Yx();u(K);const me=K.filter(xe=>z==="archived"?xe.status==="archived":xe.status!=="archived"),Q=(A&&me.some(xe=>xe.id===A)?A:null)??(p&&me.some(xe=>xe.id===p)?p:((C=me[0])==null?void 0:C.id)??null);g(Q),b(Q?await Rc(Q):[])}catch(K){T(K instanceof Xi?K.detail:K instanceof Error?K.message:String(K))}finally{j(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await Yx();u(z),p&&z.some(C=>C.id===p)&&b(await Rc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),T(null);try{b(await Rc(A))}catch(z){T(z instanceof Xi?z.detail:z instanceof Error?z.message:String(z))}},se=async A=>{var C;if(A===c)return;d(A),T(null);const z=((C=r.find(K=>A==="archived"?K.status==="archived":K.status!=="archived"))==null?void 0:C.id)??null;if(g(z),!z){b([]);return}try{b(await Rc(z))}catch(K){T(K instanceof Xi?K.detail:K instanceof Error?K.message:String(K))}},ye=async A=>{var z;if(A.preventDefault(),!(!X.title.trim()||!X.ownerWorkspaceId)){W(!0),T(null);try{const C=M==="edit"&&te?await a2(te.id,{expectedVersion:te.version,title:X.title.trim(),publicDescription:X.publicDescription.trim(),participantWorkspaceIds:X.participantWorkspaceIds}):await l2({...X,title:X.title.trim(),publicDescription:X.publicDescription.trim()});d("active"),U(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await ue(C.id,"active")}catch(C){T(C instanceof Xi?C.detail:C instanceof Error?C.message:String(C))}finally{W(!1)}}},_e=async()=>{if(!(!te||te.status!=="active")){W(!0),T(null);try{const A=await r2(te.id,te.version);H(!1),d("active"),await ue(void 0,"active")}catch(A){T(A instanceof Xi?A.detail:A instanceof Error?A.message:String(A))}finally{W(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ae,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:"正在加载..."}):ee.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):ee.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:te?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:te.title}),s.jsx("p",{children:te.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:te.status}),te.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${te.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(Jc,{})}),s.jsx("button",{"aria-label":`归档 Topic ${te.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(QN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:te.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")?"发给全部参与者":`发给 ${Zv(A.recipientWorkspaceIds.map(z=>L.get(z)??Na(z)))}`}),s.jsx("time",{children:qe(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Ea(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),M?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&U(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ye,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:M==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:M==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>U(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:M==="edit",value:X.ownerWorkspaceId,onChange:A=>ae(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(C=>C!==A.target.value)})),children:l.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:()=>_(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>_(new Set(de.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),de.map(A=>{const z=A.conversations,C=z.filter(me=>X.participantWorkspaceIds.includes(me.id)).length,K=oe.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!K,className:"collaboration-group-toggle",onClick:()=>_(me=>{const Q=new Set(me);return Q.has(A.id)?Q.delete(A.id):Q.add(A.id),Q}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:K?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[C,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:C===z.length,onChange:()=>ae(me=>{const Q=z.map(ze=>ze.id),xe=new Set(me.participantWorkspaceIds);return Q.every(ze=>xe.has(ze))?Q.forEach(ze=>xe.delete(ze)):Q.forEach(ze=>xe.add(ze)),{...me,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),K?null:s.jsx("div",{children:z.map(me=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:X.participantWorkspaceIds.includes(me.id),onChange:Q=>ae(xe=>({...xe,participantWorkspaceIds:Q.target.checked?[...xe.participantWorkspaceIds,me.id]:xe.participantWorkspaceIds.filter(ze=>ze!==me.id)})),type:"checkbox"}),s.jsx("span",{children:me.title})]},me.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>U(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!X.title.trim()||!X.ownerWorkspaceId,type:"submit",children:$?"正在保存...":M==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&te?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&H(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>H(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:te.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void _e(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function oA({busy:e,conversation:i,conversationId:l,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onStartBlankContext:j,onResetRuntime:w,onSaveResetSelection:T,onWorkspaceChange:M,onWarmupChange:U}){const N=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:H=>H.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:H=>M(H.target.value),value:l??"",children:g.map(H=>s.jsx("optgroup",{label:H.title,children:H.conversations.map($=>s.jsxs("option",{value:$.id,children:[$.title," · workspaces/",fs($.id)]},$.id))},H.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${fs(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:H=>U(H.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:N||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:N||u,onClick:j,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(uA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:T}):null]})})}function uA({busy:e,preview:i,warmup:l,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(L=>L.includedByDefault).map(L=>L.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[j,w]=D.useState(null),T=D.useRef(null),M=i.entries.filter(L=>d.has(L.id)),U=M.filter(L=>L.role==="user").length,N=M.length-U,H=i.entries.filter(L=>L.topicRelation!==null).map(L=>L.id),$=H.filter(L=>d.has(L)).length,W=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{T.current&&(T.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const oe=e||b;async function _(L){x(!0),w(null);try{await c(i.entries.filter(ee=>L.has(ee.id)).map(ee=>ee.id)),p(L)}catch(ee){w(Ve(ee).message)}finally{x(!1)}}function X(L,ee){const de=new Set(d);ee?de.add(L):de.delete(L),_(de)}function ae(){const L=new Set(d);H.forEach(ee=>L.add(ee)),_(L)}function te(){const L=new Set(d);H.forEach(ee=>{L.has(ee)?L.delete(ee):L.add(ee)}),_(L)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:oe?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:L=>L.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(L=>!L),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:oe,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:W,disabled:oe||i.entries.length===0,onChange:L=>void _(L.target.checked?new Set(i.entries.map(ee=>ee.id)):new Set),ref:T,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[U," user"]}),s.jsxs("span",{children:[N," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:oe||$===H.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:oe,onClick:te,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:l?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,j?s.jsx("span",{className:"reset-preview-selection-error",children:j}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((L,ee)=>s.jsxs("article",{className:`reset-preview-item ${L.role} ${d.has(L.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${L.role} message ${ee+1}`,checked:d.has(L.id),disabled:oe,onChange:de=>X(L.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:ee+1})]}),s.jsx("strong",{children:L.role}),L.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",L.topicRelation]}):null,s.jsx("time",{dateTime:L.createdAt,children:qe(L.createdAt)})]}),s.jsx("pre",{children:L.content})]},L.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:oe,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:oe,onClick:()=>u(i.entries.filter(L=>d.has(L.id)).map(L=>L.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function cA({currentReleasedAt:e,currentVersion:i,job:l,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(l==null?void 0:l.currentVersion)??i,b=r!=null&&r.version&&OD(r.version,m)?MD(r.version):null;return D.useEffect(()=>{const x=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:l?`status-${l.status}`:void 0,children:(l==null?void 0:l.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:Zp(m,(l==null?void 0:l.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Zp(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),l?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:qe(l.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:l!=null&&l.logs.length?l.logs.map((x,j)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:RD(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${j}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(l==null?void 0:l.status)==="running",onClick:g,type:"button",children:c?"Starting...":(l==null?void 0:l.status)==="running"?"Updating...":l?"Run again":"Start update"})]})]})})}function dA({currentUser:e,conversations:i,deploymentSettings:l,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:j,runtimeCodexVersion:w,runtimeCodexReleasedAt:T,runtimeCodexUpdating:M,runtimeSettingsDraft:U,runtimeSettingsScope:N,settingsWorkspace:H,settingsWorkspaceId:$,systemDiagnostics:W,systemDiagnosticsLoading:oe,workspaceGroups:_,workspaceRuntimeSettings:X,workspaceRuntimeSettingsDraft:ae,onCancelEnvironmentEdit:te,onClose:L,onCreateUser:ee,onDeleteUser:de,onDeleteEnvironment:Ae,onDraftChange:ge,onEditEnvironment:ue,onSaveBaseMemoryItems:V,onSaveDeploymentSettings:se,onSaveResponsibility:ye,onSaveWorkspaceMemoryItems:_e,onRevealEnvironmentValue:O,onRuntimeDraftChange:A,onCodexAccountSwitched:z,onUpdateCodexCli:C,onRuntimeScopeChange:K,onSettingsWorkspaceChange:me,onSubmitRuntimeSettings:Q,onSubmitEnvironment:xe,onRefreshSystemDiagnostics:ze,onUpdateUser:Ke,onWorkspaceRuntimeDraftChange:Rt,onWorkspaceRuntimeReset:Kt,revealedEnvironmentKeys:sn}){const[Pe,bt]=D.useState("model"),[Mt,on]=D.useState(!1),[Oe,Ot]=D.useState(null),[gn,Xt]=D.useState(!1),[Si,Xn]=D.useState((H==null?void 0:H.responsibility)??""),[Nl,At]=D.useState(!1),Dl=D.useRef(null),ie=N==="workspace"?Object.values((X==null?void 0:X.sources)??{}).filter(ce=>ce==="workspace").length:0;return D.useEffect(()=>{N==="global"&&Xt(!1)},[N]),D.useEffect(()=>{Xn((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),D.useEffect(()=>{if(!gn)return;const ce=Ie=>{var Vt;const Xe=Ie.target;Xe instanceof Node&&((Vt=Dl.current)!=null&&Vt.contains(Xe))||Xt(!1)},Ce=Ie=>{Ie.key==="Escape"&&Xt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ce,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ce,!0)}},[gn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:L,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":N==="global",className:N==="global"?"active":void 0,onClick:()=>K("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:Dl,children:[s.jsx("button",{"aria-checked":N==="workspace","aria-expanded":N==="workspace"?gn:void 0,"aria-label":N==="workspace"?"Settings workspace target":void 0,className:N==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(N!=="workspace"){K("workspace");return}Xt(ce=>!ce)},role:"radio",type:"button",children:N==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(H==null?void 0:H.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),N==="workspace"&&gn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:_.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ce=>s.jsxs("button",{"aria-selected":Ce.id===$,className:Ce.id===$?"selected":void 0,onClick:()=>{me(Ce.id),Xt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ce.title}),s.jsxs("small",{children:["workspaces/",Ce.id]})]},Ce.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:L,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Pe==="model"?"active":void 0,onClick:()=>bt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Pe==="responsibility"?"active":void 0,onClick:()=>bt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Pe==="memory"?"active":void 0,onClick:()=>bt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Pe==="environment"?"active":void 0,onClick:()=>bt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Pe==="accounts"?"active":void 0,onClick:()=>bt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Login + active account"})]}),s.jsxs("button",{className:Pe==="deployment"?"active":void 0,onClick:()=>bt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{className:Pe==="system"?"active":void 0,onClick:()=>bt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Pe==="users"?"active":void 0,onClick:()=>bt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${N==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:N==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:N==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Pe==="system"?s.jsx(fA,{conversations:i,diagnostics:W,loading:oe,onRefresh:ze}):Pe==="users"?s.jsx(vA,{currentUser:e,users:m,onCreate:ee,onDelete:de,onUpdate:Ke}):Pe==="accounts"?s.jsx(bA,{onSwitched:z}):Pe==="deployment"?s.jsx(wA,{settings:l,onSave:se}):Pe==="model"?s.jsx(kA,{draft:N==="workspace"?ae:U,globalSettings:x,models:j,codexVersion:w,codexReleasedAt:T,codexUpdating:M,scope:N,workspaceOverrideCount:ie,settings:N==="workspace"?(X==null?void 0:X.effective)??ae:x,workspaceSettings:X,onDraftChange:N==="workspace"?Rt:A,onResetWorkspaceSetting:Kt,onSubmit:Q,onUpdateCodexCli:C}):Pe==="responsibility"?s.jsx(mA,{draft:Si,saving:Nl,scope:N,workspace:H,onDraftChange:Xn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(N!=="workspace"||!H)&&(At(!0),ye(H.id,Si).then(Ce=>Xn(Ce)).finally(()=>At(!1)))}}):Pe==="memory"?s.jsx(jA,{baseSettings:p,scope:N,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:V,onSaveWorkspaceItems:_e}):s.jsx(TA,{deleteConfirmKey:Oe,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:N,workspaceEnvironment:d,valueVisible:Mt,onCancelEnvironmentEdit:te,onDeleteConfirmChange:Ot,onDeleteEnvironment:Ae,onDraftChange:ge,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:xe,onValueVisibleChange:on,revealedEnvironmentKeys:sn})]})]})]})})}function fA({conversations:e,diagnostics:i,loading:l,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=w,T.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(w)},j=()=>{if(!i||!c.length)return;const w=c[0],T=c.slice(0,5).map($=>`- ${Wo($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
90
- `),M=JSON.stringify(w,null,2),U=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Wo(i.generatedAt)}`,"","## Latest incident","","```json",M.slice(0,2500),"```","","## Recent system log","",T,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
91
- `),N=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",N),H.searchParams.set("body",U),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:l,onClick:r,type:"button",children:l?"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 · ",Ap(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?qe(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Ap(w.uptimeMs):`${Ap(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Th,{})}),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(pA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:j,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(hA,{})}),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," · ",Wo(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:l?"Loading system information...":"System information is unavailable."})]})}function pA(){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 hA(){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 mA({draft:e,saving:i,scope:l,workspace:r,onDraftChange:u,onSubmit:c}){const d=l==="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 gA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,l)=>i.windowDurationMins-l.windowDurationMins).map(i=>{const l=ed(i.usedPercent),r=Ov(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:pw(l)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${l}%`}})}),s.jsxs("small",{children:["Resets ",hw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function yA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function xA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function bA({onSwitched:e}){var A;const[i,l]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,j]=D.useState(!1),[w,T]=D.useState(""),[M,U]=D.useState(null),[N,H]=D.useState(null),[$,W]=D.useState(""),[oe,_]=D.useState(null),[X,ae]=D.useState(null),[te,L]=D.useState(!1);async function ee(){var C;const z=await Wx();l(z),((C=z.login)==null?void 0:C.status)==="pending"&&(U(z.login),j(!0))}async function de(z){d(!0),b("");try{l(await Kx(z))}catch(C){b(Ve(C).message)}finally{d(!1)}}D.useEffect(()=>{let z=!1;return Wx().then(C=>{var K;z||(l(C),((K=C.login)==null?void 0:K.status)==="pending"&&(U(C.login),j(!0)),C.accounts.length>0&&(d(!0),Kx(!1).then(me=>{z||l(me)}).catch(me=>{z||b(Ve(me).message)}).finally(()=>{z||d(!1)})))}).catch(C=>{z||b(Ve(C).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),D.useEffect(()=>{if(!M||M.status!=="pending")return;let z=!1;const C=window.setInterval(()=>{b2(M.id).then(async K=>{z||(U(K),K.status!=="pending"&&(window.clearInterval(C),K.status==="succeeded"&&(await ee(),await de(!0))))}).catch(K=>{z||b(Ve(K).message)})},1e3);return()=>{z=!0,window.clearInterval(C)}},[M==null?void 0:M.id,M==null?void 0:M.status]);function Ae(){T(""),U(null),b(""),L(!1),j(!0)}async function ge(z){z.preventDefault(),g(!0),b("");try{U(await x2(w.trim()))}catch(C){b(Ve(C).message)}finally{g(!1)}}async function ue(){if(!M||M.status!=="pending"){j(!1);return}g(!0),b("");try{const z=await v2(M.id);U(z),j(!1)}catch(z){b(Ve(z).message)}finally{g(!1)}}function V(z){H(z),W(z.name),b("")}async function se(z){if(z.preventDefault(),!N)return;const C=$.trim();if(!C||C===N.name){H(null);return}g(!0),b("");try{await w2(N.id,C),H(null),await ee()}catch(K){b(Ve(K).message)}finally{g(!1)}}async function ye(){var z;if(oe){g(!0),b("");try{const C=await j2(oe.id);l(C),_(null),await e()}catch(C){const K=Ve(C);b((z=K.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":K.detail??K.message)}finally{g(!1)}}}async function _e(){if(X){g(!0),b("");try{await k2(X.id),ae(null),await ee()}catch(z){b(Ve(z).detail??Ve(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage isolated Codex logins. Workspaces do not bind to an account; all work uses the single active account."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void de(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(M==null?void 0:M.status)==="pending",onClick:Ae,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Manual stop-and-switch"}),s.jsx("span",{children:"Switching requires the whole runtime to be idle. Seele stops retained workers, activates the selected credential, then resumes queued work. No automatic switching or parallel accounts."})]}),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 Q;const C=(i==null?void 0:i.activeAccountId)===z.id,K=(Q=i==null?void 0:i.accountDetails)==null?void 0:Q[z.id],me=[z.email,yA(z.accountType),xA(z.planType)].filter(xe=>!!xe);return s.jsxs("article",{className:C?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),C?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:me.join(" · ")||`Added ${qe(z.createdAt)}`}),K!=null&&K.usage?s.jsx(gA,{usage:K.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),K?s.jsx("small",{className:K.error?"codex-account-detail-error":"codex-account-refreshed",children:K.error?`Refresh issue: ${K.error}`:`Updated ${qe(K.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>V(z),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||C,onClick:()=>{b(""),_(z)},type:"button",children:C?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||C,onClick:()=>{b(""),ae(z)},type:"button",children:"Delete"})]})]},z.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&H(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void 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=>W(z.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>H(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!M&&j(!1),role:"presentation",children:M?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:M.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ue(),type:"button",children:"×"})]}),M.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:M.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(M.userCode),L(!0),window.setTimeout(()=>L(!1),1500)},type:"button",children:te?"Copied":"Copy code"})]}),s.jsx("a",{href:M.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..."})]}):M.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=M.account)==null?void 0:A.name)??M.accountName})," is persisted and ready. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:M.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ue(),type:"button",children:M.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ge(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>j(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates an isolated login profile. Completing login adds it to the list but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>T(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>j(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,oe?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&_(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch global execution to ",s.jsx("strong",{children:oe.name}),"? This succeeds only when every workspace and goal is idle. Retained Codex workers will be stopped; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ye(),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 this Seele deployment? 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 _e(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function vA({currentUser:e,users:i,onCreate:l,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[j,w]=D.useState(null),[T,M]=D.useState("");function U(){m(c),M(""),p("new")}function N(W){m({username:W.username,password:"",role:W.role,active:W.active}),M(""),p(W)}function H(){b||(p(null),M(""))}async function $(W){if(W.preventDefault(),!!d){x(!0),M("");try{d==="new"?await l({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(oe){M(Ve(oe).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:U,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(W=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:W.username}),W.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",qe(W.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${W.role}`,children:W.role}),s.jsx("span",{className:`user-status ${W.active?"active":"disabled"}`,children:W.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${W.username}`,className:"memory-icon-button",onClick:()=>N(W),title:"Edit",type:"button",children:s.jsx(Jc,{})}),s.jsx("button",{"aria-label":`Delete user ${W.username}`,className:"memory-icon-button memory-item-delete",disabled:W.id===e.id,onClick:()=>{M(""),w(W)},title:"Delete",type:"button",children:"×"})]})]},W.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:H,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:W=>W.stopPropagation(),onSubmit:W=>void $(W),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:H,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:W=>m(oe=>({...oe,username:W.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:W=>m(oe=>({...oe,password:W.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:W=>m(oe=>({...oe,role:W.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:W=>m(oe=>({...oe,active:W.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:H,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,j?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:W=>W.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:j.username}),". Users that own workspaces must be disabled instead."]}),T?s.jsx("p",{className:"memory-editor-error",children:T}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(j.id).then(()=>w(null)).catch(W=>M(Ve(W).message))},type:"button",children:"Delete"})]})]})}):null]})}function wA({settings:e,onSave:i}){const[l,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(l).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:l.profuseNotificationEnabled,onChange:d=>r({profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function kA({codexReleasedAt:e,codexVersion:i,codexUpdating:l,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:j,onUpdateCodexCli:w}){var M;const T=d==="workspace";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:j,children:[s.jsxs("label",{className:Nc(T,Ta(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Ac,{globalValue:lb(u.model,c),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Ta(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(mp,{"aria-label":"Runtime model",onChange:U=>b({...r,model:U}),options:zD(c,r.model),value:r.model||((M=c.find(U=>U.isDefault))==null?void 0:M.model)||""})]}),s.jsxs("label",{className:Nc(T,Ta(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Ac,{globalValue:ib(u.reasoningEffort),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Ta(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(mp,{"aria-label":"Runtime reasoning effort",onChange:U=>b({...r,reasoningEffort:U}),options:BE,value:r.reasoningEffort})]}),s.jsxs("label",{className:Nc(T,Ta(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Ac,{globalValue:rb(u.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Ta(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(mp,{"aria-label":"Permission mode",onChange:U=>b({...r,sandbox:U}),options:qE,value:r.sandbox})]}),s.jsxs("label",{className:Nc(T,Ta(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Ac,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Ta(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:U=>b({...r,fastMode:U.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",lb(p.model,c),", reasoning"," ",ib(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",rb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:Zp(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:l,onClick:w,type:"button",children:l?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function Ac({globalValue:e,isWorkspaceScope:i,label:l,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:l}),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 mp({"aria-label":e,onChange:i,options:l,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=l.find(g=>g.value===r)??l[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:l.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Ta(e,i,l){return e!==i?"workspace":l}function Nc(e,i,l="settings-wide-field"){return[l,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function jA({baseSettings:e,scope:i,workspaceSettings:l,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?l.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(CA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(SA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function SA({ariaLabel:e,emptyText:i,items:l,onSaveItems:r,title:u}){var X;const[c,d]=D.useState(Fo(l)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,j]=D.useState(null),[w,T]=D.useState(null),[M,U]=D.useState(null);D.useEffect(()=>{d(Fo(l))},[l]),D.useEffect(()=>{if(p===null)return;const ae=te=>{te.key==="Escape"&&(W(),T(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function N(ae,te){U(te);try{const L=await r(ae);return d(Fo(L)),L}finally{U(null)}}function H(){T(null),j(null),b({key:"",value:""}),g("new")}function $(ae){const te=c[ae];te&&(T(null),j(null),b({...te}),g(ae))}function W(){g(null),j(null),b({key:"",value:""})}async function oe(ae){const te=c[ae],L=(te==null?void 0:te.key)||`${ae}`;await N(c.filter((ee,de)=>de!==ae),`delete:${L}`),T(null)}async function _(ae){ae.preventDefault(),ae.stopPropagation();const te=m.key.trim(),L=H2(te);if(L){j(L);return}const ee=m.value.trim();if(!ee){j("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==de&&ge.key.trim()===te)){j(`Key "${te}" already exists. Each memory key must be unique.`);return}const Ae={...m,key:te,value:ee};p==="new"?await N([...c,Ae],"add"):typeof p=="number"&&await N(c.map((ge,ue)=>ue===p?Ae:ge),`save:${p}`),W()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ae,te)=>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}>`}),`
86
+ Workspaces in this group will move to Default.`)))try{const C=await f2(y.id),R=Ac(C.groups);b(R),mp(R),g(C.conversations),Ia(U=>{const J=new Set(U);return J.delete(y.id),pp(J),J})}catch(C){console.error(C)}}function ul(y){ze({mode:"rename",conversationId:y.id,title:y.title})}function cl(){Rt(!1),ze(null)}function dl(){on(null)}async function ea(y,k){const C=k.trim(),R=p.find(J=>J.id===y);if(!R||!C||C===R.title){cl();return}const U=await Oc(y,{title:C});Dn(U),cl()}function pd(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function cn(y){return y instanceof Element&&!!y.closest("input, button")}function Ps(y,k){const C=document.elementFromPoint(y,k);return C instanceof HTMLElement?C.closest(".session-item[data-workspace-id]"):null}function ri(y,k){const C=document.elementFromPoint(y,k);return C instanceof HTMLElement?C.closest(".workspace-group[data-group-id]"):null}function Eu(y,k,C){const R=Ps(k,C),U=R==null?void 0:R.dataset.workspaceId;if(R&&U&&U!==y){Mi({kind:"workspace",id:U,position:lA(R,C)});return}const J=ri(k,C),be=J==null?void 0:J.dataset.groupId;if(!be){Mi(null);return}Mi({kind:"group",id:be})}function Hr(y,k){cn(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Ar.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function fl(y,k){const C=Ar.current;if(!C||C.id!==k||C.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-C.startX,y.clientY-C.startY);if(za!==k){if(R<Sx)return;ti(k),Mi(null)}y.preventDefault(),yn({x:y.clientX,y:y.clientY}),Eu(k,y.clientX,y.clientY)}async function Ys(y,k){var be;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ar.current=null;const C=za===k;C&&(qa.current=!0);const R=ni;if(!C||!R){ti(null),Mi(null),yn(null);return}const U=p.find(He=>He.id===k),J=R.kind==="group"?R.id:(be=p.find(He=>He.id===R.id))==null?void 0:be.groupId;if(!U||!J){ti(null),Mi(null),yn(null);return}if(g(He=>{const Te=R.kind==="workspace"?aA(He.map(we=>we.id===k?{...we,groupId:J}:we),k,R.id,R.position):[...He.filter(we=>we.id!==k),{...U,groupId:J}];return Lc(Te.map(we=>we.id)),Te}),U.groupId!==J)try{const He=await Oc(k,{groupId:J});Dn(He)}catch(He){console.error(He),await xn()}ti(null),Mi(null),yn(null)}function Au(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ar.current=null,ti(null),Mi(null),yn(null)}function Fs(y,k){y.currentTarget.setPointerCapture(y.pointerId),Nr.current={id:k,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function Nu(y,k){const C=Nr.current;if(!C||C.id!==k||C.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-C.startX,y.clientY-C.startY);if(Ss!==k){if(R<Sx)return;Tr(k),Ul(null)}y.preventDefault();const U=ri(y.clientX,y.clientY),J=U==null?void 0:U.dataset.groupId;Ul(J&&J!==k?J:null)}function Tn(y,k){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const C=Ss===k;C&&(y.preventDefault(),Ns.current=!0);const R=Cs;C&&R&&b(U=>{const J=rA(U,k,R);return Dv(J.map(be=>be.id)),J}),Nr.current=null,Tr(null),Ul(null)}function ta(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Nr.current=null,Tr(null),Ul(null)}function na(y){const k=y.target.value;ze(C=>C&&{...C,title:k})}function $r(y){const k=y.target.value;ze(C=>C&&{...C,groupId:k})}function Za(y){const k=y.target.value;on(C=>C&&{...C,title:k})}async function En(y){if(y.preventDefault(),!xe)return;const k=xe.title.trim();if(k){Rt(!0);try{if(xe.mode==="create"){await Cn(k,xe.groupId),cl();return}xe.conversationId&&await ea(xe.conversationId,k)}catch(C){console.error(C);const R=Ve(C);ve("error",xe.mode==="create"?"Failed to create workspace":"Failed to rename workspace",R.detail??R.message)}finally{Rt(!1)}}}function ln(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),cl())}async function Gi(y){if(y.preventDefault(),!Mt)return;const k=Mt.title.trim();if(k)try{if(Mt.mode==="rename"){if(!Mt.groupId)return;const R=await d2(Mt.groupId,{title:k});b(U=>U.map(J=>J.id===R.id?R:J)),dl();return}const C=await c2(k);b(R=>[...R,C]),Ia(R=>{const U=new Set(R);return U.delete(C.id),pp(U),U}),dl()}catch(C){console.error(C)}}function An(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),dl())}async function si(y){y.preventDefault(),await Ws()}function gi(y){u(y),fp(x,y)}function Ja(y,k){Dx(y).trim()===k&&fp(y,""),x===y&&u(C=>C.trim()===k?"":C)}function yi(y,k){d(C=>{const R=new Set(C);return k?R.add(y):R.delete(y),R})}function er(y){const k=Ve(y);ve("error","Message was not confirmed",`${k.message}. Your text is still in the composer and can be retried.`)}async function Ws(y={}){const k=r.trim();if(!k)return;if(!x){Qa();return}const C=x,R=Jt.current.has(C),U=qi.current.has(C);if(U)return;if(Rr==="running"||Ms||R||U){if(y.forceNewTurn&&!w){await Vi(C,k);return}await Nn(C,k);return}qi.current.add(C),yi(C,!0);const J=`local-${Date.now()}`;et(C,Te=>({...Te,messages:[...Te.messages,{id:J,role:"user",content:k,createdAt:new Date().toISOString()}],status:"running"})),dn(C,"running"),_n(C,!0);const be=new AbortController;Sn.current.set(C,be);let He=!1;try{let Te=null;const we=pe(`conversations/${C}/turns`),Ut=await fetch(we,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,workMode:M})});if(Ut.ok){const fn=await Ut.json();if(!fn.turnId)throw new Error("Turn did not return a turn id");if(Te=fn.turnId,(M==="complex"||w)&&(Cu(C),I("simple")),!fn.message)throw new Error("Turn did not return the persisted message");ia(C,J,fn.message,Te),He=!0,Ja(C,k)}else{const fn=await YE(Ut);if(fn){Te=fn;const oi=await Xs(C,fn,k);if(!oi.ok)throw await Gt(oi,{method:"POST",url:pe(`conversations/${C}/turns/${fn}/steer`)});const Yi=await oi.json();if(!Yi.message)throw new Error("Steer did not return the persisted message");ia(C,J,Yi.message,fn),He=!0,Ja(C,k)}else throw await Gt(Ut,{method:"POST",url:we})}if(!Te)throw await Gt(Ut,{method:"POST",url:we});Jt.current.set(C,Te),await Pi(C,Te);const kt=pe(`conversations/${C}/turns/${Te}/events`),vi=await fetch(kt,{signal:be.signal});if(!vi.ok||!vi.body)throw await Gt(vi,{method:"GET",url:kt});await $s(C),await Dp(vi.body,fn=>{const oi=kp(fn,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(C,Pr=>({...Pr,status:cs(oi)??Pr.status,events:wp(Pr.events,oi)}));const Yi=cs(oi);Yi&&dn(C,Yi)}),await ai(C),await xn()}catch(Te){if(jp(Te))return;He||er(Te);const we=PE(Te);we&&ve("error","Reset thread required",w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),Jt.current.has(C)||Pl.current.delete(C),et(C,Ut=>({...Ut,status:"error",events:[...Ut.events,{id:Ut.events.length+1,event:"client.error",data:we?{message:"Reset thread required",detail:w?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:ur(Te),createdAt:new Date().toISOString()}]})),dn(C,"error"),await xn()}finally{qi.current.delete(C),yi(C,!1),Jt.current.delete(C),Sn.current.get(C)===be&&Sn.current.delete(C),_n(C,!1),await Nt(C)}}async function Nt(y){const k=il.current.get(y)??[];if(k.length===0)return;const[C,...R]=k;il.current.set(y,R),await Ge(y,C)}async function ct(y,k={}){if(Yl.current.has(y))return;const C=new AbortController;Sn.current.set(y,C),_n(y,!0);try{const R=k.waitMs?`?waitMs=${k.waitMs}`:"",U=pe(`conversations/${y}/turns/current/events${R}`),J=await fetch(U,{signal:C.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:U});await $s(y),await Dp(J.body,be=>{const He=kp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);He.turnId&&!Jt.current.has(y)&&Jt.current.set(y,He.turnId),et(y,we=>({...we,status:cs(He)??we.status,events:wp(we.events,He)}));const Te=cs(He);Te&&dn(y,Te)}),await ai(y),await xn()}catch(R){if(!jp(R)){if(VE(R)){await ai(y),await xn();return}et(y,U=>({...U,status:"error",events:[...U.events,{id:U.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),Sn.current.get(y)===C&&Sn.current.delete(y),_n(y,!1),await Nt(y)}}async function Ge(y,k,C={}){if(Jt.current.has(y)){const U=il.current.get(y)??[];U.includes(k)||il.current.set(y,[...U,k]);return}const R=new AbortController;Sn.current.set(y,R),Jt.current.set(y,k),_n(y,!0);try{const U=pe(`conversations/${y}/turns/${k}/events`),J=await fetch(U,{signal:R.signal});if(!J.ok||!J.body)throw await Gt(J,{method:"GET",url:U});await $s(y),await Dp(J.body,be=>{const He=kp(be,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);et(y,we=>({...we,status:cs(He)??we.status,events:wp(we.events,He)}));const Te=cs(He);Te&&dn(y,Te)}),await ai(y),await xn()}catch(U){if(!jp(U)){if(C.recovered&&GE(U)){await ai(y),await xn();return}et(y,J=>({...J,status:"error",events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(U),createdAt:new Date().toISOString()}]}))}}finally{Jt.current.delete(y),Sn.current.get(y)===R&&Sn.current.delete(y),_n(y,!1),await Nt(y)}}async function Vi(y,k){yi(y,!0);let C=!1;const R=`local-queued-${Date.now()}`;et(y,U=>({...U,messages:[...U.messages,{id:R,role:"user",content:k,createdAt:new Date().toISOString()}]}));try{const U=pe(`conversations/${y}/turns`),J=await fetch(U,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:k,mode:"queue"})});if(!J.ok)throw await Gt(J,{method:"POST",url:U});const be=await J.json();if(!be.turnId)throw new Error("Queued turn did not return a turn id");if(!be.message)throw new Error("Queued turn did not return the persisted message");ia(y,R,be.message,be.turnId),C=!0,Ja(y,k),Ge(y,be.turnId),await xn(),ve("success",be.queuePosition?`Queued as next turn (${be.queuePosition})`:"Started new turn")}catch(U){C||er(U),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(U),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}async function Nn(y,k){yi(y,!0);const C=Jt.current.get(y),R=`local-steer-${Date.now()}`;if(et(y,U=>({...U,messages:[...U.messages,{id:R,role:"user",content:k,createdAt:new Date().toISOString(),turnId:C??null}],status:"running"})),!C&&qi.current.has(y)){Ks(y,k,R),yi(y,!1);return}try{const U=pe(C?`conversations/${y}/turns/${C}/steer`:`conversations/${y}/turns/steer`),J=await fetch(U,Ax(k));if(!J.ok)throw await Gt(J,{method:"POST",url:U});const be=await J.json();if(!be.message)throw new Error("Steer did not return the persisted message");ia(y,R,be.message,C),Ja(y,k)}catch(U){er(U),et(y,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(U),createdAt:new Date().toISOString()}]}))}finally{yi(y,!1)}}function Ks(y,k,C){const R=Pl.current.get(y)??[];Pl.current.set(y,[...R,{message:k,localMessageId:C}])}async function Pi(y,k){const C=Pl.current.get(y)??[];if(C.length!==0){Pl.current.delete(y);for(const R of C){const U=await Xs(y,k,R.message);if(!U.ok)throw await Gt(U,{method:"POST",url:pe(`conversations/${y}/turns/${k}/steer`)});const J=await U.json();J.message&&ia(y,R.localMessageId,J.message,k)}}}async function Xs(y,k,C){return fetch(pe(`conversations/${y}/turns/${k}/steer`),Ax(C))}function ia(y,k,C,R){et(y,U=>({...U,messages:xp(U.messages.filter(J=>J.id!==k),[{...C,turnId:R??C.turnId??null}])}))}async function la(){var C;if(!x||Rr!=="running"&&!Ms)return;const y=x,k=Jt.current.get(y);(C=Sn.current.get(y))==null||C.abort(),_n(y,!1),et(y,R=>({...R,status:"done",events:[...R.events,{id:R.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),dn(y,"done");try{const R=pe(k?`conversations/${y}/turns/${k}/stop`:`conversations/${y}/turns/interrupt`),U=await fetch(R,{method:"POST"});if(!U.ok&&U.status!==409)throw await Gt(U,{method:"POST",url:R})}catch(R){et(y,U=>({...U,events:[...U.events,{id:U.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}))}Jt.current.delete(y)}async function $n(y,k){if(!x||!y.approvalTurnId||y.approvalRequestId===void 0)return;const C=x;try{const R=pe(`conversations/${C}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),U=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k})});if(!U.ok)throw await Gt(U,{method:"POST",url:R});et(C,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:k,source:"client"},createdAt:new Date().toISOString()}]}))}catch(R){et(C,J=>({...J,events:[...J.events,{id:J.events.length+1,event:"client.error",data:ur(R),createdAt:new Date().toISOString()}]}));const U=Ve(R);ve("error","Failed to respond to approval",U.detail??U.message)}}async function pl(y,k,C){const R=x,U=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!R||!U)return!1;try{const J=pe(`conversations/${R}/workspace-change-proposals/${encodeURIComponent(U)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,payload:k==="accept"?C??y.workspaceChangePayload:void 0})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const He=await be.json();return Dn(He.conversation),et(R,Te=>({...Te,events:[...Te.events,{id:`${y.id}:${k}`,event:"server.workspace_change.decision",data:{proposalId:U,changeType:y.workspaceChangeType??"responsibility",decision:k,payload:k==="accept"?C??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),ve("success",k==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(J){console.error(J);const be=Ve(J);return ve("error","Failed to respond to workspace change proposal",be.detail??be.message),!1}}async function xi(y,k,C){const R=x;if(!(!R||!y.knowledgeProposalId))try{let U;if(k==="accept")try{U=JSON.parse(C??y.body)}catch{ve("error","Knowledge proposal JSON is invalid");return}const J=pe(`conversations/${R}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),be=await fetch(J,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:k,knowledge:U})});if(!be.ok)throw await Gt(be,{method:"POST",url:J});const He=await be.json();zt([...He.items??[]].sort(eb)),et(R,Te=>({...Te,events:[...Te.events,{id:`${y.id}:${k}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:k,knowledge:k==="accept"?He.item:null},createdAt:new Date().toISOString()}]})),ve("success",k==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(U){console.error(U);const J=Ve(U);ve("error","Failed to respond to knowledge proposal",J.detail??J.message)}}function Qs(y){de(k=>{const C=k[y.id],R=y.events.map(U=>({id:U.id,turnId:U.turnId,seq:U.seq,event:U.event,data:U.data,createdAt:U.createdAt}));return{...k,[y.id]:{messages:y.messages,events:_c(R,(C==null?void 0:C.events)??[]),timelineNodes:vp(y.timelineNodes??[],(C==null?void 0:C.timelineNodes)??[]),turns:bp(y.turns??[],(C==null?void 0:C.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:Or(y),loadingOlder:!1,fullEventTurnIds:(C==null?void 0:C.fullEventTurnIds)??new Set,loadingEventTurnIds:(C==null?void 0:C.loadingEventTurnIds)??new Set}}})}function hl(y){const k=Or(y);et(y.id,C=>{var R,U,J;return{...C,messages:xp(y.messages,C.messages),timelineNodes:vp(y.timelineNodes??[],C.timelineNodes),turns:bp(y.turns??[],C.turns),events:_c(y.events.map(be=>({id:be.id,turnId:be.turnId,seq:be.seq,event:be.event,data:be.data,createdAt:be.createdAt})),C.events),contextVersions:(((R=y.contextVersions)==null?void 0:R.length)??0)>0?y.contextVersions??[]:C.contextVersions,history:{...k,loadedMessageCount:k.loadedMessageCount+(((U=C.history)==null?void 0:U.loadedMessageCount)??C.messages.length),loadedEventCount:k.loadedEventCount+(((J=C.history)==null?void 0:J.loadedEventCount)??C.events.length)},loadingOlder:!1}})}function bi(y){const k=Or(y),C=y.events.map(R=>({id:R.id,turnId:R.turnId,seq:R.seq,event:R.event,data:R.data,createdAt:R.createdAt}));et(y.id,R=>{var U,J,be;return{...R,messages:xp(R.messages,y.messages),timelineNodes:vp(R.timelineNodes,y.timelineNodes??[]),turns:bp(R.turns,y.turns??[]),events:_c(C,R.events),contextVersions:(((U=y.contextVersions)==null?void 0:U.length)??0)>0?y.contextVersions??[]:R.contextVersions,status:y.status,history:{...R.history??k,messageTotal:k.messageTotal,eventTotal:k.eventTotal,loadedMessageCount:Math.max(((J=R.history)==null?void 0:J.loadedMessageCount)??R.messages.length,R.messages.length,y.messages.length),loadedEventCount:Math.max(((be=R.history)==null?void 0:be.loadedEventCount)??R.events.length,R.events.length,y.events.length)},loadingOlder:!1}})}function et(y,k){de(C=>{const R=C[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...C,[y]:k(R)}})}function dn(y,k){g(C=>C.map(R=>R.id===y?{...R,status:k,updatedAt:new Date().toISOString()}:R))}function Dn(y){g(k=>zo(k.map(C=>C.id===y.id?{...C,...y}:C)))}async function Zs(y,k){const C=k.filter(R=>{const U=te[y];return U&&!U.fullEventTurnIds.has(R)&&!U.loadingEventTurnIds.has(R)});if(C.length!==0){et(y,R=>{const U=new Set(R.loadingEventTurnIds);for(const J of C)U.add(J);return{...R,loadingEventTurnIds:U}});try{const R=await Promise.all(C.map(U=>cD(y,U)));et(y,U=>{const J=new Set(U.fullEventTurnIds),be=new Set(U.loadingEventTurnIds),He=R.flatMap((Te,we)=>{const Ut=C[we];return J.add(Ut),be.delete(Ut),Te.map(kt=>({id:kt.id,turnId:kt.turnId,seq:kt.seq,event:kt.event,data:kt.data,createdAt:kt.createdAt}))});return{...U,events:_c(U.events,He),fullEventTurnIds:J,loadingEventTurnIds:be}})}catch(R){console.error(R),et(y,U=>{const J=new Set(U.loadingEventTurnIds);for(const be of C)J.delete(be);return{...U,loadingEventTurnIds:J}}),ve("error","Failed to load process details")}}}function _n(y,k){const C=new Set(Yl.current);k?C.add(y):C.delete(y),Yl.current=C,ou(R=>{const U=new Set(R);return k?U.add(y):U.delete(y),U})}function Gr(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Ws({forceNewTurn:y.shiftKey}))}function ml(y){Ia(k=>{const C=new Set(k);return C.has(y)?C.delete(y):C.add(y),pp(C),C})}function Ft(y){var k;return DE(y.status,(k=y.nextWakeup)==null?void 0:k.status,ei.has(y.id))}function aa(y){var R;const k=(R=ii.current)==null?void 0:R.getBoundingClientRect(),C=k?y-k.left:y;return jh(C)}function Du(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Oi(aa(y.clientX))}function hd(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Oi(aa(y.clientX)))}function md(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const k=aa(y.clientX);Oi(k),WE(k)}return s.jsxs("main",{className:`shell${ee?" mobile-sidebar-open":""}`,ref:ii,style:{"--sidebar-width":`${ql}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),ue?s.jsxs("span",{children:["v",ue]}):null,s.jsx("span",{"aria-label":ub(me),className:`backend-status ${me}`,"data-label":ub(me)})]}),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:l,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:()=>z(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Qa,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Ha.map(y=>s.jsxs("section",{className:["workspace-group",Ss===y.id?"dragging":"",Cs===y.id?"drop-after":"",(ni==null?void 0:ni.kind)==="group"&&ni.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!La.has(y.id),className:"workspace-group-toggle",onClick:k=>{if(Ns.current){k.preventDefault(),Ns.current=!1;return}ml(y.id)},onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Br(y)},onPointerCancel:ta,onPointerDown:k=>Fs(k,y.id),onPointerMove:k=>Nu(k,y.id),onPointerUp:k=>Tn(k,y.id),type:"button",children:[s.jsx("span",{className:La.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:k=>{k.preventDefault(),k.stopPropagation(),Br(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Tx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:k=>{k.stopPropagation(),Vs(y)},title:"Delete group",type:"button",children:"×"}):null]}),La.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(k=>{const C=Ft(k);return s.jsxs("div",{className:["session-item",k.id===x?"active":"",k.id===za?"dragging":"",(ni==null?void 0:ni.kind)==="workspace"&&ni.id===k.id?`drop-${ni.position}`:""].filter(Boolean).join(" "),"data-workspace-id":k.id,onClick:R=>{if(qa.current){R.preventDefault(),qa.current=!1;return}j(k.id),z(!1)},onDoubleClick:R=>{cn(R.target)||(R.preventDefault(),ul(k))},onKeyDown:R=>{pd(R.target)||R.key==="Enter"&&(j(k.id),z(!1))},onPointerCancel:Au,onPointerDown:R=>Hr(R,k.id),onPointerMove:R=>fl(R,k.id),onPointerUp:R=>Ys(R,k.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":qc(C,k.nextWakeup,zi),className:`session-status ${C}`,title:qc(C,k.nextWakeup,zi)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:k.title}),C==="waiting"&&k.nextWakeup?s.jsx("span",{className:"session-countdown",title:qc(C,k.nextWakeup,zi),children:Wc(k.nextWakeup,zi)}):null,k.unreadTurnCount>0?s.jsx("span",{"aria-label":`${k.unreadTurnCount} unread turns`,className:"session-unread",title:`${k.unreadTurnCount} unread turns`,children:k.unreadTurnCount>99?"99+":k.unreadTurnCount}):null,C!=="running"?s.jsx("button",{"aria-label":`Delete ${k.title}`,className:"session-delete",onClick:R=>{R.stopPropagation(),sn(k)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:k.workspacePath,children:["workspaces/",ps(k.id)]})]},k.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:cd,type:"button",children:s.jsx(Vx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Jl,type:"button",children:s.jsx(QN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{ks(!0),z(!1)},type:"button",children:s.jsx(Ic,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:yu,type:"button",children:s.jsx(ZN,{})}),s.jsx(JA,{usage:rd})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>z(!1),tabIndex:ee?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Du,onPointerMove:hd,onPointerUp:md,role:"separator",tabIndex:0}),Dr&&Bl?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Bl.x+12}px, ${Bl.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Dr.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",ps(Dr.id)]})]}):null,xe?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:ln,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:ln,onSubmit:y=>void En(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:na,onKeyDown:ln,value:xe.title}),xe.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:$r,onKeyDown:ln,value:xe.groupId??((Vr=m[0])==null?void 0:Vr.id)??"",children:m.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:cl,children:"Cancel"}),s.jsx("button",{disabled:Ke,type:"submit",children:Ke?"Saving...":xe.mode==="create"?"Create":"Save"})]})]})}):null,Mt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:An,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:An,onSubmit:y=>void Gi(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:Za,onKeyDown:An,value:Mt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:dl,children:"Cancel"}),s.jsx("button",{type:"submit",children:Mt.mode==="create"?"Create":"Save"})]})]})}):null,Oe?s.jsx(pA,{currentUser:i,conversations:p,editingEnvironmentKey:kr,deploymentSettings:Dl,environmentDraft:Ol,globalEnvironment:gn,workspaceEnvironment:Si,memorySettings:tu,memorySettingsDraft:bs,workspaceMemoryDraft:nu,runtimeSettings:Nl,runtimeModels:ce,runtimeCodexVersion:Ie,runtimeCodexReleasedAt:Vt,runtimeCodexUpdating:(ut==null?void 0:ut.status)==="running",runtimeSettingsDraft:Ti,runtimeSettingsScope:nn,settingsWorkspace:en,settingsWorkspaceId:yt,systemDiagnostics:De,systemDiagnosticsLoading:S,workspaceGroups:Ha,workspaceRuntimeSettings:Ra,workspaceRuntimeSettingsDraft:xs,managedUsers:se,onCancelEnvironmentEdit:ol,onClose:()=>Ot(!1),onCreateUser:async y=>{const k=await n_(y);ye(C=>[...C,k]),ve("success","User created")},onDeleteUser:async y=>{await l_(y),ye(k=>k.filter(C=>C.id!==y)),ve("success","User deleted")},onSaveDeploymentSettings:bu,onDeleteEnvironment:y=>void ku(y),onDraftChange:zl,onEditEnvironment:ju,onRevealEnvironmentValue:y=>void Su(y),onSaveBaseMemoryItems:y=>Us(y),onSaveResponsibility:async(y,k)=>{try{const C=await Oc(y,{responsibility:k});return Dn(C),X("connected"),ve("success","Workspace responsibility saved"),C.responsibility}catch(C){throw console.error(C),X("error"),ve("error","Failed to save workspace responsibility"),C}},onSaveWorkspaceMemoryItems:y=>yt?Ka(yt,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:_l,onCodexAccountSwitched:async()=>{ve("success","Codex account switched"),(await yw()).codexAccountsReady&&await Promise.all([Pa(!0),Ya(!0),Lr()])},onUpdateCodexCli:()=>{St(!0),Fa(!0)},onRuntimeScopeChange:Rl,onSettingsWorkspaceChange:Wa,onSubmitRuntimeSettings:y=>void xu(y),onWorkspaceRuntimeDraftChange:Ml,onWorkspaceRuntimeReset:y=>yt?void Ql(yt,y):void 0,revealedEnvironmentKeys:ws,onSubmitEnvironment:y=>void Bs(y),onRefreshSystemDiagnostics:()=>void Ls(),onUpdateUser:async(y,k)=>{const C=await i_(y,k);ye(R=>R.map(U=>U.id===C.id?C:U)),ve("success","User updated")}}):null,Pt?s.jsx(fA,{currentReleasedAt:Vt,currentVersion:Ie,job:ut,latest:id,latestChecking:vr,starting:Ci,onClose:()=>St(!1),onRefresh:()=>void Fa(),onStart:()=>void zs()}):null,Ni&&Ne?s.jsx(oA,{conversation:Ne,clockNow:zi,knowledgeDraft:qn,workspaceKnowledge:Yt,tokenUsage:ll,onCancelKnowledgeEdit:()=>Ei(Oo),onDeleteKnowledge:y=>void Zl(Ne.id,y),onEditKnowledge:qs,onKnowledgeDraftChange:Ei,onSubmitKnowledge:y=>void sl(Ne.id,y),onClose:()=>el(!1)}):null,iu?s.jsx(uA,{conversations:p,onClose:()=>ks(!1),workspaceGroups:Ha}):null,Di?s.jsx(cA,{busy:ru,conversation:mi??null,conversationId:un,preview:(Qt==null?void 0:Qt.conversationId)===un?Qt:null,previewLoading:jr,result:su,status:ld,warmup:lu,workspaceGroups:Ha,onClose:()=>Ct(!1),onCancelResetPreview:()=>Lt(null),onPreviewReset:()=>void vu(),onStartBlankContext:()=>void Is(),onResetRuntime:y=>void wu(y),onSaveResetSelection:fd,onWorkspaceChange:y=>{_i(y),Ri(null),Lt(null)},onWarmupChange:au}):null,oe?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!K&&_(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:Gs,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:oe.name,onChange:y=>_(k=>k&&{...k,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:oe.groupId,onChange:y=>_(k=>k&&{...k,groupId:y.target.value}),children:Ha.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:K,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:K||!oe.name.trim(),type:"submit",children:K?"Cloning...":"Clone"})]})]})}):null,N?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>H(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:N.title}),s.jsxs("p",{children:[ob(N.status),N.startedAt&&N.finishedAt?` · ${VD(N.startedAt,N.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>H(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:N.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:N.status==="completed"?"Final plan":"Current plan"}),N.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:Ea(N.currentPlan.planMarkdown,Ne)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:N.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:N.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:N.startedAt?qe(N.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:N.finishedAt?qe(N.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>H(null),type:"button",children:"Close"})})]})}):null,$?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>W(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:$.title}),s.jsx("p",{children:qe($.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>W(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(Ho,{content:$.fullDetail??$.detail??"No additional details.",conversation:Ne,streaming:!1,onPreviewArtifact:hi,onCopyArtifactUrl:Hi,copiedArtifactUrl:It})}),s.jsxs("footer",{children:[$.linkedTaskId?s.jsx("button",{onClick:()=>{const y=$.linkedTaskId;W(null),$i(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>W(null),type:"button",children:"Close"})]})]})}):null,Kt?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Pe||sn(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Pe,onClick:()=>sn(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Kt.title})," to recycle?"]}),s.jsx("code",{children:Kt.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Pe,onClick:()=>sn(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Pe,onClick:()=>void qr(Kt),type:"button",children:Pe?"Moving...":"Move to recycle"})]})]})}):null,tl?s.jsxs("div",{className:`app-toast ${tl.tone}`,role:"status",children:[s.jsx("strong",{children:tl.text}),tl.detail?s.jsx("pre",{children:tl.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:()=>z(!0),title:"Workspaces",type:"button",children:s.jsx(XN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ne==null?void 0:Ne.title)??"New workspace"})}),Ne?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",ps(Ne.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ne?s.jsxs(s.Fragment,{children:[Ne.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:yu,title:`当前 Thread 工具集已过期(${Ne.threadCapabilityVersion} / ${Ne.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Xv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Tu,title:"Clone workspace",type:"button",children:s.jsx(KN,{})}),s.jsxs("button",{className:`context-button has-usage ${_h($a??0)}`,onClick:()=>el(!0),style:{"--context-usage":`${td($a??0)}%`},title:ll&&$a!==null?`Context ${Math.round($a)}% · ${Un(ll.totalTokens)} / ${Bc(ll.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round($a??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:dd,title:"Workspace settings",type:"button",children:s.jsx(Vx,{})})]}):null})]}),w?s.jsxs("section",{className:`complex-task-bar ${w.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void $i(w.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:w.title}),s.jsx("span",{className:"complex-task-state",children:ob(w.status)}),s.jsx("span",{className:"complex-task-duration",children:GD(w,zi)})]}),s.jsxs("div",{className:"complex-task-actions",children:[_p(w.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!w.objective||!w.currentPlan,onClick:()=>void Xa("start"),title:w.objective&&w.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,w.status==="active"?s.jsx("button",{onClick:()=>void Xa("pause"),type:"button",children:"Pause"}):null,_p(w.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Xa("resume"),type:"button",children:"Resume"}):null,_p(w.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Xa("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Xa("end"),type:"button",children:"End task"})]})]}):null,(Ne==null?void 0:Ne.status)==="initialization_failed"&&Ne.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ne.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void Hn(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void fu(),ref:Hl,style:{scrollPaddingBottom:Ts},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:Ts},children:[Fl.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ne!=null&&Ne.cloneLineage&&Rs.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ne.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",qe(Ne.cloneLineage.snapshotAt)," · ",Ne.cloneLineage.importedMessageCount," messages"]})]}):null,(ra=lt==null?void 0:lt.history)!=null&&ra.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,_s.map((y,k)=>{var be,He,Te;const C=((be=y.user)==null?void 0:be.type)==="system",R=y.turnIds.some(we=>Rs.has(we)),U=_s[k+1],J=R&&(!U||!U.turnIds.some(we=>Rs.has(we)));return s.jsxs(D.Fragment,{children:[s.jsxs("section",{className:`turn-group${R?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${C?"system-turn":"user-turn"}`,children:[Uo(y.user,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Bo,{copied:Il===`${C?"system":"user"}-${y.id}-bottom`,content:qo(y.user),id:`${C?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:Wl})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(we=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Uo(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Bo,{copied:Il===`user-${we.id}-bottom`,content:qo(we),id:`user-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id))}):null,(He=y.acceptedSystemInputs)==null?void 0:He.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Uo(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Bo,{copied:Il===`system-${we.id}-bottom`,content:qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id)),y.agentItems.length>0?s.jsx(BA,{group:y,conversation:Ne,allowProcessView:!R,copiedFooter:Il===`agent-${y.id}-bottom`,copiedArtifactUrl:It,running:!R&&Po(y.turnIds,Ga),onCopyArtifactUrl:Hi,onCopyBubble:Wl,onPreviewArtifact:hi,onLoadProcessDetails:we=>Ne&&!R?Zs(Ne.id,we):void 0,onRespondApproval:$n,onRespondWorkspaceChangeProposal:pl,onRespondKnowledgeProposal:xi,onOpenComplexTask:$i,onOpenSystemEvent:W}):null,(Te=y.trailingSystemItems)==null?void 0:Te.map(we=>s.jsxs("div",{className:"turn-panel system-turn",children:[Uo(we,Ne,hi,Hi,It,$n,pl,xi,$i,W),s.jsx(Bo,{copied:Il===`system-${we.id}-bottom`,content:qo(we),id:`system-${we.id}-bottom`,timestamp:we.createdAt,variant:"outside",onCopy:Wl})]},we.id))]}),J?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:si,ref:$l,children:[al?s.jsxs("div",{className:`global-activity ${al.tone??"running"}`,children:[Mr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void la(),title:"Stop current agent run",type:"button",children:s.jsx($A,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:al.title}),al.detail?s.jsx("small",{children:al.detail}):null]}),Mr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":w?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!w||M==="complex",className:`complex-mode-button ${w||M==="complex"?"active":""}`,disabled:!!w,onClick:()=>I(y=>y==="complex"?"simple":"complex"),title:w?"End the current complex task before switching back":M==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Mv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:w?"Complex task active":M==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{disabled:x!==null&&c.has(x),onChange:y=>gi(y.target.value),onKeyDown:Gr,placeholder:"Cmd/Ctrl + Enter",ref:li,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim()||x!==null&&c.has(x),type:"submit",children:[s.jsx(GA,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),jn?s.jsx("div",{className:"artifact-lightbox",onClick:()=>hi(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>hi(null),type:"button",children:"×"}),s.jsx("img",{alt:jn.name,src:jn.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:jn.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:jn.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void Hi(jn),type:"button",children:It===jn.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function oA({conversation:e,clockNow:i,knowledgeDraft:l,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,j]=D.useState("overview"),[w,E]=D.useState(!1),[M,I]=D.useState(!1),[N,H]=D.useState(null),[$,W]=D.useState(null),[oe,_]=D.useState(!1),[K,ae]=D.useState(null),[ee,z]=D.useState(null),[te,de]=D.useState(!1),[Ae,ge]=D.useState(null),[ue,V]=D.useState(null),se=dw(u),ye=th(e,e.status),De=N?DD(N):null;D.useEffect(()=>{E(!1),H(null),W(null),ae(null),z(null),ge(null),V(null)},[e.id]),D.useEffect(()=>{x==="additionalContext"&&!K&&S()},[x,K]),D.useEffect(()=>{x==="compactions"&&!Ae&&q()},[x,Ae]);const O=()=>{E(!0),I(!0),W(null),z2(e.id).then(T=>H(T)).catch(T=>{const Q=Ve(T);W(Q.detail?`${Q.message}
87
+ ${Q.detail}`:Q.message)}).finally(()=>I(!1))},S=()=>{_(!0),z(null),I2(e.id).then(T=>ae(T)).catch(T=>{const Q=Ve(T);z(Q.detail?`${Q.message}
88
+ ${Q.detail}`:Q.message)}).finally(()=>_(!1))},q=()=>{de(!0),V(null),U2(e.id).then(T=>ge(T)).catch(T=>{const Q=Ve(T);V(Q.detail?`${Q.message}
89
+ ${Q.detail}`:Q.message)}).finally(()=>de(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:T=>T.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>j("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>j("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>j("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>j("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>j("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>j("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Je,{label:"Status",value:qc(ye,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Je,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Je,{label:"Wake at",value:Ko(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Je,{label:"Remaining",value:Wc(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/${ps(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:Ea(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Rv,{items:r,onDelete:d,onEdit:T=>{p(T),j("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:Ea(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(NA,{draft:l,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Je,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:M,onClick:O,type:"button",children:M?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:M,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 ${_h(se)}`,children:s.jsx("span",{style:{width:`${td(se)}%`}})}):null,s.jsx(Je,{label:"Input / output",value:`${Bc(u.inputTokens)} / ${Bc(u.outputTokens)}`,mono:!0}),s.jsx(Je,{label:"Reasoning",value:Bc(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",qe(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."}),M?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):$?s.jsx("pre",{className:"thread-read-error",children:$}):N?s.jsxs(s.Fragment,{children:[De?s.jsx(LA,{summary:De}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(N,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):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:q,type:"button",children:te?"Refreshing...":"Refresh"})]}),ue?s.jsx("pre",{className:"thread-read-error",children:ue}):te&&!Ae?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ae!=null&&Ae.length?s.jsx("div",{className:"context-compaction-list",children:Ae.map(T=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:qe(T.completedAt??T.usageObservedAt??T.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${T.status}`,children:T.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:jD(T).map(Q=>s.jsxs("div",{children:[s.jsx("dt",{children:Q.label}),s.jsx("dd",{children:Q.value})]},Q.label))}),s.jsxs("small",{children:[Na(T.id),T.turnId?` · turn ${Na(T.turnId)}`:""]})]},T.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."})]})}),oe?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ee?s.jsx("pre",{className:"thread-read-error",children:ee}):K?s.jsx(OA,{preview:K,refreshing:oe,onRefresh:S}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function uA({conversations:e,onClose:i,workspaceGroups:l}){var O;const[r,u]=D.useState([]),[c,d]=D.useState("active"),[p,g]=D.useState(null),[m,b]=D.useState([]),[x,j]=D.useState(!0),[w,E]=D.useState(null),[M,I]=D.useState(null),[N,H]=D.useState(!1),[$,W]=D.useState(!1),[oe,_]=D.useState(new Set),[K,ae]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),ee=r.find(S=>S.id===p)??null,z=D.useMemo(()=>new Map(e.map(S=>[S.id,S.title])),[e]),te=r.filter(S=>c==="archived"?S.status==="archived":S.status!=="archived"),de=l.map(S=>({...S,conversations:S.conversations.filter(q=>q.id!==K.ownerWorkspaceId)})).filter(S=>S.conversations.length>0),Ae=()=>{var S;ae({title:"",publicDescription:"",ownerWorkspaceId:((S=e[0])==null?void 0:S.id)??"",participantWorkspaceIds:[]}),_(new Set),I("create")},ge=()=>{!ee||ee.status!=="active"||(ae({title:ee.title,publicDescription:ee.publicDescription,ownerWorkspaceId:ee.ownerWorkspaceId,participantWorkspaceIds:ee.members.filter(S=>S.role==="participant"&&S.status==="active").map(S=>S.workspaceId)}),_(new Set),I("edit"))},ue=async(S,q=c)=>{var T;j(!0),E(null);try{const Q=await Wx();u(Q);const me=Q.filter(xe=>q==="archived"?xe.status==="archived":xe.status!=="archived"),X=(S&&me.some(xe=>xe.id===S)?S:null)??(p&&me.some(xe=>xe.id===p)?p:((T=me[0])==null?void 0:T.id)??null);g(X),b(X?await Mc(X):[])}catch(Q){E(Q instanceof Xi?Q.detail:Q instanceof Error?Q.message:String(Q))}finally{j(!1)}};D.useEffect(()=>{ue()},[]),D.useEffect(()=>{const S=window.setInterval(()=>{(async()=>{try{const q=await Wx();u(q),p&&q.some(T=>T.id===p)&&b(await Mc(p))}catch{}})()},1e4);return()=>window.clearInterval(S)},[p]);const V=async S=>{g(S),E(null);try{b(await Mc(S))}catch(q){E(q instanceof Xi?q.detail:q instanceof Error?q.message:String(q))}},se=async S=>{var T;if(S===c)return;d(S),E(null);const q=((T=r.find(Q=>S==="archived"?Q.status==="archived":Q.status!=="archived"))==null?void 0:T.id)??null;if(g(q),!q){b([]);return}try{b(await Mc(q))}catch(Q){E(Q instanceof Xi?Q.detail:Q instanceof Error?Q.message:String(Q))}},ye=async S=>{var q;if(S.preventDefault(),!(!K.title.trim()||!K.ownerWorkspaceId)){W(!0),E(null);try{const T=M==="edit"&&ee?await s2(ee.id,{expectedVersion:ee.version,title:K.title.trim(),publicDescription:K.publicDescription.trim(),participantWorkspaceIds:K.participantWorkspaceIds}):await r2({...K,title:K.title.trim(),publicDescription:K.publicDescription.trim()});d("active"),I(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((q=e[0])==null?void 0:q.id)??"",participantWorkspaceIds:[]}),await ue(T.id,"active")}catch(T){E(T instanceof Xi?T.detail:T instanceof Error?T.message:String(T))}finally{W(!1)}}},De=async()=>{if(!(!ee||ee.status!=="active")){W(!0),E(null);try{const S=await o2(ee.id,ee.version);H(!1),d("active"),await ue(void 0,"active")}catch(S){E(S instanceof Xi?S.detail:S instanceof Error?S.message:String(S))}finally{W(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:S=>S.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:Ae,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(S=>s.jsxs("button",{className:`collaboration-topic-entry${S.id===p?" active":""}`,onClick:()=>void V(S.id),type:"button",children:[s.jsx("span",{children:S.title}),s.jsxs("small",{children:[S.members.length," 个工作空间 · ",S.status]})]},S.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ee?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ee.title}),s.jsx("p",{children:ee.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ee.status}),ee.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ee.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(ed,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ee.title}`,className:"memory-icon-button",onClick:()=>H(!0),title:"归档",type:"button",children:s.jsx(JN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ee.members.filter(S=>S.status==="active").map(S=>s.jsxs("span",{children:[S.workspaceTitleSnapshot,s.jsx("small",{children:S.role})]},`${S.workspaceId}-${S.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(S=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:S.senderTitleSnapshot}),s.jsx("span",{children:S.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Jv(S.recipientWorkspaceIds.map(q=>z.get(q)??Na(q)))}`}),s.jsx("time",{children:qe(S.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:Ea(S.contentMarkdown,void 0)})]},S.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),M?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!$&&I(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:S=>S.stopPropagation(),onSubmit:ye,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:M==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:M==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>I(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:K.title,onChange:S=>ae(q=>({...q,title:S.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:K.publicDescription,onChange:S=>ae(q=>({...q,publicDescription:S.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:M==="edit",value:K.ownerWorkspaceId,onChange:S=>ae(q=>({...q,ownerWorkspaceId:S.target.value,participantWorkspaceIds:q.participantWorkspaceIds.filter(T=>T!==S.target.value)})),children:l.map(S=>s.jsx("optgroup",{label:S.title,children:S.conversations.map(q=>s.jsx("option",{value:q.id,children:q.title},q.id))},S.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:[K.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>_(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>_(new Set(de.map(S=>S.id))),type:"button",children:"全部收起"})]})]}),de.map(S=>{const q=S.conversations,T=q.filter(me=>K.participantWorkspaceIds.includes(me.id)).length,Q=oe.has(S.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!Q,className:"collaboration-group-toggle",onClick:()=>_(me=>{const X=new Set(me);return X.has(S.id)?X.delete(S.id):X.add(S.id),X}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:Q?void 0:"expanded",children:"›"}),s.jsx("strong",{children:S.title}),s.jsxs("small",{children:[T,"/",q.length]})]}),s.jsxs("label",{title:`选择 ${S.title} 全部工作空间`,children:[s.jsx("input",{checked:T===q.length,onChange:()=>ae(me=>{const X=q.map(ze=>ze.id),xe=new Set(me.participantWorkspaceIds);return X.every(ze=>xe.has(ze))?X.forEach(ze=>xe.delete(ze)):X.forEach(ze=>xe.add(ze)),{...me,participantWorkspaceIds:Array.from(xe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),Q?null:s.jsx("div",{children:q.map(me=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:K.participantWorkspaceIds.includes(me.id),onChange:X=>ae(xe=>({...xe,participantWorkspaceIds:X.target.checked?[...xe.participantWorkspaceIds,me.id]:xe.participantWorkspaceIds.filter(ze=>ze!==me.id)})),type:"checkbox"}),s.jsx("span",{children:me.title})]},me.id))})]},S.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>I(null),type:"button",children:"取消"}),s.jsx("button",{disabled:$||!K.title.trim()||!K.ownerWorkspaceId,type:"submit",children:$?"正在保存...":M==="edit"?"保存":"创建 Topic"})]})]})}):null,N&&ee?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!$&&H(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:S=>S.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>H(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ee.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:$,onClick:()=>H(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:$,onClick:()=>void De(),type:"button",children:$?"正在归档...":"归档"})]})]})}):null]})})}function cA({busy:e,conversation:i,conversationId:l,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onStartBlankContext:j,onResetRuntime:w,onSaveResetSelection:E,onWorkspaceChange:M,onWarmupChange:I}){const N=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:H=>H.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:H=>M(H.target.value),value:l??"",children:g.map(H=>s.jsx("optgroup",{label:H.title,children:H.conversations.map($=>s.jsxs("option",{value:$.id,children:[$.title," · workspaces/",ps($.id)]},$.id))},H.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${ps(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:H=>I(H.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:N||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:N||u,onClick:j,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(dA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:E}):null]})})}function dA({busy:e,preview:i,warmup:l,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=D.useState(()=>new Set(i.entries.filter(z=>z.includedByDefault).map(z=>z.id))),[g,m]=D.useState(!1),[b,x]=D.useState(!1),[j,w]=D.useState(null),E=D.useRef(null),M=i.entries.filter(z=>d.has(z.id)),I=M.filter(z=>z.role==="user").length,N=M.length-I,H=i.entries.filter(z=>z.topicRelation!==null).map(z=>z.id),$=H.filter(z=>d.has(z)).length,W=i.entries.length>0&&d.size===i.entries.length;D.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const oe=e||b;async function _(z){x(!0),w(null);try{await c(i.entries.filter(te=>z.has(te.id)).map(te=>te.id)),p(z)}catch(te){w(Ve(te).message)}finally{x(!1)}}function K(z,te){const de=new Set(d);te?de.add(z):de.delete(z),_(de)}function ae(){const z=new Set(d);H.forEach(te=>z.add(te)),_(z)}function ee(){const z=new Set(d);H.forEach(te=>{z.has(te)?z.delete(te):z.add(te)}),_(z)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:oe?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:z=>z.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(z=>!z),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:oe,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:W,disabled:oe||i.entries.length===0,onChange:z=>void _(z.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:[I," user"]}),s.jsxs("span",{children:[N," assistant"]}),H.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[$," of ",H.length," Topic input + response"]}),s.jsx("button",{disabled:oe||$===H.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:oe,onClick:ee,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:l?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,j?s.jsx("span",{className:"reset-preview-selection-error",children:j}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((z,te)=>s.jsxs("article",{className:`reset-preview-item ${z.role} ${d.has(z.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${z.role} message ${te+1}`,checked:d.has(z.id),disabled:oe,onChange:de=>K(z.id,de.target.checked),type:"checkbox"}),s.jsx("span",{children:te+1})]}),s.jsx("strong",{children:z.role}),z.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",z.topicRelation]}):null,s.jsx("time",{dateTime:z.createdAt,children:qe(z.createdAt)})]}),s.jsx("pre",{children:z.content})]},z.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:oe,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:oe,onClick:()=>u(i.entries.filter(z=>d.has(z.id)).map(z=>z.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function fA({currentReleasedAt:e,currentVersion:i,job:l,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(l==null?void 0:l.currentVersion)??i,b=r!=null&&r.version&&ID(r.version,m)?LD(r.version):null;return D.useEffect(()=>{const x=j=>{j.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:l?`status-${l.status}`:void 0,children:(l==null?void 0:l.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:eh(m,(l==null?void 0:l.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?eh(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]})]}),l?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:qe(l.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:l!=null&&l.logs.length?l.logs.map((x,j)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:zD(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${j}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(l==null?void 0:l.status)==="running",onClick:g,type:"button",children:c?"Starting...":(l==null?void 0:l.status)==="running"?"Updating...":l?"Run again":"Start update"})]})]})})}function pA({currentUser:e,conversations:i,deploymentSettings:l,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:d,memorySettings:p,memorySettingsDraft:g,managedUsers:m,workspaceMemoryDraft:b,runtimeSettings:x,runtimeModels:j,runtimeCodexVersion:w,runtimeCodexReleasedAt:E,runtimeCodexUpdating:M,runtimeSettingsDraft:I,runtimeSettingsScope:N,settingsWorkspace:H,settingsWorkspaceId:$,systemDiagnostics:W,systemDiagnosticsLoading:oe,workspaceGroups:_,workspaceRuntimeSettings:K,workspaceRuntimeSettingsDraft:ae,onCancelEnvironmentEdit:ee,onClose:z,onCreateUser:te,onDeleteUser:de,onDeleteEnvironment:Ae,onDraftChange:ge,onEditEnvironment:ue,onSaveBaseMemoryItems:V,onSaveDeploymentSettings:se,onSaveResponsibility:ye,onSaveWorkspaceMemoryItems:De,onRevealEnvironmentValue:O,onRuntimeDraftChange:S,onCodexAccountSwitched:q,onUpdateCodexCli:T,onRuntimeScopeChange:Q,onSettingsWorkspaceChange:me,onSubmitRuntimeSettings:X,onSubmitEnvironment:xe,onRefreshSystemDiagnostics:ze,onUpdateUser:Ke,onWorkspaceRuntimeDraftChange:Rt,onWorkspaceRuntimeReset:Kt,revealedEnvironmentKeys:sn}){const[Pe,bt]=D.useState("model"),[Mt,on]=D.useState(!1),[Oe,Ot]=D.useState(null),[gn,Xt]=D.useState(!1),[Si,Xn]=D.useState((H==null?void 0:H.responsibility)??""),[Nl,At]=D.useState(!1),Dl=D.useRef(null),ie=N==="workspace"?Object.values((K==null?void 0:K.sources)??{}).filter(ce=>ce==="workspace").length:0;return D.useEffect(()=>{N==="global"&&Xt(!1)},[N]),D.useEffect(()=>{Xn((H==null?void 0:H.responsibility)??"")},[H==null?void 0:H.id,H==null?void 0:H.responsibility]),D.useEffect(()=>{if(!gn)return;const ce=Ie=>{var Vt;const Xe=Ie.target;Xe instanceof Node&&((Vt=Dl.current)!=null&&Vt.contains(Xe))||Xt(!1)},Ce=Ie=>{Ie.key==="Escape"&&Xt(!1)};return document.addEventListener("pointerdown",ce,!0),document.addEventListener("keydown",Ce,!0),()=>{document.removeEventListener("pointerdown",ce,!0),document.removeEventListener("keydown",Ce,!0)}},[gn]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:z,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ce=>ce.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":N==="global",className:N==="global"?"active":void 0,onClick:()=>Q("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:Dl,children:[s.jsx("button",{"aria-checked":N==="workspace","aria-expanded":N==="workspace"?gn:void 0,"aria-label":N==="workspace"?"Settings workspace target":void 0,className:N==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(N!=="workspace"){Q("workspace");return}Xt(ce=>!ce)},role:"radio",type:"button",children:N==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(H==null?void 0:H.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),N==="workspace"&&gn?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:_.map(ce=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ce.title}),ce.conversations.map(Ce=>s.jsxs("button",{"aria-selected":Ce.id===$,className:Ce.id===$?"selected":void 0,onClick:()=>{me(Ce.id),Xt(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Ce.title}),s.jsxs("small",{children:["workspaces/",Ce.id]})]},Ce.id))]},ce.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:z,type:"button",children:"×"})})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Pe==="model"?"active":void 0,onClick:()=>bt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Pe==="responsibility"?"active":void 0,onClick:()=>bt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Pe==="memory"?"active":void 0,onClick:()=>bt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Pe==="environment"?"active":void 0,onClick:()=>bt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Pe==="accounts"?"active":void 0,onClick:()=>bt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Pe==="deployment"?"active":void 0,onClick:()=>bt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{className:Pe==="system"?"active":void 0,onClick:()=>bt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Pe==="users"?"active":void 0,onClick:()=>bt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Pe!=="system"&&Pe!=="users"&&Pe!=="accounts"&&Pe!=="deployment"?s.jsxs("div",{className:`settings-scope-banner ${N==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:N==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:N==="workspace"?`${(H==null?void 0:H.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Pe==="system"?s.jsx(hA,{conversations:i,diagnostics:W,loading:oe,onRefresh:ze}):Pe==="users"?s.jsx(kA,{currentUser:e,users:m,onCreate:te,onDelete:de,onUpdate:Ke}):Pe==="accounts"?s.jsx(wA,{onSwitched:q}):Pe==="deployment"?s.jsx(jA,{settings:l,onSave:se}):Pe==="model"?s.jsx(SA,{draft:N==="workspace"?ae:I,globalSettings:x,models:j,codexVersion:w,codexReleasedAt:E,codexUpdating:M,scope:N,workspaceOverrideCount:ie,settings:N==="workspace"?(K==null?void 0:K.effective)??ae:x,workspaceSettings:K,onDraftChange:N==="workspace"?Rt:S,onResetWorkspaceSetting:Kt,onSubmit:X,onUpdateCodexCli:T}):Pe==="responsibility"?s.jsx(yA,{draft:Si,saving:Nl,scope:N,workspace:H,onDraftChange:Xn,onSubmit:ce=>{ce.preventDefault(),ce.stopPropagation(),!(N!=="workspace"||!H)&&(At(!0),ye(H.id,Si).then(Ce=>Xn(Ce)).finally(()=>At(!1)))}}):Pe==="memory"?s.jsx(CA,{baseSettings:p,scope:N,workspaceSettings:b,workspaceName:H==null?void 0:H.title,onSaveBaseItems:V,onSaveWorkspaceItems:De}):s.jsx(AA,{deleteConfirmKey:Oe,editingEnvironmentKey:r,environmentDraft:u,globalEnvironment:c,scope:N,workspaceEnvironment:d,valueVisible:Mt,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:Ot,onDeleteEnvironment:Ae,onDraftChange:ge,onEditEnvironment:ue,onRevealEnvironmentValue:O,onSubmitEnvironment:xe,onValueVisibleChange:on,revealedEnvironmentKeys:sn})]})]})]})})}function hA({conversations:e,diagnostics:i,loading:l,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=D.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=D.useState(!1),g=D.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=D.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},j=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map($=>`- ${Ko($.createdAt)} · ${$.level.toUpperCase()} · ${$.event} · ${$.summary}`).join(`
90
+ `),M=JSON.stringify(w,null,2),I=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Ko(i.generatedAt)}`,"","## Latest incident","","```json",M.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
91
+ `),N=`[System Log] ${w.summary}`.slice(0,180),H=new URL("https://github.com/seele-labs/seele-work/issues/new");H.searchParams.set("title",N),H.searchParams.set("body",I),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:l,onClick:r,type:"button",children:l?"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 · ",Np(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?qe(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Np(w.uptimeMs):`${Np(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(Ah,{})}),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(mA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:j,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(gA,{})}),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," · ",Ko(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:l?"Loading system information...":"System information is unavailable."})]})}function mA(){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 gA(){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 yA({draft:e,saving:i,scope:l,workspace:r,onDraftChange:u,onSubmit:c}){const d=l==="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 xA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,l)=>i.windowDurationMins-l.windowDurationMins).map(i=>{const l=td(i.usedPercent),r=zv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:hw(l)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${l}%`}})}),s.jsxs("small",{children:["Resets ",mw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function bA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function vA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function wA({onSwitched:e}){var O;const[i,l]=D.useState(null),[r,u]=D.useState(!0),[c,d]=D.useState(!1),[p,g]=D.useState(!1),[m,b]=D.useState(""),[x,j]=D.useState(!1),[w,E]=D.useState(""),[M,I]=D.useState(null),[N,H]=D.useState(null),[$,W]=D.useState(""),[oe,_]=D.useState(null),[K,ae]=D.useState(null),[ee,z]=D.useState(!1);async function te(S){d(!0),b("");try{l(await Xx(S))}catch(q){b(Ve(q).message)}finally{d(!1)}}D.useEffect(()=>{let S=!1;return v2().then(q=>{var T;S||(l(q),((T=q.login)==null?void 0:T.status)==="pending"&&(I(q.login),j(!0)),q.accounts.length>0&&(d(!0),Xx(!1).then(Q=>{S||l(Q)}).catch(Q=>{S||b(Ve(Q).message)}).finally(()=>{S||d(!1)})))}).catch(q=>{S||b(Ve(q).message)}).finally(()=>{S||u(!1)}),()=>{S=!0}},[]),D.useEffect(()=>{if(!M||M.status!=="pending")return;let S=!1;const q=window.setInterval(()=>{k2(M.id).then(async T=>{S||(I(T),T.status!=="pending"&&(window.clearInterval(q),T.status==="succeeded"&&l(Q=>{if(!Q||!T.account)return Q;const me=Q.accounts.some(X=>{var xe;return X.id===((xe=T.account)==null?void 0:xe.id)})?Q.accounts.map(X=>{var xe;return X.id===((xe=T.account)==null?void 0:xe.id)?T.account:X}):[...Q.accounts,T.account];return{...Q,accounts:me}})))}).catch(T=>{S||b(Ve(T).message)})},1e3);return()=>{S=!0,window.clearInterval(q)}},[M==null?void 0:M.id,M==null?void 0:M.status]);function de(){E(""),I(null),b(""),z(!1),j(!0)}async function Ae(S){S.preventDefault(),g(!0),b("");try{I(await w2(w.trim()))}catch(q){b(Ve(q).message)}finally{g(!1)}}async function ge(){if(!M||M.status!=="pending"){j(!1);return}g(!0),b("");try{const S=await j2(M.id);I(S),j(!1)}catch(S){b(Ve(S).message)}finally{g(!1)}}function ue(S){H(S),W(S.name),b("")}async function V(S){if(S.preventDefault(),!N)return;const q=$.trim();if(!q||q===N.name){H(null);return}g(!0),b("");try{const T=await S2(N.id,q);l(Q=>Q&&{...Q,accounts:Q.accounts.map(me=>me.id===T.id?T:me)}),H(null)}catch(T){b(Ve(T).message)}finally{g(!1)}}async function se(){var S;if(oe){g(!0),b("");try{const q=await T2(oe.id);l(q),_(null),await e()}catch(q){const T=Ve(q);b((S=T.detail)!=null&&S.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":T.detail??T.message)}finally{g(!1)}}}async function ye(){if(K){g(!0),b("");try{await C2(K.id),l(S=>S&&{...S,accounts:S.accounts.filter(q=>q.id!==K.id)}),ae(null)}catch(S){b(Ve(S).detail??Ve(S).message)}finally{g(!1)}}}const De=(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||De.length===0,onClick:()=>void te(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(M==null?void 0:M.status)==="pending",onClick:de,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&&De.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:De.map(S=>{var me;const q=(i==null?void 0:i.activeAccountId)===S.id,T=(me=i==null?void 0:i.accountDetails)==null?void 0:me[S.id],Q=[S.email,bA(S.accountType),vA(S.planType)].filter(X=>!!X);return s.jsxs("article",{className:q?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:S.name}),q?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:Q.join(" · ")||`Added ${qe(S.createdAt)}`}),T!=null&&T.usage?s.jsx(xA,{usage:T.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),T?s.jsx("small",{className:T.error?"codex-account-detail-error":"codex-account-refreshed",children:T.error?`Refresh issue: ${T.error}`:`Updated ${qe(T.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>ue(S),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||q,onClick:()=>{b(""),_(S)},type:"button",children:q?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||q,onClick:()=>{b(""),ae(S)},type:"button",children:"Delete"})]})]},S.id)})}),N?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&H(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:S=>S.stopPropagation(),onSubmit:S=>void V(S),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:S=>W(S.target.value),value:$})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>H(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!$.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!M&&j(!1),role:"presentation",children:M?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:S=>S.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:M.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void ge(),type:"button",children:"×"})]}),M.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:M.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(M.userCode),z(!0),window.setTimeout(()=>z(!1),1500)},type:"button",children:ee?"Copied":"Copy code"})]}),s.jsx("a",{href:M.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..."})]}):M.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((O=M.account)==null?void 0:O.name)??M.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:M.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void ge(),type:"button",children:M.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:S=>S.stopPropagation(),onSubmit:S=>void Ae(S),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>j(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:S=>E(S.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>j(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,oe?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&_(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:S=>S.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>_(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:oe.name}),"? The cloud runtime must be idle. Member deployments finish active turns, pause new work, and then install this credential; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>_(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void se(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,K?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:S=>S.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:K.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 ye(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function kA({currentUser:e,users:i,onCreate:l,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=D.useState(null),[g,m]=D.useState(c),[b,x]=D.useState(!1),[j,w]=D.useState(null),[E,M]=D.useState("");function I(){m(c),M(""),p("new")}function N(W){m({username:W.username,password:"",role:W.role,active:W.active}),M(""),p(W)}function H(){b||(p(null),M(""))}async function $(W){if(W.preventDefault(),!!d){x(!0),M("");try{d==="new"?await l({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(oe){M(Ve(oe).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:I,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(W=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:W.username}),W.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",qe(W.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${W.role}`,children:W.role}),s.jsx("span",{className:`user-status ${W.active?"active":"disabled"}`,children:W.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${W.username}`,className:"memory-icon-button",onClick:()=>N(W),title:"Edit",type:"button",children:s.jsx(ed,{})}),s.jsx("button",{"aria-label":`Delete user ${W.username}`,className:"memory-icon-button memory-item-delete",disabled:W.id===e.id,onClick:()=>{M(""),w(W)},title:"Delete",type:"button",children:"×"})]})]},W.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:H,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:W=>W.stopPropagation(),onSubmit:W=>void $(W),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:H,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:W=>m(oe=>({...oe,username:W.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:W=>m(oe=>({...oe,password:W.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:W=>m(oe=>({...oe,role:W.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:W=>m(oe=>({...oe,active:W.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||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,j?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:W=>W.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:j.username}),". Users that own workspaces must be disabled instead."]}),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(j.id).then(()=>w(null)).catch(W=>M(Ve(W).message))},type:"button",children:"Delete"})]})]})}):null]})}function jA({settings:e,onSave:i}){const[l,r]=D.useState(e),[u,c]=D.useState(!1);return D.useEffect(()=>r(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:d=>{d.preventDefault(),c(!0),i(l).finally(()=>c(!1))},children:[s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:l.profuseNotificationEnabled,onChange:d=>r({profuseNotificationEnabled:d.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:u,type:"submit",children:u?"Saving...":"Save deployment settings"})})]})]})}function SA({codexReleasedAt:e,codexVersion:i,codexUpdating:l,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:j,onUpdateCodexCli:w}){var M;const E=d==="workspace";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),E?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:j,children:[s.jsxs("label",{className:Dc(E,Ta(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Nc,{globalValue:ab(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Ta(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(gp,{"aria-label":"Runtime model",onChange:I=>b({...r,model:I}),options:UD(c,r.model),value:r.model||((M=c.find(I=>I.isDefault))==null?void 0:M.model)||""})]}),s.jsxs("label",{className:Dc(E,Ta(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Nc,{globalValue:lb(u.reasoningEffort),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Ta(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(gp,{"aria-label":"Runtime reasoning effort",onChange:I=>b({...r,reasoningEffort:I}),options:HE,value:r.reasoningEffort})]}),s.jsxs("label",{className:Dc(E,Ta(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Nc,{globalValue:sb(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Ta(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(gp,{"aria-label":"Permission mode",onChange:I=>b({...r,sandbox:I}),options:$E,value:r.sandbox})]}),s.jsxs("label",{className:Dc(E,Ta(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Nc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Ta(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:I=>b({...r,fastMode:I.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 ",ab(p.model,c),", reasoning"," ",lb(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",sb(p.sandbox),"."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:eh(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:l,onClick:w,type:"button",children:l?"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 Nc({globalValue:e,isWorkspaceScope:i,label:l,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:l}),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 gp({"aria-label":e,onChange:i,options:l,value:r}){const[u,c]=D.useState(!1),d=D.useRef(null),p=l.find(g=>g.value===r)??l[0]??null;return D.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:l.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Ta(e,i,l){return e!==i?"workspace":l}function Dc(e,i,l="settings-wide-field"){return[l,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function CA({baseSettings:e,scope:i,workspaceSettings:l,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?l.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(EA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(TA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function TA({ariaLabel:e,emptyText:i,items:l,onSaveItems:r,title:u}){var K;const[c,d]=D.useState(Wo(l)),[p,g]=D.useState(null),[m,b]=D.useState({key:"",value:""}),[x,j]=D.useState(null),[w,E]=D.useState(null),[M,I]=D.useState(null);D.useEffect(()=>{d(Wo(l))},[l]),D.useEffect(()=>{if(p===null)return;const ae=ee=>{ee.key==="Escape"&&(W(),E(null))};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[p]);async function N(ae,ee){I(ee);try{const z=await r(ae);return d(Wo(z)),z}finally{I(null)}}function H(){E(null),j(null),b({key:"",value:""}),g("new")}function $(ae){const ee=c[ae];ee&&(E(null),j(null),b({...ee}),g(ae))}function W(){g(null),j(null),b({key:"",value:""})}async function oe(ae){const ee=c[ae],z=(ee==null?void 0:ee.key)||`${ae}`;await N(c.filter((te,de)=>de!==ae),`delete:${z}`),E(null)}async function _(ae){ae.preventDefault(),ae.stopPropagation();const ee=m.key.trim(),z=V2(ee);if(z){j(z);return}const te=m.value.trim();if(!te){j("Value is required.");return}const de=p==="new"?-1:p;if(c.some((ge,ue)=>ue!==de&&ge.key.trim()===ee)){j(`Key "${ee}" already exists. Each memory key must be unique.`);return}const Ae={...m,key:ee,value:te};p==="new"?await N([...c,Ae],"add"):typeof p=="number"&&await N(c.map((ge,ue)=>ue===p?Ae:ge),`save:${p}`),W()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ae,ee)=>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}>`}),`
92
92
  `,s.jsx("span",{children:ae.value}),`
93
- `,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||te+1}`,className:"memory-icon-button memory-item-edit",disabled:M!==null,title:"Edit",type:"button",onClick:()=>$(te),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||te+1}`,className:"memory-icon-button memory-item-delete",disabled:M!==null,title:"Delete",type:"button",onClick:()=>T(te),children:"×"})]})]},`${te}-${ae.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:W,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ae=>ae.stopPropagation(),onSubmit:ae=>void _(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:W,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ae=>b(te=>({...te,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(te=>({...te,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:W,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:M!==null,type:"submit",children:M==="add"||M!=null&&M.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick: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:()=>T(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((X=c[w])==null?void 0:X.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:M!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:M!==null,type:"button",onClick:()=>void oe(w),children:"Delete"})]})]})}):null]})}function CA({emptyText:e,items:i}){const l=Fo(i);return l.length?s.jsx("div",{className:"memory-items-list",children:l.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}>`}),`
93
+ `,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||ee+1}`,className:"memory-icon-button memory-item-edit",disabled:M!==null,title:"Edit",type:"button",onClick:()=>$(ee),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ae.key||ee+1}`,className:"memory-icon-button memory-item-delete",disabled:M!==null,title:"Delete",type:"button",onClick:()=>E(ee),children:"×"})]})]},`${ee}-${ae.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:W,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ae=>ae.stopPropagation(),onSubmit:ae=>void _(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:W,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ae=>b(ee=>({...ee,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(ee=>({...ee,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:W,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:M!==null,type:"submit",children:M==="add"||M!=null&&M.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:((K=c[w])==null?void 0:K.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:M!==null,type:"button",onClick:()=>E(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:M!==null,type:"button",onClick:()=>void oe(w),children:"Delete"})]})]})}):null]})}function EA({emptyText:e,items:i}){const l=Wo(i);return l.length?s.jsx("div",{className:"memory-items-list",children:l.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
94
94
  `,s.jsx("span",{children:r.value}),`
95
- `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function TA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:l,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:j,onSubmitEnvironment:w,onValueVisibleChange:T,revealedEnvironmentKeys:M}){const U=i!==null&&M.has(i),N=u==="workspace",H=N?c:r,[$,W]=D.useState(!1);function oe(){p(),b({description:"",key:"",value:""}),T(!1),W(!0)}function _(te){x(te),T(!1),W(!0)}function X(){W(!1),p(),T(!1)}function ae(te){w(te),W(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:N?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:N?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),N?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Nx,{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:oe,children:"+"})}),s.jsx(Nx,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:te=>g(te),onEdit:_,variables:H})]}),$?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:te=>te.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:te=>b({...l,key:te.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:l.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:te=>b({...l,value:te.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:l.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!U&&!l.value){j(i),T(!0);return}T(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(JN,{}):s.jsx(ZN,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:te=>b({...l,description:te.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:l.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:!l.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:te=>te.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Nx({emptyText:e,onDelete:i,onEdit:l,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"," ",qe(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:()=>l==null?void 0:l(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 _v({items:e,onDelete:i,onEdit:l}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:AA(p.kind)}),s.jsx("span",{className:_A(p.status),children:NA(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",DA(p.refreshPolicy)," · updated ",qe(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:()=>l(p),title:"Edit knowledge",type:"button",children:s.jsx(Jc,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function EA({draft:e,items:i,scope:l,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return l==="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(_v,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function AA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function NA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function DA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function _A(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:l=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:l?"mono":void 0,title:i,children:i})]})}function RA({onRefresh:e,preview:i,refreshing:l}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,MA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Dx(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",qe(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:l,onClick:e,type:"button",children:l?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Dx(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[Un(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Dx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function MA(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 OA({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:Lo(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Lo(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Lo(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,l)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",l+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:Lo(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Lo(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":hs(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 Io(e,i,l,r,u,c,d,p,g,m){var b,x,j,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":qe(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":qe(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(qo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":qe(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(qx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":qe(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:GD(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:qe(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(qx,{content:e.message.content}):s.jsx(qo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:l,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(M=>s.jsx("article",{className:"message topic-input","data-hover-time":qe(M.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 ",M.senderName]}),s.jsx("time",{dateTime:M.createdAt,children:qe(M.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(qo,{content:M.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},M.id))});const T=mr({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":qe(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(Lc,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:T})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(Mv,{description:e.tool.body,icon:s.jsx(Rv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(YA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(VA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx($A,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(GA,{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":qe(e.tool.createdAt),title:qe(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(Lc,{})}),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:qe(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(qo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(j=e.tool.rawEvents)!=null&&j.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":qe(e.tool.createdAt),title:qe(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(Lc,{})}):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 _x(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&zA(e.tool)}function zA(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 LA(e){const i=[],l=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?l.push(r):i.push(r);return[...i,...l]}function IA({group:e,conversation:i,allowProcessView:l=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:j,onOpenComplexTask:w,onOpenSystemEvent:T}){const M=LA(e.agentItems.filter(_x)),U=e.agentItems.some(ee=>!_x(ee)),N=l&&(U||e.turnIds.length>0),H=c?"process":"result",[$,W]=D.useState(H),[oe,_]=D.useState(!1),X=$==="result"?M:e.agentItems,ae=KA(X);D.useEffect(()=>{oe||W(H)},[H,oe]);const te=c||N||e.stopped,L=s.jsxs(s.Fragment,{children:[te?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):N?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),W(ee=>ee==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(UA,{}):s.jsx(BA,{})}):null}):null,X.map(ee=>s.jsx(D.Fragment,{children:Io(ee,i,m,d,u,b,x,j,w,T)},ee.id)),$==="result"&&X.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":U?"No reliable final answer captured":"No result yet"}):null,s.jsx(Uo,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:XA(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:te?"stopped-turn-body has-controls":"stopped-turn-body",children:L})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",te?"has-controls":""].filter(Boolean).join(" "),children:L})}function UA(){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 BA(){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 qA(){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 Rv(){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 HA(){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 Mv({className:e="",description:i,icon:l,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":qe(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:l}),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 $A({conversation:e,tool:i,onRespond:l}){var U;const r=je((U=i.workspaceChangePayload)==null?void 0:U.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),j=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:j?"pending":"preparing",T=w==="pending";D.useEffect(()=>{c(r)},[r]);async function M(N){p(N);try{await l(i,N,N==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Mv,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(Jc,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:N=>N.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",qe(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:j?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,T?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:N=>c(N.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Ea(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Ea(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void M("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void M("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function GA({tool:e,onRespond:i}){const[l,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Rx(l);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":qe(e.createdAt),title:qe(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:l}):b?s.jsx(Mx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Mx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:l}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Rx(l)&&(c("accept"),Promise.resolve(i(e,"accept",l)).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",l)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Rx(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function gp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Mx({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:gp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:gp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:gp(e.content??e.description)})]})]})})}function VA({conversation:e,tool:i}){var d;const l=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=CE(l),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":qe(i.createdAt),title:qe(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:SE(l,r)})]}),s.jsx(Ox,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:l.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:PA(p.kind)}),s.jsx("code",{title:p.path,children:xv(p.path,r)}),s.jsx(Ox,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Ox({additions:e,deletions:i,running:l=!1}){return s.jsxs("span",{className:"file-change-stats",children:[l?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 PA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function YA({tool:e,onRespondApproval:i}){var j;const l=hD(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=l==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=Pc(e.body)?null:e.body,m=g?bD(g):null,b=m?`${FA(l)} · ${m}`:l==="running"?"Running script":l==="approval"?"Waiting for approval":"Command",x=mD(e,l);return s.jsxs("article",{className:`tool-card command ${l}`,"data-hover-time":qe(e.createdAt),title:qe(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(j=e.rawEvents)!=null&&j.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(zx,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:gD(e,l)}),e.output?s.jsx(zx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:l==="running"?"Waiting for output...":l==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(WA,{events:e.rawEvents??[]}):null]})}function FA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function zx({content:e}){const[i,l]=D.useState(!1),r=xD(e,Cx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:yD(e,Cx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>l(u=>!u),children:i?"Collapse":"Show all"}):null]})}function WA({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 Uo({copied:e,content:i,id:l,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(Kv,{})}):null,s.jsx("time",{dateTime:u,children:qe(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(l,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 Bo(e){return e.type==="message"?e.message.role==="user"?e.message.content:gr(e.message.content):e.type==="assistantText"?gr(e.content):e.type==="turnError"?`Task failed
95
+ `,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function AA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:l,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:j,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:M}){const I=i!==null&&M.has(i),N=u==="workspace",H=N?c:r,[$,W]=D.useState(!1);function oe(){p(),b({description:"",key:"",value:""}),E(!1),W(!0)}function _(ee){x(ee),E(!1),W(!0)}function K(){W(!1),p(),E(!1)}function ae(ee){w(ee),W(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:N?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:N?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),N?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(_x,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:oe,children:"+"})}),s.jsx(_x,{emptyText:N?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ee=>g(ee),onEdit:_,variables:H})]}),$?s.jsx("div",{className:"memory-editor-overlay",onClick:K,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit: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:K,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:ee=>b({...l,key:ee.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:l.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:ee=>b({...l,value:ee.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:l.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!I&&!l.value){j(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(t2,{}):s.jsx(e2,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ee=>b({...l,description:ee.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:l.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!l.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function _x({emptyText:e,onDelete:i,onEdit:l,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"," ",qe(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:()=>l==null?void 0:l(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Rv({items:e,onDelete:i,onEdit:l}){const[r,u]=D.useState(null),[c,d]=D.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:DA(p.kind)}),s.jsx("span",{className:MA(p.status),children:_A(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",RA(p.refreshPolicy)," · updated ",qe(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:()=>l(p),title:"Edit knowledge",type:"button",children:s.jsx(ed,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function NA({draft:e,items:i,scope:l,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return l==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Rv,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function DA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function _A(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function RA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function MA(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Je({label:e,value:i,mono:l=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:l?"mono":void 0,title:i,children:i})]})}function OA({onRefresh:e,preview:i,refreshing:l}){const r=["workspace_identity","workspace_environment","rendering"],u=D.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,zA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Rx(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 ",qe(i.generatedAt)]}),s.jsxs("span",{children:[Un(u.length)," keys"]}),s.jsx("button",{disabled:l,onClick:e,type:"button",children:l?"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:Rx(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 Rx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function zA(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function LA({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Je,{label:"Thread",value:e.id,mono:!0}),s.jsx(Je,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Je,{label:"Status",value:e.status}),s.jsx(Je,{label:"Source",value:e.source}),s.jsx(Je,{label:"Created",value:Io(e.createdAt)}),s.jsx(Je,{label:"Updated",value:Io(e.updatedAt)}),s.jsx(Je,{label:"Recency",value:Io(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,l)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",l+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:Io(i.startedAt)}),s.jsx(Je,{label:"Completed",value:Io(i.completedAt)}),s.jsx(Je,{label:"Duration",value:i.durationMs===null?"unknown":ms(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 Uo(e,i,l,r,u,c,d,p,g,m){var b,x,j,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":qe(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":qe(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(Ho,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":qe(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx($x,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":qe(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:YD(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:qe(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx($x,{content:e.message.content}):s.jsx(Ho,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:l,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(M=>s.jsx("article",{className:"message topic-input","data-hover-time":qe(M.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 ",M.senderName]}),s.jsx("time",{dateTime:M.createdAt,children:qe(M.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Ho,{content:M.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},M.id))});const E=mr({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":qe(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(Ic,{})}):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&&g?s.jsx(Ov,{description:e.tool.body,icon:s.jsx(Mv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(WA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(YA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(VA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx(PA,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":qe(e.tool.createdAt),title:qe(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(Ic,{})}),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:qe(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(Ho,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:l,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(j=e.tool.rawEvents)!=null&&j.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":qe(e.tool.createdAt),title:qe(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(Ic,{})}):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 Mx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&IA(e.tool)}function IA(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||!!e.linkedTaskId||e.meta==="approval"}function UA(e){const i=[],l=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?l.push(r):i.push(r);return[...i,...l]}function BA({group:e,conversation:i,allowProcessView:l=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:j,onOpenComplexTask:w,onOpenSystemEvent:E}){const M=UA(e.agentItems.filter(Mx)),I=e.agentItems.some(te=>!Mx(te)),N=l&&(I||e.turnIds.length>0),H=c?"process":"result",[$,W]=D.useState(H),[oe,_]=D.useState(!1),K=$==="result"?M:e.agentItems,ae=QA(K);D.useEffect(()=>{oe||W(H)},[H,oe]);const ee=c||N||e.stopped,z=s.jsxs(s.Fragment,{children:[ee?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):N?s.jsx("button",{"aria-label":$==="result"?"Show process":"Show result",className:"turn-view-toggle",title:$==="result"?"Show process":"Show result",type:"button",onClick:()=>{_(!0),W(te=>te==="result"?(g(e.turnIds),"process"):"result")},children:$==="result"?s.jsx(qA,{}):s.jsx(HA,{})}):null}):null,K.map(te=>s.jsx(D.Fragment,{children:Uo(te,i,m,d,u,b,x,j,w,E)},te.id)),$==="result"&&K.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":I?"No reliable final answer captured":"No result yet"}):null,s.jsx(Bo,{copied:r,content:ae,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:ZA(K),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:ee?"stopped-turn-body has-controls":"stopped-turn-body",children:z})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ee?"has-controls":""].filter(Boolean).join(" "),children:z})}function qA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function HA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function $A(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function Mv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function GA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function Ov({className:e="",description:i,icon:l,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":qe(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:l}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function VA({conversation:e,tool:i,onRespond:l}){var I;const r=je((I=i.workspaceChangePayload)==null?void 0:I.content)||i.body,[u,c]=D.useState(r),[d,p]=D.useState(null),[g,m]=D.useState("source"),[b,x]=D.useState(!1),j=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:j?"pending":"preparing",E=w==="pending";D.useEffect(()=>{c(r)},[r]);async function M(N){p(N);try{await l(i,N,N==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(Ov,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(ed,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:N=>N.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",qe(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:j?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:N=>c(N.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:Ea(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Ea(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 M("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void M("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function PA({tool:e,onRespond:i}){const[l,r]=D.useState(e.body),[u,c]=D.useState(null),[d,p]=D.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=Ox(l);return D.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":qe(e.createdAt),title:qe(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:l}):b?s.jsx(zx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(zx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:l}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{Ox(l)&&(c("accept"),Promise.resolve(i(e,"accept",l)).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",l)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function Ox(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function yp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function zx({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:yp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:yp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:yp(e.content??e.description)})]})]})})}function YA({conversation:e,tool:i}){var d;const l=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=EE(l),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":qe(i.createdAt),title:qe(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:TE(l,r)})]}),s.jsx(Lx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:l.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:FA(p.kind)}),s.jsx("code",{title:p.path,children:bv(p.path,r)}),s.jsx(Lx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Lx({additions:e,deletions:i,running:l=!1}){return s.jsxs("span",{className:"file-change-stats",children:[l?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function FA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function WA({tool:e,onRespondApproval:i}){var j;const l=yD(e),[r,u]=D.useState(!1),[c,d]=D.useState("script"),p=l==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=Yc(e.body)?null:e.body,m=g?kD(g):null,b=m?`${KA(l)} · ${m}`:l==="running"?"Running script":l==="approval"?"Waiting for approval":"Command",x=xD(e,l);return s.jsxs("article",{className:`tool-card command ${l}`,"data-hover-time":qe(e.createdAt),title:qe(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(j=e.rawEvents)!=null&&j.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Ix,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:bD(e,l)}),e.output?s.jsx(Ix,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:l==="running"?"Waiting for output...":l==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(XA,{events:e.rawEvents??[]}):null]})}function KA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Ix({content:e}){const[i,l]=D.useState(!1),r=wD(e,Ex);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:vD(e,Ex)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>l(u=>!u),children:i?"Collapse":"Show all"}):null]})}function XA({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Bo({copied:e,content:i,id:l,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(Xv,{})}):null,s.jsx("time",{dateTime:u,children:qe(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(l,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function qo(e){return e.type==="message"?e.message.role==="user"?e.message.content:gr(e.message.content):e.type==="assistantText"?gr(e.content):e.type==="turnError"?`Task failed
96
96
 
97
97
  ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
98
98
 
99
- `):""}function KA(e){return e.map(Bo).filter(i=>i.trim()).join(`
99
+ `):""}function QA(e){return e.map(qo).filter(i=>i.trim()).join(`
100
100
 
101
- `)}function XA(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.type!=="tool")return l.createdAt}return new Date().toISOString()}function QA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(ZA,{label:Ov(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 Ov(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function ZA({label:e,window:i}){const l=ed(i.usedPercent),r=Nh(l),u=`${e} usage ${pw(l)} · resets ${hw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${l}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(l),"%"]})})}function JA(e,i,l,r,u,c){const d=[...e].sort(Yo),p=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.sequence])),g=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.timelineAt])),m=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.sequence])),b=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.timelineAt])),x=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),j=x.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),w=x.filter(_=>!j.includes(_)),T=new Set(x.flatMap(_=>_.turnId?[_.turnId]:[])),M=fE(i),U=new Map(l.map(_=>[_.id,_])),N=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),$=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...l.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var Pe,bt,Mt,on;const X=U.get(_),ae=d.filter(Oe=>Oe.turnId===_),te=ae.filter(Oe=>Oe.role==="user").sort((Oe,Ot)=>{const gn=b.get(Oe.id)??Oe.createdAt,Xt=b.get(Ot.id)??Ot.createdAt;return gn.localeCompare(Xt)||Yo(Oe,Ot)}),L=ae.filter(Oe=>Oe.role==="assistant"),ee=i.filter(Oe=>Oe.turnId===_).sort(Yo),de=`turn:${_}`,Ae=r.filter(Oe=>Oe.parentId===de).sort((Oe,Ot)=>Oe.sequence-Ot.sequence),ge=(X==null?void 0:X.origin)??M.get(_),ue=j.filter(Oe=>Oe.turnId===_).sort((Oe,Ot)=>Oe.timelineAt.localeCompare(Ot.timelineAt)||Oe.sequence-Ot.sequence).map(Oe=>Lx(Oe,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?oN(Ae,ee,Vo([_],u),c):Lv(ee,Vo([_],u),c),se=L.map(zo),ye=Ae.find(Oe=>Oe.subtype==="server.complex_task.plan_updated"),_e=ee.find(Oe=>Oe.event==="server.complex_task.plan_updated"),O=(ye==null?void 0:ye.detail)??(_e==null?void 0:_e.data),A=he(he(O).task),z=he(A.currentPlan),C=je(z.planMarkdown),K=iN(sN(V,se),C),me=pE(X);me&&K.push({id:`turn-error-${me.turnId}`,type:"turnError",createdAt:me.createdAt,content:me.content});const Q=ee.find(Oe=>Oe.event==="server.wakeup.started"),xe=he(Q==null?void 0:Q.data),ze=typeof xe.instruction=="string"?xe.instruction.trim():"",Ke=ge==="timeline_event"?ee[0]:void 0,Rt=T.has(_)?null:Ke?zv(Ke,(X==null?void 0:X.startedAt)??new Date(0).toISOString()):lN(ge)?{id:`system-${_}`,type:"system",createdAt:(X==null?void 0:X.startedAt)??((Pe=ee[0])==null?void 0:Pe.createdAt)??new Date(0).toISOString(),title:aN(ge??"system"),detail:rN(ge??"system",ze),fullDetail:ze||void 0}:null,Kt=kN(ee),sn=(te[0]?b.get(te[0].id):(bt=j.find(Oe=>Oe.turnId===_))==null?void 0:bt.timelineAt)??g.get(_)??(X==null?void 0:X.startedAt)??((Mt=ae[0])==null?void 0:Mt.createdAt)??((on=ee[0])==null?void 0:on.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:Rt??(te[0]?zo(te[0]):null),followupUsers:te.slice(1).map(zo),acceptedSystemInputs:ue,agentItems:K,activity:Kt??(Vo([_],u)?{id:-1,title:K.some(Oe=>Oe.type==="assistantText"&&Oe.streaming)?"Writing response":"Working",createdAt:sn,tone:"running"}:null),notificationFailure:wN(ee),stopped:ee.some(Uv),trailingSystemItems:[],sortAt:sn,sortSequence:p.get(_)??null}}),W=d.filter(_=>!_.turnId);$.push(...W.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?zo(_):null,followupUsers:[],agentItems:_.role==="assistant"?[zo(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const oe=new Map(i.map(_=>[String(_.id),_]));return $.push(...w.map(_=>({id:_.id,turnIds:[],user:Lx(_,_.entityType==="event"&&_.entityId?oe.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),$.sort((_,X)=>{const ae=_.sortAt.localeCompare(X.sortAt);return ae!==0?ae:_.sortSequence!==null||X.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(X.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...X})=>X)}function Lx(e,i,l){var g,m;if(i||e.entityType==="event")return zv(i??Wp(e),e.createdAt);const r=he(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=$p(r,l),x=eN(r.messages,l),j=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(T=>typeof T=="string"&&T.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",j.length>0?j.map(T=>{const M=l.get(T)??T;return`${fr(M)} (\`${T}\`)`}).join(", "):"Unknown"].join(`
102
- `)}}const u=je(r.complexTaskId)||je(he(r.task).id)||void 0,c=gv(e.title,e.subtype),d=mr(r,[e.summary,e.contentMarkdown]),p=[`## ${fr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
101
+ `)}function ZA(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.type!=="tool")return l.createdAt}return new Date().toISOString()}function JA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(eN,{label:zv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function zv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function eN({label:e,window:i}){const l=td(i.usedPercent),r=_h(l),u=`${e} usage ${hw(l)} · resets ${mw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${l}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(l),"%"]})})}function tN(e,i,l,r,u,c){const d=[...e].sort(Fo),p=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.sequence])),g=new Map(r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>[_.turnId,_.timelineAt])),m=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.sequence])),b=new Map(r.filter(_=>_.nodeType==="user_message"&&_.entityId!==null).map(_=>[_.entityId,_.timelineAt])),x=r.filter(_=>_.parentId===null&&_.nodeType==="system_event"),j=x.filter(_=>_.turnId!==null&&_.subtype.startsWith("input:")),w=x.filter(_=>!j.includes(_)),E=new Set(x.flatMap(_=>_.turnId?[_.turnId]:[])),M=hE(i),I=new Map(l.map(_=>[_.id,_])),N=r.filter(_=>_.parentId===null&&_.nodeType==="agent_turn"&&_.turnId!==null).map(_=>_.turnId),$=[...new Set(r.length>0?[...N,...u?[u]:[]]:[...l.map(_=>_.id),...d.flatMap(_=>_.turnId?[_.turnId]:[]),...i.flatMap(_=>_.turnId?[_.turnId]:[])])].map(_=>{var Pe,bt,Mt,on;const K=I.get(_),ae=d.filter(Oe=>Oe.turnId===_),ee=ae.filter(Oe=>Oe.role==="user").sort((Oe,Ot)=>{const gn=b.get(Oe.id)??Oe.createdAt,Xt=b.get(Ot.id)??Ot.createdAt;return gn.localeCompare(Xt)||Fo(Oe,Ot)}),z=ae.filter(Oe=>Oe.role==="assistant"),te=i.filter(Oe=>Oe.turnId===_).sort(Fo),de=`turn:${_}`,Ae=r.filter(Oe=>Oe.parentId===de).sort((Oe,Ot)=>Oe.sequence-Ot.sequence),ge=(K==null?void 0:K.origin)??M.get(_),ue=j.filter(Oe=>Oe.turnId===_).sort((Oe,Ot)=>Oe.timelineAt.localeCompare(Ot.timelineAt)||Oe.sequence-Ot.sequence).map(Oe=>Ux(Oe,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?cN(Ae,te,Po([_],u),c):Iv(te,Po([_],u),c),se=z.map(Lo),ye=Ae.find(Oe=>Oe.subtype==="server.complex_task.plan_updated"),De=te.find(Oe=>Oe.event==="server.complex_task.plan_updated"),O=(ye==null?void 0:ye.detail)??(De==null?void 0:De.data),S=he(he(O).task),q=he(S.currentPlan),T=je(q.planMarkdown),Q=aN(uN(V,se),T),me=mE(K);me&&Q.push({id:`turn-error-${me.turnId}`,type:"turnError",createdAt:me.createdAt,content:me.content});const X=te.find(Oe=>Oe.event==="server.wakeup.started"),xe=he(X==null?void 0:X.data),ze=typeof xe.instruction=="string"?xe.instruction.trim():"",Ke=ge==="timeline_event"?te[0]:void 0,Rt=E.has(_)?null:Ke?Lv(Ke,(K==null?void 0:K.startedAt)??new Date(0).toISOString()):rN(ge)?{id:`system-${_}`,type:"system",createdAt:(K==null?void 0:K.startedAt)??((Pe=te[0])==null?void 0:Pe.createdAt)??new Date(0).toISOString(),title:sN(ge??"system"),detail:oN(ge??"system",ze),fullDetail:ze||void 0}:null,Kt=SN(te),sn=(ee[0]?b.get(ee[0].id):(bt=j.find(Oe=>Oe.turnId===_))==null?void 0:bt.timelineAt)??g.get(_)??(K==null?void 0:K.startedAt)??((Mt=ae[0])==null?void 0:Mt.createdAt)??((on=te[0])==null?void 0:on.createdAt)??new Date(0).toISOString();return{id:`turn-${_}`,turnIds:[_],user:Rt??(ee[0]?Lo(ee[0]):null),followupUsers:ee.slice(1).map(Lo),acceptedSystemInputs:ue,agentItems:Q,activity:Kt??(Po([_],u)?{id:-1,title:Q.some(Oe=>Oe.type==="assistantText"&&Oe.streaming)?"Writing response":"Working",createdAt:sn,tone:"running"}:null),notificationFailure:jN(te),stopped:te.some(Bv),trailingSystemItems:[],sortAt:sn,sortSequence:p.get(_)??null}}),W=d.filter(_=>!_.turnId);$.push(...W.map(_=>({id:`message-${_.id}`,turnIds:[],user:_.role==="user"?Lo(_):null,followupUsers:[],agentItems:_.role==="assistant"?[Lo(_)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(_.id)??_.createdAt,sortSequence:m.get(_.id)??null})));const oe=new Map(i.map(_=>[String(_.id),_]));return $.push(...w.map(_=>({id:_.id,turnIds:[],user:Ux(_,_.entityType==="event"&&_.entityId?oe.get(_.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:_.timelineAt,sortSequence:_.sequence}))),$.sort((_,K)=>{const ae=_.sortAt.localeCompare(K.sortAt);return ae!==0?ae:_.sortSequence!==null||K.sortSequence!==null?(_.sortSequence??Number.MAX_SAFE_INTEGER)-(K.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:_,...K})=>K)}function Ux(e,i,l){var g,m;if(i||e.entityType==="event")return Lv(i??Xp(e),e.createdAt);const r=he(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Gp(r,l),x=nN(r.messages,l),j=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**","",j.length>0?j.map(E=>{const M=l.get(E)??E;return`${fr(M)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
102
+ `)}}const u=je(r.complexTaskId)||je(he(r.task).id)||void 0,c=yv(e.title,e.subtype),d=mr(r,[e.summary,e.contentMarkdown]),p=[`## ${fr(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
103
103
  `):""].filter(Boolean).join(`
104
- `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function eN(e,i){if(!Array.isArray(e))return[];const l=new Set,r=[];for(const u of e){const c=he(u),d=je(c.id),p=je(c.senderWorkspaceId),g=je(c.contentMarkdown).trim(),m=je(c.createdAt);!d||l.has(d)||!p||!g||!m||(l.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(je(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function zv(e,i){return e.event==="server.collaboration.topic_created"?tN(e,i):nN(e,i)}function tN(e,i){const l=he(he(e.data).topic),r=je(l.title).trim()||"Untitled Topic",u=je(l.publicDescription).trim()||"未填写描述",c=Array.isArray(l.members)?l.members.map(he):[],d=je(l.ownerWorkspaceId),p=c.find(x=>je(x.role)==="owner"||je(x.workspaceId)===d),g=je(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>je(x.role)!=="owner"&&je(x.status)==="active"),b=m.length?m.map(x=>{const j=je(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${fr(j)} (\`${je(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",fr(r),"","**描述**","",fr(u),"","**Owner Workspace**","",`${fr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
105
- `)}}function nN(e,i){const l=he(e.data),r=Fp(e.data),u=gv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:mr(l),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${fr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
106
- `)}}function Fp(e,i=""){return Array.isArray(e)?e.map(l=>Fp(l)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([l,r])=>[l,Fp(r,l)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Wo(e)||e}function iN(e,i){const l=i.trim();return l?e.filter(r=>r.type==="assistantText"?gr(r.content).trim()!==l:r.type==="message"&&r.message.role==="assistant"?gr(r.message.content).trim()!==l:!0):e}function lN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function aN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function rN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?rw(i,20):"Auto resumed"}function sN(e,i){if(e.some(u=>u.type==="assistantText"))return Vc(e);if(i.length===0)return e;const l=[...i],r=[];for(const u of e)u.type==="tool"&&Sh(u.tool)&&jh(l,u.tool)||r.push(u);return Vc([...r,...l])}function oN(e,i,l,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=uN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(El(x),x)}if(l)for(const m of i)cN(e,m)||c.set(El(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(El(m),m);const p=Lv([...c.values()].sort(Yo),l,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:dN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:l&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:fN(m,r)})}return Vc(p)}function uN(e,i,l){if(e.entityType==="event"&&e.entityId){const r=l.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Wp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>kh(u)===e.entityId);return r.length>0?r:[Wp(e)]}return[]}function Wp(e){const i=he(e.detail),l=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":je(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":l,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function cN(e,i){const l=i.id===void 0?null:String(i.id),r=kh(i);return e.some(u=>l!==null&&u.entityType==="event"&&u.entityId===l||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function kh(e){if(e.event!=="codex.notification")return null;const i=he(e.data),l=he(i.params),r=he(l.item);return je(r.id)||je(l.itemId)||null}function dN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function fN(e,i){var r,u;const l=he(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?$p(l,i).title:e.title||sw(e.subtype),body:e.subtype==="input:collaboration_notice"?$p(l,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||ew(l),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Lv(e,i,l){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"){mN(r,p);continue}if(p.event==="server.knowledge.decision"){gN(r,p);continue}if(Uv(p)){vN(r);continue}if(p.event==="server.steer"){const T=he(p.data),M=typeof T.message=="string"?T.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof T.messageId=="string"?T.messageId:void 0});continue}const g=UD(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=ID(p.data);if(m!=null&&m.text){const T=m.itemId?d.get(m.itemId)??m.phase:m.phase,M=m.itemId??`phase:${T}`,U=`${u.get(M)??""}${m.text}`,N=Pv(U),H=c.get(M)??"",$=N.startsWith(H)?N.slice(H.length):N;if(u.set(M,U),c.set(M,N),$){const W=r[r.length-1];(W==null?void 0:W.type)==="assistantText"&&xN(W,m.itemId,T)?(W.content+=$,W.itemId=W.itemId??m.itemId,W.streamKey=W.streamKey??M,W.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:T,itemId:m.itemId,streamKey:M,streaming:i})}continue}const b=BD(p.data);if(b!=null&&b.text){const T=gr(b.text),M=b.itemId??`phase:${b.phase}`,U=bN(r,b.itemId,b.phase);if(U>=0){const N=r[U];N.type==="assistantText"&&(T?(N.content=T,N.phase=b.phase,N.itemId=N.itemId??b.itemId,N.streamKey=N.streamKey??M,N.streaming=!1,hN(r,U,b.itemId)):r.splice(U,1))}else T&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:T,phase:b.phase,itemId:b.itemId,streamKey:M,streaming:!1});continue}const x=cD(p,l);if(x){x.rawEvents=[p];const T=Ux(r,x);if(T>=0){Bx(r[T],x);continue}if(Sh(x)&&jh(r,x)||x.kind==="command"&&x.meta==="running"&&Pc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const j=dD(p);if(j){j.rawEvents=[p];const T=Ux(r,j);if(T>=0){Bx(r[T],j);continue}r.push({id:`tool-${j.id}`,type:"tool",createdAt:j.createdAt,tool:j});continue}if(vE(p)){pN(r,p);continue}const w=fD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Vc(r)}function pN(e,i){const l=kh(i);if(l)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==l)){u.tool={...u.tool,rawEvents:Bv(u.tool.rawEvents,[i])};return}}}function hN(e,i,l){if(l)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===l&&e.splice(r,1)}}function mN(e,i){const l=he(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=he(l.payload),d=je(c.content)||(typeof l.responsibility=="string"?l.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){g.tool={...g.tool,title:u==="accept"?"Workspace change applied":"Workspace change declined",meta:u==="accept"?"saved":"declined",body:d??g.tool.body,workspaceChangePayload:u==="accept"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function gN(e,i){const l=he(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=he(l.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 jh(e,i){const l=Iv(i);if(typeof l!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Ix(d,i))continue;const p=gr(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"||!Ix(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,l>=g)continue;const m=Math.max(0,Math.min(d.content.length,l-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),j=[];return b&&j.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),j.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&j.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...j),!0}if(u>=0&&l>=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 Ix(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Vc(e){const i=[],l=[];for(const c of e){if(c.type==="tool"&&Sh(c.tool)){i.push(c.tool);continue}l.push(c)}const r=[...l],u=[];for(const c of i)jh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return yN([...u,...r])}function Sh(e){return typeof Iv(e)=="number"}function Iv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function yN(e){const i=[];for(let l=0;l<e.length;l+=1){const r=e[l],u=e[l+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),l+=1;continue}i.push(r)}return i}function xN(e,i,l){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===l}function bN(e,i,l){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===l||u.phase==="unknown"||l==="unknown"))return r}return-1}function Uv(e){return e.event==="server.stop"||e.event==="server.stopped"}function vN(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 wN(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.event!=="server.notification.failed")continue;const r=he(l.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function kN(e){for(let i=e.length-1;i>=0;i-=1){const l=ow(e[i]);if(l)return l}return null}function Ux(e,i){for(let l=e.length-1;l>=0;l-=1){const r=e[l];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 l}return-1}function Bx(e,i){if(e.type!=="tool")return;const l=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&Pc(i.body)&&!Pc(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:l?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:l?e.tool.meta:i.meta,output:TD(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Bv(e.tool.rawEvents,i.rawEvents)}}function Bv(e,i){const l=[...e??[],...i??[]];if(l.length===0)return;const r=new Set;return l.filter(u=>{const c=El(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 yp(e,i){const l=new Set,r=[...e,...i].filter(u=>l.has(u.id)?!1:(l.add(u.id),!0));return r.filter(u=>qv(u)?!r.some(c=>jN(c,u)):!0)}function xp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function bp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function qv(e){return e.id.startsWith("local-")}function jN(e,i){if(qv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const l=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(l)||Number.isNaN(r)?!1:Math.abs(l-r)<=12e4}function Dc(e,i){const l=new Map,r=new Map;for(const c of[...e,...i]){const d=El(c);r.has(d)||r.set(d,r.size),l.set(d,c)}return[...l.values()].sort((c,d)=>{const p=Hv(c,d);return p!==0?p:(r.get(El(c))??0)-(r.get(El(d))??0)})}function vp(e,i){const l=El(i),r=e.findIndex(c=>El(c)===l);if(r<0)return[...e,i];if(SN(e[r],i))return e;const u=[...e];return u[r]=i,u}function SN(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 El(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Yo(e,i){const l=Hv(e,i);return l!==0?l:CN(e.id,i.id)}function Hv(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 l=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(l)&&!Number.isNaN(r)&&l!==r?l-r:Number.isNaN(l)!==Number.isNaN(r)?Number.isNaN(l)?1:-1:0}function CN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function wp(e,i){const l=he(e.data);return typeof l.__seq=="number"&&typeof l.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(l,"payload")?{id:typeof l.__eventId=="string"?l.__eventId:`stream:${l.__turnId??"unknown"}:${l.__seq}`,turnId:typeof l.__turnId=="string"?l.__turnId:null,seq:l.__seq,event:e.event,data:l.payload,createdAt:l.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const qo=D.memo(function({content:i,conversation:l,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?Pv(i):gr(i),g=l&&!r?MN(p,l):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(AN,{content:p,conversation:l}):Ea(p,l),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(RN,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},TN);function TN(e,i){var l,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((l=e.conversation)==null?void 0:l.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 qx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const EN=2;function AN({content:e,conversation:i}){const l=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=NN(e);return D.useLayoutEffect(()=>{const p=l.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*EN,j=Math.min(m,x);return b!==null&&j<=b?b:j})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:l,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Ea(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function NN(e){const i=_N(e),l=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:DN(l),activeBlock:r}}function DN(e){const i=[];let l=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(_c(i,e.slice(l,d)),l=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(_c(i,e.slice(l,m)),l=m,u=!1),g===""&&(_c(i,e.slice(l,d)),l=d)}return l<e.length&&_c(i,e.slice(l)),i}function _c(e,i){i.trim()&&e.push(i)}function _N(e){const i=e.lastIndexOf(`
104
+ `);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function nN(e,i){if(!Array.isArray(e))return[];const l=new Set,r=[];for(const u of e){const c=he(u),d=je(c.id),p=je(c.senderWorkspaceId),g=je(c.contentMarkdown).trim(),m=je(c.createdAt);!d||l.has(d)||!p||!g||!m||(l.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(je(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Lv(e,i){return e.event==="server.collaboration.topic_created"?iN(e,i):lN(e,i)}function iN(e,i){const l=he(he(e.data).topic),r=je(l.title).trim()||"Untitled Topic",u=je(l.publicDescription).trim()||"未填写描述",c=Array.isArray(l.members)?l.members.map(he):[],d=je(l.ownerWorkspaceId),p=c.find(x=>je(x.role)==="owner"||je(x.workspaceId)===d),g=je(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>je(x.role)!=="owner"&&je(x.status)==="active"),b=m.length?m.map(x=>{const j=je(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${fr(j)} (\`${je(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",fr(r),"","**描述**","",fr(u),"","**Owner Workspace**","",`${fr(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
105
+ `)}}function lN(e,i){const l=he(e.data),r=Kp(e.data),u=yv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:mr(l),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${fr(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
106
+ `)}}function Kp(e,i=""){return Array.isArray(e)?e.map(l=>Kp(l)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([l,r])=>[l,Kp(r,l)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Ko(e)||e}function aN(e,i){const l=i.trim();return l?e.filter(r=>r.type==="assistantText"?gr(r.content).trim()!==l:r.type==="message"&&r.message.role==="assistant"?gr(r.message.content).trim()!==l:!0):e}function rN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function sN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function oN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?sw(i,20):"Auto resumed"}function uN(e,i){if(e.some(u=>u.type==="assistantText"))return Pc(e);if(i.length===0)return e;const l=[...i],r=[];for(const u of e)u.type==="tool"&&Th(u.tool)&&Ch(l,u.tool)||r.push(u);return Pc([...r,...l])}function cN(e,i,l,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=dN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(El(x),x)}if(l)for(const m of i)fN(e,m)||c.set(El(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(El(m),m);const p=Iv([...c.values()].sort(Fo),l,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:pN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:l&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:hN(m,r)})}return Pc(p)}function dN(e,i,l){if(e.entityType==="event"&&e.entityId){const r=l.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Xp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>Sh(u)===e.entityId);return r.length>0?r:[Xp(e)]}return[]}function Xp(e){const i=he(e.detail),l=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":je(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":l,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function fN(e,i){const l=i.id===void 0?null:String(i.id),r=Sh(i);return e.some(u=>l!==null&&u.entityType==="event"&&u.entityId===l||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function Sh(e){if(e.event!=="codex.notification")return null;const i=he(e.data),l=he(i.params),r=he(l.item);return je(r.id)||je(l.itemId)||null}function pN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function hN(e,i){var r,u;const l=he(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Gp(l,i).title:e.title||ow(e.subtype),body:e.subtype==="input:collaboration_notice"?Gp(l,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||tw(l),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Iv(e,i,l){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){yN(r,p);continue}if(p.event==="server.knowledge.decision"){xN(r,p);continue}if(Bv(p)){kN(r);continue}if(p.event==="server.steer"){const E=he(p.data),M=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=HD(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=qD(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,M=m.itemId??`phase:${E}`,I=`${u.get(M)??""}${m.text}`,N=Yv(I),H=c.get(M)??"",$=N.startsWith(H)?N.slice(H.length):N;if(u.set(M,I),c.set(M,N),$){const W=r[r.length-1];(W==null?void 0:W.type)==="assistantText"&&vN(W,m.itemId,E)?(W.content+=$,W.itemId=W.itemId??m.itemId,W.streamKey=W.streamKey??M,W.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:$,phase:E,itemId:m.itemId,streamKey:M,streaming:i})}continue}const b=$D(p.data);if(b!=null&&b.text){const E=gr(b.text),M=b.itemId??`phase:${b.phase}`,I=wN(r,b.itemId,b.phase);if(I>=0){const N=r[I];N.type==="assistantText"&&(E?(N.content=E,N.phase=b.phase,N.itemId=N.itemId??b.itemId,N.streamKey=N.streamKey??M,N.streaming=!1,gN(r,I,b.itemId)):r.splice(I,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:M,streaming:!1});continue}const x=pD(p,l);if(x){x.rawEvents=[p];const E=qx(r,x);if(E>=0){Hx(r[E],x);continue}if(Th(x)&&Ch(r,x)||x.kind==="command"&&x.meta==="running"&&Yc(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const j=hD(p);if(j){j.rawEvents=[p];const E=qx(r,j);if(E>=0){Hx(r[E],j);continue}r.push({id:`tool-${j.id}`,type:"tool",createdAt:j.createdAt,tool:j});continue}if(kE(p)){mN(r,p);continue}const w=mD(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Pc(r)}function mN(e,i){const l=Sh(i);if(l)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==l)){u.tool={...u.tool,rawEvents:qv(u.tool.rawEvents,[i])};return}}}function gN(e,i,l){if(l)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===l&&e.splice(r,1)}}function yN(e,i){const l=he(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=he(l.payload),d=je(c.content)||(typeof l.responsibility=="string"?l.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){g.tool={...g.tool,title:u==="accept"?"Workspace change applied":"Workspace change declined",meta:u==="accept"?"saved":"declined",body:d??g.tool.body,workspaceChangePayload:u==="accept"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function xN(e,i){const l=he(i.data),r=typeof l.proposalId=="string"?l.proposalId:void 0,u=typeof l.decision=="string"?l.decision:void 0,c=he(l.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 Ch(e,i){const l=Uv(i);if(typeof l!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!Bx(d,i))continue;const p=gr(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"||!Bx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,l>=g)continue;const m=Math.max(0,Math.min(d.content.length,l-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),j=[];return b&&j.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),j.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&j.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...j),!0}if(u>=0&&l>=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 Bx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Pc(e){const i=[],l=[];for(const c of e){if(c.type==="tool"&&Th(c.tool)){i.push(c.tool);continue}l.push(c)}const r=[...l],u=[];for(const c of i)Ch(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return bN([...u,...r])}function Th(e){return typeof Uv(e)=="number"}function Uv(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function bN(e){const i=[];for(let l=0;l<e.length;l+=1){const r=e[l],u=e[l+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),l+=1;continue}i.push(r)}return i}function vN(e,i,l){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===l}function wN(e,i,l){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===l||u.phase==="unknown"||l==="unknown"))return r}return-1}function Bv(e){return e.event==="server.stop"||e.event==="server.stopped"}function kN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function jN(e){for(let i=e.length-1;i>=0;i-=1){const l=e[i];if(l.event!=="server.notification.failed")continue;const r=he(l.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function SN(e){for(let i=e.length-1;i>=0;i-=1){const l=uw(e[i]);if(l)return l}return null}function qx(e,i){for(let l=e.length-1;l>=0;l-=1){const r=e[l];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 l}return-1}function Hx(e,i){if(e.type!=="tool")return;const l=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&Yc(i.body)&&!Yc(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:l?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:l?e.tool.meta:i.meta,output:ND(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:qv(e.tool.rawEvents,i.rawEvents)}}function qv(e,i){const l=[...e??[],...i??[]];if(l.length===0)return;const r=new Set;return l.filter(u=>{const c=El(u);return r.has(c)?!1:(r.add(c),!0)})}function Lo(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function xp(e,i){const l=new Set,r=[...e,...i].filter(u=>l.has(u.id)?!1:(l.add(u.id),!0));return r.filter(u=>Hv(u)?!r.some(c=>CN(c,u)):!0)}function bp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function vp(e,i){const l=new Map;for(const r of[...e,...i])l.set(r.id,r);return[...l.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Hv(e){return e.id.startsWith("local-")}function CN(e,i){if(Hv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const l=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(l)||Number.isNaN(r)?!1:Math.abs(l-r)<=12e4}function _c(e,i){const l=new Map,r=new Map;for(const c of[...e,...i]){const d=El(c);r.has(d)||r.set(d,r.size),l.set(d,c)}return[...l.values()].sort((c,d)=>{const p=$v(c,d);return p!==0?p:(r.get(El(c))??0)-(r.get(El(d))??0)})}function wp(e,i){const l=El(i),r=e.findIndex(c=>El(c)===l);if(r<0)return[...e,i];if(TN(e[r],i))return e;const u=[...e];return u[r]=i,u}function TN(e,i){return e.turnId===i.turnId&&e.event===i.event&&e.createdAt===i.createdAt&&e.seq===i.seq&&JSON.stringify(e.data)===JSON.stringify(i.data)}function El(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Fo(e,i){const l=$v(e,i);return l!==0?l:EN(e.id,i.id)}function $v(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const l=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(l)&&!Number.isNaN(r)&&l!==r?l-r:Number.isNaN(l)!==Number.isNaN(r)?Number.isNaN(l)?1:-1:0}function EN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function kp(e,i){const l=he(e.data);return typeof l.__seq=="number"&&typeof l.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(l,"payload")?{id:typeof l.__eventId=="string"?l.__eventId:`stream:${l.__turnId??"unknown"}:${l.__seq}`,turnId:typeof l.__turnId=="string"?l.__turnId:null,seq:l.__seq,event:e.event,data:l.payload,createdAt:l.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Ho=D.memo(function({content:i,conversation:l,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?Yv(i):gr(i),g=l&&!r?zN(p,l):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(DN,{content:p,conversation:l}):Ea(p,l),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(ON,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},AN);function AN(e,i){var l,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((l=e.conversation)==null?void 0:l.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 $x({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const NN=2;function DN({content:e,conversation:i}){const l=D.useRef(null),[r,u]=D.useState(null),{committedBlocks:c,activeBlock:d}=_N(e);return D.useLayoutEffect(()=>{const p=l.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*NN,j=Math.min(m,x);return b!==null&&j<=b?b:j})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:l,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(D.Fragment,{children:Ea(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function _N(e){const i=MN(e),l=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:RN(l),activeBlock:r}}function RN(e){const i=[];let l=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Rc(i,e.slice(l,d)),l=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Rc(i,e.slice(l,m)),l=m,u=!1),g===""&&(Rc(i,e.slice(l,d)),l=d)}return l<e.length&&Rc(i,e.slice(l)),i}function Rc(e,i){i.trim()&&e.push(i)}function MN(e){const i=e.lastIndexOf(`
107
107
  `);if(i<0)return 0;const l=[0];for(let u=0;u<e.length;u+=1)e[u]===`
108
108
  `&&u+1<e.length&&l.push(u+1);let r=-1;for(const u of l){const c=e.indexOf(`
109
- `,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function RN({artifact:e,onPreview:i,onCopyUrl:l,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:()=>l(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function MN(e,i){const l=new Map;for(const r of ON(e)){const u=$v(r);if(u){const c=Gv(u).toLowerCase(),d=l.get(c);(!d||IN(u,d))&&l.set(c,u)}}return Array.from(l.values()).map(r=>zN(r,i)).filter(r=>r!==null)}function ON(e){const i=[],l=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[l,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function zN(e,i){const l=$v(e);if(!l||!LN(l))return null;const r=Vv(l,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Gv(r),url:pe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function $v(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function LN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Gv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function Vv(e,i){const l=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return l===r||!l.startsWith(`${r}/`)?l:l.slice(r.length+1)}function IN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function gr(e){return e.trim()}function Pv(e){return e.trim()}function kp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function UN(e){return{a({children:i,href:l}){if(!l)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(l),u=!r&&e?BN(l,e):null,c=u??l,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 l=$N(i);return l?Ch(l.language)==="mermaid"?s.jsx(GN,{code:l.code}):s.jsx(YN,{code:l.code,language:l.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:l}){return s.jsx("td",{style:Hx(i),children:l})},th({align:i,children:l}){return s.jsx("th",{style:Hx(i),children:l})}}}function BN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[l]=e.split("#",1),[r]=l.split("?",1),u=qN(r);if(!u)return null;const c=Vv(u,i.workspacePath);return pe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function qN(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function Hx(e){return e&&e!=="char"?{textAlign:e}:void 0}function Ea(e,i){const l=HN(e);return s.jsx(Z1,{components:UN(i),remarkPlugins:[dE],skipHtml:!0,children:l})}function HN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
110
- $2`)}function $N(e){var c;const i=D.Children.toArray(e),l=i.length===1&&D.isValidElement(i[0])?i[0]:null;if(!l||l.type!=="code")return null;const u=((c=(l.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Kp(l.props.children).replace(/\n$/,""),language:u}}function Kp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Kp).join(""):D.isValidElement(e)?Kp(e.props.children):""}const Yv="github-light",jp=new Map,Sp=new Map;let Cp=null,Tp=null;const Fv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Ch(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 Wv(e){const i=Ch(e);return!i||i==="text"||i==="txt"?"text":Fv.has(i)?i:"text"}function GN({code:e}){const l=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Sp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const j=Sp.get(e);return j?(d(j),g(null),()=>{b=!0}):(g(null),d(null),VN(l,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Sp.set(e,w),d(w),g(null))},w=>{if(!b){const T=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(T)},UE)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,l]);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(Th,{})})}),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 VN(e,i){return(await(await PN()).render(e,i)).svg}function PN(){return Tp||(Tp=jt(()=>import("./mermaid.core-CF4D4k4A.js").then(e=>e.bp),[],import.meta.url).then(e=>{const i=e.default;return i.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),i})),Tp}function YN({code:e,language:i,reserveHeight:l=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!Vx(i))return null;const m=Gx(e,i);return jp.get(m)??null}),p=l?{"--code-block-min-height":`${XE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!Vx(i))return d(null),()=>{m=!0};const b=Gx(e,i),x=jp.get(b);return x?(d(x),()=>{m=!0}):(d(null),e2(e,i).then(j=>{jp.set(b,j),m||d(j)}).catch(j=>{console.warn("Failed to highlight code block",j),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Th,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Th(){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 FN(){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 Kv(){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 WN(){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 KN(){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 $x(){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 XN(){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 Lc(){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 Jc(){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 QN(){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 ZN(){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 JN(){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 Gx(e,i){return`${Yv}:${Wv(i)}:${e}`}function Vx(e){const i=Ch(e);return!!i&&Fv.has(i)}async function e2(e,i){return(await t2()).codeToHtml(e,{lang:Wv(i),theme:Yv})}function t2(){return Cp||(Cp=n2()),Cp}async function n2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:l},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:j},{default:w},{default:T},{default:M},{default:U},{default:N},{default:H},{default:$},{default:W},{default:oe}]=await Promise.all([jt(()=>import("./core-oe5gdaUo.js"),[],import.meta.url),jt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),jt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),jt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),jt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),jt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),jt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),jt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),jt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),jt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),jt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),jt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),jt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),jt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),jt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),jt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),jt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),jt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),jt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[l],langs:[r,u,c,d,p,g,m,b,x,j,w,T,M,U,N,H,$,W,oe]})}async function Px(){const e=pe("conversations"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).conversations}async function i2(){const e=pe("workspace-states"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).workspaces}async function Yx(){const e=pe("collaboration/topics"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).topics}async function Rc(e){const i=pe(`collaboration/topics/${e}/messages?limit=100`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).messages}async function l2(e){const i=pe("collaboration/topics"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"POST",url:i}),(await l.json()).topic}async function a2(e,i){const l=pe(`collaboration/topics/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).topic}async function r2(e,i){const l=pe(`collaboration/topics/${e}/archive`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Se(r,{method:"POST",url:l}),(await r.json()).topic}async function s2(e){const i=pe(`conversations/${e}/read`),l=await fetch(i,{method:"POST"});await Se(l,{method:"POST",url:i})}async function Fx(){const e=pe("workspace-groups"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).groups}async function o2(e){const i=pe("workspace-groups"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Se(l,{method:"POST",url:i}),(await l.json()).group}async function u2(e,i){const l=pe(`workspace-groups/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).group}async function c2(e){const i=pe(`workspace-groups/${e}`),l=await fetch(i,{method:"DELETE"});return await Se(l,{method:"DELETE",url:i}),await l.json()}async function d2(){const e=pe("settings/environment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).variables}async function f2(e){const i=pe(`conversations/${e}/settings/environment`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).variables}async function p2(e){const i=pe(`conversations/${e}/knowledge`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).items}async function h2(){const e=pe("settings/runtime"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function m2(){const e=pe("settings/deployment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function g2(){const e=pe("diagnostics"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function y2(){const e=pe("settings/runtime/codex"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function Wx(){const e=pe("settings/runtime/accounts"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function Kx(e=!1){const i=pe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),await l.json()}async function x2(e){const i=pe("settings/runtime/accounts"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return await Se(l,{method:"POST",url:i}),(await l.json()).login}async function b2(e){const i=pe(`settings/runtime/accounts/login/${e}`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).login}async function v2(e){const i=pe(`settings/runtime/accounts/login/${e}/cancel`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),(await l.json()).login}async function w2(e,i){const l=pe(`settings/runtime/accounts/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return await Se(r,{method:"PATCH",url:l}),(await r.json()).account}async function k2(e){const i=pe(`settings/runtime/accounts/${e}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i})}async function j2(e){const i=pe(`settings/runtime/accounts/${e}/switch`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),await l.json()}async function S2(e=!0){const i=pe(`settings/runtime/models?refresh=${e?"1":"0"}`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function C2(e=!1){const i=pe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function T2(){const e=pe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Se(i,{method:"POST",url:e}),(await i.json()).job}async function E2(e){const i=pe(`conversations/${e}/settings/runtime`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).settings}async function A2(){const e=pe("settings/memory"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function N2(e){const i=pe("settings/runtime"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),(await l.json()).settings}async function D2(e){const i=pe("settings/deployment"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),(await l.json()).settings}async function Xx(e,i){const l=pe(`conversations/${e}/settings/runtime`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PUT",url:l}),await r.json()}async function Qx(e,i){const l=pe(`conversations/${e}/runtime/reset`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"POST",url:l});const u=(await r.json()).job;return Qv(e,u)}async function Xv(e){const i=pe(`conversations/${e}/runtime/reset`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).job}async function Qv(e,i){let l=i;const r=Date.now()+1800*1e3;for(;l.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 Xv(e);if(!u||u.id!==l.id)throw new Error("The runtime reset job is no longer available.");l=u}if(l.status==="failed"||!l.result)throw new Error(l.error??"Full-history reset failed.");return l.result}async function Zx(e){const i=pe(`conversations/${e}/runtime/reset-preview`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function _2(e,i){const l=pe(`conversations/${e}/runtime/reset-selection`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"PUT",url:l})}async function R2(e){const i=pe(`conversations/${e}/runtime/thread-read`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).result}async function M2(e){const i=pe(`conversations/${e}/runtime/token-usage`),l=await fetch(i);await Se(l,{url:i});const r=await l.json();return r.event?uw(r.event):null}async function O2(e){const i=pe(`conversations/${e}/runtime/additional-context`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function z2(e){const i=pe(`conversations/${e}/runtime/compactions`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).compactions}function L2(e,i){return{model:e.model===i.model?null:e.model,reasoningEffort:e.reasoningEffort===i.reasoningEffort?null:e.reasoningEffort,fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function I2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:B2(e.sourceCluesText),requiredEnv:q2(e.requiredEnvText)}}function U2(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(`
109
+ `,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function ON({artifact:e,onPreview:i,onCopyUrl:l,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:()=>l(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function zN(e,i){const l=new Map;for(const r of LN(e)){const u=Gv(r);if(u){const c=Vv(u).toLowerCase(),d=l.get(c);(!d||BN(u,d))&&l.set(c,u)}}return Array.from(l.values()).map(r=>IN(r,i)).filter(r=>r!==null)}function LN(e){const i=[],l=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[l,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function IN(e,i){const l=Gv(e);if(!l||!UN(l))return null;const r=Pv(l,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:Vv(r),url:pe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function Gv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function UN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Vv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function Pv(e,i){const l=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return l===r||!l.startsWith(`${r}/`)?l:l.slice(r.length+1)}function BN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function gr(e){return e.trim()}function Yv(e){return e.trim()}function jp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function qN(e){return{a({children:i,href:l}){if(!l)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(l),u=!r&&e?HN(l,e):null,c=u??l,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 l=VN(i);return l?Eh(l.language)==="mermaid"?s.jsx(PN,{code:l.code}):s.jsx(WN,{code:l.code,language:l.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:l}){return s.jsx("td",{style:Gx(i),children:l})},th({align:i,children:l}){return s.jsx("th",{style:Gx(i),children:l})}}}function HN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[l]=e.split("#",1),[r]=l.split("?",1),u=$N(r);if(!u)return null;const c=Pv(u,i.workspacePath);return pe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function $N(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function Gx(e){return e&&e!=="char"?{textAlign:e}:void 0}function Ea(e,i){const l=GN(e);return s.jsx(eC,{components:qN(i),remarkPlugins:[pE],skipHtml:!0,children:l})}function GN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
110
+ $2`)}function VN(e){var c;const i=D.Children.toArray(e),l=i.length===1&&D.isValidElement(i[0])?i[0]:null;if(!l||l.type!=="code")return null;const u=((c=(l.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Qp(l.props.children).replace(/\n$/,""),language:u}}function Qp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Qp).join(""):D.isValidElement(e)?Qp(e.props.children):""}const Fv="github-light",Sp=new Map,Cp=new Map;let Tp=null,Ep=null;const Wv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Eh(e){const i=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[i]??i}function Kv(e){const i=Eh(e);return!i||i==="text"||i==="txt"?"text":Wv.has(i)?i:"text"}function PN({code:e}){const l=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=D.useState(!1),[c,d]=D.useState(()=>Cp.get(e)??null),[p,g]=D.useState(null);D.useEffect(()=>{let b=!1,x;const j=Cp.get(e);return j?(d(j),g(null),()=>{b=!0}):(g(null),d(null),YN(l,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Cp.set(e,w),d(w),g(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(E)},qE)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,l]);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(Ah,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function YN(e,i){return(await(await FN()).render(e,i)).svg}function FN(){return Ep||(Ep=jt(()=>import("./mermaid.core-CdmqBWlH.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})),Ep}function WN({code:e,language:i,reserveHeight:l=!1}){const[r,u]=D.useState(!1),[c,d]=D.useState(()=>{if(!Yx(i))return null;const m=Px(e,i);return Sp.get(m)??null}),p=l?{"--code-block-min-height":`${ZE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!Yx(i))return d(null),()=>{m=!0};const b=Px(e,i),x=Sp.get(b);return x?(d(x),()=>{m=!0}):(d(null),n2(e,i).then(j=>{Sp.set(b,j),m||d(j)}).catch(j=>{console.warn("Failed to highlight code block",j),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Ah,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Ah(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function KN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Xv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function XN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function QN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function Vx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function ZN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Ic(){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 ed(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function JN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function e2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function t2(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Px(e,i){return`${Fv}:${Kv(i)}:${e}`}function Yx(e){const i=Eh(e);return!!i&&Wv.has(i)}async function n2(e,i){return(await i2()).codeToHtml(e,{lang:Kv(i),theme:Fv})}function i2(){return Tp||(Tp=l2()),Tp}async function l2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:l},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:j},{default:w},{default:E},{default:M},{default:I},{default:N},{default:H},{default:$},{default:W},{default:oe}]=await Promise.all([jt(()=>import("./core-Bw-_nA47.js"),[],import.meta.url),jt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),jt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.b),[],import.meta.url),jt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),jt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),jt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),jt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),jt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),jt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),jt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),jt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),jt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),jt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(_=>_.s),[],import.meta.url),jt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),jt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),jt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),jt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),jt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),jt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[l],langs:[r,u,c,d,p,g,m,b,x,j,w,E,M,I,N,H,$,W,oe]})}async function Fx(){const e=pe("conversations"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).conversations}async function a2(){const e=pe("workspace-states"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).workspaces}async function Wx(){const e=pe("collaboration/topics"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).topics}async function Mc(e){const i=pe(`collaboration/topics/${e}/messages?limit=100`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).messages}async function r2(e){const i=pe("collaboration/topics"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"POST",url:i}),(await l.json()).topic}async function s2(e,i){const l=pe(`collaboration/topics/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).topic}async function o2(e,i){const l=pe(`collaboration/topics/${e}/archive`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await Se(r,{method:"POST",url:l}),(await r.json()).topic}async function u2(e){const i=pe(`conversations/${e}/read`),l=await fetch(i,{method:"POST"});await Se(l,{method:"POST",url:i})}async function Kx(){const e=pe("workspace-groups"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).groups}async function c2(e){const i=pe("workspace-groups"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Se(l,{method:"POST",url:i}),(await l.json()).group}async function d2(e,i){const l=pe(`workspace-groups/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).group}async function f2(e){const i=pe(`workspace-groups/${e}`),l=await fetch(i,{method:"DELETE"});return await Se(l,{method:"DELETE",url:i}),await l.json()}async function p2(){const e=pe("settings/environment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).variables}async function h2(e){const i=pe(`conversations/${e}/settings/environment`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).variables}async function m2(e){const i=pe(`conversations/${e}/knowledge`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).items}async function g2(){const e=pe("settings/runtime"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function y2(){const e=pe("settings/deployment"),i=await fetch(e);return await Se(i,{url:e}),(await i.json()).settings}async function x2(){const e=pe("diagnostics"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function b2(){const e=pe("settings/runtime/codex"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function v2(){const e=pe("settings/runtime/accounts"),i=await fetch(e);await Se(i,{url:e});const l=await i.json();return xr(),l}async function Xx(e=!1){const i=pe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),l=await fetch(i,{method:"POST"});await Se(l,{method:"POST",url:i});const r=await l.json();return xr(),r}async function w2(e){const i=pe("settings/runtime/accounts"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Se(l,{method:"POST",url:i});const r=await l.json();return r.login.status==="succeeded"&&xr(),r.login}async function k2(e){const i=pe(`settings/runtime/accounts/login/${e}`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).login}async function j2(e){const i=pe(`settings/runtime/accounts/login/${e}/cancel`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),(await l.json()).login}async function S2(e,i){const l=pe(`settings/runtime/accounts/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});await Se(r,{method:"PATCH",url:l});const u=await r.json();return xr(),u.account}async function C2(e){const i=pe(`settings/runtime/accounts/${e}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i}),xr()}async function T2(e){const i=pe(`settings/runtime/accounts/${e}/switch`),l=await fetch(i,{method:"POST"});await Se(l,{method:"POST",url:i});const r=await l.json();return xr(),r}async function E2(e=!0){const i=pe(`settings/runtime/models?refresh=${e?"1":"0"}`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function A2(e=!1){const i=pe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function N2(){const e=pe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await Se(i,{method:"POST",url:e}),(await i.json()).job}async function D2(e){const i=pe(`conversations/${e}/settings/runtime`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).settings}async function _2(){const e=pe("settings/memory"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function R2(e){const i=pe("settings/runtime"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),(await l.json()).settings}async function M2(e){const i=pe("settings/deployment"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),(await l.json()).settings}async function Qx(e,i){const l=pe(`conversations/${e}/settings/runtime`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PUT",url:l}),await r.json()}async function Zx(e,i){const l=pe(`conversations/${e}/runtime/reset`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"POST",url:l});const u=(await r.json()).job;return Zv(e,u)}async function Qv(e){const i=pe(`conversations/${e}/runtime/reset`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).job}async function Zv(e,i){let l=i;const r=Date.now()+1800*1e3;for(;l.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 Qv(e);if(!u||u.id!==l.id)throw new Error("The runtime reset job is no longer available.");l=u}if(l.status==="failed"||!l.result)throw new Error(l.error??"Full-history reset failed.");return l.result}async function Jx(e){const i=pe(`conversations/${e}/runtime/reset-preview`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function O2(e,i){const l=pe(`conversations/${e}/runtime/reset-selection`),r=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await Se(r,{method:"PUT",url:l})}async function z2(e){const i=pe(`conversations/${e}/runtime/thread-read`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).result}async function L2(e){const i=pe(`conversations/${e}/runtime/token-usage`),l=await fetch(i);await Se(l,{url:i});const r=await l.json();return r.event?cw(r.event):null}async function I2(e){const i=pe(`conversations/${e}/runtime/additional-context`),l=await fetch(i);return await Se(l,{url:i}),await l.json()}async function U2(e){const i=pe(`conversations/${e}/runtime/compactions`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).compactions}function B2(e,i){return{model:e.model===i.model?null:e.model,reasoningEffort:e.reasoningEffort===i.reasoningEffort?null:e.reasoningEffort,fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox}}function q2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:$2(e.sourceCluesText),requiredEnv:G2(e.requiredEnvText)}}function H2(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
111
111
  `),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
112
- `)}}function B2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(l=>l.trim()).filter(Boolean).map(l=>{const r=l.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():l,providedBy:"user",providedAt:i}})}function q2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[l,...r]=i.split(/\s+-\s+/);return{key:l.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function Jx(e,i){const l=eb(i.attention)-eb(e.attention);return l!==0?l:i.updatedAt.localeCompare(e.updatedAt)}function eb(e){return e==="watch"?2:e==="tracked"?1:0}function Fo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function H2(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 $2(e){return Fo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
113
- `)}async function G2(e){const i=pe("settings/memory"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),await l.json()}async function V2(e,i,l){const r=pe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:l,key:e,value:i})});return await Se(u,{method:"PUT",url:r}),(await u.json()).variable}async function P2(e,i,l,r){const u=pe(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:l})});return await Se(c,{method:"PUT",url:u}),await c.json()}async function Y2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}/reveal`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).variable.value}async function F2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).variable.value}async function W2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i})}async function K2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});return await Se(r,{method:"DELETE",url:l}),(await r.json()).conversation}async function X2(e,i){const l=pe(`conversations/${e}/knowledge`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"POST",url:l}),(await r.json()).item}async function Q2(e,i,l){const r=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return await Se(u,{method:"PATCH",url:r}),(await u.json()).item}async function Z2(e,i){const l=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});await Se(r,{method:"DELETE",url:l})}async function J2(){const e=pe("meta"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function eD(e){const i=pe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).usage??null}async function tD(e,i){const l=pe("conversations"),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Se(r,{method:"POST",url:l}),(await r.json()).conversation}async function nD(e){const i=pe(`conversations/${e}/complex-task`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).task}async function iD(e,i){const l=pe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).task}async function lD(e,i){const l=pe(`conversations/${e}/complex-task/${i}`),r=await fetch(l,{method:"POST"});return await Se(r,{method:"POST",url:l}),(await r.json()).task}async function aD(e,i,l){const r=pe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:l})});return await Se(u,{method:"POST",url:r}),await u.json()}async function rD(e){const i=pe(`conversations/${e}/clone/retry`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),await l.json()}async function Ep(e,i={}){const l=new URLSearchParams;l.set("limit",String(i.limit??bv)),i.before&&l.set("before",i.before);const r=pe(`conversations/${e}?${l}`),u=await fetch(r);return await Se(u,{url:r}),(await u.json()).conversation}async function sD(e,i){const l=pe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).events}async function Mc(e,i){const l=pe(`conversations/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).conversation}async function oD(e){const i=pe(`conversations/${e}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i})}function uD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Zv(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function cD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:_D(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=he(e.data),d=je(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=je(c.audience),x=je(c.recipientWorkspaceId),j=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(U=>typeof U=="string"):Array.isArray(c.recipients)?c.recipients.filter(U=>typeof U=="string"):[],w=j.filter(U=>U!=="ALL").map(U=>i.get(U)).filter(U=>!!U);let T="Topic";w.length>0?T=Zv(w):j.length===1?T=j[0]==="ALL"?"Topic participants":Na(j[0]):j.length>1?T=`${j.length} workspaces`:b==="public"||b==="all"?T="Topic participants":b==="owner"&&(T="Topic owner");const M=je(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:M?`Topic ${Na(M)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?je(c.contentMarkdown)||void 0:je(c.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(g||m)&&je(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=he(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=he(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=he(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",j=Array.isArray(b.options)?b.options.map(w=>{const T=he(w);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
112
+ `)}}function $2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(l=>l.trim()).filter(Boolean).map(l=>{const r=l.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():l,providedBy:"user",providedAt:i}})}function G2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[l,...r]=i.split(/\s+-\s+/);return{key:l.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function eb(e,i){const l=tb(i.attention)-tb(e.attention);return l!==0?l:i.updatedAt.localeCompare(e.updatedAt)}function tb(e){return e==="watch"?2:e==="tracked"?1:0}function Wo(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function V2(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function P2(e){return Wo(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
113
+ `)}async function Y2(e){const i=pe("settings/memory"),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Se(l,{method:"PUT",url:i}),await l.json()}async function F2(e,i,l){const r=pe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:l,key:e,value:i})});return await Se(u,{method:"PUT",url:r}),(await u.json()).variable}async function W2(e,i,l,r){const u=pe(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:l})});return await Se(c,{method:"PUT",url:u}),await c.json()}async function K2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}/reveal`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).variable.value}async function X2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).variable.value}async function Q2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i})}async function Z2(e,i){const l=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});return await Se(r,{method:"DELETE",url:l}),(await r.json()).conversation}async function J2(e,i){const l=pe(`conversations/${e}/knowledge`),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"POST",url:l}),(await r.json()).item}async function eD(e,i,l){const r=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});return await Se(u,{method:"PATCH",url:r}),(await u.json()).item}async function tD(e,i){const l=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(l,{method:"DELETE"});await Se(r,{method:"DELETE",url:l})}async function nD(){const e=pe("meta"),i=await fetch(e);return await Se(i,{url:e}),await i.json()}async function iD(e){const i=pe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).usage??null}async function lD(e,i){const l=pe("conversations"),r=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await Se(r,{method:"POST",url:l}),(await r.json()).conversation}async function aD(e){const i=pe(`conversations/${e}/complex-task`),l=await fetch(i);return await Se(l,{url:i}),(await l.json()).task}async function rD(e,i){const l=pe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).task}async function sD(e,i){const l=pe(`conversations/${e}/complex-task/${i}`),r=await fetch(l,{method:"POST"});return await Se(r,{method:"POST",url:l}),(await r.json()).task}async function oD(e,i,l){const r=pe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:l})});return await Se(u,{method:"POST",url:r}),await u.json()}async function uD(e){const i=pe(`conversations/${e}/clone/retry`),l=await fetch(i,{method:"POST"});return await Se(l,{method:"POST",url:i}),await l.json()}async function Ap(e,i={}){const l=new URLSearchParams;l.set("limit",String(i.limit??vv)),i.before&&l.set("before",i.before);const r=pe(`conversations/${e}?${l}`),u=await fetch(r);return await Se(u,{url:r}),(await u.json()).conversation}async function cD(e,i){const l=pe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(l);return await Se(r,{url:l}),(await r.json()).events}async function Oc(e,i){const l=pe(`conversations/${e}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await Se(r,{method:"PATCH",url:l}),(await r.json()).conversation}async function dD(e){const i=pe(`conversations/${e}`),l=await fetch(i,{method:"DELETE"});await Se(l,{method:"DELETE",url:i})}function fD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Jv(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function pD(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:OD(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=he(e.data),d=je(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=je(c.audience),x=je(c.recipientWorkspaceId),j=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(I=>typeof I=="string"):Array.isArray(c.recipients)?c.recipients.filter(I=>typeof I=="string"):[],w=j.filter(I=>I!=="ALL").map(I=>i.get(I)).filter(I=>!!I);let E="Topic";w.length>0?E=Jv(w):j.length===1?E=j[0]==="ALL"?"Topic participants":Na(j[0]):j.length>1?E=`${j.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const M=je(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:M?`Topic ${Na(M)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?je(c.contentMarkdown)||void 0:je(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(g||m)&&je(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=he(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=he(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=he(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",j=Array.isArray(b.options)?b.options.map(w=>{const E=he(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
114
114
  `):"";return j?`${x}
115
115
 
116
116
  ${j}`:x}).join(`
117
117
 
118
- `);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=he(e.data);if(je(c.actionType)==="seele_workspace_change"){const p=he(c.payload),g=he(p.payload),m=je(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:lw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=jE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=kE(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=he(e.data),d=he(c.params),p=je(d.tool)||"dynamic tool",g=he(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:nw(p,!1,g),body:iw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?Jv(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&je(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?he(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=he(e.data),d=he(c.payload),p=je(d.content)||je(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:je(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=he(e.data),d=he(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=he(e.data),d=he(c.task),p=he(d.currentPlan),g=he(c.update),m=je(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:je(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=he(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:je(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=he(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"?Ic(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=he(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Xp(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=he(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=DD(c.requestId),p=he(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const l=he(e.data),r=l.method,u=he(l.params);if(r==="item/started"){const c=he(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:Ic(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=he(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:Ic(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=Gp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function dD(e){if(e.event!=="codex.notification")return null;const i=he(e.data),l=i.method;if(l!=="item/started"&&l!=="item/completed")return null;const r=he(i.params),u=he(r.item),c=typeof u.type=="string"?u.type:"item";if(tw(c)||dw(u))return null;const d=l==="item/completed",p=he(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?nw(g,d,p):d?`Finished ${Aa(c)}`:`Working on ${Aa(c)}`,body:g?iw(g,p):aw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?pD(u):"running",topicAction:g==="seele_topics"?Jv(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&je(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?he(p.payload):void 0}}function Jv(e){return e==="read"||e==="history"||e==="send"?e:void 0}function fD(e){if(ow(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=wE(e);return i?{id:e.id,kind:"activity",title:sw(i),body:ew(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function ew(e){const i=he(e);for(const l of["title","message","description","status","reason"])if(typeof i[l]=="string"&&i[l].trim())return rw(i[l].trim(),180);return"Event details are available"}function tw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function pD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Aa(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function nw(e,i,l){if(e==="seele_topics")switch(je(l.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=je(l.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=Aa(e);return i?`Finished ${r}`:`Running ${r}`}function iw(e,i){if(e==="seele_topics"){const l=je(i.topicId);return l?`Topic ${Na(l)}`:"Topic"}if(e==="seele_wakeup")return je(i.instruction)||(je(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const l=je(i.type)||"workspace";return lw(l,he(i.payload))}return Aa(e)}function lw(e,i){return e==="responsibility"?je(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function aw(e,i){for(const l of["title","name","description","text","summary"])if(typeof e[l]=="string"&&e[l].trim())return ds(e[l].trim(),160);return typeof e.id=="string"?`${Aa(i)} ${Na(e.id)}`:Aa(i)}function hD(e){var l;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(l=e.meta)==null?void 0:l.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function mD(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function gD(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 l=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return l?`Exit code: ${l[1]}`:i==="failed"?"Command failed.":"Command completed."}function yD(e,i){const l=e.split(/\r?\n/),u=l.slice(0,i).join(`
118
+ `);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=he(e.data);if(je(c.actionType)==="seele_workspace_change"){const p=he(c.payload),g=he(p.payload),m=je(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:aw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=CE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=SE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=he(e.data),d=he(c.params),p=je(d.tool)||"dynamic tool",g=he(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:iw(p,!1,g),body:lw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:je(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?ew(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&je(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?he(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=he(e.data),d=he(c.payload),p=je(d.content)||je(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:je(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=he(e.data),d=he(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=he(e.data),d=he(c.task),p=he(d.currentPlan),g=he(c.update),m=je(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:je(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=he(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:je(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=he(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"?Uc(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=he(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Zp(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=he(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=MD(c.requestId),p=he(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const l=he(e.data),r=l.method,u=he(l.params);if(r==="item/started"){const c=he(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:Uc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=Vp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=he(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:Uc(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=Vp(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:je(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function hD(e){if(e.event!=="codex.notification")return null;const i=he(e.data),l=i.method;if(l!=="item/started"&&l!=="item/completed")return null;const r=he(i.params),u=he(r.item),c=typeof u.type=="string"?u.type:"item";if(nw(c)||fw(u))return null;const d=l==="item/completed",p=he(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?iw(g,d,p):d?`Finished ${Aa(c)}`:`Working on ${Aa(c)}`,body:g?lw(g,p):rw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?gD(u):"running",topicAction:g==="seele_topics"?ew(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&je(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?he(p.payload):void 0}}function ew(e){return e==="read"||e==="history"||e==="send"?e:void 0}function mD(e){if(uw(e)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.workspace_change.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(e.event))return null;const i=jE(e);return i?{id:e.id,kind:"activity",title:ow(i),body:tw(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function tw(e){const i=he(e);for(const l of["title","message","description","status","reason"])if(typeof i[l]=="string"&&i[l].trim())return sw(i[l].trim(),180);return"Event details are available"}function nw(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function gD(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function Aa(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function iw(e,i,l){if(e==="seele_topics")switch(je(l.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=je(l.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=Aa(e);return i?`Finished ${r}`:`Running ${r}`}function lw(e,i){if(e==="seele_topics"){const l=je(i.topicId);return l?`Topic ${Na(l)}`:"Topic"}if(e==="seele_wakeup")return je(i.instruction)||(je(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const l=je(i.type)||"workspace";return aw(l,he(i.payload))}return Aa(e)}function aw(e,i){return e==="responsibility"?je(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function rw(e,i){for(const l of["title","name","description","text","summary"])if(typeof e[l]=="string"&&e[l].trim())return fs(e[l].trim(),160);return typeof e.id=="string"?`${Aa(i)} ${Na(e.id)}`:Aa(i)}function yD(e){var l;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(l=e.meta)==null?void 0:l.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 bD(e,i){var r;if(i==="running")return"Command is still running.";if(i==="approval")return"Waiting for approval before running.";if(i==="stopped")return"Command was stopped.";const l=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return l?`Exit code: ${l[1]}`:i==="failed"?"Command failed.":"Command completed."}function vD(e,i){const l=e.split(/\r?\n/),u=l.slice(0,i).join(`
119
119
  `);return l.length>i?`${u}
120
- ...`:u}function xD(e,i){return e?e.split(/\r?\n/).filter(l=>l.trim()).length>i:!1}function Pc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function bD(e){const i=e.trim();return!i||i.includes(`
121
- `)?null:ds(i,120)}function ds(e,i){if(e.length<=i)return e;const l=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,l)}...${e.slice(-l)}`}function rw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function sw(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function ow(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=he(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 ${Na(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=he(e.data);return{id:e.id,title:"Codex compacting context",detail:Xp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=he(e.data);return{id:e.id,title:"Codex context compacted",detail:Xp(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=he(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=he(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?ds(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=he(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=he(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?ds(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const l=he(e.data),r=l.method,u=he(l.params);if(r==="item/started"||r==="item/completed"){const c=he(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:ds(Ic(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=dw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:ds(g,96),createdAt:i,tone:p?"done":"running"};if(!tw(d))return{id:e.id,title:p?`Finished ${Aa(d)}`:`Working on ${Aa(d)}`,detail:aw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=he(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=he(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?hs(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=he(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${nb(d)}`:`Finished ${nb(d)}`,detail:typeof c.durationMs=="number"?hs(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Xp(e,i){const l=Yc(e.before),r=Yc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${hs(c)}`)}else u.push("Codex triggered");if(l&&r){u.push(`context ${dr(l)} → ${dr(r)}`);const c=l.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Eh(c)} tokens`)}else l&&u.push(`context ${dr(l)}`);return u.join(" · ")}function vD(e){const i=Yc(e.before),l=Yc(e.after),r=i&&l?i.totalTokens-l.totalTokens:null;let u="Unavailable";return i&&l?u=`${dr(i)} → ${dr(l)}`:i?u=`${dr(i)} → unavailable`:l&&(u=`unavailable → ${dr(l)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":hs(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Eh(r)} tokens`:"No decrease observed"}]}function Yc(e){const i=he(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function dr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Eh(e.totalTokens)} tokens`}function Eh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function wD(e){let i=null;for(const l of e)for(const r of l.events){const u=SD(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function tb(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.updatedAt)>Date.parse(i.updatedAt))?l:i,null)}function kD(e){let i=null;for(const l of e){const r=uw(l);r&&(!i||Yo(l,i)>0)&&(i=r)}return i}function uw(e){if(e.event!=="codex.notification")return null;const i=he(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const l=he(i.params),r=he(l.tokenUsage),u=he(r.last),c=he(r.total),d=Object.keys(u).length>0?u:c,p=pi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:pi(d.inputTokens),cachedInputTokens:pi(d.cachedInputTokens),outputTokens:pi(d.outputTokens),reasoningOutputTokens:pi(d.reasoningOutputTokens),modelContextWindow:pi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function jD(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.createdAt)>Date.parse(i.createdAt))?l:i,null)}function cw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function SD(e){if(e.event!=="codex.notification")return null;const i=he(e.data);if(i.method!=="account/rateLimits/updated")return null;const l=he(i.params),r=he(l.rateLimits),u=[r.primary,r.secondary].map(c=>CD(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function CD(e){const i=he(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 TD(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Ic(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function dw(e){var l;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((l=Gp(e)[0])==null?void 0:l.path)??null}function he(e){return e&&typeof e=="object"?e:{}}function pi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function je(e){return typeof e=="string"?e:""}function fr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function ED(e){const i=he(e),l=he(i.thread);if(!Object.keys(l).length)return null;const r=Array.isArray(l.turns)?l.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const j=he(b),w=je(j.id)||`turn-${x+1}`,T=Array.isArray(j.items)?j.items:[];c+=T.length,u.push(AD(j,w)),T.forEach(M=>{const U=he(M),N=je(U.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(m+=1)})}),{id:je(l.id),sessionId:je(l.sessionId),status:fw(l.status),source:Ah(l.source),cwd:je(l.cwd),path:je(l.path),preview:je(l.preview),createdAt:pi(l.createdAt),updatedAt:pi(l.updatedAt),recencyAt:pi(l.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function AD(e,i){const l=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(l.map(c=>je(he(c).type)).filter(c=>c.length>0))).join(", "),u=ND(l.map(c=>Qp(c)).filter(Boolean).join(" "),220);return{id:i,status:fw(e.status),itemsView:je(e.itemsView)||"unknown",itemCount:l.length,startedAt:pi(e.startedAt),completedAt:pi(e.completedAt),durationMs:pi(e.durationMs),itemTypes:r,preview:u,raw:e}}function Qp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Qp).filter(Boolean).join(`
122
- `);if(!e||typeof e!="object")return"";const i=e,l=je(i.text),r=Qp(i.content);return[l,r].filter(Boolean).join(`
123
- `)}function fw(e){const i=he(e);return je(i.type)||Ah(e)}function ND(e,i){const l=e.replace(/\s+/g," ").trim();return l.length>i?`${l.slice(0,i)}...`:l}function Lo(e){return e===null?"unknown":qe(e*1e3)}function DD(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Ah(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function _D(e){if(typeof e=="string")return e;const i=he(e),l=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return l&&r?`${l}
120
+ ...`:u}function wD(e,i){return e?e.split(/\r?\n/).filter(l=>l.trim()).length>i:!1}function Yc(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function kD(e){const i=e.trim();return!i||i.includes(`
121
+ `)?null:fs(i,120)}function fs(e,i){if(e.length<=i)return e;const l=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,l)}...${e.slice(-l)}`}function sw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function ow(e){const l=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return l?l.charAt(0).toUpperCase()+l.slice(1):"System event"}function uw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=he(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 ${Na(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=he(e.data);return{id:e.id,title:"Codex compacting context",detail:Zp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=he(e.data);return{id:e.id,title:"Codex context compacted",detail:Zp(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=he(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=he(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?fs(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=he(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=he(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?fs(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const l=he(e.data),r=l.method,u=he(l.params);if(r==="item/started"||r==="item/completed"){const c=he(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:fs(Uc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=fw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:fs(g,96),createdAt:i,tone:p?"done":"running"};if(!nw(d))return{id:e.id,title:p?`Finished ${Aa(d)}`:`Working on ${Aa(d)}`,detail:rw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=he(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=he(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?ms(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=he(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${ib(d)}`:`Finished ${ib(d)}`,detail:typeof c.durationMs=="number"?ms(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Zp(e,i){const l=Fc(e.before),r=Fc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${ms(c)}`)}else u.push("Codex triggered");if(l&&r){u.push(`context ${dr(l)} → ${dr(r)}`);const c=l.totalTokens-r.totalTokens;c>0&&u.push(`released ~${Nh(c)} tokens`)}else l&&u.push(`context ${dr(l)}`);return u.join(" · ")}function jD(e){const i=Fc(e.before),l=Fc(e.after),r=i&&l?i.totalTokens-l.totalTokens:null;let u="Unavailable";return i&&l?u=`${dr(i)} → ${dr(l)}`:i?u=`${dr(i)} → unavailable`:l&&(u=`unavailable → ${dr(l)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":ms(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${Nh(r)} tokens`:"No decrease observed"}]}function Fc(e){const i=he(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function dr(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${Nh(e.totalTokens)} tokens`}function Nh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function SD(e){let i=null;for(const l of e)for(const r of l.events){const u=ED(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function nb(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.updatedAt)>Date.parse(i.updatedAt))?l:i,null)}function CD(e){let i=null;for(const l of e){const r=cw(l);r&&(!i||Fo(l,i)>0)&&(i=r)}return i}function cw(e){if(e.event!=="codex.notification")return null;const i=he(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const l=he(i.params),r=he(l.tokenUsage),u=he(r.last),c=he(r.total),d=Object.keys(u).length>0?u:c,p=pi(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:pi(d.inputTokens),cachedInputTokens:pi(d.cachedInputTokens),outputTokens:pi(d.outputTokens),reasoningOutputTokens:pi(d.reasoningOutputTokens),modelContextWindow:pi(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function TD(...e){return e.reduce((i,l)=>l&&(!i||Date.parse(l.createdAt)>Date.parse(i.createdAt))?l:i,null)}function dw(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function ED(e){if(e.event!=="codex.notification")return null;const i=he(e.data);if(i.method!=="account/rateLimits/updated")return null;const l=he(i.params),r=he(l.rateLimits),u=[r.primary,r.secondary].map(c=>AD(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function AD(e){const i=he(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 ND(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Uc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function fw(e){var l;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((l=Vp(e)[0])==null?void 0:l.path)??null}function he(e){return e&&typeof e=="object"?e:{}}function pi(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function je(e){return typeof e=="string"?e:""}function fr(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function DD(e){const i=he(e),l=he(i.thread);if(!Object.keys(l).length)return null;const r=Array.isArray(l.turns)?l.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const j=he(b),w=je(j.id)||`turn-${x+1}`,E=Array.isArray(j.items)?j.items:[];c+=E.length,u.push(_D(j,w)),E.forEach(M=>{const I=he(M),N=je(I.type);N==="userMessage"?d+=1:N==="agentMessage"?p+=1:N==="compaction"?g+=1:N==="contextCompaction"&&(m+=1)})}),{id:je(l.id),sessionId:je(l.sessionId),status:pw(l.status),source:Dh(l.source),cwd:je(l.cwd),path:je(l.path),preview:je(l.preview),createdAt:pi(l.createdAt),updatedAt:pi(l.updatedAt),recencyAt:pi(l.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function _D(e,i){const l=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(l.map(c=>je(he(c).type)).filter(c=>c.length>0))).join(", "),u=RD(l.map(c=>Jp(c)).filter(Boolean).join(" "),220);return{id:i,status:pw(e.status),itemsView:je(e.itemsView)||"unknown",itemCount:l.length,startedAt:pi(e.startedAt),completedAt:pi(e.completedAt),durationMs:pi(e.durationMs),itemTypes:r,preview:u,raw:e}}function Jp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Jp).filter(Boolean).join(`
122
+ `);if(!e||typeof e!="object")return"";const i=e,l=je(i.text),r=Jp(i.content);return[l,r].filter(Boolean).join(`
123
+ `)}function pw(e){const i=he(e);return je(i.type)||Dh(e)}function RD(e,i){const l=e.replace(/\s+/g," ").trim();return l.length>i?`${l.slice(0,i)}...`:l}function Io(e){return e===null?"unknown":qe(e*1e3)}function MD(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Dh(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function OD(e){if(typeof e=="string")return e;const i=he(e),l=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return l&&r?`${l}
124
124
 
125
- ${r}`:l||r||Ah(e)}function nb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function hs(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ap(e){if(e<6e4)return hs(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60),r=i%60;return r===0?`${l}h`:`${l}h ${r}m`}function pw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function Uc(e){return e===null?"unknown":Un(e)}function ed(e){return Math.max(0,Math.min(100,Math.round(e)))}function Nh(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function hw(e){return qe(e*1e3)}function qe(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const l={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",l).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 Wo(e){const i=qe(e);return i?`${i} UTC+08:00`:""}function RD(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 ib(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function lb(e,i){const l=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return l?`${l.displayName}${l.isDefault?" (default)":""}`:e||"Unavailable"}function td(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Zp(e,i){const l=td(e);return i?`${l} (${qe(i)})`:l}function MD(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(td(e))}`}function OD(e,i){const l=ab(e),r=ab(i);if(!l||!r)return!1;for(let u=0;u<l.core.length;u+=1)if(l.core[u]!==r.core[u])return l.core[u]>r.core[u];return l.prerelease===r.prerelease?!1:l.prerelease?r.prerelease?l.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function ab(e){if(!e)return null;const i=td(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 zD(e,i){const l=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&l.push({value:i,label:`${i} (unavailable)`}),l.length===0&&l.push({value:"",label:"Models unavailable"}),l}async function Np(e,i){const l=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await l.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
125
+ ${r}`:l||r||Dh(e)}function ib(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function ms(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Np(e){if(e<6e4)return ms(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const l=Math.floor(i/60),r=i%60;return r===0?`${l}h`:`${l}h ${r}m`}function hw(e){return`${Math.round(e)}%`}function Un(e){return new Intl.NumberFormat("en-US").format(e)}function Bc(e){return e===null?"unknown":Un(e)}function td(e){return Math.max(0,Math.min(100,Math.round(e)))}function _h(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function mw(e){return qe(e*1e3)}function qe(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const l={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",l).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 Ko(e){const i=qe(e);return i?`${i} UTC+08:00`:""}function zD(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 lb(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function ab(e,i){const l=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return l?`${l.displayName}${l.isDefault?" (default)":""}`:e||"Unavailable"}function nd(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function eh(e,i){const l=nd(e);return i?`${l} (${qe(i)})`:l}function LD(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(nd(e))}`}function ID(e,i){const l=rb(e),r=rb(i);if(!l||!r)return!1;for(let u=0;u<l.core.length;u+=1)if(l.core[u]!==r.core[u])return l.core[u]>r.core[u];return l.prerelease===r.prerelease?!1:l.prerelease?r.prerelease?l.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function rb(e){if(!e)return null;const i=nd(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 UD(e,i){const l=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&l.push({value:i,label:`${i} (unavailable)`}),l.length===0&&l.push({value:"",label:"Models unavailable"}),l}async function Dp(e,i){const l=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await l.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
126
126
 
127
- `);u=p.pop()??"";for(const g of p){const m=LD(g);m&&i(m)}}}function LD(e){const i=e.split(`
127
+ `);u=p.pop()??"";for(const g of p){const m=BD(g);m&&i(m)}}}function BD(e){const i=e.split(`
128
128
  `),l=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!l||r.length===0)return null;const u=l.slice(7),c=r.join(`
129
- `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function ID(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 l=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return l?{text:l,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 UD(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"?null:{itemId:l.id,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function BD(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"||!l.text?null:{itemId:l.id,text:l.text,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function us(e){var l,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=(l=i.params)==null?void 0:l.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 fs(e){return e.length<=6?e:e.slice(0,6)}function Na(e){return e.slice(0,8)}function rb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function sb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function Dp(e,...i){return i.includes(e)}function qD(e,i){const l=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(l)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-l)/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 HD(e,i){const l=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(l)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-l)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function Jp(e,i){var l;return i==="running"||i==="error"?i:((l=e==null?void 0:e.nextWakeup)==null?void 0:l.status)==="scheduled"?"waiting":i}function $D(e,i){return`waiting ${Fc(e,i)}`}function Fc(e,i){const l=Date.parse(e.wakeAt);if(Number.isNaN(l))return"waiting";const r=Math.max(0,Math.ceil((l-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 Bc(e,i=null,l=Date.now()){if(e==="waiting")return i?$D(i,l):"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 ob(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function GD(e){return e==="assistant"?"Seele":"You"}const VD=document.getElementById("root"),mw=window.__seeleCodexRoot??qk.createRoot(VD);window.__seeleCodexRoot=mw;i_();mw.render(s.jsx(D.StrictMode,{children:s.jsx(PD,{})}));function PD(){const[e,i]=D.useState(null),[l,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState("admin"),[g,m]=D.useState(""),[b,x]=D.useState(!1),[j,w]=D.useState("");D.useEffect(()=>{ub().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),D.useEffect(()=>{let N=!1,H=0;const $=async()=>{try{const W=await XD();if(N)return;r(W),c(""),H=window.setTimeout($,W.status==="authorized"&&W.configurationReady?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),H=window.setTimeout($,3e3)}};return $(),()=>{N=!0,window.clearTimeout(H)}},[]),D.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),m(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Pp,N),()=>window.removeEventListener(Pp,N)},[]);async function T(N){N.preventDefault(),x(!0),w("");try{const H=await fetch(pe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!H.ok){w(H.status===401?"Incorrect username or password.":H.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}m(""),i(await ub())}catch{w("Unable to reach Seele.")}finally{x(!1)}}async function M(){await fetch(pe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const U=WD();if(U&&e&&(!e.enabled||e.authenticated)){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return N.role!=="admin"?s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-access-denied",children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Administrator access required"}),s.jsx("p",{children:"This page changes deployment authorization."}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("a",{href:vh(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void M(),type:"button",children:"Sign out"})]})]})}):s.jsx(FD,{authorization:l,currentUser:N,onLogout:M})}if(!U&&l&&(l.status!=="authorized"||!l.configurationReady))return s.jsx(YD,{authorization:l});if(!e||!l&&!U)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(aA,{authEnabled:e.enabled,currentUser:N,onLogout:M})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:T,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>p(N.target.value),value:d})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>m(N.target.value),type:"password",value:g})]}),j?s.jsx("p",{className:"auth-error",role:"alert",children:j}):null,s.jsx("button",{disabled:b||!d||!g,type:"submit",children:b?"Signing in...":"Sign in"})]})]})})}function YD({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."}},l=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration 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:l.title}),s.jsx("p",{className:"deployment-lead",children:l.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?eh(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]})]}),e.lastError||e.configurationError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError}):null,s.jsx("a",{className:"deployment-primary-link",href:KD(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function FD({authorization:e,currentUser:i,onLogout:l}){const[r,u]=D.useState([]),[c,d]=D.useState({}),[p,g]=D.useState(null),[m,b]=D.useState(!0),[x,j]=D.useState("");D.useEffect(()=>{let T=!1,M=0;const U=async()=>{try{const N=await QD();if(T)return;u(N),d(H=>Object.fromEntries(N.map($=>[$.deploymentId,H[$.deploymentId]??$.name]))),j("")}catch(N){T||j(Ve(N).message)}finally{T||(b(!1),M=window.setTimeout(U,5e3))}};return U(),()=>{T=!0,window.clearTimeout(M)}},[]);async function w(T,M){g(T),j("");try{const U=await ZD(T,M);u(N=>N.map(H=>H.deploymentId===U.deploymentId?U:H)),d(N=>({...N,[U.deploymentId]:U.name}))}catch(U){j(Ve(U).message)}finally{g(null)}}return s.jsxs("main",{className:"deployment-admin-shell",children:[s.jsxs("header",{className:"deployment-admin-header",children:[s.jsxs("div",{children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Deployments"}),s.jsx("p",{children:"Authorize or revoke Seele instances connected to this cloud deployment."})]}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("span",{children:i.username}),s.jsx("a",{href:vh(),children:"Open Seele"}),s.jsx("button",{onClick:()=>void l(),type:"button",children:"Sign out"})]})]}),s.jsxs("section",{className:"deployment-admin-summary",children:[s.jsxs("div",{children:[s.jsx("strong",{children:r.length}),s.jsx("span",{children:"Total"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="pending").length}),s.jsx("span",{children:"Pending"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="authorized").length}),s.jsx("span",{children:"Authorized"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(T=>T.status==="revoked").length}),s.jsx("span",{children:"Revoked"})]})]}),e?s.jsxs("p",{className:"deployment-cloud-identity",children:["This cloud: ",s.jsx("code",{children:e.deploymentId})]}):null,x?s.jsx("p",{className:"deployment-error",role:"alert",children:x}):null,m?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!m&&r.length===0?s.jsx("p",{className:"deployment-admin-empty",children:"No deployment has contacted this cloud yet."}):null,s.jsx("div",{className:"deployment-list",children:r.map(T=>{const M=p===T.deploymentId,U=c[T.deploymentId]??T.name;return s.jsxs("article",{className:"deployment-card",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("span",{className:`deployment-status is-${T.status}`,children:T.status}),s.jsx("h2",{children:T.name}),s.jsx("code",{children:T.deploymentId})]}),s.jsx("button",{className:T.status==="authorized"?"is-danger":"is-primary",disabled:M,onClick:()=>void w(T.deploymentId,{status:T.status==="authorized"?"revoked":"authorized"}),type:"button",children:M?"Saving...":T.status==="authorized"?"Revoke":"Authorize"})]}),s.jsxs("dl",{className:"deployment-card-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Version"}),s.jsx("dd",{children:T.version})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last seen"}),s.jsx("dd",{children:eh(T.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:eh(T.firstSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsx("dd",{children:T.appliedGlobalRevision})]})]}),s.jsxs("form",{className:"deployment-name-form",onSubmit:N=>{N.preventDefault(),w(T.deploymentId,{name:U})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:M,maxLength:80,onChange:N=>d(H=>({...H,[T.deploymentId]:N.target.value})),value:U})]}),s.jsx("button",{disabled:M||!U.trim()||U.trim()===T.name,type:"submit",children:"Save name"})]})]},T.deploymentId)})})]})}function WD(){const e=vh("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function KD(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function eh(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function XD(){const e=await fetch(pe("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function QD(){const e=pe("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).deployments}async function ZD(e,i){const l=pe(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:l});return(await r.json()).deployment}async function ub(){const e=await fetch(pe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function JD(){const e=pe("admin/users"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).users}async function e_(e){const i=pe("admin/users"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!l.ok)throw await Gt(l,{method:"POST",url:i});return(await l.json()).user}async function t_(e,i){const l=pe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:l});return(await r.json()).user}async function n_(e){const i=pe(`admin/users/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});if(!l.ok)throw await Gt(l,{method:"DELETE",url:i})}function i_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const l=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return l.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Pp)),l},window.__seeleAuthFetchInstalled=!0}export{jt as _,Hk as a,ij as b,fx as c,Jk as f,cb as g,nj as h,ih as s,Yk as w};
129
+ `);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function qD(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 l=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return l?{text:l,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 HD(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"?null:{itemId:l.id,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function $D(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const l=(r=i.params)==null?void 0:r.item;return(l==null?void 0:l.type)!=="agentMessage"&&(l==null?void 0:l.type)!=="plan"||!l.text?null:{itemId:l.id,text:l.text,phase:l.type==="plan"?"final_answer":l.phase==="commentary"||l.phase==="final_answer"?l.phase:"unknown"}}function cs(e){var l,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=(l=i.params)==null?void 0:l.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 ps(e){return e.length<=6?e:e.slice(0,6)}function Na(e){return e.slice(0,8)}function sb(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function ob(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function _p(e,...i){return i.includes(e)}function GD(e,i){const l=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(l)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-l)/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 VD(e,i){const l=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(l)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-l)/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 th(e,i){var l;return i==="running"||i==="error"?i:((l=e==null?void 0:e.nextWakeup)==null?void 0:l.status)==="scheduled"?"waiting":i}function PD(e,i){return`waiting ${Wc(e,i)}`}function Wc(e,i){const l=Date.parse(e.wakeAt);if(Number.isNaN(l))return"waiting";const r=Math.max(0,Math.ceil((l-i)/1e3));if(r<60)return`${r}s`;const u=Math.ceil(r/60);if(u<60)return`${u}m`;const c=Math.ceil(u/60);return c<24?`${c}h`:`${Math.ceil(c/24)}d`}function qc(e,i=null,l=Date.now()){if(e==="waiting")return i?PD(i,l):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function ub(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function YD(e){return e==="assistant"?"Seele":"You"}const FD=document.getElementById("root"),gw=window.__seeleCodexRoot??$k.createRoot(FD);window.__seeleCodexRoot=gw;a_();gw.render(s.jsx(D.StrictMode,{children:s.jsx(WD,{})}));function WD(){const[e,i]=D.useState(null),[l,r]=D.useState(null),[u,c]=D.useState(""),[d,p]=D.useState("admin"),[g,m]=D.useState(""),[b,x]=D.useState(!1),[j,w]=D.useState("");D.useEffect(()=>{cb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),w("Unable to reach Seele.")})},[]),D.useEffect(()=>{let N=!1,H=0;const $=async()=>{try{const oe=await yw();if(N)return;r(oe),c(""),H=window.setTimeout($,oe.status==="authorized"&&oe.configurationReady&&oe.codexAccountsReady?3e4:3e3)}catch{if(N)return;c("Unable to reach Seele."),H=window.setTimeout($,3e3)}},W=()=>{window.clearTimeout(H),$()};return window.addEventListener(Fp,W),$(),()=>{N=!0,window.clearTimeout(H),window.removeEventListener(Fp,W)}},[]),D.useEffect(()=>{const N=()=>{i({enabled:!0,authenticated:!1,user:null}),m(""),w("Your session has expired. Sign in again.")};return window.addEventListener(Yp,N),()=>window.removeEventListener(Yp,N)},[]);async function E(N){N.preventDefault(),x(!0),w("");try{const H=await fetch(pe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:d,password:g})});if(!H.ok){w(H.status===401?"Incorrect username or password.":H.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}m(""),i(await cb())}catch{w("Unable to reach Seele.")}finally{x(!1)}}async function M(){await fetch(pe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}const I=QD();if(I&&e&&(!e.enabled||e.authenticated)){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return N.role!=="admin"?s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-access-denied",children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Administrator access required"}),s.jsx("p",{children:"This page changes deployment authorization."}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("a",{href:kh(),children:"Back to Seele"}),s.jsx("button",{onClick:()=>void M(),type:"button",children:"Sign out"})]})]})}):s.jsx(XD,{authorization:l,currentUser:N,onLogout:M})}if(!I&&l&&(l.status!=="authorized"||!l.configurationReady||!l.codexAccountsReady))return s.jsx(KD,{authorization:l});if(!e||!l&&!I)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:u||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(sA,{authEnabled:e.enabled,currentUser:N,onLogout:M})}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:E,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>p(N.target.value),value:d})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>m(N.target.value),type:"password",value:g})]}),j?s.jsx("p",{className:"auth-error",role:"alert",children:j}):null,s.jsx("button",{disabled:b||!d||!g,type:"submit",children:b?"Signing in...":"Sign in"})]})]})})}function KD({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."}},l=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:l.title}),s.jsx("p",{className:"deployment-lead",children:l.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?nh(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:ZD(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function XD({authorization:e,currentUser:i,onLogout:l}){const[r,u]=D.useState([]),[c,d]=D.useState({}),[p,g]=D.useState(null),[m,b]=D.useState(!0),[x,j]=D.useState("");D.useEffect(()=>{let E=!1,M=0;const I=async()=>{try{const N=await JD();if(E)return;u(N),d(H=>Object.fromEntries(N.map($=>[$.deploymentId,H[$.deploymentId]??$.name]))),j("")}catch(N){E||j(Ve(N).message)}finally{E||(b(!1),M=window.setTimeout(I,5e3))}};return I(),()=>{E=!0,window.clearTimeout(M)}},[]);async function w(E,M){g(E),j("");try{const I=await e_(E,M);u(N=>N.map(H=>H.deploymentId===I.deploymentId?I:H)),d(N=>({...N,[I.deploymentId]:I.name}))}catch(I){j(Ve(I).message)}finally{g(null)}}return s.jsxs("main",{className:"deployment-admin-shell",children:[s.jsxs("header",{className:"deployment-admin-header",children:[s.jsxs("div",{children:[s.jsx("p",{className:"deployment-kicker",children:"Seele Cloud"}),s.jsx("h1",{children:"Deployments"}),s.jsx("p",{children:"Authorize or revoke Seele instances connected to this cloud deployment."})]}),s.jsxs("div",{className:"deployment-page-actions",children:[s.jsx("span",{children:i.username}),s.jsx("a",{href:kh(),children:"Open Seele"}),s.jsx("button",{onClick:()=>void l(),type:"button",children:"Sign out"})]})]}),s.jsxs("section",{className:"deployment-admin-summary",children:[s.jsxs("div",{children:[s.jsx("strong",{children:r.length}),s.jsx("span",{children:"Total"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(E=>E.status==="pending").length}),s.jsx("span",{children:"Pending"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(E=>E.status==="authorized").length}),s.jsx("span",{children:"Authorized"})]}),s.jsxs("div",{children:[s.jsx("strong",{children:r.filter(E=>E.status==="revoked").length}),s.jsx("span",{children:"Revoked"})]})]}),e?s.jsxs("p",{className:"deployment-cloud-identity",children:["This cloud: ",s.jsx("code",{children:e.deploymentId})]}):null,x?s.jsx("p",{className:"deployment-error",role:"alert",children:x}):null,m?s.jsx("p",{className:"deployment-admin-empty",children:"Loading deployments..."}):null,!m&&r.length===0?s.jsx("p",{className:"deployment-admin-empty",children:"No deployment has contacted this cloud yet."}):null,s.jsx("div",{className:"deployment-list",children:r.map(E=>{const M=p===E.deploymentId,I=c[E.deploymentId]??E.name;return s.jsxs("article",{className:"deployment-card",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("span",{className:`deployment-status is-${E.status}`,children:E.status}),s.jsx("h2",{children:E.name}),s.jsx("code",{children:E.deploymentId})]}),s.jsx("button",{className:E.status==="authorized"?"is-danger":"is-primary",disabled:M,onClick:()=>void w(E.deploymentId,{status:E.status==="authorized"?"revoked":"authorized"}),type:"button",children:M?"Saving...":E.status==="authorized"?"Revoke":"Authorize"})]}),s.jsxs("dl",{className:"deployment-card-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Version"}),s.jsx("dd",{children:E.version})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last seen"}),s.jsx("dd",{children:nh(E.lastSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"First seen"}),s.jsx("dd",{children:nh(E.firstSeenAt)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsx("dd",{children:E.appliedGlobalRevision})]})]}),s.jsxs("form",{className:"deployment-name-form",onSubmit:N=>{N.preventDefault(),w(E.deploymentId,{name:I})},children:[s.jsxs("label",{children:[s.jsx("span",{children:"Display name"}),s.jsx("input",{disabled:M,maxLength:80,onChange:N=>d(H=>({...H,[E.deploymentId]:N.target.value})),value:I})]}),s.jsx("button",{disabled:M||!I.trim()||I.trim()===E.name,type:"submit",children:"Save name"})]})]},E.deploymentId)})})]})}function QD(){const e=kh("admin/deployments").replace(/\/+$/,"");return window.location.pathname.replace(/\/+$/,"")===e}function ZD(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function nh(e){const i=Date.parse(e);return Number.isNaN(i)?e:new Date(i).toLocaleString()}async function yw(){const e=await fetch(pe("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function JD(){const e=pe("admin/deployments"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).deployments}async function e_(e,i){const l=pe(`admin/deployments/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:l});return(await r.json()).deployment}async function cb(){const e=await fetch(pe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function t_(){const e=pe("admin/users"),i=await fetch(e);if(!i.ok)throw await Gt(i,{url:e});return(await i.json()).users}async function n_(e){const i=pe("admin/users"),l=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!l.ok)throw await Gt(l,{method:"POST",url:i});return(await l.json()).user}async function i_(e,i){const l=pe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(l,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Gt(r,{method:"PATCH",url:l});return(await r.json()).user}async function l_(e){const i=pe(`admin/users/${encodeURIComponent(e)}`),l=await fetch(i,{method:"DELETE"});if(!l.ok)throw await Gt(l,{method:"DELETE",url:i})}function a_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const l=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return l.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Yp)),l.status===503&&r.includes("/api/")&&xr(),l},window.__seeleAuthFetchInstalled=!0}function xr(){window.dispatchEvent(new Event(Fp))}export{jt as _,Gk as a,aj as b,hx as c,tj as f,db as g,lj as h,ah as s,Wk as w};